diff --git a/.github/ISSUE_TEMPLATE/default.md b/.github/ISSUE_TEMPLATE/default.md new file mode 100755 index 0000000000..88cd61e83b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/default.md @@ -0,0 +1,27 @@ +--- +name: Issue +about: Report a bug or make a feature request. +title: '' +labels: '' +assignees: '' + +--- + +|Wazuh version|Component|Install type|Install method|Platform| +|---|---|---|---|---| +| X.Y.Z-rev | Wazuh component | Manager/Agent | Packages/Sources | OS version | + + + + diff --git a/.github/ISSUE_TEMPLATE/planned__epic_support_new_oss.md b/.github/ISSUE_TEMPLATE/planned__epic_support_new_oss.md new file mode 100644 index 0000000000..d5956011c5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/planned__epic_support_new_oss.md @@ -0,0 +1,47 @@ +--- +name: 'Planned: Epic support new OSs' +about: Add support for a new OS. +title: Support new OSs - +labels: level/epic, request/operational, type/maintenance +assignees: '' + +--- + +# Description +| Related issue | +|---| +| Issue number | + +| Agent tier | Central components support | OS type | +|-|-|-| +| 1/2/3 | Yes/No | New family/Major/Minor | + +# Specific issues + + +**QA** +- + + +**CppServer** +- + + +**Indexer** +- + + +**DevOps** +- + + +**Dashboard** +- + + +**ThreatIntel** +- + + +**Agent** +- diff --git a/.github/ISSUE_TEMPLATE/planned__specific_support_new_oss.md b/.github/ISSUE_TEMPLATE/planned__specific_support_new_oss.md new file mode 100644 index 0000000000..aa77924aeb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/planned__specific_support_new_oss.md @@ -0,0 +1,100 @@ +--- +name: 'Planned: Specific support new OSs' +about: Test compatibility with new OS. +title: Support new OSs - - +labels: level/task, request/operational, type/maintenance +assignees: '' + +--- + +# Description +| Related issue | Epic issue | +|---|---| +| Issue number | Issue number| + +| Agent tier | Central components support | OS type | +|-|-|-| +| 1/2/3 | Yes/No | New family/Major/Minor | + +# Plan + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/release_manual_tests.md b/.github/ISSUE_TEMPLATE/release_manual_tests.md new file mode 100644 index 0000000000..df15810fbd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/release_manual_tests.md @@ -0,0 +1,54 @@ +--- +name: Release Candidate - Manual tests +about: Report the results after running manual tests for the specified release. +title: Release [WAZUH VERSION] - Manual tests - [TEST NAME] +labels: release/4.3.0 +assignees: '' + +--- + +The following issue aims to run the specified test for the current release candidate, report the results, and open new issues for any encountered errors. + +## Test information +| | | +|-------------------------|--------------------------------------------| +| **Test name** | | +| **Category** | | +| **Deployment option** | | +| **Main release issue** | | +| **Release candidate #** | | + +## Test description +ADD TEST DESCRIPTION HERE + +## Test report procedure + +All test results must have one of the following statuses: +| | | +|---------------------------------|--------------------------------------------| +| :green_circle: | All checks passed. | +| :red_circle: | There is at least one failed result. | +| :yellow_circle: | There is at least one expected failure or skipped test and no failures. | + +Any failing test must be properly addressed with a new issue, detailing the error and the possible cause. + +An extended report of the test results must be attached as a ZIP or TXT file. Please attach any documents, screenshots, or tables to the issue update with the results. This report can be used by the auditors to dig deeper into any possible failures and details. + +## Conclusions + +All tests have been executed and the results can be found [here](). + +| | | | | +|----------------|-------------|---------------------|----------------| +| **Status** | **Test** | **Failure type** | **Notes** | +| | | | | + +All tests have passed and the fails have been reported or justified. Therefore, I conclude that this issue is finished and OK for this release candidate. + +## Auditors validation +The definition of done for this one is the validation of the conclusions and the test results from all auditors. + +All checks from below must be accepted in order to close this issue. + +- [ ] MODULE OWNER +- [ ] EXTRA REVIEWER diff --git a/.github/ISSUE_TEMPLATE/scheduled__support_new_oss.md b/.github/ISSUE_TEMPLATE/scheduled__support_new_oss.md new file mode 100644 index 0000000000..4eaa605d3a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/scheduled__support_new_oss.md @@ -0,0 +1,29 @@ +--- +name: 'Scheduled: Support new OSs' +about: Regularly check for new OS versions during their prerelease stages of development. +title: 'Week # - Support new OSs' +labels: level/task, request/operational, type/maintenance +assignees: '' + +--- + +|Week|Previous issue| +|---|---| +|21|https://github.com/wazuh/wazuh/issues/23311| + +## Description + +This issue aims to regularly check for new OS versions during their prerelease stages of development. + +Each OS must have one of the following check statuses: + +| Check | Description | +|:-:|--------------------------------------------| +| 🟡 | New OS version has been found. | +| ⚫ | No new OS version has been found. | + +Check the current table: + +| OS family | Version | Release date | Estimated frequency | Links | Check | Support OS issue | +|-|-|-|-|-|:-:|-| +| Ubuntu (**_SAMPLE, DELETE_**) | 24.10 | 05/23/2024 | Semester | [Releases](https://wiki.ubuntu.com/Releases) / [Pre-releases](https://wiki.ubuntu.com/Releases#:~:text=mailing%20list.-,Future,-Version)| 🟡 | https://github.com/wazuh/wazuh/issues/23579 | diff --git a/.github/ISSUE_TEMPLATE/system_tests.md b/.github/ISSUE_TEMPLATE/system_tests.md new file mode 100644 index 0000000000..91644da5ab --- /dev/null +++ b/.github/ISSUE_TEMPLATE/system_tests.md @@ -0,0 +1,80 @@ +--- +name: Release Candidate - System tests +about: Report the results after running system tests. +title: Release [WAZUH VERSION] - [STAGE] - System tests +labels: level/task, type/test +assignees: '' + +--- + +The following issue aims to run all `system tests` for the current release candidate, report the results, and open new issues for any encountered errors. + +## System tests information +| | | +|--------------------------------------|--------------------------------------------| +| **Main release candidate issue** | | +| **Version** | | +| **Release candidate #** | | +| **Tag** | | +| **Previous system tests issue** | | + +## Instructions +To run tests in an AWS EC2 virtual environment, the following requirements will need to be met: + +| Environment | EC2 | +|------------------------------|-------------------------------------------| +|Basic_cluster |Ubuntu 22.04.2 LTS C5.XLarge 15GB SSD | +|Big_cluster_40_agents |Ubuntu 22.04.2 LTS T3.Large 60GB SSD | +|Agentless_cluster |Ubuntu 22.04.2 LTS C5a.XLarge 30GB SSD | +|Four_manager_disconnected_node|Ubuntu 22.04.2 LTS T3.Large 30GB SSD | +|One_manager_agent |Ubuntu 22.04.2 LTS T3.Large 30GB SSD | +|Manager_agent |Ubuntu 22.04.2 LTS T3.Large 30GB SSD | +|Enrollment_cluster |Ubuntu 22.04.2 LTS T3.Large 30GB SSD | +|Basic_environment |Ubuntu 22.04.2 LTS T3.Large 30GB SSD | + + +These requirements should be requested to the @wazuh/devel-devops team via https://github.com/wazuh/internal-devel-requests. + +For further information, check https://github.com/wazuh/wazuh-qa/tree/master/tests/system/README.md + +## Test report procedure +All individual test checks must be marked as: +| | | +|---------------------------------|--------------------------------------------| +| Pass | The test ran successfully. | +| Xfail | The test was expected to fail and it failed. It must be properly justified and reported in an issue. | +| Skip | The test was not run. It must be properly justified and reported in an issue. | +| Fail | The test failed. A new issue must be opened to evaluate and address the problem. | + +All test results must have one the following statuses: +| | | +|---------------------------------|--------------------------------------------| +| :green_circle: | All checks passed. | +| :red_circle: | There is at least one failed check. | +| :yellow_circle: | There is at least one expected fail or skipped test and no failures. | + +Any failing test must be properly addressed with a new issue, detailing the error and the possible cause. It must be included in the `Fixes` section of the current release candidate main issue. + +Any expected fail or skipped test must have an issue justifying the reason. All auditors must validate the justification for an expected fail or skipped test. + +An extended report of the test results must be attached as a zip or txt. This report can be used by the auditors to dig deeper into any possible failures and details. + +## Conclusions + + + +## Auditors validation +The definition of done for this one is the validation of the conclusions and the test results from all auditors. + +All checks from below must be accepted in order to close this issue. + +- [ ] @wazuh/devel-qa-release diff --git a/.github/ISSUE_TEMPLATE/workload_benchmarks_metrics.md b/.github/ISSUE_TEMPLATE/workload_benchmarks_metrics.md new file mode 100644 index 0000000000..b1dc8f116e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/workload_benchmarks_metrics.md @@ -0,0 +1,67 @@ +--- +name: Release Candidate - Workload benchmarks metrics +about: Report the workload benchmarks metrics. +title: Release [WAZUH VERSION] - Release Candidate [RC VERSION] - Workload benchmarks + metrics +labels: '' +assignees: '' + +--- + +The following issue aims to run all `workload benchmarks` for the current release candidate, report the results, and open new issues for any encountered errors. + +## Workload benchmarks metrics information +| | | +|-----------------------------------------------|--------------------------------------------| +| **Main release candidate issue** | | +| **Version** | | +| **Release candidate #** | | +| **Tag** | | +| **Previous Workload benchmarks metrics issue**| | + +## Test configuration +All tests will be run and workload performance metrics will be obtained for the following clustered environment configurations: + +| | | +|-------------------|--------------------| +| **# Agents** | **# Worker nodes** | +| | | + +## Test report procedure +All individual test checks must be marked as: +| | | +|---------------------------------|--------------------------------------------| +| Pass | The test ran successfully. | +| Xfail | The test was expected to fail and it failed. It must be properly justified and reported in an issue. | +| Skip | The test was not run. It must be properly justified and reported in an issue. | +| Fail | The test failed. A new issue must be opened to evaluate and address the problem. | + +All test results must have one the following statuses: +| | | +|---------------------------------|--------------------------------------------| +| :green_circle: | All checks passed. | +| :red_circle: | There is at least one failed check. | +| :yellow_circle: | There is at least one expected fail or skipped test and no failures. | + +Any failing test must be properly addressed with a new issue, detailing the error and the possible cause. It must be included in the `Fixes` section of the current release candidate main issue. + +Any expected fail or skipped test must have an issue justifying the reason. All auditors must validate the justification for an expected fail or skipped test. + +An extended report of the test results must be attached as a zip or txt. This report can be used by the auditors to dig deeper into any possible failures and details. + +## Conclusions + + + +## Auditors validation +The definition of done for this one is the validation of the conclusions and the test results from all auditors. + +All checks from below must be accepted in order to close this issue. + +- [ ] diff --git a/.github/ISSUE_TEMPLATE/wpk_upgrade_tests.md b/.github/ISSUE_TEMPLATE/wpk_upgrade_tests.md new file mode 100644 index 0000000000..237db48447 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/wpk_upgrade_tests.md @@ -0,0 +1,205 @@ +--- +name: Release Candidate - WPK upgrade tests +about: Report the results after upgrade agent via WPK. +title: Release [WAZUH VERSION] - Release Candidate [RC VERSION] - WPK upgrade tests +labels: '' +assignees: '' + +--- + +The following issue aims to run `upgrade WPK tests` for the current release candidate, report the results, and open new issues for any encountered errors. + +## WPK upgrade tests information + +|Main RC issue|Version|Release candidate|Tag|Previous issue| +|---|---|---|---|---| +|||||| + +## Test report procedure +All individual test checks must be marked as: +| | | +|---------------------------------|--------------------------------------------| +| Pass | The test ran successfully. | +| Xfail | The test was expected to fail and it failed. It must be properly justified and reported in an issue. | +| Skip | The test was not run. It must be properly justified and reported in an issue. | +| Fail | The test failed. A new issue must be opened to evaluate and address the problem. | + +All test results must have one the following statuses: +| | | +|---------------------------------|--------------------------------------------| +| :green_circle: | All checks passed. | +| :red_circle: | There is at least one failed check. | +| :yellow_circle: | There is at least one expected fail or skipped test and no failures. | + +Any failing test must be properly addressed with a new issue, detailing the error and the possible cause. It must be included in the `Fixes` section of the current release candidate main issue. + +Any expected fail or skipped test must have an issue justifying the reason. All auditors must validate the justification for an expected fail or skipped test. + +An extended report of the test results must be attached as a zip or txt. This report can be used by the auditors to dig deeper into any possible failures and details. + +## Tests + +To evaluate this feature, it is necessary to test upgrading the agent and also the case when the upgrade fails (rollback). The `tree` command will be used to compare, before and after the upgrade/rollback process, and check that the presence, ownership and permissions of the files and directories are expected. + +Wazuh versions to test (Upgrade to the current agent version): +### Linux + +|OS|Version|Status|Upgrade fail|Upgrade OK| +|----|-----|------|---------------|------------------| +|CentOS 6|3.6| | | | | +|CentOS 6|3.7| | | | | +|CentOS 6|3.13.3| | | | | +|CentOS 6|4.0.4| | | | | +|CentOS 6|4.1.5| | | | | +|CentOS 6|4.2.7| | | | | +|CentOS 6|4.3.4| | | | | +|CentOS 8|3.6| | | | | +|CentOS 8|3.7| | | | | +|CentOS 8|3.13.3| | | | | +|CentOS 8|4.0.4| | | | | +|CentOS 8|4.1.5| | | | | +|CentOS 8|4.2.7| | | | | +|CentOS 8|4.3.4| | | | | +|Ubuntu 20|3.6| | | | | +|Ubuntu 20|3.7| | | | | +|Ubuntu 20|3.13.3|| | | | +|Ubuntu 20|4.0.4|| | | | +|Ubuntu 20|4.1.5| ||| | +|Ubuntu 20|4.2.7| ||| | +|Ubuntu 20|4.3 || | | +|openSUSE Tumbleweed|3.6| | | | | +|openSUSE Tumbleweed|3.7| | | | | +|openSUSE Tumbleweed|3.13.3|| || | +|openSUSE Tumbleweed|4.0.4|| | || +|openSUSE Tumbleweed|4.1.5|| | || +|openSUSE Tumbleweed|4.2.7|| || | +|openSUSE Tumbleweed|4.3| | | +|Amazon Linux 2|3.6| | | | | +|Amazon Linux 2|3.7| | | | | +|Amazon Linux 2|3.13.3|| || | +|Amazon Linux 2|4.0.4|| | || +|Amazon Linux 2|4.1.5|| | || +|Amazon Linux 2|4.2.7|| || | +|Amazon Linux 2|4.3| | | + +### Windows + +|OS|Version|Status|Upgrade fail|Upgrade OK| +|----|-----|------|---------------|------------------| +|Server 2008|3.6| | | | | +|Server 2008|3.7| | | | | +|Server 2008|3.13.3|| || | +|Server 2008|4.0.4|| | || +|Server 2008|4.1.5|| | || +|Server 2008|4.2.7|| || | +|Server 2008|4.3| | | +|Server 2012 R2|3.6| | | | | +|Server 2012 R2|3.7| | | | | +|Server 2012 R2|3.13.3|| || | +|Server 2012 R2|4.0.4|| | || +|Server 2012 R2|4.1.5|| | || +|Server 2012 R2|4.2.7|| || | +|Server 2012 R2|4.3| | | +|Server 2016|3.6| | | | | +|Server 2016|3.7| | | | | +|Server 2016|3.13.3|| || | +|Server 2016|4.0.4|| | || +|Server 2016|4.1.5|| | || +|Server 2016|4.2.7|| || | +|Server 2016|4.3| | | +|Server 2019|3.6| | | | | +|Server 2019|3.7| | | | | +|Server 2019|3.13.3|| || | +|Server 2019|4.0.4|| | || +|Server 2019|4.1.5|| | || +|Server 2019|4.2.7|| || | +|Server 2019|4.3| | | +|Windows 10|3.6| | | | | +|Windows 10|3.7| | | | | +|Windows 10|3.13.3|| || | +|Windows 10|4.0.4|| | || +|Windows 10|4.1.5|| | || +|Windows 10|4.2.7|| || | +|Windows 10|4.3| | | +|Server 2022|3.6| | | | | +|Server 2022|3.7| | | | | +|Server 2022|3.13.3|| || | +|Server 2022|4.0.4|| | || +|Server 2022|4.1.5|| | || +|Server 2022|4.2.7|| || | +|Server 2022|4.3| | | + +### macOS + +|OS|Version|Status|Upgrade fail|Upgrade OK| +|----|-----------|--------|-------|------------------| +| Sierra |4.3.0| || | | | +| Sierra |4.3.4| || | | | +| Catalina |4.3.0| || | | | +| Catalina |4.3.4| || | | | +| Big Sur |4.3.0| || | | | +| Big Sur |4.3.4| || | | | +| Monterey |4.3.0| || | | | +| Monterey |4.3.4| || | | | + + + + +## Auditors validation +The definition of done for this one is the validation of the conclusions and the test results from all auditors. + +All checks from below must be accepted in order to close this issue. + +- [ ] diff --git a/.github/actions/clang_format/action.yml b/.github/actions/clang_format/action.yml new file mode 100644 index 0000000000..7b5f7e1c8b --- /dev/null +++ b/.github/actions/clang_format/action.yml @@ -0,0 +1,64 @@ +name: "Coding style check" +description: "Validates the Coding style of a given module" + +inputs: + path: + required: true + description: "Path to validate" + default: src/ + id: + required: true + description: "Module identifier, used to name the artifact" + +runs: + using: "composite" + steps: + - name: Dependencies for local execution + if: env.ACT # Only run for local execution + shell: bash + run: | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - + echo "deb http://deb.debian.org/debian/ testing main" >> /etc/apt/sources.conf + sudo apt update + + # Dependencies for testing: + # - clang-format + - name: Install dependencies + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: clang-format + version: 1.0 + + - name: Check Coding style + shell: bash + run: | + + # Don't apply changes, just check + arguments="--dry-run " + + # Retrieve all the source files for the desired module + sourceFiles=$(find ${{ inputs.path }} -type f \( -name "*.cpp" -o -name "*.hpp" \) | tr '\n' ' ') + arguments+="-i $sourceFiles " + + ERRORS_FILE=${{ inputs.path }}/clang_format_errors.txt + clang-format $arguments 2> ${ERRORS_FILE} + + # Check if there are errors + if [ -s "${ERRORS_FILE}" ]; then + echo "---------------------------------" + echo "FAILED: Clang-format check failed" + echo "---------------------------------" + exit 1 + else + echo "---------------------------------" + echo "PASSED: Clang-format check passed" + echo "---------------------------------" + fi + + # Upload errors as an artifact, when failed + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: Clang-format errors - ${{ inputs.id }} + path: ${{ inputs.path }}/clang_format_errors.txt + retention-days: 1 diff --git a/.github/actions/compile/action.yml b/.github/actions/compile/action.yml new file mode 100644 index 0000000000..ff7c41cd70 --- /dev/null +++ b/.github/actions/compile/action.yml @@ -0,0 +1,25 @@ +name: "Compile" +description: "Executes a compilation." + +inputs: + path: + required: true + description: "Path to compile and test" + default: src/ + +runs: + using: "composite" + steps: + - name: Compile + run: | + SRC_FOLDER=$(pwd)/src + + VERSION=$(cat src/VERSION) + echo $VERSION + REVISION=$(cat src/REVISION) + echo $REVISION + + cd ${{ inputs.path }} + mkdir -p build && cd build + cmake -DSRC_FOLDER=${SRC_FOLDER} -DVERSION="$VERSION" -DREVISION="$REVISION" .. && make -j2 + shell: bash diff --git a/.github/actions/compile_and_test/action.yml b/.github/actions/compile_and_test/action.yml new file mode 100644 index 0000000000..6b4477acab --- /dev/null +++ b/.github/actions/compile_and_test/action.yml @@ -0,0 +1,87 @@ +name: "Compile and test" +description: "Executes a compilation and test (optional) routine based on a path. It also validates the right execution with ASAN or Valgrind" + +inputs: + path: + required: true + description: "Path to compile and test" + default: src/ + asan: + required: false + description: "Enable address sanitizer" + default: "false" + test: + required: false + description: "Run tests" + default: "true" + +runs: + using: "composite" + steps: + # Dependencies for testing: + # - valgrind + - name: Install dependencies + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: valgrind + version: 1.0 + + # Dependencies for coverage: + # - lcov + - name: Install dependencies + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: lcov + version: 1.0 + + - name: Compile + run: | + SRC_FOLDER=$(pwd)/src + + VERSION=$(cat src/VERSION) + echo $VERSION + REVISION=$(cat src/REVISION) + echo $REVISION + + cd ${{ inputs.path }} + mkdir -p build && cd build + + if [[ ${{ inputs.test }} == "false" ]]; then + echo "Compiling without tests" + cmake -DSRC_FOLDER=${SRC_FOLDER} -DVERSION="$VERSION" -DREVISION="$REVISION" .. && make -j2 + else + if [[ "${{ inputs.asan }}" != "false" ]]; then + # Compile for ASAN + echo "Compiling for ASAN" + export COMPILATION_FLAGS="-g -fsanitize=address -fsanitize=undefined -fsanitize=leak" + else + # Compile for valgrind and coverage + echo "Compiling for valgrind and coverage" + export COMPILATION_FLAGS="-fprofile-arcs -ftest-coverage -lgcov --coverage" + fi + # Read version and revision file. + cmake -DSRC_FOLDER=${SRC_FOLDER} -DCMAKE_CXX_FLAGS="$COMPILATION_FLAGS" -DUNIT_TEST=ON -DVERSION="$VERSION" -DREVISION="$REVISION" .. && make -j2 + fi + + shell: bash + + - name: Test + run: | + + if [[ ${{ inputs.test }} == "false" ]]; then + echo "Skipping tests" + else + cd ${{ inputs.path }}/build + + if [[ "${{ inputs.asan }}" != "false" ]]; then + # Run for ASAN + echo "Running tests for ASAN" + ctest --output-on-failure + else + # Run for valgrind and coverage + echo "Running tests for valgrind and coverage" + valgrind ctest --output-on-failure + fi + fi + + shell: bash diff --git a/.github/actions/coverage/action.yml b/.github/actions/coverage/action.yml new file mode 100644 index 0000000000..106e73a44a --- /dev/null +++ b/.github/actions/coverage/action.yml @@ -0,0 +1,125 @@ +name: "Coverage" +description: "Calculates the coverage for a module located on a given path" + +inputs: + path: + required: true + description: "Path to the module" + id: + required: true + description: "Module identifier, used to name the artifact" + +runs: + using: "composite" + steps: + - name: Dependencies for local execution + if: env.ACT # Only run for local execution + shell: bash + run: | + + # Update packages + sudo apt-get update + sudo apt-get install -y bc + + # Dependencies for testing: + # - lcov + - name: Install dependencies + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: lcov + version: 1.0 + + # Generate the coverage files + - name: Generate coverage files + shell: bash + run: | + + cd ${{ inputs.path }} + + # Set arguments + arguments="--capture " + + # Set working directory + if [[ -d "build/tests/unit" ]]; then + arguments+="--directory build/tests/unit " + fi + + if [[ -d "build/tests/component" ]]; then + arguments+="--directory build/tests/component " + fi + + # Set output file + arguments+="--output-file build/coverage.info " + + # # Disable branch coverage + arguments+="-rc lcov_branch_coverage=0 " + + # Include test files + include_files="" + for file in $(find src/ include/ -type f -regextype posix-extended -regex ".*/*\.(hpp|cpp|h|c)") + do + if [[ ! "$file" =~ "_generated.h" ]]; then + include_files+="--include=$(pwd)$dir/$file " + fi + done + arguments+="$include_files" + + echo "Executing: lcov $arguments" + lcov $arguments + + # Generate the HTML coverage report + - name: Generate coverage report + shell: bash + run: | + + cd ${{ inputs.path }}/build + + # Generate HTML report + genhtml coverage.info --output-directory coverage_report + + # Upload the coverage report as an artifact + - name: Uploading coverage report + if: always() + uses: actions/upload-artifact@v3 + with: + name: Coverage Report - ${{ inputs.id }} + path: ./${{ inputs.path }}/build/coverage_report + retention-days: 1 + + # Check whether the coverage is greater than 90% both for lines and functions + - name: Validate coverage + shell: bash + run: | + + cd ${{ inputs.path }} + + # Obtain the coverage data + coverageData=($(lcov --list build/coverage.info | tail -n1 | grep -oE '[0-9.]+%')) + + # Check if lines the coverage is greater than 90% + linesCoverage=$(echo "${coverageData[0]}" | sed 's/%//') + echo "Lines coverage is: $linesCoverage %" + if ! (( $(echo "$linesCoverage > 90" | bc -l) )); then + echo "----------------------------------------" + echo "FAILED: Lines coverage is lower than 90%" + echo "----------------------------------------" + exit 1 + else + echo "------------------------------------------" + echo "PASSED: Lines coverage is greater than 90%" + echo "------------------------------------------" + fi + + # Check if functions coverage is greater than 90% + functionsCoverage=$(echo "${coverageData[1]}" | sed 's/%//') + echo "Functions coverage is: $functionsCoverage %" + if ! (( $(echo "$functionsCoverage > 90" | bc -l) )); then + echo "---------------------------------------------" + echo "FAILED: Functions coverage is lower than 90%" + echo "--------------------------------------------" + exit 1 + else + echo "----------------------------------------------" + echo "PASSED: Functions coverage is greater than 90%" + echo "----------------------------------------------" + fi diff --git a/.github/actions/doxygen/action.yml b/.github/actions/doxygen/action.yml new file mode 100644 index 0000000000..dc250552e1 --- /dev/null +++ b/.github/actions/doxygen/action.yml @@ -0,0 +1,72 @@ +name: "Doxygen documentation generartion" +description: "Generates the documentation for a given module" + +inputs: + path: + required: true + description: "Path to the module we want to generate documentation for" + default: src/ + doxygen_config: + required: true + description: "Path to the doxygen configuration file" + default: src/Doxyfile + id: + required: true + description: "Module identifier, used to name the artifact" + +runs: + using: "composite" + steps: + # Dependencies for testing: + # - doxygen + # - graphviz + - name: Install dependencies + uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: doxygen graphviz + version: 1.0 + + - name: Generate documentation + shell: bash + run: | + + # Generate the doxygen configuration file + CONFIG_FILE=${{ inputs.path }}/doxygen_config.cfg + { + cat ${{ inputs.doxygen_config }} + echo "OUTPUT_DIRECTORY = ${{ inputs.path }}/doc" + echo "INPUT = ${{ inputs.path }}" + } > ${CONFIG_FILE} + + # Generate the documentation + sudo dot -c + ERRORS_FILE=${{ inputs.path }}/doxygen_errors.txt + doxygen -s ${CONFIG_FILE} 2> ${ERRORS_FILE} + + # Check if there are errors + if [ -s "${ERRORS_FILE}" ]; then + echo "-----------------------------------------------" + echo "FAILED: Doxygen documentation generation failed" + echo "-----------------------------------------------" + exit 1 + else + echo "----------------------------------------------------" + echo "PASSED: Doxygen documentation generated successfully" + echo "----------------------------------------------------" + fi + + # Upload errors as an artifact, when failed + - uses: actions/upload-artifact@v3 + if: failure() + with: + name: Doxygen errors - ${{ inputs.id }} + path: ${{ inputs.path }}/doxygen_errors.txt + retention-days: 1 + + # Upload the documentation as an artifact, when successful + - uses: actions/upload-artifact@v3 + if: success() + with: + name: Doxygen Documentation - ${{ inputs.id }} + path: ${{ inputs.path }}/doc + retention-days: 1 diff --git a/.github/actions/ghcr_pull_and_push/build_and_push_image_to_ghcr.sh b/.github/actions/ghcr_pull_and_push/build_and_push_image_to_ghcr.sh new file mode 100644 index 0000000000..f24b6198b7 --- /dev/null +++ b/.github/actions/ghcr_pull_and_push/build_and_push_image_to_ghcr.sh @@ -0,0 +1,22 @@ +GITHUB_PUSH_SECRET=$1 +GITHUB_USER=$2 +DOCKER_IMAGE_NAME=$3 +BUILD_CONTEXT=$4 +DOCKERFILE_PATH="$BUILD_CONTEXT/Dockerfile" +if [ -n "$5" ]; then + DOCKER_IMAGE_TAG=$5 +else + exit 1 +fi +GITHUB_REPOSITORY="wazuh/wazuh" +GITHUB_OWNER="wazuh" +IMAGE_ID=ghcr.io/${GITHUB_OWNER}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} +IMAGE_ID=$(echo ${IMAGE_ID} | tr '[A-Z]' '[a-z]') + +# Login to GHCR +echo ${GITHUB_PUSH_SECRET} | docker login https://ghcr.io -u $GITHUB_USER --password-stdin + +# Build image +echo build -t ${IMAGE_ID} -f ${DOCKERFILE_PATH} ${BUILD_CONTEXT} +docker build -t ${IMAGE_ID} -f ${DOCKERFILE_PATH} ${BUILD_CONTEXT} +docker push ${IMAGE_ID} diff --git a/.github/actions/ghcr_pull_and_push/pull_image_from_ghcr.sh b/.github/actions/ghcr_pull_and_push/pull_image_from_ghcr.sh new file mode 100644 index 0000000000..d17c6f45cc --- /dev/null +++ b/.github/actions/ghcr_pull_and_push/pull_image_from_ghcr.sh @@ -0,0 +1,20 @@ +set -x +GITHUB_PUSH_SECRET=$1 +GITHUB_USER=$2 +DOCKER_IMAGE_NAME=$3 +if [ -n "$4" ]; then + DOCKER_IMAGE_TAG="$4" +else + exit 1 +fi +GITHUB_REPOSITORY="wazuh/wazuh" +GITHUB_OWNER="wazuh" +IMAGE_ID=ghcr.io/${GITHUB_OWNER}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} +IMAGE_ID=$(echo ${IMAGE_ID} | tr '[A-Z]' '[a-z]') + +# Login to GHCR +echo ${GITHUB_PUSH_SECRET} | docker login https://ghcr.io -u $GITHUB_USER --password-stdin + +# Pull and rename image +docker pull ${IMAGE_ID} +docker image tag ghcr.io/${GITHUB_OWNER}/${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} ${DOCKER_IMAGE_NAME}:${DOCKER_IMAGE_TAG} diff --git a/.github/actions/ghcr_pull_and_push/retag_image.sh b/.github/actions/ghcr_pull_and_push/retag_image.sh new file mode 100644 index 0000000000..2bd2bb7292 --- /dev/null +++ b/.github/actions/ghcr_pull_and_push/retag_image.sh @@ -0,0 +1,62 @@ +set -x +GITHUB_PUSH_SECRET=$1 +GITHUB_USER=$2 +OLD_TAG=$3 +NEW_TAG=$4 +if [ -n "$5" ]; then + SINGLE_IMAGE="$5" +fi + +IMAGES_LIST=( + "common_wpk_builder" + "compile_windows_agent" + "pkg_deb_agent_builder_i386" + "pkg_deb_agent_builder_amd64" + "pkg_deb_agent_builder_arm64" + "pkg_deb_agent_builder_armhf" + "pkg_deb_manager_builder_amd64" + "pkg_rpm_agent_builder_i386" + "pkg_rpm_agent_builder_amd64" + "pkg_rpm_agent_builder_arm64" + "pkg_rpm_agent_builder_armhf" + "pkg_rpm_manager_builder_amd64" + "pkg_rpm_legacy_builder_i386" + "pkg_rpm_legacy_builder_amd64" +) + +retag_image(){ + DOCKER_IMAGE_NAME="$1" + OLD_TAG="$2" + NEW_TAG="$3" + GITHUB_REPOSITORY="wazuh/wazuh" + GITHUB_OWNER="wazuh" + IMAGE_ID=$(echo "ghcr.io/${GITHUB_OWNER}/${DOCKER_IMAGE_NAME}" | tr '[A-Z]' '[a-z]') + + # Bring old tag + pull_output=$(docker pull ${IMAGE_ID}:${OLD_TAG}) + + if echo "$pull_output" | grep -qi "error"; then + echo "Failed pulling ${IMAGE_ID}:${OLD_TAG}" + exit 1 + else + # Retag + docker tag ${IMAGE_ID}:${OLD_TAG} ${IMAGE_ID}:${NEW_TAG} + # Upload + docker push ${IMAGE_ID}:${NEW_TAG} + docker rmi ${IMAGE_ID}:${OLD_TAG} -f + docker rmi ${IMAGE_ID}:${NEW_TAG} -f + fi +} + +# Login to GHCR +echo ${GITHUB_PUSH_SECRET} | docker login https://ghcr.io -u $GITHUB_USER --password-stdin + +if [ -n "$SINGLE_IMAGE" ]; then + # Retag the image passed as argument + retag_image $SINGLE_IMAGE $OLD_TAG $NEW_TAG +else + # Iterate images list retagging + for DOCKER_IMAGE_NAME in "${IMAGES_LIST[@]}"; do + retag_image $DOCKER_IMAGE_NAME $OLD_TAG $NEW_TAG + done +fi diff --git a/.github/actions/install_build_deps/action.yml b/.github/actions/install_build_deps/action.yml new file mode 100644 index 0000000000..3bcc43aac7 --- /dev/null +++ b/.github/actions/install_build_deps/action.yml @@ -0,0 +1,55 @@ +name: "Install Wazuh build dependencies" +description: "This action installs all the requirements to test and build Wazuh agent/server in Ubuntu Linux" +inputs: + target: + required: true + description: "Wazuh target to decide if install or not custom dependencies" +runs: + using: "composite" + steps: + - name: Update apt-get + shell: bash + run: sudo apt-get update -y + - name: Install tools and libraries + shell: bash + run: sudo apt-get install cppcheck astyle valgrind lcov clang-tools -y + - name: Install mingw + shell: bash + run: | + if [[ "${{ inputs.target }}" == "winagent" ]]; then + sudo apt-get install gcc-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 nsis -y + else + echo "Skipping mingw installation for this target" + fi + - name: Install wine + shell: bash + run: | + if [[ "${{ inputs.target }}" == "winagent" ]]; then + sudo dpkg --add-architecture i386 + sudo mkdir -pm755 /etc/apt/keyrings + sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key + sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources + sudo apt-get update + sudo apt-get install -y --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386 wine-stable-i386 wine-stable-amd64 winehq-stable + else + echo "Skipping wine installation for this target" + fi + - name: Install CMocka + shell: bash + run: | + if [[ "${{ inputs.target }}" == "winagent" ]]; then + echo "Installing CMocka by sources with 'winagent' required flags" + cd /tmp + curl -L https://git.cryptomilk.org/projects/cmocka.git/snapshot/stable-1.1.tar.gz | \ + tar zvx -C /tmp/ && \ + sed -i "s|ON|OFF|g" /tmp/stable-1.1/DefineOptions.cmake && \ + mkdir /tmp/stable-1.1/build && \ + cd /tmp/stable-1.1/build && \ + cmake -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc -DCMAKE_C_LINK_EXECUTABLE=i686-w64-mingw32-ld -DCMAKE_INSTALL_PREFIX=/usr/i686-w64-mingw32/ -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_BUILD_TYPE=Release .. && \ + make && \ + sudo make install && \ + cd $GITHUB_WORKSPACE + else + echo "Installing CMocka directly from apt-get" + sudo apt-get install libcmocka-dev -y + fi diff --git a/.github/actions/test_deploy_macos.sh b/.github/actions/test_deploy_macos.sh new file mode 100644 index 0000000000..218b353fab --- /dev/null +++ b/.github/actions/test_deploy_macos.sh @@ -0,0 +1,140 @@ +#!/bin/bash + +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. + +# Global variables +VERSION="$(sed 's/v//' src/VERSION)" +MAJOR=$(echo "${VERSION}" | cut -dv -f2 | cut -d. -f1) +MINOR=$(echo "${VERSION}" | cut -d. -f2) +SHA="$(git rev-parse --short=7 "$1")" + +WAZUH_MACOS_AGENT_DEPLOYMENT_VARS="/tmp/wazuh_envs" +conf_path="/Library/Ossec/etc/ossec.conf" + +VARS=( "WAZUH_MANAGER" "WAZUH_MANAGER_PORT" "WAZUH_PROTOCOL" "WAZUH_REGISTRATION_SERVER" "WAZUH_REGISTRATION_PORT" "WAZUH_REGISTRATION_PASSWORD" "WAZUH_KEEP_ALIVE_INTERVAL" "WAZUH_TIME_RECONNECT" "WAZUH_REGISTRATION_CA" "WAZUH_REGISTRATION_CERTIFICATE" "WAZUH_REGISTRATION_KEY" "WAZUH_AGENT_NAME" "WAZUH_AGENT_GROUP" "ENROLLMENT_DELAY" ) +VALUES=( "1.1.1.1" "7777" "udp" "2.2.2.2" "8888" "password" "10" "10" "/Library/Ossec/etc/testsslmanager.cert" "/Library/Ossec/etc/testsslmanager.cert" "/Library/Ossec/etc/testsslmanager.key" "test-agent" "test-group" "10" ) +TAGS1=( "
" "" "" "" "" "" "" "" "" "" "" "" "" "" ) +TAGS2=( "
" "" "" "" "" "" "" "" "" "" "" "" "" "" ) +WAZUH_REGISTRATION_PASSWORD_PATH="/Library/Ossec/etc/authd.pass" + +function install_wazuh(){ + + echo "Testing the following variables $1" + + eval "echo \"$1\" > ${WAZUH_MACOS_AGENT_DEPLOYMENT_VARS} && installer -pkg wazuh-agent-${VERSION}-0.commit${SHA}.pkg -target / > /dev/null 2>&1" + +} + +function remove_wazuh () { + + /bin/rm -r /Library/Ossec > /dev/null 2>&1 + /bin/launchctl unload /Library/LaunchDaemons/com.wazuh.agent.plist > /dev/null 2>&1 + /bin/rm -f /Library/LaunchDaemons/com.wazuh.agent.plist > /dev/null 2>&1 + /bin/rm -rf /Library/StartupItems/WAZUH > /dev/null 2>&1 + /usr/bin/dscl . -delete "/Users/wazuh" > /dev/null 2>&1 + /usr/bin/dscl . -delete "/Groups/wazuh" > /dev/null 2>&1 + /usr/sbin/pkgutil --forget com.wazuh.pkg.wazuh-agent > /dev/null 2>&1 + +} + +function test() { + + for i in "${!VARS[@]}"; do + if ( echo "${@}" | grep -q -w "${VARS[i]}" ); then + if [ "${VARS[i]}" == "WAZUH_MANAGER" ] || [ "${VARS[i]}" == "WAZUH_PROTOCOL" ]; then + LIST=( "${VALUES[i]//,/ }" ) + for j in "${!LIST[@]}"; do + if ( grep -q "${TAGS1[i]}${LIST[j]}${TAGS2[i]}" "${conf_path}" ); then + echo "The variable ${VARS[i]} is set correctly" + else + echo "The variable ${VARS[i]} is not set correctly" + exit 1 + fi + done + elif [ "${VARS[i]}" == "WAZUH_REGISTRATION_PASSWORD" ]; then + if ( grep -q "${VALUES[i]}" "${WAZUH_REGISTRATION_PASSWORD_PATH}" ); then + echo "The variable ${VARS[i]} is set correctly" + else + echo "The variable ${VARS[i]} is not set correctly" + exit 1 + fi + else + if ( grep -q "${TAGS1[i]}${VALUES[i]}${TAGS2[i]}" "${conf_path}" ); then + echo "The variable ${VARS[i]} is set correctly" + else + echo "The variable ${VARS[i]} is not set correctly" + exit 1 + fi + fi + fi + done + +} + +echo "Download package https://s3.us-west-1.amazonaws.com/packages-dev.wazuh.com/warehouse/pullrequests/${MAJOR}.${MINOR}/macos/wazuh-agent-${VERSION}-0.commit${SHA}.pkg" +wget "https://s3.us-west-1.amazonaws.com/packages-dev.wazuh.com/warehouse/pullrequests/${MAJOR}.${MINOR}/macos/wazuh-agent-${VERSION}-0.commit${SHA}.pkg" > /dev/null 2>&1 + +install_wazuh "WAZUH_MANAGER='1.1.1.1' && WAZUH_MANAGER_PORT='7777' && WAZUH_PROTOCOL='udp' && WAZUH_REGISTRATION_SERVER='2.2.2.2' && WAZUH_REGISTRATION_PORT='8888' && WAZUH_REGISTRATION_PASSWORD='password' && WAZUH_KEEP_ALIVE_INTERVAL='10' && WAZUH_TIME_RECONNECT='10' && WAZUH_REGISTRATION_CA='/Library/Ossec/etc/testsslmanager.cert' && WAZUH_REGISTRATION_CERTIFICATE='/Library/Ossec/etc/testsslmanager.cert' && WAZUH_REGISTRATION_KEY='/Library/Ossec/etc/testsslmanager.key' && WAZUH_AGENT_NAME='test-agent' && WAZUH_AGENT_GROUP='test-group' && ENROLLMENT_DELAY='10'" +test "WAZUH_MANAGER WAZUH_MANAGER_PORT WAZUH_PROTOCOL WAZUH_REGISTRATION_SERVER WAZUH_REGISTRATION_PORT WAZUH_REGISTRATION_PASSWORD WAZUH_KEEP_ALIVE_INTERVAL WAZUH_TIME_RECONNECT WAZUH_REGISTRATION_CA WAZUH_REGISTRATION_CERTIFICATE WAZUH_REGISTRATION_KEY WAZUH_AGENT_NAME WAZUH_AGENT_GROUP ENROLLMENT_DELAY" +remove_wazuh + +install_wazuh "WAZUH_MANAGER='1.1.1.1'" +test "WAZUH_MANAGER" +remove_wazuh + +install_wazuh "WAZUH_MANAGER_PORT='7777'" +test "WAZUH_MANAGER_PORT" +remove_wazuh + +install_wazuh "WAZUH_PROTOCOL='udp'" +test "WAZUH_PROTOCOL" +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_SERVER='2.2.2.2'" +test "WAZUH_REGISTRATION_SERVER" +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_PORT='8888'" +test "WAZUH_REGISTRATION_PORT" +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_PASSWORD='password'" +test "WAZUH_REGISTRATION_PASSWORD" +remove_wazuh + +install_wazuh "WAZUH_KEEP_ALIVE_INTERVAL='10'" +test "WAZUH_KEEP_ALIVE_INTERVAL" +remove_wazuh + +install_wazuh "WAZUH_TIME_RECONNECT='10'" +test "WAZUH_TIME_RECONNECT" +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_CA='/Library/Ossec/etc/testsslmanager.cert'" +test "WAZUH_REGISTRATION_CA" +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_CERTIFICATE='/Library/Ossec/etc/testsslmanager.cert'" +test "WAZUH_REGISTRATION_CERTIFICATE" +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_KEY='/Library/Ossec/etc/testsslmanager.key'" +test "WAZUH_REGISTRATION_KEY" +remove_wazuh + +install_wazuh "WAZUH_AGENT_NAME='test-agent'" +test "WAZUH_AGENT_NAME" +remove_wazuh + +install_wazuh "WAZUH_AGENT_GROUP='test-group'" +test "WAZUH_AGENT_GROUP" +remove_wazuh + +install_wazuh "ENROLLMENT_DELAY='10'" +test "ENROLLMENT_DELAY" +remove_wazuh diff --git a/.github/actions/test_deploy_ubuntu.sh b/.github/actions/test_deploy_ubuntu.sh new file mode 100644 index 0000000000..4558757853 --- /dev/null +++ b/.github/actions/test_deploy_ubuntu.sh @@ -0,0 +1,132 @@ +#!/bin/bash + +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. + +# Global variables +VERSION="$(sed 's/v//' src/VERSION)" +MAJOR=$(echo "${VERSION}" | cut -dv -f2 | cut -d. -f1) +MINOR=$(echo "${VERSION}" | cut -d. -f2) +SHA="$(git rev-parse --short=7 "$1")" + +conf_path="/var/ossec/etc/ossec.conf" + +VARS=( "WAZUH_MANAGER" "WAZUH_MANAGER_PORT" "WAZUH_PROTOCOL" "WAZUH_REGISTRATION_SERVER" "WAZUH_REGISTRATION_PORT" "WAZUH_REGISTRATION_PASSWORD" "WAZUH_KEEP_ALIVE_INTERVAL" "WAZUH_TIME_RECONNECT" "WAZUH_REGISTRATION_CA" "WAZUH_REGISTRATION_CERTIFICATE" "WAZUH_REGISTRATION_KEY" "WAZUH_AGENT_NAME" "WAZUH_AGENT_GROUP" "ENROLLMENT_DELAY" ) +VALUES=( "1.1.1.1" "7777" "udp" "2.2.2.2" "8888" "password" "10" "10" "/var/ossec/etc/testsslmanager.cert" "/var/ossec/etc/testsslmanager.cert" "/var/ossec/etc/testsslmanager.key" "test-agent" "test-group" "10" ) +TAGS1=( "
" "" "" "" "" "" "" "" "" "" "" "" "" "" ) +TAGS2=( "
" "" "" "" "" "" "" "" "" "" "" "" "" "" ) +WAZUH_REGISTRATION_PASSWORD_PATH="/var/ossec/etc/authd.pass" + +function install_wazuh(){ + + echo "Testing the following variables $*" + eval "${*} apt install -y ./wazuh-agent_${VERSION}-0.commit${SHA}_amd64.deb > /dev/null 2>&1" + +} + +function remove_wazuh () { + + apt purge -y wazuh-agent > /dev/null 2>&1 + +} + +function test() { + + for i in "${!VARS[@]}"; do + if ( echo "${@}" | grep -q -w "${VARS[i]}" ); then + if [ "${VARS[i]}" == "WAZUH_MANAGER" ] || [ "${VARS[i]}" == "WAZUH_PROTOCOL" ]; then + LIST=( "${VALUES[i]//,/ }" ) + for j in "${!LIST[@]}"; do + if ( grep -q "${TAGS1[i]}${LIST[j]}${TAGS2[i]}" "${conf_path}" ); then + echo "The variable ${VARS[i]} is set correctly" + else + echo "The variable ${VARS[i]} is not set correctly" + exit 1 + fi + done + elif [ "${VARS[i]}" == "WAZUH_REGISTRATION_PASSWORD" ]; then + if ( grep -q "${VALUES[i]}" "${WAZUH_REGISTRATION_PASSWORD_PATH}" ); then + echo "The variable ${VARS[i]} is set correctly" + else + echo "The variable ${VARS[i]} is not set correctly" + exit 1 + fi + else + if ( grep -q "${TAGS1[i]}${VALUES[i]}${TAGS2[i]}" "${conf_path}" ); then + echo "The variable ${VARS[i]} is set correctly" + else + echo "The variable ${VARS[i]} is not set correctly" + exit 1 + fi + fi + fi + done + +} + +echo "Download package: https://s3.us-west-1.amazonaws.com/packages-dev.wazuh.com/warehouse/pullrequests/${MAJOR}.${MINOR}/deb/var/wazuh-agent_${VERSION}-0.commit${SHA}_amd64.deb" +wget "https://s3.us-west-1.amazonaws.com/packages-dev.wazuh.com/warehouse/pullrequests/${MAJOR}.${MINOR}/deb/var/wazuh-agent_${VERSION}-0.commit${SHA}_amd64.deb" > /dev/null 2>&1 + +install_wazuh "WAZUH_MANAGER=1.1.1.1 WAZUH_MANAGER_PORT=7777 WAZUH_PROTOCOL=udp WAZUH_REGISTRATION_SERVER=2.2.2.2 WAZUH_REGISTRATION_PORT=8888 WAZUH_REGISTRATION_PASSWORD=password WAZUH_KEEP_ALIVE_INTERVAL=10 WAZUH_TIME_RECONNECT=10 WAZUH_REGISTRATION_CA=/var/ossec/etc/testsslmanager.cert WAZUH_REGISTRATION_CERTIFICATE=/var/ossec/etc/testsslmanager.cert WAZUH_REGISTRATION_KEY=/var/ossec/etc/testsslmanager.key WAZUH_AGENT_NAME=test-agent WAZUH_AGENT_GROUP=test-group ENROLLMENT_DELAY=10" +test "WAZUH_MANAGER WAZUH_MANAGER_PORT WAZUH_PROTOCOL WAZUH_REGISTRATION_SERVER WAZUH_REGISTRATION_PORT WAZUH_REGISTRATION_PASSWORD WAZUH_KEEP_ALIVE_INTERVAL WAZUH_TIME_RECONNECT WAZUH_REGISTRATION_CA WAZUH_REGISTRATION_CERTIFICATE WAZUH_REGISTRATION_KEY WAZUH_AGENT_NAME WAZUH_AGENT_GROUP ENROLLMENT_DELAY" +remove_wazuh + +install_wazuh "WAZUH_MANAGER=1.1.1.1" +test "WAZUH_MANAGER" +remove_wazuh + +install_wazuh "WAZUH_MANAGER_PORT=7777" +test "WAZUH_MANAGER_PORT" +remove_wazuh + +install_wazuh "WAZUH_PROTOCOL=udp" +test "WAZUH_PROTOCOL" +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_SERVER=2.2.2.2" +test "WAZUH_REGISTRATION_SERVER" +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_PORT=8888" +test "WAZUH_REGISTRATION_PORT" +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_PASSWORD=password" +test "WAZUH_REGISTRATION_PASSWORD" +remove_wazuh + +install_wazuh "WAZUH_KEEP_ALIVE_INTERVAL=10" +test "WAZUH_KEEP_ALIVE_INTERVAL" +remove_wazuh + +install_wazuh "WAZUH_TIME_RECONNECT=10" +test "WAZUH_TIME_RECONNECT" +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_CA=/var/ossec/etc/testsslmanager.cert" +test "WAZUH_REGISTRATION_CA" +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_CERTIFICATE=/var/ossec/etc/testsslmanager.cert" +test "WAZUH_REGISTRATION_CERTIFICATE" +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_KEY=/var/ossec/etc/testsslmanager.key" +test "WAZUH_REGISTRATION_KEY" +remove_wazuh + +install_wazuh "WAZUH_AGENT_NAME=test-agent" +test "WAZUH_AGENT_NAME" +remove_wazuh + +install_wazuh "WAZUH_AGENT_GROUP=test-group" +test "WAZUH_AGENT_GROUP" +remove_wazuh + +install_wazuh "ENROLLMENT_DELAY=10" +test "ENROLLMENT_DELAY" +remove_wazuh diff --git a/.github/actions/test_deploy_win.ps1 b/.github/actions/test_deploy_win.ps1 new file mode 100644 index 0000000000..81cd0d886f --- /dev/null +++ b/.github/actions/test_deploy_win.ps1 @@ -0,0 +1,157 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. + +$VERSION = Get-Content src/VERSION +[version]$VERSION = $VERSION -replace '[v]','' +$MAJOR=$VERSION.Major +$MINOR=$VERSION.Minor +$SHA= git rev-parse --short $args[0] + +$TEST_ARRAY=@( + @("WAZUH_MANAGER ", "1.1.1.1", "
", "
"), + @("WAZUH_MANAGER_PORT ", "7777", "", ""), + @("WAZUH_PROTOCOL ", "udp", "", ""), + @("WAZUH_REGISTRATION_SERVER ", "2.2.2.2", "", ""), + @("WAZUH_REGISTRATION_PORT ", "8888", "", ""), + @("WAZUH_REGISTRATION_PASSWORD ", "password", "", ""), + @("WAZUH_KEEP_ALIVE_INTERVAL ", "10", "", ""), + @("WAZUH_TIME_RECONNECT ", "10", "", ""), + @("WAZUH_REGISTRATION_CA ", "/var/ossec/etc/testsslmanager.cert", "", ""), + @("WAZUH_REGISTRATION_CERTIFICATE ", "/var/ossec/etc/testsslmanager.cert", "", ""), + @("WAZUH_REGISTRATION_KEY ", "/var/ossec/etc/testsslmanager.key", "", ""), + @("WAZUH_AGENT_NAME ", "test-agent", "", ""), + @("WAZUH_AGENT_GROUP ", "test-group", "", ""), + @("ENROLLMENT_DELAY ", "10", "", "") +) + +function install_wazuh($vars) +{ + + Write-Output "Testing the following variables $vars" + Start-Process C:\Windows\System32\msiexec.exe -ArgumentList "/i wazuh-agent-$VERSION-0.commit$SHA.msi /qn $vars" -wait + +} + +function remove_wazuh +{ + + Start-Process C:\Windows\System32\msiexec.exe -ArgumentList "/x wazuh-agent-$VERSION-commit$SHA.msi /qn" -wait + +} + +function test($vars) +{ + + For ($i=0; $i -lt $TEST_ARRAY.Length; $i++) { + if($vars.Contains($TEST_ARRAY[$i][0])) { + if ( ($TEST_ARRAY[$i][0] -eq "WAZUH_MANAGER ") -OR ($TEST_ARRAY[$i][0] -eq "WAZUH_PROTOCOL ") ) { + $LIST = $TEST_ARRAY[$i][1].split(",") + For ($j=0; $j -lt $LIST.Length; $j++) { + $SEL = Select-String -Path 'C:\Program Files (x86)\ossec-agent\ossec.conf' -Pattern "$($TEST_ARRAY[$i][2])$($LIST[$j])$($TEST_ARRAY[$i][3])" + if($SEL -ne $null) { + Write-Output "The variable $($TEST_ARRAY[$i][0]) is set correctly" + } + if($SEL -eq $null) { + Write-Output "The variable $($TEST_ARRAY[$i][0]) is not set correctly" + exit 1 + } + } + } + ElseIf ( ($TEST_ARRAY[$i][0] -eq "WAZUH_REGISTRATION_PASSWORD ") ) { + if (Test-Path 'C:\Program Files (x86)\ossec-agent\authd.pass'){ + $SEL = Select-String -Path 'C:\Program Files (x86)\ossec-agent\authd.pass' -Pattern "$($TEST_ARRAY[$i][1])" + if($SEL -ne $null) { + Write-Output "The variable $($TEST_ARRAY[$i][0]) is set correctly" + } + if($SEL -eq $null) { + Write-Output "The variable $($TEST_ARRAY[$i][0]) is not set correctly" + exit 1 + } + } + else + { + Write-Output "WAZUH_REGISTRATION_PASSWORD is not correct" + exit 1 + } + } + Else { + $SEL = Select-String -Path 'C:\Program Files (x86)\ossec-agent\ossec.conf' -Pattern "$($TEST_ARRAY[$i][2])$($TEST_ARRAY[$i][1])$($TEST_ARRAY[$i][3])" + if($SEL -ne $null) { + Write-Output "The variable $($TEST_ARRAY[$i][0]) is set correctly" + } + if($SEL -eq $null) { + Write-Output "The variable $($TEST_ARRAY[$i][0]) is not set correctly" + exit 1 + } + } + } + } + +} + +Write-Output "Download package: https://s3.us-west-1.amazonaws.com/packages-dev.wazuh.com/warehouse/pullrequests/$MAJOR.$MINOR/windows/wazuh-agent-$VERSION-0.commit$SHA.msi" +Invoke-WebRequest -Uri "https://s3.us-west-1.amazonaws.com/packages-dev.wazuh.com/warehouse/pullrequests/$MAJOR.$MINOR/windows/wazuh-agent-$VERSION-0.commit$SHA.msi" -OutFile "wazuh-agent-$VERSION-0.commit$SHA.msi" + +install_wazuh "WAZUH_MANAGER=1.1.1.1 WAZUH_MANAGER_PORT=7777 WAZUH_PROTOCOL=udp WAZUH_REGISTRATION_SERVER=2.2.2.2 WAZUH_REGISTRATION_PORT=8888 WAZUH_REGISTRATION_PASSWORD=password WAZUH_KEEP_ALIVE_INTERVAL=10 WAZUH_TIME_RECONNECT=10 WAZUH_REGISTRATION_CA=/var/ossec/etc/testsslmanager.cert WAZUH_REGISTRATION_CERTIFICATE=/var/ossec/etc/testsslmanager.cert WAZUH_REGISTRATION_KEY=/var/ossec/etc/testsslmanager.key WAZUH_AGENT_NAME=test-agent WAZUH_AGENT_GROUP=test-group ENROLLMENT_DELAY=10" +test "WAZUH_MANAGER WAZUH_MANAGER_PORT WAZUH_PROTOCOL WAZUH_REGISTRATION_SERVER WAZUH_REGISTRATION_PORT WAZUH_REGISTRATION_PASSWORD WAZUH_KEEP_ALIVE_INTERVAL WAZUH_TIME_RECONNECT WAZUH_REGISTRATION_CA WAZUH_REGISTRATION_CERTIFICATE WAZUH_REGISTRATION_KEY WAZUH_AGENT_NAME WAZUH_AGENT_GROUP ENROLLMENT_DELAY " +remove_wazuh + +install_wazuh "WAZUH_MANAGER=1.1.1.1" +test "WAZUH_MANAGER " +remove_wazuh + +install_wazuh "WAZUH_MANAGER_PORT=7777" +test "WAZUH_MANAGER_PORT " +remove_wazuh + +install_wazuh "WAZUH_PROTOCOL=udp" +test "WAZUH_PROTOCOL " +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_SERVER=2.2.2.2" +test "WAZUH_REGISTRATION_SERVER " +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_PORT=8888" +test "WAZUH_REGISTRATION_PORT " +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_PASSWORD=password" +test "WAZUH_REGISTRATION_PASSWORD " +remove_wazuh + +install_wazuh "WAZUH_KEEP_ALIVE_INTERVAL=10" +test "WAZUH_KEEP_ALIVE_INTERVAL " +remove_wazuh + +install_wazuh "WAZUH_TIME_RECONNECT=10" +test "WAZUH_TIME_RECONNECT " +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_CA=/var/ossec/etc/testsslmanager.cert" +test "WAZUH_REGISTRATION_CA " +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_CERTIFICATE=/var/ossec/etc/testsslmanager.cert" +test "WAZUH_REGISTRATION_CERTIFICATE " +remove_wazuh + +install_wazuh "WAZUH_REGISTRATION_KEY=/var/ossec/etc/testsslmanager.key" +test "WAZUH_REGISTRATION_KEY " +remove_wazuh + +install_wazuh "WAZUH_AGENT_NAME=test-agent" +test "WAZUH_AGENT_NAME " +remove_wazuh + +install_wazuh "WAZUH_AGENT_GROUP=test-group" +test "WAZUH_AGENT_GROUP " +remove_wazuh + +install_wazuh "ENROLLMENT_DELAY=10" +test "ENROLLMENT_DELAY " +remove_wazuh diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100755 index 0000000000..ed578180d8 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,76 @@ +|Related issue| +|---| +|| + + + +## Description + + + +## Configuration options + + + +## Logs/Alerts example + + + +## Tests + + + + +- Compilation without warnings in every supported platform + - [ ] Linux + - [ ] Windows + - [ ] MAC OS X +- [ ] Source installation +- [ ] Package installation +- [ ] Source upgrade +- [ ] Package upgrade +- [ ] Review logs syntax and correct language +- [ ] QA templates contemplate the added capabilities + + +- Memory tests for Linux + - [ ] Scan-build report + - [ ] Coverity + - [ ] Valgrind (memcheck and descriptor leaks check) + - [ ] Dr. Memory + - [ ] AddressSanitizer +- Memory tests for Windows + - [ ] Scan-build report + - [ ] Coverity + - [ ] Dr. Memory +- Memory tests for macOS + - [ ] Scan-build report + - [ ] Leaks + - [ ] AddressSanitizer + + +- [ ] Retrocompatibility with older Wazuh versions +- [ ] Working on cluster environments +- [ ] Configuration on demand reports new parameters +- [ ] The data flow works as expected (agent-manager-api-app) +- [ ] Added unit tests (for new features) +- [ ] Stress test for affected components + + +- Decoder/Rule tests + - [ ] Added unit testing files ".ini" + - [ ] runtests.py executed without errors \ No newline at end of file diff --git a/.github/workflows/.python_version b/.github/workflows/.python_version new file mode 100644 index 0000000000..2c0733315e --- /dev/null +++ b/.github/workflows/.python_version @@ -0,0 +1 @@ +3.11 diff --git a/.github/workflows/deployment_vars.yml b/.github/workflows/deployment_vars.yml new file mode 100644 index 0000000000..1f1c7ba1c1 --- /dev/null +++ b/.github/workflows/deployment_vars.yml @@ -0,0 +1,79 @@ +name: Deployment variable tests +on: + pull_request: + paths: + - 'src/init/register_configure_agent.sh' + - 'src/win32/InstallerScripts.vbs' + +jobs: + test_ubuntu: + name: Test Deployment variables on Ubuntu + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Wait for build to succeed + uses: fountainhead/action-wait-for-check@v1.0.0 + id: wait-for-build-deb + with: + token: ${{ secrets.GITHUB_TOKEN }} + checkName: 'Build Linux amd64 agent deb package' + ref: ${{ github.event.pull_request.head.sha || github.sha }} + timeoutSeconds: 3600 + intervalSeconds: 60 + + - name: Fail after timeout + if: steps.wait-for-build.outputs.conclusion == 'timed_out' + run: exit 1 + + - name: Run test + if: steps.wait-for-build-deb.outputs.conclusion == 'success' + run: sudo bash .github/actions/test_deploy_ubuntu.sh ${{ github.event.pull_request.head.sha || github.sha }} + + test_macos: + name: Test Deployment variables on macOS + runs-on: macOS-latest + steps: + - uses: actions/checkout@v2 + + - name: Wait for build to succeed + uses: fountainhead/action-wait-for-check@v1.0.0 + id: wait-for-build-macos + with: + token: ${{ secrets.GITHUB_TOKEN }} + checkName: 'Build macOS agent package signed MacOS' + ref: ${{ github.event.pull_request.head.sha || github.sha }} + timeoutSeconds: 3600 + intervalSeconds: 60 + + - name: Fail after timeout + if: steps.wait-for-build.outputs.conclusion == 'timed_out' + run: exit 1 + + - name: Run test + if: steps.wait-for-build-macos.outputs.conclusion == 'success' + run: sudo bash .github/actions/test_deploy_macos.sh ${{ github.event.pull_request.head.sha || github.sha }} + + test_windows: + name: Test Deployment variables on Windows + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + + - name: Wait for build to succeed + uses: fountainhead/action-wait-for-check@v1.0.0 + id: wait-for-build-win + with: + token: ${{ secrets.GITHUB_TOKEN }} + checkName: 'Build Windows i386 agent package' + ref: ${{ github.event.pull_request.head.sha || github.sha }} + timeoutSeconds: 3600 + intervalSeconds: 60 + + - name: Fail after timeout + if: steps.wait-for-build.outputs.conclusion == 'timed_out' + run: exit 1 + + - name: Run test + if: steps.wait-for-build-win.outputs.conclusion == 'success' + run: .github/actions/test_deploy_win.ps1 ${{ github.event.pull_request.head.sha || github.sha }} diff --git a/.github/workflows/integration_tests_aws_tier_0_1.yml b/.github/workflows/integration_tests_aws_tier_0_1.yml new file mode 100644 index 0000000000..5b56a974d7 --- /dev/null +++ b/.github/workflows/integration_tests_aws_tier_0_1.yml @@ -0,0 +1,178 @@ +name: Integration tests for AWS - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + base_qa_it_fw_branch: + description: 'Base qa-integration-framework branch' + required: true + default: 'main' + +jobs: + build: + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + QA_IT_FW_BRANCH: ${{ github.base_ref || inputs.base_qa_it_fw_branch }} + AWS_ACCESS_KEY_ID: ${{ secrets.IT_AWS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.IT_AWS_SECRET_ACCESS_KEY }} + AWS_DEFAULT_REGION: 'us-east-1' + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + # Download and install integration tests framework. + - name: Download and install integration tests framework + run: | + if [ "X`git ls-remote https://github.com/wazuh/qa-integration-framework.git ${BRANCH_BASE}`" != "X" ]; then + QA_BRANCH=${BRANCH_BASE} + elif [ "X`git ls-remote https://github.com/wazuh/qa-integration-framework.git ${QA_IT_FW_BRANCH}`" != "X" ]; then + QA_BRANCH=${QA_IT_FW_BRANCH} + else + QA_BRANCH="main" + fi + git clone -b ${QA_BRANCH} --single-branch https://github.com/wazuh/qa-integration-framework.git + sudo pip install qa-integration-framework/ + sudo rm -rf qa-integration-framework/ + - name: Set AWS credentials file + run: | + sudo aws configure set aws_access_key_id ${{ secrets.IT_AWS_KEY_ID }} --profile default + sudo aws configure set aws_secret_access_key ${{ secrets.IT_AWS_SECRET_ACCESS_KEY }} --profile default + sudo aws configure set default.region ${AWS_DEFAULT_REGION} --profile default + # Build wazuh server for linux. + - name: Build wazuh server for linux + run: | + make deps -C src TARGET=server -j2 + make -C src TARGET=server -j2 + # Install wazuh server for linux. + - name: Install wazuh server for linux + run: | + echo 'USER_LANGUAGE="en"' > ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_NO_STOP="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_INSTALL_TYPE="server"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo "USER_DIR=/var/ossec" >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_EMAIL="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_ROOTCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCOLLECTOR="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SCA="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_WHITE_LIST="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSLOG="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_AUTHD="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_UPDATE_CHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AUTO_START="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + sudo sh install.sh + rm ./etc/preloaded-vars.conf + # Run AWS integration tests. + - name: Run Parser related tests + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/aws_s3.py') || + contains(steps.get_modified_files.outputs.files, 'wodles/aws/aws_tools.py') + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 test_aws/test_parser.py + - name: Run every test due to base WazuhIntegration class change or manual dispatch + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/wazuh_integration.py') || + ${{ github.event_name == 'workflow_dispatch' }} + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 test_aws/ + # Bucket tests + - name: Run Custom Buckets tests + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/aws_bucket.py') + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 -k kms test_aws/ + sudo python3 -m pytest --tier 0 --tier 1 -k macie test_aws/ + sudo python3 -m pytest --tier 0 --tier 1 -k trusted_advisor test_aws/ + - name: Run Config tests + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/config.py') || + contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/aws_bucket.py') + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 -k config test_aws/ + - name: Run GuardDuty tests + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/guardduty.py') || + contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/aws_bucket.py') + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 -k guardduty test_aws/ + - name: Run CloudTrail tests + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/cloudtrail.py') || + contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/aws_bucket.py') + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 -k cloudtrail test_aws/ + - name: Run Load Balancers tests + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/load_balancers.py') || + contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/aws_bucket.py') + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 -k alb test_aws/ + sudo python3 -m pytest --tier 0 --tier 1 -k clb test_aws/ + sudo python3 -m pytest --tier 0 --tier 1 -k nlb test_aws/ + - name: Run Server Access tests + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/server_access.py') || + contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/aws_bucket.py') + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 -k server_access test_aws/ + - name: Run Umbrella tests + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/umbrella.py') || + contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/aws_bucket.py') + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 -k cisco test_aws/ + - name: Run VPC Flow tests + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/vpcflow.py') || + contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/aws_bucket.py') + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 -k vpc test_aws/ + - name: Run WAF tests + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/waf.py') || + contains(steps.get_modified_files.outputs.files, 'wodles/aws/buckets_s3/aws_bucket.py') + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 -k waf test_aws/ + # Services tests + - name: Run CloudWatch tests + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/services/cloudwatchlogs.py') || + contains(steps.get_modified_files.outputs.files, 'wodles/aws/services/aws_service.py') + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 -k cloudwatch test_aws/ + - name: Run Inspector tests + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/services/inspector.py') || + contains(steps.get_modified_files.outputs.files, 'wodles/aws/services/aws_service.py') + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 -k inspector test_aws/ + # Custom Logs Buckets tests + - name: Run Inspector tests + if: contains(steps.get_modified_files.outputs.files, 'wodles/aws/subscribers/**') + run: | + cd tests/integration + sudo python3 -m pytest --tier 0 --tier 1 test_aws/test_custom_bucket.py diff --git a/.github/workflows/integration_tests_execd_tier_0_1_lin.yml b/.github/workflows/integration_tests_execd_tier_0_1_lin.yml new file mode 100644 index 0000000000..ea68708115 --- /dev/null +++ b/.github/workflows/integration_tests_execd_tier_0_1_lin.yml @@ -0,0 +1,78 @@ +name: Integration tests for Execd on Linux - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + build: + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + # Build wazuh agent for linux. + - name: Build wazuh agent for linux + run: | + make deps -C src TARGET=agent -j2 + make -C src TARGET=agent -j2 + # Install wazuh agent for linux. + - name: Install wazuh agent for linux + run: | + echo 'USER_LANGUAGE="en"' > ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AGENT_SERVER_IP="127.0.0.1"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_NO_STOP="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_INSTALL_TYPE="agent"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo "USER_DIR=/var/ossec" >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_EMAIL="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_ROOTCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_OPENSCAP="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_WHITE_LIST="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSLOG="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_AUTHD="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AUTO_START="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + sudo sh install.sh + rm ./etc/preloaded-vars.conf + # Download and install integration tests framework. + - name: Download and install integration tests framework + run: | + if [ "X`git ls-remote https://github.com/wazuh/qa-integration-framework.git ${BRANCH_NAME}`" != "X" ]; then + QA_BRANCH=${BRANCH_NAME} + elif [ "X`git ls-remote https://github.com/wazuh/qa-integration-framework.git ${BRANCH_BASE}`" != "X" ]; then + QA_BRANCH=${BRANCH_BASE} + else + QA_BRANCH="main" + fi + git clone -b ${QA_BRANCH} --single-branch https://github.com/wazuh/qa-integration-framework.git + sudo pip install qa-integration-framework/ + sudo rm -rf qa-integration-framework/ + # Run execd integration tests. + - name: Run execd integration tests + run: | + cd tests/integration + sudo python -m pytest --tier 0 --tier 1 test_execd/ diff --git a/.github/workflows/integration_tests_execd_tier_0_1_win.yml b/.github/workflows/integration_tests_execd_tier_0_1_win.yml new file mode 100644 index 0000000000..2244853f9c --- /dev/null +++ b/.github/workflows/integration_tests_execd_tier_0_1_win.yml @@ -0,0 +1,94 @@ +name: Integration tests for Execd on Windows - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + # Build the winagent on linux. + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Install wingw required to build the winagent. + - name: Install dependencies + run: sudo apt install gcc-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 nsis -y + # Build winagent. + - name: Build wazuh agent for windows + run: | + make deps -C src TARGET=winagent -j2 + make -C src TARGET=winagent -j2 + # Compress the files generated by the build. + - name: Compress the winagent build + run: cd .. && zip -r wazuh.zip wazuh + # Make folder and save the compressed build as artifacts. + - name: Save compressed build + run: | + mkdir -p src/winagent + cp ../wazuh.zip src/winagent/wazuh.zip + # Upload build artifacts. + - name: Upload Artifact winagent + uses: actions/upload-artifact@v3 + with: + name: winagent + path: src/winagent + # Execute the tests on windows. + run-test: + needs: build + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: windows-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + - name: Add WiX toolkit to PATH + shell: bash + run: echo "${WIX}bin" >> $GITHUB_PATH + # Download the compressed winagent build. + - name: Download Artifact winagent + uses: actions/download-artifact@v3 + with: + name: winagent + path: C:\winagent\ + # Decompress the winagent files. + - name: Decompress wazuh + run: | + Expand-Archive -LiteralPath C:\winagent\wazuh.zip -DestinationPath C:\ + # Build the winagent installer. + - name: Build wazuh installer + run: | + cd C:\wazuh\src\win32 + .\wazuh-installer-build-msi.bat + # Install the windows agent. + - name: Install wazuh agent + run: | + cd C:\wazuh\src\win32 + .\wazuh-agent--.msi /q WAZUH_MANAGER="127.0.0.1" + # Download and install integration tests framework. + - name: Download and install qa-integration-framework + run: | + if (git ls-remote https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_NAME) { + $QA_BRANCH = $env:BRANCH_NAME + } elseif (git ls-remote https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_BASE) { + $QA_BRANCH = $env:BRANCH_BASE + } else { + $QA_BRANCH = "main" + } + git clone -b $QA_BRANCH --single-branch https://github.com/wazuh/qa-integration-framework.git + pip install qa-integration-framework/ + rm qa-integration-framework/ -r -force + # Run execd integration tests. + - name: Run execd integration tests + run: | + cd C:\wazuh\tests\integration + python -m pytest -m win32 --tier 0 --tier 1 test_execd\ diff --git a/.github/workflows/integration_tests_fim_tier_0_1_lin.yml b/.github/workflows/integration_tests_fim_tier_0_1_lin.yml new file mode 100644 index 0000000000..570606bc27 --- /dev/null +++ b/.github/workflows/integration_tests_fim_tier_0_1_lin.yml @@ -0,0 +1,83 @@ +name: Integration tests for FIM on Linux - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + build: + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + # Build wazuh agent for linux. + - name: Build wazuh agent for linux + run: | + make deps -C src TARGET=agent -j2 + make -C src TARGET=agent -j2 + # Install wazuh agent for linux. + - name: Install wazuh agent for linux + run: | + echo 'USER_LANGUAGE="en"' > ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_NO_STOP="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_INSTALL_TYPE="agent"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo "USER_DIR=/var/ossec" >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_EMAIL="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_ROOTCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_OPENSCAP="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_WHITE_LIST="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSLOG="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_AUTHD="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AUTO_START="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AGENT_SERVER_IP="127.0.0.1"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + sudo sh install.sh + rm ./etc/preloaded-vars.conf + # Download and install integration tests framework. + - name: Download and install integration tests framework + run: | + if [ "X`git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git ${BRANCH_NAME}`" != "X" ]; then + QA_BRANCH=${BRANCH_NAME} + elif [ "X`git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git ${BRANCH_BASE}`" != "X" ]; then + QA_BRANCH=${BRANCH_BASE} + else + QA_BRANCH="main" + fi + git clone -b ${QA_BRANCH} --single-branch https://github.com/wazuh/qa-integration-framework.git + sudo pip install qa-integration-framework/ + sudo rm -rf qa-integration-framework/ + # Install audit required by FIM + - name: Install audit + run: | + sudo apt-get update + sudo apt-get install auditd -y + # Run fim integration tests. + - name: Run fim integration tests + run: | + cd tests/integration + sudo python -m pytest --tier 0 --tier 1 test_fim/ diff --git a/.github/workflows/integration_tests_fim_tier_0_1_macos.yml b/.github/workflows/integration_tests_fim_tier_0_1_macos.yml new file mode 100644 index 0000000000..317bab30ba --- /dev/null +++ b/.github/workflows/integration_tests_fim_tier_0_1_macos.yml @@ -0,0 +1,78 @@ +name: Integration tests for FIM on MacOS - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + build: + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: macos-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + # Build wazuh agent for macOS. + - name: Build wazuh agent for macOS + run: | + make deps -C src TARGET=agent -j2 + make -C src TARGET=agent -j2 + # Install wazuh agent for macOS. + - name: Install wazuh agent for macOS + run: | + echo 'USER_LANGUAGE="en"' > ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_NO_STOP="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_INSTALL_TYPE="agent"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo "USER_DIR=/Library/Ossec" >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_EMAIL="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_ROOTCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_OPENSCAP="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_WHITE_LIST="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSLOG="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_AUTHD="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AUTO_START="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AGENT_SERVER_IP="127.0.0.1"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + sudo sh install.sh + rm ./etc/preloaded-vars.conf + # Download and install integration tests framework. + - name: Download and install integration tests framework + run: | + if [ "X`git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git ${BRANCH_NAME}`" != "X" ]; then + QA_BRANCH=${BRANCH_NAME} + elif [ "X`git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git ${BRANCH_BASE}`" != "X" ]; then + QA_BRANCH=${BRANCH_BASE} + else + QA_BRANCH="main" + fi + git clone -b ${QA_BRANCH} --single-branch https://github.com/wazuh/qa-integration-framework.git + sudo pip install qa-integration-framework/ + sudo rm -rf qa-integration-framework/ + # Run fim integration tests. + - name: Run fim integration tests + run: | + cd tests/integration + sudo python -m pytest --tier 0 --tier 1 test_fim/ diff --git a/.github/workflows/integration_tests_fim_tier_0_1_win.yml b/.github/workflows/integration_tests_fim_tier_0_1_win.yml new file mode 100644 index 0000000000..f5b0051e64 --- /dev/null +++ b/.github/workflows/integration_tests_fim_tier_0_1_win.yml @@ -0,0 +1,94 @@ +name: Integration tests for FIM on Windows - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + # Build the winagent on linux. + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Install wingw required to build the winagent. + - name: Install dependencies + run: sudo apt install gcc-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 nsis -y + # Build winagent. + - name: Build wazuh agent for windows + run: | + make deps -C src TARGET=winagent -j2 + make -C src TARGET=winagent -j2 + # Compress the files generated by the build. + - name: Compress the winagent build + run: cd .. && zip -r wazuh.zip wazuh + # Make folder and save the compressed build as artifacts. + - name: Save compressed build + run: | + mkdir -p src/winagent + cp ../wazuh.zip src/winagent/wazuh.zip + # Upload build artifacts. + - name: Upload Artifact winagent + uses: actions/upload-artifact@v3 + with: + name: winagent + path: src/winagent + # Execute the tests on windows. + run-test: + needs: build + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: windows-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + - name: Add WiX toolkit to PATH + shell: bash + run: echo "${WIX}bin" >> $GITHUB_PATH + # Download the compressed winagent build. + - name: Download Artifact winagent + uses: actions/download-artifact@v3 + with: + name: winagent + path: C:\winagent\ + # Decompress the winagent files. + - name: Decompress wazuh + run: | + Expand-Archive -LiteralPath C:\winagent\wazuh.zip -DestinationPath C:\ + # Build the winagent installer. + - name: Build wazuh installer + run: | + cd C:\wazuh\src\win32 + .\wazuh-installer-build-msi.bat + # Install the windows agent. + - name: Install wazuh agent + run: | + cd C:\wazuh\src\win32 + .\wazuh-agent--.msi /q WAZUH_MANAGER="127.0.0.1" + # Download and install integration tests framework. + - name: Download and install qa-integration-framework + run: | + if (git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_NAME) { + $QA_BRANCH = $env:BRANCH_NAME + } elseif (git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_BASE) { + $QA_BRANCH = $env:BRANCH_BASE + } else { + $QA_BRANCH = "main" + } + git clone -b $QA_BRANCH --single-branch https://github.com/wazuh/qa-integration-framework.git + pip install qa-integration-framework/ + rm qa-integration-framework/ -r -force + # Run fim integration tests. + - name: Run fim integration tests + run: | + cd C:\wazuh\tests\integration + python -m pytest --tier 0 --tier 1 test_fim\ diff --git a/.github/workflows/integration_tests_fim_tier_2_lin.yml b/.github/workflows/integration_tests_fim_tier_2_lin.yml new file mode 100644 index 0000000000..8aa7c159a3 --- /dev/null +++ b/.github/workflows/integration_tests_fim_tier_2_lin.yml @@ -0,0 +1,83 @@ +name: Integration tests for FIM on Linux - Tier 2 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + build: + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + # Build wazuh agent for linux. + - name: Build wazuh agent for linux + run: | + make deps -C src TARGET=agent -j2 + make -C src TARGET=agent -j2 + # Install wazuh agent for linux. + - name: Install wazuh agent for linux + run: | + echo 'USER_LANGUAGE="en"' > ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_NO_STOP="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_INSTALL_TYPE="agent"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo "USER_DIR=/var/ossec" >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_EMAIL="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_ROOTCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_OPENSCAP="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_WHITE_LIST="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSLOG="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_AUTHD="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AUTO_START="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AGENT_SERVER_IP="127.0.0.1"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + sudo sh install.sh + rm ./etc/preloaded-vars.conf + # Download and install integration tests framework. + - name: Download and install integration tests framework + run: | + if [ "X`git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git ${BRANCH_NAME}`" != "X" ]; then + QA_BRANCH=${BRANCH_NAME} + elif [ "X`git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git ${BRANCH_BASE}`" != "X" ]; then + QA_BRANCH=${BRANCH_BASE} + else + QA_BRANCH="main" + fi + git clone -b ${QA_BRANCH} --single-branch https://github.com/wazuh/qa-integration-framework.git + sudo pip install qa-integration-framework/ + sudo rm -rf qa-integration-framework/ + # Install audit required by FIM + - name: Install audit + run: | + sudo apt-get update + sudo apt-get install auditd -y + # Run fim integration tests. + - name: Run fim integration tests + run: | + cd tests/integration + sudo python -m pytest --tier 2 test_fim/ diff --git a/.github/workflows/integration_tests_fim_tier_2_win.yml.yml b/.github/workflows/integration_tests_fim_tier_2_win.yml.yml new file mode 100644 index 0000000000..432f3bc2b2 --- /dev/null +++ b/.github/workflows/integration_tests_fim_tier_2_win.yml.yml @@ -0,0 +1,94 @@ +name: Integration tests for FIM on Windows - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + # Build the winagent on linux. + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Install wingw required to build the winagent. + - name: Install dependencies + run: sudo apt install gcc-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 nsis -y + # Build winagent. + - name: Build wazuh agent for windows + run: | + make deps -C src TARGET=winagent -j2 + make -C src TARGET=winagent -j2 + # Compress the files generated by the build. + - name: Compress the winagent build + run: cd .. && zip -r wazuh.zip wazuh + # Make folder and save the compressed build as artifacts. + - name: Save compressed build + run: | + mkdir -p src/winagent + cp ../wazuh.zip src/winagent/wazuh.zip + # Upload build artifacts. + - name: Upload Artifact winagent + uses: actions/upload-artifact@v3 + with: + name: winagent + path: src/winagent + # Execute the tests on windows. + run-test: + needs: build + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: windows-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + - name: Add WiX toolkit to PATH + shell: bash + run: echo "${WIX}bin" >> $GITHUB_PATH + # Download the compressed winagent build. + - name: Download Artifact winagent + uses: actions/download-artifact@v3 + with: + name: winagent + path: C:\winagent\ + # Decompress the winagent files. + - name: Decompress wazuh + run: | + Expand-Archive -LiteralPath C:\winagent\wazuh.zip -DestinationPath C:\ + # Build the winagent installer. + - name: Build wazuh installer + run: | + cd C:\wazuh\src\win32 + .\wazuh-installer-build-msi.bat + # Install the windows agent. + - name: Install wazuh agent + run: | + cd C:\wazuh\src\win32 + .\wazuh-agent--.msi /q WAZUH_MANAGER="127.0.0.1" + # Download and install integration tests framework. + - name: Download and install qa-integration-framework + run: | + if (git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_NAME) { + $QA_BRANCH = $env:BRANCH_NAME + } elseif (git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_BASE) { + $QA_BRANCH = $env:BRANCH_BASE + } else { + $QA_BRANCH = "main" + } + git clone -b $QA_BRANCH --single-branch https://github.com/wazuh/qa-integration-framework.git + pip install qa-integration-framework/ + rm qa-integration-framework/ -r -force + # Run fim integration tests. + - name: Run fim integration tests + run: | + cd C:\wazuh\tests\integration + python -m pytest --tier 2 test_fim\ diff --git a/.github/workflows/integration_tests_github_tier_0_1_lin.yml b/.github/workflows/integration_tests_github_tier_0_1_lin.yml new file mode 100644 index 0000000000..93bdfb2858 --- /dev/null +++ b/.github/workflows/integration_tests_github_tier_0_1_lin.yml @@ -0,0 +1,78 @@ +name: Integration tests for GitHub on Linux - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + build: + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + # Build wazuh agent for linux. + - name: Build wazuh agent for linux + run: | + make deps -C src TARGET=agent -j2 + make -C src TARGET=agent -j2 + # Install wazuh agent for linux. + - name: Install wazuh agent for linux + run: | + echo 'USER_LANGUAGE="en"' > ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AGENT_SERVER_IP="127.0.0.1"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_NO_STOP="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_INSTALL_TYPE="agent"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo "USER_DIR=/var/ossec" >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_EMAIL="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_ROOTCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_OPENSCAP="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_WHITE_LIST="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSLOG="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_AUTHD="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AUTO_START="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + sudo sh install.sh + rm ./etc/preloaded-vars.conf + # Download and install integration tests framework. + - name: Download and install integration tests framework + run: | + if [ "X`git ls-remote https://github.com/wazuh/qa-integration-framework.git ${BRANCH_NAME}`" != "X" ]; then + QA_BRANCH=${BRANCH_NAME} + elif [ "X`git ls-remote https://github.com/wazuh/qa-integration-framework.git ${BRANCH_BASE}`" != "X" ]; then + QA_BRANCH=${BRANCH_BASE} + else + QA_BRANCH="main" + fi + git clone -b ${QA_BRANCH} --single-branch https://github.com/wazuh/qa-integration-framework.git + sudo pip install qa-integration-framework/ + sudo rm -rf qa-integration-framework/ + # Run github integration tests. + - name: Run github integration tests + run: | + cd tests/integration + sudo python -m pytest --tier 0 --tier 1 test_github/ diff --git a/.github/workflows/integration_tests_github_tier_0_1_win.yml b/.github/workflows/integration_tests_github_tier_0_1_win.yml new file mode 100644 index 0000000000..2e2e1dbb01 --- /dev/null +++ b/.github/workflows/integration_tests_github_tier_0_1_win.yml @@ -0,0 +1,94 @@ +name: Integration tests for GitHub on Windows - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + # Build the winagent on linux. + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Install wingw required to build the winagent. + - name: Install dependencies + run: sudo apt install gcc-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 nsis -y + # Build winagent. + - name: Build wazuh agent for windows + run: | + make deps -C src TARGET=winagent -j2 + make -C src TARGET=winagent -j2 + # Compress the files generated by the build. + - name: Compress the winagent build + run: cd .. && zip -r wazuh.zip wazuh + # Make folder and save the compressed build as artifacts. + - name: Save compressed build + run: | + mkdir -p src/winagent + cp ../wazuh.zip src/winagent/wazuh.zip + # Upload build artifacts. + - name: Upload Artifact winagent + uses: actions/upload-artifact@v3 + with: + name: winagent + path: src/winagent + # Execute the tests on windows. + run-test: + needs: build + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: windows-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + - name: Add WiX toolkit to PATH + shell: bash + run: echo "${WIX}bin" >> $GITHUB_PATH + # Download the compressed winagent build. + - name: Download Artifact winagent + uses: actions/download-artifact@v3 + with: + name: winagent + path: C:\winagent\ + # Decompress the winagent files. + - name: Decompress wazuh + run: | + Expand-Archive -LiteralPath C:\winagent\wazuh.zip -DestinationPath C:\ + # Build the winagent installer. + - name: Build wazuh installer + run: | + cd C:\wazuh\src\win32 + .\wazuh-installer-build-msi.bat + # Install the windows agent. + - name: Install wazuh agent + run: | + cd C:\wazuh\src\win32 + .\wazuh-agent--.msi /q WAZUH_MANAGER="127.0.0.1" + # Download and install integration tests framework. + - name: Download and install qa-integration-framework + run: | + if (git ls-remote https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_NAME) { + $QA_BRANCH = $env:BRANCH_NAME + } elseif (git ls-remote https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_BASE) { + $QA_BRANCH = $env:BRANCH_BASE + } else { + $QA_BRANCH = "main" + } + git clone -b $QA_BRANCH --single-branch https://github.com/wazuh/qa-integration-framework.git + pip install qa-integration-framework/ + rm qa-integration-framework/ -r -force + # Run github integration tests. + - name: Run github integration tests + run: | + cd C:\wazuh\tests\integration + python -m pytest --tier 0 --tier 1 test_github\ diff --git a/.github/workflows/integration_tests_logcollector_tier_0_1_lin.yml b/.github/workflows/integration_tests_logcollector_tier_0_1_lin.yml new file mode 100644 index 0000000000..ba5a1643c0 --- /dev/null +++ b/.github/workflows/integration_tests_logcollector_tier_0_1_lin.yml @@ -0,0 +1,78 @@ +name: Integration tests for logcollector on Linux - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + build: + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + # Build wazuh agent for linux. + - name: Build wazuh agent for linux + run: | + make deps -C src TARGET=agent -j2 + make -C src TARGET=agent -j2 + # Install wazuh agent for linux. + - name: Install wazuh agent for linux + run: | + echo 'USER_LANGUAGE="en"' > ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_NO_STOP="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_INSTALL_TYPE="agent"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo "USER_DIR=/var/ossec" >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_EMAIL="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_ROOTCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_OPENSCAP="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_WHITE_LIST="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSLOG="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_AUTHD="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AUTO_START="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AGENT_SERVER_IP="127.0.0.1"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + sudo sh install.sh + rm ./etc/preloaded-vars.conf + # Download and install integration tests framework. + - name: Download and install integration tests framework + run: | + if [ "X`git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git ${BRANCH_NAME}`" != "X" ]; then + QA_BRANCH=${BRANCH_NAME} + elif [ "X`git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git ${BRANCH_BASE}`" != "X" ]; then + QA_BRANCH=${BRANCH_BASE} + else + QA_BRANCH="main" + fi + git clone -b ${QA_BRANCH} --single-branch https://github.com/wazuh/qa-integration-framework.git + sudo pip install qa-integration-framework/ + sudo rm -rf qa-integration-framework/ + # Run logcollector integration tests. + - name: Run logcollector integration tests + run: | + cd tests/integration + sudo python -m pytest --tier 0 --tier 1 test_logcollector/ diff --git a/.github/workflows/integration_tests_logcollector_tier_0_1_macos.yml b/.github/workflows/integration_tests_logcollector_tier_0_1_macos.yml new file mode 100644 index 0000000000..2f7238a216 --- /dev/null +++ b/.github/workflows/integration_tests_logcollector_tier_0_1_macos.yml @@ -0,0 +1,78 @@ +name: Integration tests for logcollector on MacOS - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + build: + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: macos-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + # Build wazuh agent for macOS. + - name: Build wazuh agent for macOS + run: | + make deps -C src TARGET=agent -j2 + make -C src TARGET=agent -j2 + # Install wazuh agent for macOS. + - name: Install wazuh agent for macOS + run: | + echo 'USER_LANGUAGE="en"' > ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_NO_STOP="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_INSTALL_TYPE="agent"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo "USER_DIR=/Library/Ossec" >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_EMAIL="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_ROOTCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_OPENSCAP="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_WHITE_LIST="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSLOG="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_AUTHD="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AUTO_START="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AGENT_SERVER_IP="127.0.0.1"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + sudo sh install.sh + rm ./etc/preloaded-vars.conf + # Download and install integration tests framework. + - name: Download and install integration tests framework + run: | + if [ "X`git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git ${BRANCH_NAME}`" != "X" ]; then + QA_BRANCH=${BRANCH_NAME} + elif [ "X`git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git ${BRANCH_BASE}`" != "X" ]; then + QA_BRANCH=${BRANCH_BASE} + else + QA_BRANCH="main" + fi + git clone -b ${QA_BRANCH} --single-branch https://github.com/wazuh/qa-integration-framework.git + sudo pip install qa-integration-framework/ + sudo rm -rf qa-integration-framework/ + # Run logcollector integration tests. + - name: Run logcollector integration tests + run: | + cd tests/integration + sudo python -m pytest --tier 0 --tier 1 test_logcollector/ diff --git a/.github/workflows/integration_tests_logcollector_tier_0_1_win.yml b/.github/workflows/integration_tests_logcollector_tier_0_1_win.yml new file mode 100644 index 0000000000..1abe16fb7e --- /dev/null +++ b/.github/workflows/integration_tests_logcollector_tier_0_1_win.yml @@ -0,0 +1,94 @@ +name: Integration tests for logcollector on Windows - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + # Build the winagent on linux. + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Install wingw required to build the winagent. + - name: Install dependencies + run: sudo apt install gcc-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 nsis -y + # Build winagent. + - name: Build wazuh agent for windows + run: | + make deps -C src TARGET=winagent -j2 + make -C src TARGET=winagent -j2 + # Compress the files generated by the build. + - name: Compress the winagent build + run: cd .. && zip -r wazuh.zip wazuh + # Make folder and save the compressed build as artifacts. + - name: Save compressed build + run: | + mkdir -p src/winagent + cp ../wazuh.zip src/winagent/wazuh.zip + # Upload build artifacts. + - name: Upload Artifact winagent + uses: actions/upload-artifact@v3 + with: + name: winagent + path: src/winagent + # Execute the tests on windows. + run-test: + needs: build + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: windows-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + - name: Add WiX toolkit to PATH + shell: bash + run: echo "${WIX}bin" >> $GITHUB_PATH + # Download the compressed winagent build. + - name: Download Artifact winagent + uses: actions/download-artifact@v3 + with: + name: winagent + path: C:\winagent\ + # Decompress the winagent files. + - name: Decompress wazuh + run: | + Expand-Archive -LiteralPath C:\winagent\wazuh.zip -DestinationPath C:\ + # Build the winagent installer. + - name: Build wazuh installer + run: | + cd C:\wazuh\src\win32 + .\wazuh-installer-build-msi.bat + # Install the windows agent. + - name: Install wazuh agent + run: | + cd C:\wazuh\src\win32 + .\wazuh-agent--.msi /q WAZUH_MANAGER="127.0.0.1" + # Download and install integration tests framework. + - name: Download and install qa-integration-framework + run: | + if (git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_NAME) { + $QA_BRANCH = $env:BRANCH_NAME + } elseif (git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_BASE) { + $QA_BRANCH = $env:BRANCH_BASE + } else { + $QA_BRANCH = "main" + } + git clone -b $QA_BRANCH --single-branch https://github.com/wazuh/qa-integration-framework.git + pip install qa-integration-framework/ + rm qa-integration-framework/ -r -force + # Run logcollector integration tests. + - name: Run logcollector integration tests + run: | + cd C:\wazuh\tests\integration + python -m pytest --tier 0 --tier 1 test_logcollector\ diff --git a/.github/workflows/integration_tests_msgraph_tier_0_1_lin.yml b/.github/workflows/integration_tests_msgraph_tier_0_1_lin.yml new file mode 100644 index 0000000000..d2b668cb74 --- /dev/null +++ b/.github/workflows/integration_tests_msgraph_tier_0_1_lin.yml @@ -0,0 +1,88 @@ +name: Integration tests for MsGraph on Linux - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + build: + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + # Setup MSGraph Proxy + - name: Download m365proxy and config http for msgraph module + run: | + sed -i 's/https:\/\/%s\/%s/http:\/\/%s\/%s/g' src/wazuh_modules/wm_ms_graph.h + curl -L http://packages.wazuh.com/utils/m365proxy/m365proxy.tar.gz | \ + tar zvx -C /tmp/ + # Build wazuh agent for linux. + - name: Build wazuh agent for linux + run: | + make deps -C src TARGET=agent -j2 + make -C src TARGET=agent -j2 + # Install wazuh agent for linux. + - name: Install wazuh agent for linux + run: | + echo 'USER_LANGUAGE="en"' > ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AGENT_SERVER_IP="127.0.0.1"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_NO_STOP="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_INSTALL_TYPE="agent"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo "USER_DIR=/var/ossec" >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_EMAIL="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_ROOTCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_OPENSCAP="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCOLLECTOR="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SCA="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_WHITE_LIST="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSLOG="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_AUTHD="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AUTO_START="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + sudo sh install.sh + rm ./etc/preloaded-vars.conf + # Download and install integration tests framework. + - name: Download and install integration tests framework + run: | + if [ "X`git ls-remote https://github.com/wazuh/qa-integration-framework.git ${BRANCH_NAME}`" != "X" ]; then + QA_BRANCH=${BRANCH_NAME} + elif [ "X`git ls-remote https://github.com/wazuh/qa-integration-framework.git ${BRANCH_BASE}`" != "X" ]; then + QA_BRANCH=${BRANCH_BASE} + else + QA_BRANCH="main" + fi + git clone -b ${QA_BRANCH} --single-branch https://github.com/wazuh/qa-integration-framework.git + sudo pip install qa-integration-framework/ + sudo rm -rf qa-integration-framework/ + # Run msgraph integration tests. + - name: Run msgraph integration tests + run: | + cd tests/integration + sudo python -m pytest --tier 0 --tier 1 test_msgraph/ diff --git a/.github/workflows/integration_tests_office365_tier_0_1_lin.yml b/.github/workflows/integration_tests_office365_tier_0_1_lin.yml new file mode 100644 index 0000000000..fd8fbc1879 --- /dev/null +++ b/.github/workflows/integration_tests_office365_tier_0_1_lin.yml @@ -0,0 +1,78 @@ +name: Integration tests for Office365 on Linux - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + build: + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + # Build wazuh agent for linux. + - name: Build wazuh agent for linux + run: | + make deps -C src TARGET=agent -j2 + make -C src TARGET=agent -j2 + # Install wazuh agent for linux. + - name: Install wazuh agent for linux + run: | + echo 'USER_LANGUAGE="en"' > ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AGENT_SERVER_IP="127.0.0.1"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_NO_STOP="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_INSTALL_TYPE="agent"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo "USER_DIR=/var/ossec" >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_EMAIL="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_ROOTCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_OPENSCAP="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_WHITE_LIST="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSLOG="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_AUTHD="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AUTO_START="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + sudo sh install.sh + rm ./etc/preloaded-vars.conf + # Download and install integration tests framework. + - name: Download and install integration tests framework + run: | + if [ "X`git ls-remote https://github.com/wazuh/qa-integration-framework.git ${BRANCH_NAME}`" != "X" ]; then + QA_BRANCH=${BRANCH_NAME} + elif [ "X`git ls-remote https://github.com/wazuh/qa-integration-framework.git ${BRANCH_BASE}`" != "X" ]; then + QA_BRANCH=${BRANCH_BASE} + else + QA_BRANCH="main" + fi + git clone -b ${QA_BRANCH} --single-branch https://github.com/wazuh/qa-integration-framework.git + sudo pip install qa-integration-framework/ + sudo rm -rf qa-integration-framework/ + # Run office365 integration tests. + - name: Run office365 integration tests + run: | + cd tests/integration + sudo python -m pytest --tier 0 --tier 1 test_office365/ diff --git a/.github/workflows/integration_tests_office365_tier_0_1_win.yml b/.github/workflows/integration_tests_office365_tier_0_1_win.yml new file mode 100644 index 0000000000..f028e322cd --- /dev/null +++ b/.github/workflows/integration_tests_office365_tier_0_1_win.yml @@ -0,0 +1,94 @@ +name: Integration tests for Office365 on Windows - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + # Build the winagent on linux. + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Install wingw required to build the winagent. + - name: Install dependencies + run: sudo apt install gcc-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 nsis -y + # Build winagent. + - name: Build wazuh agent for windows + run: | + make deps -C src TARGET=winagent -j2 + make -C src TARGET=winagent -j2 + # Compress the files generated by the build. + - name: Compress the winagent build + run: cd .. && zip -r wazuh.zip wazuh + # Make folder and save the compressed build as artifacts. + - name: Save compressed build + run: | + mkdir -p src/winagent + cp ../wazuh.zip src/winagent/wazuh.zip + # Upload build artifacts. + - name: Upload Artifact winagent + uses: actions/upload-artifact@v3 + with: + name: winagent + path: src/winagent + # Execute the tests on windows. + run-test: + needs: build + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: windows-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + - name: Add WiX toolkit to PATH + shell: bash + run: echo "${WIX}bin" >> $GITHUB_PATH + # Download the compressed winagent build. + - name: Download Artifact winagent + uses: actions/download-artifact@v3 + with: + name: winagent + path: C:\winagent\ + # Decompress the winagent files. + - name: Decompress wazuh + run: | + Expand-Archive -LiteralPath C:\winagent\wazuh.zip -DestinationPath C:\ + # Build the winagent installer. + - name: Build wazuh installer + run: | + cd C:\wazuh\src\win32 + .\wazuh-installer-build-msi.bat + # Install the windows agent. + - name: Install wazuh agent + run: | + cd C:\wazuh\src\win32 + .\wazuh-agent--.msi /q WAZUH_MANAGER="127.0.0.1" + # Download and install integration tests framework. + - name: Download and install qa-integration-framework + run: | + if (git ls-remote https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_NAME) { + $QA_BRANCH = $env:BRANCH_NAME + } elseif (git ls-remote https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_BASE) { + $QA_BRANCH = $env:BRANCH_BASE + } else { + $QA_BRANCH = "main" + } + git clone -b $QA_BRANCH --single-branch https://github.com/wazuh/qa-integration-framework.git + pip install qa-integration-framework/ + rm qa-integration-framework/ -r -force + # Run office365 integration tests. + - name: Run office365 integration tests + run: | + cd C:\wazuh\tests\integration + python -m pytest --tier 0 --tier 1 test_office365\ diff --git a/.github/workflows/integration_tests_sca_tier_0_1_lin.yml b/.github/workflows/integration_tests_sca_tier_0_1_lin.yml new file mode 100644 index 0000000000..33f758a3d5 --- /dev/null +++ b/.github/workflows/integration_tests_sca_tier_0_1_lin.yml @@ -0,0 +1,82 @@ +name: Integration tests for SCA on Linux - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + build: + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + # Build wazuh agent for linux. + - name: Build wazuh agent for linux + run: | + make deps -C src TARGET=agent -j2 + make -C src TARGET=agent -j2 + # Install wazuh agent for linux. + - name: Install wazuh agent for linux + run: | + echo 'USER_LANGUAGE="en"' > ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AGENT_SERVER_IP="127.0.0.1"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_NO_STOP="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_INSTALL_TYPE="agent"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo "USER_DIR=/var/ossec" >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_EMAIL="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_ROOTCHECK="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_OPENSCAP="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSCOLLECTOR="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SCA="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_WHITE_LIST="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_SYSLOG="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_ENABLE_AUTHD="n"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + echo 'USER_AUTO_START="y"' >> ./etc/preloaded-vars.conf + echo "" >> ./etc/preloaded-vars.conf + sudo sh install.sh + rm ./etc/preloaded-vars.conf + # Download and install integration tests framework. + - name: Download and install integration tests framework + run: | + if [ "X`git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git ${BRANCH_NAME}`" != "X" ]; then + QA_BRANCH=${BRANCH_NAME} + elif [ "X`git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git ${BRANCH_BASE}`" != "X" ]; then + QA_BRANCH=${BRANCH_BASE} + else + QA_BRANCH="main" + fi + git clone -b ${QA_BRANCH} --single-branch https://github.com/wazuh/qa-integration-framework.git + sudo pip install qa-integration-framework/ + sudo rm -rf qa-integration-framework/ + # Run sca integration tests. + - name: Run sca integration tests + run: | + cd tests/integration + sudo python -m pytest --tier 0 --tier 1 test_sca/ diff --git a/.github/workflows/integration_tests_sca_tier_0_1_win.yml b/.github/workflows/integration_tests_sca_tier_0_1_win.yml new file mode 100644 index 0000000000..33178e932f --- /dev/null +++ b/.github/workflows/integration_tests_sca_tier_0_1_win.yml @@ -0,0 +1,94 @@ +name: Integration tests for SCA on Windows - Tier 0 and 1 + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch' + required: true + default: 'main' + +jobs: + # Build the winagent on linux. + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + # Install wingw required to build the winagent. + - name: Install dependencies + run: sudo apt install gcc-mingw-w64 g++-mingw-w64-i686 g++-mingw-w64-x86-64 nsis -y + # Build winagent. + - name: Build wazuh agent for windows + run: | + make deps -C src TARGET=winagent -j2 + make -C src TARGET=winagent -j2 + # Compress the files generated by the build. + - name: Compress the winagent build + run: cd .. && zip -r wazuh.zip wazuh + # Make folder and save the compressed build as artifacts. + - name: Save compressed build + run: | + mkdir -p src/winagent + cp ../wazuh.zip src/winagent/wazuh.zip + # Upload build artifacts. + - name: Upload Artifact winagent + uses: actions/upload-artifact@v3 + with: + name: winagent + path: src/winagent + # Execute the tests on windows. + run-test: + needs: build + env: + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + BRANCH_BASE: ${{ github.base_ref || inputs.base_branch }} + runs-on: windows-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version-file: ".github/workflows/.python_version" + architecture: x64 + - name: Add WiX toolkit to PATH + shell: bash + run: echo "${WIX}bin" >> $GITHUB_PATH + # Download the compressed winagent build. + - name: Download Artifact winagent + uses: actions/download-artifact@v3 + with: + name: winagent + path: C:\winagent\ + # Decompress the winagent files. + - name: Decompress wazuh + run: | + Expand-Archive -LiteralPath C:\winagent\wazuh.zip -DestinationPath C:\ + # Build the winagent installer. + - name: Build wazuh installer + run: | + cd C:\wazuh\src\win32 + .\wazuh-installer-build-msi.bat + # Install the windows agent. + - name: Install wazuh agent + run: | + cd C:\wazuh\src\win32 + .\wazuh-agent--.msi /q WAZUH_MANAGER="127.0.0.1" + # Download and install integration tests framework. + - name: Download and install qa-integration-framework + run: | + if (git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_NAME) { + $QA_BRANCH = $env:BRANCH_NAME + } elseif (git ls-remote --heads https://github.com/wazuh/qa-integration-framework.git $env:BRANCH_BASE) { + $QA_BRANCH = $env:BRANCH_BASE + } else { + $QA_BRANCH = "main" + } + git clone -b $QA_BRANCH --single-branch https://github.com/wazuh/qa-integration-framework.git + pip install qa-integration-framework/ + rm qa-integration-framework/ -r -force + # Run sca integration tests. + - name: Run sca integration tests + run: | + cd C:\wazuh\tests\integration + python -m pytest -m win32 --tier 0 --tier 1 test_sca\ diff --git a/.github/workflows/packages_retag_images.yml b/.github/workflows/packages_retag_images.yml new file mode 100644 index 0000000000..207c80c28a --- /dev/null +++ b/.github/workflows/packages_retag_images.yml @@ -0,0 +1,73 @@ +name: Package - Retag Docker images +on: + workflow_dispatch: + inputs: + old_version: + description: | + Tag name refering old tag + (Use a version name. Ex 4.8.0) + required: false + default: none + new_version: + description: | + Retagging tag + (Use a version name. Ex 4.8.0 + Must be newer than old one.) + required: false + default: none + single_docker_image: + description: | + Docker image name. Used to retag only + the provided image. + required: false + default: '' + push: + branches: + - '[0-9]+.[0-9]+.[0-9]+' + - 'master' + paths: + - 'src/VERSION' + +jobs: + Upload-package-building-images: + runs-on: ubuntu-latest + timeout-minutes: 20 + name: Package - Retag Docker images + + steps: + - name: Cancel previous runs + uses: fkirc/skip-duplicate-actions@master + with: + cancel_others: 'true' + github_token: ${{ secrets.GITHUB_TOKEN }} + skip_after_successful_duplicate: 'false' + + - name: Checkout repository previous commit + uses: actions/checkout@v4 + with: + fetch-depth: 2 + - run: git checkout HEAD^ + + - name: Get old version from src/VERSION + run: | + VERSION=$(sed 's/^v\([0-9]*\.[0-9]*\.[0-9]*\)/\1/' $GITHUB_WORKSPACE/src/VERSION) + echo "OLD_VERSION=$VERSION" >> $GITHUB_ENV; + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Get new version from src/VERSION + run: | + VERSION=$(sed 's/^v\([0-9]*\.[0-9]*\.[0-9]*\)/\1/' $GITHUB_WORKSPACE/src/VERSION) + echo "NEW_VERSION=$VERSION" >> $GITHUB_ENV; + + - name: Run retag script + run: | + if [ "${{ inputs.old_version }}" != "none" ] && [ "${{ inputs.new_version }}" != "none" ]; then + new_version=${{ inputs.new_version }} + old_version=${{ inputs.old_version }} + else + new_version=${{ env.NEW_VERSION }} + old_version=${{ env.OLD_VERSION }} + fi + bash $GITHUB_WORKSPACE/.github/actions/ghcr_pull_and_push/retag_image.sh ${{ secrets.CI_WAZUH_AGENT_PACKAGES_CLASSIC }} ${{ github.actor}} $old_version $new_version ${{ inputs.single_docker_image }} diff --git a/.github/workflows/packages_upload_images.yml b/.github/workflows/packages_upload_images.yml new file mode 100644 index 0000000000..314a6bc80b --- /dev/null +++ b/.github/workflows/packages_upload_images.yml @@ -0,0 +1,201 @@ +run-name: Package - Upload Docker package building images +name: Package - Upload Docker package building images + +on: + push: + branches: + - '[0-9]+.[0-9]+.[0-9]+' + - 'master' + paths: + - 'packages/**' + +jobs: + Upload-package-building-images: + runs-on: ubuntu-latest + + steps: + - name: Cancel previous runs + uses: fkirc/skip-duplicate-actions@master + with: + cancel_others: 'true' + github_token: ${{ secrets.GITHUB_TOKEN }} + skip_after_successful_duplicate: 'false' + + - name: Checkout wazuh/wazuh repository + uses: actions/checkout@v4 + + - name: Get changed files + uses: dorny/paths-filter@v2 + id: changes + with: + filters: | + pkg_deb_manager_builder_amd64: + - 'packages/build.sh' + - 'packages/generate_package.sh' + - 'packages/debs/amd64/manager/**' + - 'packages/debs/utils/**' + pkg_rpm_manager_builder_amd64: + - 'packages/build.sh' + - 'packages/generate_package.sh' + - 'packages/rpms/amd64/manager/**' + - 'packages/rpms/utils/**' + pkg_deb_agent_builder_amd64: + - 'packages/build.sh' + - 'packages/generate_package.sh' + - 'packages/debs/amd64/agent/**' + - 'packages/debs/utils/**' + pkg_deb_agent_builder_i386: + - 'packages/build.sh' + - 'packages/generate_package.sh' + - 'packages/debs/i386/agent/**' + - 'packages/debs/utils/**' + pkg_rpm_agent_builder_amd64: + - 'packages/build.sh' + - 'packages/generate_package.sh' + - 'packages/rpms/amd64/agent/**' + - 'packages/rpms/utils/**' + pkg_rpm_agent_builder_i386: + - 'packages/build.sh' + - 'packages/generate_package.sh' + - 'packages/rpms/i386/agent/**' + - 'packages/rpms/utils/**' + pkg_rpm_legacy_builder_amd64: + - 'packages/build.sh' + - 'packages/generate_package.sh' + - 'packages/rpms/amd64/legacy/**' + - 'packages/rpms/utils/**' + pkg_rpm_legacy_builder_i386: + - 'packages/build.sh' + - 'packages/generate_package.sh' + - 'packages/rpms/i386/legacy/**' + - 'packages/rpms/utils/**' + pkg_deb_agent_builder_arm64: + - 'packages/build.sh' + - 'packages/generate_package.sh' + - 'packages/debs/arm64/agent/**' + - 'packages/debs/utils/**' + pkg_deb_agent_builder_armhf: + - 'packages/build.sh' + - 'packages/generate_package.sh' + - 'packages/debs/armhf/agent/**' + - 'packages/debs/utils/**' + pkg_rpm_agent_builder_arm64: + - 'packages/build.sh' + - 'packages/generate_package.sh' + - 'packages/rpms/arm64/agent/**' + - 'packages/rpms/utils/**' + pkg_rpm_agent_builder_armhf: + - 'packages/build.sh' + - 'packages/generate_package.sh' + - 'packages/rpms/armhf/agent/**' + - 'packages/rpms/utils/**' + compile_windows_agent: + - 'packages/windows/**' + commom_wpk_builder: + - 'packages/wpk/wpkpack.py' + - 'packages/wpk/run.sh' + - 'packages/wpk/generate_wpk_package.sh' + - 'packages/wpk/common/**' + + - name: Set TAG and WAZUH_AGENT_PACKAGES_BRANCH + run: | + VERSION=$(sed 's/^v\([0-9]*\.[0-9]*\.[0-9]*\)/\1/' src/VERSION) + echo "TAG=$VERSION" >> $GITHUB_ENV; + + - name: Request pkg_deb_manager_builder_amd64 update + if: steps.changes.outputs.pkg_deb_manager_builder_amd64 == 'true' + run: | + gh workflow run packages-upload-manager-images.yml -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=deb -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Request pkg_rpm_manager_builder_amd64 update + if: steps.changes.outputs.pkg_rpm_manager_builder_amd64 == 'true' + run: | + gh workflow run packages-upload-manager-images.yml -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=rpm -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Request pkg_deb_agent_builder_amd64 update + if: steps.changes.outputs.pkg_deb_agent_builder_amd64 == 'true' + run: | + gh workflow run packages-upload-agent-images-amd.yml --repo wazuh/wazuh-agent-packages -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=deb -f architecture=amd64 -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.CI_WAZUH_AGENT_PACKAGES }} + + - name: Request pkg_deb_agent_builder_i386 update + if: steps.changes.outputs.pkg_deb_agent_builder_i386 == 'true' + run: | + gh workflow run packages-upload-agent-images-amd.yml --repo wazuh/wazuh-agent-packages -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=deb -f architecture=i386 -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.CI_WAZUH_AGENT_PACKAGES }} + + - name: Request pkg_rpm_agent_builder_amd64 update + if: steps.changes.outputs.pkg_rpm_agent_builder_amd64 == 'true' + run: | + gh workflow run packages-upload-agent-images-amd.yml --repo wazuh/wazuh-agent-packages -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=rpm -f architecture=amd64 -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.CI_WAZUH_AGENT_PACKAGES }} + + - name: Request pkg_rpm_agent_builder_i386 update + if: steps.changes.outputs.pkg_rpm_agent_builder_i386 == 'true' + run: | + gh workflow run packages-upload-agent-images-amd.yml --repo wazuh/wazuh-agent-packages -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=rpm -f architecture=amd64 -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.CI_WAZUH_AGENT_PACKAGES }} + + - name: Request pkg_rpm_legacy_builder_amd64 update + if: steps.changes.outputs.pkg_rpm_legacy_builder_amd64 == 'true' + run: | + gh workflow run packages-upload-agent-images-amd.yml --repo wazuh/wazuh-agent-packages -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=rpm -f architecture=amd64 -f legacy=true -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.CI_WAZUH_AGENT_PACKAGES }} + + - name: Request pkg_rpm_legacy_builder_i386 update + if: steps.changes.outputs.pkg_rpm_legacy_builder_i386 == 'true' + run: | + gh workflow run packages-upload-agent-images-amd.yml --repo wazuh/wazuh-agent-packages -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=rpm -f architecture=i386 -f legacy=true -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.CI_WAZUH_AGENT_PACKAGES }} + + - name: Request pkg_deb_agent_builder_arm64 update + if: steps.changes.outputs.pkg_deb_agent_builder_arm64 == 'true' + run: | + gh workflow run packages-upload-agent-images-arm.yml --repo wazuh/wazuh-agent-packages -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=deb -f architecture=arm64 -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.CI_WAZUH_AGENT_PACKAGES }} + + - name: Request pkg_deb_agent_builder_armhf update + if: steps.changes.outputs.pkg_deb_agent_builder_armhf == 'true' + run: | + gh workflow run packages-upload-agent-images-arm.yml --repo wazuh/wazuh-agent-packages -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=deb -f architecture=armhf -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.CI_WAZUH_AGENT_PACKAGES }} + + - name: Request pkg_rpm_agent_builder_arm64 update + if: steps.changes.outputs.pkg_rpm_agent_builder_arm64 == 'true' + run: | + gh workflow run packages-upload-agent-images-arm.yml --repo wazuh/wazuh-agent-packages -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=rpm -f architecture=arm64 -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.CI_WAZUH_AGENT_PACKAGES }} + + - name: Request pkg_rpm_agent_builder_armhf update + if: steps.changes.outputs.pkg_rpm_agent_builder_armhf == 'true' + run: | + gh workflow run packages-upload-agent-images-arm.yml --repo wazuh/wazuh-agent-packages -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=rpm -f architecture=armhf -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.CI_WAZUH_AGENT_PACKAGES }} + + - name: Request compile_windows_agent update + if: steps.changes.outputs.compile_windows_agent == 'true' + run: | + gh workflow run packages-upload-agent-images-amd.yml --repo wazuh/wazuh-agent-packages -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=windows -f architecture=i386 -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.CI_WAZUH_AGENT_PACKAGES }} + + - name: Request commom_wpk_builder update + if: steps.changes.outputs.commom_wpk_builder == 'true' + run: | + gh workflow run packages-upload-wpk-images.yml --repo wazuh/wazuh-agent-packages -r ${{ github.ref_name }} -f docker_image_tag=${{ env.TAG }} -f system=common -f source_reference=${{ github.ref_name }} + env: + GH_TOKEN: ${{ secrets.CI_WAZUH_AGENT_PACKAGES }} diff --git a/.gitignore b/.gitignore index 460ae459bb..47317c7386 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,13 @@ # patch files *.rej *.orig + +# Python cache +__pycache__ +.pytest_cache + +# Thumbnails +._* + +### Python Virtualenv +venv diff --git a/README.md b/README.md index 1666a0c84d..90e92a8902 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,190 @@ -# wazuh-agent -Wazuh agent, the Wazuh agent for endpoints. +# Wazuh + +[![Slack](https://img.shields.io/badge/slack-join-blue.svg)](https://wazuh.com/community/join-us-on-slack/) +[![Email](https://img.shields.io/badge/email-join-blue.svg)](https://groups.google.com/forum/#!forum/wazuh) +[![Documentation](https://img.shields.io/badge/docs-view-green.svg)](https://documentation.wazuh.com) +[![Documentation](https://img.shields.io/badge/web-view-green.svg)](https://wazuh.com) +[![Coverity](https://scan.coverity.com/projects/10992/badge.svg)](https://scan.coverity.com/projects/wazuh-wazuh) +[![Twitter](https://img.shields.io/twitter/follow/wazuh?style=social)](https://twitter.com/wazuh) +[![YouTube](https://img.shields.io/youtube/views/peTSzcAueEc?style=social)](https://www.youtube.com/watch?v=peTSzcAueEc) + + +Wazuh is a free and open source platform used for threat prevention, detection, and response. It is capable of protecting workloads across on-premises, virtualized, containerized, and cloud-based environments. + +Wazuh solution consists of an endpoint security agent, deployed to the monitored systems, and a management server, which collects and analyzes data gathered by the agents. Besides, Wazuh has been fully integrated with the Elastic Stack, providing a search engine and data visualization tool that allows users to navigate through their security alerts. + +## Wazuh capabilities + +A brief presentation of some of the more common use cases of the Wazuh solution. + +**Intrusion detection** + +Wazuh agents scan the monitored systems looking for malware, rootkits and suspicious anomalies. They can detect hidden files, cloaked processes or unregistered network listeners, as well as inconsistencies in system call responses. + +In addition to agent capabilities, the server component uses a signature-based approach to intrusion detection, using its regular expression engine to analyze collected log data and look for indicators of compromise. + +**Log data analysis** + +Wazuh agents read operating system and application logs, and securely forward them to a central manager for rule-based analysis and storage. When no agent is deployed, the server can also receive data via syslog from network devices or applications. + +The Wazuh rules help make you aware of application or system errors, misconfigurations, attempted and/or successful malicious activities, policy violations and a variety of other security and operational issues. + +**File integrity monitoring** + +Wazuh monitors the file system, identifying changes in content, permissions, ownership, and attributes of files that you need to keep an eye on. In addition, it natively identifies users and applications used to create or modify files. + +File integrity monitoring capabilities can be used in combination with threat intelligence to identify threats or compromised hosts. In addition, several regulatory compliance standards, such as PCI DSS, require it. + +**Vulnerability detection** + +Wazuh agents pull software inventory data and send this information to the server, where it is correlated with continuously updated CVE (Common Vulnerabilities and Exposure) databases, in order to identify well-known vulnerable software. + +Automated vulnerability assessment helps you find the weak spots in your critical assets and take corrective action before attackers exploit them to sabotage your business or steal confidential data. + +**Configuration assessment** + +Wazuh monitors system and application configuration settings to ensure they are compliant with your security policies, standards and/or hardening guides. Agents perform periodic scans to detect applications that are known to be vulnerable, unpatched, or insecurely configured. + +Additionally, configuration checks can be customized, tailoring them to properly align with your organization. Alerts include recommendations for better configuration, references and mapping with regulatory compliance. + +**Incident response** + +Wazuh provides out-of-the-box active responses to perform various countermeasures to address active threats, such as blocking access to a system from the threat source when certain criteria are met. + +In addition, Wazuh can be used to remotely run commands or system queries, identifying indicators of compromise (IOCs) and helping perform other live forensics or incident response tasks. + +**Regulatory compliance** + +Wazuh provides some of the necessary security controls to become compliant with industry standards and regulations. These features, combined with its scalability and multi-platform support help organizations meet technical compliance requirements. + +Wazuh is widely used by payment processing companies and financial institutions to meet PCI DSS (Payment Card Industry Data Security Standard) requirements. Its web user interface provides reports and dashboards that can help with this and other regulations (e.g. GPG13 or GDPR). + +**Cloud security** + +Wazuh helps monitoring cloud infrastructure at an API level, using integration modules that are able to pull security data from well known cloud providers, such as Amazon AWS, Azure or Google Cloud. In addition, Wazuh provides rules to assess the configuration of your cloud environment, easily spotting weaknesses. + +In addition, Wazuh light-weight and multi-platform agents are commonly used to monitor cloud environments at the instance level. + +**Containers security** + +Wazuh provides security visibility into your Docker hosts and containers, monitoring their behavior and detecting threats, vulnerabilities and anomalies. The Wazuh agent has native integration with the Docker engine allowing users to monitor images, volumes, network settings, and running containers. + +Wazuh continuously collects and analyzes detailed runtime information. For example, alerting for containers running in privileged mode, vulnerable applications, a shell running in a container, changes to persistent volumes or images, and other possible threats. + +## WUI + +The Wazuh WUI provides a powerful user interface for data visualization and analysis. This interface can also be used to manage Wazuh configuration and to monitor its status. + +**Modules overview** + +![Modules overview](https://github.com/wazuh/wazuh-dashboard-plugins/raw/master/screenshots/app.png) + +**Security events** + +![Overview](https://github.com/wazuh/wazuh-dashboard-plugins/blob/master/screenshots/app2.png) + +**Integrity monitoring** + +![Overview](https://github.com/wazuh/wazuh-dashboard-plugins/blob/master/screenshots/app3.png) + +**Vulnerability detection** + +![Overview](https://github.com/wazuh/wazuh-dashboard-plugins/blob/master/screenshots/app4.png) + +**Regulatory compliance** + +![Overview](https://github.com/wazuh/wazuh-dashboard-plugins/blob/master/screenshots/app5.png) + +**Agents overview** + +![Overview](https://github.com/wazuh/wazuh-dashboard-plugins/blob/master/screenshots/app6.png) + +**Agent summary** + +![Overview](https://github.com/wazuh/wazuh-dashboard-plugins/blob/master/screenshots/app7.png) + +## Orchestration + +Here you can find all the automation tools maintained by the Wazuh team. + +* [Wazuh AWS CloudFormation](https://github.com/wazuh/wazuh-cloudformation) + +* [Docker containers](https://github.com/wazuh/wazuh-docker) + +* [Wazuh Ansible](https://github.com/wazuh/wazuh-ansible) + +* [Wazuh Chef](https://github.com/wazuh/wazuh-chef) + +* [Wazuh Puppet](https://github.com/wazuh/wazuh-puppet) + +* [Wazuh Kubernetes](https://github.com/wazuh/wazuh-kubernetes) + +* [Wazuh Bosh](https://github.com/wazuh/wazuh-bosh) + +* [Wazuh Salt](https://github.com/wazuh/wazuh-salt) + +## Branches + +* `master` branch contains the latest code, be aware of possible bugs on this branch. +* `stable` branch on correspond to the last Wazuh stable version. + +## Software and libraries used + +|Software|Version|Author|License| +|---|---|---|---| +|[bzip2](https://github.com/libarchive/bzip2)|1.0.8|Julian Seward|BSD License| +|[cJSON](https://github.com/DaveGamble/cJSON)|1.7.12|Dave Gamble|MIT License| +|[cPython](https://github.com/python/cpython)|3.10.13|Guido van Rossum|Python Software Foundation License version 2| +|[cURL](https://github.com/curl/curl)|8.5.0|Daniel Stenberg|MIT License| +|[Flatbuffers](https://github.com/google/flatbuffers/)|23.5.26|Google Inc.|Apache 2.0 License| +|[GoogleTest](https://github.com/google/googletest)|1.11.0|Google Inc.|3-Clause "New" BSD License| +|[jemalloc](https://github.com/jemalloc/jemalloc)|5.2.1|Jason Evans|2-Clause "Simplified" BSD License| +|[Lua](https://github.com/lua/lua)|5.3.6|PUC-Rio|MIT License| +|[libarchive](https://github.com/libarchive/libarchive)|3.7.2|Tim Kientzle|3-Clause "New" BSD License| +|[libdb](https://github.com/yasuhirokimura/db18)|18.1.40|Oracle Corporation|Affero GPL v3| +|[libffi](https://github.com/libffi/libffi)|3.2.1|Anthony Green|MIT License| +|[libpcre2](https://github.com/PCRE2Project/pcre2)|10.42.0|Philip Hazel|BSD License| +|[libplist](https://github.com/libimobiledevice/libplist)|2.2.0|Aaron Burghardt et al.|GNU Lesser General Public License version 2.1| +|[libYAML](https://github.com/yaml/libyaml)|0.1.7|Kirill Simonov|MIT License| +|[liblzma](https://github.com/tukaani-project/xz)|5.4.2|Lasse Collin, Jia Tan et al.|GNU Public License version 3| +|[Linux Audit userspace](https://github.com/linux-audit/audit-userspace)|2.8.4|Rik Faith|LGPL (copyleft)| +|[msgpack](https://github.com/msgpack/msgpack-c)|3.1.1|Sadayuki Furuhashi|Boost Software License version 1.0| +|[nlohmann](https://github.com/nlohmann/json)|3.7.3|Niels Lohmann|MIT License| +|[OpenSSL](https://github.com/openssl/openssl)|3.0.12|OpenSSL Software Foundation|Apache 2.0 License| +|[pacman](https://gitlab.archlinux.org/pacman/pacman)|5.2.2|Judd Vinet|GNU Public License version 2 (copyleft)| +|[popt](https://github.com/rpm-software-management/popt)|1.16|Jeff Johnson & Erik Troan|MIT License| +|[procps](https://gitlab.com/procps-ng/procps)|2.8.3|Brian Edmonds et al.|LGPL (copyleft)| +|[RocksDB](https://github.com/facebook/rocksdb/)|8.3.2|Facebook Inc.|Apache 2.0 License| +|[rpm](https://github.com/rpm-software-management/rpm)|4.18.2|Marc Ewing & Erik Troan|GNU Public License version 2 (copyleft)| +|[sqlite](https://github.com/sqlite/sqlite)|3.45.0|D. Richard Hipp|Public Domain (no restrictions)| +|[zlib](https://github.com/madler/zlib)|1.3.1|Jean-loup Gailly & Mark Adler|zlib/libpng License| + +* [PyPi packages](framework/requirements.txt) + +## Documentation + +* [Full documentation](http://documentation.wazuh.com) +* [Wazuh installation guide](https://documentation.wazuh.com/current/installation-guide/index.html) + +## Get involved + +Become part of the [Wazuh's community](https://wazuh.com/community/) to learn from other users, participate in discussions, talk to our developers and contribute to the project. + +If you want to contribute to our project please don’t hesitate to make pull-requests, submit issues or send commits, we will review all your questions. + +You can also join our [Slack community channel](https://wazuh.com/community/join-us-on-slack/) and [mailing list](https://groups.google.com/d/forum/wazuh) by sending an email to [wazuh+subscribe@googlegroups.com](mailto:wazuh+subscribe@googlegroups.com), to ask questions and participate in discussions. + +Stay up to date on news, releases, engineering articles and more. + +* [Wazuh website](http://wazuh.com) +* [Linkedin](https://www.linkedin.com/company/wazuh) +* [YouTube](https://www.youtube.com/c/wazuhsecurity) +* [Twitter](https://twitter.com/wazuh) +* [Wazuh blog](https://wazuh.com/blog/) +* [Slack announcements channel](https://wazuh.com/community/join-us-on-slack/) + +## Authors + +Wazuh Copyright (C) 2015-2023 Wazuh Inc. (License GPLv2) + +Based on the OSSEC project started by Daniel Cid. diff --git a/bump_version.sh b/bump_version.sh old mode 100644 new mode 100755 index e69de29bb2..22f7378b6a --- a/bump_version.sh +++ b/bump_version.sh @@ -0,0 +1,219 @@ +#!/bin/bash + +# Bump source version +# Copyright (C) 2015, Wazuh Inc. +# May 2, 2017 + +# Syntax: +# bump_version [ ] [ -r ] [ -p ] +# Example: +# ./bump_version.sh v3.0.0-alpha1 -r 3457 -p 3.0.0.1 + +while [ -n "$1" ] +do + case $1 in + "-p") + if [[ $2 =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]] + then + product=$2 + else + echo "Error: product does not match 'X.X.X.X'" + exit 1 + fi + + shift 2 + ;; + "-r") + if [[ $2 =~ ^[[:digit:]]+$ ]] + then + revision=$2 + else + echo "Error: revision is not numeric." + exit 1 + fi + + shift 2 + ;; + *) + if [[ $1 =~ ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+(-[[:alnum:]]+)?$ ]] + then + version=$1 + else + echo "Error: incorrect version (must have form 'vX.X.X' or 'vX.X.X-...')." + exit 1 + fi + + shift 1 + esac +done + +if [ -z "$version" ] && [ -z "$revision" ] && [ -z "$product" ] +then + echo "Error: no arguments given." + echo "Syntax: $0 [ ] [ -r ] [ -p ]" + exit 1 +fi + +cd $(dirname $0) + +VERSION_FILE="../src/VERSION" +REVISION_FILE="../src/REVISION" +DEFS_FILE="../src/headers/defs.h" +WAZUH_SERVER="../src/init/wazuh-server.sh" +WAZUH_AGENT="../src/init/wazuh-client.sh" +WAZUH_LOCAL="../src/init/wazuh-local.sh" +NSIS_FILE="../src/win32/wazuh-installer.nsi" +MSI_FILE="../src/win32/wazuh-installer.wxs" +FW_INIT="../framework/wazuh/__init__.py" +CLUSTER_INIT="../framework/wazuh/core/cluster/__init__.py" +API_SETUP="../api/setup.py" +API_SPEC="../api/api/spec/spec.yaml" +VERSION_DOCU="../src/Doxyfile" +WIN_RESOURCE="../src/win32/version.rc" + +if [ -n "$version" ] +then + + # File VERSIONS + + echo $version > $VERSION_FILE + + # File defs.h + + egrep "^#define __ossec_version +\"v.+\"" $DEFS_FILE > /dev/null + + if [ $? != 0 ] + then + echo "Error: no suitable version definition found at file $DEFS_FILE" + exit 1 + fi + + sed -E -i'' -e "s/^(#define __ossec_version +)\"v.*\"/\1\"$version\"/" $DEFS_FILE + + # wazuh-control + + sed -E -i'' -e "s/^(VERSION=+)\"v.*\"/\1\"$version\"/" $WAZUH_SERVER + sed -E -i'' -e "s/^(VERSION=+)\"v.*\"/\1\"$version\"/" $WAZUH_AGENT + sed -E -i'' -e "s/^(VERSION=+)\"v.*\"/\1\"$version\"/" $WAZUH_LOCAL + + # File wazuh-installer.nsi + + egrep "^\!define VERSION \".+\"" $NSIS_FILE > /dev/null + + if [ $? != 0 ] + then + echo "Error: no suitable version definition found at file $NSIS_FILE" + exit 1 + fi + + sed -E -i'' -e "s/^(\!define VERSION \").+\"/\1${version:1}\"/g" $NSIS_FILE + + # File wazuh-installer.wxs + + egrep ' /dev/null + + if [ $? != 0 ] + then + echo "Error: no suitable version definition (VER_PRODUCTVERSION_STR) found at file $WIN_RESOURCE" + exit 1 + fi + + sed -E -i'' -e "s/^(#define VER_PRODUCTVERSION_STR +)v.+/\1$version/" $WIN_RESOURCE + + egrep "^#define VER_PRODUCTVERSION [[:digit:]]+,[[:digit:]]+,[[:digit:]]+,[[:digit:]]+" $WIN_RESOURCE > /dev/null + + if [ $? != 0 ] + then + echo "Error: no suitable version definition (VER_PRODUCTVERSION) found at file $WIN_RESOURCE" + exit 1 + fi + + product_commas=`echo "${version:1}.0" | tr '.' ','` + sed -E -i'' -e "s/^(#define VER_PRODUCTVERSION +).+/\1$product_commas/" $WIN_RESOURCE +fi + +if [ -n "$revision" ] +then + CURRENT_VERSION=$(cat $VERSION_FILE) + + # File REVISION + + echo $revision > $REVISION_FILE + + # wazuh-control + + sed -E -i'' -e "s/^(REVISION=+)\".*\"/\1\"$revision\"/" $WAZUH_SERVER + sed -E -i'' -e "s/^(REVISION=+)\".*\"/\1\"$revision\"/" $WAZUH_AGENT + sed -E -i'' -e "s/^(REVISION=+)\".*\"/\1\"$revision\"/" $WAZUH_LOCAL + + # File wazuh-installer.nsi + + egrep "^\!define REVISION \".+\"" $NSIS_FILE > /dev/null + + if [ $? != 0 ] + then + echo "Error: no suitable revision definition found at file $NSIS_FILE" + exit 1 + fi + + sed -E -i'' -e "s/^(\!define REVISION \").+\"/\1$revision\"/g" $NSIS_FILE + + # Cluster + + sed -E -i'' -e "s/__revision__ = '.+'/__revision__ = '$revision'/g" $CLUSTER_INIT + + # API + + sed -E -i'' -e "s/x-revision: .+'/x-revision: '$revision'/g" $API_SPEC + + # Documentation config file + + sed -E -i'' -e "s/PROJECT_NUMBER = \".+\"/PROJECT_NUMBER = \"$CURRENT_VERSION-$revision\"/g" $VERSION_DOCU +fi + +if [ -n "$product" ] +then + + # File wazuh-installer.nsi + + egrep "^VIProductVersion \".+\"" $NSIS_FILE > /dev/null + + if [ $? != 0 ] + then + echo "Error: no suitable product definition found at file $NSIS_FILE" + exit 1 + fi + + sed -E -i'' -e "s/^(VIProductVersion \").+\"/\1$product\"/g" $NSIS_FILE +fi diff --git a/etc/ruleset/rootcheck/cis_apache2224_rcl.txt b/etc/ruleset/rootcheck/cis_apache2224_rcl.txt new file mode 100644 index 0000000000..3086655e6e --- /dev/null +++ b/etc/ruleset/rootcheck/cis_apache2224_rcl.txt @@ -0,0 +1,512 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2017 +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://github.com/ossec/ossec-hids/blob/master/LICENSE +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - p (process running) +# - d (any file inside the directory) +# +# Additional values: +# For the registry , use "->" to look for a specific entry and another +# "->" to look for the value. +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceeded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + +# CIS Checks for Apache Https Server +# Based on Center for Internet Security Benchmark for Apache HttpSserver 2.4 v1.3.1 and Apache HttpsServer 2.2 v3.4.1 (https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308) +# +# +$main-conf=/etc/apache2/apache2.conf,/etc/httpd/conf/httpd.conf; +$conf-dirs=/etc/apache2/conf-enabled,/etc/apache2/mods-enabled,/etc/apache2/sites-enabled,/etc/httpd/conf.d,/etc/httpd/modsecurity.d; +$ssl-confs=/etc/apache2/mods-enabled/ssl.conf,/etc/httpd/conf.d/ssl.conf; +$mods-en=/etc/apache2/mods-enabled; +$request-confs=/etc/httpd/conf/httpd.conf,/etc/apache2/mods-enabled/reqtimeout.conf; +$traceen=/etc/apache2/apache2.conf,/etc/httpd/conf/httpd.conf,/etc/apache2/conf-enabled/security.conf; +# +# +#2.3 Disable WebDAV Modules +[CIS - Apache Configuration - 2.3: WebDAV Modules are enabled] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:$conf-dirs -> conf -> !r:^# && r:loadmodule\sdav; +d:$conf-dirs -> load -> !r:^# && r:loadmodule\sdav; +f:/etc/httpd/conf.d -> !r:^# && r:loadmodule\sdav; +d:$mods-en -> dav.load; +# +# +#2.4 Disable Status Module +[CIS - Apache Configuration - 2.4: Status Module is enabled] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:$conf-dirs -> conf -> !r:^# && r:loadmodule\sstatus; +d:$conf-dirs -> load -> !r:^# && r:loadmodule\sstatus; +f:/etc/httpd/conf.d -> !r:^# && r:loadmodule\sstatus; +d:$mods-en -> status.load; +# +# +#2.5 Disable Autoindex Module +[CIS - Apache Configuration - 2.5: Autoindex Module is enabled] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:$conf-dirs -> conf -> !r:^# && r:loadmodule\sautoindex; +d:$conf-dirs -> load -> !r:^# && r:loadmodule\sautoindex; +f:/etc/httpd/conf.d -> !r:^# && r:loadmodule\sautoindex; +d:$mods-en -> autoindex.load; +# +# +#2.6 Disable Proxy Modules +[CIS - Apache Configuration - 2.6: Proxy Modules are enabled] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:$conf-dirs -> conf -> !r:^# && r:loadmodule\sproxy; +d:$conf-dirs -> load -> !r:^# && r:loadmodule\sproxy; +f:/etc/httpd/conf.d -> !r:^# && r:loadmodule\sproxy; +d:$mods-en -> proxy.load; +# +# +#2.7 Disable User Directories Modules +[CIS - Apache Configuration - 2.7: User Directories Modules are enabled] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:$conf-dirs -> conf -> !r:^# && r:loadmodule\suserdir; +d:$conf-dirs -> load -> !r:^# && r:loadmodule\suserdir; +f:/etc/httpd/conf.d -> !r:^# && r:loadmodule\suserdir; +d:$mods-en -> userdir.load; +# +# +#2.8 Disable Info Module +[CIS - Apache Configuration - 2.8: Info Module is enabled] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:$conf-dirs -> conf -> !r:^# && r:loadmodule\sinfo; +d:$conf-dirs -> load -> !r:^# && r:loadmodule\sinfo; +d:$conf-dirs -> conf -> !r:^# && r:loadmodule\sinfo; +d:$mods-en -> info.load; +# +# +#3.2 Give the Apache User Account an Invalid Shell +[CIS - Apache Configuration - 3.2: Apache User Account has got a valid shell] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:/etc/passwd -> r:/var/www && !r:\.*/bin/false$|/sbin/nologin$; +# +# +#3.3 Lock the Apache User Account +[CIS - Apache Configuration - 3.3: Lock the Apache User Account] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:/etc/shadow -> r:^daemon|^wwwrun|^www-data|^apache && !r:\p!\.*$; +# +# +#4.4 Restrict Override for All Directories +[CIS - Apache Configuration - 4.4: Restrict Override for All Directories] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:$conf-dirs -> conf -> !r:^# && !r:\w+ && r:allowoverride && !r:none$; +d:$conf-dirs -> conf -> !r:^# && !r:\w+ && r:allowoverridelist; +f:$main-conf -> !r:^# && !r:\w+ && r:allowoverride && !r:none$; +f:$main-conf -> !r:^# && !r:\w+ && r:allowoverridelist; +# +# +#5.3 Minimize Options for Other Directories +[CIS - Apache Configuration - 5.3: Minimize Options for other directories] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:$conf-dirs -> conf -> !r:^# && r:options\sincludes; +f:$main-conf -> !r:^# && r:options\sincludes; +# +# +#5.4.1 Remove default index.html sites +[CIS - Apache Configuration - 5.4.1: Remove default index.html sites] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:/var/www -> index.html; +d:/var/www/html -> index.html; +# +# +#5.4.2 Remove the Apache user manual +[CIS - Apache Configuration - 5.4.2: Remove the Apache user manual] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:/etc/httpd/conf.d -> manual.conf; +d:/etc/apache2/conf-enabled -> apache2-doc.conf; +# +# +#5.4.5 Verify that no Handler is enabled +[CIS - Apache Configuration - 5.4.5: A Handler is configured] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:$conf-dirs -> conf -> !r:^# && r:/wsethandler; +f:$main-conf -> !r:^# && r:/wsethandler; +# +# +#5.5 Remove default CGI content printenv +[CIS - Apache Configuration - 5.5: Remove default CGI content printenv] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:/var/www/cgi-bin -> printenv; +d:/usr/lib/cgi-bin -> printenv; +# +# +#5.6 Remove default CGI content test-cgi +[CIS - Apache Configuration - 5.6: Remove default CGI content test-cgi] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:/var/www/cgi-bin -> test-cgi; +d:/usr/lib/cgi-bin -> test-cgi; +# +# +#5.7 Limit HTTP Request Method +[CIS - Apache Configuration - 5.7: Disable HTTP Request Method] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$main-conf -> !r:; +# +# +#5.8 Disable HTTP Trace Method +[CIS - Apache Configuration - 5.8: Disable HTTP Trace Method] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$traceen -> !r:^# && r:traceenable\s+on\s*$; +# +# +#5.9 Restrict HTTP Protocol Versions +[CIS - Apache Configuration - 5.9: Restrict HTTP Protocol Versions] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:/etc/httpd/conf/httpd.conf -> !r:loadmodule\srewrite; +d:$mods-en -> !f:rewrite.load; +f:$main-conf -> !r:rewriteengine\son; +f:$main-conf -> !r:rewritecond && !r:%{THE_REQUEST} && !r:!HTTP/1\\.1\$; +f:$main-conf -> !r:rewriterule && !r:.* - [F]; +# +# +#5.12 Deny IP Address Based Requests +[CIS - Apache Configuration - 5.12: Deny IP Address Based Requests] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:/etc/httpd/conf/httpd.conf -> !r:loadmodule\srewrite; +d:$mods-en -> !f:rewrite.load; +f:$main-conf -> !r:rewriteengine\son; +f:$main-conf -> !r:rewritecond && !r:%{HTTP_HOST} && !r:www\\.\w+\\.\w+ [NC]$; +f:$main-conf -> !r:rewritecond && !r:%{REQUEST_URI} && !r:/error [NC]$; +f:$main-conf -> !r:rewriterule && !r:.\(.*\) - [L,F]$; +# +# +#5.13 Restrict Listen Directive +[CIS - Apache Configuration - 5.13: Restrict Listen Directive] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:$conf-dirs -> conf -> !r:^# && r:listen\s80$; +d:$conf-dirs -> conf -> !r:^# && r:listen\s0.0.0.0\p80; +d:$conf-dirs -> conf -> !r:^# && r:listen\s[\p\pffff\p0.0.0.0]\p80; +f:$main-conf -> !r:^# && r:listen\s80$; +f:$main-conf -> !r:^# && r:listen\s0.0.0.0\p\d*; +f:$main-conf -> !r:^# && r:listen\s[\p\pffff\p0.0.0.0]\p\d*; +f:/etc/apache2/sites-enabled/000-default.conf -> !r:^# && r:listen\s80$; +f:/etc/apache2/sites-enabled/000-default.conf -> !r:^# && r:listen\s0.0.0.0\p\d*; +f:/etc/apache2/sites-enabled/000-default.conf -> !r:^# && r:listen\s[\p\pffff\p0.0.0.0]\p\d*; +f:/etc/apache2/ports.conf -> !r:^# && r:listen\s80$; +f:/etc/apache2/ports.conf -> !r:^# && r:listen\s0.0.0.0\p\d*; +f:/etc/apache2/ports.conf -> !r:^# && r:listen\s[\p\pffff\p0.0.0.0]\p\d*; +# +# +#5.14 Restrict Browser Frame Options +[CIS - Apache Configuration - 5.14: Restrict Browser Frame Options] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$main-conf -> !r:header\salways\sappend\sx-frame-options && !r:sameorigin|deny; +# +# +#6.1 Configure the Error Log to notice at least +[CIS - Apache Configuration - 6.1: Configure the Error Log to notice at least] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$main-conf -> !r:^# && r:loglevel\snotice\score\p && r:warn|emerg|alert|crit|error|notice; +f:$main-conf -> !r:loglevel\snotice\score\p && !r:info|debug; +# +# +#6.2 Configure a Syslog facility for Error Log +[CIS - Apache Configuration - 6.2: Configure a Syslog facility for Error Log] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$main-conf -> !r:errorlog\s+\p*syslog\p\.*\p*; +# +# +#7.6 Disable SSL Insecure Renegotiation +[CIS - Apache Configuration - 7.6: Disable SSL Insecure Renegotiation] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$ssl-confs -> !r:^\t*\s*# && r:sslinsecurerenegotiation\s+on\s*; +f:$ssl-confs -> !r:^\t*\s*# && r:sslinsecurerenegotiation\s*$; +# +# +#7.7 Ensure SSL Compression is not enabled +[CIS - Apache Configuration - 7.7: Ensure SSL Compression is not enabled] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$ssl-confs -> !r:^\t*\s*# && r:sslcompression\s+on\s*; +f:$ssl-confs -> !r:^\t*\s*# && r:sslcompression\s*$; +# +# +#7.8 Disable SSL TLS v1.0 Protocol +[CIS - Apache Configuration - 7.8: Disable insecure TLS Protocol] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$ssl-confs -> !r:^\t*\s*sslprotocol; +f:$ssl-confs -> !r:^\t*\s*# && r:sslprotocol\s+all; +f:$ssl-confs -> !r:^\t*\s*# && r:sslprotocol\s+\.*tlsv1\P\s*; +f:$ssl-confs -> !r:^\t*\s*# && r:sslprotocol\s+\.*sslv2\P\s*; +f:$ssl-confs -> !r:^\t*\s*# && r:sslprotocol\s+\.*sslv3\P\s*; +# +# +#7.9 Enable OCSP Stapling +[CIS - Apache Configuration - 7.9: Enable OCSP Stapling] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:/etc/httpd/conf/httpd.conf -> !r:^loadmodule\s+ssl; +d:$mods-en -> !f:ssl.load; +f:$ssl-confs -> !r:\t*\s*# && r:sslusestapling\s+off; +f:$ssl-confs -> !r:\t*\s*sslusestapling\s+on; +f:$ssl-confs -> !r:\t*\s*sslstaplingcache\s+\.+; +# +# +#7.10 Enable HTTP Strict Transport Security +[CIS - Apache Configuration - 7.10: Enable HTTP Strict Transport Security] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:/etc/apache2/apache2.conf -> !r:Header\salways\sset\sStrict-Transport-Security\s"max-age=\d\d\d\d*"; +f:/etc/apache2/apache2.conf -> !r:^# && r:Header\salways\sset\sStrict-Transport-Security\s"max-age=1\d\d"; +f:/etc/apache2/apache2.conf -> !r:^# && r:Header\salways\sset\sStrict-Transport-Security\s"max-age=2\d\d"; +f:/etc/apache2/apache2.conf -> !r:^# && r:Header\salways\sset\sStrict-Transport-Security\s"max-age=3\d\d"; +f:/etc/apache2/apache2.conf -> !r:^# && r:Header\salways\sset\sStrict-Transport-Security\s"max-age=4\d\d"; +f:/etc/apache2/apache2.conf -> !r:^# && r:Header\salways\sset\sStrict-Transport-Security\s"max-age=5\d\d"; +# +# +#8.1 Set ServerToken to Prod or ProductOnly +[CIS - Apache Configuration - 8.1: Set ServerToken to Prod or ProductOnly] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:$conf-dirs -> conf -> !r:^# && r:servertokens\s+major; +d:$conf-dirs -> conf -> !r:^# && r:servertokens\s+minor; +d:$conf-dirs -> conf -> !r:^# && r:servertokens\s+min; +d:$conf-dirs -> conf -> !r:^# && r:servertokens\s+minimal; +d:$conf-dirs -> conf -> !r:^# && r:servertokens\s+os; +d:$conf-dirs -> conf -> !r:^# && r:servertokens\s+full; +# +# +#8.2: Set ServerSignature to Off +[CIS - Apache Configuration - 8.2: Set ServerSignature to Off] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:$conf-dirs -> conf -> !r:^# && r:serversignature\s+email; +d:$conf-dirs -> conf -> !r:^# && r:serversignature\s+on; +# +# +#8.3: Prevent Information Leakage via Default Apache Content +[CIS - Apache Configuration - 8.3: Prevent Information Leakage via Default Apache Content] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +d:$conf-dirs -> conf -> !r:^\t*\s*# && r:include\s*\w*httpd-autoindex.conf; +d:$conf-dirs -> conf -> !r:^\t*\s*# && r:alias\s*/icons/\s*\.*; +# +# +#9.1:Set TimeOut to 10 or less +[CIS - Apache Configuration - 9.1: Set TimeOut to 10 or less] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$main-conf -> !r:^# && r:timeout\s+9\d; +f:$main-conf -> !r:^# && r:timeout\s+8\d; +f:$main-conf -> !r:^# && r:timeout\s+7\d; +f:$main-conf -> !r:^# && r:timeout\s+6\d; +f:$main-conf -> !r:^# && r:timeout\s+5\d; +f:$main-conf -> !r:^# && r:timeout\s+4\d; +f:$main-conf -> !r:^# && r:timeout\s+3\d; +f:$main-conf -> !r:^# && r:timeout\s+2\d; +f:$main-conf -> !r:^# && r:timeout\s+11; +f:$main-conf -> !r:^# && r:timeout\s+12; +f:$main-conf -> !r:^# && r:timeout\s+13; +f:$main-conf -> !r:^# && r:timeout\s+14; +f:$main-conf -> !r:^# && r:timeout\s+15; +f:$main-conf -> !r:^# && r:timeout\s+16; +f:$main-conf -> !r:^# && r:timeout\s+17; +f:$main-conf -> !r:^# && r:timeout\s+18; +f:$main-conf -> !r:^# && r:timeout\s+19; +f:$main-conf -> !r:^timeout\s+\d\d*; +f:$main-conf -> !r:^# && r:timeout\s+\d\d\d+; +# +# +#9.2:Set the KeepAlive directive to On +[CIS - Apache Configuration - 9.2: Set the KeepAlive directive to On] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$main-conf -> !r:^# && r:keepalive\s+off; +f:$main-conf -> !r:keepalive\s+on; +# +# +#9.3:Set MaxKeepAliveRequests to 100 or greater +[CIS - Apache Configuration - 9.3: Set MaxKeepAliveRequest to 100 or greater] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$main-conf -> !r:^maxkeepaliverequests\s+\d\d\d+; +# +# +#9.4: Set KeepAliveTimeout Low to Mitigate Denial of Service +[CIS - Apache Configuration - 9.4: Set KeepAliveTimeout Low] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$main-conf -> !r:keepalivetimeout\s+\d\d*; +f:$main-conf -> !r:^# && r:keepalivetimeout\s+16; +f:$main-conf -> !r:^# && r:keepalivetimeout\s+17; +f:$main-conf -> !r:^# && r:keepalivetimeout\s+18; +f:$main-conf -> !r:^# && r:keepalivetimeout\s+19; +f:$main-conf -> !r:^# && r:keepalivetimeout\s+2\d; +f:$main-conf -> !r:^# && r:keepalivetimeout\s+3\d; +f:$main-conf -> !r:^# && r:keepalivetimeout\s+4\d; +f:$main-conf -> !r:^# && r:keepalivetimeout\s+5\d; +f:$main-conf -> !r:^# && r:keepalivetimeout\s+6\d; +f:$main-conf -> !r:^# && r:keepalivetimeout\s+7\d; +f:$main-conf -> !r:^# && r:keepalivetimeout\s+8\d; +f:$main-conf -> !r:^# && r:keepalivetimeout\s+9\d; +f:$main-conf -> !r:^# && r:keepalivetimeout\s+\d\d\d+; +# +# +#9.5 Set Timeout Limits for Request Headers +[CIS - Apache Configuration - 9.5: Set Timeout Limits for Request Headers] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:/etc/httpd/conf/httpd.conf -> !r:^loadmodule\s+reqtimeout; +d:$mods-en -> !f:reqtimeout.load; +f:$request-confs -> !r:^\t*\s*requestreadtimeout\.+header\p\d\d*\D\d\d*; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D41; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D42; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D43; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D44; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D45; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D46; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D47; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D48; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D49; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D5\d; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D6\d; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D7\d; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D8\d; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D9\d; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+header\p\d\d\D\d\d\d+; +# +# +#9.6 Set Timeout Limits for Request Body +[CIS - Apache Configuration - 9.6: Set Timeout Limits for Request Body] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:/etc/httpd/conf/httpd.conf -> !r:^loadmodule\s+reqtimeout; +d:$mods-en -> !f:reqtimeout.load; +f:$request-confs -> !r:\t*\s*requestreadtimeout\.+body\p\d\d*; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p21; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p22; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p23; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p24; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p25; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p26; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p27; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p28; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p29; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p3\d; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p4\d; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p5\d; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p6\d; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p7\d; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p8\d; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p9\d; +f:$request-confs -> !r:^\t*\s*# && r:\t*\s*requestreadtimeout\.+body\p\d\d\d+; +# +# +#10.1 Set the LimitRequestLine directive to 512 or less +[CIS - Apache Configuration - 10.1: Set LimitRequestLine to 512 or less] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$main-conf -> !r:^limitrequestline\s+\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\13; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\14; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\15; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\16; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\17; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\18; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\19; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\2\d; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\3\d; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\4\d; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\5\d; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\6\d; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\7\d; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\8\d; +f:$main-conf -> !r:^# && r:limitrequestline\s+5\9\d; +f:$main-conf -> !r:^# && r:limitrequestline\s+6\d\d; +f:$main-conf -> !r:^# && r:limitrequestline\s+7\d\d; +f:$main-conf -> !r:^# && r:limitrequestline\s+8\d\d; +f:$main-conf -> !r:^# && r:limitrequestline\s+9\d\d; +f:$main-conf -> !r:^# && r:limitrequestline\s+\d\d\d\d+; +# +# +#10.2 Set the LimitRequestFields directive to 100 or less +[CIS - Apache Configuration - 10.2: Set LimitRequestFields to 100 or less] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$main-conf -> !r:^limitrequestfields\s\d\d*; +f:$main-conf -> !r:^# && r:limitrequestfields\s+1\d1; +f:$main-conf -> !r:^# && r:limitrequestfields\s+1\d2; +f:$main-conf -> !r:^# && r:limitrequestfields\s+1\d3; +f:$main-conf -> !r:^# && r:limitrequestfields\s+1\d4; +f:$main-conf -> !r:^# && r:limitrequestfields\s+1\d5; +f:$main-conf -> !r:^# && r:limitrequestfields\s+1\d6; +f:$main-conf -> !r:^# && r:limitrequestfields\s+1\d7; +f:$main-conf -> !r:^# && r:limitrequestfields\s+1\d8; +f:$main-conf -> !r:^# && r:limitrequestfields\s+1\d9; +f:$main-conf -> !r:^# && r:limitrequestfields\s+11\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+12\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+13\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+14\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+15\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+16\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+17\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+18\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+19\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+2\d\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+3\d\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+4\d\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+5\d\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+6\d\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+7\d\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+8\d\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+9\d\d; +f:$main-conf -> !r:^# && r:limitrequestfields\s+\d\d\d\d+; +# +# +#10.3 Set the LimitRequestFieldsize directive to 1024 or less +[CIS - Apache Configuration - 10.3: Set LimitRequestFieldsize to 1024 or less] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$main-conf -> !r:^limitrequestfieldsize\s+\d\d*; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+1\d25; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+1\d26; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+1\d27; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+1\d28; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+1\d29; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+1\d3\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+1\d4\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+1\d5\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+1\d6\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+1\d7\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+1\d8\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+1\d9\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+11\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+12\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+13\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+14\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+15\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+16\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+17\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+18\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+19\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+2\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+3\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+4\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+5\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+6\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+7\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+8\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+9\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestfieldsize\s+\d\d\d\d\d+; +# +# +#10.4 Set the LimitRequestBody directive to 102400 or less +[CIS - Apache Configuration - 10.4: Set LimitRequestBody to 102400 or less] [any] [https://workbench.cisecurity.org/benchmarks/307, https://workbench.cisecurity.org/benchmarks/308] +f:$main-conf -> !r:^limitrequestbody\s+\d\d*; +f:$main-conf -> !r:^# && r:limitrequestbody\s+0\s*$; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d24\d1; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d24\d2; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d24\d3; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d24\d4; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d24\d5; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d24\d6; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d24\d7; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d24\d8; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d24\d9; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d241\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d242\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d243\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d244\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d245\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d246\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d247\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d248\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d249\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d25\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d26\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d27\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d28\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d29\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d3\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d4\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d5\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d6\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d7\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d8\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+1\d9\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+11\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+12\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+13\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+14\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+15\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+16\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+17\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+18\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+19\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+2\d\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+3\d\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+4\d\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+5\d\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+6\d\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+7\d\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+8\d\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+9\d\d\d\d\d; +f:$main-conf -> !r:^# && r:limitrequestbody\s+\d\d\d\d\d\d\d+; diff --git a/etc/ruleset/rootcheck/cis_debian_linux_rcl.txt b/etc/ruleset/rootcheck/cis_debian_linux_rcl.txt new file mode 100644 index 0000000000..bc12c32cc0 --- /dev/null +++ b/etc/ruleset/rootcheck/cis_debian_linux_rcl.txt @@ -0,0 +1,203 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2008 Daniel B. Cid - dcid@ossec.net +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://www.gnu.org/licenses/gpl.html +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - p (process running) +# - d (any file inside the directory) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + +# CIS Checks for Debian/Ubuntu +# Based on Center for Internet Security Benchmark for Debian Linux v1.0 + +# Main one. Only valid for Debian/Ubuntu. +[CIS - Testing against the CIS Debian Linux Benchmark v1.0] [all required] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/debian_version; +f:/proc/sys/kernel/ostype -> Linux; + + +# Section 1.4 - Partition scheme. +[CIS - Debian Linux - 1.4 - Robust partition scheme - /tmp is not on its own partition {CIS: 1.4 Debian Linux}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/fstab -> !r:/tmp; + +[CIS - Debian Linux - 1.4 - Robust partition scheme - /opt is not on its own partition {CIS: 1.4 Debian Linux}] [all] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/opt; +f:/etc/fstab -> !r:/opt; + +[CIS - Debian Linux - 1.4 - Robust partition scheme - /var is not on its own partition {CIS: 1.4 Debian Linux}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/fstab -> !r:/var; + + +# Section 2.3 - SSH configuration +[CIS - Debian Linux - 2.3 - SSH Configuration - Protocol version 1 enabled {CIS: 2.3 Debian Linux} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\.+1; + +[CIS - Debian Linux - 2.3 - SSH Configuration - IgnoreRHosts disabled {CIS: 2.3 Debian Linux} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\.+no; + +[CIS - Debian Linux - 2.3 - SSH Configuration - Empty passwords permitted {CIS: 2.3 Debian Linux} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:^PermitEmptyPasswords\.+yes; + +[CIS - Debian Linux - 2.3 - SSH Configuration - Host based authentication enabled {CIS: 2.3 Debian Linux} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\.+yes; + +[CIS - Debian Linux - 2.3 - SSH Configuration - Root login allowed {CIS: 2.3 Debian Linux} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\.+yes; + + +# Section 2.4 Enable system accounting +#[CIS - Debian Linux - 2.4 - System Accounting - Sysstat not installed {CIS: 2.4 Debian Linux}] [all] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +#f:!/etc/default/sysstat; +#f:!/var/log/sysstat; + +#[CIS - Debian Linux - 2.4 - System Accounting - Sysstat not enabled {CIS: 2.4 Debian Linux}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +#f:!/etc/default/sysstat; +#f:/etc/default/sysstat -> !r:^# && r:ENABLED="false"; + + +# Section 2.5 Install and run Bastille +#[CIS - Debian Linux - 2.5 - System harderning - Bastille is not installed {CIS: 2.5 Debian Linux}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +#f:!/etc/Bastille; + + +# Section 2.6 Ensure sources.list Sanity +[CIS - Debian Linux - 2.6 - Sources list sanity - Security updates not enabled {CIS: 2.6 Debian Linux} {PCI_DSS: 6.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:!/etc/apt/sources.list; +f:!/etc/apt/sources.list -> !r:^# && r:http://security.debian|http://security.ubuntu; + + +# Section 3 - Minimize inetd services +[CIS - Debian Linux - 3.3 - Telnet enabled on inetd {CIS: 3.3 Debian Linux} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/inetd.conf -> !r:^# && r:telnet; + +[CIS - Debian Linux - 3.4 - FTP enabled on inetd {CIS: 3.4 Debian Linux} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/inetd.conf -> !r:^# && r:/ftp; + +[CIS - Debian Linux - 3.5 - rsh/rlogin/rcp enabled on inetd {CIS: 3.5 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/inetd.conf -> !r:^# && r:shell|login; + +[CIS - Debian Linux - 3.6 - tftpd enabled on inetd {CIS: 3.6 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/inetd.conf -> !r:^# && r:tftp; + +[CIS - Debian Linux - 3.7 - imap enabled on inetd {CIS: 3.7 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/inetd.conf -> !r:^# && r:imap; + +[CIS - Debian Linux - 3.8 - pop3 enabled on inetd {CIS: 3.8 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/inetd.conf -> !r:^# && r:pop; + +[CIS - Debian Linux - 3.9 - Ident enabled on inetd {CIS: 3.9 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/inetd.conf -> !r:^# && r:ident; + + +# Section 4 - Minimize boot services +[CIS - Debian Linux - 4.1 - Disable inetd - Inetd enabled but no services running {CIS: 4.1 Debian Linux} {PCI_DSS: 2.2.2}] [all] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +p:inetd; +f:!/etc/inetd.conf -> !r:^# && r:wait; + +[CIS - Debian Linux - 4.3 - GUI login enabled {CIS: 4.3 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/inittab -> !r:^# && r:id:5; + +[CIS - Debian Linux - 4.6 - Disable standard boot services - Samba Enabled {CIS: 4.6 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/init.d/samba; + +[CIS - Debian Linux - 4.7 - Disable standard boot services - NFS Enabled {CIS: 4.7 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/init.d/nfs-common; +f:/etc/init.d/nfs-user-server; +f:/etc/init.d/nfs-kernel-server; + +[CIS - Debian Linux - 4.9 - Disable standard boot services - NIS Enabled {CIS: 4.9 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/init.d/nis; + +[CIS - Debian Linux - 4.13 - Disable standard boot services - Web server Enabled {CIS: 4.13 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/init.d/apache; +f:/etc/init.d/apache2; + +[CIS - Debian Linux - 4.15 - Disable standard boot services - DNS server Enabled {CIS: 4.15 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/init.d/bind; + +[CIS - Debian Linux - 4.16 - Disable standard boot services - MySQL server Enabled {CIS: 4.16 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/init.d/mysql; + +[CIS - Debian Linux - 4.16 - Disable standard boot services - PostgreSQL server Enabled {CIS: 4.16 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/init.d/postgresql; + +[CIS - Debian Linux - 4.17 - Disable standard boot services - Webmin Enabled {CIS: 4.17 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/init.d/webmin; + +[CIS - Debian Linux - 4.18 - Disable standard boot services - Squid Enabled {CIS: 4.18 Debian Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/init.d/squid; + + +# Section 5 - Kernel tuning +[CIS - Debian Linux - 5.1 - Network parameters - Source routing accepted {CIS: 5.1 Debian Linux}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/accept_source_route -> 1; + +[CIS - Debian Linux - 5.1 - Network parameters - ICMP broadcasts accepted {CIS: 5.1 Debian Linux}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts -> 0; + +[CIS - Debian Linux - 5.2 - Network parameters - IP Forwarding enabled {CIS: 5.2 Debian Linux}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/proc/sys/net/ipv4/ip_forward -> 1; +f:/proc/sys/net/ipv6/ip_forward -> 1; + + +# Section 7 - Permissions +[CIS - Debian Linux - 7.1 - Partition /var without 'nodev' set {CIS: 7.1 Debian Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/var && !r:nodev; + +[CIS - Debian Linux - 7.1 - Partition /tmp without 'nodev' set {CIS: 7.1 Debian Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/tmp && !r:nodev; + +[CIS - Debian Linux - 7.1 - Partition /opt without 'nodev' set {CIS: 7.1 Debian Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/opt && !r:nodev; + +[CIS - Debian Linux - 7.1 - Partition /home without 'nodev' set {CIS: 7.1 Debian Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/home && !r:nodev ; + +[CIS - Debian Linux - 7.2 - Removable partition /media without 'nodev' set {CIS: 7.2 Debian Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nodev; + +[CIS - Debian Linux - 7.2 - Removable partition /media without 'nosuid' set {CIS: 7.2 Debian Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nosuid; + +[CIS - Debian Linux - 7.3 - User-mounted removable partition /media {CIS: 7.3 Debian Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && r:user; + + +# Section 8 - Access and authentication +[CIS - Debian Linux - 8.8 - LILO Password not set {CIS: 8.8 Debian Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/lilo.conf -> !r:^# && !r:restricted; +f:/etc/lilo.conf -> !r:^# && !r:password=; + +[CIS - Debian Linux - 8.8 - GRUB Password not set {CIS: 8.8 Debian Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/boot/grub/menu.lst -> !r:^# && !r:password; + +[CIS - Debian Linux - 9.2 - Account with empty password present {CIS: 9.2 Debian Linux} {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/shadow -> r:^\w+::; + +[CIS - Debian Linux - 13.11 - Non-root account with uid 0 {CIS: 13.11 Debian Linux} {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Debian_Benchmark_v1.0.pdf] +f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:; diff --git a/etc/ruleset/rootcheck/cis_mysql5_6_community_rcl.txt b/etc/ruleset/rootcheck/cis_mysql5_6_community_rcl.txt new file mode 100644 index 0000000000..25eb72e3a8 --- /dev/null +++ b/etc/ruleset/rootcheck/cis_mysql5_6_community_rcl.txt @@ -0,0 +1,165 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2017 +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://github.com/ossec/ossec-hids/blob/master/LICENSE +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - p (process running) +# - d (any file inside the directory) +# +# Additional values: +# For the registry , use "->" to look for a specific entry and another +# "->" to look for the value. +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceeded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + +# CIS Checks for MYSQL +# Based on Center for Internet Security Benchmark for MYSQL v1.1.0 +# +$home_dirs=/usr2/home/*,/home/*,/home,/*/home/*,/*/home,/; +$enviroment_files=/*/home/*/\.bashrc,/*/home/*/\.profile,/*/home/*/\.bash_profile,/home/*/\.bashrc,/home/*/\.profile,/home/*/\.bash_profile; +$mysql-cnfs=/etc/mysql/my.cnf,/etc/mysql/mariadb.cnf,/etc/mysql/conf.d/*.cnf,/etc/mysql/mariadb.conf.d/*.cnf,~/.my.cnf; +# +# +#1.3 Disable MySQL Command History +[CIS - MySQL Configuration - 1.3: Disable MySQL Command History] [any] [https://workbench.cisecurity.org/files/1310/download] +d:$home_dirs -> ^.mysql_history$; +# +# +#1.5 Disable Interactive Login +[CIS - MySQL Configuration - 1.5: Disable Interactive Login] [any] [https://workbench.cisecurity.org/files/1310/download] +f:/etc/passwd -> r:^mysql && !r:\.*/bin/false$|/sbin/nologin$; +# +# +#1.6 Verify That 'MYSQL_PWD' Is Not In Use +[CIS - MySQL Configuration - 1.6: 'MYSQL_PWD' Is in Use] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$enviroment_files -> r:\.*MYSQL_PWD\.*; +# +# +#4.3 Ensure 'allow-suspicious-udfs' Is Set to 'FALSE' +[CIS - MySQL Configuration - 4.3: 'allow-suspicious-udfs' Is Set in my.cnf'] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:allow-suspicious-udfs\.+true; +f:$mysql-cnfs -> r:allow-suspicious-udfs\s*$; +# +# +#4.4 Ensure 'local_infile' Is Disabled +[CIS - MySQL Configuration - 4.4: local_infile is not forbidden in my.cnf] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:local-infile\s*=\s*1; +f:$mysql-cnfs -> r:local-infile\s*$; +# +# +#4.5 Ensure 'mysqld' Is Not Started with '--skip-grant-tables' +[CIS - MySQL Configuration - 4.5: skip-grant-tables is set in my.cnf] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:skip-grant-tables\s*=\s*true; +f:$mysql-cnfs -> !r:skip-grant-tables\s*=\s*false; +f:$mysql-cnfs -> r:skip-grant-tables\s*$; +# +# +#4.6 Ensure '--skip-symbolic-links' Is Enabled +[CIS - MySQL Configuration - 4.6: skip_symbolic_links is not enabled in my.cnf] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:skip_symbolic_links\s*=\s*no; +f:$mysql-cnfs -> !r:skip_symbolic_links\s*=\s*yes; +f:$mysql-cnfs -> r:skip_symbolic_links\s*$; +# +# +#4.8 Ensure 'secure_file_priv' is not empty +[CIS - MySQL Configuration - 4.8: Ensure 'secure_file_priv' is not empty] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> r:^# && r:secure_file_priv=\s*\S+\s*; +f:$mysql-cnfs -> !r:secure_file_priv=\s*\S+\s*; +f:$mysql-cnfs -> r:secure_file_priv\s*$; +# +# +#4.9 Ensure 'sql_mode' Contains 'STRICT_ALL_TABLES' +[CIS - MySQL Configuration - 4.9: strict_all_tables is not set at sql_mode section of my.cnf] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:strict_all_tables\s*$; +# +# +#6.1 Ensure 'log_error' is not empty +[CIS - MySQL Configuration - 6.1: log-error is not set in my.cnf] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> r:^# && r:log_error\s*=\s*\S+\s*; +f:$mysql-cnfs -> !r:log_error\s*=\s*\S+\s*; +f:$mysql-cnfs -> r:log_error\s*$; +# +# +#6.2 Ensure Log Files are not Stored on a non-system partition +[CIS - MySQL Configuration - 6.2: log files are maybe stored on systempartition] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:log_bin= && !r:\s*/\S*\s*; +f:$mysql-cnfs -> !r:^# && r:log_bin= && !r:\s*/var/\S*\s*; +f:$mysql-cnfs -> !r:^# && r:log_bin= && !r:\s*/usr/\S*\s*; +f:$mysql-cnfs -> r:log_bin\s*$; +# +# +#6.3 Ensure 'log_warning' is set to 2 at least +[CIS - MySQL Configuration - 6.3: log warnings is set low] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:log_warnings\s*=\s*0; +f:$mysql-cnfs -> !r:^# && r:log_warnings\s*=\s*1; +f:$mysql-cnfs -> !r:log_warnings\s*=\s*\d+; +f:$mysql-cnfs -> r:log_warnings\s*$; +# +# +#6.5 Ensure 'log_raw' is set to 'off' +[CIS - MySQL Configuration - 6.5: log_raw is not set to off] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:log-raw\s*=\s*on; +f:$mysql-cnfs -> r:log-raw\s*$; +# +# +#7.1 Ensure 'old_password' is not set to '1' or 'On' +[CIS - MySQL Configuration - 7.1:Ensure 'old_passwords' is not set to '1' or 'on'] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:old_passwords\s*=\s*1; +f:$mysql-cnfs -> !r:^# && r:old_passwords\s*=\s*on; +f:$mysql-cnfs -> !r:old_passwords\s*=\s*2; +f:$mysql-cnfs -> r:old_passwords\s*$; +# +# +#7.2 Ensure 'secure_auth' is set to 'ON' +[CIS - MySQL Configuration - 7.2: Ensure 'secure_auth' is set to 'ON'] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:secure_auth\s*=\s*off; +f:$mysql-cnfs -> !r:secure_auth\s*=\s*on; +f:$mysql-cnfs -> r:secure_auth\s*$; +# +# +#7.3 Ensure Passwords Are Not Stored in the Global Configuration +[CIS - MySQL Configuration - 7.3: Passwords are stored in global configuration] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:^\s*password\.*; +# +# +#7.4 Ensure 'sql_mode' Contains 'NO_AUTO_CREATE_USER' +[CIS - MySQL Configuration - 7.4: Ensure 'sql_mode' Contains 'NO_AUTO_CREATE_USER'] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:no_auto_create_user\s*$; +f:$mysql-cnfs -> r:^# && r:\s*no_auto_create_user\s*$; +# +# +#7.6 Ensure Password Policy is in Place +[CIS - MySQL Configuration - 7.6: Ensure Password Policy is in Place ] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:plugin-load\s*=\s*validate_password.so\s*$; +f:$mysql-cnfs -> !r:validate-password\s*=\s*force_plus_permanent\s*$; +f:$mysql-cnfs -> !r:validate_password_length\s*=\s*14\s$; +f:$mysql-cnfs -> !r:validate_password_mixed_case_count\s*=\s*1\s*$; +f:$mysql-cnfs -> !r:validate_password_number_count\s*=\s*1\s*$; +f:$mysql-cnfs -> !r:validate_password_special_char_count\s*=\s*1; +f:$mysql-cnfs -> !r:validate_password_policy\s*=\s*medium\s*; +# +# +#9.2 Ensure 'master_info_repository' is set to 'Table' +[CIS - MySQL Configuration - 9.2: Ensure 'master_info_repositrory' is set to 'Table'] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:master_info_repository\s*=\s*file; +f:$mysql-cnfs -> !r:master_info_repository\s*=\s*table; +f:$mysql-cnfs -> r:master_info_repository\s*$; diff --git a/etc/ruleset/rootcheck/cis_mysql5_6_enterprise_rcl.txt b/etc/ruleset/rootcheck/cis_mysql5_6_enterprise_rcl.txt new file mode 100644 index 0000000000..2e1671b570 --- /dev/null +++ b/etc/ruleset/rootcheck/cis_mysql5_6_enterprise_rcl.txt @@ -0,0 +1,215 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2017 +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://github.com/ossec/ossec-hids/blob/master/LICENSE +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - p (process running) +# - d (any file inside the directory) +# +# Additional values: +# For the registry , use "->" to look for a specific entry and another +# "->" to look for the value. +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceeded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + +# CIS Checks for MYSQL +# Based on Center for Internet Security Benchmark for MYSQL v1.1.0 +# +$home_dirs=/usr2/home/*,/home/*,/home,/*/home/*,/*/home,/; +$enviroment_files=/*/home/*/\.bashrc,/*/home/*/\.profile,/*/home/*/\.bash_profile,/home/*/\.bashrc,/home/*/\.profile,/home/*/\.bash_profile; +$mysql-cnfs=/etc/mysql/my.cnf,/etc/mysql/mariadb.cnf,/etc/mysql/conf.d/*.cnf,/etc/mysql/mariadb.conf.d/*.cnf,~/.my.cnf; +# +# +#1.3 Disable MySQL Command History +[CIS - MySQL Configuration - 1.3: Disable MySQL Command History] [any] [https://workbench.cisecurity.org/files/1310/download] +d:$home_dirs -> ^.mysql_history$; +# +# +#1.5 Disable Interactive Login +[CIS - MySQL Configuration - 1.5: Disable Interactive Login] [any] [https://workbench.cisecurity.org/files/1310/download] +f:/etc/passwd -> r:^mysql && !r:\.*/bin/false$|/sbin/nologin$; +# +# +#1.6 Verify That 'MYSQL_PWD' Is Not In Use +[CIS - MySQL Configuration - 1.6: 'MYSQL_PWD' Is in Use] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$enviroment_files -> r:\.*MYSQL_PWD\.*; +# +# +#4.3 Ensure 'allow-suspicious-udfs' Is Set to 'FALSE' +[CIS - MySQL Configuration - 4.3: 'allow-suspicious-udfs' Is Set in my.cnf'] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:allow-suspicious-udfs\.+true; +f:$mysql-cnfs -> r:allow-suspicious-udfs\s*$; +# +# +#4.4 Ensure 'local_infile' Is Disabled +[CIS - MySQL Configuration - 4.4: local_infile is not forbidden in my.cnf] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:local-infile\s*=\s*1; +f:$mysql-cnfs -> r:local-infile\s*$; +# +# +#4.5 Ensure 'mysqld' Is Not Started with '--skip-grant-tables' +[CIS - MySQL Configuration - 4.5: skip-grant-tables is set in my.cnf] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:skip-grant-tables\s*=\s*true; +f:$mysql-cnfs -> !r:skip-grant-tables\s*=\s*false; +f:$mysql-cnfs -> r:skip-grant-tables\s*$; +# +# +#4.6 Ensure '--skip-symbolic-links' Is Enabled +[CIS - MySQL Configuration - 4.6: skip_symbolic_links is not enabled in my.cnf] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:skip_symbolic_links\s*=\s*no; +f:$mysql-cnfs -> !r:skip_symbolic_links\s*=\s*yes; +f:$mysql-cnfs -> r:skip_symbolic_links\s*$; +# +# +#4.8 Ensure 'secure_file_priv' is not empty +[CIS - MySQL Configuration - 4.8: Ensure 'secure_file_priv' is not empty] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> r:^# && r:secure_file_priv=\s*\S+\s*; +f:$mysql-cnfs -> !r:secure_file_priv=\s*\S+\s*; +f:$mysql-cnfs -> r:secure_file_priv\s*$; +# +# +#4.9 Ensure 'sql_mode' Contains 'STRICT_ALL_TABLES' +[CIS - MySQL Configuration - 4.9: strict_all_tables is not set at sql_mode section of my.cnf] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:strict_all_tables\s*$; +# +# +#6.1 Ensure 'log_error' is not empty +[CIS - MySQL Configuration - 6.1: log-error is not set in my.cnf] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> r:^# && r:log_error\s*=\s*\S+\s*; +f:$mysql-cnfs -> !r:log_error\s*=\s*\S+\s*; +f:$mysql-cnfs -> r:log_error\s*$; +# +# +#6.2 Ensure Log Files are not Stored on a non-system partition +[CIS - MySQL Configuration - 6.2: log files are maybe stored on systempartition] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:log_bin= && !r:\s*/\S*\s*; +f:$mysql-cnfs -> !r:^# && r:log_bin= && !r:\s*/var/\S*\s*; +f:$mysql-cnfs -> !r:^# && r:log_bin= && !r:\s*/usr/\S*\s*; +f:$mysql-cnfs -> r:log_bin\s*$; +# +# +#6.3 Ensure 'log_warning' is set to 2 at least +[CIS - MySQL Configuration - 6.3: log warnings is set low] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:log_warnings\s*=\s*0; +f:$mysql-cnfs -> !r:^# && r:log_warnings\s*=\s*1; +f:$mysql-cnfs -> !r:log_warnings\s*=\s*\d+; +f:$mysql-cnfs -> r:log_warnings\s*$; +# +# +#6.4 Ensure 'log_raw' is set to 'off' +[CIS - MySQL Configuration - 6.4: log_raw is not set to off] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:log-raw\s*=\s*on; +f:$mysql-cnfs -> r:log-raw\s*$; +# +# +#6.5 Ensure audit_log_connection_policy is not set to 'none' +[CIS - MySQL Configuration - 6.5: audit_log_connection_policy is set to 'none' change it to all or erros] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r^# && r::audit_log_connection_policy\s*=\s*none; +f:$mysql-cnfs -> r:audit_log_connection_policy\s*$; +# +# +#6.6 Ensure audit_log_exclude_account is set to Null +[CIS - MySQL Configuration - 6.6:audit_log_exclude_accounts is not set to Null] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:audit_log_exclude_accounts\s*=\s* && !r:null\s*$; +f:$mysql-cnfs -> r:audit_log_exclude_accounts\s*$; +# +# +#6.7 Ensure audit_log_include_accounts is set to Null +[CIS - MySQL Configuration - 6.7:audit_log_include_accounts is not set to Null] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:audit_log_include_accounts\s*=\s* && !r:null\s*$; +f:$mysql-cnfs -> r:audit_log_include_accounts\s*$; +# +# +#6.9 Ensure audit_log_policy is not set to all +[CIS - MySQL Configuration - 6.9: audit_log_policy is not set to all] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:audit_log_policy\s*=\s*queries; +f:$mysql-cnfs -> !r:^# && r:audit_log_policy\s*=\s*none; +f:$mysql-cnfs -> !r:^# && r:audit_log_policy\s*=\s*logins; +f:$mysql-cnfs -> r:audit_log_policy\s*$; +# +# +#6.10 Ensure audit_log_statement_policy is set to all +[CIS - MySQL Configuration - 6.10: Ensure audit_log_statement_policy is set to all] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:audit_log_statement_policy\.+errors; +f:$mysql-cnfs -> !r:^# && r:audit_log_statement_policy\.+none; +f:$mysql-cnfs -> r:audit_log_statement_policy\s*$; +# +# +#6.11 Ensure audit_log_strategy is set to synchronous or semisynchronous +[CIS - MySQL Configuration - 6.11: Ensure audit_log_strategy is set to all] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:audit_log_strategy\.+asynchronous; +f:$mysql-cnfs -> !r:^# && r:audit_log_strategy\.+performance; +f:$mysql-cnfs -> !r:audit_log_strategy\s*=\s* && r:semisynchronous|synchronous; +f:$mysql-cnfs -> r:audit_log_strategy\s*$; +# +# +#6.12 Make sure the audit plugin can't be unloaded +[CIS - MySQL Configuration - 6.12: Audit plugin can be unloaded] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:^audit_log\s*=\s*on\s*; +f:$mysql-cnfs -> !r:^# && r:^audit_log\s*=\s*off\s*; +f:$mysql-cnfs -> !r:^# && r:^audit_log\s*=\s*force\s*; +f:$mysql-cnfs -> !r:^audit_log\s*=\s*force_plus_permanent\s*; +f:$mysql-cnfs -> r:^audit_log\s$; +# +# +#7.1 Ensure 'old_password' is not set to '1' or 'On' +[CIS - MySQL Configuration - 7.1:Ensure 'old_passwords' is not set to '1' or 'on'] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:old_passwords\s*=\s*1; +f:$mysql-cnfs -> !r:^# && r:old_passwords\s*=\s*on; +f:$mysql-cnfs -> !r:old_passwords\s*=\s*2; +f:$mysql-cnfs -> r:old_passwords\s*$; +# +# +#7.2 Ensure 'secure_auth' is set to 'ON' +[CIS - MySQL Configuration - 7.2: Ensure 'secure_auth' is set to 'ON'] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:secure_auth\s*=\s*off; +f:$mysql-cnfs -> !r:secure_auth\s*=\s*on; +f:$mysql-cnfs -> r:secure_auth\s*$; +# +# +#7.3 Ensure Passwords Are Not Stored in the Global Configuration +[CIS - MySQL Configuration - 7.3: Passwords are stored in global configuration] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:^\s*password\.*; +# +# +#7.4 Ensure 'sql_mode' Contains 'NO_AUTO_CREATE_USER' +[CIS - MySQL Configuration - 7.4: Ensure 'sql_mode' Contains 'NO_AUTO_CREATE_USER'] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:no_auto_create_user\s*$; +f:$mysql-cnfs -> r:^# && r:\s*no_auto_create_user\s*$; +# +# +#7.6 Ensure Password Policy is in Place +[CIS - MySQL Configuration - 7.6: Ensure Password Policy is in Place ] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:plugin-load\s*=\s*validate_password.so\s*$; +f:$mysql-cnfs -> !r:validate-password\s*=\s*force_plus_permanent\s*$; +f:$mysql-cnfs -> !r:validate_password_length\s*=\s*14\s$; +f:$mysql-cnfs -> !r:validate_password_mixed_case_count\s*=\s*1\s*$; +f:$mysql-cnfs -> !r:validate_password_number_count\s*=\s*1\s*$; +f:$mysql-cnfs -> !r:validate_password_special_char_count\s*=\s*1; +f:$mysql-cnfs -> !r:validate_password_policy\s*=\s*medium\s*; +# +# +#9.2 Ensure 'master_info_repository' is set to 'Table' +[CIS - MySQL Configuration - 9.2: Ensure 'master_info_repositrory' is set to 'Table'] [any] [https://workbench.cisecurity.org/files/1310/download] +f:$mysql-cnfs -> !r:^# && r:master_info_repository\s*=\s*file; +f:$mysql-cnfs -> !r:master_info_repository\s*=\s*table; +f:$mysql-cnfs -> r:master_info_repository\s*$; diff --git a/etc/ruleset/rootcheck/cis_rhel5_linux_rcl.txt b/etc/ruleset/rootcheck/cis_rhel5_linux_rcl.txt new file mode 100644 index 0000000000..afc16ff24f --- /dev/null +++ b/etc/ruleset/rootcheck/cis_rhel5_linux_rcl.txt @@ -0,0 +1,852 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2014 +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://www.gnu.org/licenses/gpl.html +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - p (process running) +# - d (any file inside the directory) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + + +# CIS Checks for Red Hat / CentOS 5 +# Based on CIS Benchmark for Red Hat Enterprise Linux 5 v2.1.0 + +# TODO: URL is invalid currently + +# RC scripts location +$rc_dirs=/etc/rc.d/rc2.d,/etc/rc.d/rc3.d,/etc/rc.d/rc4.d,/etc/rc.d/rc5.d; + + +[CIS - Testing against the CIS Red Hat Enterprise Linux 5 Benchmark v2.1.0] [any required] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/redhat-release -> r:^Red Hat Enterprise Linux \S+ release 5; +f:/etc/redhat-release -> r:^CentOS && r:release 5; +f:/etc/redhat-release -> r:^Cloud && r:release 5; +f:/etc/redhat-release -> r:^Oracle && r:release 5; +f:/etc/redhat-release -> r:^Better && r:release 5; + + +# 1.1.1 /tmp: partition +[CIS - RHEL5 - - Build considerations - Robust partition scheme - /tmp is not on its own partition {CIS: 1.1.1 RHEL5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> !r:/tmp; + +# 1.1.2 /tmp: nodev +[CIS - RHEL5 - 1.1.2 - Partition /tmp without 'nodev' set {CIS: 1.1.2 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nodev; + +# 1.1.3 /tmp: nosuid +[CIS - RHEL5 - 1.1.3 - Partition /tmp without 'nosuid' set {CIS: 1.1.3 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nosuid; + +# 1.1.4 /tmp: noexec +[CIS - RHEL5 - 1.1.4 - Partition /tmp without 'noexec' set {CIS: 1.1.4 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nodev; + +# 1.1.5 Build considerations - Partition scheme. +[CIS - RHEL5 - - Build considerations - Robust partition scheme - /var is not on its own partition {CIS: 1.1.5 RHEL5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> !r^# && !r:/var; + +# 1.1.6 bind mount /var/tmp to /tmp +[CIS - RHEL5 - - Build considerations - Robust partition scheme - /var/tmp is bound to /tmp {CIS: 1.1.6 RHEL5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> r:^# && !r:/var/tmp && !r:bind; + +# 1.1.7 /var/log: partition +[CIS - RHEL5 - - Build considerations - Robust partition scheme - /var/log is not on its own partition {CIS: 1.1.7 RHEL5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> ^# && !r:/var/log; + +# 1.1.8 /var/log/audit: partition +[CIS - RHEL5 - - Build considerations - Robust partition scheme - /var/log/audit is not on its own partition {CIS: 1.1.8 RHEL5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> ^# && !r:/var/log/audit; + +# 1.1.9 /home: partition +[CIS - RHEL5 - - Build considerations - Robust partition scheme - /home is not on its own partition {CIS: 1.1.9 Debian RHEL5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> ^# && !r:/home; + +# 1.1.10 /home: nodev +[CIS - RHEL5 - 1.1.10 - Partition /home without 'nodev' set {CIS: 1.1.10 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/home && !r:nodev; + +# 1.1.11 nodev on removable media partitions (not scored) +[CIS - RHEL5 - 1.1.11 - Removable partition /media without 'nodev' set {CIS: 1.1.11 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nodev; + +# 1.1.12 noexec on removable media partitions (not scored) +[CIS - RHEL5 - 1.1.12 - Removable partition /media without 'noexec' set {CIS: 1.1.12 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:noexec; + +# 1.1.13 nosuid on removable media partitions (not scored) +[CIS - RHEL5 - 1.1.13 - Removable partition /media without 'nosuid' set {CIS: 1.1.13 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nosuid; + +# 1.1.14 /dev/shm: nodev +[CIS - RHEL5 - 1.1.11 - /dev/shm without 'nodev' set {CIS: 1.1.14 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:nodev; + +# 1.1.15 /dev/shm: nosuid +[CIS - RHEL5 - 1.1.11 - /dev/shm without 'nosuid' set {CIS: 1.1.15 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:nosuid; + +# 1.1.16 /dev/shm: noexec +[CIS - RHEL5 - 1.1.11 - /dev/shm without 'noexec' set {CIS: 1.1.16 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:noexec; + +# 1.1.17 sticky bit on world writable directories (Scored) +# TODO + +# 1.1.18 disable cramfs (not scored) + +# 1.1.19 disable freevxfs (not scored) + +# 1.1.20 disable jffs2 (not scored) + +# 1.1.21 disable hfs (not scored) + +# 1.1.22 disable hfsplus (not scored) + +# 1.1.23 disable squashfs (not scored) + +# 1.1.24 disable udf (not scored) + + +########################################## +# 1.2 Software Updates +########################################## + +# 1.2.1 Configure rhn updates (not scored) + +# 1.2.2 verify RPM gpg keys (Scored) +# TODO + +# 1.2.3 verify gpgcheck enabled (Scored) +# TODO + +# 1.2.4 Disable rhnsd (not scored) + +# 1.2.5 Disable yum-updatesd (Scored) +[CIS - RHEL5 - 1.2.5 - yum-updatesd not Disabled {CIS: 1.2.5 RHEL5} {PCI_DSS: 6.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:noexec; +p:yum-updatesd; + +# 1.2.6 Obtain updates with yum (not scored) + +# 1.2.7 Verify package integrity (not scored) + + +############################################### +# 1.3 Advanced Intrusion Detection Environment +############################################### +# +# Skipped, this control is obsoleted by OSSEC +# + + +############################################### +# 1.4 Configure SELinux +############################################### + +# 1.4.1 enable selinux in /etc/grub.conf +[CIS - RHEL5 - 1.4.1 - SELinux Disabled in /etc/grub.conf {CIS: 1.4.1 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/grub.conf -> !r:selinux=0; + +# 1.4.2 Set selinux state +[CIS - RHEL5 - 1.4.2 - SELinux not set to enforcing {CIS: 1.4.2 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/selinux/config -> r:SELINUX=enforcing; + +# 1.4.3 Set seliux policy +[CIS - RHEL5 - 1.4.3 - SELinux policy not set to targeted {CIS: 1.4.3 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/selinux/config -> r:SELINUXTYPE=targeted; + +# 1.4.4 Remove SETroubleshoot +[CIS - RHEL5 - 1.4.4 - SELinux setroubleshoot enabled {CIS: 1.4.4 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dsetroubleshoot$; + +# 1.4.5 Disable MCS Translation service mcstrans +[CIS - RHEL5 - 1.4.5 - SELinux mctrans enabled {CIS: 1.4.5 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dmctrans$; + +# 1.4.6 Check for unconfined daemons +# TODO + + +############################################### +# 1.5 Secure Boot Settings +############################################### + +# 1.5.1 Set User/Group Owner on /etc/grub.conf +# TODO (no mode tests) + +# 1.5.2 Set Permissions on /etc/grub.conf (Scored) +# TODO (no mode tests) + +# 1.5.3 Set Boot Loader Password (Scored) +[CIS - RHEL5 - 1.5.3 - GRUB Password not set {CIS: 1.5.3 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/boot/grub/menu.lst -> !r:^# && !r:password; + +# 1.5.4 Require Authentication for Single-User Mode (Scored) +[CIS - RHEL5 - 1.5.4 - Authentication for single user mode not enabled {CIS: 1.5.4 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/inittab -> !r:^# && r:S:wait; + +# 1.5.5 Disable Interactive Boot (Scored) +[CIS - RHEL5 - 1.5.5 - Interactive Boot not disabled {CIS: 1.5.5 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/sysconfig/init -> !r:^# && r:PROMPT=no; + + + +############################################### +# 1.6 Additional Process Hardening +############################################### + +# 1.6.1 Restrict Core Dumps (Scored) +[CIS - RHEL5 - 1.6.1 - Interactive Boot not disabled {CIS: 1.6.1 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/security/limits.conf -> !r:^# && !r:hard\.+core\.+0; + +# 1.6.2 Configure ExecShield (Scored) +[CIS - RHEL5 - 1.6.2 - ExecShield not enabled {CIS: 1.6.2 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/proc/sys/kernel/exec-shield -> 0; + +# 1.6.3 Enable Randomized Virtual Memory Region Placement (Scored) +[CIS - RHEL5 - 1.6.3 - Randomized Virtual Memory Region Placement not enabled {CIS: 1.6.3 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/proc/sys/kernel/randomize_va_space -> 0; + +# 1.6.4 Enable XD/NX Support on 32-bit x86 Systems (Scored) +# TODO + +# 1.6.5 Disable Prelink (Scored) +[CIS - RHEL5 - 1.6.5 - Prelink not disabled {CIS: 1.6.5 RHEL5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/sysconfig/prelink -> !r:PRELINKING=no; + + +############################################### +# 1.7 Use the Latest OS Release +############################################### + + +############################################### +# 2 OS Services +############################################### + +############################################### +# 2.1 Remove Legacy Services +############################################### + +# 2.1.1 Remove telnet-server (Scored) +# TODO: detect it is installed at all +[CIS - RHEL5 - 2.1.1 - Telnet enabled on xinetd {CIS: 2.1.1 RHEL5} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/xinetd.d/telnet -> !r:^# && r:disable && r:no; + + +# 2.1.2 Remove telnet Clients (Scored) +# TODO + +# 2.1.3 Remove rsh-server (Scored) +[CIS - RHEL5 - 2.1.3 - rsh/rlogin/rcp enabled on xinetd {CIS: 2.1.3 RHEL5} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/xinetd.d/rlogin -> !r:^# && r:disable && r:no; +f:/etc/xinetd.d/rsh -> !r:^# && r:disable && r:no; +f:/etc/xinetd.d/shell -> !r:^# && r:disable && r:no; + +# 2.1.4 Remove rsh (Scored) +# TODO + +# 2.1.5 Remove NIS Client (Scored) +[CIS - RHEL5 - 2.1.5 - Disable standard boot services - NIS (client) Enabled {CIS: 2.1.5 RHEL5} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dypbind$; + +# 2.1.6 Remove NIS Server (Scored) +[CIS - RHEL5 - 2.1.5 - Disable standard boot services - NIS (server) Enabled {CIS: 2.1.6 RHEL5} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dypserv$; + +# 2.1.7 Remove tftp (Scored) +# TODO + +# 2.1.8 Remove tftp-server (Scored) +[CIS - RHEL5 - 2.1.8 - tftpd enabled on xinetd {CIS: 2.1.8 RHEL5} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/xinetd.d/tftpd -> !r:^# && r:disable && r:no; + +# 2.1.9 Remove talk (Scored) +# TODO + +# 2.1.10 Remove talk-server (Scored) +[CIS - RHEL5 - 2.1.10 - talk enabled on xinetd {CIS: 2.1.10 RHEL5} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/xinetd.d/talk -> !r:^# && r:disable && r:no; + +# 2.1.11 Remove xinetd (Scored) +# TODO + +# 2.1.12 Disable chargen-dgram (Scored) +# TODO + +# 2.1.13 Disable chargen-stream (Scored) +# TODO + +# 2.1.14 Disable daytime-dgram (Scored) +# TODO + +# 2.1.15 Disable daytime-stream (Scored) +# TODO + +# 2.1.16 Disable echo-dgram (Scored) +# TODO + +# 2.1.17 Disable echo-stream (Scored) +# TODO + +# 2.1.18 Disable tcpmux-server (Scored) +# TODO + + +############################################### +# 3 Special Purpose Services +############################################### + +############################################### +# 3.1 Disable Avahi Server +############################################### + +# 3.1.1 Disable Avahi Server (Scored) +[CIS - RHEL5 - 3.1.1 - Avahi daemon not disabled {CIS: 3.1.1 RHEL5} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +p:avahi-daemon; + +# 3.1.2 Service Only via Required Protocol (Not Scored) +# TODO + +# 3.1.3 Check Responses TTL Field (Scored) +# TODO + +# 3.1.4 Prevent Other Programs from Using Avahi’s Port (Not Scored) +# TODO + +# 3.1.5 Disable Publishing (Not Scored) + +# 3.1.6 Restrict Published Information (if publishing is required) (Not scored) + +# 3.2 Set Daemon umask (Scored) +[CIS - RHEL5 - 3.2 - Set daemon umask - Default umask is higher than 027 {CIS: 3.2 RHEL5}] [all] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/init.d/functions -> !r:^# && r:^umask && <:umask 027; + +# 3.3 Remove X Windows (Scored) +[CIS - RHEL5 - 3.3 - X11 not disabled {CIS: 3.3 RHEL5} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/inittab -> !r:^# && r:id:5; + +# 3.4 Disable Print Server - CUPS (Not Scored) + +# 3.5 Remove DHCP Server (Not Scored) +# TODO + +# 3.6 Configure Network Time Protocol (NTP) (Scored) +#[CIS - RHEL5 - 3.6 - NTPD not disabled {CIS: 3.6 RHEL5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +# TODO. + +# 3.7 Remove LDAP (Not Scored) + +# 3.8 Disable NFS and RPC (Not Scored) +[CIS - RHEL5 - 3.8 - Disable standard boot services - NFS Enabled {CIS: 3.8 RHEL5} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dnfs$; +d:$rc_dirs -> ^S\d\dnfslock$; + +# 3.9 Remove DNS Server (Not Scored) +# TODO + +# 3.10 Remove FTP Server (Not Scored) +[CIS - RHEL5 - 3.10 - VSFTP enabled on xinetd {CIS: 3.10 RHEL5} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/xinetd.d/vsftpd -> !r:^# && r:disable && r:no; + +# 3.11 Remove HTTP Server (Not Scored) +[CIS - RHEL5 - 3.11 - Disable standard boot services - Apache web server Enabled {CIS: 3.11 RHEL5} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dhttpd$; + +# 3.12 Remove Dovecot (IMAP and POP3 services) (Not Scored) +[CIS - RHEL5 - 3.12 - imap enabled on xinetd {CIS: 3.12 RHEL5} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/xinetd.d/cyrus-imapd -> !r:^# && r:disable && r:no; + +[CIS - RHEL5 - 3.12 - pop3 enabled on xinetd {CIS: 3.12 RHEL5} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/xinetd.d/dovecot -> !r:^# && r:disable && r:no; + +# 3.13 Remove Samba (Not Scored) +[CIS - RHEL5 - 3.13 - Disable standard boot services - Samba Enabled {CIS: 3.13 RHEL5} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dsamba$; +d:$rc_dirs -> ^S\d\dsmb$; + +# 3.14 Remove HTTP Proxy Server (Not Scored) +[CIS - RHEL5 - 3.14 - Disable standard boot services - Squid Enabled {CIS: 3.14 RHEL5} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dsquid$; + +# 3.15 Remove SNMP Server (Not Scored) +[CIS - RHEL5 - 3.15 - Disable standard boot services - SNMPD process Enabled {CIS: 3.15 RHEL5} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dsnmpd$; + +# 3.16 Configure Mail Transfer Agent for Local-Only Mode (Scored) +# TODO + + +############################################### +# 4 Network Configuration and Firewalls +############################################### + +############################################### +# 4.1 Modify Network Parameters (Host Only) +############################################### + +# 4.1.1 Disable IP Forwarding (Scored) +[CIS - RHEL5 - 4.1.1 - Network parameters - IP Forwarding enabled {CIS: 4.1.1 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/proc/sys/net/ipv4/ip_forward -> 1; +f:/proc/sys/net/ipv6/ip_forward -> 1; + +# 4.1.2 Disable Send Packet Redirects (Scored) +[CIS - RHEL5 - 4.1.2 - Network parameters - IP send redirects enabled {CIS: 4.1.2 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/send_redirects -> 0; +f:/proc/sys/net/ipv4/conf/default/send_redirects -> 0; + + +############################################### +# 4.2 Modify Network Parameters (Host and Router) +############################################### + +# 4.2.1 Disable Source Routed Packet Acceptance (Scored) +[CIS - RHEL5 - 4.2.1 - Network parameters - Source routing accepted {CIS: 4.2.1 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/accept_source_route -> 1; + +# 4.2.2 Disable ICMP Redirect Acceptance (Scored) +[CIS - RHEL5 - 4.2.2 - Network parameters - ICMP redirects accepted {CIS: 4.2.2 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/accept_redirects -> 1; +f:/proc/sys/net/ipv4/conf/default/accept_redirects -> 1; + +# 4.2.3 Disable Secure ICMP Redirect Acceptance (Scored) +[CIS - RHEL5 - 4.2.3 - Network parameters - ICMP secure redirects accepted {CIS: 4.2.3 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/secure_redirects -> 1; +f:/proc/sys/net/ipv4/conf/default/secure_redirects -> 1; + +# 4.2.4 Log Suspicious Packets (Scored) +[CIS - RHEL5 - 4.2.4 - Network parameters - martians not logged {CIS: 4.2.4 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/log_martians -> 0; + +# 4.2.5 Enable Ignore Broadcast Requests (Scored) +[CIS - RHEL5 - 4.2.5 - Network parameters - ICMP broadcasts accepted {CIS: 4.2.5 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts -> 0; + +# 4.2.6 Enable Bad Error Message Protection (Scored) +[CIS - RHEL5 - 4.2.6 - Network parameters - Bad error message protection not enabled {CIS: 4.2.6 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/proc/sys/net/ipv4/icmp_ignore_bogus_error_responses -> 0; + +# 4.2.7 Enable RFC-recommended Source Route Validation (Scored) +[CIS - RHEL5 - 4.2.7 - Network parameters - RFC Source route validation not enabled {CIS: 4.2.7 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/rp_filter -> 0; +f:/proc/sys/net/ipv4/conf/default/rp_filter -> 0; + +# 4.2.8 Enable TCP SYN Cookies (Scored) +[CIS - RHEL5 - 4.2.8 - Network parameters - SYN Cookies not enabled {CIS: 4.2.8 RHEL5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/proc/sys/net/ipv4/tcp_syncookies -> 0; + + +############################################### +# 4.3 Wireless Networking +############################################### + +# 4.3.1 Deactivate Wireless Interfaces (Not Scored) + + +############################################### +# 4.4 Disable ipv6 +############################################### + +############################################### +# 4.4.1 Configure IPv6 +############################################### + +# 4.4.1.1 Disable IPv6 Router Advertisements (Not Scored) + +# 4.4.1.2 Disable IPv6 Redirect Acceptance (Not Scored) + +# 4.4.2 Disable IPv6 (Not Scored) + + +############################################### +# 4.5 Install TCP Wrappers +############################################### + +# 4.5.1 Install TCP Wrappers (Not Scored) + +# 4.5.2 Create /etc/hosts.allow (Not Scored) + +# 4.5.3 Verify Permissions on /etc/hosts.allow (Scored) +# TODO + +# 4.5.4 Create /etc/hosts.deny (Not Scored) + +# 4.5.5 Verify Permissions on /etc/hosts.deny (Scored) +# TODO + + +############################################### +# 4.6 Uncommon Network Protocols +############################################### + +# 4.6.1 Disable DCCP (Not Scored) + +# 4.6.2 Disable SCTP (Not Scored) + +# 4.6.3 Disable RDS (Not Scored) + +# 4.6.4 Disable TIPC (Not Scored) + +# 4.7 Enable IPtables (Scored) +# TODO + +# 4.8 Enable IP6tables (Not Scored) + + +############################################### +# 5 Logging and Auditing +############################################### + +############################################### +# 5.1 Configure Syslog +############################################### + +# 5.1.1 Configure /etc/syslog.conf (Not Scored) + +# 5.1.2 Create and Set Permissions on syslog Log Files (Scored) + +# 5.1.3 Configure syslog to Send Logs to a Remote Log Host (Scored) + +# 5.1.4 Accept Remote syslog Messages Only on Designated Log Hosts (Not Scored) + + +############################################### +# 5.2 Configure rsyslog +############################################### + +# 5.2.1 Install the rsyslog package (Not Scored) + +# 5.2.2 Activate the rsyslog Service (Not Scored) + +# 5.2.3 Configure /etc/rsyslog.conf (Not Scored) + +# 5.2.4 Create and Set Permissions on rsyslog Log Files (Not Scored) + +# 5.2.5 Configure rsyslog to Send Logs to a Remote Log Host (Not Scored) + +# 5.2.6 Accept Remote rsyslog Messages Only on Designated Log Hosts (Not Scored) + + +############################################### +# 5.3 Configure System Accounting (auditd) +############################################### + +############################################### +# 5.3.1 Configure Data Retention +############################################### + +# 5.3.1.1 Configure Audit Log Storage Size (Not Scored) + +# 5.3.1.2 Disable System on Audit Log Full (Not Scored) + +# 5.3.1.3 Keep All Auditing Information (Scored) + +# 5.3.2 Enable auditd Service (Scored) + +# 5.3.3 Configure Audit Log Storage Size (Not Scored) + +# 5.3.4 Disable System on Audit Log Full (Not Scored) + +# 5.3.5 Keep All Auditing Information (Scored) + +# 5.3.6 Enable Auditing for Processes That Start Prior to auditd (Scored) + +# 5.3.7 Record Events That Modify Date and Time Information (Scored) + +# 5.3.8 Record Events That Modify User/Group Information (Scored) + +# 5.3.9 Record Events That Modify the System’s Network Environment (Scored) + +# 5.3.10 Record Events That Modify the System’s Mandatory Access Controls (Scored) + +# 5.3.11 Collect Login and Logout Events (Scored) + +# 5.3.12 Collect Session Initiation Information (Scored) + +# 5.3.13 Collect Discretionary Access Control Permission Modification Events (Scored) + +# 5.3.14 Collect Unsuccessful Unauthorized Access Attempts to Files (Scored) + +# 5.3.15 Collect Use of Privileged Commands (Scored) + +# 5.3.16 Collect Successful File System Mounts (Scored) + +# 5.3.17 Collect File Deletion Events by User (Scored) + +# 5.3.18 Collect Changes to System Administration Scope (sudoers) (Scored) + +# 5.3.19 Collect System Administrator Actions (sudolog) (Scored) + +# 5.3.20 Collect Kernel Module Loading and Unloading (Scored) + +# 5.3.21 Make the Audit Configuration Immutable (Scored) + +# 5.4 Configure logrotate (Not Scored) + + +############################################### +# 6 System Access, Authentication and Authorization +############################################### + +############################################### +# 6.1 Configure cron and anacron +############################################### + +# 6.1.1 Enable anacron Daemon (Scored) + +# 6.1.2 Enable cron Daemon (Scored) + +# 6.1.3 Set User/Group Owner and Permission on /etc/anacrontab (Scored) + +# 6.1.4 Set User/Group Owner and Permission on /etc/crontab (Scored) + +# 6.1.5 Set User/Group Owner and Permission on /etc/cron.hourly (Scored) + +# 6.1.6 Set User/Group Owner and Permission on /etc/cron.daily (Scored) + +# 6.1.7 Set User/Group Owner and Permission on /etc/cron.weekly (Scored) + +# 6.1.8 Set User/Group Owner and Permission on /etc/cron.monthly (Scored) + +# 6.1.9 Set User/Group Owner and Permission on /etc/cron.d (Scored) + +# 6.1.10 Restrict at Daemon (Scored) + +# 6.1.11 Restrict at/cron to Authorized Users (Scored) + +############################################### +# 6.1 Configure SSH +############################################### + +# 6.2.1 Set SSH Protocol to 2 (Scored) +[CIS - RHEL5 - 6.2.1 - SSH Configuration - Protocol version 1 enabled {CIS: 6.2.1 RHEL5} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\.+1; + +# 6.2.2 Set LogLevel to INFO (Scored) + +# 6.2.3 Set Permissions on /etc/ssh/sshd_config (Scored) + +# 6.2.4 Disable SSH X11 Forwarding (Scored) + +# 6.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) + +# 6.2.6 Set SSH IgnoreRhosts to Yes (Scored) +[CIS - RHEL5 - 6.2.6 - SSH Configuration - IgnoreRHosts disabled {CIS: 6.2.6 RHEL5} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\.+no; + +# 6.2.7 Set SSH HostbasedAuthentication to No (Scored) +[CIS - RHEL5 - 6.2.7 - SSH Configuration - Host based authentication enabled {CIS: 6.2.7 RHEL5} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\.+yes; + +# 6.2.8 Disable SSH Root Login (Scored) +[CIS - RHEL5 - 6.2.8 - SSH Configuration - Root login allowed {CIS: 6.2.8 RHEL5} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\.+yes; + +# 6.2.9 Set SSH PermitEmptyPasswords to No (Scored) +[CIS - RHEL5 - 6.2.9 - SSH Configuration - Empty passwords permitted {CIS: 6.2.9 RHEL5} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:^PermitEmptyPasswords\.+yes; + +# 6.2.10 Do Not Allow Users to Set Environment Options (Scored) + +# 6.2.11 Use Only Approved Ciphers in Counter Mode (Scored) + +# 6.2.12 Set Idle Timeout Interval for User Login (Not Scored) + +# 6.2.13 Limit Access via SSH (Scored) + +# 6.2.14 Set SSH Banner (Scored) + +# 6.2.15 Enable SSH UsePrivilegeSeparation (Scored) + + +############################################### +# 6.3 Configure PAM +############################################### + +# 6.3.1 Set Password Creation Requirement Parameters Using pam_cracklib (Scored) + +# 6.3.2 Set Lockout for Failed Password Attempts (Not Scored) + +# 6.3.3 Use pam_deny.so to Deny Services (Not Scored) + +# 6.3.4 Upgrade Password Hashing Algorithm to SHA-512 (Scored) + +# 6.3.5 Limit Password Reuse (Scored) + +# 6.3.6 Remove the pam_ccreds Package (Scored) + +# 6.4 Restrict root Login to System Console (Not Scored) + +# 6.5 Restrict Access to the su Command (Scored) + + +############################################### +# 7 User Accounts and Environment +############################################### + +############################################### +# 7.1 Set Shadow Password Suite Parameters (/etc/login.defs) +############################################### + +# 7.1.1 Set Password Expiration Days (Scored) + +# 7.1.2 Set Password Change Minimum Number of Days (Scored) + +# 7.1.3 Set Password Expiring Warning Days (Scored) + +# 7.2 Disable System Accounts (Scored) + +# 7.3 Set Default Group for root Account (Scored) + +# 7.4 Set Default umask for Users (Scored) + +# 7.5 Lock Inactive User Accounts (Scored) + + +############################################### +# 8 Warning Banners +############################################### + +############################################### +# 8.1 Warning Banners for Standard Login Services +############################################### + +# 8.1.1 Set Warning Banner for Standard Login Services (Scored) + +# 8.1.2 Remove OS Information from Login Warning Banners (Scored) + +# 8.2 Set GNOME Warning Banner (Not Scored) + + +############################################### +# 9 System Maintenance +############################################### + +############################################### +# 9.1 Verify System File Permissions +############################################### + +# 9.1.1 Verify System File Permissions (Not Scored) + +# 9.1.2 Verify Permissions on /etc/passwd (Scored) + +# 9.1.3 Verify Permissions on /etc/shadow (Scored) + +# 9.1.4 Verify Permissions on /etc/gshadow (Scored) + +# 9.1.5 Verify Permissions on /etc/group (Scored) + +# 9.1.6 Verify User/Group Ownership on /etc/passwd (Scored) + +# 9.1.7 Verify User/Group Ownership on /etc/shadow (Scored) + +# 9.1.8 Verify User/Group Ownership on /etc/gshadow (Scored) + +# 9.1.9 Verify User/Group Ownership on /etc/group (Scored) + +# 9.1.10 Find World Writable Files (Not Scored) + +# 9.1.11 Find Un-owned Files and Directories (Scored) + +# 9.1.12 Find Un-grouped Files and Directories (Scored) + +# 9.1.13 Find SUID System Executables (Not Scored) + +# 9.1.14 Find SGID System Executables (Not Scored) + + +############################################### +# 9.2 Review User and Group Settings +############################################### + +# 9.2.1 Ensure Password Fields are Not Empty (Scored) + +# 9.2.2 Verify No Legacy "+" Entries Exist in /etc/passwd File (Scored) + +# 9.2.3 Verify No Legacy "+" Entries Exist in /etc/shadow File (Scored) + +# 9.2.4 Verify No Legacy "+" Entries Exist in /etc/group File (Scored) + +# 9.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) +[CIS - RHEL5 - 9.2.5 - Non-root account with uid 0 {CIS: 9.2.5 RHEL5} {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:; + +# 9.2.6 Ensure root PATH Integrity (Scored) + +# 9.2.7 Check Permissions on User Home Directories (Scored) + +# 9.2.8 Check User Dot File Permissions (Scored) + +# 9.2.9 Check Permissions on User .netrc Files (Scored) + +# 9.2.10 Check for Presence of User .rhosts Files (Scored) + +# 9.2.11 Check Groups in /etc/passwd (Scored) + +# 9.2.12 Check That Users Are Assigned Home Directories (Scored) + +# 9.2.13 Check That Defined Home Directories Exist (Scored) + +# 9.2.14 Check User Home Directory Ownership (Scored) + +# 9.2.15 Check for Duplicate UIDs (Scored) + +# 9.2.16 Check for Duplicate GIDs (Scored) + +# 9.2.17 Check That Reserved UIDs Are Assigned to System Accounts + +# 9.2.18 Check for Duplicate User Names (Scored) + +# 9.2.19 Check for Duplicate Group Names (Scored) + +# 9.2.20 Check for Presence of User .netrc Files (Scored) + +# 9.2.21 Check for Presence of User .forward Files (Scored) + +# Other/Legacy Tests +[CIS - RHEL5 - X.X.X - Account with empty password present {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/shadow -> r:^\w+::; + +[CIS - RHEL5 - X.X.X - User-mounted removable partition allowed on the console] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +f:/etc/security/console.perms -> r:^ \d+ ; +f:/etc/security/console.perms -> r:^ \d+ ; + +[CIS - RHEL5 - X.X.X - Disable standard boot services - Kudzu hardware detection Enabled] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dkudzu$; + +[CIS - RHEL5 - X.X.X - Disable standard boot services - PostgreSQL server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dpostgresql$; + +[CIS - RHEL5 - X.X.X - Disable standard boot services - MySQL server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dmysqld$; + +[CIS - RHEL5 - X.X.X - Disable standard boot services - DNS server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dnamed$; + +[CIS - RHEL5 - X.X.X - Disable standard boot services - NetFS Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_5_Benchmark_v2.1.0.pdf] +d:$rc_dirs -> ^S\d\dnetfs$; diff --git a/etc/ruleset/rootcheck/cis_rhel6_linux_rcl.txt b/etc/ruleset/rootcheck/cis_rhel6_linux_rcl.txt new file mode 100644 index 0000000000..48b8a87045 --- /dev/null +++ b/etc/ruleset/rootcheck/cis_rhel6_linux_rcl.txt @@ -0,0 +1,794 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2014 +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://www.gnu.org/licenses/gpl.html +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - p (process running) +# - d (any file inside the directory) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + + +# CIS Checks for Red Hat / CentOS 6 +# Based on CIS Benchmark for Red Hat Enterprise Linux 6 v1.3.0 + +# RC scripts location +$rc_dirs=/etc/rc.d/rc2.d,/etc/rc.d/rc3.d,/etc/rc.d/rc4.d,/etc/rc.d/rc5.d; + + +[CIS - Testing against the CIS Red Hat Enterprise Linux 5 Benchmark v2.1.0] [any required] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/redhat-release -> r:^Red Hat Enterprise Linux \S+ release 6; +f:/etc/redhat-release -> r:^CentOS && r:release 6; +f:/etc/redhat-release -> r:^Cloud && r:release 6; +f:/etc/redhat-release -> r:^Oracle && r:release 6; +f:/etc/redhat-release -> r:^Better && r:release 6; + +# 1.1.1 /tmp: partition +[CIS - RHEL6 - Build considerations - Robust partition scheme - /tmp is not on its own partition] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> !r:/tmp; + +# 1.1.2 /tmp: nodev +[CIS - RHEL6 - 1.1.2 - Partition /tmp without 'nodev' set {CIS: 1.1.2 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nodev; + +# 1.1.3 /tmp: nosuid +[CIS - RHEL6 - 1.1.3 - Partition /tmp without 'nosuid' set {CIS: 1.1.3 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nosuid; + +# 1.1.4 /tmp: noexec +[CIS - RHEL6 - 1.1.4 - Partition /tmp without 'noexec' set {CIS: 1.1.4 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nodev; + +# 1.1.5 Build considerations - Partition scheme. +[CIS - RHEL6 - Build considerations - Robust partition scheme - /var is not on its own partition {CIS: 1.1.5 RHEL6}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> !r^# && !r:/var; + +# 1.1.6 bind mount /var/tmp to /tmp +[CIS - RHEL6 - Build considerations - Robust partition scheme - /var/tmp is bound to /tmp {CIS: 1.1.6 RHEL6}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> r:^# && !r:/var/tmp && !r:bind; + +# 1.1.7 /var/log: partition +[CIS - RHEL6 - Build considerations - Robust partition scheme - /var/log is not on its own partition {CIS: 1.1.7 RHEL6}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> ^# && !r:/var/log; + +# 1.1.8 /var/log/audit: partition +[CIS - RHEL6 - Build considerations - Robust partition scheme - /var/log/audit is not on its own partition {CIS: 1.1.8 RHEL6}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> ^# && !r:/var/log/audit; + +# 1.1.9 /home: partition +[CIS - RHEL6 - Build considerations - Robust partition scheme - /home is not on its own partition {CIS: 1.1.9 RHEL6}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> ^# && !r:/home; + +# 1.1.10 /home: nodev +[CIS - RHEL6 - 1.1.10 - Partition /home without 'nodev' set {CIS: 1.1.10 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> !r:^# && r:/home && !r:nodev; + +# 1.1.11 nodev on removable media partitions (not scored) +[CIS - RHEL6 - 1.1.11 - Removable partition /media without 'nodev' set {CIS: 1.1.11 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nodev; + +# 1.1.12 noexec on removable media partitions (not scored) +[CIS - RHEL6 - 1.1.12 - Removable partition /media without 'noexec' set {CIS: 1.1.12 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:noexec; + +# 1.1.13 nosuid on removable media partitions (not scored) +[CIS - RHEL6 - 1.1.13 - Removable partition /media without 'nosuid' set {CIS: 1.1.13 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nosuid; + +# 1.1.14 /dev/shm: nodev +[CIS - RHEL6 - 1.1.14 - /dev/shm without 'nodev' set {CIS: 1.1.14 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:nodev; + +# 1.1.15 /dev/shm: nosuid +[CIS - RHEL6 - 1.1.15 - /dev/shm without 'nosuid' set {CIS: 1.1.15 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:nosuid; + +# 1.1.16 /dev/shm: noexec +[CIS - RHEL6 - 1.1.16 - /dev/shm without 'noexec' set {CIS: 1.1.16 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:noexec; + +# 1.1.17 sticky bit on world writable directories (Scored) +# TODO + +# 1.1.18 disable cramfs (not scored) + +# 1.1.19 disable freevxfs (not scored) + +# 1.1.20 disable jffs2 (not scored) + +# 1.1.21 disable hfs (not scored) + +# 1.1.22 disable hfsplus (not scored) + +# 1.1.23 disable squashfs (not scored) + +# 1.1.24 disable udf (not scored) + + +########################################## +# 1.2 Software Updates +########################################## + +# 1.2.1 Configure rhn updates (not scored) + +# 1.2.2 verify RPM gpg keys (Scored) +# TODO + +# 1.2.3 verify gpgcheck enabled (Scored) +# TODO + +# 1.2.4 Disable rhnsd (not scored) + +# 1.2.5 Obtain Software Package Updates with yum (Not Scored) + +# 1.2.6 Obtain updates with yum (not scored) + + +############################################### +# 1.3 Advanced Intrusion Detection Environment +############################################### +# +# Skipped, this control is obsoleted by OSSEC +# + +############################################### +# 1.4 Configure SELinux +############################################### + +# 1.4.1 enable selinux in /etc/grub.conf +[CIS - RHEL6 - 1.4.1 - SELinux Disabled in /etc/grub.conf {CIS: 1.4.1 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/grub.conf -> !r:selinux=0; + +# 1.4.2 Set selinux state +[CIS - RHEL6 - 1.4.2 - SELinux not set to enforcing {CIS: 1.4.2 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/selinux/config -> r:SELINUX=enforcing; + +# 1.4.3 Set seliux policy +[CIS - RHEL6 - 1.4.3 - SELinux policy not set to targeted {CIS: 1.4.3 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/selinux/config -> r:SELINUXTYPE=targeted; + +# 1.4.4 Remove SETroubleshoot +[CIS - RHEL6 - 1.4.4 - SELinux setroubleshoot enabled {CIS: 1.4.4 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dsetroubleshoot$; + +# 1.4.5 Disable MCS Translation service mcstrans +[CIS - RHEL6 - 1.4.5 - SELinux mctrans enabled {CIS: 1.4.5 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dmctrans$; + +# 1.4.6 Check for unconfined daemons +# TODO + + +############################################### +# 1.5 Secure Boot Settings +############################################### + +# 1.5.1 Set User/Group Owner on /etc/grub.conf +# TODO (no mode tests) + +# 1.5.2 Set Permissions on /etc/grub.conf (Scored) +# TODO (no mode tests) + +# 1.5.3 Set Boot Loader Password (Scored) +[CIS - RHEL6 - 1.5.3 - GRUB Password not set {CIS: 1.5.3 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/boot/grub/menu.lst -> !r:^# && !r:password; + +# 1.5.4 Require Authentication for Single-User Mode (Scored) +[CIS - RHEL6 - 1.5.4 - Authentication for single user mode not enabled {CIS: 1.5.4 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/inittab -> !r:^# && r:S:wait; + +# 1.5.5 Disable Interactive Boot (Scored) +[CIS - RHEL6 - 1.5.5 - Interactive Boot not disabled {CIS: 1.5.5 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/sysconfig/init -> !r:^# && r:PROMPT=no; + + +############################################### +# 1.6 Additional Process Hardening +############################################### + +# 1.6.1 Restrict Core Dumps (Scored) +[CIS - RHEL6 - 1.6.1 - Interactive Boot not disabled {CIS: 1.6.1 RHEL6}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/security/limits.conf -> !r:^# && !r:hard\.+core\.+0; + +# 1.6.2 Configure ExecShield (Scored) +[CIS - RHEL6 - 1.6.2 - ExecShield not enabled {CIS: 1.6.2 RHEL6}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/proc/sys/kernel/exec-shield -> 0; + +# 1.6.3 Enable Randomized Virtual Memory Region Placement (Scored) +[CIS - RHEL6 - 1.6.3 - Randomized Virtual Memory Region Placement not enabled {CIS: 1.6.3 RHEL6}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/proc/sys/kernel/randomize_va_space -> 0; + + +############################################### +# 1.7 Use the Latest OS Release (Not Scored) +############################################### + + +############################################### +# 2 OS Services +############################################### + +############################################### +# 2.1 Remove Legacy Services +############################################### + +# 2.1.1 Remove telnet-server (Scored) +# TODO: detect it is installed at all +[CIS - RHEL6 - 2.1.1 - Telnet enabled on xinetd {CIS: 2.1.1 RHEL6} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/xinetd.d/telnet -> !r:^# && r:disable && r:no; + + +# 2.1.2 Remove telnet Clients (Scored) +# TODO + +# 2.1.3 Remove rsh-server (Scored) +[CIS - RHEL6 - 2.1.3 - rsh/rlogin/rcp enabled on xinetd {CIS: 2.1.3 RHEL6} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/xinetd.d/rlogin -> !r:^# && r:disable && r:no; +f:/etc/xinetd.d/rsh -> !r:^# && r:disable && r:no; +f:/etc/xinetd.d/shell -> !r:^# && r:disable && r:no; + +# 2.1.4 Remove rsh (Scored) +# TODO + +# 2.1.5 Remove NIS Client (Scored) +[CIS - RHEL6 - 2.1.5 - Disable standard boot services - NIS (client) Enabled {CIS: 2.1.5 RHEL6} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dypbind$; + +# 2.1.6 Remove NIS Server (Scored) +[CIS - RHEL6 - 2.1.6 - Disable standard boot services - NIS (server) Enabled {CIS: 2.1.6 RHEL6} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dypserv$; + +# 2.1.7 Remove tftp (Scored) +# TODO + +# 2.1.8 Remove tftp-server (Scored) +[CIS - RHEL6 - 2.1.8 - tftpd enabled on xinetd {CIS: 2.1.8 RHEL6} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/xinetd.d/tftpd -> !r:^# && r:disable && r:no; + +# 2.1.9 Remove talk (Scored) +# TODO + +# 2.1.10 Remove talk-server (Scored) +[CIS - RHEL6 - 2.1.10 - talk enabled on xinetd {CIS: 2.1.10 RHEL6} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/xinetd.d/talk -> !r:^# && r:disable && r:no; + +# 2.1.11 Remove xinetd (Scored) +# TODO + +# 2.1.12 Disable chargen-dgram (Scored) +# TODO + +# 2.1.13 Disable chargen-stream (Scored) +# TODO + +# 2.1.14 Disable daytime-dgram (Scored) +# TODO + +# 2.1.15 Disable daytime-stream (Scored) +# TODO + +# 2.1.16 Disable echo-dgram (Scored) +# TODO + +# 2.1.17 Disable echo-stream (Scored) +# TODO + +# 2.1.18 Disable tcpmux-server (Scored) +# TODO + + +############################################### +# 3 Special Purpose Services +############################################### + +# 3.1 Set Daemon umask (Scored) +[CIS - RHEL6 - 3.1 - Set daemon umask - Default umask is higher than 027 {CIS: 3.1 RHEL6} {PCI_DSS: 2.2.2}] [all] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/init.d/functions -> !r:^# && r:^umask && <:umask 027; + +# 3.2 Remove X Windows (Scored) +[CIS - RHEL6 - 3.2 - X11 not disabled {CIS: 3.2 RHEL6} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/inittab -> !r:^# && r:id:5; + +# 3.3 Disable Avahi Server (Scored) +[CIS - RHEL6 - 3.2 - Avahi daemon not disabled {CIS: 3.3 RHEL6} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +p:avahi-daemon; + +# 3.4 Disable Print Server - CUPS (Not Scored) + +# 3.5 Remove DHCP Server (Not Scored) +# TODO + +# 3.6 Configure Network Time Protocol (NTP) (Scored) +#[CIS - RHEL6 - 3.6 - NTPD not disabled {CIS: 1.1.1 RHEL6} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +# TODO. + +# 3.7 Remove LDAP (Not Scored) + +# 3.8 Disable NFS and RPC (Not Scored) +[CIS - RHEL6 - 3.8 - Disable standard boot services - NFS Enabled {CIS: 3.8 RHEL6} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dnfs$; +d:$rc_dirs -> ^S\d\dnfslock$; + +# 3.9 Remove DNS Server (Not Scored) +# TODO + +# 3.10 Remove FTP Server (Not Scored) +[CIS - RHEL6 - 3.10 - VSFTP enabled on xinetd {CIS: 3.10 RHEL6} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/xinetd.d/vsftpd -> !r:^# && r:disable && r:no; + +# 3.11 Remove HTTP Server (Not Scored) +[CIS - RHEL6 - 3.11 - Disable standard boot services - Apache web server Enabled {CIS: 3.11 RHEL6}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dhttpd$; + +# 3.12 Remove Dovecot (IMAP and POP3 services) (Not Scored) +[CIS - RHEL6 - 3.12 - imap enabled on xinetd {CIS: 3.12 RHEL6} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/xinetd.d/cyrus-imapd -> !r:^# && r:disable && r:no; + +[CIS - RHEL6 - 3.12 - pop3 enabled on xinetd {CIS: 3.12 RHEL6} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/xinetd.d/dovecot -> !r:^# && r:disable && r:no; + +# 3.13 Remove Samba (Not Scored) +[CIS - RHEL6 - 3.13 - Disable standard boot services - Samba Enabled {CIS: 3.13 RHEL6} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dsamba$; +d:$rc_dirs -> ^S\d\dsmb$; + +# 3.14 Remove HTTP Proxy Server (Not Scored) +[CIS - RHEL6 - 3.14 - Disable standard boot services - Squid Enabled {CIS: 3.14 RHEL6} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dsquid$; + +# 3.15 Remove SNMP Server (Not Scored) +[CIS - RHEL6 - 3.15 - Disable standard boot services - SNMPD process Enabled {CIS: 3.15 RHEL6} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dsnmpd$; + +# 3.16 Configure Mail Transfer Agent for Local-Only Mode (Scored) +# TODO + + +############################################### +# 4 Network Configuration and Firewalls +############################################### + +############################################### +# 4.1 Modify Network Parameters (Host Only) +############################################### + +# 4.1.1 Disable IP Forwarding (Scored) +[CIS - RHEL6 - 4.1.1 - Network parameters - IP Forwarding enabled {CIS: 4.1.1 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/proc/sys/net/ipv4/ip_forward -> 1; +f:/proc/sys/net/ipv6/ip_forward -> 1; + +# 4.1.2 Disable Send Packet Redirects (Scored) +[CIS - RHEL6 - 4.1.2 - Network parameters - IP send redirects enabled {CIS: 4.1.2 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/proc/sys/net/ipv4/conf/all/send_redirects -> 0; +f:/proc/sys/net/ipv4/conf/default/send_redirects -> 0; + + +############################################### +# 4.2 Modify Network Parameters (Host and Router) +############################################### + +# 4.2.1 Disable Source Routed Packet Acceptance (Scored) +[CIS - RHEL6 - 4.2.1 - Network parameters - Source routing accepted {CIS: 4.2.1 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/proc/sys/net/ipv4/conf/all/accept_source_route -> 1; + +# 4.2.2 Disable ICMP Redirect Acceptance (Scored) +#[CIS - RHEL6 - 4.2.2 - Network parameters - ICMP redirects accepted {CIS: 1.1.1 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +#f:/proc/sys/net/ipv4/conf/all/accept_redirects -> 1; +#f:/proc/sys/net/ipv4/conf/default/accept_redirects -> 1; + +# 4.2.3 Disable Secure ICMP Redirect Acceptance (Scored) +[CIS - RHEL6 - 4.2.3 - Network parameters - ICMP secure redirects accepted {CIS: 4.2.3 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/proc/sys/net/ipv4/conf/all/secure_redirects -> 1; +f:/proc/sys/net/ipv4/conf/default/secure_redirects -> 1; + +# 4.2.4 Log Suspicious Packets (Scored) +[CIS - RHEL6 - 4.2.4 - Network parameters - martians not logged {CIS: 4.2.4 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/proc/sys/net/ipv4/conf/all/log_martians -> 0; + +# 4.2.5 Enable Ignore Broadcast Requests (Scored) +[CIS - RHEL6 - 4.2.5 - Network parameters - ICMP broadcasts accepted {CIS: 4.2.5 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts -> 0; + +# 4.2.6 Enable Bad Error Message Protection (Scored) +[CIS - RHEL6 - 4.2.6 - Network parameters - Bad error message protection not enabled {CIS: 4.2.6 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/proc/sys/net/ipv4/icmp_ignore_bogus_error_responses -> 0; + +# 4.2.7 Enable RFC-recommended Source Route Validation (Scored) +[CIS - RHEL6 - 4.2.7 - Network parameters - RFC Source route validation not enabled {CIS: 4.2.7 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/proc/sys/net/ipv4/conf/all/rp_filter -> 0; +f:/proc/sys/net/ipv4/conf/default/rp_filter -> 0; + +# 4.2.8 Enable TCP SYN Cookies (Scored) +[CIS - RHEL6 - 4.2.8 - Network parameters - SYN Cookies not enabled {CIS: 4.2.8 RHEL6} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/proc/sys/net/ipv4/tcp_syncookies -> 0; + + +############################################### +# 4.3 Wireless Networking +############################################### + +# 4.3.1 Deactivate Wireless Interfaces (Not Scored) + + +############################################### +# 4.4 Disable ipv6 +############################################### + +############################################### +# 4.4.1 Configure IPv6 +############################################### + +# 4.4.1.1 Disable IPv6 Router Advertisements (Not Scored) + +# 4.4.1.2 Disable IPv6 Redirect Acceptance (Not Scored) + +# 4.4.2 Disable IPv6 (Not Scored) + + +############################################### +# 4.5 Install TCP Wrappers +############################################### + +# 4.5.1 Install TCP Wrappers (Not Scored) + +# 4.5.2 Create /etc/hosts.allow (Not Scored) + +# 4.5.3 Verify Permissions on /etc/hosts.allow (Scored) +# TODO + +# 4.5.4 Create /etc/hosts.deny (Not Scored) + +# 4.5.5 Verify Permissions on /etc/hosts.deny (Scored) +# TODO + + +############################################### +# 4.6 Uncommon Network Protocols +############################################### + +# 4.6.1 Disable DCCP (Not Scored) + +# 4.6.2 Disable SCTP (Not Scored) + +# 4.6.3 Disable RDS (Not Scored) + +# 4.6.4 Disable TIPC (Not Scored) + +# 4.7 Enable IPtables (Scored) +# TODO + +# 4.8 Enable IP6tables (Not Scored) + + +############################################### +# 5 Logging and Auditing +############################################### + +############################################### +# 5.1 Configure Syslog +############################################### + +# 5.1.1 Install the rsyslog package (Scored) +# TODO + +# 5.1.2 Activate the rsyslog Service (Scored) +# TODO + +# 5.1.3 Configure /etc/rsyslog.conf (Not Scored) + +# 5.1.4 Create and Set Permissions on rsyslog Log Files (Scored) + +# 5.1.5 Configure rsyslog to Send Logs to a Remote Log Host (Scored) + +# 5.1.6 Accept Remote rsyslog Messages Only on Designated Log Hosts (Not Scored) + + +############################################### +# 5.2 Configure System Accounting (auditd) +############################################### + +############################################### +# 5.2.1 Configure Data Retention +############################################### + +# 5.2.1.1 Configure Audit Log Storage Size (Not Scored) + +# 5.2.1.2 Disable System on Audit Log Full (Not Scored) + +# 5.2.1.3 Keep All Auditing Information (Scored) + +# 5.2.2 Enable auditd Service (Scored) + +# 5.2.3 Enable Auditing for Processes That Start Prior to auditd (Scored) + +# 5.2.4 Record Events That Modify Date and Time Information (Scored) + +# 5.2.5 Record Events That Modify User/Group Information (Scored) + +# 5.2.6 Record Events That Modify the System’s Network Environment (Scored) + +# 5.2.7 Record Events That Modify the System’s Mandatory Access Controls (Scored) + +# 5.2.8 Collect Login and Logout Events (Scored) + +# 5.2.9 Collect Session Initiation Information (Scored) + +# 5.2.10 Collect Discretionary Access Control Permission Modification Events (Scored) + +# 5.2.11 Collect Unsuccessful Unauthorized Access Attempts to Files (Scored) + +# 5.2.12 Collect Use of Privileged Commands (Scored) + +# 5.2.13 Collect Successful File System Mounts (Scored) + +# 5.2.14 Collect File Deletion Events by User (Scored) + +# 5.2.15 Collect Changes to System Administration Scope (sudoers) (Scored) + +# 5.2.16 Collect System Administrator Actions (sudolog) (Scored) + +# 5.2.17 Collect Kernel Module Loading and Unloading (Scored) + +# 5.2.18 Make the Audit Configuration Immutable (Scored) + +# 5.3 Configure logrotate (Not Scored) + + +############################################### +# 6 System Access, Authentication and Authorization +############################################### + +############################################### +# 6.1 Configure cron and anacron +############################################### + +# 6.1.1 Enable anacron Daemon (Scored) + +# 6.1.2 Enable cron Daemon (Scored) + +# 6.1.3 Set User/Group Owner and Permission on /etc/anacrontab (Scored) + +# 6.1.4 Set User/Group Owner and Permission on /etc/crontab (Scored) + +# 6.1.5 Set User/Group Owner and Permission on /etc/cron.hourly (Scored) + +# 6.1.6 Set User/Group Owner and Permission on /etc/cron.daily (Scored) + +# 6.1.7 Set User/Group Owner and Permission on /etc/cron.weekly (Scored) + +# 6.1.8 Set User/Group Owner and Permission on /etc/cron.monthly (Scored) + +# 6.1.9 Set User/Group Owner and Permission on /etc/cron.d (Scored) + +# 6.1.10 Restrict at Daemon (Scored) + +# 6.1.11 Restrict at/cron to Authorized Users (Scored) + +############################################### +# 6.1 Configure SSH +############################################### + +# 6.2.1 Set SSH Protocol to 2 (Scored) +[CIS - RHEL6 - 6.2.1 - SSH Configuration - Protocol version 1 enabled {CIS: 6.2.1 RHEL6} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\.+1; + +# 6.2.2 Set LogLevel to INFO (Scored) + +# 6.2.3 Set Permissions on /etc/ssh/sshd_config (Scored) + +# 6.2.4 Disable SSH X11 Forwarding (Scored) + +# 6.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) + +# 6.2.6 Set SSH IgnoreRhosts to Yes (Scored) +[CIS - RHEL6 - 6.2.6 - SSH Configuration - IgnoreRHosts disabled {CIS: 6.2.6 RHEL6} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\.+no; + +# 6.2.7 Set SSH HostbasedAuthentication to No (Scored) +[CIS - RHEL6 - 6.2.7 - SSH Configuration - Host based authentication enabled {CIS: 6.2.7 RHEL6} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\.+yes; + +# 6.2.8 Disable SSH Root Login (Scored) +[CIS - RHEL6 - 6.2.8 - SSH Configuration - Root login allowed {CIS: 6.2.8 RHEL6} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\.+yes; + +# 6.2.9 Set SSH PermitEmptyPasswords to No (Scored) +[CIS - RHEL6 - 6.2.9 - SSH Configuration - Empty passwords permitted {CIS: 6.2.9 RHEL6} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:^PermitEmptyPasswords\.+yes; + +# 6.2.10 Do Not Allow Users to Set Environment Options (Scored) + +# 6.2.11 Use Only Approved Ciphers in Counter Mode (Scored) + +# 6.2.12 Set Idle Timeout Interval for User Login (Not Scored) + +# 6.2.13 Limit Access via SSH (Scored) + +# 6.2.14 Set SSH Banner (Scored) + + +############################################### +# 6.3 Configure PAM +############################################### + +# 6.3.1 Set Password Creation Requirement Parameters Using pam_cracklib (Scored) + +# 6.3.2 Set Lockout for Failed Password Attempts (Not Scored) + +# 6.3.3 Use pam_deny.so to Deny Services (Not Scored) + +# 6.3.4 Upgrade Password Hashing Algorithm to SHA-512 (Scored) + +# 6.3.5 Limit Password Reuse (Scored) + +# 6.4 Restrict root Login to System Console (Not Scored) + +# 6.5 Restrict Access to the su Command (Scored) + + +############################################### +# 7 User Accounts and Environment +############################################### + +############################################### +# 7.1 Set Shadow Password Suite Parameters (/etc/login.defs) +############################################### + +# 7.1.1 Set Password Expiration Days (Scored) + +# 7.1.2 Set Password Change Minimum Number of Days (Scored) + +# 7.1.3 Set Password Expiring Warning Days (Scored) + +# 7.2 Disable System Accounts (Scored) + +# 7.3 Set Default Group for root Account (Scored) + +# 7.4 Set Default umask for Users (Scored) + +# 7.5 Lock Inactive User Accounts (Scored) + + +############################################### +# 8 Warning Banners +############################################### + +############################################### +# 8.1 Warning Banners for Standard Login Services +############################################### + +# 8.1 Set Warning Banner for Standard Login Services (Scored) + +# 8.2 Remove OS Information from Login Warning Banners (Scored) + +# 8.3 Set GNOME Warning Banner (Not Scored) + + +############################################### +# 9 System Maintenance +############################################### + +############################################### +# 9.1 Verify System File Permissions +############################################### + +# 9.1.1 Verify System File Permissions (Not Scored) + +# 9.1.2 Verify Permissions on /etc/passwd (Scored) + +# 9.1.3 Verify Permissions on /etc/shadow (Scored) + +# 9.1.4 Verify Permissions on /etc/gshadow (Scored) + +# 9.1.5 Verify Permissions on /etc/group (Scored) + +# 9.1.6 Verify User/Group Ownership on /etc/passwd (Scored) + +# 9.1.7 Verify User/Group Ownership on /etc/shadow (Scored) + +# 9.1.8 Verify User/Group Ownership on /etc/gshadow (Scored) + +# 9.1.9 Verify User/Group Ownership on /etc/group (Scored) + +# 9.1.10 Find World Writable Files (Not Scored) + +# 9.1.11 Find Un-owned Files and Directories (Scored) + +# 9.1.12 Find Un-grouped Files and Directories (Scored) + +# 9.1.13 Find SUID System Executables (Not Scored) + +# 9.1.14 Find SGID System Executables (Not Scored) + + +############################################### +# 9.2 Review User and Group Settings +############################################### + +# 9.2.1 Ensure Password Fields are Not Empty (Scored) + +# 9.2.2 Verify No Legacy "+" Entries Exist in /etc/passwd File (Scored) + +# 9.2.3 Verify No Legacy "+" Entries Exist in /etc/shadow File (Scored) + +# 9.2.4 Verify No Legacy "+" Entries Exist in /etc/group File (Scored) + +# 9.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) +[CIS - RHEL6 - 9.2.5 - Non-root account with uid 0 {CIS: 9.2.5 RHEL6} {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:; + +# 9.2.6 Ensure root PATH Integrity (Scored) + +# 9.2.7 Check Permissions on User Home Directories (Scored) + +# 9.2.8 Check User Dot File Permissions (Scored) + +# 9.2.9 Check Permissions on User .netrc Files (Scored) + +# 9.2.10 Check for Presence of User .rhosts Files (Scored) + +# 9.2.11 Check Groups in /etc/passwd (Scored) + +# 9.2.12 Check That Users Are Assigned Valid Home Directories (Scored) + +# 9.2.13 Check User Home Directory Ownership (Scored) + +# 9.2.14 Check for Duplicate UIDs (Scored) + +# 9.2.15 Check for Duplicate GIDs (Scored) + +# 9.2.16 Check for Duplicate User Names (Scored) + +# 9.2.17 Check for Duplicate Group Names (Scored) + +# 9.2.18 Check for Presence of User .netrc Files (Scored) + +# 9.2.19 Check for Presence of User .forward Files (Scored) + + +# Other/Legacy Tests +[CIS - RHEL6 - X.X.X - Account with empty password present {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/shadow -> r:^\w+::; + +[CIS - RHEL6 - X.X.X - User-mounted removable partition allowed on the console] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +f:/etc/security/console.perms -> r:^ \d+ ; +f:/etc/security/console.perms -> r:^ \d+ ; + +[CIS - RHEL6 - X.X.X - Disable standard boot services - Kudzu hardware detection Enabled] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dkudzu$; + +[CIS - RHEL6 - X.X.X - Disable standard boot services - PostgreSQL server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dpostgresql$; + +[CIS - RHEL6 - X.X.X - Disable standard boot services - MySQL server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dmysqld$; + +[CIS - RHEL6 - X.X.X - Disable standard boot services - DNS server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dnamed$; + +[CIS - RHEL6 - X.X.X - Disable standard boot services - NetFS Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_6_Benchmark_v1.3.0.pdf] +d:$rc_dirs -> ^S\d\dnetfs$; diff --git a/etc/ruleset/rootcheck/cis_rhel7_linux_rcl.txt b/etc/ruleset/rootcheck/cis_rhel7_linux_rcl.txt new file mode 100644 index 0000000000..3d2199255c --- /dev/null +++ b/etc/ruleset/rootcheck/cis_rhel7_linux_rcl.txt @@ -0,0 +1,820 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2014 +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://www.gnu.org/licenses/gpl.html +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - p (process running) +# - d (any file inside the directory) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + + +# CIS Checks for Red Hat / CentOS 7 +# Based on CIS Benchmark for Red Hat Enterprise Linux 7 v1.1.0 + +# Vars +$sshd_file=/etc/ssh/sshd_config; + +# RC scripts location +$rc_dirs=/etc/rc.d/rc2.d,/etc/rc.d/rc3.d,/etc/rc.d/rc4.d,/etc/rc.d/rc5.d; + + +[CIS - Testing against the CIS Red Hat Enterprise Linux 7 Benchmark v1.1.0] [any required] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/redhat-release -> r:^Red Hat Enterprise Linux \S+ release 7; +f:/etc/redhat-release -> r:^CentOS && r:release 7; +f:/etc/redhat-release -> r:^Cloud && r:release 7; +f:/etc/redhat-release -> r:^Oracle && r:release 7; +f:/etc/redhat-release -> r:^Better && r:release 7; +f:/etc/redhat-release -> r:^OpenVZ && r:release 7; + +# 1.1.1 /tmp: partition +[CIS - RHEL7 - Build considerations - Robust partition scheme - /tmp is not on its own partition] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:/tmp; + +# 1.1.2 /tmp: nodev +[CIS - RHEL7 - 1.1.2 - Partition /tmp without 'nodev' set {CIS: 1.1.2 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nodev; + +# 1.1.3 /tmp: nosuid +[CIS - RHEL7 - 1.1.3 - Partition /tmp without 'nosuid' set {CIS: 1.1.3 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nosuid; + +# 1.1.4 /tmp: noexec +[CIS - RHEL7 - 1.1.4 - Partition /tmp without 'noexec' set {CIS: 1.1.4 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:noexec; + +# 1.1.5 Build considerations - Partition scheme. +[CIS - RHEL7 - Build considerations - Robust partition scheme - /var is not on its own partition {CIS: 1.1.5 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r^# && !r:/var; + +# 1.1.6 bind mount /var/tmp to /tmp +[CIS - RHEL7 - Build considerations - Robust partition scheme - /var/tmp is bound to /tmp {CIS: 1.1.6 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && !r:/var/tmp; + +# 1.1.7 /var/log: partition +[CIS - RHEL7 - Build considerations - Robust partition scheme - /var/log is not on its own partition {CIS: 1.1.7 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && !r:/var/log; + +# 1.1.8 /var/log/audit: partition +[CIS - RHEL7 - Build considerations - Robust partition scheme - /var/log/audit is not on its own partition {CIS: 1.1.8 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && !r:/var/log/audit; + +# 1.1.9 /home: partition +[CIS - RHEL7 - Build considerations - Robust partition scheme - /home is not on its own partition {CIS: 1.1.9 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && !r:/home; + +# 1.1.10 /home: nodev +[CIS - RHEL7 - 1.1.10 - Partition /home without 'nodev' set {CIS: 1.1.10 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/home && !r:nodev; + +# 1.1.11 nodev on removable media partitions (not scored) +[CIS - RHEL7 - 1.1.11 - Removable partition /media without 'nodev' set {CIS: 1.1.11 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nodev; + +# 1.1.12 noexec on removable media partitions (not scored) +[CIS - RHEL7 - 1.1.12 - Removable partition /media without 'noexec' set {CIS: 1.1.12 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:noexec; + +# 1.1.13 nosuid on removable media partitions (not scored) +[CIS - RHEL7 - 1.1.13 - Removable partition /media without 'nosuid' set {CIS: 1.1.13 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nosuid; + +# 1.1.14 /dev/shm: nodev +[CIS - RHEL7 - 1.1.14 - /dev/shm without 'nodev' set {CIS: 1.1.14 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:nodev; + +# 1.1.15 /dev/shm: nosuid +[CIS - RHEL7 - 1.1.15 - /dev/shm without 'nosuid' set {CIS: 1.1.15 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:nosuid; + +# 1.1.16 /dev/shm: noexec +[CIS - RHEL7 - 1.1.16 - /dev/shm without 'noexec' set {CIS: 1.1.16 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:noexec; + +# 1.1.17 sticky bit on world writable directories (Scored) +# TODO + +# 1.1.18 disable cramfs (not scored) + +# 1.1.19 disable freevxfs (not scored) + +# 1.1.20 disable jffs2 (not scored) + +# 1.1.21 disable hfs (not scored) + +# 1.1.22 disable hfsplus (not scored) + +# 1.1.23 disable squashfs (not scored) + +# 1.1.24 disable udf (not scored) + + +########################################## +# 1.2 Software Updates +########################################## + +# 1.2.1 Configure rhn updates (not scored) + +# 1.2.2 verify RPM gpg keys (Scored) +# TODO + +# 1.2.3 verify gpgcheck enabled (Scored) +# TODO + +# 1.2.4 Disable rhnsd (not scored) + +# 1.2.5 Obtain Software Package Updates with yum (Not Scored) + +# 1.2.6 Obtain updates with yum (not scored) + + +############################################### +# 1.3 Advanced Intrusion Detection Environment +############################################### +# +# Skipped, this control is obsoleted by OSSEC +# + +############################################### +# 1.4 Configure SELinux +############################################### + +# 1.4.1 enable selinux in /etc/grub.conf +[CIS - RHEL7 - 1.4.1 - SELinux Disabled in /etc/grub.conf {CIS: 1.4.1 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/grub.conf -> r:selinux=0; +f:/etc/grub2.cfg -> r:selinux=0; + +# 1.4.2 Set selinux state +[CIS - RHEL7 - 1.4.2 - SELinux not set to enforcing {CIS: 1.4.2 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/selinux/config -> !r:SELINUX=enforcing; + +# 1.4.3 Set seliux policy +[CIS - RHEL7 - 1.4.3 - SELinux policy not set to targeted {CIS: 1.4.3 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/selinux/config -> !r:SELINUXTYPE=targeted; + +# 1.4.4 Remove SETroubleshoot +[CIS - RHEL7 - 1.4.4 - SELinux setroubleshoot enabled {CIS: 1.4.4 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dsetroubleshoot$; +f:/usr/share/dbus-1/services/sealert.service -> r:Exec=/usr/bin/sealert; + +# 1.4.5 Disable MCS Translation service mcstrans +[CIS - RHEL7 - 1.4.5 - SELinux mctrans enabled {CIS: 1.4.5 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dmctrans$; +f:/usr/lib/systemd/system/mcstransd.service -> r:ExecStart=/usr/sbin/mcstransd; + +# 1.4.6 Check for unconfined daemons +# TODO + + +############################################### +# 1.5 Secure Boot Settings +############################################### + +# 1.5.1 Set User/Group Owner on /etc/grub.conf +# TODO (no mode tests) +# stat -L -c "%u %g" /boot/grub2/grub.cfg | egrep "0 0" + +# 1.5.2 Set Permissions on /etc/grub.conf (Scored) +# TODO (no mode tests) +# stat -L -c "%a" /boot/grub2/grub.cfg | egrep ".00" + +# 1.5.3 Set Boot Loader Password (Scored) +[CIS - RHEL7 - 1.5.3 - GRUB Password not set {CIS: 1.5.3 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/boot/grub2/grub.cfg -> !r:^# && !r:password; + + + +############################################### +# 1.6 Additional Process Hardening +############################################### + +# 1.6.1 Restrict Core Dumps (Scored) +[CIS - RHEL7 - 1.6.1 - Interactive Boot not disabled {CIS: 1.6.1 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/security/limits.conf -> !r:^# && !r:hard\.+core\.+0; + +# 1.6.1 Enable Randomized Virtual Memory Region Placement (Scored) +# Note this is also labeled 1.6.1 in the CIS benchmark. +[CIS - RHEL7 - 1.6.1 - Randomized Virtual Memory Region Placement not enabled {CIS: 1.6.3 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/proc/sys/kernel/randomize_va_space -> !r:^2$; + + +############################################### +# 1.7 Use the Latest OS Release (Not Scored) +############################################### + + +############################################### +# 2 OS Services +############################################### + +############################################### +# 2.1 Remove Legacy Services +############################################### + +# 2.1.1 Remove telnet-server (Scored) +# TODO: detect it is installed at all +[CIS - RHEL7 - 2.1.1 - Telnet enabled on xinetd {CIS: 2.1.1 RHEL7} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/telnet -> !r:^# && r:disable && r:no; +f:/usr/lib/systemd/system/telnet@.service -> r:ExecStart=-/usr/sbin/in.telnetd; + + +# 2.1.2 Remove telnet Clients (Scored) +# TODO + +# 2.1.3 Remove rsh-server (Scored) +[CIS - RHEL7 - 2.1.3 - rsh/rlogin/rcp enabled on xinetd {CIS: 2.1.3 RHEL7} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/rlogin -> !r:^# && r:disable && r:no; +f:/etc/xinetd.d/rsh -> !r:^# && r:disable && r:no; +f:/etc/xinetd.d/shell -> !r:^# && r:disable && r:no; +# TODO (finish this) +f:/usr/lib/systemd/system/rexec@.service -> r:ExecStart; +f:/usr/lib/systemd/system/rlogin@.service -> r:ExecStart; +f:/usr/lib/systemd/system/rsh@.service -> r:ExecStart; + +# 2.1.4 Remove rsh (Scored) +# TODO + +# 2.1.5 Remove NIS Client (Scored) +[CIS - RHEL7 - 2.1.5 - Disable standard boot services - NIS (client) Enabled {CIS: 2.1.5 RHEL7} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dypbind$; +f:/usr/lib/systemd/system/ypbind.service -> r:Exec; + +# 2.1.6 Remove NIS Server (Scored) +[CIS - RHEL7 - 2.1.6 - Disable standard boot services - NIS (server) Enabled {CIS: 2.1.6 RHEL7} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dypserv$; +f:/usr/lib/systemd/system/ypserv.service -> r:Exec; + +# 2.1.7 Remove tftp (Scored) +# TODO + +# 2.1.8 Remove tftp-server (Scored) +[CIS - RHEL7 - 2.1.8 - tftpd enabled on xinetd {CIS: 2.1.8 RHEL7} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/tftpd -> !r:^# && r:disable && r:no; +f:/usr/lib/systemd/system/tftp.service -> r:Exec; + +# 2.1.9 Remove talk (Scored) +# TODO + +# 2.1.10 Remove talk-server (Scored) +[CIS - RHEL7 - 2.1.10 - talk enabled on xinetd {CIS: 2.1.10 RHEL7} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/talk -> !r:^# && r:disable && r:no; +f:/usr/lib/systemd/system/ntalk.service -> r:Exec; + +# 2.1.11 Remove xinetd (Scored) +[CIS - RHEL7 - 2.1.11 - xinetd detected {CIS: 2.1.11 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/usr/lib/systemd/system/xinetd.service -> r:Exec; + +# 2.1.12 Disable chargen-dgram (Scored) +[CIS - RHEL7 - 2.1.12 - chargen-dgram enabled on xinetd {CIS: 2.1.12 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/chargen-dgram -> !r:^# && r:disable && r:no; + +# 2.1.13 Disable chargen-stream (Scored) +[CIS - RHEL7 - 2.1.13 - chargen-stream enabled on xinetd {CIS: 2.1.13 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/chargen-stream -> !r:^# && r:disable && r:no; + +# 2.1.14 Disable daytime-dgram (Scored) +[CIS - RHEL7 - 2.1.14 - daytime-dgram enabled on xinetd {CIS: 2.1.14 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/daytime-dgram -> !r:^# && r:disable && r:no; + +# 2.1.15 Disable daytime-stream (Scored) +[CIS - RHEL7 - 2.1.15 - daytime-stream enabled on xinetd {CIS: 2.1.15 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/daytime-stream -> !r:^# && r:disable && r:no; + + +# 2.1.16 Disable echo-dgram (Scored) +[CIS - RHEL7 - 2.1.16 - echo-dgram enabled on xinetd {CIS: 2.1.16 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/echo-dgram -> !r:^# && r:disable && r:no; + +# 2.1.17 Disable echo-stream (Scored) +[CIS - RHEL7 - 2.1.17 - echo-stream enabled on xinetd {CIS: 2.1.17 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/echo-stream -> !r:^# && r:disable && r:no; + +# 2.1.18 Disable tcpmux-server (Scored) +[CIS - RHEL7 - 2.1.18 - tcpmux-server enabled on xinetd {CIS: 2.1.18 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/tcpmux-server -> !r:^# && r:disable && r:no; + + +############################################### +# 3 Special Purpose Services +############################################### + +# 3.1 Set Daemon umask (Scored) +[CIS - RHEL7 - 3.1 - Set daemon umask - Default umask is higher than 027 {CIS: 3.1 RHEL7} {PCI_DSS: 2.2.2}] [all] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/sysconfig/init -> !r:^# && r:^umask && <:umask 027; + +# 3.2 Remove X Windows (Scored) +[CIS - RHEL7 - 3.2 - X11 not disabled {CIS: 3.2 RHEL7} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +p:gdm-x-session; + +# 3.3 Disable Avahi Server (Scored) +[CIS - RHEL7 - 3.2 - Avahi daemon not disabled {CIS: 3.3 RHEL7} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +p:avahi-daemon; + +# 3.4 Disable Print Server - CUPS (Not Scored) + +# 3.5 Remove DHCP Server (Scored) +[CIS - RHEL7 - 3.5 - DHCPnot disabled {CIS: 3.5 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/usr/lib/systemd/system/dhcpd.service -> r:Exec; + +# 3.6 Configure Network Time Protocol (NTP) (Scored) +[CIS - RHEL7 - 3.6 - NTPD not Configured {CIS: 3.6 RHEL7} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/ntp.conf -> r:restrict default kod nomodify notrap nopeer noquery && r:^server; +f:/etc/sysconfig/ntpd -> r:OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid"; + +# 3.7 Remove LDAP (Not Scored) + +# 3.8 Disable NFS and RPC (Not Scored) +[CIS - RHEL7 - 3.8 - Disable standard boot services - NFS Enabled {CIS: 3.8 RHEL7} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dnfs$; +d:$rc_dirs -> ^S\d\dnfslock$; + +# 3.9 Remove DNS Server (Not Scored) +# TODO + +# 3.10 Remove FTP Server (Not Scored) +[CIS - RHEL7 - 3.10 - VSFTP enabled on xinetd {CIS: 3.10 RHEL7} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/vsftpd -> !r:^# && r:disable && r:no; + +# 3.11 Remove HTTP Server (Not Scored) +[CIS - RHEL7 - 3.11 - Disable standard boot services - Apache web server Enabled {CIS: 3.11 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dhttpd$; + +# 3.12 Remove Dovecot (IMAP and POP3 services) (Not Scored) +[CIS - RHEL7 - 3.12 - imap enabled on xinetd {CIS: 3.12 RHEL7} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/cyrus-imapd -> !r:^# && r:disable && r:no; + +[CIS - RHEL7 - 3.12 - pop3 enabled on xinetd {CIS: 3.12 RHEL7} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/dovecot -> !r:^# && r:disable && r:no; + +# 3.13 Remove Samba (Not Scored) +[CIS - RHEL7 - 3.13 - Disable standard boot services - Samba Enabled {CIS: 3.13 RHEL7} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dsamba$; +d:$rc_dirs -> ^S\d\dsmb$; + +# 3.14 Remove HTTP Proxy Server (Not Scored) +[CIS - RHEL7 - 3.14 - Disable standard boot services - Squid Enabled {CIS: 3.14 RHEL7} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dsquid$; + +# 3.15 Remove SNMP Server (Not Scored) +[CIS - RHEL7 - 3.15 - Disable standard boot services - SNMPD process Enabled {CIS: 3.15 RHEL7} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dsnmpd$; + +# 3.16 Configure Mail Transfer Agent for Local-Only Mode (Scored) +# TODO + + +############################################### +# 4 Network Configuration and Firewalls +############################################### + +############################################### +# 4.1 Modify Network Parameters (Host Only) +############################################### + +# 4.1.1 Disable IP Forwarding (Scored) +[CIS - RHEL7 - 4.1.1 - Network parameters - IP Forwarding enabled {CIS: 4.1.1 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/ip_forward -> 1; +f:/proc/sys/net/ipv6/ip_forward -> 1; + +# 4.1.2 Disable Send Packet Redirects (Scored) +[CIS - RHEL7 - 4.1.2 - Network parameters - IP send redirects enabled {CIS: 4.1.2 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/send_redirects -> 1; +f:/proc/sys/net/ipv4/conf/default/send_redirects -> 1; + + +############################################### +# 4.2 Modify Network Parameters (Host and Router) +############################################### + +# 4.2.1 Disable Source Routed Packet Acceptance (Scored) +[CIS - RHEL7 - 4.2.1 - Network parameters - Source routing accepted {CIS: 4.2.1 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/accept_source_route -> 1; + +# 4.2.2 Disable ICMP Redirect Acceptance (Scored) +[CIS - RHEL7 - 4.2.2 - Network parameters - ICMP redirects accepted {CIS: 1.1.1 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/accept_redirects -> 1; +f:/proc/sys/net/ipv4/conf/default/accept_redirects -> 1; + +# 4.2.3 Disable Secure ICMP Redirect Acceptance (Scored) +[CIS - RHEL7 - 4.2.3 - Network parameters - ICMP secure redirects accepted {CIS: 4.2.3 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/secure_redirects -> 1; +f:/proc/sys/net/ipv4/conf/default/secure_redirects -> 1; + +# 4.2.4 Log Suspicious Packets (Scored) +[CIS - RHEL7 - 4.2.4 - Network parameters - martians not logged {CIS: 4.2.4 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/log_martians -> 0; + +# 4.2.5 Enable Ignore Broadcast Requests (Scored) +[CIS - RHEL7 - 4.2.5 - Network parameters - ICMP broadcasts accepted {CIS: 4.2.5 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts -> 0; + +# 4.2.6 Enable Bad Error Message Protection (Scored) +[CIS - RHEL7 - 4.2.6 - Network parameters - Bad error message protection not enabled {CIS: 4.2.6 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/icmp_ignore_bogus_error_responses -> 0; + +# 4.2.7 Enable RFC-recommended Source Route Validation (Scored) +[CIS - RHEL7 - 4.2.7 - Network parameters - RFC Source route validation not enabled {CIS: 4.2.7 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/rp_filter -> 0; +f:/proc/sys/net/ipv4/conf/default/rp_filter -> 0; + +# 4.2.8 Enable TCP SYN Cookies (Scored) +[CIS - RHEL7 - 4.2.8 - Network parameters - SYN Cookies not enabled {CIS: 4.2.8 RHEL7} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/tcp_syncookies -> 0; + + +############################################### +# 4.3 Wireless Networking +############################################### + +# 4.3.1 Deactivate Wireless Interfaces (Not Scored) + + +############################################### +# 4.4 Disable ipv6 +############################################### + +############################################### +# 4.4.1 Configure IPv6 +############################################### + +# 4.4.1.1 Disable IPv6 Router Advertisements (Not Scored) + +# 4.4.1.2 Disable IPv6 Redirect Acceptance (Not Scored) + +# 4.4.2 Disable IPv6 (Not Scored) + + +############################################### +# 4.5 Install TCP Wrappers +############################################### + +# 4.5.1 Install TCP Wrappers (Not Scored) + +# 4.5.2 Create /etc/hosts.allow (Not Scored) + +# 4.5.3 Verify Permissions on /etc/hosts.allow (Scored) +# TODO + +# 4.5.4 Create /etc/hosts.deny (Not Scored) + +# 4.5.5 Verify Permissions on /etc/hosts.deny (Scored) +# TODO + + +############################################### +# 4.6 Uncommon Network Protocols +############################################### + +# 4.6.1 Disable DCCP (Not Scored) + +# 4.6.2 Disable SCTP (Not Scored) + +# 4.6.3 Disable RDS (Not Scored) + +# 4.6.4 Disable TIPC (Not Scored) + +# 4.7 Enable IPtables (Scored) +#[CIS - RHEL7 - 4.7 - Uncommon Network Protocols - Firewalld not enabled {CIS: 4.7 RHEL7}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +#f:/usr/lib/systemd/system/firewalld.service -> TODO; + + +############################################### +# 5 Logging and Auditing +############################################### + +############################################### +# 5.1 Configure Syslog +############################################### + +# 5.1.1 Install the rsyslog package (Scored) +# TODO + +# 5.1.2 Activate the rsyslog Service (Scored) +# TODO + +# 5.1.3 Configure /etc/rsyslog.conf (Not Scored) + +# 5.1.4 Create and Set Permissions on rsyslog Log Files (Scored) + +# 5.1.5 Configure rsyslog to Send Logs to a Remote Log Host (Scored) + +# 5.1.6 Accept Remote rsyslog Messages Only on Designated Log Hosts (Not Scored) + + +############################################### +# 5.2 Configure System Accounting (auditd) +############################################### + +############################################### +# 5.2.1 Configure Data Retention +############################################### + +# 5.2.1.1 Configure Audit Log Storage Size (Not Scored) + +# 5.2.1.2 Disable System on Audit Log Full (Not Scored) + +# 5.2.1.3 Keep All Auditing Information (Scored) + +# 5.2.2 Enable auditd Service (Scored) + +# 5.2.3 Enable Auditing for Processes That Start Prior to auditd (Scored) + +# 5.2.4 Record Events That Modify Date and Time Information (Scored) + +# 5.2.5 Record Events That Modify User/Group Information (Scored) + +# 5.2.6 Record Events That Modify the System’s Network Environment (Scored) + +# 5.2.7 Record Events That Modify the System’s Mandatory Access Controls (Scored) + +# 5.2.8 Collect Login and Logout Events (Scored) + +# 5.2.9 Collect Session Initiation Information (Scored) + +# 5.2.10 Collect Discretionary Access Control Permission Modification Events (Scored) + +# 5.2.11 Collect Unsuccessful Unauthorized Access Attempts to Files (Scored) + +# 5.2.12 Collect Use of Privileged Commands (Scored) + +# 5.2.13 Collect Successful File System Mounts (Scored) + +# 5.2.14 Collect File Deletion Events by User (Scored) + +# 5.2.15 Collect Changes to System Administration Scope (sudoers) (Scored) + +# 5.2.16 Collect System Administrator Actions (sudolog) (Scored) + +# 5.2.17 Collect Kernel Module Loading and Unloading (Scored) + +# 5.2.18 Make the Audit Configuration Immutable (Scored) + +# 5.3 Configure logrotate (Not Scored) + + +############################################### +# 6 System Access, Authentication and Authorization +############################################### + +############################################### +# 6.1 Configure cron and anacron +############################################### + +# 6.1.1 Enable anacron Daemon (Scored) + +# 6.1.2 Enable cron Daemon (Scored) + +# 6.1.3 Set User/Group Owner and Permission on /etc/anacrontab (Scored) + +# 6.1.4 Set User/Group Owner and Permission on /etc/crontab (Scored) + +# 6.1.5 Set User/Group Owner and Permission on /etc/cron.hourly (Scored) + +# 6.1.6 Set User/Group Owner and Permission on /etc/cron.daily (Scored) + +# 6.1.7 Set User/Group Owner and Permission on /etc/cron.weekly (Scored) + +# 6.1.8 Set User/Group Owner and Permission on /etc/cron.monthly (Scored) + +# 6.1.9 Set User/Group Owner and Permission on /etc/cron.d (Scored) + +# 6.1.10 Restrict at Daemon (Scored) + +# 6.1.11 Restrict at/cron to Authorized Users (Scored) + +############################################### +# 6.2 Configure SSH +############################################### + +# 6.2.1 Set SSH Protocol to 2 (Scored) +[CIS - RHEL7 - 6.2.1 - SSH Configuration - Protocol version 1 enabled {CIS: 6.2.1 RHEL7} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\.+1; + +# 6.2.2 Set LogLevel to INFO (Scored) +[CIS - RHEL7 - 6.2.1 - SSH Configuration - Protocol version 1 enabled {CIS: 6.2.1 RHEL7} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && !r:LogLevel\.+INFO; + +# 6.2.3 Set Permissions on /etc/ssh/sshd_config (Scored) +# TODO + +# 6.2.4 Disable SSH X11 Forwarding (Scored) +# TODO + +# 6.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) +[CIS - RHEL7 - 6.2.5 - SSH Configuration - Set SSH MaxAuthTries to 4 or Less {CIS - RHEL7 - 6.2.5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:$sshd_file -> !r:^\s*MaxAuthTries\s+4\s*$; + +# 6.2.6 Set SSH IgnoreRhosts to Yes (Scored) +[CIS - RHEL7 - 6.2.6 - SSH Configuration - IgnoreRHosts disabled {CIS: 6.2.6 RHEL7} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\.+no; + +# 6.2.7 Set SSH HostbasedAuthentication to No (Scored) +[CIS - RHEL7 - 6.2.7 - SSH Configuration - Host based authentication enabled {CIS: 6.2.7 RHEL7} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\.+yes; + +# 6.2.8 Disable SSH Root Login (Scored) +[CIS - RHEL7 - 6.2.8 - SSH Configuration - Root login allowed {CIS: 6.2.8 RHEL7} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:$sshd_file -> !r:^\s*PermitRootLogin\.+no; + +# 6.2.9 Set SSH PermitEmptyPasswords to No (Scored) +[CIS - RHEL7 - 6.2.9 - SSH Configuration - Empty passwords permitted {CIS: 6.2.9 RHEL7} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:$sshd_file -> !r:^\s*PermitEmptyPasswords\.+no; + +# 6.2.10 Do Not Allow Users to Set Environment Options (Scored) + +# 6.2.11 Use Only Approved Ciphers in Counter Mode (Scored) + +# 6.2.12 Set Idle Timeout Interval for User Login (Not Scored) + +# 6.2.13 Limit Access via SSH (Scored) + +# 6.2.14 Set SSH Banner (Scored) + + +############################################### +# 6.3 Configure PAM +############################################### + +# 6.3.1 Upgrade Password Hashing Algorithm to SHA-512 (Scored) +# authconfig --test | grep hashing | grep sha512 + +# 6.3.2 Set Password Creation Requirement Parameters Using pam_cracklib (Scored) + +# 6.3.3 Set Lockout for Failed Password Attempts (Not Scored) + +# 6.3.4 Limit Password Reuse (Scored) + + +# 6.4 Restrict root Login to System Console (Not Scored) + +# 6.5 Restrict Access to the su Command (Scored) + + +############################################### +# 7 User Accounts and Environment +############################################### + +############################################### +# 7.1 Set Shadow Password Suite Parameters (/etc/login.defs) +############################################### + +# 7.1.1 Set Password Expiration Days (Scored) + +# 7.1.2 Set Password Change Minimum Number of Days (Scored) + +# 7.1.3 Set Password Expiring Warning Days (Scored) + +# 7.2 Disable System Accounts (Scored) + +# 7.3 Set Default Group for root Account (Scored) + +# 7.4 Set Default umask for Users (Scored) + +# 7.5 Lock Inactive User Accounts (Scored) + + +############################################### +# 8 Warning Banners +############################################### + +############################################### +# 8.1 Warning Banners for Standard Login Services +############################################### + +# 8.1 Set Warning Banner for Standard Login Services (Scored) + +# 8.2 Remove OS Information from Login Warning Banners (Scored) + +# 8.3 Set GNOME Warning Banner (Not Scored) + + +############################################### +# 9 System Maintenance +############################################### + +############################################### +# 9.1 Verify System File Permissions +############################################### + +# 9.1.1 Verify System File Permissions (Not Scored) + +# 9.1.2 Verify Permissions on /etc/passwd (Scored) + +# 9.1.3 Verify Permissions on /etc/shadow (Scored) + +# 9.1.4 Verify Permissions on /etc/gshadow (Scored) + +# 9.1.5 Verify Permissions on /etc/group (Scored) + +# 9.1.6 Verify User/Group Ownership on /etc/passwd (Scored) + +# 9.1.7 Verify User/Group Ownership on /etc/shadow (Scored) + +# 9.1.8 Verify User/Group Ownership on /etc/gshadow (Scored) + +# 9.1.9 Verify User/Group Ownership on /etc/group (Scored) + +# 9.1.10 Find World Writable Files (Not Scored) + +# 9.1.11 Find Un-owned Files and Directories (Scored) + +# 9.1.12 Find Un-grouped Files and Directories (Scored) + +# 9.1.13 Find SUID System Executables (Not Scored) + +# 9.1.14 Find SGID System Executables (Not Scored) + + +############################################### +# 9.2 Review User and Group Settings +############################################### + +# 9.2.1 Ensure Password Fields are Not Empty (Scored) + +# 9.2.2 Verify No Legacy "+" Entries Exist in /etc/passwd File (Scored) + +# 9.2.3 Verify No Legacy "+" Entries Exist in /etc/shadow File (Scored) + +# 9.2.4 Verify No Legacy "+" Entries Exist in /etc/group File (Scored) + +# 9.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) +[CIS - RHEL7 - 9.2.5 - Non-root account with uid 0 {CIS: 9.2.5 RHEL7} {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:; + +# 9.2.6 Ensure root PATH Integrity (Scored) + +# 9.2.7 Check Permissions on User Home Directories (Scored) + +# 9.2.8 Check User Dot File Permissions (Scored) + +# 9.2.9 Check Permissions on User .netrc Files (Scored) + +# 9.2.10 Check for Presence of User .rhosts Files (Scored) + +# 9.2.11 Check Groups in /etc/passwd (Scored) + +# 9.2.12 Check That Users Are Assigned Valid Home Directories (Scored) + +# 9.2.13 Check User Home Directory Ownership (Scored) + +# 9.2.14 Check for Duplicate UIDs (Scored) + +# 9.2.15 Check for Duplicate GIDs (Scored) + +# 9.2.16 Check That Reserved UIDs Are Assigned to System Accounts (Scored) + +# 9.2.17 Check for Duplicate User Names (Scored) + +# 9.2.18 Check for Duplicate Group Names (Scored) + +# 9.2.19 Check for Presence of User .netrc Files (Scored) + +# 9.2.20 Check for Presence of User .forward Files (Scored) + + +# Other/Legacy Tests +[CIS - RHEL7 - X.X.X - Account with empty password present {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/shadow -> r:^\w+::; + +[CIS - RHEL7 - X.X.X - User-mounted removable partition allowed on the console] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +f:/etc/security/console.perms -> r:^ \d+ ; +f:/etc/security/console.perms -> r:^ \d+ ; + +[CIS - RHEL7 - X.X.X - Disable standard boot services - Kudzu hardware detection Enabled] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dkudzu$; + +[CIS - RHEL7 - X.X.X - Disable standard boot services - PostgreSQL server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dpostgresql$; + +[CIS - RHEL7 - X.X.X - Disable standard boot services - MySQL server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dmysqld$; + +[CIS - RHEL7 - X.X.X - Disable standard boot services - DNS server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dnamed$; + +[CIS - RHEL7 - X.X.X - Disable standard boot services - NetFS Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_Red_Hat_Enterprise_Linux_7_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dnetfs$; diff --git a/etc/ruleset/rootcheck/cis_rhel_linux_rcl.txt b/etc/ruleset/rootcheck/cis_rhel_linux_rcl.txt new file mode 100644 index 0000000000..4574c1402f --- /dev/null +++ b/etc/ruleset/rootcheck/cis_rhel_linux_rcl.txt @@ -0,0 +1,288 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2014 +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://www.gnu.org/licenses/gpl.html +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - p (process running) +# - d (any file inside the directory) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + + +# CIS Checks for Red Hat (RHEL 2.1, 3.0, 4.0 and Fedora Core 1,2,3,4 and 5). +# Based on CIS Benchmark for Red Hat Enterprise Linux v1.0.5 + + + +# RC scripts location +$rc_dirs=/etc/rc.d/rc2.d,/etc/rc.d/rc3.d,/etc/rc.d/rc4.d,/etc/rc.d/rc5.d; + + + +# Main one. Only valid for Red Hat/Fedora. +[CIS - Testing against the CIS Red Hat Enterprise Linux Benchmark v1.0.5] [any required] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/redhat-release -> r:^Red Hat Enterprise Linux \S+ release 4; +f:/etc/redhat-release -> r:^Red Hat Enterprise Linux \S+ release 3; +f:/etc/redhat-release -> r:^Red Hat Enterprise Linux \S+ release 2.1; +f:/etc/fedora-release -> r:^Fedora && r:release 1; +f:/etc/fedora-release -> r:^Fedora && r:release 2; +f:/etc/fedora-release -> r:^Fedora && r:release 3; +f:/etc/fedora-release -> r:^Fedora && r:release 4; +f:/etc/fedora-release -> r:^Fedora && r:release 5; + + +# Build considerations - Partition scheme. +[CIS - Red Hat Linux - - Build considerations - Robust partition scheme - /var is not on its own partition] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/fstab -> !r:/var; + +[CIS - Red Hat Linux - - Build considerations - Robust partition scheme - /home is not on its own partition] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/fstab -> !r:/home; + + +# Section 1.3 - SSH configuration +[CIS - Red Hat Linux - 1.3 - SSH Configuration - Protocol version 1 enabled {CIS: 1.3 Red Hat Linux} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\.+1; + +[CIS - Red Hat Linux - 1.3 - SSH Configuration - IgnoreRHosts disabled {CIS: 1.3 Red Hat Linux} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\.+no; + +[CIS - Red Hat Linux - 1.3 - SSH Configuration - Empty passwords permitted {CIS: 1.3 Red Hat Linux} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:^PermitEmptyPasswords\.+yes; + +[CIS - Red Hat Linux - 1.3 - SSH Configuration - Host based authentication enabled {CIS: 1.3 Red Hat Linux} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\.+yes; + +[CIS - Red Hat Linux - 1.3 - SSH Configuration - Root login allowed {CIS: 1.3 Red Hat Linux} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\.+yes; + + +# Section 1.4 Enable system accounting +#[CIS - Red Hat Linux - 1.4 - System Accounting - Sysstat not installed] [all] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +#f:!/var/log/sa; + + +# Section 2.5 Install and run Bastille +#[CIS - Red Hat Linux - 1.5 - System harderning - Bastille is not installed] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +#f:!/etc/Bastille; + + +# Section 2 - Minimize xinetd services +[CIS - Red Hat Linux - 2.3 - Telnet enabled on xinetd {CIS: 2.3 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/xinetd.c/telnet -> !r:^# && r:disable && r:no; + +[CIS - Red Hat Linux - 2.4 - VSFTP enabled on xinetd {CIS: 2.4 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/xinetd.c/vsftpd -> !r:^# && r:disable && r:no; + +[CIS - Red Hat Linux - 2.4 - WU-FTP enabled on xinetd {CIS: 2.4 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/xinetd.c/wu-ftpd -> !r:^# && r:disable && r:no; + +[CIS - Red Hat Linux - 2.5 - rsh/rlogin/rcp enabled on xinetd {CIS: 2.5 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/xinetd.c/rlogin -> !r:^# && r:disable && r:no; +f:/etc/xinetd.c/rsh -> !r:^# && r:disable && r:no; +f:/etc/xinetd.c/shell -> !r:^# && r:disable && r:no; + +[CIS - Red Hat Linux - 2.6 - tftpd enabled on xinetd {CIS: 2.6 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/xinetd.c/tftpd -> !r:^# && r:disable && r:no; + +[CIS - Red Hat Linux - 2.7 - imap enabled on xinetd {CIS: 2.7 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/xinetd.c/imap -> !r:^# && r:disable && r:no; +f:/etc/xinetd.c/imaps -> !r:^# && r:disable && r:no; + +[CIS - Red Hat Linux - 2.8 - pop3 enabled on xinetd {CIS: 2.8 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/xinetd.c/ipop3 -> !r:^# && r:disable && r:no; +f:/etc/xinetd.c/pop3s -> !r:^# && r:disable && r:no; + + +# Section 3 - Minimize boot services +[CIS - Red Hat Linux - 3.1 - Set daemon umask - Default umask is higher than 027 {CIS: 3.1 Red Hat Linux}] [all] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/init.d/functions -> !r:^# && r:^umask && >:umask 027; + +[CIS - Red Hat Linux - 3.4 - GUI login enabled {CIS: 3.4 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/inittab -> !r:^# && r:id:5; + +[CIS - Red Hat Linux - 3.7 - Disable standard boot services - Samba Enabled {CIS: 3.7 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +d:$rc_dirs -> ^S\d\dsamba$; +d:$rc_dirs -> ^S\d\dsmb$; + +[CIS - Red Hat Linux - 3.8 - Disable standard boot services - NFS Enabled {CIS: 3.8 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +d:$rc_dirs -> ^S\d\dnfs$; +d:$rc_dirs -> ^S\d\dnfslock$; + +[CIS - Red Hat Linux - 3.10 - Disable standard boot services - NIS Enabled {CIS: 3.10 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +d:$rc_dirs -> ^S\d\dypbind$; +d:$rc_dirs -> ^S\d\dypserv$; + +[CIS - Red Hat Linux - 3.13 - Disable standard boot services - NetFS Enabled {CIS: 3.13 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +d:$rc_dirs -> ^S\d\dnetfs$; + +[CIS - Red Hat Linux - 3.15 - Disable standard boot services - Apache web server Enabled {CIS: 3.15 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +d:$rc_dirs -> ^S\d\dapache$; +d:$rc_dirs -> ^S\d\dhttpd$; + +[CIS - Red Hat Linux - 3.15 - Disable standard boot services - TUX web server Enabled {CIS: 3.15 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +d:$rc_dirs -> ^S\d\dtux$; + +[CIS - Red Hat Linux - 3.16 - Disable standard boot services - SNMPD process Enabled {CIS: 3.16 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +d:$rc_dirs -> ^S\d\dsnmpd$; + +[CIS - Red Hat Linux - 3.17 - Disable standard boot services - DNS server Enabled {CIS: 3.17 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +d:$rc_dirs -> ^S\d\dnamed$; + +[CIS - Red Hat Linux - 3.18 - Disable standard boot services - MySQL server Enabled {CIS: 3.18 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +d:$rc_dirs -> ^S\d\dmysqld$; + +[CIS - Red Hat Linux - 3.18 - Disable standard boot services - PostgreSQL server Enabled {CIS: 3.18 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +d:$rc_dirs -> ^S\d\dpostgresql$; + +[CIS - Red Hat Linux - 3.19 - Disable standard boot services - Webmin Enabled {CIS: 3.19 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +d:$rc_dirs -> ^S\d\dwebmin$; + +[CIS - Red Hat Linux - 3.20 - Disable standard boot services - Squid Enabled {CIS: 3.20 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +d:$rc_dirs -> ^S\d\dsquid$; + +[CIS - Red Hat Linux - 3.21 - Disable standard boot services - Kudzu hardware detection Enabled {CIS: 3.21 Red Hat Linux} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +d:$rc_dirs -> ^S\d\dkudzu$; + + +# Section 4 - Kernel tuning +[CIS - Red Hat Linux - 4.1 - Network parameters - Source routing accepted {CIS: 4.1 Red Hat Linux}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/proc/sys/net/ipv4/conf/all/accept_source_route -> 1; + +[CIS - Red Hat Linux - 4.1 - Network parameters - ICMP broadcasts accepted {CIS: 4.1 Red Hat Linux}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts -> 0; + +[CIS - Red Hat Linux - 4.2 - Network parameters - IP Forwarding enabled {CIS: 4.2 Red Hat Linux}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/proc/sys/net/ipv4/ip_forward -> 1; +f:/proc/sys/net/ipv6/ip_forward -> 1; + + +# Section 6 - Permissions +[CIS - Red Hat Linux - 6.1 - Partition /var without 'nodev' set {CIS: 6.1 Red Hat Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/var && !r:nodev; + +[CIS - Red Hat Linux - 6.1 - Partition /tmp without 'nodev' set {CIS: 6.1 Red Hat Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/tmp && !r:nodev; + +[CIS - Red Hat Linux - 6.1 - Partition /opt without 'nodev' set {CIS: 6.1 Red Hat Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/opt && !r:nodev; + +[CIS - Red Hat Linux - 6.1 - Partition /home without 'nodev' set {CIS: 6.1 Red Hat Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/fstab -> !r:^# && r:ext2|ext3 && r:/home && !r:nodev ; + +[CIS - Red Hat Linux - 6.2 - Removable partition /media without 'nodev' set {CIS: 6.2 Red Hat Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nodev; + +[CIS - Red Hat Linux - 6.2 - Removable partition /media without 'nosuid' set {CIS: 6.2 Red Hat Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nosuid; + +[CIS - Red Hat Linux - 6.3 - User-mounted removable partition allowed on the console {CIS: 6.3 Red Hat Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/security/console.perms -> r:^ \d+ ; +f:/etc/security/console.perms -> r:^ \d+ ; + + +# Section 7 - Access and authentication +[CIS - Red Hat Linux - 7.8 - LILO Password not set {CIS: 7.8 Red Hat Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/lilo.conf -> !r:^# && !r:restricted; +f:/etc/lilo.conf -> !r:^# && !r:password=; + +[CIS - Red Hat Linux - 7.8 - GRUB Password not set {CIS: 7.8 Red Hat Linux} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/boot/grub/menu.lst -> !r:^# && !r:password; + +[CIS - Red Hat Linux - 8.2 - Account with empty password present {CIS: 8.2 Red Hat Linux} {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/shadow -> r:^\w+::; + +[CIS - Red Hat Linux - SN.11 - Non-root account with uid 0 {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_RHLinux_Benchmark_v1.0.5.pdf] +f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:; + + +# Tests specific for VMware ESX - Runs on Red Hat Linux - +# Will not be tested anywhere else. +[VMware ESX - Testing against the Security Harderning benchmark VI3 for ESX 3.5] [any required] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +f:/etc/vmware-release -> r:^VMware ESX; + + +# Virtual Machine Files and Settings - 1 +# 1.1 +[VMware ESX - VM settings - Copy operation between guest and console enabled] [any] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +d:/vmfs/volumes -> .vmx$ -> !r:^isolation.tools.copy.disable; +d:/vmfs/volumes -> .vmx$ -> r:^isolation.tools.copy.disable && r:false; + +# 1.2 +[VMware ESX - VM settings - Paste operation between guest and console enabled] [any] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +d:/vmfs/volumes -> .vmx$ -> !r:^isolation.tools.paste.disable; +d:/vmfs/volumes -> .vmx$ -> r:^isolation.tools.paste.disable && r:false; + +# 1.3 +[VMware ESX - VM settings - GUI Options enabled] [any] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +d:/vmfs/volumes -> .vmx$ -> r:^isolation.tools.setGUIOptions.enable && r:true; + +# 1.4 +[VMware ESX - VM settings - Data Flow from the Virtual Machine to the Datastore not limited - Rotate size not 100KB] [any] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +d:/vmfs/volumes -> .vmx$ -> !r:^log.rotateSize; +d:/vmfs/volumes -> .vmx$ -> r:^log.rotateSize && !r:"100000"; + +# 1.5 +[VMware ESX - VM settings - Data Flow from the Virtual Machine to the Datastore not limited - Maximum number of logs not 10] [any] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +d:/vmfs/volumes -> .vmx$ -> !r:^log.keepOld; +d:/vmfs/volumes -> .vmx$ -> r:^log.keepOld && r:"10"; + +# 1.6 +[VMware ESX - VM settings - Data Flow from the Virtual Machine to the Datastore not limited - Guests allowed to write SetInfo data to config] [any] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +d:/vmfs/volumes -> .vmx$ -> !r:^isolation.tools.setinfo.disable; +d:/vmfs/volumes -> .vmx$ -> r:^isolation.tools.setinfo.disable && r:false; + +# 1.7 +[VMware ESX - VM settings - Nonpersistent Disks being used] [any] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +d:/vmfs/volumes -> .vmx$ -> r:^scsi\d:\d.mode && r:!independent-nonpersistent; + +# 1.8 +[VMware ESX - VM settings - Floppy drive present] [any] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +d:/vmfs/volumes -> .vmx$ -> r:^floppy\d+.present && r:!false; + +[VMware ESX - VM settings - Serial port present] [any] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +d:/vmfs/volumes -> .vmx$ -> r:^serial\d+.present && r:!false; + +[VMware ESX - VM settings - Parallel port present] [any] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +d:/vmfs/volumes -> .vmx$ -> r:^parallel\d+.present && r:!false; + +# 1.9 +[VMware ESX - VM settings - Unauthorized Removal or Connection of Devices allowed] [any] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +d:/vmfs/volumes -> .vmx$ -> !r:^Isolation.tools.connectable.disable; +d:/vmfs/volumes -> .vmx$ -> r:^Isolation.tools.connectable.disable && r:false; + +# 1.10 +[VMware ESX - VM settings - Avoid Denial of Service Caused by Virtual Disk Modification Operations - diskWiper enabled] [any] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +d:/vmfs/volumes -> .vmx$ -> !r:^isolation.tools.diskWiper.disable; +d:/vmfs/volumes -> .vmx$ -> r:^isolation.tools.diskWiper.disable && r:false; + +[VMware ESX - VM settings - Avoid Denial of Service Caused by Virtual Disk Modification Operations - diskShrink enabled] [any] [http://www.vmware.com/pdf/vi3_security_hardening_wp.pdf] +d:/vmfs/volumes -> .vmx$ -> !r:^isolation.tools.diskShrink.disable; +d:/vmfs/volumes -> .vmx$ -> r:^isolation.tools.diskShrink.disable && r:false; + + +# Configuring the Service Console in ESX 3.5 - 2 +# 2.1 diff --git a/etc/ruleset/rootcheck/cis_sles11_linux_rcl.txt b/etc/ruleset/rootcheck/cis_sles11_linux_rcl.txt new file mode 100644 index 0000000000..8ded004454 --- /dev/null +++ b/etc/ruleset/rootcheck/cis_sles11_linux_rcl.txt @@ -0,0 +1,731 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2014 +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://www.gnu.org/licenses/gpl.html +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - p (process running) +# - d (any file inside the directory) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + + +# CIS Checks for SUSE SLES 11 +# Based on CIS Benchmark for SUSE Linux Enterprise Server 11 v1.1.0 + +# RC scripts location +$rc_dirs=/etc/rc.d/rc2.d,/etc/rc.d/rc3.d,/etc/rc.d/rc4.d,/etc/rc.d/rc5.d; + + +[CIS - Testing against the CIS SUSE Linux Enterprise Server 11 Benchmark v1.1.0] [any required] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/os-release -> r:^PRETTY_NAME="SUSE Linux Enterprise Server 11"; +f:/etc/os-release -> r:^PRETTY_NAME="SUSE Linux Enterprise Server 11 SP1"; +f:/etc/os-release -> r:^PRETTY_NAME="SUSE Linux Enterprise Server 11 SP2"; +f:/etc/os-release -> r:^PRETTY_NAME="SUSE Linux Enterprise Server 11 SP3"; +f:/etc/os-release -> r:^PRETTY_NAME="SUSE Linux Enterprise Server 11 SP4"; + +# 2.1 /tmp: partition +[CIS - SLES11 - 2.1 - Build considerations - Robust partition scheme - /tmp is not on its own partition {CIS: 2.2 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:/tmp; + +# 2.2 /tmp: nodev +[CIS - SLES11 - 2.2 - Partition /tmp without 'nodev' set {CIS: 2.2 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nodev; + +# 2.3 /tmp: nosuid +[CIS - SLES11 - 2.3 - Partition /tmp without 'nosuid' set {CIS: 2.3 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nosuid; + +# 2.4 /tmp: noexec +[CIS - SLES11 - 2.4 - Partition /tmp without 'noexec' set {CIS: 2.4 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nodev; + +# 2.5 Build considerations - Partition scheme. +[CIS - SLES11 - Build considerations - Robust partition scheme - /var is not on its own partition {CIS: 2.5 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r^# && !r:/var; + +# 2.6 bind mount /var/tmp to /tmp +[CIS - SLES11 - Build considerations - Robust partition scheme - /var/tmp is bound to /tmp {CIS: 2.6 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> r:^# && !r:/var/tmp && !r:bind; + +# 2.7 /var/log: partition +[CIS - SLES11 - Build considerations - Robust partition scheme - /var/log is not on its own partition {CIS: 2.7 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> ^# && !r:/var/log; + +# 2.8 /var/log/audit: partition +[CIS - SLES11 - Build considerations - Robust partition scheme - /var/log/audit is not on its own partition {CIS: 2.8 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> ^# && !r:/var/log/audit; + +# 2.9 /home: partition +[CIS - SLES11 - Build considerations - Robust partition scheme - /home is not on its own partition {CIS: 2.9 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> ^# && !r:/home; + +# 2.10 /home: nodev +[CIS - SLES11 - 2.10 - Partition /home without 'nodev' set {CIS: 2.10 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/home && !r:nodev; + +# 2.11 nodev on removable media partitions (not scored) +[CIS - SLES11 - 2.11 - Removable partition /media without 'nodev' set {CIS: 2.11 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nodev; + +# 2.12 noexec on removable media partitions (not scored) +[CIS - SLES11 - 2.12 - Removable partition /media without 'noexec' set {CIS: 2.12 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:noexec; + +# 2.13 nosuid on removable media partitions (not scored) +[CIS - SLES11 - 2.13 - Removable partition /media without 'nosuid' set {CIS: 2.13 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nosuid; + +# 2.14 /dev/shm: nodev +[CIS - SLES11 - 2.14 - /dev/shm without 'nodev' set {CIS: 2.14 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:nodev; + +# 2.15 /dev/shm: nosuid +[CIS - SLES11 - 2.15 - /dev/shm without 'nosuid' set {CIS: 2.15 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:nosuid; + +# 2.16 /dev/shm: noexec +[CIS - SLES11 - 2.16 - /dev/shm without 'noexec' set {CIS: 2.16 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:noexec; + +# 2.17 sticky bit on world writable directories (Scored) +# TODO + +# 2.18 disable cramfs (not scored) + +# 2.19 disable freevxfs (not scored) + +# 2.20 disable jffs2 (not scored) + +# 2.21 disable hfs (not scored) + +# 2.22 disable hfsplus (not scored) + +# 2.23 disable squashfs (not scored) + +# 2.24 disable udf (not scored) + +# 2.25 disable automounting (Scored) +# TODO + +############################################### +# 3 Secure Boot Settings +############################################### + +# 3.1 Set User/Group Owner on /etc/grub.conf +# TODO (no mode tests) +# stat -L -c "%u %g" /boot/grub2/grub.cfg | egrep "0 0" + +# 3.2 Set Permissions on /etc/grub.conf (Scored) +# TODO (no mode tests) +# stat -L -c "%a" /boot/grub2/grub.cfg | egrep ".00" + +# 3.3 Set Boot Loader Password (Scored) +[CIS - SLES11 - 3.3 - GRUB Password not set {CIS: 3.3 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/boot/grub2/grub.cfg -> !r:^# && !r:password; + +# 3.4 Require Authentication for Single-User Mode (Scored) + +# 3.5 Disable Interactive Boot (Scored) + +############################################### +# 4 Additional Process Hardening +############################################### + +# 4.1 Restrict Core Dumps (Scored) +[CIS - SLES11 - 4.1 - Interactive Boot not disabled {CIS: 4.1 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/security/limits.conf -> !r:^# && !r:hard\.+core\.+0; + +# 4.2 Enable XD/NX Support on 32-bit x86 Systems (Not Scored) +# TODO + +# 4.3 Enable Randomized Virtual Memory Region Placement (Scored) +[CIS - SLES11 - 4.3 - Randomized Virtual Memory Region Placement not enabled {CIS: 4.3 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/proc/sys/kernel/randomize_va_space -> 2; + +# 4.4 Disable Prelink (Scored) +# TODO + +# 4.5 Activate AppArmor (Scored) +# TODO + +############################################### +# 5 OS Services +############################################### + +############################################### +# 5.1 Remove Legacy Services +############################################### + +# 5.1.1 Remove NIS Server (Scored) +[CIS - SLES11 - 5.1.1 - Disable standard boot services - NIS (server) Enabled {CIS: 5.1.1 SLES11} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dypserv$; + +# 5.1.2 Remove NIS Client (Scored) +[CIS - SLES11 - 5.1.2 - Disable standard boot services - NIS (client) Enabled {CIS: 51.2 SLES11} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dypbind$; + +# 5.1.3 Remove rsh-server (Scored) +[CIS - SLES11 - 5.1.3 - rsh/rlogin/rcp enabled on xinetd {CIS: 5.1.3 SLES11} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/rlogin -> !r:^# && r:disable && r:no; +f:/etc/xinetd.d/rsh -> !r:^# && r:disable && r:no; +f:/etc/xinetd.d/shell -> !r:^# && r:disable && r:no; + +# 5.1.4 Remove rsh client (Scored) +# TODO + +# 5.1.5 Remove talk-server (Scored) +[CIS - SLES11 - 5.1.5 - talk enabled on xinetd {CIS: 5.1.5 SLES11} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/talk -> !r:^# && r:disable && r:no; + +# 5.1.6 Remove talk client (Scored) +# TODO + +# 5.1.7 Remove telnet-server (Scored) +# TODO: detect it is installed at all +[CIS - SLES11 - 5.1.7 - Telnet enabled on xinetd {CIS: 5.1.7 SLES11} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/telnet -> !r:^# && r:disable && r:no; + +# 5.1.8 Remove tftp-server (Scored) +[CIS - SLES11 - 5.1.8 - tftpd enabled on xinetd {CIS: 5.1.8 SLES11} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/tftpd -> !r:^# && r:disable && r:no; + +# 5.1.9 Remove xinetd (Scored) +[CIS - SLES11 - 5.1.9 - xinetd detected {CIS: 5.1.9 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] + +# 5.2 Disable chargen-udp (Scored) +[CIS - SLES11 - 5.2 - chargen-udp enabled on xinetd {CIS: 5.2 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/chargen-udp -> !r:^# && r:disable && r:no; + +# 5.3 Disable chargen (Scored) +[CIS - SLES11 - 5.3 - chargen enabled on xinetd {CIS: 5.3 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/chargen -> !r:^# && r:disable && r:no; + +# 5.4 Disable daytime-udp (Scored) +[CIS - SLES11 - 5.4 - daytime-udp enabled on xinetd {CIS: 5.4 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/daytime-udp -> !r:^# && r:disable && r:no; + +# 5.5 Disable daytime (Scored) +[CIS - SLES11 - 5.5 - daytime enabled on xinetd {CIS: 5.5 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/daytime -> !r:^# && r:disable && r:no; + + +# 5.6 Disable echo-udp (Scored) +[CIS - SLES11 - 5.6 - echo-udp enabled on xinetd {CIS: 5.6 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/echo-udp -> !r:^# && r:disable && r:no; + +# 5.7 Disable echo (Scored) +[CIS - SLES11 - 5.7 - echo enabled on xinetd {CIS: 5.7 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/echo -> !r:^# && r:disable && r:no; + +# 5.8 Disable discard-udp (Scored) +[CIS - SLES11 - 5.8 - discard-udp enabled on xinetd {CIS: 5.8 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/discard-udp -> !r:^# && r:disable && r:no; + +# 5.9 Disable discard (Scored) +[CIS - SLES11 - 5.9 - discard enabled on xinetd {CIS: 5.9 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/discard -> !r:^# && r:disable && r:no; + +# 5.10 Disable time-udp (Scored) +[CIS - SLES11 - 5.10 - time-udp enabled on xinetd {CIS: 5.10 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/time-udp -> !r:^# && r:disable && r:no; + +# 5.11 Disable time (Scored) +[CIS - SLES11 - 5.11 - time enabled on xinetd {CIS: 5.11 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/time -> !r:^# && r:disable && r:no; + +############################################### +# 6 Special Purpose Services +############################################### + +# 6.1 Remove X Windows (Scored) +[CIS - SLES11 - 6.1 - X11 not disabled {CIS: 6.1 SLES11} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/inittab -> !r:^# && r:id:5; + +# 6.2 Disable Avahi Server (Scored) +[CIS - SLES11 - 6.2 - Avahi daemon not disabled {CIS: 6.2 SLES11} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +p:avahi-daemon; + +# 6.3 Disable Print Server - CUPS (Not Scored) +#TODO + +# 6.4 Remove DHCP Server (Scored) +#[CIS - SLES11 - 6.4 - DHCPnot disabled {CIS: 6.4 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dhcpd$; +d:$rc_dirs -> ^S\d\dhcpd6$; + +# 6.5 Configure Network Time Protocol (NTP) (Scored) +#TODO Chrony +[CIS - SLES11 - 6.5 - NTPD not Configured {CIS: 6.5 SLES11} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/ntp.conf -> r:restrict default kod nomodify notrap nopeer noquery && r:^server; +f:/etc/sysconfig/ntpd -> r:OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid"; + +# 6.6 Remove LDAP (Not Scored) +#TODO + +# 6.7 Disable NFS and RPC (Not Scored) +[CIS - SLES11 - 6.7 - Disable standard boot services - NFS Enabled {CIS: 6.7 SLES11} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dnfs$; +d:$rc_dirs -> ^S\d\dnfslock$; + +# 6.8 Remove DNS Server (Not Scored) +# TODO + +# 6.9 Remove FTP Server (Not Scored) +[CIS - SLES11 - 6.9 - VSFTP enabled on xinetd {CIS: 6.9 SLES11} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/vsftpd -> !r:^# && r:disable && r:no; + +# 6.10 Remove HTTP Server (Not Scored) +[CIS - SLES11 - 6.10 - Disable standard boot services - Apache web server Enabled {CIS: 6.10 SLES11}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dapache2$; + +# 6.11 Remove Dovecot (IMAP and POP3 services) (Not Scored) +[CIS - SLES11 - 6.11 - imap enabled on xinetd {CIS: 6.11 SLES11} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/cyrus-imapd -> !r:^# && r:disable && r:no; + +[CIS - SLES11 - 6.11 - pop3 enabled on xinetd {CIS: 6.11 SLES11} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/xinetd.d/dovecot -> !r:^# && r:disable && r:no; + +# 6.12 Remove Samba (Not Scored) +[CIS - SLES11 - 6.12 - Disable standard boot services - Samba Enabled {CIS: 6.12 SLES11} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dsamba$; +d:$rc_dirs -> ^S\d\dsmb$; + +# 6.13 Remove HTTP Proxy Server (Not Scored) +[CIS - SLES11 - 6.13 - Disable standard boot services - Squid Enabled {CIS: 6.13 SLES11} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dsquid$; + +# 6.14 Remove SNMP Server (Not Scored) +[CIS - SLES11 - 6.14 - Disable standard boot services - SNMPD process Enabled {CIS: 6.14 SLES11} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dsnmpd$; + +# 6.15 Configure Mail Transfer Agent for Local-Only Mode (Scored) +# TODO + +# 6.16 Ensure rsync service is not enabled (Scored) +[CIS - SLES11 - 6.16 - Disable standard boot services - rsyncd process Enabled {CIS: 6.16 SLES11} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\drsyncd$; + +# 6.17 Ensure Biosdevname is not enabled (Scored) +# TODO + +############################################### +# 7 Network Configuration and Firewalls +############################################### + +############################################### +# 7.1 Modify Network Parameters (Host Only) +############################################### + +# 7.1.1 Disable IP Forwarding (Scored) +[CIS - SLES11 - 7.1.1 - Network parameters - IP Forwarding enabled {CIS: 7.1.1 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/ip_forward -> 1; +f:/proc/sys/net/ipv6/ip_forward -> 1; + +# 7.1.2 Disable Send Packet Redirects (Scored) +[CIS - SLES11 - 7.1.2 - Network parameters - IP send redirects enabled {CIS: 7.1.2 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/send_redirects -> 0; +f:/proc/sys/net/ipv4/conf/default/send_redirects -> 0; + +############################################### +# 7.2 Modify Network Parameters (Host and Router) +############################################### + +# 7.2.1 Disable Source Routed Packet Acceptance (Scored) +[CIS - SLES11 - 7.2.1 - Network parameters - Source routing accepted {CIS: 7.2.1 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/accept_source_route -> 1; + +# 7.2.2 Disable ICMP Redirect Acceptance (Scored) +[CIS - SLES11 - 7.2.2 - Network parameters - ICMP redirects accepted {CIS: 7.2.2 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/accept_redirects -> 1; +f:/proc/sys/net/ipv4/conf/default/accept_redirects -> 1; + +# 7.2.3 Disable Secure ICMP Redirect Acceptance (Scored) +[CIS - SLES11 - 7.2.3 - Network parameters - ICMP secure redirects accepted {CIS: 7.2.3 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/secure_redirects -> 1; +f:/proc/sys/net/ipv4/conf/default/secure_redirects -> 1; + +# 7.2.4 Log Suspicious Packets (Scored) +[CIS - SLES11 - 7.2.4 - Network parameters - martians not logged {CIS: 7.2.4 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/log_martians -> 0; + +# 7.2.5 Enable Ignore Broadcast Requests (Scored) +[CIS - SLES11 - 7.2.5 - Network parameters - ICMP broadcasts accepted {CIS: 7.2.5 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts -> 0; + +# 7.2.6 Enable Bad Error Message Protection (Scored) +[CIS - SLES11 - 7.2.6 - Network parameters - Bad error message protection not enabled {CIS: 7.2.6 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/icmp_ignore_bogus_error_responses -> 0; + +# 7.2.7 Enable RFC-recommended Source Route Validation (Scored) +[CIS - SLES11 - 7.2.7 - Network parameters - RFC Source route validation not enabled {CIS: 7.2.7 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/conf/all/rp_filter -> 0; +f:/proc/sys/net/ipv4/conf/default/rp_filter -> 0; + +# 7.2.8 Enable TCP SYN Cookies (Scored) +[CIS - SLES11 - 7.2.8 - Network parameters - SYN Cookies not enabled {CIS: 7.2.8 SLES11} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/proc/sys/net/ipv4/tcp_syncookies -> 0; + +############################################### +# 7.3 Configure IPv6 +############################################### + +# 7.3.1 Disable IPv6 Router Advertisements (Not Scored) + +# 7.3.2 Disable IPv6 Redirect Acceptance (Not Scored) + +# 7.3.3 Disable IPv6 (Not Scored) + +############################################### +# 7.4 Install TCP Wrappers +############################################### + +# 7.4.1 Install TCP Wrappers (Not Scored) + +# 7.4.2 Create /etc/hosts.allow (Not Scored) + +# 7.4.3 Verify Permissions on /etc/hosts.allow (Scored) +# TODO + +# 7.4.4 Create /etc/hosts.deny (Not Scored) + +# 7.5.5 Verify Permissions on /etc/hosts.deny (Scored) +# TODO + +############################################### +# 7.5 Uncommon Network Protocols +############################################### + +# 7.5.1 Disable DCCP (Not Scored) + +# 7.5.2 Disable SCTP (Not Scored) + +# 7.5.3 Disable RDS (Not Scored) + +# 7.5.4 Disable TIPC (Not Scored) + +# 7.6 Deactivate Wireless Interfaces (Not Scored) + +# 7.7 Enable SuSEfirewall2 (Scored) + +# 7.8 Limit access to trusted networks (Not Scored) + +############################################### +# 8 Logging and Auditing +############################################### + +############################################### +# 8.1 Configure System Accounting (auditd) +############################################### + +############################################### +# 8.1.1 Configure Data Retention +############################################### + +# 8.1.1.1 Configure Audit Log Storage Size (Not Scored) + +# 8.1.1.2 Disable System on Audit Log Full (Not Scored) + +# 8.1.1.3 Keep All Auditing Information (Scored) + +# 8.1.2 Enable auditd Service (Scored) + +# 8.1.3 Enable Auditing for Processes That Start Prior to auditd (Scored) + +# 8.1.4 Record Events That Modify Date and Time Information (Scored) + +# 8.1.5 Record Events That Modify User/Group Information (Scored) + +# 8.1.6 Record Events That Modify the System’s Network Environment (Scored) + +# 8.1.7 Record Events That Modify the System’s Mandatory Access Controls (Scored) + +# 8.1.8 Collect Login and Logout Events (Scored) + +# 8.1.9 Collect Session Initiation Information (Scored) + +# 8.1.10 Collect Discretionary Access Control Permission Modification Events (Scored) + +# 8.1.11 Collect Unsuccessful Unauthorized Access Attempts to Files (Scored) + +# 8.1.12 Collect Use of Privileged Commands (Scored) + +# 8.1.13 Collect Successful File System Mounts (Scored) + +# 8.1.14 Collect File Deletion Events by User (Scored) + +# 8.1.15 Collect Changes to System Administration Scope (sudoers) (Scored) + +# 8.1.16 Collect System Administrator Actions (sudolog) (Scored) + +# 8.1.17 Collect Kernel Module Loading and Unloading (Scored) + +# 8.1.18 Make the Audit Configuration Immutable (Scored) + +############################################### +# 8.2 Configure rsyslog +############################################### + +# 8.2.1 Install the rsyslog package (Scored) +# TODO + +# 8.2.2 Activate the rsyslog Service (Scored) +# TODO + +# 8.2.3 Configure /etc/rsyslog.conf (Not Scored) + +# 8.2.4 Create and Set Permissions on rsyslog Log Files (Scored) + +# 8.2.5 Configure rsyslog to Send Logs to a Remote Log Host (Scored) + +# 8.2.6 Accept Remote rsyslog Messages Only on Designated Log Hosts (Not Scored) + +############################################### +# 8.3 Advanced Intrusion Detection Environment (AIDE) +############################################### + +# 8.3.1 Install AIDE (Scored) + +# 8.3.2 Implement Periodic Execution of File Integrity (Scored) + +# 8.4 Configure logrotate (Not Scored) + +############################################### +# 9 System Access, Authentication and Authorization +############################################### + +############################################### +# 9.1 Configure cron and anacron +############################################### + +# 9.1.1 Enable cron Daemon (Scored) + +# 9.1.2 Set User/Group Owner and Permission on /etc/crontab (Scored) + +# 9.1.3 Set User/Group Owner and Permission on /etc/cron.hourly (Scored) + +# 9.1.4 Set User/Group Owner and Permission on /etc/cron.daily (Scored) + +# 9.1.5 Set User/Group Owner and Permission on /etc/cron.weekly (Scored) + +# 9.1.6 Set User/Group Owner and Permission on /etc/cron.monthly (Scored) + +# 9.1.7 Set User/Group Owner and Permission on /etc/cron.d (Scored) + +# 9.1.8 Restrict at/cron to Authorized Users (Scored) + +############################################### +# 9.2 Configure SSH +############################################### + +# 9.2.1 Set SSH Protocol to 2 (Scored) +[CIS - SLES11 - 9.2.1 - SSH Configuration - Protocol version 1 enabled {CIS: 9.2.1 SLES11} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\.+1; + +# 9.2.2 Set LogLevel to INFO (Scored) +[CIS - SLES11 - 9.2.1 - SSH Configuration - Loglevel not INFO {CIS: 9.2.1 SLES11} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && !r:LogLevel\.+INFO; + +# 9.2.3 Set Permissions on /etc/ssh/sshd_config (Scored) +# TODO + +# 9.2.4 Disable SSH X11 Forwarding (Scored) +# TODO + +# 9.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) +[ CIS - SLES11 - 9.2.5 - SSH Configuration - Set SSH MaxAuthTries to 4 or Less {CIS - SLES11 - 9.2.5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:$sshd_file -> !r:^\s*MaxAuthTries\s+4\s*$; + +# 9.2.6 Set SSH IgnoreRhosts to Yes (Scored) +[CIS - SLES11 - 9.2.6 - SSH Configuration - IgnoreRHosts disabled {CIS: 9.2.6 SLES11} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\.+no; + +# 9.2.7 Set SSH HostbasedAuthentication to No (Scored) +[CIS - SLES11 - 9.2.7 - SSH Configuration - Host based authentication enabled {CIS: 9.2.7 SLES11} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\.+yes; + +# 9.2.8 Disable SSH Root Login (Scored) +[CIS - SLES11 - 9.2.8 - SSH Configuration - Root login allowed {CIS: 9.2.8 SLES11} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:$sshd_file -> !r:^\s*PermitRootLogin\.+no; + +# 9.2.9 Set SSH PermitEmptyPasswords to No (Scored) +[CIS - SLES11 - 9.2.9 - SSH Configuration - Empty passwords permitted {CIS: 9.2.9 SLES11} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:$sshd_file -> !r:^\s*PermitEmptyPasswords\.+no; + +# 9.2.10 Do Not Allow Users to Set Environment Options (Scored) + +# 9.2.11 Use Only Approved Ciphers in Counter Mode (Scored) + +# 9.2.12 Set Idle Timeout Interval for User Login (Not Scored) + +# 9.2.13 Limit Access via SSH (Scored) + +# 9.2.14 Set SSH Banner (Scored) + +############################################### +# 9.3 Configure PAM +############################################### + +# 9.3.1 Set Password Creation Requirement Parameters Using pam_cracklib (Scored) + +# 9.3.2 Set Lockout for Failed Password Attempts (Not Scored) + +# 9.3.3 Limit Password Reuse (Scored) + +# 9.4 Restrict root Login to System Console (Not Scored) + +# 9.5 Restrict Access to the su Command (Scored) + +############################################### +# 10 User Accounts and Environment +############################################### + +############################################### +# 10.1 Set Shadow Password Suite Parameters (/etc/login.defs) +############################################### + +# 10.1.1 Set Password Expiration Days (Scored) + +# 10.1.2 Set Password Change Minimum Number of Days (Scored) + +# 10.1.3 Set Password Expiring Warning Days (Scored) + +# 10.2 Disable System Accounts (Scored) + +# 10.3 Set Default Group for root Account (Scored) + +# 10.4 Set Default umask for Users (Scored) + +# 10.5 Lock Inactive User Accounts (Scored) + + +############################################### +# 11 Warning Banners +############################################### + +# 11.1 Set Warning Banner for Standard Login Services (Scored) + +# 11.2 Remove OS Information from Login Warning Banners (Scored) + +# 11.3 Set Graphical Warning Banner (Not Scored) + +############################################### +# 12 Verify System File Permissions +############################################### + +# 12.1 Verify System File Permissions (Not Scored) + +# 12.2 Verify Permissions on /etc/passwd (Scored) + +# 12.3 Verify Permissions on /etc/shadow (Scored) + +# 12.4 Verify Permissions on /etc/group (Scored) + +# 12.5 Verify User/Group Ownership on /etc/passwd (Scored) + +# 12.6 Verify User/Group Ownership on /etc/shadow (Scored) + +# 12.7 Verify User/Group Ownership on /etc/group (Scored) + +# 12.8 Find World Writable Files (Not Scored) + +# 12.9 Find Un-owned Files and Directories (Scored) + +# 12.10 Find Un-grouped Files and Directories (Scored) + +# 12.11 Find SUID System Executables (Not Scored) + +# 12.12 Find SGID System Executables (Not Scored) + +############################################### +# 13 Review User and Group Settings +############################################### + +# 13.1 Ensure Password Fields are Not Empty (Scored) + +# 13.2 Verify No Legacy "+" Entries Exist in /etc/passwd File (Scored) + +# 13.3 Verify No Legacy "+" Entries Exist in /etc/shadow File (Scored) + +# 13.4 Verify No Legacy "+" Entries Exist in /etc/group File (Scored) + +# 13.5 Verify No UID 0 Accounts Exist Other Than root (Scored) +[CIS - SLES11 - 13.5 - Non-root account with uid 0 {CIS: 13.5 SLES11} {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:; + +# 13.6 Ensure root PATH Integrity (Scored) + +# 13.7 Check Permissions on User Home Directories (Scored) + +# 13.8 Check User Dot File Permissions (Scored) + +# 13.9 Check Permissions on User .netrc Files (Scored) + +# 13.10 Check for Presence of User .rhosts Files (Scored) + +# 13.11 Check Groups in /etc/passwd (Scored) + +# 13.12 Check That Users Are Assigned Valid Home Directories (Scored) + +# 13.13 Check User Home Directory Ownership (Scored) + +# 13.14 Check for Duplicate UIDs (Scored) + +# 13.15 Check for Duplicate GIDs (Scored) + +# 13.16 Check for Duplicate User Names (Scored) + +# 13.17 Check for Duplicate Group Names (Scored) + +# 13.18 Check for Presence of User .netrc Files (Scored) + +# 13.19 Check for Presence of User .forward Files (Scored) + +# 13.20 Ensure shadow group is empty (Scored) + + +# Other/Legacy Tests +[CIS - SLES11 - X.X.X - Account with empty password present {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/shadow -> r:^\w+::; + +[CIS - SLES11 - X.X.X - User-mounted removable partition allowed on the console] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +f:/etc/security/console.perms -> r:^ \d+ ; +f:/etc/security/console.perms -> r:^ \d+ ; + +[CIS - SLES11 - X.X.X - Disable standard boot services - Kudzu hardware detection Enabled] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dkudzu$; + +[CIS - SLES11 - X.X.X - Disable standard boot services - PostgreSQL server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dpostgresql$; + +[CIS - SLES11 - X.X.X - Disable standard boot services - MySQL server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dmysqld$; + +[CIS - SLES11 - X.X.X - Disable standard boot services - DNS server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dnamed$; + +[CIS - SLES11 - X.X.X - Disable standard boot services - NetFS Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_11_Benchmark_v1.1.0.pdf] +d:$rc_dirs -> ^S\d\dnetfs$; diff --git a/etc/ruleset/rootcheck/cis_sles12_linux_rcl.txt b/etc/ruleset/rootcheck/cis_sles12_linux_rcl.txt new file mode 100644 index 0000000000..2d050201e2 --- /dev/null +++ b/etc/ruleset/rootcheck/cis_sles12_linux_rcl.txt @@ -0,0 +1,741 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2014 +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://www.gnu.org/licenses/gpl.html +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - p (process running) +# - d (any file inside the directory) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + + +# CIS Checks for SUSE SLES 12 +# Based on CIS Benchmark for SUSE Linux Enterprise Server 12 v1.0.0 + +# RC scripts location +$rc_dirs=/etc/rc.d/rc2.d,/etc/rc.d/rc3.d,/etc/rc.d/rc4.d,/etc/rc.d/rc5.d; + + +[CIS - Testing against the CIS SUSE Linux Enterprise Server 12 Benchmark v1.0.0] [any required] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/os-release -> r:^PRETTY_NAME="SUSE Linux Enterprise Server 12"; +f:/etc/os-release -> r:^PRETTY_NAME="SUSE Linux Enterprise Server 12 SP1"; +f:/etc/os-release -> r:^PRETTY_NAME="SUSE Linux Enterprise Server 12 SP2"; +f:/etc/os-release -> r:^PRETTY_NAME="SUSE Linux Enterprise Server 12 SP3"; +f:/etc/os-release -> r:^PRETTY_NAME="SUSE Linux Enterprise Server 12 SP4"; + +# 2.1 /tmp: partition +[CIS - SLES12 - 2.1 - Build considerations - Robust partition scheme - /tmp is not on its own partition {CIS: 2.2 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> !r:/tmp; + +# 2.2 /tmp: nodev +[CIS - SLES12 - 2.2 - Partition /tmp without 'nodev' set {CIS: 2.2 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nodev; + +# 2.3 /tmp: nosuid +[CIS - SLES12 - 2.3 - Partition /tmp without 'nosuid' set {CIS: 2.3 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nosuid; + +# 2.4 /tmp: noexec +[CIS - SLES12 - 2.4 - Partition /tmp without 'noexec' set {CIS: 2.4 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> !r:^# && r:/tmp && !r:nodev; + +# 2.5 Build considerations - Partition scheme. +[CIS - SLES12 - Build considerations - Robust partition scheme - /var is not on its own partition {CIS: 2.5 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> !r^# && !r:/var; + +# 2.6 bind mount /var/tmp to /tmp +[CIS - SLES12 - Build considerations - Robust partition scheme - /var/tmp is bound to /tmp {CIS: 2.6 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> r:^# && !r:/var/tmp && !r:bind; + +# 2.7 /var/log: partition +[CIS - SLES12 - Build considerations - Robust partition scheme - /var/log is not on its own partition {CIS: 2.7 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> ^# && !r:/var/log; + +# 2.8 /var/log/audit: partition +[CIS - SLES12 - Build considerations - Robust partition scheme - /var/log/audit is not on its own partition {CIS: 2.8 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> ^# && !r:/var/log/audit; + +# 2.9 /home: partition +[CIS - SLES12 - Build considerations - Robust partition scheme - /home is not on its own partition {CIS: 2.9 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> ^# && !r:/home; + +# 2.10 /home: nodev +[CIS - SLES12 - 2.10 - Partition /home without 'nodev' set {CIS: 2.10 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> !r:^# && r:/home && !r:nodev; + +# 2.11 nodev on removable media partitions (not scored) +[CIS - SLES12 - 2.11 - Removable partition /media without 'nodev' set {CIS: 2.11 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nodev; + +# 2.12 noexec on removable media partitions (not scored) +[CIS - SLES12 - 2.12 - Removable partition /media without 'noexec' set {CIS: 2.12 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:noexec; + +# 2.13 nosuid on removable media partitions (not scored) +[CIS - SLES12 - 2.13 - Removable partition /media without 'nosuid' set {CIS: 2.13 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> !r:^# && r:/media && !r:nosuid; + +# 2.14 /dev/shm: nodev +[CIS - SLES12 - 2.14 - /dev/shm without 'nodev' set {CIS: 2.14 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:nodev; + +# 2.15 /dev/shm: nosuid +[CIS - SLES12 - 2.15 - /dev/shm without 'nosuid' set {CIS: 2.15 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:nosuid; + +# 2.16 /dev/shm: noexec +[CIS - SLES12 - 2.16 - /dev/shm without 'noexec' set {CIS: 2.16 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/fstab -> !r:^# && r:/dev/shm && !r:noexec; + +# 2.17 sticky bit on world writable directories (Scored) +# TODO + +# 2.18 disable cramfs (not scored) + +# 2.19 disable freevxfs (not scored) + +# 2.20 disable jffs2 (not scored) + +# 2.21 disable hfs (not scored) + +# 2.22 disable hfsplus (not scored) + +# 2.23 disable squashfs (not scored) + +# 2.24 disable udf (not scored) + +# 2.25 disable automounting (Scored) +# TODO + +############################################### +# 3 Secure Boot Settings +############################################### + +# 3.1 Set User/Group Owner on /etc/grub.conf +# TODO (no mode tests) +# stat -L -c "%u %g" /boot/grub2/grub.cfg | egrep "0 0" + +# 3.2 Set Permissions on /etc/grub.conf (Scored) +# TODO (no mode tests) +# stat -L -c "%a" /boot/grub2/grub.cfg | egrep ".00" + +# 3.3 Set Boot Loader Password (Scored) +[CIS - SLES12 - 3.3 - GRUB Password not set {CIS: 3.3 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/boot/grub2/grub.cfg -> !r:^# && !r:password; + +############################################### +# 4 Additional Process Hardening +############################################### + +# 4.1 Restrict Core Dumps (Scored) +[CIS - SLES12 - 4.1 - Interactive Boot not disabled {CIS: 4.1 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/security/limits.conf -> !r:^# && !r:hard\.+core\.+0; + +# 4.2 Enable XD/NX Support on 32-bit x86 Systems (Not Scored) +# TODO + +# 4.3 Enable Randomized Virtual Memory Region Placement (Scored) +[CIS - SLES12 - 4.3 - Randomized Virtual Memory Region Placement not enabled {CIS: 4.3 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/proc/sys/kernel/randomize_va_space -> 2; + +# 4.4 Disable Prelink (Scored) +# TODO + +# 4.5 Activate AppArmor (Scored) +# TODO + +############################################### +# 5 OS Services +############################################### + +############################################### +# 5.1 Remove Legacy Services +############################################### + +# 5.1.1 Remove NIS Server (Scored) +[CIS - SLES12 - 5.1.1 - Disable standard boot services - NIS (server) Enabled {CIS: 5.1.1 SLES12} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +d:$rc_dirs -> ^S\d\dypserv$; +f:/usr/lib/systemd/system/ypserv.service -> r:Exec; + +# 5.1.2 Remove NIS Client (Scored) +[CIS - SLES12 - 5.1.2 - Disable standard boot services - NIS (client) Enabled {CIS: 51.2 SLES12} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +d:$rc_dirs -> ^S\d\dypbind$; +f:/usr/lib/systemd/system/ypbind.service -> r:Exec; + +# 5.1.3 Remove rsh-server (Scored) +[CIS - SLES12 - 5.1.3 - rsh/rlogin/rcp enabled on xinetd {CIS: 5.1.3 SLES12} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/rlogin -> !r:^# && r:disable && r:no; +f:/etc/xinetd.d/rsh -> !r:^# && r:disable && r:no; +f:/etc/xinetd.d/shell -> !r:^# && r:disable && r:no; +# TODO (finish this) +f:/usr/lib/systemd/system/rexec@.service -> r:ExecStart; +f:/usr/lib/systemd/system/rlogin@.service -> r:ExecStart; +f:/usr/lib/systemd/system/rsh@.service -> r:ExecStart; + +# 5.1.4 Remove rsh client (Scored) +# TODO + +# 5.1.5 Remove talk-server (Scored) +[CIS - SLES12 - 5.1.5 - talk enabled on xinetd {CIS: 5.1.5 SLES12} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/talk -> !r:^# && r:disable && r:no; +f:/usr/lib/systemd/system/ntalk.service -> r:Exec; + +# 5.1.6 Remove talk client (Scored) +# TODO + +# 5.1.7 Remove telnet-server (Scored) +# TODO: detect it is installed at all +[CIS - SLES12 - 5.1.7 - Telnet enabled on xinetd {CIS: 5.1.7 SLES12} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/telnet -> !r:^# && r:disable && r:no; +f:/usr/lib/systemd/system/telnet@.service -> r:ExecStart=-/usr/sbin/in.telnetd; + +# 5.1.8 Remove tftp-server (Scored) +[CIS - SLES12 - 5.1.8 - tftpd enabled on xinetd {CIS: 5.1.8 SLES12} {PCI_DSS: 2.2.3}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/tftpd -> !r:^# && r:disable && r:no; +f:/usr/lib/systemd/system/tftp.service -> r:Exec; + +# 5.1.9 Remove xinetd (Scored) +[CIS - SLES12 - 5.1.9 - xinetd detected {CIS: 5.1.9 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/usr/lib/systemd/system/xinetd.service -> r:Exec; + +# 5.2 Disable chargen-udp (Scored) +[CIS - SLES12 - 5.2 - chargen-udp enabled on xinetd {CIS: 5.2 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/chargen-udp -> !r:^# && r:disable && r:no; + +# 5.3 Disable chargen (Scored) +[CIS - SLES12 - 5.3 - chargen enabled on xinetd {CIS: 5.3 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/chargen -> !r:^# && r:disable && r:no; + +# 5.4 Disable daytime-udp (Scored) +[CIS - SLES12 - 5.4 - daytime-udp enabled on xinetd {CIS: 5.4 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/daytime-udp -> !r:^# && r:disable && r:no; + +# 5.5 Disable daytime (Scored) +[CIS - SLES12 - 5.5 - daytime enabled on xinetd {CIS: 5.5 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/daytime -> !r:^# && r:disable && r:no; + + +# 5.6 Disable echo-udp (Scored) +[CIS - SLES12 - 5.6 - echo-udp enabled on xinetd {CIS: 5.6 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/echo-udp -> !r:^# && r:disable && r:no; + +# 5.7 Disable echo (Scored) +[CIS - SLES12 - 5.7 - echo enabled on xinetd {CIS: 5.7 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/echo -> !r:^# && r:disable && r:no; + +# 5.8 Disable discard-udp (Scored) +[CIS - SLES12 - 5.8 - discard-udp enabled on xinetd {CIS: 5.8 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/discard-udp -> !r:^# && r:disable && r:no; + +# 5.9 Disable discard (Scored) +[CIS - SLES12 - 5.9 - discard enabled on xinetd {CIS: 5.9 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/discard -> !r:^# && r:disable && r:no; + +# 5.10 Disable time-udp (Scored) +[CIS - SLES12 - 5.10 - time-udp enabled on xinetd {CIS: 5.10 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/time-udp -> !r:^# && r:disable && r:no; + +# 5.11 Disable time (Scored) +[CIS - SLES12 - 5.11 - time enabled on xinetd {CIS: 5.11 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/time -> !r:^# && r:disable && r:no; + +############################################### +# 6 Special Purpose Services +############################################### + +# 6.1 Remove X Windows (Scored) +[CIS - SLES12 - 6.1 - X11 not disabled {CIS: 6.1 SLES12} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/usr/lib/systemd/system/default.target -> r:Graphical; +p:gdm-x-session; + +# 6.2 Disable Avahi Server (Scored) +[CIS - SLES12 - 6.2 - Avahi daemon not disabled {CIS: 6.2 SLES12} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +p:avahi-daemon; + +# 6.3 Disable Print Server - CUPS (Not Scored) +#TODO + +# 6.4 Remove DHCP Server (Scored) +[CIS - SLES12 - 6.4 - DHCPnot disabled {CIS: 6.4 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/usr/lib/systemd/system/dhcpd.service -> r:Exec; + +# 6.5 Configure Network Time Protocol (NTP) (Scored) +#TODO Chrony +[CIS - SLES12 - 6.5 - NTPD not Configured {CIS: 6.5 SLES12} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/ntp.conf -> r:restrict default kod nomodify notrap nopeer noquery && r:^server; +f:/etc/sysconfig/ntpd -> r:OPTIONS="-u ntp:ntp -p /var/run/ntpd.pid"; + +# 6.6 Remove LDAP (Not Scored) +#TODO + +# 6.7 Disable NFS and RPC (Not Scored) +[CIS - SLES12 - 6.7 - Disable standard boot services - NFS Enabled {CIS: 6.7 SLES12} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +d:$rc_dirs -> ^S\d\dnfs$; +d:$rc_dirs -> ^S\d\dnfslock$; + +# 6.8 Remove DNS Server (Not Scored) +# TODO + +# 6.9 Remove FTP Server (Not Scored) +[CIS - SLES12 - 6.9 - VSFTP enabled on xinetd {CIS: 6.9 SLES12} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/vsftpd -> !r:^# && r:disable && r:no; + +# 6.10 Remove HTTP Server (Not Scored) +[CIS - SLES12 - 6.10 - Disable standard boot services - Apache web server Enabled {CIS: 6.10 SLES12}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +d:$rc_dirs -> ^S\d\dapache2$; + +# 6.11 Remove Dovecot (IMAP and POP3 services) (Not Scored) +[CIS - SLES12 - 6.11 - imap enabled on xinetd {CIS: 6.11 SLES12} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/cyrus-imapd -> !r:^# && r:disable && r:no; + +[CIS - SLES12 - 6.11 - pop3 enabled on xinetd {CIS: 6.11 SLES12} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/xinetd.d/dovecot -> !r:^# && r:disable && r:no; + +# 6.12 Remove Samba (Not Scored) +[CIS - SLES12 - 6.12 - Disable standard boot services - Samba Enabled {CIS: 6.12 SLES12} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +d:$rc_dirs -> ^S\d\dsamba$; +d:$rc_dirs -> ^S\d\dsmb$; + +# 6.13 Remove HTTP Proxy Server (Not Scored) +[CIS - SLES12 - 6.13 - Disable standard boot services - Squid Enabled {CIS: 6.13 SLES12} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +d:$rc_dirs -> ^S\d\dsquid$; + +# 6.14 Remove SNMP Server (Not Scored) +[CIS - SLES12 - 6.14 - Disable standard boot services - SNMPD process Enabled {CIS: 6.14 SLES12} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +d:$rc_dirs -> ^S\d\dsnmpd$; + +# 6.15 Configure Mail Transfer Agent for Local-Only Mode (Scored) +# TODO + +# 6.16 Ensure rsync service is not enabled (Scored) +[CIS - SLES12 - 6.16 - Disable standard boot services - rsyncd process Enabled {CIS: 6.16 SLES12} {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +d:$rc_dirs -> ^S\d\drsyncd$; + +# 6.17 Ensure Biosdevname is not enabled (Scored) +# TODO + +############################################### +# 7 Network Configuration and Firewalls +############################################### + +############################################### +# 7.1 Modify Network Parameters (Host Only) +############################################### + +# 7.1.1 Disable IP Forwarding (Scored) +[CIS - SLES12 - 7.1.1 - Network parameters - IP Forwarding enabled {CIS: 7.1.1 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/proc/sys/net/ipv4/ip_forward -> 1; +f:/proc/sys/net/ipv6/ip_forward -> 1; + +# 7.1.2 Disable Send Packet Redirects (Scored) +[CIS - SLES12 - 7.1.2 - Network parameters - IP send redirects enabled {CIS: 7.1.2 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/proc/sys/net/ipv4/conf/all/send_redirects -> 0; +f:/proc/sys/net/ipv4/conf/default/send_redirects -> 0; + +############################################### +# 7.2 Modify Network Parameters (Host and Router) +############################################### + +# 7.2.1 Disable Source Routed Packet Acceptance (Scored) +[CIS - SLES12 - 7.2.1 - Network parameters - Source routing accepted {CIS: 7.2.1 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/proc/sys/net/ipv4/conf/all/accept_source_route -> 1; + +# 7.2.2 Disable ICMP Redirect Acceptance (Scored) +[CIS - SLES12 - 7.2.2 - Network parameters - ICMP redirects accepted {CIS: 7.2.2 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/proc/sys/net/ipv4/conf/all/accept_redirects -> 1; +f:/proc/sys/net/ipv4/conf/default/accept_redirects -> 1; + +# 7.2.3 Disable Secure ICMP Redirect Acceptance (Scored) +[CIS - SLES12 - 7.2.3 - Network parameters - ICMP secure redirects accepted {CIS: 7.2.3 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/proc/sys/net/ipv4/conf/all/secure_redirects -> 1; +f:/proc/sys/net/ipv4/conf/default/secure_redirects -> 1; + +# 7.2.4 Log Suspicious Packets (Scored) +[CIS - SLES12 - 7.2.4 - Network parameters - martians not logged {CIS: 7.2.4 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/proc/sys/net/ipv4/conf/all/log_martians -> 0; + +# 7.2.5 Enable Ignore Broadcast Requests (Scored) +[CIS - SLES12 - 7.2.5 - Network parameters - ICMP broadcasts accepted {CIS: 7.2.5 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/proc/sys/net/ipv4/icmp_echo_ignore_broadcasts -> 0; + +# 7.2.6 Enable Bad Error Message Protection (Scored) +[CIS - SLES12 - 7.2.6 - Network parameters - Bad error message protection not enabled {CIS: 7.2.6 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/proc/sys/net/ipv4/icmp_ignore_bogus_error_responses -> 0; + +# 7.2.7 Enable RFC-recommended Source Route Validation (Scored) +[CIS - SLES12 - 7.2.7 - Network parameters - RFC Source route validation not enabled {CIS: 7.2.7 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/proc/sys/net/ipv4/conf/all/rp_filter -> 0; +f:/proc/sys/net/ipv4/conf/default/rp_filter -> 0; + +# 7.2.8 Enable TCP SYN Cookies (Scored) +[CIS - SLES12 - 7.2.8 - Network parameters - SYN Cookies not enabled {CIS: 7.2.8 SLES12} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/proc/sys/net/ipv4/tcp_syncookies -> 0; + +############################################### +# 7.3 Configure IPv6 +############################################### + +# 7.3.1 Disable IPv6 Router Advertisements (Not Scored) + +# 7.3.2 Disable IPv6 Redirect Acceptance (Not Scored) + +# 7.3.3 Disable IPv6 (Not Scored) + +############################################### +# 7.4 Install TCP Wrappers +############################################### + +# 7.4.1 Install TCP Wrappers (Not Scored) + +# 7.4.2 Create /etc/hosts.allow (Not Scored) + +# 7.4.3 Verify Permissions on /etc/hosts.allow (Scored) +# TODO + +# 7.4.4 Create /etc/hosts.deny (Not Scored) + +# 7.5.5 Verify Permissions on /etc/hosts.deny (Scored) +# TODO + +############################################### +# 7.5 Uncommon Network Protocols +############################################### + +# 7.5.1 Disable DCCP (Not Scored) + +# 7.5.2 Disable SCTP (Not Scored) + +# 7.5.3 Disable RDS (Not Scored) + +# 7.5.4 Disable TIPC (Not Scored) + +# 7.6 Deactivate Wireless Interfaces (Not Scored) + +# 7.7 Enable SuSEfirewall2 (Scored) + +# 7.8 Limit access to trusted networks (Not Scored) + +############################################### +# 8 Logging and Auditing +############################################### + +############################################### +# 8.1 Configure System Accounting (auditd) +############################################### + +############################################### +# 8.1.1 Configure Data Retention +############################################### + +# 8.1.1.1 Configure Audit Log Storage Size (Not Scored) + +# 8.1.1.2 Disable System on Audit Log Full (Not Scored) + +# 8.1.1.3 Keep All Auditing Information (Scored) + +# 8.1.2 Enable auditd Service (Scored) + +# 8.1.3 Enable Auditing for Processes That Start Prior to auditd (Scored) + +# 8.1.4 Record Events That Modify Date and Time Information (Scored) + +# 8.1.5 Record Events That Modify User/Group Information (Scored) + +# 8.1.6 Record Events That Modify the System’s Network Environment (Scored) + +# 8.1.7 Record Events That Modify the System’s Mandatory Access Controls (Scored) + +# 8.1.8 Collect Login and Logout Events (Scored) + +# 8.1.9 Collect Session Initiation Information (Scored) + +# 8.1.10 Collect Discretionary Access Control Permission Modification Events (Scored) + +# 8.1.11 Collect Unsuccessful Unauthorized Access Attempts to Files (Scored) + +# 8.1.12 Collect Use of Privileged Commands (Scored) + +# 8.1.13 Collect Successful File System Mounts (Scored) + +# 8.1.14 Collect File Deletion Events by User (Scored) + +# 8.1.15 Collect Changes to System Administration Scope (sudoers) (Scored) + +# 8.1.16 Collect System Administrator Actions (sudolog) (Scored) + +# 8.1.17 Collect Kernel Module Loading and Unloading (Scored) + +# 8.1.18 Make the Audit Configuration Immutable (Scored) + +############################################### +# 8.2 Configure rsyslog +############################################### + +# 8.2.1 Install the rsyslog package (Scored) +# TODO + +# 8.2.2 Activate the rsyslog Service (Scored) +# TODO + +# 8.2.3 Configure /etc/rsyslog.conf (Not Scored) + +# 8.2.4 Create and Set Permissions on rsyslog Log Files (Scored) + +# 8.2.5 Configure rsyslog to Send Logs to a Remote Log Host (Scored) + +# 8.2.6 Accept Remote rsyslog Messages Only on Designated Log Hosts (Not Scored) + +############################################### +# 8.3 Advanced Intrusion Detection Environment (AIDE) +############################################### + +# 8.3.1 Install AIDE (Scored) + +# 8.3.2 Implement Periodic Execution of File Integrity (Scored) + +# 8.4 Configure logrotate (Not Scored) + +############################################### +# 9 System Access, Authentication and Authorization +############################################### + +############################################### +# 9.1 Configure cron and anacron +############################################### + +# 9.1.1 Enable cron Daemon (Scored) + +# 9.1.2 Set User/Group Owner and Permission on /etc/crontab (Scored) + +# 9.1.3 Set User/Group Owner and Permission on /etc/cron.hourly (Scored) + +# 9.1.4 Set User/Group Owner and Permission on /etc/cron.daily (Scored) + +# 9.1.5 Set User/Group Owner and Permission on /etc/cron.weekly (Scored) + +# 9.1.6 Set User/Group Owner and Permission on /etc/cron.monthly (Scored) + +# 9.1.7 Set User/Group Owner and Permission on /etc/cron.d (Scored) + +# 9.1.8 Restrict at/cron to Authorized Users (Scored) + +############################################### +# 9.2 Configure SSH +############################################### + +# 9.2.1 Set SSH Protocol to 2 (Scored) +[CIS - SLES12 - 9.2.1 - SSH Configuration - Protocol version 1 enabled {CIS: 9.2.1 SLES12} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\.+1; + +# 9.2.2 Set LogLevel to INFO (Scored) +[CIS - SLES12 - 9.2.1 - SSH Configuration - Loglevel not INFO {CIS: 9.2.1 SLES12} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && !r:LogLevel\.+INFO; + +# 9.2.3 Set Permissions on /etc/ssh/sshd_config (Scored) +# TODO + +# 9.2.4 Disable SSH X11 Forwarding (Scored) +# TODO + +# 9.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) +[ CIS - SLES12 - 9.2.5 - SSH Configuration - Set SSH MaxAuthTries to 4 or Less {CIS - SLES12 - 9.2.5} {PCI_DSS: 2.2.4}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:MaxAuthTries && !r:3\s*$; +f:/etc/ssh/sshd_config -> r:^#\s*MaxAuthTries; +f:/etc/ssh/sshd_config -> !r:MaxAuthTries; + +# 9.2.6 Set SSH IgnoreRhosts to Yes (Scored) +[CIS - SLES12 - 9.2.6 - SSH Configuration - IgnoreRHosts disabled {CIS: 9.2.6 SLES12} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\.+no; + +# 9.2.7 Set SSH HostbasedAuthentication to No (Scored) +[CIS - SLES12 - 9.2.7 - SSH Configuration - Host based authentication enabled {CIS: 9.2.7 SLES12} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\.+yes; + +# 9.2.8 Disable SSH Root Login (Scored) +[CIS - SLES12 - 9.2.8 - SSH Configuration - Root login allowed {CIS: 9.2.8 SLES12} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\.+yes; +f:/etc/ssh/sshd_config -> r:^#\s*PermitRootLogin; + +# 9.2.9 Set SSH PermitEmptyPasswords to No (Scored) +[CIS - SLES12 - 9.2.9 - SSH Configuration - Empty passwords permitted {CIS: 9.2.9 SLES12} {PCI_DSS: 4.1}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/ssh/sshd_config -> !r:^# && r:^PermitEmptyPasswords\.+yes; +f:/etc/ssh/sshd_config -> r:^#\s*PermitEmptyPasswords; + +# 9.2.10 Do Not Allow Users to Set Environment Options (Scored) + +# 9.2.11 Use Only Approved Ciphers in Counter Mode (Scored) + +# 9.2.12 Set Idle Timeout Interval for User Login (Not Scored) + +# 9.2.13 Limit Access via SSH (Scored) + +# 9.2.14 Set SSH Banner (Scored) + +############################################### +# 9.3 Configure PAM +############################################### + +# 9.3.1 Set Password Creation Requirement Parameters Using pam_cracklib (Scored) + +# 9.3.2 Set Lockout for Failed Password Attempts (Not Scored) + +# 9.3.3 Limit Password Reuse (Scored) + +# 9.4 Restrict root Login to System Console (Not Scored) + +# 9.5 Restrict Access to the su Command (Scored) + +############################################### +# 10 User Accounts and Environment +############################################### + +############################################### +# 10.1 Set Shadow Password Suite Parameters (/etc/login.defs) +############################################### + +# 10.1.1 Set Password Expiration Days (Scored) + +# 10.1.2 Set Password Change Minimum Number of Days (Scored) + +# 10.1.3 Set Password Expiring Warning Days (Scored) + +# 10.2 Disable System Accounts (Scored) + +# 10.3 Set Default Group for root Account (Scored) + +# 10.4 Set Default umask for Users (Scored) + +# 10.5 Lock Inactive User Accounts (Scored) + + +############################################### +# 11 Warning Banners +############################################### + +# 11.1 Set Warning Banner for Standard Login Services (Scored) + +# 11.2 Remove OS Information from Login Warning Banners (Scored) + +# 11.3 Set Graphical Warning Banner (Not Scored) + +############################################### +# 12 Verify System File Permissions +############################################### + +# 12.1 Verify System File Permissions (Not Scored) + +# 12.2 Verify Permissions on /etc/passwd (Scored) + +# 12.3 Verify Permissions on /etc/shadow (Scored) + +# 12.4 Verify Permissions on /etc/group (Scored) + +# 12.5 Verify User/Group Ownership on /etc/passwd (Scored) + +# 12.6 Verify User/Group Ownership on /etc/shadow (Scored) + +# 12.7 Verify User/Group Ownership on /etc/group (Scored) + +# 12.8 Find World Writable Files (Not Scored) + +# 12.9 Find Un-owned Files and Directories (Scored) + +# 12.10 Find Un-grouped Files and Directories (Scored) + +# 12.11 Find SUID System Executables (Not Scored) + +# 12.12 Find SGID System Executables (Not Scored) + +############################################### +# 13 Review User and Group Settings +############################################### + +# 13.1 Ensure Password Fields are Not Empty (Scored) + +# 13.2 Verify No Legacy "+" Entries Exist in /etc/passwd File (Scored) + +# 13.3 Verify No Legacy "+" Entries Exist in /etc/shadow File (Scored) + +# 13.4 Verify No Legacy "+" Entries Exist in /etc/group File (Scored) + +# 13.5 Verify No UID 0 Accounts Exist Other Than root (Scored) +[CIS - SLES12 - 13.5 - Non-root account with uid 0 {CIS: 13.5 SLES12} {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:; + +# 13.6 Ensure root PATH Integrity (Scored) + +# 13.7 Check Permissions on User Home Directories (Scored) + +# 13.8 Check User Dot File Permissions (Scored) + +# 13.9 Check Permissions on User .netrc Files (Scored) + +# 13.10 Check for Presence of User .rhosts Files (Scored) + +# 13.11 Check Groups in /etc/passwd (Scored) + +# 13.12 Check That Users Are Assigned Valid Home Directories (Scored) + +# 13.13 Check User Home Directory Ownership (Scored) + +# 13.14 Check for Duplicate UIDs (Scored) + +# 13.15 Check for Duplicate GIDs (Scored) + +# 13.16 Check for Duplicate User Names (Scored) + +# 13.17 Check for Duplicate Group Names (Scored) + +# 13.18 Check for Presence of User .netrc Files (Scored) + +# 13.19 Check for Presence of User .forward Files (Scored) + +# 13.20 Ensure shadow group is empty (Scored) + + +# Other/Legacy Tests +[CIS - SLES12 - X.X.X - Account with empty password present {PCI_DSS: 10.2.5}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/shadow -> r:^\w+::; + +[CIS - SLES12 - X.X.X - User-mounted removable partition allowed on the console] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +f:/etc/security/console.perms -> r:^ \d+ ; +f:/etc/security/console.perms -> r:^ \d+ ; + +[CIS - SLES12 - X.X.X - Disable standard boot services - Kudzu hardware detection Enabled] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +d:$rc_dirs -> ^S\d\dkudzu$; + +[CIS - SLES12 - X.X.X - Disable standard boot services - PostgreSQL server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +d:$rc_dirs -> ^S\d\dpostgresql$; + +[CIS - SLES12 - X.X.X - Disable standard boot services - MySQL server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +d:$rc_dirs -> ^S\d\dmysqld$; + +[CIS - SLES12 - X.X.X - Disable standard boot services - DNS server Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +d:$rc_dirs -> ^S\d\dnamed$; + +[CIS - SLES12 - X.X.X - Disable standard boot services - NetFS Enabled {PCI_DSS: 2.2.2}] [any] [https://benchmarks.cisecurity.org/tools2/linux/CIS_SUSE_Linux_Enterprise_Server_12_Benchmark_v1.0.0.pdf] +d:$rc_dirs -> ^S\d\dnetfs$; diff --git a/etc/ruleset/rootcheck/cis_win2012r2_domainL1_rcl.txt b/etc/ruleset/rootcheck/cis_win2012r2_domainL1_rcl.txt new file mode 100644 index 0000000000..777e4218c8 --- /dev/null +++ b/etc/ruleset/rootcheck/cis_win2012r2_domainL1_rcl.txt @@ -0,0 +1,1069 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2018 OSSEC Project +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://github.com/ossec/ossec-hids/blob/master/LICENSE +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - r (registry entry) +# - p (process running) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceeded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + +# CIS Checks for Windows Server 2012 R2 Domain Controller L1 +# Based on Center for Internet Security Benchmark v2.2.1 for Microsoft Windows Server 2012 R2 (https://workbench.cisecurity.org/benchmarks/288) +# +# +# +#1.1.2 Ensure 'Maximum password age' is set to '60 or fewer days, but not 0' +[CIS - Microsoft Windows Server 2012 R2 - Ensure 'Maximum password age' is set to '60 or fewer days, but not 0'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 0; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 3D; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 3E; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 3F; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:4\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:5\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:6\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:7\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:8\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:9\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:A\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:B\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:C\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:D\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:E\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:F\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:\w\w\w+; +# +# +#2.3.1.2 Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.1.2: Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> 1; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !NoConnectedUser; +# +# +#2.3.1.4 Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.1.4: Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse -> 0; +# +# +#2.3.2.1 Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.2.1: Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy -> !1; +# +# +#2.3.2.2 Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.2.2: Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 2; +# +# +#2.3.4.1 Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.4.1: Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> AllocateDASD -> 1; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> AllocateDASD -> 2; +# +# +#2.3.4.2 Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.4.2: Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> !1; +# +# +#2.3.5.1 Ensure 'Domain controller: Allow server operators to schedule tasks' is set to 'Disabled' (DC only) +[CIS - Microsoft Windows Server 2012 R2 - 2.3.5.1: Ensure 'Domain controller: Allow server operators to schedule tasks' is set to 'Disabled' (DC only)] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\SubmitControl -> !0; + +# +# +#2.3.5.2 Ensure 'Domain controller: LDAP server signing requirements' is set to 'Require signing' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.5.2: Ensure 'Domain controller: LDAP server signing requirements' is set to 'Require signing'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters -> LDAPServerIntegrity -> !2; +# +# +#2.3.5.3 Ensure 'Domain controller: Refuse machine account password changes' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.5.3: Ensure 'Domain controller: Refuse machine account password changes' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RefusePasswordChange -> 1; +# +# +#2.3.6.1 Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.6.1: Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal -> 0; +# +# +#2.3.6.2 Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.6.2: Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel -> 0; +# +# +#2.3.6.3 Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.6.3: Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel -> 0; +# +# +#2.3.6.4 Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.6.4: Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange -> 1; +# +# +#2.3.6.6 Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.6.6: Ensure 'Domain member: Require strong session key' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey -> 0; +# +# +#2.3.7.1 Ensure 'Interactive logon: Do not display last user name' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.7.1: Ensure 'Interactive logon: Do not display last user name' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !DontDisplayLastUserName; +# +# +#2.3.7.2 Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.7.2: Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD -> 1; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !DisableCAD; +# +# +#2.3.7.3 Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.7.3: Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 385; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 386; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 387; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 388; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 389; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:38\D; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:39\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:3\D\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:4\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:5\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:6\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:7\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:8\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:9\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:\D\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:\w\w\w\w+; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !InactivityTimeoutSecs; +# +# +#2.3.7.7 Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.7.7: Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> 1; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> 2; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> 3; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> 4; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> 0F; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:1\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:2\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:3\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:4\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:5\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:6\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:7\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:8\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:9\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:\D\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:\w\w\w+; +# +# +#2.3.7.9 Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher +[CIS - Microsoft Windows Server 2012 R2 - 2.3.7.9: Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> ScRemoveOption -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> !ScRemoveOption; +# +# +#2.3.8.1 Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.8.1: Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> !1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> !RequireSecuritySignature; +# +# +#2.3.8.2 Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.8.2: Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> !1; +# +# +#2.3.8.3 Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.8.3: Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword -> !0; +# +# +#2.3.9.1 Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.9.1: Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> 0; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:1\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:2\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:3\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:4\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:5\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:6\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:7\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:8\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:9\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:\D\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:\w\w\w+; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> !AutoDisconnect; +# +# +#2.3.9.2 Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.9.2: Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature -> !1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> !RequireSecuritySignature; +# +# +#2.3.9.3 Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.9.3: Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature -> !1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> !EnableSecuritySignature; +# +# +#2.3.9.4 Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.9.4: Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> !1; +# +# +#2.3.10.5 Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.5: Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 2; +# +# +#2.3.10.6 Configure 'Network access: Named Pipes that can be accessed anonymously' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.6: Configure 'Network access: Named Pipes that can be accessed anonymously'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> !r:lsarpc|netlogon|samr; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> !NullSessionPipes; +# +# +#2.3.10.7 Configure 'Network access: Remotely accessible registry paths' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.7: Configure 'Network access: Remotely accessible registry paths'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> !r:System\\CurrentControlSet\\Control\\ProductOptions|System\\CurrentControlSet\\Control\\Server Applications|Software\\Microsoft\\Windows NT\\CurrentVersion; +# +# +#2.3.10.8 Configure 'Network access: Remotely accessible registry paths and sub-paths' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.8: Configure 'Network access: Remotely accessible registry paths and sub-paths'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> !r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Print|Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows|System\\CurrentControlSet\\Control\\Print\\Printers|System\\CurrentControlSet\\Services\\Eventlog|Software\\Microsoft\\OLAP Server|System\\CurrentControlSet\\Control\\ContentIndex|System\\CurrentControlSet\\Control\\Terminal Server|System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig|System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration|Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib|System\\CurrentControlSet\\Services\\SysmonLog|System\\CurrentControlSet\\Services\\CertSvc|System\\CurrentControlSet\\Services\\WINS; +# +# +#2.3.10.9 Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.9: Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess -> !1; +# +# +#2.3.10.10 Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.10: Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> r:\.+; +# +# +#2.3.10.11 Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.11: Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest -> 1; +# +# +#2.3.11.1 Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.1: Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> UseMachineId -> !1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> !UseMachineId; +# +# +#2.3.11.2 Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.2: Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback -> 1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> !allownullsessionfallback; +# +# +#2.3.11.3 Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.3: Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID -> !0; +# +# +#2.3.11.4 Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.4: Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> !2147483644; +# +# +#2.3.11.5 Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.5: Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash -> 0; +# +# +#2.3.11.6 Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.6: Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> !1; +# +# +#2.3.11.7 Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.7: Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 0; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 2; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 3; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 4; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> !LmCompatibilityLevel; +# +# +#2.3.11.8 Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> !1; +# +# +#2.3.11.9 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.9: Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption''] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec -> !537395200; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> !NTLMMinClientSec; +# +# +#2.3.11.10 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.10: Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec -> !537395200; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> !NTLMMinServerSec; +# +# +#2.3.13.1 Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.13.1: Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ShutdownWithoutLogon -> 1; +# +# +#2.3.15.1 Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.15.1: Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive -> !1; +# +# +#2.3.15.2 Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.15.2: Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode -> !1; +# +# +#2.3.17.1 Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.1: Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !FilterAdministratorToken; +# +# +#2.3.17.2 Ensure 'User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.2: Ensure 'User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableUIADesktopToggle -> 1; +# +# +#2.3.17.3 Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.3: Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> 1; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !ConsentPromptBehaviorAdmin; +# +# +#2.3.17.4 Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.4: Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser -> 1; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !ConsentPromptBehaviorUser; +# +# +#2.3.17.5 Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.5: Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 0; +r:HKEY_LOCAL_MACHINE\MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !EnableInstallerDetection; +# +# +#2.3.17.6 Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.6: Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths -> 0; +# +# +#2.3.17.7 Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.7: Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA -> 0; +# +# +#2.3.17.8 Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.8: Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop -> 0; +# +# +#2.3.17.9 Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.9: Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization -> 0; +# +# +#9.1.1 Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.1: Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> EnableFirewall -> 0; +# +# +#9.1.2 Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.2: Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> DefaultInboundAction -> 0; +# +# +#9.1.3 Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.3: Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction -> 1; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> DefaultOutboundAction -> 1; +# +# +#9.1.4 Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.4: Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications -> 0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> !DisableNotifications; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> DisableNotifications -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> !DisableNotifications; +# +# +#9.1.5 Ensure 'Windows Firewall: Domain: Settings: Apply local firewall rules' is set to 'Yes (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.5: Ensure 'Windows Firewall: Domain: Settings: Apply local firewall rules' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> AllowLocalPolicyMerge -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> AllowLocalPolicyMerge -> 0; +# +# +#9.1.6 Ensure 'Windows Firewall: Domain: Settings: Apply local connection security rules' is set to 'Yes (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.6: Ensure 'Windows Firewall: Domain: Settings: Apply local connection security rules' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> AllowLocalIPsecPolicyMerge -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> AllowLocalIPsecPolicyMerge -> 0; +# +# +#9.1.7 Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\*.log' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.7: Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\*.log'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:\psystemroot\p\\system32\logfiles\firewall\\w+\plog; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFilePath -> r:\psystemroot\p\\system32\logfiles\firewall\\w+\plog; +# +# +#9.1.8 Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.8: Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> r:3\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFileSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFileSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFileSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFileSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFileSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFileSize -> r:3\w\w\w; +# +# +#9.1.9 Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.9: Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogDroppedPackets -> 0; +# +# +#9.1.10 Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.10: Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogSuccessfulConnections -> 0; +# +# +#9.2.1 Ensure 'Windows Firewall: Private: Firewall state' is set to 'On' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.1: Ensure 'Windows Firewall: Private: Firewall state' is set to 'On'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile -> EnableFirewall -> 0; +# +# +#9.2.2 Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.2: Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile -> DefaultInboundAction -> 0; +# +# +#9.2.3 Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.3: Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction -> 1; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile -> DefaultOutboundAction -> 1; +# +# +#9.2.4 Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.4: Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile -> DisableNotifications -> 0; +# +# +#9.2.5 Ensure 'Windows Firewall: Private: Settings: Apply local firewall rules' is set to 'Yes (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.5: Ensure 'Windows Firewall: Private: Settings: Apply local firewall rules' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> AllowLocalPolicyMerge -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile -> AllowLocalPolicyMerge -> 0; +# +# +#9.2.6 Ensure 'Windows Firewall: Private: Settings: Apply local connection security rules' is set to 'Yes (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.6: Ensure 'Windows Firewall: Private: Settings: Apply local connection security rules' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> AllowLocalIPsecPolicyMerge -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile -> AllowLocalIPsecPolicyMerge -> 0; +# +# +#9.2.7 Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\*.log' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.7: Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\*.log'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:\psystemroot\p\\system32\logfiles\firewall\\w+\plog; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFilePath -> r:\psystemroot\p\\system32\logfiles\firewall\\w+\plog; +# +# +#9.2.8 Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.8: Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> r:3\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFileSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFileSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFileSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFileSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFileSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFileSize -> r:3\w\w\w; +# +# +#9.2.9 Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.9: Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogDroppedPackets -> 0; +# +# +#9.2.10 Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.10: Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogSuccessfulConnections -> 0; +# +# +#9.3.1 Ensure 'Windows Firewall: Public: Firewall state' is set to 'On' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.1: Ensure 'Windows Firewall: Public: Firewall state' is set to 'On'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile -> EnableFirewall -> 0; +# +# +#9.3.2 Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.2: Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile -> DefaultInboundAction -> 0; +# +# +#9.3.3 Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.3: Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction -> 1; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile -> DefaultOutboundAction -> 1; +# +# +#9.3.4 Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.4: Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile -> DisableNotifications -> 0; +# +# +#9.3.5 Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.5: Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile -> AllowLocalPolicyMerge -> 0; +# +# +#9.3.6 Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.6: Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0; +# +# +#9.3.7 Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\*.log' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.7: Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\*.log'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:\psystemroot\p\\system32\logfiles\firewall\\w+\plog; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFilePath -> r:\psystemroot\p\\system32\logfiles\firewall\\w+\plog; +# +# +#9.3.8 Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.8: Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> r:3\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFileSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFileSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFileSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFileSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFileSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFileSize -> r:3\w\w\w; +# +# +#9.3.9 Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.9: Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogDroppedPackets -> 0; +# +# +#9.3.10 Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.10: Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogSuccessfulConnections -> 0; +# +# +#18.1.1.1 Ensure 'Prevent enabling lock screen camera' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.1.1.1: Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> !NoLockScreenCamera; +# +# +#18.1.1.2 Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.1.1.2: Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> !NoLockScreenSlideshow; +# +# +#18.3.1 Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.1: Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> !0; +# +# +#18.3.2 Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.2: Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting -> !2; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> !DisableIPSourceRouting; +# +# +#18.3.3 Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.3: Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting -> !2; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> !DisableIPSourceRouting; +# +# +#18.3.4 Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.4: Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect -> 1; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> !EnableICMPRedirect; +# +# +#18.3.6 Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.6: Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand -> !1; +# +# +#18.3.8 Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.8: Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode -> 0; +# +# +#18.3.9 Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.9: Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires' is set to 'Enabled: 5 or fewer seconds'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> 6; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> 7; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> 8; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> 9; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> r:\w\w+; +# +# +#18.3.12 Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.12: Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> 5B; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> 5C; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> 5D; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> 5E; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> 5F; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> r:6\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> r:7\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> r:8\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> r:9\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> r:\D\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> r:\w\w\w+; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> !WarningLevel; +# +# +#18.4.11.2 Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.11.2: Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA -> 1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> !NC_AllowNetBridge_NLA; +# +# +#18.4.11.3 Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.11.3: Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> !NC_StdDomainUserSetLocation; +# +# +#18.4.21.1 Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.21.1: Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections -> !1; +# +# +#18.6.2 Ensure 'WDigest Authentication' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.6.2: Ensure 'WDigest Authentication' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential -> !0; +# +# +#18.8.3.1 Ensure 'Include command line in process creation events' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.3.1: Ensure 'Include command line in process creation events' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled -> !0; +# +# +#18.8.12.1 Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.12.1: Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy -> !3; +# +# +#18.8.19.2 Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.19.2: Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> !NoBackgroundPolicy; +# +# +#18.8.19.3 Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.19.3: Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> !NoGPOListChanges; +# +# +#18.8.19.4 Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.19.4: Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy -> !0; +# +# +#18.8.25.1 Ensure 'Do not display network selection UI' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.25.1: Ensure 'Do not display network selection UI' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> !DontDisplayNetworkSelectionUI; +# +# +#18.8.25.2 Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.25.2: Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> !DontEnumerateConnectedUsers; +# +# +#18.8.25.3 Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.25.3: Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers -> !0; +# +# +#18.8.25.4 Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.25.4: Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> !DisableLockScreenAppNotifications; +# +# +#18.8.25.5 Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.25.5: Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon -> !0; +# +# +#18.8.31.1 Ensure 'Configure Offer Remote Assistance' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.31.1: Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited -> !0; +# +# +#18.8.31.2 Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.31.2: Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fAllowToGetHelp; +# +# +#18.9.6.1 Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.6.1: Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> !MSAOptional; +# +# +#18.9.8.1 Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.8.1: Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoAutoplayfornonVolume; +# +# +#18.9.8.2 Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.8.2: Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoAutorun; +# +# +#18.9.8.3 Ensure 'Turn off Autoplay' is set to 'Enabled: All drives' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.8.3: Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer-> NoDriveTypeAutoRun -> !ff; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer-> !NoDriveTypeAutoRun; +# +# +#18.9.15.1 Ensure 'Do not display the password reveal button' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.15.1: Ensure 'Do not display the password reveal button' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> !DisablePasswordReveal; +# +# +#18.9.15.2 Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.15.2: Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators -> !0; +# +# +#18.9.26.1.1 Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.1.1: Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention -> !0; +# +# +#18.9.26.1.2 Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.1.2: Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:0\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:3\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:4\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:5\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:6\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:7\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> !MaxSize; +# +# +#18.9.26.2.1 Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.2.1: Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention -> !0; +# +# +#18.9.26.2.2 Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.2.2: Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:0\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:1\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:2\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> !MaxSize; +# +# +#18.9.26.3.1 Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.3.1: Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention -> !0; +# +# +#18.9.26.3.2 Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.3.2: Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:0\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:3\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:4\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:5\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:6\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:7\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> !MaxSize; +# +# +#18.9.26.4.1 Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.4.1: Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention -> !0; +# +# +#18.9.26.4.2 Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.4.2: Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:0\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:3\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:4\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:5\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:6\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:7\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> !MaxSize; +# +# +#18.9.30.2 Ensure 'Configure Windows SmartScreen' is set to 'Enabled: Require approval from an administrator before running downloaded unknown software' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.30.2: Ensure 'Configure Windows SmartScreen' is set to 'Enabled: Require approval from an administrator before running downloaded unknown software'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen -> !2; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> !EnableSmartScreen; +# +# +#18.9.30.3 Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.30.3: Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention -> !0; +# +# +#18.9.30.4 Ensure 'Turn off heap termination on corruption' is set to 'Disabled'[CIS - Microsoft Windows Server 2012 R2 - 18.9.30.4: Ensure 'Turn off heap termination on corruption' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption -> !0; +# +# +#18.9.30.5 Ensure 'Turn off shell protocol protected mode' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.30.5: Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior -> !0; +# +# +#18.9.47.1 Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.47.1: Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> !DisableFileSyncNGSC; +# +# +#18.9.47.2 Ensure 'Prevent the usage of OneDrive for file storage on Windows 8.1' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.47.2: Ensure 'Prevent the usage of OneDrive for file storage on Windows 8.1' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Skydrive -> DisableFileSync -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Skydrive -> !DisableFileSync; +# +# +#18.9.52.2.2 Ensure 'Do not allow passwords to be saved' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.2.2: Ensure 'Do not allow passwords to be saved' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !DisablePasswordSaving; +# +# +#18.9.52.3.3.2 Ensure 'Do not allow drive redirection' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.3.2: Ensure 'Do not allow drive redirection' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fDisableCdm; +# +# +#18.9.52.3.9.1 Ensure 'Always prompt for password upon connection' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.9.1: Ensure 'Always prompt for password upon connection' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fPromptForPassword; +# +# +#18.9.52.3.9.2 Ensure 'Require secure RPC communication' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.9.2: Ensure 'Require secure RPC communication' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fEncryptRPCTraffic; +# +# +#18.9.52.3.9.3 Ensure 'Set client connection encryption level' is set to 'Enabled: High Level' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.9.3: Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel -> !3; +# +# +#18.9.52.3.11.1 Ensure 'Do not delete temp folders upon exit' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.11.1: Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit -> !1; +# +# +#18.9.52.3.11.2 Ensure 'Do not use temporary folders per session' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.11.2: Ensure 'Do not use temporary folders per session' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> PerSessionTempDir -> !1; +# +# +#18.9.53.1 Ensure 'Prevent downloading of enclosures' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.53.1: Ensure 'Prevent downloading of enclosures' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> !DisableEnclosureDownload; +# +# +#18.9.54.2 Ensure 'Allow indexing of encrypted files' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.54.2: Ensure 'Allow indexing of encrypted files' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems -> !0; +# +# +#18.9.61.1 Ensure 'Turn off Automatic Download and Install of updates' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.61.1: Ensure 'Turn off Automatic Download and Install of updates' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> AutoDownload -> !4; +# +# +#18.9.61.2 Ensure 'Turn off the offer to update to the latest version of Windows' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.61.2: Ensure 'Turn off the offer to update to the latest version of Windows' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> DisableOSUpgrade -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> !DisableOSUpgrade; +# +# +#18.9.70.2.1 Ensure 'Configure Default consent' is set to 'Enabled: Always ask before sending data' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.70.2.1: Ensure 'Configure Default consent' is set to 'Enabled: Always ask before sending data'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting\Consent -> DefaultConsent -> !1; +# +# +#18.9.70.3 Ensure 'Automatically send memory dumps for OS-generated error reports' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.70.3: Ensure 'Automatically send memory dumps for OS-generated error reports' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> AutoApproveOSDumps -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !AutoApproveOSDumps; +# +# +#18.9.74.1 Ensure 'Allow user control over installs' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.74.1: Ensure 'Allow user control over installs' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl -> !0; +# +# +#18.9.74.2 Ensure 'Always install with elevated privileges' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.74.2: Ensure 'Always install with elevated privileges' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated -> !0; +# +# +#18.9.75.1 Ensure 'Sign-in last interactive user automatically after a system-initiated restart' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.75.1: Ensure 'Sign-in last interactive user automatically after a system-initiated restart' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> !DisableAutomaticRestartSignOn; +# +# +#18.9.84.1 Ensure 'Turn on PowerShell Script Block Logging' is set to 'Disabled'[CIS - Microsoft Windows Server 2012 R2 - 18.9.84.1: Ensure 'Turn on PowerShell Script Block Logging' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> !EnableScriptBlockLogging; +# +# +#18.9.84.2 Ensure 'Turn on PowerShell Transcription' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.84.2: Ensure 'Turn on PowerShell Transcription' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting -> !0; +# +# +#18.9.86.1.1 Ensure 'Allow Basic authentication' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.1.1: Ensure 'Allow Basic authentication' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic -> !0; +# +# +#18.9.86.1.2 Ensure 'Allow unencrypted traffic' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.1.2: Ensure 'Allow unencrypted traffic' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic -> !0; +# +# +#18.9.86.1.3 Ensure 'Disallow Digest authentication' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.1.3: Ensure 'Disallow Digest authentication' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> !AllowDigest; +# +# +#18.9.86.2.1 Ensure 'Allow Basic authentication' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.2.1: Ensure 'Allow Basic authentication' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic -> !0; +# +# +#18.9.86.2.3 Ensure 'Allow unencrypted traffic' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.2.3: Ensure 'Allow unencrypted traffic' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic -> !0; +# +# +#18.9.86.2.4 Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.2.4: Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> !DisableRunAs; +# +# +#18.9.90.2 Ensure 'Configure Automatic Updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.90.2: Ensure 'Configure Automatic Updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> !NoAutoUpdate; +# +# +#18.9.90.3 Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.90.3: Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> !ScheduledInstallDay; +# +# +#18.9.90.4 Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.90.4: Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers -> !0; +# diff --git a/etc/ruleset/rootcheck/cis_win2012r2_domainL2_rcl.txt b/etc/ruleset/rootcheck/cis_win2012r2_domainL2_rcl.txt new file mode 100644 index 0000000000..811ef64d6b --- /dev/null +++ b/etc/ruleset/rootcheck/cis_win2012r2_domainL2_rcl.txt @@ -0,0 +1,347 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2018 OSSEC Project +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://github.com/ossec/ossec-hids/blob/master/LICENSE +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - r (registry entry) +# - p (process running) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceeded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + +# CIS Checks for Windows Server 2012 R2 Domain Controller L2 +# Based on Center for Internet Security Benchmark v2.2.1 for Microsoft Windows Server 2012 R2 (https://workbench.cisecurity.org/benchmarks/288) +# +# +#2.3.10.4 Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.4: Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> !1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> !DisableDomainCreds; +# +# +#18.3.5 Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.5: Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> !493e0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> !KeepAliveTime; +# +# +#18.3.7 Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.7: Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> !0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> !PerformRouterDiscovery; +# +# +#18.3.10 Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.10: Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> !3; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> !TcpMaxDataRetransmissions; +# +# +#18.3.11 Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.11: Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> !3; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> !TcpMaxDataRetransmissions; +# +# +#18.4.9.1 Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.9.1: Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnDomain -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnPublicNet -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitLLTDIOOnPrivateNet -> !0; +# +# +#18.4.9.2 Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.9.2: Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnDomain -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnPublicNet -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitRspndrOnPrivateNet -> !0; +# +# +#18.4.10.2 Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.10.2: Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> !Disabled; +# +# +#18.4.19.2.1 Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)') +[CIS - Microsoft Windows Server 2012 R2 - 18.4.19.2.1: Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> !ff; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> !DisabledComponents; +# +# +#18.4.20.1 Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.20.1: Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> !EnableRegistrars; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> !DisableUPnPRegistrar; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> !DisableInBand802DOT11Registrar; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> !DisableFlashConfigRegistrar; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> !DisableWPDRegistrar; +# +# +#18.4.20.2 Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.20.2: Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> !DisableWcnUi; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# +#18.8.24.1 Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.24.1: Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> !BlockUserInputMethodsForSignIn; +# +# +#18.8.29.5.1 Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.29.5.1: Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> !DCSettingIndex; +# +# +#18.8.29.5.2 Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.29.5.2: Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> !ACSettingIndex; +# +# +#18.8.39.5.1 Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.39.5.1: Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> !DisableQueryRemoteServer; +# +# +#18.8.39.11.1 Ensure 'Enable/Disable PerfTrack' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.39.11.1: Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> !ScenarioExecutionEnabled; +# +# +#18.8.41.1 Ensure 'Turn off the advertising ID' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.41.1: Ensure 'Turn off the advertising ID' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> !DisabledByGroupPolicy; +# +# +#18.8.44.1.1 Ensure 'Enable Windows NTP Client' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.44.1.1: Ensure 'Enable Windows NTP Client' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> !Enabled; +# +# +#18.9.37.1 Ensure 'Turn off location' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.37.1: Ensure 'Turn off location' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> !DisableLocation; +# +# +#18.9.52.3.2.1 Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.2.1: Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fSingleSessionPerUser -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fSingleSessionPerUser; +# +# +#18.9.52.3.3.1 Ensure 'Do not allow COM port redirection' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.3.1: Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fDisableCcm; +# +# +#18.9.52.3.3.3 Ensure 'Do not allow LPT port redirection' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.3.3: Ensure 'Do not allow LPT port redirection' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fDisableLPT; +# +# +#18.9.52.3.3.4 Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.3.4: Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fDisablePNPRedir; +# +# +#18.9.52.3.10.1 Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.10.1: Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba2; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba3; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba4; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba5; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba6; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba7; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba8; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba9; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba\D; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbbb\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbbc\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbbd\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbbe\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbbf\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbc\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbd\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbe\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbf\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dc\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dd\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:de\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:df\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:e\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:f\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:\w\w\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !MaxIdleTime; +# +# +#18.9.52.3.10.2 Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.10.2: Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> !EA60; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !MaxDisconnectionTime; +# +# +#18.9.54.3 Ensure 'Set what information is shared in Search' is set to 'Enabled: Anonymous info' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.54.3: Ensure 'Set what information is shared in Search' is set to 'Enabled: Anonymous info'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> ConnectedSearchPrivacy -> !3; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> !ConnectedSearchPrivacy; +# +# +#18.9.59.1 Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.59.1: Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> !NoGenTicket; +# +# +#18.9.61.3 Ensure 'Turn off the Store application' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.61.3: Ensure 'Turn off the Store application' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> RemoveWindowsStore -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> !RemoveWindowsStore; +# +# +#18.9.69.3.1 Ensure 'Join Microsoft MAPS' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.69.3.1: Ensure 'Join Microsoft MAPS' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting -> !0; +# +# +#18.9.74.3 Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.74.3: Ensure 'Join Microsoft MAPS' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> !0; +# +# +#18.9.86.2.2 Ensure 'Allow remote server management through WinRM' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.2.2: Ensure 'Allow remote server management through WinRM' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> !0; +# +# +#18.9.87.1 Ensure 'Allow Remote Shell Access' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.87.1: Ensure 'Allow Remote Shell Access' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> !AllowRemoteShellAccess; +# diff --git a/etc/ruleset/rootcheck/cis_win2012r2_memberL1_rcl.txt b/etc/ruleset/rootcheck/cis_win2012r2_memberL1_rcl.txt new file mode 100644 index 0000000000..bbdd28a59f --- /dev/null +++ b/etc/ruleset/rootcheck/cis_win2012r2_memberL1_rcl.txt @@ -0,0 +1,1135 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2018 OSSEC Project +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://github.com/ossec/ossec-hids/blob/master/LICENSE +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - r (registry entry) +# - p (process running) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceeded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + +# CIS Checks for Windows Server 2012 R2 Domain Controller L2 +# Based on Center for Internet Security Benchmark v2.2.1 for Microsoft Windows Server 2012 R2 (https://workbench.cisecurity.org/benchmarks/288) +# +# +#1.1.2 Ensure 'Maximum password age' is set to '60 or fewer days, but not 0' +[CIS - Microsoft Windows Server 2012 R2 - Ensure 'Maximum password age' is set to '60 or fewer days, but not 0'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 0; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 3D; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 3E; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 3F; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:4\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:5\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:6\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:7\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:8\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:9\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:A\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:B\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:C\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:D\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:E\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:F\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> r:\w\w\w+; +# +# +#2.3.1.2 Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.1.2: Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> 1; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !NoConnectedUser; +# +# +#2.3.1.4 Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.1.4: Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse -> 0; +# +# +#2.3.2.1 Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.2.1: Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy -> !1; +# +# +#2.3.2.2 Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.2.2: Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 2; +# +# +#2.3.4.1 Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.4.1: Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> AllocateDASD -> 1; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> AllocateDASD -> 2; +# +# +#2.3.4.2 Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.4.2: Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> !1; +# +# +#2.3.6.1 Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.6.1: Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal -> 0; +# +# +#2.3.6.2 Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.6.2: Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel -> 0; +# +# +#2.3.6.3 Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.6.3: Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel -> 0; +# +# +#2.3.6.4 Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.6.4: Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange -> 1; +# +# +#2.3.6.6 Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.6.6: Ensure 'Domain member: Require strong session key' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey -> 0; +# +# +#2.3.7.1 Ensure 'Interactive logon: Do not display last user name' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.7.1: Ensure 'Interactive logon: Do not display last user name' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !DontDisplayLastUserName; +# +# +#2.3.7.2 Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.7.2: Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD -> 1; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !DisableCAD; +# +# +#2.3.7.3 Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.7.3: Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 385; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 386; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 387; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 388; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 389; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:38\D; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:39\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:3\D\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:4\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:5\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:6\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:7\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:8\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:9\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:\D\w\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> r:\w\w\w\w+; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !InactivityTimeoutSecs; +# +# +#2.3.7.7 Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.7.7: Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> 1; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> 2; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> 3; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> 4; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> 0F; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:1\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:2\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:3\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:4\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:5\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:6\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:7\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:8\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:9\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:\D\w; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> r:\w\w\w+; +# +# +#2.3.7.8 Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.7.8: Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ForceUnlockLogon -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> !ForceUnlockLogon; +# +# +#2.3.7.9 Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher +[CIS - Microsoft Windows Server 2012 R2 - 2.3.7.9: Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> ScRemoveOption -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon -> !ScRemoveOption; +# +# +#2.3.8.1 Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.8.1: Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> !1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> !RequireSecuritySignature; +# +# +#2.3.8.2 Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.8.2: Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> !1; +# +# +#2.3.8.3 Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.8.3: Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword -> !0; +# +# +#2.3.9.1 Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.9.1: Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> 0; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:1\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:2\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:3\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:4\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:5\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:6\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:7\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:8\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:9\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:\D\w; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> r:\w\w\w+; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> !AutoDisconnect; +# +# +#2.3.9.2 Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.9.2: Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature -> !1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> !RequireSecuritySignature; +# +# +#2.3.9.3 Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.9.3: Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature -> !1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> !EnableSecuritySignature; +# +# +#2.3.9.4 Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.9.4: Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> !1; +# +# +#2.3.9.5 Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher +[CIS - Microsoft Windows Server 2012 R2 - 2.3.9.5: Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel -> !0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> !SMBServerNameHardeningLevel; +# +# +#2.3.10.2 Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.2: Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM -> 0; +# +# +#2.3.10.3 Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.3: Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous -> !1; +# +# +#2.3.10.5 Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.5: Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 2; +# +# +#2.3.10.6 Configure 'Network access: Named Pipes that can be accessed anonymously' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.6: Configure 'Network access: Named Pipes that can be accessed anonymously'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> !r:lsarpc|netlogon|samr; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> !NullSessionPipes; +# +# +#2.3.10.7 Configure 'Network access: Remotely accessible registry paths' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.7: Configure 'Network access: Remotely accessible registry paths'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> !r:System\\CurrentControlSet\\Control\\ProductOptions|System\\CurrentControlSet\\Control\\Server Applications|Software\\Microsoft\\Windows NT\\CurrentVersion; +# +# +#2.3.10.8 Configure 'Network access: Remotely accessible registry paths and sub-paths' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.8: Configure 'Network access: Remotely accessible registry paths and sub-paths'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> !r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Print|Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows|System\\CurrentControlSet\\Control\\Print\\Printers|System\\CurrentControlSet\\Services\\Eventlog|Software\\Microsoft\\OLAP Server|System\\CurrentControlSet\\Control\\ContentIndex|System\\CurrentControlSet\\Control\\Terminal Server|System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig|System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration|Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib|System\\CurrentControlSet\\Services\\SysmonLog|System\\CurrentControlSet\\Services\\CertSvc|System\\CurrentControlSet\\Services\\WINS; +# +# +#2.3.10.9 Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.9: Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess -> !1; +# +# +#2.3.10.10 Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.10: Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> r:\.+; +# +# +#2.3.10.11 Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.11: Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest -> 1; +# +# +#2.3.11.1 Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.1: Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> UseMachineId -> !1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> !UseMachineId; +# +# +#2.3.11.2 Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.2: Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback -> 1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> !allownullsessionfallback; +# +# +#2.3.11.3 Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.3: Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID -> !0; +# +# +#2.3.11.4 Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.4: Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> !2147483644; +# +# +#2.3.11.5 Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.5: Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash -> 0; +# +# +#2.3.11.6 Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.6: Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> !1; +# +# +#2.3.11.7 Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.7: Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 0; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 2; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 3; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 4; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> !LmCompatibilityLevel; +# +# +#2.3.11.8 Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> !1; +# +# +#2.3.11.9 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.9: Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption''] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec -> !537395200; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> !NTLMMinClientSec; +# +# +#2.3.11.10 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.11.10: Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec -> !537395200; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> !NTLMMinServerSec; +# +# +#2.3.13.1 Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.13.1: Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ShutdownWithoutLogon -> 1; +# +# +#2.3.15.1 Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.15.1: Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive -> !1; +# +# +#2.3.15.2 Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.15.2: Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode -> !1; +# +# +#2.3.17.1 Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.1: Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !FilterAdministratorToken; +# +# +#2.3.17.2 Ensure 'User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.2: Ensure 'User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableUIADesktopToggle -> 1; +# +# +#2.3.17.3 Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.3: Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> 0; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> 1; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !ConsentPromptBehaviorAdmin; +# +# +#2.3.17.4 Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.4: Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser -> 1; +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !ConsentPromptBehaviorUser; +# +# +#2.3.17.5 Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.5: Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 0; +r:HKEY_LOCAL_MACHINE\MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> !EnableInstallerDetection; +# +# +#2.3.17.6 Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.6: Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths -> 0; +# +# +#2.3.17.7 Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.7: Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA -> 0; +# +# +#2.3.17.8 Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.8: Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop -> 0; +# +# +#2.3.17.9 Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.17.9: Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization -> 0; +# +# +#9.1.1 Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.1: Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> EnableFirewall -> 0; +# +# +#9.1.2 Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.2: Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> DefaultInboundAction -> 0; +# +# +#9.1.3 Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.3: Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction -> 1; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> DefaultOutboundAction -> 1; +# +# +#9.1.4 Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.4: Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications -> 0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> !DisableNotifications; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> DisableNotifications -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> !DisableNotifications; +# +# +#9.1.5 Ensure 'Windows Firewall: Domain: Settings: Apply local firewall rules' is set to 'Yes (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.5: Ensure 'Windows Firewall: Domain: Settings: Apply local firewall rules' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> AllowLocalPolicyMerge -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> AllowLocalPolicyMerge -> 0; +# +# +#9.1.6 Ensure 'Windows Firewall: Domain: Settings: Apply local connection security rules' is set to 'Yes (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.6: Ensure 'Windows Firewall: Domain: Settings: Apply local connection security rules' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> AllowLocalIPsecPolicyMerge -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile -> AllowLocalIPsecPolicyMerge -> 0; +# +# +#9.1.7 Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\*.log' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.7: Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\*.log'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:\psystemroot\p\\system32\logfiles\firewall\\w+\plog; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFilePath -> r:\psystemroot\p\\system32\logfiles\firewall\\w+\plog; +# +# +#9.1.8 Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.8: Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> r:3\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFileSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFileSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFileSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFileSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFileSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogFileSize -> r:3\w\w\w; +# +# +#9.1.9 Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.9: Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogDroppedPackets -> 0; +# +# +#9.1.10 Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.1.10: Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\DomainProfile\Logging -> LogSuccessfulConnections -> 0; +# +# +#9.2.1 Ensure 'Windows Firewall: Private: Firewall state' is set to 'On' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.1: Ensure 'Windows Firewall: Private: Firewall state' is set to 'On'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile -> EnableFirewall -> 0; +# +# +#9.2.2 Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.2: Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile -> DefaultInboundAction -> 0; +# +# +#9.2.3 Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.3: Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction -> 1; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile -> DefaultOutboundAction -> 1; +# +# +#9.2.4 Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.4: Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile -> DisableNotifications -> 0; +# +# +#9.2.5 Ensure 'Windows Firewall: Private: Settings: Apply local firewall rules' is set to 'Yes (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.5: Ensure 'Windows Firewall: Private: Settings: Apply local firewall rules' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> AllowLocalPolicyMerge -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile -> AllowLocalPolicyMerge -> 0; +# +# +#9.2.6 Ensure 'Windows Firewall: Private: Settings: Apply local connection security rules' is set to 'Yes (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.6: Ensure 'Windows Firewall: Private: Settings: Apply local connection security rules' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> AllowLocalIPsecPolicyMerge -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile -> AllowLocalIPsecPolicyMerge -> 0; +# +# +#9.2.7 Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\*.log' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.7: Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\*.log'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:\psystemroot\p\\system32\logfiles\firewall\\w+\plog; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFilePath -> r:\psystemroot\p\\system32\logfiles\firewall\\w+\plog; +# +# +#9.2.8 Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.8: Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> r:3\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFileSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFileSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFileSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFileSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFileSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogFileSize -> r:3\w\w\w; +# +# +#9.2.9 Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.9: Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogDroppedPackets -> 0; +# +# +#9.2.10 Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.2.10: Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\StandardProfile\Logging -> LogSuccessfulConnections -> 0; +# +# +#9.3.1 Ensure 'Windows Firewall: Public: Firewall state' is set to 'On' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.1: Ensure 'Windows Firewall: Public: Firewall state' is set to 'On'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile -> EnableFirewall -> 0; +# +# +#9.3.2 Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.2: Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile -> DefaultInboundAction -> 0; +# +# +#9.3.3 Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.3: Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction -> 1; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile -> DefaultOutboundAction -> 1; +# +# +#9.3.4 Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.4: Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile -> DisableNotifications -> 0; +# +# +#9.3.5 Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.5: Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile -> AllowLocalPolicyMerge -> 0; +# +# +#9.3.6 Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.6: Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0; +# +# +#9.3.7 Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\*.log' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.7: Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\*.log'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:\psystemroot\p\\system32\logfiles\firewall\\w+\plog; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFilePath -> r:\psystemroot\p\\system32\logfiles\firewall\\w+\plog; +# +# +#9.3.8 Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.8: Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> r:3\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFileSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFileSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFileSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFileSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFileSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogFileSize -> r:3\w\w\w; +# +# +#9.3.9 Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.9: Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogDroppedPackets -> 0; +# +# +#9.3.10 Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes' +[CIS - Microsoft Windows Server 2012 R2 - 9.3.10: Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\SharedAccess\Parameters\FirewallPolicy\PublicProfile\Logging -> LogSuccessfulConnections -> 0; +# +# +#18.1.1.1 Ensure 'Prevent enabling lock screen camera' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.1.1.1: Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> !NoLockScreenCamera; +# +# +#18.1.1.2 Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.1.1.2: Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> !NoLockScreenSlideshow; +# +# +#18.2.1 Ensure LAPS AdmPwd GPO Extension / CSE is installed +[CIS - Microsoft Windows Server 2012 R2 - 18.2.1: Ensure LAPS AdmPwd GPO Extension / CSE is installed] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> !DllName; +# +# +#18.2.2 Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.2.2: Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> !PwdExpirationProtectionEnabled; +# +# +#18.2.3 Ensure 'Enable Local Admin Password Management' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.2.3: Ensure 'Enable Local Admin Password Management' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> !AdmPwdEnabled; +# +# +#18.2.4 Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters' +[CIS - Microsoft Windows Server 2012 R2 - 18.2.4: Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity -> !4; +# +# +#18.2.5 Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more' +[CIS - Microsoft Windows Server 2012 R2 - 18.2.5: Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> r:\d; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> r:a; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> r:b; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> r:c; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> r:d; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> r:e; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> !PasswordLength; +# +# +#18.2.6 Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer' +[CIS - Microsoft Windows Server 2012 R2 - 18.2.6: Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> 1F; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> r:2\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> r:3\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> r:4\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> r:5\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> r:6\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> r:7\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> r:8\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> r:9\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> r:\D\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> r:\w\w\w+; +# +# +#18.3.1 Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.1: Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> !0; +# +# +#18.3.2 Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.2: Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting -> !2; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> !DisableIPSourceRouting; +# +# +#18.3.3 Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.3: Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting -> !2; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> !DisableIPSourceRouting; +# +# +#18.3.4 Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.4: Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect -> 1; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> !EnableICMPRedirect; +# +# +#18.3.6 Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.6: Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand -> !1; +# +# +#18.3.8 Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.8: Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode -> 0; +# +# +#18.3.9 Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.9: Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires' is set to 'Enabled: 5 or fewer seconds'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> 6; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> 7; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> 8; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> 9; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> r:\w\w+; +# +# +#18.3.12 Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.12: Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> 5B; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> 5C; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> 5D; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> 5E; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> 5F; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> r:6\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> r:7\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> r:8\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> r:9\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> r:\D\w; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> r:\w\w\w+; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> !WarningLevel; +# +# +#18.4.11.2 Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.11.2: Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA -> 1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> !NC_AllowNetBridge_NLA; +# +# +#18.4.11.3 Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.11.3: Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> !NC_StdDomainUserSetLocation; +# +# +#18.4.21.1 Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.21.1: Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections -> !1; +# +# +#18.6.1 Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.6.1: Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy -> !0; +# +# +#18.6.2 Ensure 'WDigest Authentication' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.6.2: Ensure 'WDigest Authentication' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential -> !0; +# +# +#18.8.3.1 Ensure 'Include command line in process creation events' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.3.1: Ensure 'Include command line in process creation events' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled -> !0; +# +# +#18.8.12.1 Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.12.1: Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy -> !3; +# +# +#18.8.19.2 Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.19.2: Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> !NoBackgroundPolicy; +# +# +#18.8.19.3 Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.19.3: Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> !NoGPOListChanges; +# +# +#18.8.19.4 Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.19.4: Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy -> !0; +# +# +#18.8.25.1 Ensure 'Do not display network selection UI' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.25.1: Ensure 'Do not display network selection UI' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> !DontDisplayNetworkSelectionUI; +# +# +#18.8.25.2 Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.25.2: Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> !DontEnumerateConnectedUsers; +# +# +#18.8.25.3 Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.25.3: Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers -> !0; +# +# +#18.8.25.4 Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.25.4: Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> !DisableLockScreenAppNotifications; +# +# +#18.8.25.5 Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.25.5: Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon -> !0; +# +# +#18.8.31.1 Ensure 'Configure Offer Remote Assistance' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.31.1: Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited -> !0; +# +# +#18.8.31.2 Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.31.2: Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fAllowToGetHelp; +# +# +#18.8.32.1 Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.32.1: Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> !EnableAuthEpResolution; +# +# +#18.9.6.1 Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.6.1: Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> !MSAOptional; +# +# +#18.9.8.1 Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.8.1: Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoAutoplayfornonVolume; +# +# +#18.9.8.2 Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.8.2: Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoAutorun; +# +# +#18.9.8.3 Ensure 'Turn off Autoplay' is set to 'Enabled: All drives' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.8.3: Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer-> NoDriveTypeAutoRun -> !ff; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer-> !NoDriveTypeAutoRun; +# +# +#18.9.15.1 Ensure 'Do not display the password reveal button' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.15.1: Ensure 'Do not display the password reveal button' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> !DisablePasswordReveal; +# +# +#18.9.15.2 Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.15.2: Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators -> !0; +# +# +#18.9.26.1.1 Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.1.1: Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention -> !0; +# +# +#18.9.26.1.2 Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.1.2: Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:0\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:3\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:4\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:5\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:6\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> r:7\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> !MaxSize; +# +# +#18.9.26.2.1 Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.2.1: Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention -> !0; +# +# +#18.9.26.2.2 Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.2.2: Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:0\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:1\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> r:2\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> !MaxSize; +# +# +#18.9.26.3.1 Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.3.1: Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention -> !0; +# +# +#18.9.26.3.2 Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.3.2: Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:0\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:3\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:4\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:5\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:6\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> r:7\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> !MaxSize; +# +# +#18.9.26.4.1 Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.4.1: Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention -> !0; +# +# +#18.9.26.4.2 Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.26.4.2: Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:0\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:1\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:2\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:3\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:4\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:5\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:6\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> r:7\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> !MaxSize; +# +# +#18.9.30.2 Ensure 'Configure Windows SmartScreen' is set to 'Enabled: Require approval from an administrator before running downloaded unknown software' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.30.2: Ensure 'Configure Windows SmartScreen' is set to 'Enabled: Require approval from an administrator before running downloaded unknown software'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen -> !2; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> !EnableSmartScreen; +# +# +#18.9.30.3 Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.30.3: Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention -> !0; +# +# +#18.9.30.4 Ensure 'Turn off heap termination on corruption' is set to 'Disabled'[CIS - Microsoft Windows Server 2012 R2 - 18.9.30.4: Ensure 'Turn off heap termination on corruption' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption -> !0; +# +# +#18.9.30.5 Ensure 'Turn off shell protocol protected mode' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.30.5: Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior -> !0; +# +# +#18.9.47.1 Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.47.1: Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> !DisableFileSyncNGSC; +# +# +#18.9.47.2 Ensure 'Prevent the usage of OneDrive for file storage on Windows 8.1' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.47.2: Ensure 'Prevent the usage of OneDrive for file storage on Windows 8.1' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Skydrive -> DisableFileSync -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Skydrive -> !DisableFileSync; +# +# +#18.9.52.2.2 Ensure 'Do not allow passwords to be saved' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.2.2: Ensure 'Do not allow passwords to be saved' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !DisablePasswordSaving; +# +# +#18.9.52.3.3.2 Ensure 'Do not allow drive redirection' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.3.2: Ensure 'Do not allow drive redirection' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fDisableCdm; +# +# +#18.9.52.3.9.1 Ensure 'Always prompt for password upon connection' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.9.1: Ensure 'Always prompt for password upon connection' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fPromptForPassword; +# +# +#18.9.52.3.9.2 Ensure 'Require secure RPC communication' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.9.2: Ensure 'Require secure RPC communication' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fEncryptRPCTraffic; +# +# +#18.9.52.3.9.3 Ensure 'Set client connection encryption level' is set to 'Enabled: High Level' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.9.3: Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel -> !3; +# +# +#18.9.52.3.11.1 Ensure 'Do not delete temp folders upon exit' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.11.1: Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit -> !1; +# +# +#18.9.52.3.11.2 Ensure 'Do not use temporary folders per session' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.11.2: Ensure 'Do not use temporary folders per session' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> PerSessionTempDir -> !1; +# +# +#18.9.53.1 Ensure 'Prevent downloading of enclosures' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.53.1: Ensure 'Prevent downloading of enclosures' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> !DisableEnclosureDownload; +# +# +#18.9.54.2 Ensure 'Allow indexing of encrypted files' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.54.2: Ensure 'Allow indexing of encrypted files' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems -> !0; +# +# +#18.9.61.1 Ensure 'Turn off Automatic Download and Install of updates' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.61.1: Ensure 'Turn off Automatic Download and Install of updates' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> AutoDownload -> !4; +# +# +#18.9.61.2 Ensure 'Turn off the offer to update to the latest version of Windows' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.61.2: Ensure 'Turn off the offer to update to the latest version of Windows' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> DisableOSUpgrade -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> !DisableOSUpgrade; +# +# +#18.9.70.2.1 Ensure 'Configure Default consent' is set to 'Enabled: Always ask before sending data' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.70.2.1: Ensure 'Configure Default consent' is set to 'Enabled: Always ask before sending data'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting\Consent -> DefaultConsent -> !1; +# +# +#18.9.70.3 Ensure 'Automatically send memory dumps for OS-generated error reports' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.70.3: Ensure 'Automatically send memory dumps for OS-generated error reports' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> AutoApproveOSDumps -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !AutoApproveOSDumps; +# +# +#18.9.74.1 Ensure 'Allow user control over installs' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.74.1: Ensure 'Allow user control over installs' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl -> !0; +# +# +#18.9.74.2 Ensure 'Always install with elevated privileges' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.74.2: Ensure 'Always install with elevated privileges' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated -> !0; +# +# +#18.9.75.1 Ensure 'Sign-in last interactive user automatically after a system-initiated restart' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.75.1: Ensure 'Sign-in last interactive user automatically after a system-initiated restart' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> !DisableAutomaticRestartSignOn; +# +# +#18.9.84.1 Ensure 'Turn on PowerShell Script Block Logging' is set to 'Disabled'[CIS - Microsoft Windows Server 2012 R2 - 18.9.84.1: Ensure 'Turn on PowerShell Script Block Logging' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> !EnableScriptBlockLogging; +# +# +#18.9.84.2 Ensure 'Turn on PowerShell Transcription' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.84.2: Ensure 'Turn on PowerShell Transcription' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting -> !0; +# +# +#18.9.86.1.1 Ensure 'Allow Basic authentication' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.1.1: Ensure 'Allow Basic authentication' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic -> !0; +# +# +#18.9.86.1.2 Ensure 'Allow unencrypted traffic' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.1.2: Ensure 'Allow unencrypted traffic' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic -> !0; +# +# +#18.9.86.1.3 Ensure 'Disallow Digest authentication' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.1.3: Ensure 'Disallow Digest authentication' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> !AllowDigest; +# +# +#18.9.86.2.1 Ensure 'Allow Basic authentication' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.2.1: Ensure 'Allow Basic authentication' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic -> !0; +# +# +#18.9.86.2.3 Ensure 'Allow unencrypted traffic' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.2.3: Ensure 'Allow unencrypted traffic' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic -> !0; +# +# +#18.9.86.2.4 Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.2.4: Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> !DisableRunAs; +# +# +#18.9.90.2 Ensure 'Configure Automatic Updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.90.2: Ensure 'Configure Automatic Updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> !NoAutoUpdate; +# +# +#18.9.90.3 Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.90.3: Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> !ScheduledInstallDay; +# +# +#18.9.90.4 Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.90.4: Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers -> !0; +# +# +# diff --git a/etc/ruleset/rootcheck/cis_win2012r2_memberL2_rcl.txt b/etc/ruleset/rootcheck/cis_win2012r2_memberL2_rcl.txt new file mode 100644 index 0000000000..3695dc483b --- /dev/null +++ b/etc/ruleset/rootcheck/cis_win2012r2_memberL2_rcl.txt @@ -0,0 +1,4733 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2018 OSSEC Project +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://github.com/ossec/ossec-hids/blob/master/LICENSE +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - r (registry entry) +# - p (process running) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceeded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + +# CIS Checks for Windows Server 2012 R2 Domain Controller L2 +# Based on Center for Internet Security Benchmark v2.2.1 for Microsoft Windows Server 2012 R2 (https://workbench.cisecurity.org/benchmarks/288) +# +# +#2.3.7.6 Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)' +[CIS - Microsoft Windows Server 2012 R2 - Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> 5; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> 6; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> 7; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> 8; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> 9; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> a; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> b; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> c; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> d; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> e; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> f; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> \w\w+; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> !CachedLogonsCount; +# +# +#2.3.10.4 Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 2.3.10.4: Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> !1; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> !DisableDomainCreds; +# +# +#18.3.5 Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.5: Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> !493e0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> !KeepAliveTime; +# +# +#18.3.7 Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.7: Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> !0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> !PerformRouterDiscovery; +# +# +#18.3.10 Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.10: Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> !3; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> !TcpMaxDataRetransmissions; +# +# +#18.3.11 Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3' +[CIS - Microsoft Windows Server 2012 R2 - 18.3.11: Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> !3; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> !TcpMaxDataRetransmissions; +# +# +#18.4.9.1 Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.9.1: Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnDomain -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnPublicNet -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitLLTDIOOnPrivateNet -> !0; +# +# +#18.4.9.2 Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.9.2: Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnDomain -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnPublicNet -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitRspndrOnPrivateNet -> !0; +# +# +#18.4.10.2 Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.10.2: Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> !Disabled; +# +# +#18.4.19.2.1 Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)') +[CIS - Microsoft Windows Server 2012 R2 - 18.4.19.2.1: Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> !ff; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> !DisabledComponents; +# +# +#18.4.20.1 Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.20.1: Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> !EnableRegistrars; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> !DisableUPnPRegistrar; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> !DisableInBand802DOT11Registrar; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> !DisableFlashConfigRegistrar; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> !DisableWPDRegistrar; +# +# +#18.4.20.2 Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.20.2: Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> !DisableWcnUi; +# +# +#18.4.21.2 Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.4.21.2: Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> !fBlockNonDomain; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# + -> !1; +# +# +#18.8.20.1.1 Ensure 'Turn off access to the Store' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.1: Ensure 'Turn off access to the Store' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> !NoUseStoreOpenWith; +# +# +#18.8.20.1.2 Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.2: Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableWebPnPDownload; +# +# +#18.8.20.1.3 Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.3: Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> !PreventHandwritingDataSharing; +# +# +#18.8.20.1.4 Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.4: Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> !PreventHandwritingErrorReports; +# +# +#18.8.20.1.5 Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.5: Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> !ExitOnMSICW; +# +# +#18.8.20.1.6 Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.6: Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoWebServices; +# +# +#18.8.20.1.7 Ensure 'Turn off printing over HTTP' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.7: Ensure 'Turn off printing over HTTP' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> !DisableHTTPPrinting; +# +# +#18.8.20.1.8 Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.8: Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> !1; +r:HKEY_LOCAL_MACHINE\Policies\Microsoft\Windows\Registration Wizard Control -> !NoRegistration; +# +# +#18.8.20.1.9 Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.9: Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> !DisableContentFileUpdates; +# +# +#18.8.20.1.10 Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.10: Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoOnlinePrintsWizard; +# +# +#18.8.20.1.11 Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.11: Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> !NoPublishingWizard; +# +# +#18.8.20.1.12 Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.12: Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> !CEIP; +# +# +#18.8.20.1.13 Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.13: Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> !CEIPEnable; +# +# +#18.8.20.1.14 Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.20.1.14: Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> !Disabled; +# +# +#18.8.24.1 Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.24.1: Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> !BlockUserInputMethodsForSignIn; +# +# +#18.8.29.5.1 Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.29.5.1: Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> !DCSettingIndex; +# +# +#18.8.29.5.2 Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.29.5.2: Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> !ACSettingIndex; +# +# +#18.8.32.2 Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.32.2: Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> !RestrictRemoteClients; +# +# +#18.8.39.5.1 Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.39.5.1: Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> !DisableQueryRemoteServer; +# +# +#18.8.39.11.1 Ensure 'Enable/Disable PerfTrack' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.39.11.1: Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> !ScenarioExecutionEnabled; +# +# +#18.8.41.1 Ensure 'Turn off the advertising ID' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.41.1: Ensure 'Turn off the advertising ID' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> !DisabledByGroupPolicy; +# +# +#18.8.44.1.1 Ensure 'Enable Windows NTP Client' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.44.1.1: Ensure 'Enable Windows NTP Client' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> !Enabled; +# +# +#18.8.44.1.2 Ensure 'Enable Windows NTP Server' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.8.44.1.2: Ensure 'Enable Windows NTP Server' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled -> !0; +# +# +#18.9.37.1 Ensure 'Turn off location' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.37.1: Ensure 'Turn off location' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> !DisableLocation; +# +# +#18.9.52.3.2.1 Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.2.1: Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fSingleSessionPerUser -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fSingleSessionPerUser; +# +# +#18.9.52.3.3.1 Ensure 'Do not allow COM port redirection' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.3.1: Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fDisableCcm; +# +# +#18.9.52.3.3.3 Ensure 'Do not allow LPT port redirection' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.3.3: Ensure 'Do not allow LPT port redirection' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fDisableLPT; +# +# +#18.9.52.3.3.4 Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.3.4: Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !fDisablePNPRedir; +# +# +#18.9.52.3.10.1 Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.10.1: Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba2; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba3; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba4; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba5; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba6; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba7; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba8; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba9; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbba\D; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbbb\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbbc\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbbd\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbbe\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbbf\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbc\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbd\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbe\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dbf\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dc\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:dd\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:de\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:df\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:e\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:f\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> r:\w\w\w\w\w\w; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !MaxIdleTime; +# +# +#18.9.52.3.10.2 Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.52.3.10.2: Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> !EA60; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> !MaxDisconnectionTime; +# +# +#18.9.54.3 Ensure 'Set what information is shared in Search' is set to 'Enabled: Anonymous info' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.54.3: Ensure 'Set what information is shared in Search' is set to 'Enabled: Anonymous info'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> ConnectedSearchPrivacy -> !3; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> !ConnectedSearchPrivacy; +# +# +#18.9.59.1 Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.59.1: Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> !NoGenTicket; +# +# +#18.9.61.3 Ensure 'Turn off the Store application' is set to 'Enabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.61.3: Ensure 'Turn off the Store application' is set to 'Enabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> RemoveWindowsStore -> !1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> !RemoveWindowsStore; +# +# +#18.9.69.3.1 Ensure 'Join Microsoft MAPS' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.69.3.1: Ensure 'Join Microsoft MAPS' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting -> !0; +# +# +#18.9.74.3 Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.74.3: Ensure 'Join Microsoft MAPS' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> !0; +# +# +#18.9.86.2.2 Ensure 'Allow remote server management through WinRM' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.86.2.2: Ensure 'Allow remote server management through WinRM' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> !0; +# +# +#18.9.87.1 Ensure 'Allow Remote Shell Access' is set to 'Disabled' +[CIS - Microsoft Windows Server 2012 R2 - 18.9.87.1: Ensure 'Allow Remote Shell Access' is set to 'Disabled'] [any] [https://workbench.cisecurity.org/benchmarks/288] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> !AllowRemoteShellAccess; +# + + diff --git a/etc/ruleset/rootcheck/rootkit_files.txt b/etc/ruleset/rootcheck/rootkit_files.txt index e69de29bb2..eada35cca2 100644 --- a/etc/ruleset/rootcheck/rootkit_files.txt +++ b/etc/ruleset/rootcheck/rootkit_files.txt @@ -0,0 +1,410 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# rootkit_files.txt, (C) Daniel B. Cid +# Imported from the rootcheck project. +# +# Blank lines and lines starting with '#' are ignored. +# +# Each line must be in the following format: +# file_name ! Name ::Link to it +# +# Files that start with an '*' will be searched in the whole system. + +# Bash door +tmp/mcliZokhb ! Bash door ::/rootkits/bashdoor.php +tmp/mclzaKmfa ! Bash door ::/rootkits/bashdoor.php + +# adore Worm +dev/.shit/red.tgz ! Adore Worm ::/rootkits/adorew.php +usr/lib/libt ! Adore Worm ::/rootkits/adorew.php +usr/bin/adore ! Adore Worm ::/rootkits/adorew.php +*/klogd.o ! Adore Worm ::/rootkits/adorew.php +*/red.tar ! Adore Worm ::/rootkits/adorew.php + +# T.R.K rootkit +usr/bin/soucemask ! TRK rootkit ::/rootkits/trk.php +usr/bin/sourcemask ! TRK rootkit ::/rootkits/trk.php + +# 55.808.A Worm +tmp/.../a ! 55808.A Worm :: +tmp/.../r ! 55808.A Worm :: + +# Volc Rootkit +usr/lib/volc ! Volc Rootkit :: +usr/bin/volc ! Volc Rootkit :: + +# Illogic +lib/security/.config ! Illogic Rootkit ::rootkits/illogic.php +usr/bin/sia ! Illogic Rootkit ::rootkits/illogic.php +etc/ld.so.hash ! Illogic Rootkit ::rootkits/illogic.php +*/uconf.inv ! Illogic Rootkit ::rootkits/illogic.php + +# T0rnkit +usr/src/.puta ! t0rn Rootkit ::rootkits/torn.php +usr/info/.t0rn ! t0rn Rootkit ::rootkits/torn.php +lib/ldlib.tk ! t0rn Rootkit ::rootkits/torn.php +etc/ttyhash ! t0rn Rootkit ::rootkits/torn.php +sbin/xlogin ! t0rn Rootkit ::rootkits/torn.php +*/ldlib.tk ! t0rn Rootkit ::rootkits/torn.php +*/.t0rn ! t0rn Rootkit ::rootkits/torn.php +*/.puta ! t0rn Rootkit ::rootkits/torn.php + +# RK17 +bin/rtty ! RK17 :: +bin/squit ! RK17 :: +sbin/pback ! RK17 :: +proc/kset ! RK17 :: +usr/src/linux/modules/autod.o ! RK17 :: +usr/src/linux/modules/soundx.o ! RK17 :: + +# Ramen Worm +usr/lib/ldlibps.so ! Ramen Worm ::rootkits/ramen.php +usr/lib/ldlibns.so ! Ramen Worm ::rootkits/ramen.php +usr/lib/ldliblogin.so ! Ramen Worm ::rootkits/ramen.php +usr/src/.poop ! Ramen Worm ::rootkits/ramen.php +tmp/ramen.tgz ! Ramen Worm ::rootkits/ramen.php +etc/xinetd.d/asp ! Ramen Worm ::rootkits/ramen.php + +# Sadmind/IIS Worm +dev/cuc ! Sadmind/IIS Worm :: + +# Monkit +lib/defs ! Monkit :: +usr/lib/libpikapp.a ! Monkit found :: + +# RSHA +usr/bin/kr4p ! RSHA :: +usr/bin/n3tstat ! RSHA :: +usr/bin/chsh2 ! RSHA :: +usr/bin/slice2 ! RSHA :: +etc/rc.d/rsha ! RSHA :: + +# ShitC worm +bin/home ! ShitC :: +sbin/home ! ShitC :: +usr/sbin/in.slogind ! ShitC :: + +# Omega Worm +dev/chr ! Omega Worm :: + +# rh-sharpe +bin/.ps ! Rh-Sharpe :: +usr/bin/cleaner ! Rh-Sharpe :: +usr/bin/slice ! Rh-Sharpe :: +usr/bin/vadim ! Rh-Sharpe :: +usr/bin/.ps ! Rh-Sharpe :: +bin/.lpstree ! Rh-Sharpe :: +usr/bin/.lpstree ! Rh-Sharpe :: +usr/bin/lnetstat ! Rh-Sharpe :: +bin/lnetstat ! Rh-Sharpe :: +usr/bin/ldu ! Rh-Sharpe :: +bin/ldu ! Rh-Sharpe :: +usr/bin/lkillall ! Rh-Sharpe :: +bin/lkillall ! Rh-Sharpe :: +usr/include/rpcsvc/du ! Rh-Sharpe :: + +# Maniac RK +usr/bin/mailrc ! Maniac RK :: + +# Showtee / Romanian +usr/lib/.egcs ! Showtee :: +usr/lib/.wormie ! Showtee :: +usr/lib/.kinetic ! Showtee :: +usr/lib/liblog.o ! Showtee :: +usr/include/addr.h ! Showtee / Romanian rootkit :: +usr/include/cron.h ! Showtee :: +usr/include/file.h ! Showtee / Romanian rootkit :: +usr/include/syslogs.h ! Showtee / Romanian rootkit :: +usr/include/proc.h ! Showtee / Romanian rootkit :: +usr/include/chk.h ! Showtee :: +usr/sbin/initdl ! Romanian rootkit :: +usr/sbin/xntps ! Romanian rootkit :: + +# Optickit +usr/bin/xchk ! Optickit :: +usr/bin/xsf ! Optickit :: + +# LDP worm +dev/.kork ! LDP Worm :: +bin/.login ! LDP Worm :: +bin/.ps ! LDP Worm :: + +# Telekit +dev/hda06 ! TeLeKit trojan :: +usr/info/libc1.so ! TeleKit trojan :: + +# Tribe bot +dev/wd4 ! Tribe bot :: + +# LRK +dev/ida/.inet ! LRK rootkit ::rootkits/lrk.php +*/bindshell ! LRK rootkit ::rootkits/lrk.php + +# Adore Rootkit +etc/bin/ava ! Adore Rootkit :: +etc/sbin/ava ! Adore Rootkit :: + +# Slapper +tmp/.bugtraq ! Slapper installed :: +tmp/.bugtraq.c ! Slapper installed :: +tmp/.cinik ! Slapper installed :: +tmp/.b ! Slapper installed :: +tmp/httpd ! Slapper installed :: +tmp./update ! Slapper installed :: +tmp/.unlock ! Slapper installed :: +tmp/.font-unix/.cinik ! Slapper installed :: +tmp/.cinik ! Slapper installed :: + +# Scalper +tmp/.uua ! Scalper installed :: +tmp/.a ! Scalper installed :: + +# Knark +proc/knark ! Knark Installed ::rootkits/knark.php +dev/.pizda ! Knark Installed ::rootkits/knark.php +dev/.pula ! Knark Installed ::rootkits/knark.php +dev/.pula ! Knark Installed ::rootkits/knark.php +*/taskhack ! Knark Installed ::rootkits/knark.php +*/rootme ! Knark Installed ::rootkits/knark.php +*/nethide ! Knark Installed ::rootkits/knark.php +*/hidef ! Knark Installed ::rootkits/knark.php +*/ered ! Knark Installed ::rootkits/knark.php + +# Lion worm +dev/.lib ! Lion Worm ::rootkits/lion.php +dev/.lib/1iOn.sh ! Lion Worm ::rootkits/lion.php +bin/mjy ! Lion Worm ::rootkits/lion.php +bin/in.telnetd ! Lion Worm ::rootkits/lion.php +usr/info/torn ! Lion Worm ::rootkits/lion.php +*/1iOn\.sh ! Lion Worm ::rootkits/lion.php + +# Bobkit +usr/include/.../ ! Bobkit Rootkit ::rootkits/bobkit.php +usr/lib/.../ ! Bobkit Rootkit ::rootkits/bobkit.php +usr/sbin/.../ ! Bobkit Rootkit ::rootkits/bobkit.php +usr/bin/ntpsx ! Bobkit Rootkit ::rootkits/bobkit.php +tmp/.bkp ! Bobkit Rootkit ::rootkits/bobkit.php +usr/lib/.bkit- ! Bobkit Rootkit ::rootkits/bobkit.php +*/bkit- ! Bobkit Rootkit ::rootkits/bobkit.php + +# Hidrootkit +var/lib/games/.k ! Hidr00tkit :: + +# Ark +dev/ptyxx ! Ark rootkit :: + +# Mithra Rootkit +usr/lib/locale/uboot ! Mithra`s rootkit :: + +# Optickit +usr/bin/xsf ! OpticKit :: +usr/bin/xchk ! OpticKit :: + +# LOC rookit +tmp/xp ! LOC rookit :: +tmp/kidd0.c ! LOC rookit :: +tmp/kidd0 ! LOC rookit :: + +# TC2 worm +usr/info/.tc2k ! TC2 Worm :: +usr/bin/util ! TC2 Worm :: +usr/sbin/initcheck ! TC2 Worm :: +usr/sbin/ldb ! TC2 Worm :: + +# Anonoiyng rootkit +usr/sbin/mech ! Anonoiyng rootkit :: +usr/sbin/kswapd ! Anonoiyng rootkit :: + +# SuckIt +lib/.x ! SuckIt rootkit :: +*/hide.log ! Suckit rootkit :: +lib/sk ! SuckIT rootkit :: + +# Beastkit +usr/local/bin/bin ! Beastkit rootkit ::rootkits/beastkit.php +usr/man/.man10 ! Beastkit rootkit ::rootkits/beastkit.php +usr/sbin/arobia ! Beastkit rootkit ::rootkits/beastkit.php +usr/lib/elm/arobia ! Beastkit rootkit ::rootkits/beastkit.php +usr/local/bin/.../bktd ! Beastkit rootkit ::rootkits/beastkit.php + +# Tuxkit +dev/tux ! Tuxkit rootkit ::rootkits/Tuxkit.php +usr/bin/xsf ! Tuxkit rootkit ::rootkits/Tuxkit.php +usr/bin/xchk ! Tuxkit rootkit ::rootkits/Tuxkit.php +*/.file ! Tuxkit rootkit ::rootkits/Tuxkit.php +*/.addr ! Tuxkit rootkit ::rootkits/Tuxkit.php + +# Old rootkits +usr/include/rpc/ ../kit ! Old rootkits ::rootkits/Old.php +usr/include/rpc/ ../kit2 ! Old rootkits ::rootkits/Old.php +usr/doc/.sl ! Old rootkits ::rootkits/Old.php +usr/doc/.sp ! Old rootkits ::rootkits/Old.php +usr/doc/.statnet ! Old rootkits ::rootkits/Old.php +usr/doc/.logdsys ! Old rootkits ::rootkits/Old.php +usr/doc/.dpct ! Old rootkits ::rootkits/Old.php +usr/doc/.gifnocfi ! Old rootkits ::rootkits/Old.php +usr/doc/.dnif ! Old rootkits ::rootkits/Old.php +usr/doc/.nigol ! Old rootkits ::rootkits/Old.php + +# Kenga3 rootkit +usr/include/. . ! Kenga3 rootkit + +# ESRK rootkit +usr/lib/tcl5.3 ! ESRK rootkit + +# Fu rootkit +sbin/xc ! Fu rootkit +usr/include/ivtype.h ! Fu rootkit +bin/.lib ! Fu rootkit + +# ShKit rootkit +lib/security/.config ! ShKit rootkit +etc/ld.so.hash ! ShKit rootkit + +# AjaKit rootkit +lib/.ligh.gh ! AjaKit rootkit +lib/.libgh.gh ! AjaKit rootkit +lib/.libgh-gh ! AjaKit rootkit +dev/tux ! AjaKit rootkit +dev/tux/.proc ! AjaKit rootkit +dev/tux/.file ! AjaKit rootkit + +# zaRwT rootkit +bin/imin ! zaRwT rootkit +bin/imout ! zaRwT rootkit + +# Madalin rootkit +usr/include/icekey.h ! Madalin rootkit +usr/include/iceconf.h ! Madalin rootkit +usr/include/iceseed.h ! Madalin rootkit + +# shv5 rootkit XXX http://www.askaboutskating.com/forum/.../shv5/setup +lib/libsh.so ! shv5 rootkit +usr/lib/libsh ! shv5 rootkit + +# BMBL rootkit (http://www.giac.com/practical/GSEC/Steve_Terrell_GSEC.pdf) +etc/.bmbl ! BMBL rootkit +etc/.bmbl/sk ! BMBL rootkit + +# rootedoor rootkit +*/rootedoor ! Rootedoor rootkit + +# 0vason rootkit +*/ovas0n ! ovas0n rootkit ::/rootkits/ovason.php +*/ovason ! ovas0n rootkit ::/rootkits/ovason.php + +# Rpimp reverse telnet +*/rpimp ! rpv21 (Reverse Pimpage)::/rootkits/rpimp.php + +# Cback Linux worm +tmp/cback ! cback worm ::/rootkits/cback.php +tmp/derfiq ! cback worm ::/rootkits/cback.php + +# aPa Kit (from rkhunter) +usr/share/.aPa ! Apa Kit + +# enye-sec Rootkit +etc/.enyelkmHIDE^IT.ko ! enye-sec Rootkit ::/rootkits/enye-sec.php + +# Override Rootkit +dev/grid-hide-pid- ! Override rootkit ::/rootkits/override.php +dev/grid-unhide-pid- ! Override rootkit ::/rootkits/override.php +dev/grid-show-pids ! Override rootkit ::/rootkits/override.php +dev/grid-hide-port- ! Override rootkit ::/rootkits/override.php +dev/grid-unhide-port- ! Override rootkit ::/rootkits/override.php + +# PHALANX rootkit +usr/share/.home* ! PHALANX rootkit :: +usr/share/.home*/tty ! PHALANX rootkit :: +etc/host.ph1 ! PHALANX rootkit :: +bin/host.ph1 ! PHALANX rootkit :: + +# ZK rootkit (http://honeyblog.org/junkyard/reports/redhat-compromise2.pdf) +# and from chkrootkit +usr/share/.zk ! ZK rootkit :: +usr/share/.zk/zk ! ZK rootkit :: +etc/1ssue.net ! ZK rootkit :: +usr/X11R6/.zk ! ZK rootkit :: +usr/X11R6/.zk/xfs ! ZK rootkit :: +usr/X11R6/.zk/echo ! ZK rootkit :: +etc/sysconfig/console/load.zk ! ZK rootkit :: + +# Public sniffers +*/.linux-sniff ! Sniffer log :: +*/sniff-l0g ! Sniffer log :: +*/core_$ ! Sniffer log :: +*/tcp.log ! Sniffer log :: +*/chipsul ! Sniffer log :: +*/beshina ! Sniffer log :: +*/.owned$ | Sniffer log :: + +# Solaris worm - +# http://blogs.sun.com/security/entry/solaris_in_telnetd_worm_seen +var/adm/.profile ! Solaris Worm :: +var/spool/lp/.profile ! Solaris Worm :: +var/adm/sa/.adm ! Solaris Worm :: +var/spool/lp/admins/.lp ! Solaris Worm :: + +# Suspicious files +etc/rc.d/init.d/rc.modules ! Suspicious file ::rootkits/Suspicious.php +lib/ldd.so ! Suspicious file ::rootkits/Suspicious.php +usr/man/muie ! Suspicious file ::rootkits/Suspicious.php +usr/X11R6/include/pain ! Suspicious file ::rootkits/Suspicious.php +usr/bin/sourcemask ! Suspicious file ::rootkits/Suspicious.php +usr/bin/ras2xm ! Suspicious file ::rootkits/Suspicious.php +usr/bin/ddc ! Suspicious file ::rootkits/Suspicious.php +usr/bin/jdc ! Suspicious file ::rootkits/Suspicious.php +usr/sbin/in.telnet ! Suspicious file ::rootkits/Suspicious.php +sbin/vobiscum ! Suspicious file ::rootkits/Suspicious.php +usr/sbin/jcd ! Suspicious file ::rootkits/Suspicious.php +usr/sbin/atd2 ! Suspicious file ::rootkits/Suspicious.php +usr/bin/ishit ! Suspicious file ::rootkits/Suspicious.php +usr/bin/.etc ! Suspicious file ::rootkits/Suspicious.php +usr/bin/xstat ! Suspicious file ::rootkits/Suspicious.php +var/run/.tmp ! Suspicious file ::rootkits/Suspicious.php +usr/man/man1/lib/.lib ! Suspicious file ::rootkits/Suspicious.php +usr/man/man2/.man8 ! Suspicious file ::rootkits/Suspicious.php +var/run/.pid ! Suspicious file ::rootkits/Suspicious.php +lib/.so ! Suspicious file ::rootkits/Suspicious.php +lib/.fx ! Suspicious file ::rootkits/Suspicious.php +lib/lblip.tk ! Suspicious file ::rootkits/Suspicious.php +usr/lib/.fx ! Suspicious file ::rootkits/Suspicious.php +var/local/.lpd ! Suspicious file ::rootkits/Suspicious.php +dev/rd/cdb ! Suspicious file ::rootkits/Suspicious.php +dev/.rd/ ! Suspicious file ::rootkits/Suspicious.php +usr/lib/pt07 ! Suspicious file ::rootkits/Suspicious.php +usr/bin/atm ! Suspicious file ::rootkits/Suspicious.php +tmp/.cheese ! Suspicious file ::rootkits/Suspicious.php +dev/.arctic ! Suspicious file ::rootkits/Suspicious.php +dev/.xman ! Suspicious file ::rootkits/Suspicious.php +dev/.golf ! Suspicious file ::rootkits/Suspicious.php +dev/srd0 ! Suspicious file ::rootkits/Suspicious.php +dev/ptyzx ! Suspicious file ::rootkits/Suspicious.php +dev/ptyzg ! Suspicious file ::rootkits/Suspicious.php +dev/xdf1 ! Suspicious file ::rootkits/Suspicious.php +dev/ttyop ! Suspicious file ::rootkits/Suspicious.php +dev/ttyof ! Suspicious file ::rootkits/Suspicious.php +dev/hd7 ! Suspicious file ::rootkits/Suspicious.php +dev/hdx1 ! Suspicious file ::rootkits/Suspicious.php +dev/hdx2 ! Suspicious file ::rootkits/Suspicious.php +dev/xdf2 ! Suspicious file ::rootkits/Suspicious.php +dev/ptyp ! Suspicious file ::rootkits/Suspicious.php +dev/ptyr ! Suspicious file ::rootkits/Suspicious.php +sbin/pback ! Suspicious file ::rootkits/Suspicious.php +usr/man/man3/psid ! Suspicious file ::rootkits/Suspicious.php +proc/kset ! Suspicious file ::rootkits/Suspicious.php +usr/bin/gib ! Suspicious file ::rootkits/Suspicious.php +usr/bin/snick ! Suspicious file ::rootkits/Suspicious.php +usr/bin/kfl ! Suspicious file ::rootkits/Suspicious.php +tmp/.dump ! Suspicious file ::rootkits/Suspicious.php +var/.x ! Suspicious file ::rootkits/Suspicious.php +var/.x/psotnic ! Suspicious file ::rootkits/Suspicious.php +*/.log ! Suspicious file ::rootkits/Suspicious.php +*/ecmf ! Suspicious file ::rootkits/Suspicious.php +*/mirkforce ! Suspicious file ::rootkits/Suspicious.php +*/mfclean ! Suspicious file ::rootkits/Suspicious.php diff --git a/etc/ruleset/rootcheck/rootkit_trojans.txt b/etc/ruleset/rootcheck/rootkit_trojans.txt new file mode 100644 index 0000000000..3bbeddabba --- /dev/null +++ b/etc/ruleset/rootcheck/rootkit_trojans.txt @@ -0,0 +1,111 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# rootkit_trojans.txt, (C) Daniel B. Cid +# +# Imported from the rootcheck project. +# Some entries taken from the chkrootkit project. +# +# Blank lines and lines starting with '#' are ignored. +# +# Each line must be in the following format: +# file_name !string_to_search!Description + +# Common binaries and public trojan entries +ls !bash|^/bin/sh|dev/[^clu]|\.tmp/lsfile|duarawkz|/prof|/security|file\.h! +env !bash|^/bin/sh|file\.h|proc\.h|/dev/|^/bin/.*sh! +echo !bash|^/bin/sh|file\.h|proc\.h|/dev/[^cl]|^/bin/.*sh! +chown !bash|^/bin/sh|file\.h|proc\.h|/dev/[^cl]|^/bin/.*sh! +chmod !bash|^/bin/sh|file\.h|proc\.h|/dev/[^cl]|^/bin/.*sh! +chgrp !bash|^/bin/sh|file\.h|proc\.h|/dev/[^cl]|^/bin/.*sh! +cat !bash|^/bin/sh|file\.h|proc\.h|/dev/[^cl]|^/bin/.*sh! +bash !proc\.h|/dev/[0-9]|/dev/[hijkz]! +sh !proc\.h|/dev/[0-9]|/dev/[hijkz]! +uname !bash|^/bin/sh|file\.h|proc\.h|^/bin/.*sh! +date !bash|^/bin/sh|file\.h|proc\.h|/dev/[^cln]|^/bin/.*sh! +du !w0rm|/prof|file\.h! +df !bash|^/bin/sh|file\.h|proc\.h|/dev/[^clurdv]|^/bin/.*sh! +login !elite|SucKIT|xlogin|vejeta|porcao|lets_log|sukasuk! +passwd !bash|file\.h|proc\.h|/dev/ttyo|/dev/[A-Z]|/dev/[b-s,uvxz]! +mingetty !bash|Dimensioni|pacchetto! +chfn !bash|file\.h|proc\.h|/dev/ttyo|/dev/[A-Z]|/dev/[a-s,uvxz]! +chsh !bash|file\.h|proc\.h|/dev/ttyo|/dev/[A-Z]|/dev/[a-s,uvxz]! +mail !bash|file\.h|proc\.h|/dev/[^nu]! +su !/dev/[d-s,abuvxz]|/dev/[A-D]|/dev/[F-Z]|/dev/[0-9]|satori|vejeta|conf\.inv! +sudo !satori|vejeta|conf\.inv! +crond !/dev/[^nt]|bash! +gpm !bash|mingetty! +ifconfig !bash|^/bin/sh|/dev/tux|session.null|/dev/[^cludisopt]! +diff !bash|^/bin/sh|file\.h|proc\.h|/dev/[^n]|^/bin/.*sh! +md5sum !bash|^/bin/sh|file\.h|proc\.h|/dev/|^/bin/.*sh! +hdparm !bash|/dev/ida! +ldd !/dev/[^n]|proc\.h|libshow.so|libproc.a! + +# Trojan entries for troubleshooting binaries +grep !bash|givemer! +egrep !bash|^/bin/sh|file\.h|proc\.h|/dev/|^/bin/.*sh! +find !bash|/dev/[^tnlcs]|/prof|/home/virus|file\.h! +lsof !/prof|/dev/[^apcmnfk]|proc\.h|bash|^/bin/sh|/dev/ttyo|/dev/ttyp! +netstat !bash|^/bin/sh|/dev/[^aik]|/prof|grep|addr\.h! +top !/dev/[^npi3st%]|proc\.h|/prof/! +ps !/dev/ttyo|\.1proc|proc\.h|bash|^/bin/sh! +tcpdump !bash|^/bin/sh|file\.h|proc\.h|/dev/[^bu]|^/bin/.*sh! +pidof !bash|^/bin/sh|file\.h|proc\.h|/dev/[^f]|^/bin/.*sh! +fuser !bash|^/bin/sh|file\.h|proc\.h|/dev/[a-dtz]|^/bin/.*sh! +w !uname -a|proc\.h|bash! + +# Trojan entries for common daemons +sendmail !bash|fuck! +named !bash|blah|/dev/[0-9]|^/bin/sh! +inetd !bash|^/bin/sh|file\.h|proc\.h|/dev/[^un%]|^/bin/.*sh! +apachectl !bash|^/bin/sh|file\.h|proc\.h|/dev/[^n]|^/bin/.*sh! +sshd !check_global_passwd|panasonic|satori|vejeta|\.ark|/hash\.zk|bash|/dev[a-s]|/dev[A-Z]/! +syslogd !bash|/usr/lib/pt07|/dev/[^cln]]|syslogs\.h|proc\.h! +xinetd !bash|file\.h|proc\.h! +in.telnetd !cterm100|vt350|VT100|ansi-term|bash|^/bin/sh|/dev[A-R]|/dev/[a-z]/! +in.fingerd !bash|^/bin/sh|cterm100|/dev/! +identd !bash|^/bin/sh|file\.h|proc\.h|/dev/[^n]|^/bin/.*sh! +init !bash|/dev/h +tcpd !bash|proc\.h|p1r0c4|hack|/dev/[^n]! +rlogin !p1r0c4|r00t|bash|/dev/[^nt]! + +# Kill trojan +killall !/dev/[^t%]|proc\.h|bash|tmp! +kill !/dev/[ab,d-k,m-z]|/dev/[F-Z]|/dev/[A-D]|/dev/[0-9]|proc\.h|bash|tmp! + +# Rootkit entries +/etc/rc.d/rc.sysinit !enyelkmHIDE! enye-sec Rootkit + +# ZK rootkit (http://honeyblog.org/junkyard/reports/redhat-compromise2.pdf) +/etc/sysconfig/console/load.zk !/bin/sh! ZK rootkit +/etc/sysconfig/console/load.zk !usr/bin/run! ZK rootkit + +# Modified /etc/hosts entries +# Idea taken from: +# http://blog.tenablesecurity.com/2006/12/detecting_compr.html +# http://www.sophos.com/security/analyses/trojbagledll.html +# http://www.f-secure.com/v-descs/fantibag_b.shtml +/etc/hosts !^[^#]*avp\.ch!Anti-virus site on the hosts file +/etc/hosts !^[^#]*avp\.ru!Anti-virus site on the hosts file +/etc/hosts !^[^#]*awaps\.net! Anti-virus site on the hosts file +/etc/hosts !^[^#]*ca\.com! Anti-virus site on the hosts file +/etc/hosts !^[^#]*mcafee\.com! Anti-virus site on the hosts file +/etc/hosts !^[^#]*microsoft\.com! Anti-virus site on the hosts file +/etc/hosts !^[^#]*f-secure\.com! Anti-virus site on the hosts file +/etc/hosts !^[^#]*sophos\.com! Anti-virus site on the hosts file +/etc/hosts !^[^#]*symantec\.com! Anti-virus site on the hosts file +/etc/hosts !^[^#]*my-etrust\.com! Anti-virus site on the hosts file +/etc/hosts !^[^#]*nai\.com! Anti-virus site on the hosts file +/etc/hosts !^[^#]*networkassociates\.com! Anti-virus site on the hosts file +/etc/hosts !^[^#]*viruslist\.ru! Anti-virus site on the hosts file +/etc/hosts !^[^#]*kaspersky! Anti-virus site on the hosts file +/etc/hosts !^[^#]*symantecliveupdate\.com! Anti-virus site on the hosts file +/etc/hosts !^[^#]*grisoft\.com! Anti-virus site on the hosts file +/etc/hosts !^[^#]*clamav\.net! Anti-virus site on the hosts file +/etc/hosts !^[^#]*bitdefender\.com! Anti-virus site on the hosts file +/etc/hosts !^[^#]*antivirus\.com! Anti-virus site on the hosts file +/etc/hosts !^[^#]*sans\.org! Security site on the hosts file diff --git a/etc/ruleset/rootcheck/system_audit_rcl.txt b/etc/ruleset/rootcheck/system_audit_rcl.txt new file mode 100644 index 0000000000..e5586ce322 --- /dev/null +++ b/etc/ruleset/rootcheck/system_audit_rcl.txt @@ -0,0 +1,102 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Linux Audit - (C) 2007 Daniel B. Cid - dcid@ossec.net +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://www.gnu.org/licenses/gpl.html +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - p (process running) +# - d (any file inside the directory) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + +$php.ini=/etc/php.ini,/var/www/conf/php.ini,/etc/php5/apache2/php.ini; +$web_dirs=/var/www,/var/htdocs,/home/httpd,/usr/local/apache,/usr/local/apache2,/usr/local/www; + +# PHP checks +[PHP - Register globals are enabled] [any] [] +f:$php.ini -> r:^register_globals = On; + +# PHP checks +[PHP - Expose PHP is enabled] [any] [] +f:$php.ini -> r:^expose_php = On; + +# PHP checks +[PHP - Allow URL fopen is enabled] [any] [] +f:$php.ini -> r:^allow_url_fopen = On; + +# PHP checks +[PHP - Displaying of errors is enabled] [any] [] +f:$php.ini -> r:^display_errors = On; + +# PHP checks - consider open_basedir && disable_functions + + +## Looking for common web exploits (might indicate that you are owned). +## Using http://dcid.me/blog/logsamples/webattacks_links as a reference. +#[Web exploits - Possible compromise] [any] [] +#d:$web_dirs -> .txt$ -> r:^ ^.yop$; + +[Web exploits (uncommon file name inside htdocs) - Possible compromise {PCI_DSS: 6.5, 6.6, 11.4}] [any] [] +d:$web_dirs -> ^id$; + +[Web exploits (uncommon file name inside htdocs) - Possible compromise {PCI_DSS: 6.5, 6.6, 11.4}] [any] [] +d:$web_dirs -> ^.ssh$; + +[Web exploits (uncommon file name inside htdocs) - Possible compromise {PCI_DSS: 6.5, 6.6, 11.4}] [any] [] +d:$web_dirs -> ^...$; + +[Web exploits (uncommon file name inside htdocs) - Possible compromise {PCI_DSS: 6.5, 6.6, 11.4}] [any] [] +d:$web_dirs -> ^.shell$; + +## Looking for outdated Web applications +## Taken from http://sucuri.net/latest-versions +[Web vulnerability - Outdated WordPress installation {PCI_DSS: 6.5, 6.6, 11.4}] [any] [http://sucuri.net/latest-versions] +d:$web_dirs -> ^version.php$ -> r:^\.wp_version && >:$wp_version = '4.4.2'; + +[Web vulnerability - Outdated Joomla installation {PCI_DSS: 6.5, 6.6, 11.4}] [any] [http://sucuri.net/latest-versions] +d:$web_dirs -> ^version.php$ -> r:var \.RELEASE && r:'3.4.8'; + +[Web vulnerability - Outdated osCommerce (v2.2) installation {PCI_DSS: 6.5, 6.6, 11.4}] [any] [http://sucuri.net/latest-versions] +d:$web_dirs -> ^application_top.php$ -> r:'osCommerce 2.2-; + +## Looking for known backdoors +[Web vulnerability - Backdoors / Web based malware found - eval(base64_decode) {PCI_DSS: 6.5, 6.6, 11.4}] [any] [] +d:$web_dirs -> .php$ -> r:eval\(base64_decode\(\paWYo; + +[Web vulnerability - Backdoors / Web based malware found - eval(base64_decode(POST)) {PCI_DSS: 6.5, 6.6, 11.4}] [any] [] +d:$web_dirs -> .php$ -> r:eval\(base64_decode\(\S_POST; + +[Web vulnerability - .htaccess file compromised {PCI_DSS: 6.5, 6.6, 11.4}] [any] [http://blog.sucuri.net/2011/05/understanding-htaccess-attacks-part-1.html] +d:$web_dirs -> ^.htaccess$ -> r:RewriteCond \S+HTTP_REFERERS \S+google; + +[Web vulnerability - .htaccess file compromised - auto append {PCI_DSS: 6.5, 6.6, 11.4}] [any] [http://blog.sucuri.net/2011/05/understanding-htaccess-attacks-part-1.html] +d:$web_dirs -> ^.htaccess$ -> r:php_value auto_append_file; diff --git a/etc/ruleset/rootcheck/system_audit_ssh.txt b/etc/ruleset/rootcheck/system_audit_ssh.txt new file mode 100644 index 0000000000..558bb17dea --- /dev/null +++ b/etc/ruleset/rootcheck/system_audit_ssh.txt @@ -0,0 +1,75 @@ +# SSH Rootcheck +# +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# + + +$sshd_file=/etc/ssh/sshd_config; + + +# Listen PORT != 22 +# The option Port specifies on which port number ssh daemon listens for incoming connections. +# Changing the default port you may reduce the number of successful attacks from zombie bots, an attacker or bot doing port-scanning can quickly identify your SSH port. +[SSH Hardening - 1: Port 22 {PCI_DSS: 2.2.4}] [any] [1] +f:$sshd_file -> !r:^# && r:Port\.+22; + + +# Protocol 2 +# The Protocol parameter dictates which version of the SSH communication and encryption protocols are in use. +# Version 1 of the SSH protocol has weaknesses. +[SSH Hardening - 2: Protocol 1 {PCI_DSS: 2.2.4}] [any] [2] +f:$sshd_file -> !r:^# && r:Protocol\.+1; + + +# PermitRootLogin no +# The option PermitRootLogin specifies whether root can log in using ssh. +# If you want log in as root, you should use the option "Match" and restrict it to a few IP addresses. +[SSH Hardening - 3: Root can log in] [any] [3] +f:$sshd_file -> !r:^\s*PermitRootLogin\.+no; + + +# PubkeyAuthentication yes +# Access only by public key +# Generally people will use weak passwords and have poor password practices. Keys are considered stronger than password. +[SSH Hardening - 4: No Public Key authentication {PCI_DSS: 2.2.4}] [any] [4] +f:$sshd_file -> !r:^\s*PubkeyAuthentication\.+yes; + + +# PasswordAuthentication no +# The option PasswordAuthentication specifies whether we should use password-based authentication. +# Use public key authentication instead of passwords +[SSH Hardening - 5: Password Authentication {PCI_DSS: 2.2.4}] [any] [5] +f:$sshd_file -> !r:^\s*PasswordAuthentication\.+no; + + +# PermitEmptyPasswords no +# The option PermitEmptyPasswords specifies whether the server allows logging in to accounts with a null password +# Accounts with null passwords are a bad practice. +[SSH Hardening - 6: Empty passwords allowed {PCI_DSS: 2.2.4}] [any] [6] +f:$sshd_file -> !r:^\s*PermitEmptyPasswords\.+no; + + +# IgnoreRhosts yes +# The option IgnoreRhosts specifies whether rhosts or shosts files should not be used in authentication. +# For security reasons it is recommended to no use rhosts or shosts files for authentication. +[SSH Hardening - 7: Rhost or shost used for authentication {PCI_DSS: 2.2.4}] [any] [7] +f:$sshd_file -> !r:^\s*IgnoreRhosts\.+yes; + + +# LoginGraceTime 30 +# The option LoginGraceTime specifies how long in seconds after a connection request the server will wait before disconnecting if the user has not successfully logged in. +# 30 seconds is the recommended time for avoiding open connections without authenticate +[SSH Hardening - 8: Wrong Grace Time {PCI_DSS: 2.2.4}] [any] [8] +f:$sshd_file -> !r:^\s*LoginGraceTime\s+30\s*$; + + +# MaxAuthTries 4 +# The MaxAuthTries parameter specifices the maximum number of authentication attempts permitted per connection. Once the number of failures reaches half this value, additional failures are logged. +# This should be set to 4. +[SSH Hardening - 9: Wrong Maximum number of authentication attempts {PCI_DSS: 2.2.4}] [any] [9] +f:$sshd_file -> !r:^\s*MaxAuthTries\s+4\s*$; diff --git a/etc/ruleset/rootcheck/win_applications_rcl.txt b/etc/ruleset/rootcheck/win_applications_rcl.txt new file mode 100644 index 0000000000..01e5af4304 --- /dev/null +++ b/etc/ruleset/rootcheck/win_applications_rcl.txt @@ -0,0 +1,135 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Application detection - (C) 2007 Daniel B. Cid - dcid@ossec.net +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://www.gnu.org/licenses/gpl.html +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - r (registry entry) +# - p (process running) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + +[Chat/IM/VoIP - Skype {PCI_DSS: 10.6.1}] [any] [] +f:\Program Files\Skype\Phone; +f:\Documents and Settings\All Users\Documents\My Skype Pictures; +f:\Documents and Settings\Skype; +f:\Documents and Settings\All Users\Start Menu\Programs\Skype; +r:HKLM\SOFTWARE\Skype; +r:HKEY_LOCAL_MACHINE\Software\Policies\Skype; +p:r:Skype.exe; + +[Chat/IM - Yahoo {PCI_DSS: 10.6.1}] [any] [] +f:\Documents and Settings\All Users\Start Menu\Programs\Yahoo! Messenger; +r:HKLM\SOFTWARE\Yahoo; + +[Chat/IM - ICQ {PCI_DSS: 10.6.1}] [any] [] +r:HKEY_CURRENT_USER\Software\Mirabilis\ICQ; + +[Chat/IM - AOL {PCI_DSS: 10.6.1}] [any] [http://www.aol.com] +r:HKEY_LOCAL_MACHINE\SOFTWARE\America Online\AOL Instant Messenger; +r:HKEY_CLASSES_ROOT\aim\shell\open\command; +r:HKEY_CLASSES_ROOT\AIM.Protocol; +r:HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/x-aim; +f:\Program Files\AIM95; +p:r:aim.exe; + +[Chat/IM - MSN {PCI_DSS: 10.6.1}] [any] [http://www.msn.com] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSNMessenger; +r:HKEY_CURRENT_USER\SOFTWARE\Microsoft\MSNMessenger; +f:\Program Files\MSN Messenger; +f:\Program Files\Messenger; +p:r:msnmsgr.exe; + +[Chat/IM - ICQ {PCI_DSS: 10.6.1}] [any] [http://www.icq.com] +r:HKLM\SOFTWARE\Mirabilis\ICQ; + +[P2P - UTorrent {PCI_DSS: 10.6.1}] [any] [] +p:r:utorrent.exe; + +[P2P - LimeWire {PCI_DSS: 11.4}] [any] [] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Limewire; +r:HKLM\software\microsoft\windows\currentversion\run -> limeshop; +f:\Program Files\limewire; +f:\Program Files\limeshop; + +[P2P/Adware - Kazaa {PCI_DSS: 11.4}] [any] [] +f:\Program Files\kazaa; +f:\Documents and Settings\All Users\Start Menu\Programs\kazaa; +f:\Documents and Settings\All Users\DESKTOP\Kazaa Media Desktop.lnk; +f:\Documents and Settings\All Users\DESKTOP\Kazaa Promotions.lnk; +f:%WINDIR%\System32\Cd_clint.dll; +f:%WINDIR%\Sysnative\Cd_clint.dll; +r:HKEY_LOCAL_MACHINE\SOFTWARE\KAZAA; +r:HKEY_CURRENT_USER\SOFTWARE\KAZAA; +r:HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN\KAZAA; + +# http://vil.nai.com/vil/content/v_135023.htm +[Adware - RxToolBar {PCI_DSS: 11.4}] [any] [http://vil.nai.com/vil/content/v_135023.htm] +r:HKEY_CURRENT_USER\Software\Infotechnics; +r:HKEY_CURRENT_USER\Software\Infotechnics\RX Toolbar; +r:HKEY_CURRENT_USER\Software\RX Toolbar; +r:HKEY_CLASSES_ROOT\BarInfoUrl.TBInfo; +r:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\RX Toolbar; +f:\Program Files\RXToolBar; + +# http://btfaq.com/serve/cache/18.html +[P2P - BitTorrent {PCI_DSS: 10.6.1}] [any] [http://btfaq.com/serve/cache/18.html] +f:\Program Files\BitTorrent; +r:HKEY_CLASSES_ROOT\.torrent; +r:HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/x-bittorrent; +r:HKEY_CLASSES_ROOT\bittorrent; +r:HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\BitTorrent; + +# http://www.gotomypc.com +[Remote Access - GoToMyPC {PCI_DSS: 10.6.1}] [any] [] +f:\Program Files\Citrix\GoToMyPC; +f:\Program Files\Citrix\GoToMyPC\g2svc.exe; +f:\Program Files\Citrix\GoToMyPC\g2comm.exe; +f:\Program Files\expertcity\GoToMyPC; +r:HKLM\software\microsoft\windows\currentversion\run -> gotomypc; +r:HKEY_LOCAL_MACHINE\software\citrix\gotomypc; +r:HKEY_LOCAL_MACHINE\system\currentcontrolset\services\gotomypc; +p:r:g2svc.exe; +p:r:g2pre.exe; + +[Spyware - Twain Tec Spyware {PCI_DSS: 11.4}] [any] [] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Classes\TwaintecDll.TwaintecDllObj.1; +r:HKEY_LOCAL_MACHINE\SOFTWARE\twaintech; +f:%WINDIR%\twaintec.dll; + +# http://www.symantec.com/security_response/writeup.jsp?docid=2004-062611-4548-99&tabid=2 +[Spyware - SpyBuddy {PCI_DSS: 11.4}] [any] [] +f:\Program Files\ExploreAnywhere\SpyBuddy\sb32mon.exe; +f:\Program Files\ExploreAnywhere\SpyBuddy; +f:\Program Files\ExploreAnywhere; +f:%WINDIR%\System32\sysicept.dll; +f:%WINDIR%\Sysnative\sysicept.dll; +r:HKEY_LOCAL_MACHINE\Software\ExploreAnywhere Software\SpyBuddy; + +[Spyware - InternetOptimizer {PCI_DSS: 11.4}] [any] [] +r:HKLM\SOFTWARE\Avenue Media; +r:HKEY_CLASSES_ROOT\\safesurfinghelper.iebho.1; +r:HKEY_CLASSES_ROOT\\safesurfinghelper.iebho; diff --git a/etc/ruleset/rootcheck/win_audit_rcl.txt b/etc/ruleset/rootcheck/win_audit_rcl.txt new file mode 100644 index 0000000000..afdc7a0319 --- /dev/null +++ b/etc/ruleset/rootcheck/win_audit_rcl.txt @@ -0,0 +1,82 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Windows Audit - (C) 2007 Daniel B. Cid - dcid@ossec.net +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://www.gnu.org/licenses/gpl.html +# +# [Application name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - r (registry entry) +# - p (process running) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# Values can be preceded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + +# http://technet2.microsoft.com/windowsserver/en/library/486896ba-dfa1-4850-9875-13764f749bba1033.mspx?mfr=true +[Disabled Registry tools set {PCI_DSS: 10.6.1}] [any] [] +r:HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableRegistryTools -> 1; +r:HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableRegistryTools -> 1; + +# http://support.microsoft.com/kb/825750 +[DCOM disabled {PCI_DSS: 10.6.1}] [any] [] +r:HKEY_LOCAL_MACHINE\Software\Microsoft\OLE -> EnableDCOM -> N; + +# http://web.mit.edu/is/topics/windows/server/winmitedu/security.html +[LM authentication allowed (weak passwords) {PCI_DSS: 10.6.1, 11.4}] [any] [] +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA -> LMCompatibilityLevel -> 0; +r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA -> LMCompatibilityLevel -> 1; + +# http://research.eeye.com/html/alerts/AL20060813.html +# Disabled by some Malwares (sometimes by McAfee and Symantec +# security center too). +[Firewall/Anti Virus notification disabled {PCI_DSS: 10.6.1}] [any] [] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center -> FirewallDisableNotify -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center -> antivirusoverride -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center -> firewalldisablenotify -> !0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center -> firewalldisableoverride -> !0; + +# Checking for the microsoft firewall. +[Microsoft Firewall disabled {PCI_DSS: 10.6.1, 1.4}] [all] [] +r:HKEY_LOCAL_MACHINE\software\policies\microsoft\windowsfirewall\domainprofile -> enablefirewall -> 0; +r:HKEY_LOCAL_MACHINE\software\policies\microsoft\windowsfirewall\standardprofile -> enablefirewall -> 0; + +#http://web.mit.edu/is/topics/windows/server/winmitedu/security.html +[Null sessions allowed {PCI_DSS: 11.4}] [any] [] +r:HKLM\System\CurrentControlSet\Control\Lsa -> RestrictAnonymous -> 0; + +[Error reporting disabled {PCI_DSS: 10.6.1}] [any] [http://windowsir.blogspot.com/2007/04/something-new-to-look-for.html] +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealth\ErrorReporting -> DoReport -> 0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealth\ErrorReporting -> IncludeKernelFaults -> 0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealth\ErrorReporting -> IncludeMicrosoftApps -> 0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealth\ErrorReporting -> IncludeWindowsApps -> 0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealth\ErrorReporting -> IncludeShutdownErrs -> 0; +r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealth\ErrorReporting -> ShowUI -> 0; + +# http://support.microsoft.com/default.aspx?scid=315231 +[Automatic Logon enabled {PCI_DSS: 10.6.1}] [any] [http://support.microsoft.com/default.aspx?scid=315231] +r:HKLM\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon -> DefaultPassword; +r:HKLM\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon -> AutoAdminLogon -> 1; + +[Winpcap packet filter driver found {PCI_DSS: 10.6.1}] [any] [] +f:%WINDIR%\System32\drivers\npf.sys; +f:%WINDIR%\Sysnative\drivers\npf.sys; diff --git a/etc/ruleset/rootcheck/win_malware_rcl.txt b/etc/ruleset/rootcheck/win_malware_rcl.txt new file mode 100644 index 0000000000..cd65c21bd3 --- /dev/null +++ b/etc/ruleset/rootcheck/win_malware_rcl.txt @@ -0,0 +1,176 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# OSSEC Windows Malware list - (C) 2007 Daniel B. Cid - dcid@ossec.net +# +# Released under the same license as OSSEC. +# More details at the LICENSE file included with OSSEC or online +# at: https://www.gnu.org/licenses/gpl.html +# +# [Malware name] [any or all] [reference] +# type:; +# +# Type can be: +# - f (for file or directory) +# - r (registry entry) +# - p (process running) +# +# Additional values: +# For the registry and for directories, use "->" to look for a specific entry and another +# "->" to look for the value. +# Also, use " -> r:^\. -> ..." to search all files in a directory +# For files, use "->" to look for a specific value in the file. +# +# # Values can be preceded by: =: (for equal) - default +# r: (for ossec regexes) +# >: (for strcmp greater) +# <: (for strcmp lower) +# Multiple patterns can be specified by using " && " between them. +# (All of them must match for it to return true). + +# http://www.iss.net/threats/ginwui.html +[Ginwui Backdoor {PCI_DSS: 11.4}] [any] [http://www.iss.net/threats/ginwui.html] +f:%WINDIR%\System32\zsyhide.dll; +f:%WINDIR%\Sysnative\zsyhide.dll; +f:%WINDIR%\System32\zsydll.dll; +f:%WINDIR%\Sysnative\zsydll.dll; +r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Notify\zsydll; +r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows -> AppInit_DLLs -> r:zsyhide.dll; + +# http://www.symantec.com/security_response/writeup.jsp?docid=2006-081312-3302-99&tabid=2 +[Wargbot Backdoor {PCI_DSS: 11.4}] [any] [] +f:%WINDIR%\System32\wgareg.exe; +f:%WINDIR%\Sysnative\wgareg.exe; +r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\wgareg; + +# http://www.f-prot.com/virusinfo/descriptions/sober_j.html +[Sober Worm {PCI_DSS: 11.4}] [any] [] +f:%WINDIR%\System32\nonzipsr.noz; +f:%WINDIR%\Sysnative\nonzipsr.noz; +f:%WINDIR%\System32\clonzips.ssc; +f:%WINDIR%\Sysnative\clonzips.ssc; +f:%WINDIR%\System32\clsobern.isc; +f:%WINDIR%\Sysnative\clsobern.isc; +f:%WINDIR%\System32\sb2run.dii; +f:%WINDIR%\Sysnative\sb2run.dii; +f:%WINDIR%\System32\winsend32.dal; +f:%WINDIR%\Sysnative\winsend32.dal; +f:%WINDIR%\System32\winroot64.dal; +f:%WINDIR%\Sysnative\winroot64.dal; +f:%WINDIR%\System32\zippedsr.piz; +f:%WINDIR%\Sysnative\zippedsr.piz; +f:%WINDIR%\System32\winexerun.dal; +f:%WINDIR%\Sysnative\winexerun.dal; +f:%WINDIR%\System32\winmprot.dal; +f:%WINDIR%\Sysnative\winmprot.dal; +f:%WINDIR%\System32\dgssxy.yoi; +f:%WINDIR%\Sysnative\dgssxy.yoi; +f:%WINDIR%\System32\cvqaikxt.apk; +f:%WINDIR%\Sysnative\cvqaikxt.apk; +f:%WINDIR%\System32\sysmms32.lla; +f:%WINDIR%\Sysnative\sysmms32.lla; +f:%WINDIR%\System32\Odin-Anon.Ger; +f:%WINDIR%\Sysnative\Odin-Anon.Ger; + +# http://www.symantec.com/security_response/writeup.jsp?docid=2005-042611-0148-99&tabid=2 +[Hotword Trojan {PCI_DSS: 11.4}] [any] [] +f:%WINDIR%\System32\_; +f:%WINDIR%\Sysnative\_; +f:%WINDIR%\System32\explore.exe; +f:%WINDIR%\Sysnative\explore.exe; +f:%WINDIR%\System32\ svchost.exe; +f:%WINDIR%\Sysnative\ svchost.exe; +f:%WINDIR%\System32\mmsystem.dlx; +f:%WINDIR%\Sysnative\mmsystem.dlx; +f:%WINDIR%\System32\WINDLL-ObjectsWin*.DLX; +f:%WINDIR%\Sysnative\WINDLL-ObjectsWin*.DLX; +f:%WINDIR%\System32\CFXP.DRV; +f:%WINDIR%\Sysnative\CFXP.DRV; +f:%WINDIR%\System32\CHJO.DRV; +f:%WINDIR%\Sysnative\CHJO.DRV; +f:%WINDIR%\System32\MMSYSTEM.DLX; +f:%WINDIR%\Sysnative\MMSYSTEM.DLX; +f:%WINDIR%\System32\OLECLI.DL; +f:%WINDIR%\Sysnative\OLECLI.DL; + +[Beagle worm {PCI_DSS: 11.4}] [any] [] +f:%WINDIR%\System32\winxp.exe; +f:%WINDIR%\Sysnative\winxp.exe; +f:%WINDIR%\System32\winxp.exeopen; +f:%WINDIR%\Sysnative\winxp.exeopen; +f:%WINDIR%\System32\winxp.exeopenopen; +f:%WINDIR%\Sysnative\winxp.exeopenopen; +f:%WINDIR%\System32\winxp.exeopenopenopen; +f:%WINDIR%\Sysnative\winxp.exeopenopenopen; +f:%WINDIR%\System32\winxp.exeopenopenopenopen; +f:%WINDIR%\Sysnative\winxp.exeopenopenopenopen; + +# http://symantec.com/security_response/writeup.jsp?docid=2007-071711-3132-99 +[Gpcoder Trojan {PCI_DSS: 11.4}] [any] [http://symantec.com/security_response/writeup.jsp?docid=2007-071711-3132-99] +f:%WINDIR%\System32\ntos.exe; +f:%WINDIR%\Sysnative\ntos.exe; +f:%WINDIR%\System32\wsnpoem; +f:%WINDIR%\Sysnative\wsnpoem; +f:%WINDIR%\System32\wsnpoem\audio.dll; +f:%WINDIR%\Sysnative\wsnpoem\audio.dll; +f:%WINDIR%\System32\wsnpoem\video.dll; +f:%WINDIR%\Sysnative\wsnpoem\video.dll; +r:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run -> userinit -> r:ntos.exe; + +# [http://www.symantec.com/security_response/writeup.jsp?docid=2006-112813-0222-99&tabid=2 +[Looked.BK Worm {PCI_DSS: 11.4}] [any] [] +f:%WINDIR%\uninstall\rundl132.exe; +f:%WINDIR%\Logo1_.exe; +f:%Windir%\RichDll.dll; +r:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run -> load -> r:rundl132.exe; + +[Possible Malware - Svchost running outside system32 {PCI_DSS: 11.4}] [all] [] +p:r:svchost.exe && !%WINDIR%\System32\svchost.exe; +f:!%WINDIR%\SysWOW64; + +[Possible Malware - Inetinfo running outside system32\inetsrv {PCI_DSS: 11.4}] [all] [] +p:r:inetinfo.exe && !%WINDIR%\System32\inetsrv\inetinfo.exe; +f:!%WINDIR%\SysWOW64; + +[Possible Malware - Rbot/Sdbot detected {PCI_DSS: 11.4}] [any] [] +f:%Windir%\System32\rdriv.sys; +f:%Windir%\Sysnative\rdriv.sys; +f:%Windir%\lsass.exe; + +[Possible Malware File {PCI_DSS: 11.4}] [any] [] +f:%WINDIR%\utorrent.exe; +f:%WINDIR%\System32\utorrent.exe; +f:%WINDIR%\Sysnative\utorrent.exe; +f:%WINDIR%\System32\Files32.vxd; +f:%WINDIR%\Sysnative\Files32.vxd; + +# Modified /etc/hosts entries +# Idea taken from: +# http://blog.tenablesecurity.com/2006/12/detecting_compr.html +# http://www.sophos.com/security/analyses/trojbagledll.html +# http://www.f-secure.com/v-descs/fantibag_b.shtml +[Anti-virus site on the hosts file] [any] [] +f:%WINDIR%\System32\Drivers\etc\HOSTS -> r:avp.ch|avp.ru|nai.com; +f:%WINDIR%\Sysnative\Drivers\etc\HOSTS -> r:avp.ch|avp.ru|nai.com; +f:%WINDIR%\System32\Drivers\etc\HOSTS -> r:awaps.net|ca.com|mcafee.com; +f:%WINDIR%\Sysnative\Drivers\etc\HOSTS -> r:awaps.net|ca.com|mcafee.com; +f:%WINDIR%\System32\Drivers\etc\HOSTS -> r:microsoft.com|f-secure.com; +f:%WINDIR%\Sysnative\Drivers\etc\HOSTS -> r:microsoft.com|f-secure.com; +f:%WINDIR%\System32\Drivers\etc\HOSTS -> r:sophos.com|symantec.com; +f:%WINDIR%\Sysnative\Drivers\etc\HOSTS -> r:sophos.com|symantec.com; +f:%WINDIR%\System32\Drivers\etc\HOSTS -> r:my-etrust.com|viruslist.ru; +f:%WINDIR%\Sysnative\Drivers\etc\HOSTS -> r:my-etrust.com|viruslist.ru; +f:%WINDIR%\System32\Drivers\etc\HOSTS -> r:networkassociates.com; +f:%WINDIR%\Sysnative\Drivers\etc\HOSTS -> r:networkassociates.com; +f:%WINDIR%\System32\Drivers\etc\HOSTS -> r:kaspersky|grisoft.com; +f:%WINDIR%\Sysnative\Drivers\etc\HOSTS -> r:kaspersky|grisoft.com; +f:%WINDIR%\System32\Drivers\etc\HOSTS -> r:symantecliveupdate.com; +f:%WINDIR%\Sysnative\Drivers\etc\HOSTS -> r:symantecliveupdate.com; +f:%WINDIR%\System32\Drivers\etc\HOSTS -> r:clamav.net|bitdefender.com; +f:%WINDIR%\Sysnative\Drivers\etc\HOSTS -> r:clamav.net|bitdefender.com; +f:%WINDIR%\System32\Drivers\etc\HOSTS -> r:antivirus.com|sans.org; +f:%WINDIR%\Sysnative\Drivers\etc\HOSTS -> r:antivirus.com|sans.org; diff --git a/etc/ruleset/sca/almalinux/cis_alma_linux_8.yml b/etc/ruleset/sca/almalinux/cis_alma_linux_8.yml new file mode 100644 index 0000000000..4e96f528d2 --- /dev/null +++ b/etc/ruleset/sca/almalinux/cis_alma_linux_8.yml @@ -0,0 +1,4598 @@ +# Security Configuration Assessment +# CIS Checks for Alma Linux 8 +# Copyright (C) 2023, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Alma Linux 8 Benchmark v2.0.0 - 05-31-2022 + +policy: + id: "cis_alma_linux_8" + file: "cis_alma_linux_8.yml" + name: "CIS Alma Linux 8 Benchmark v2.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Alma Linux 8 systems running on x86 and x64 platforms. This document was tested against Alma Linux 8." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Alma Linux platform." + description: "Requirements for running the policy against Alma Linux 8." + condition: any + rules: + - "f:/etc/redhat-release -> r:^AlmaLinux && r:release 8" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # 1.1.1.1 Ensure mounting of cramfs filesystems is disabled. (Automated) + - id: 32000 + title: "Ensure mounting of cramfs filesystems is disabled." + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf with a line that reads install cramfs /bin/false and a line the reads blacklist cramfs. Example: # printf "install cramfs /bin/false blacklist cramfs " >> /etc/modprobe.d/cramfs.conf Run the following command to unload the cramfs module: # modprobe -r cramfs.' + compliance: + - cis: ["1.1.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:modprobe -n -v cramfs -> r:^\s*\t*install\s*\t*/bin/false' + - "not c:lsmod -> r:cramfs" + - 'd:/etc/modprobe.d -> r:\.+ -> r:^\s*\t*blacklist\s*cramfs' + + # 1.1.1.2 Ensure mounting of squashfs filesystems is disabled. (Automated) + - id: 32001 + title: "Ensure mounting of squashfs filesystems is disabled." + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: 'As Snap packages utilizes squashfs as a compressed filesystem, disabling squashfs will cause Snap packages to fail. Snap application packages of software are self-contained and work across a range of Linux distributions. This is unlike traditional Linux package management approaches, like APT or RPM, which require specifically adapted packages per Linux distribution on an application update and delay therefore application deployment from developers to their software''s end-user. Snaps themselves have no dependency on any external store ("App store"), can be obtained from any source and can be therefore used for upstream software deployment.' + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf with the lines that reads install squashfs /bin/false and blacklist squashfs. Example: # printf "install squashfs /bin/false blacklist squashfs " >> /etc/modprobe.d/squashfs.conf Run the following command to unload the squashfs module: # modprobe -r squashfs.' + compliance: + - cis: ["1.1.1.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:modprobe -n -v squashfs -> r:^\s*\t*install\s*\t*/bin/false' + - "not c:lsmod -> r:squashfs" + - 'd:/etc/modprobe.d -> r:\.+ -> r:^\s*\t*blacklist\s*squashfs' + + # 1.1.1.3 Ensure mounting of udf filesystems is disabled. (Automated) + - id: 32002 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: "Microsoft Azure requires the usage of udf. udf should not be disabled on systems run on Microsoft Azure." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf with a line that reads install udf /bin/false. Example: # printf "install udf /bin/false blacklist udf " >> /etc/modprobe.d/udf.conf Run the following command to unload the udf module: # modprobe -r udf.' + compliance: + - cis: ["1.1.1.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:modprobe -n -v udf -> r:^\s*\t*install\s*\t*/bin/false' + - "not c:lsmod -> r:udf" + - 'd:/etc/modprobe.d -> r:\.+ -> r:^\s*\t*blacklist\s*udf' + + # 1.1.2.1 Ensure /tmp is a separate partition. (Automated) + - id: 32003 + title: "Ensure /tmp is a separate partition." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a configuration where /tmp is not a separate file system it will essentially have the whole disk available, as the default installation only creates a single / partition. On the other hand, a RAM-based /tmp (as with tmpfs) will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily. Another alternative is to create a dedicated partition for /tmp from a separate volume or disk. One of the downsides of a disk-based dedicated partition is that it will be slower than tmpfs which is RAM-based. /tmp utilizing tmpfs can be resized using the size={size} parameter in the relevant entry in /etc/fstab." + remediation: "First ensure that systemd is correctly configured to ensure that /tmp will be mounted at boot time. # systemctl unmask tmp.mount For specific configuration requirements of the /tmp mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs /tmp 0 tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 Example of using a volume or disk with specific mount options. The source location of the volume or disk will vary depending on your environment. /tmp defaults,nodev,nosuid,noexec 0 0." + references: + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + - "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html" + compliance: + - cis: ["1.1.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s' + - "c:systemctl is-enabled tmp.mount -> r:enabled|static|generated" + + # 1.1.2.2 Ensure nodev option set on /tmp partition. (Automated) + - id: 32004 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s && r:nodev' + + # 1.1.2.3 Ensure noexec option set on /tmp partition. (Automated) + - id: 32005 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s && r:noexec' + + # 1.1.2.4 Ensure nosuid option set on /tmp partition. (Automated) + - id: 32006 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s && r:nosuid' + + # 1.1.3.1 Ensure separate partition exists for /var. (Automated) + - id: 32007 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "The reasoning for mounting /var on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behaviour. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s' + + # 1.1.3.2 Ensure nodev option set on /var partition. (Automated) + - id: 32008 + title: "Ensure nodev option set on /var partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s && r:nodev' + + # 1.1.3.3 Ensure noexec option set on /var partition. (Automated) + - id: 32009 + title: "Ensure noexec option set on /var partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot run executable binaries from /var." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s && r:noexec' + + # 1.1.3.4 Ensure nosuid option set on /var partition. (Automated) + - id: 32010 + title: "Ensure nosuid option set on /var partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s && r:nosuid' + + # 1.1.4.1 Ensure separate partition exists for /var/tmp. (Automated) + - id: 32011 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications. Temporary file residing in /var/tmp is to be preserved between reboots." + rationale: "The reasoning for mounting /var/tmp on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/tmp directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/tmp and cause the potential disruption to daemons as the disk is full. Fine grained control over the mount Configuring /var/tmp as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var/tmp may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s' + + # 1.1.4.2 Ensure noexec option set on /var/tmp partition. (Automated) + - id: 32012 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s && r:noexec' + + # 1.1.4.3 Ensure nosuid option set on /var/tmp partition. (Automated) + - id: 32013 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s && r:nosuid' + + # 1.1.4.4 Ensure nodev option set on /var/tmp partition. (Automated) + - id: 32014 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s && r:nodev' + + # 1.1.5.1 Ensure separate partition exists for /var/log. (Automated) + - id: 32015 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "The reasoning for mounting /var/log on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log directory contain the log files that can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. Fine grained control over the mount Configuring /var/log as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of log data As /var/log contains log files, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.5.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s' + + # 1.1.5.2 Ensure nodev option set on /var/log partition. (Automated) + - id: 32016 + title: "Ensure nodev option set on /var/log partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s && r:nodev' + + # 1.1.5.3 Ensure noexec option set on /var/log partition. (Automated) + - id: 32017 + title: "Ensure noexec option set on /var/log partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot run executable binaries from /var/log." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s && r:noexec' + + # 1.1.5.4 Ensure nosuid option set on /var/log partition. (Automated) + - id: 32018 + title: "Ensure nosuid option set on /var/log partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot create setuid files in /var/log." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s && r:nosuid' + + # 1.1.6.1 Ensure separate partition exists for /var/log/audit. (Automated) + - id: 32019 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "The reasoning for mounting /var/log/audit on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log/audit directory contain the audit.log file that can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/log/audit and cause auditd to trigger it's space_left_action as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var/log/audit as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of audit data As /var/log/audit contains audit logs, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.6.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s' + + # 1.1.6.2 Ensure noexec option set on /var/log/audit partition. (Automated) + - id: 32020 + title: "Ensure noexec option set on /var/log/audit partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log/audit filesystem is only intended for audit logs, set this option to ensure that users cannot run executable binaries from /var/log/audit." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s && r:noexec' + + # 1.1.6.3 Ensure nodev option set on /var/log/audit partition. (Automated) + - id: 32021 + title: "Ensure nodev option set on /var/log/audit partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log/audit filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s && r:nodev' + + # 1.1.6.4 Ensure nosuid option set on /var/log/audit partition. (Automated) + - id: 32022 + title: "Ensure nosuid option set on /var/log/audit partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log/audit filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s && r:nosuid' + + # 1.1.7.1 Ensure separate partition exists for /home. (Automated) + - id: 32023 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "The reasoning for mounting /home on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /home directory contains user generated data, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /home and impact all local users. Fine grained control over the mount Configuring /home as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. In the case of /home options such as usrquota/grpquota may be considered to limit the impact that users can have on each other with regards to disk resource exhaustion. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of user data As /home contains user data, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.7.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s' + + # 1.1.7.2 Ensure nodev option set on /home partition. (Automated) + - id: 32024 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /home filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s && r:nodev' + + # 1.1.7.3 Ensure nosuid option set on /home partition. (Automated) + - id: 32025 + title: "Ensure nosuid option set on /home partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /home filesystem is only intended for user file storage, set this option to ensure that users cannot create setuid files in /home." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s && r:nosuid' + + # 1.1.7.4 Ensure usrquota option set on /home partition. (Automated) + - id: 32026 + title: "Ensure usrquota option set on /home partition." + description: "The usrquota mount option allows for the filesystem to have disk quotas configured." + rationale: "To ensure the availability of disk space on /home, it is important to limit the impact a single user or group can cause for other users (or the wider system) by accidentally filling up the partition. Quotas can also be applied to inodes for filesystems where inode exhaustion is a concern." + remediation: "Edit the /etc/fstab file and add usrquota to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,usrquota,grpquota,nodev,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home Create the quota database. This example will ignore any existing quota files. # quotacheck -cugv /home quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. quotacheck: Scanning /dev/sdb [/home] done quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Checked 8 directories and 0 files quotacheck: Old file not found. quotacheck: Old file not found. Restore SELinux context on the quota database files. Order of operations is important as quotaon will set the immutable attribute on the files and thus restorecon will fail. # restorecon /home/aquota.user Enable quotas on the partition: # quotaon -vug /home /dev/sdb [/home]: group quotas turned on /dev/sdb [/home]: user quotas turned on." + compliance: + - cis: ["1.1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s && r:usrquota' + + # 1.1.7.5 Ensure grpquota option set on /home partition. (Automated) + - id: 32027 + title: "Ensure grpquota option set on /home partition." + description: "The grpquota mount option allows for the filesystem to have disk quotas configured." + rationale: "To ensure the availability of disk space on /home, it is important to limit the impact a single user or group can cause for other users (or the wider system) by accidentally filling up the partition. Quotas can also be applied to inodes for filesystems where inode exhaustion is a concern." + remediation: "Edit the /etc/fstab file and add grpquota to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,usrquota,grpquota,nodev,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home Create the quota database. This example will ignore any existing quota files. # quotacheck -cugv /home quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. quotacheck: Scanning /dev/sdb [/home] done quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Checked 8 directories and 0 files quotacheck: Old file not found. quotacheck: Old file not found. Restore SELinux context on the quota database files. Order of operations is important as quotaon will set the immutable attribute on the files and thus restorecon will fail. # restorecon /home/aquota.group Enable quotas on the partition: # quotaon -vug /home /dev/sdb [/home]: group quotas turned on /dev/sdb [/home]: user quotas turned on." + compliance: + - cis: ["1.1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s && r:grpquota' + + # 1.1.8.1 Ensure nodev option set on /dev/shm partition. (Automated) + - id: 32028 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s && r:nodev' + + # 1.1.8.2 Ensure noexec option set on /dev/shm partition. (Automated) + - id: 32029 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Example: /dev/shm defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm NOTE It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s && r:noexec' + + # 1.1.8.3 Ensure nosuid option set on /dev/shm partition. (Automated) + - id: 32030 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s && r:nosuid' + + # 1.1.9 Disable Automounting. (Automated) + - id: 32031 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "If there are no other packages that depends on autofs, remove the package with: # dnf remove autofs Run the following command to disable autofs if it is required: # systemctl --now disable autofs." + compliance: + - cis: ["1.1.9"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + - nist_sp_800-53: ["SC-18(4)"] + condition: any + rules: + - "c:systemctl is-enabled autofs -> r:^Failed && r:No such file or directory" + - "not c:systemctl is-enabled autofs -> r:^enabled" + + # 1.1.10 Disable USB Storage. (Automated) + - id: 32032 + title: "Disable USB Storage." + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/usb_storage.conf and add the following line: install usb-storage /bin/true Run the following command to unload the usb-storage module: rmmod usb-storage." + compliance: + - cis: ["1.1.10"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["13.7"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.8.3.1"] + - nist_sp_800-53: ["SC-18(4)"] + condition: all + rules: + - "c:modprobe -n -v usb-storage -> r:^install /bin/true" + - "not c:lsmod -> r:^usb-storage" + + # 1.2.1 Ensure GPG keys are configured. (Manual) - Not Implemented + + # 1.2.2 Ensure gpgcheck is globally activated. (Automated) + - id: 32033 + title: "Ensure gpgcheck is globally activated." + description: "The gpgcheck option, found in the main section of the /etc/dnf/dnf.conf and individual /etc/yum.repos.d/* files, determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/dnf/dnf.conf and set gpgcheck=1 in the [main] section. Example: # sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' /etc/dnf/dnf.conf Edit any failing files in /etc/yum.repos.d/* and set all instances starting with gpgcheck to 1. Example: # find /etc/yum.repos.d/ -name \"*.repo\" -exec echo \"Checking:\" {} \\; -exec sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' {} \\;." + compliance: + - cis: ["1.2.2"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - mitre_techniques: ["T1017", "T1019", "T1068", "T1072", "T1073", "T1075", "T1100", "T1103", "T1137", "T1138", "T1189", "T1190", "T1195", "T1210", "T1211", "T1212", "T1495"] + - nist_sp_800-53: ["SI-2"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'f:/etc/dnf/dnf.conf -> r:^\s*gpgcheck\s*=\s*1' + - 'not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck\s*=\s*0' + + # 1.2.3 Ensure package manager repositories are configured. (Manual) - Not Implemented + + # 1.3.1 Ensure AIDE is installed. (Automated) + - id: 32034 + title: "Ensure AIDE is installed." + description: "Advanced Intrusion Detection Environment (AIDE) is a intrusion detection tool that uses predefined rules to check the integrity of files and directories in the Linux operating system. AIDE has its own database to check the integrity of files and directories. AIDE takes a snapshot of files and directories including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # dnf install aide Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: Run the following commands: # aide --init # mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz." + references: + - "http://aide.sourceforge.net/stable/manual.html" + compliance: + - cis: ["1.3.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-2"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:rpm -q aide -> r:aide-" + + # 1.3.2 Ensure filesystem integrity is regularly checked. (Automated) + - id: 32035 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check OR if aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + references: + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service" + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer" + compliance: + - cis: ["1.3.2"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-2"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:systemctl is-enabled aidecheck.service -> r:^enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:^enabled" + - "c:systemctl status aidecheck.service -> r:active" + + # 1.4.1 Ensure bootloader password is set. (Automated) - Not Implemented + + # 1.4.2 Ensure permissions on bootloader config are configured. (Automated) - Not Implemented + + # 1.4.3 Ensure authentication is required when booting into rescue mode. (Automated) + - id: 32036 + title: "Ensure authentication is required when booting into rescue mode." + description: "Rescue mode (former single user mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in rescue mode (former single user mode) prevents an unauthorized user from rebooting the system into rescue mode to gain root privileges without credentials." + remediation: "The systemd drop-in files must be created if it is necessary to change the default settings: Create the file /etc/systemd/system/rescue.service.d/00-require-auth.conf which contains only the configuration to be overridden: [Service] ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue." + compliance: + - cis: ["1.4.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/usr/lib/systemd/system/rescue.service -> r:^ExecStart=- && r:systemd/systemd-sulogin-shell\s*\t*rescue' + - 'd:/etc/systemd/system/rescue.service.d -> r:\.+ -> r:^ExecStart=- && r:systemd/systemd-sulogin-shell\s*\t*rescue' + + # 1.5.1 Ensure core dump storage is disabled. (Automated) + - id: 32037 + title: "Ensure core dump storage is disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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." + remediation: "Edit /etc/systemd/coredump.conf and edit or add the following line: Storage=none." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.1"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*Storage\s*=\s*none' + + # 1.5.2 Ensure core dump backtraces are disabled. (Automated) + - id: 32038 + title: "Ensure core dump backtraces are disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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, increasing the risk to the system." + remediation: "Edit or add the following line in /etc/systemd/coredump.conf: ProcessSizeMax=0." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.2"] + - nist_sp_800-53: ["CM-6b"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*ProcessSizeMax\s*=\s*0' + + # 1.5.3 Ensure address space layout randomization (ASLR) is enabled. (Automated) - Not Implemented + + # 1.6.1.1 Ensure SELinux is installed. (Automated) + - id: 32039 + title: "Ensure SELinux is installed." + description: "SELinux provides Mandatory Access Control." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install SELinux: # dnf install libselinux." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:rpm -q libselinux -> r:^libselinux-" + + # 1.6.1.2 Ensure SELinux is not disabled in bootloader configuration. (Automated) + - id: 32040 + title: "Ensure SELinux is not disabled in bootloader configuration." + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + impact: "Files created while SELinux is disabled are not labeled at all. This behavior causes problems when changing to enforcing mode because files are labeled incorrectly or are not labeled at all. To prevent incorrectly labeled and unlabeled files from causing problems, file systems are automatically relabeled when changing from the disabled state to permissive or enforcing mode. This can be a long running process that should be accounted for as it may extend downtime during initial re-boot." + remediation: "Run the following command to remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: grubby --update-kernel ALL --remove-args 'selinux=0 enforcing=0'." + compliance: + - cis: ["1.6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + - 'f:/boot/grub2/grub.cfg -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + + # 1.6.1.3 Ensure SELinux policy is configured. (Automated) + - id: 32041 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+targeted$|^Loaded policy name:\s+mls$' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Ensure the SELinux mode is not disabled. (Automated) + - id: 32042 + title: "Ensure the SELinux mode is not disabled." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes" + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$|^Permissive$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing|\s*SELINUX\s*=\s*permisive' + + # 1.6.1.5 Ensure the SELinux mode is enforcing. (Automated) + - id: 32043 + title: "Ensure the SELinux mode is enforcing." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode the system not only avoids enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future. Running SELinux in Permissive mode, though helpful for developing SELinux policy, only logs access denial entries, but does not deny any operations." + remediation: "Run the following command to set SELinux's running mode: # setenforce 1 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes" + compliance: + - cis: ["1.6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + # 1.6.1.6 Ensure no unconfined services exist. (Automated) + - id: 32044 + title: "Ensure no unconfined services exist." + description: "Unconfined processes run in unconfined domains." + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules - it does not replace them." + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "not c:ps -eZ -> r:unconfined_service_t" + + # 1.6.1.7 Ensure SETroubleshoot is not installed. (Automated) + - id: 32045 + title: "Ensure SETroubleshoot is not installed." + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # dnf remove setroubleshoot." + compliance: + - cis: ["1.6.1.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "not c:rpm -qa setroubleshoot -> r:^setroubleshoot" + + # 1.6.1.8 Ensure the MCS Translation Service (mcstrans) is not installed. (Automated) + - id: 32046 + title: "Ensure the MCS Translation Service (mcstrans) is not installed." + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf." + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # dnf remove mcstrans." + compliance: + - cis: ["1.6.1.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "not c:rpm -qa mcstrans -> r:mcstrans" + + # 1.7.1 Ensure message of the day is configured properly. (Automated) + - id: 32047 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + condition: any + rules: + - "not f:/etc/motd" + - 'not f:/etc/motd -> r:\\v|\\r|\\m|\\s|alma' + + # 1.7.2 Ensure local login warning banner is configured properly. (Automated) + - id: 32048 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.7.2"] + condition: any + rules: + - "not f:/etc/issue" + - 'not f:/etc/issue -> r:\\v|\\r|\\m|\\s|alma' + + # 1.7.3 Ensure remote login warning banner is configured properly. (Automated) + - id: 32049 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + condition: any + rules: + - "not f:/etc/issue.net" + - 'not f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|alma' + + # 1.7.4 Ensure permissions on /etc/motd are configured. (Automated) + - id: 32050 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd : # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.5 Ensure permissions on /etc/issue are configured. (Automated) + - id: 32051 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue : # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured. (Automated) + - id: 32052 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.8.1 Ensure GNOME Display Manager is removed. (Manual) + - id: 32053 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + impact: "Removing the GNOME Display manager will remove the GUI from the system." + remediation: "Run the following command to remove the gdm package # dnf remove gdm." + references: + - "https://wiki.gnome.org/Projects/GDM" + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1028", "T1046", "T1052", "T1064", "T1076", "T1086", "T1091", "T1092", "T1118", "T1121", "T1127", "T1133", "T1137", "T1164", "T1170", "T1171", "T1173", "T1175", "T1180", "T1184", "T1191", "T1210", "T1221", "T1519"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "f:rpm -q gdm -> r:is not installed" + + # 1.8.2 Ensure GDM login banner is configured. (Automated) + - id: 32054 + title: "Ensure GDM login banner is configured." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Note: If a graphical login is not required, it should be removed to reduce the attack surface of the system." + remediation: "Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/01-banner-message) [org/gnome/login-screen] banner-message-enable=true banner-message-text='' Example Banner Text: 'Authorized users only. All activity may be monitored and reported.' Run the following command to update the system databases: # dconf update." + compliance: + - cis: ["1.8.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm" + - "f:/etc/dconf/profile/gdm -> r:user-db:user" + - "f:/etc/dconf/profile/gdm -> r:system-db:gdm" + - "f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - 'd:/etc/dconf/db/gdm.d -> r:\.+ -> r:banner-message-enable=true' + - 'd:/etc/dconf/db/gdm.d -> r:\.+ -> r:banner-message-text=' + + # 1.8.3 Ensure last logged in user display is disabled. (Automated) + - id: 32055 + title: "Ensure last logged in user display is disabled." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Displaying the last logged in user eliminates half of the Userid/Password equation that an unauthorized person would need to log on. Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Notes: - - If a graphical login is not required, it should be removed to reduce the attack surface of the system. If a different GUI login service is in use and required on the system, consult your documentation to disable displaying the last logged on user." + remediation: "Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/00-login-screen) [org/gnome/login-screen] # Do not show the user list disable-user-list=true Run the following command to update the system databases: # dconf update." + compliance: + - cis: ["1.8.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm" + - "f:/etc/dconf/profile/gdm -> r:user-db:user" + - "f:/etc/dconf/profile/gdm -> r:system-db:gdm" + - "f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - 'd:/etc/dconf/db/gdm.d -> r:\.+ -> r:disable-user-list=true' + + # 1.8.4 Ensure XDMCP is not enabled. (Automated) + - id: 32056 + title: "Ensure XDMCP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. - XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user - XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server." + remediation: "Edit the file /etc/gdm/custom.conf and remove the line Enable=true." + references: + - "https://help.gnome.org/admin/gdm/2.32/configuration.html.en" + compliance: + - cis: ["1.8.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not f:/etc/gdm/custom.conf -> r:^\s*Enable\s*=\s*true' + + # 1.8.5 Ensure automatic mounting of removable media is disabled. (Automated) + - id: 32057 + title: "Ensure automatic mounting of removable media is disabled." + description: "By default GNOME automatically mounts removable media when inserted as a convenience to the user." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "Ensure that automatic mounting of media is disabled for all GNOME users: # cat << EOF >> /etc/dconf/db/local.d/00-media-automount [org/gnome/desktop/media-handling] automount=false automount-open=false EOF Apply the changes with: # dconf update OR Run the following command to uninstall the GNOME desktop Manager package: # dnf uninstall gdm." + references: + - "https://access.redhat.com/solutions/20107" + compliance: + - cis: ["1.8.5"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - "c:gsettings get org.gnome.desktop.media-handling automount -> r:^false" + + # 1.9 Ensure updates, patches, and additional security software are installed. (Manual) + - id: 32058 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available updates: # dnf update." + compliance: + - cis: ["1.9"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - mitre_techniques: ["T1017", "T1019", "T1068", "T1072", "T1073", "T1075", "T1100", "T1103", "T1137", "T1138", "T1189", "T1190", "T1195", "T1210", "T1211", "T1212", "T1495"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'not c:sh -c "dnf check-update | egrep -v \"Updating|Last metadata|^$\"" -> r:^\w' + + # 1.10 Ensure system-wide crypto policy is not legacy. (Automated) + - id: 32059 + title: "Ensure system-wide crypto policy is not legacy." + description: "The system-wide crypto-policies followed by the crypto core components allow consistently deprecating and disabling algorithms system-wide. The individual policy levels (DEFAULT, LEGACY, FUTURE, and FIPS) are included in the crypto-policies(7) package." + rationale: "If the Legacy system-wide crypto policy is selected, it includes support for TLS 1.0, TLS 1.1, and SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are allowed, while RSA and Diffie-Hellman parameters are accepted if larger than 1023-bits. These legacy protocols and algorithms can make the system vulnerable to attacks, including those listed in RFC 7457." + impact: "Environments that require compatibility with older insecure protocols may require the use of the less secure LEGACY policy level." + remediation: "Run the following command to change the system-wide crypto policy # update-crypto-policies --set Example: # update-crypto-policies --set DEFAULT Run the following to make the updated system-wide crypto policy active # update-crypto-policies." + references: + - "https://access.redhat.com/articles/3642912#what-polices-are-provided-1" + compliance: + - cis: ["1.10"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - mitre_techniques: ["T1040", "T1070", "T1114", "T1119", "T1145", "T1208", "T1492", "T1493", "T1527", "T1530"] + - nist_sp_800-53: ["SC-8"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'f:/etc/crypto-policies/config -> r:^\s*LEGACY' + + # 2.1.1 Ensure time synchronization is in use. (Automated) + - id: 32060 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them. Note: If another method for time synchronization is being used, this section may be skipped." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Run the following command to install chrony: # dnf install chrony." + compliance: + - cis: ["2.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:rpm -q chrony -> r:^chrony-" + + # 2.1.2 Ensure chrony is configured. (Automated) + - id: 32061 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: 'Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include ''-u chrony'': OPTIONS="-u chrony".' + compliance: + - cis: ["2.1.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "f:/etc/chrony.conf" + - 'f:/etc/chrony.conf -> r:^\s*\t*server|^\s*\t*pool' + - 'f:/etc/sysconfig/chronyd -> r:^\s*\t*OPTIONS\.*-u chrony' + + # 2.2.1 Ensure xinetd is not installed. (Automated) + - id: 32062 + title: "Ensure xinetd is not installed." + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed to reduce the attack surface are of the system. Note: If an xinetd service or services are required, ensure that any xinetd service not required is stopped and disabled." + remediation: "Run the following command to remove xinetd: # dnf remove xinetd." + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - mitre_techniques: ["T1015", "T1028", "T1046", "T1051", "T1052", "T1064", "T1076", "T1086", "T1091", "T1092", "T1118", "T1121", "T1127", "T1133", "T1137", "T1164", "T1170", "T1171", "T1173", "T1175", "T1180", "T1184", "T1191", "T1200", "T1210", "T1221", "T1519"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q xinetd -> r:^package xinetd is not installed" + + # 2.2.2 Ensure xorg-x11-server-common is not installed. (Automated) + - id: 32063 + title: "Ensure xorg-x11-server-common is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: 'Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime.' + remediation: "Run the following command to remove the X Windows Server packages: # dnf remove xorg-x11-server-common." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q xorg-x11-server-common -> r:^package xorg-x11-server-common is not installed" + + # 2.2.3 Ensure Avahi Server is not installed. (Automated) + - id: 32064 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to stop, mask and remove avahi-autoipd and avahi: # systemctl stop avahi-daemon.socket avahi-daemon.service # dnf remove avahi-autoipd avahi." + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q avahi -> r:^package avahi is not installed" + - "c:rpm -q avahi-autoipd -> r:^package avahi-autoipd is not installed" + + # 2.2.4 Ensure CUPS is not installed. (Automated) + - id: 32065 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface. Note: Removing CUPS will prevent printing from the system." + impact: "Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to remove cups: # dnf remove cups." + references: + - "http://www.cups.org." + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q cups -> r:^package cups is not installed" + + # 2.2.5 Ensure DHCP Server is not installed. (Automated) + - id: 32066 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that the rpm -q dhcp-server package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcp: # dnf remove dhcp-server." + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dhcp-server -> r:^package dhcp-server is not installed" + + # 2.2.6 Ensure DNS Server is not installed. (Automated) + - id: 32067 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove bind: # dnf remove bind." + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q bind -> r:^package bind is not installed" + + # 2.2.7 Ensure VSFTP Server is not installed. (Automated) + - id: 32068 + title: "Ensure VSFTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "Unless there is a need to run the system as a FTP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # dnf remove vsftpd." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q vsftpd -> r:^package vsftpd is not installed" + + # 2.2.8 Ensure TFTP Server is not installed. (Automated) + - id: 32069 + title: "Ensure TFTP Server is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + remediation: "Run the following command to remove tftp-server: # dnf remove tftp-server." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp-server -> r:^package tftp-server is not installed" + + # 2.2.9 Ensure a web server is not installed. (Automated) + - id: 32070 + title: "Ensure a web server is not installed." + description: "Web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the packages be removed to reduce the potential attack surface. Note: Several http servers exist. They should also be audited, and removed, if not required." + remediation: "Run the following command to remove httpd and nginx: # dnf remove httpd nginx." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nginx -> r:^package nginx is not installed" + - "c:rpm -q httpd -> r:^package httpd is not installed" + + # 2.2.10 Ensure IMAP and POP3 server is not installed. (Automated) + - id: 32071 + title: "Ensure IMAP and POP3 server is not installed." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface. Note: Several IMAP/POP3 servers exist and can use other service names. These should also be audited and the packages removed if not required." + remediation: "Run the following command to remove dovecot and cyrus-imapd: # dnf remove dovecot cyrus-imapd." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dovecot -> r:^package dovecot is not installed" + - "c:rpm -q cyrus-imapd -> r:^package cyrus-imapd is not installed" + + # 2.2.11 Ensure Samba is not installed. (Automated) + - id: 32072 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # dnf remove samba." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q samba -> r:^package samba is not installed" + + # 2.2.12 Ensure HTTP Proxy Server is not installed. (Automated) + - id: 32073 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "Unless a system is specifically set up to act as a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface. Note: Several HTTP proxy servers exist. These should be checked and removed unless required." + remediation: "Run the following command to remove the squid package: # dnf remove squid." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q squid -> r:^package squid is not installed" + + # 2.2.13 Ensure net-snmp is not installed. (Automated) + - id: 32074 + title: "Ensure net-snmp is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. If SNMP v2 is absolutely necessary, modify the community strings' values. -." + remediation: "Run the following command to remove net-snmpd: # dnf remove net-snmp." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - mitre_techniques: ["T1015", "T1028", "T1046", "T1051", "T1052", "T1064", "T1076", "T1086", "T1091", "T1092", "T1118", "T1121", "T1127", "T1133", "T1137", "T1164", "T1170", "T1171", "T1173", "T1175", "T1180", "T1184", "T1191", "T1200", "T1210", "T1221", "T1519"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q net-snmp -> r:^package net-snmp is not installed" + + # 2.2.14 Ensure NIS server is not installed. (Automated) + - id: 32075 + title: "Ensure NIS server is not installed." + description: "The ypserv package provides the Network Information Service (NIS). This service, formally known as Yellow Pages, is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the ypserv package be removed, and if required a more secure services be used." + remediation: "Run the following command to remove ypserv: # dnf remove ypserv." + compliance: + - cis: ["2.2.14"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - mitre_techniques: ["T1015", "T1028", "T1046", "T1051", "T1052", "T1064", "T1076", "T1086", "T1091", "T1092", "T1118", "T1121", "T1127", "T1133", "T1137", "T1164", "T1170", "T1171", "T1173", "T1175", "T1180", "T1184", "T1191", "T1200", "T1210", "T1221", "T1519"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ypserv -> r:^package ypserv is not installed" + + # 2.2.15 Ensure telnet-server is not installed. (Automated) + - id: 32076 + title: "Ensure telnet-server is not installed." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to remove the telnet-server package: # dnf remove telnet-server." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - mitre_techniques: ["T1015", "T1028", "T1046", "T1051", "T1052", "T1064", "T1076", "T1086", "T1091", "T1092", "T1118", "T1121", "T1127", "T1133", "T1137", "T1164", "T1170", "T1171", "T1173", "T1175", "T1180", "T1184", "T1191", "T1200", "T1210", "T1221", "T1519"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet-server -> r:^package telnet-server is not installed" + + # 2.2.16 Ensure mail transfer agent is configured for local-only mode. (Automated) + - id: 32077 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Notes: - This recommendation is designed around the postfix mail server. - Depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not c:ss -lntu -> r:\s*127.0.0.1:25\s*|\s*::1:25\s*' + + # 2.2.17 Ensure nfs-utils is not installed or the nfs-server service is masked. (Automated) + - id: 32078 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not require network shares, it is recommended that the nfs-utils package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization are dependent on the nfs-utils package. If the nfs-package is required as a dependency, the nfs-server should be disabled and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove nfs-utils OR If the nfs-package is required as a dependency, run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server." + compliance: + - cis: ["2.2.17"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q nfs-utils -> r:^package nfs-utils is not installed" + - "c:systemctl is-enabled nfs-server -> r:masked|No such file or directory" + + # 2.2.18 Ensure rpcbind is not installed or the rpcbind services are masked. (Automated) + - id: 32079 + title: "Ensure rpcbind is not installed or the rpcbind services are masked." + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening." + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization, and the nfs-utils package used for The Network File System (NFS), are dependent on the rpcbind package. If the rpcbind package is required as a dependency, the services rpcbind.service and rpcbind.socket should be stopped and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove rpcbind OR If the rpcbind package is required as a dependency, run the following commands to stop and mask the rpcbind and rpcbind.socket services: # systemctl --now mask rpcbind # systemctl --now mask rpcbind.socket." + compliance: + - cis: ["2.2.18"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rpcbind -> r:^package rpcbind is not installed" + - "c:systemctl is-enabled rpcbind -> r:masked|No such file or directory" + - "c:systemctl is-enabled rpcbind.socket -> r:masked|No such file or directory" + + # 2.2.19 Ensure rsync-daemon is not installed or the rsyncd service is masked. (Automated) + - id: 32080 + title: "Ensure rsync-daemon is not installed or the rsyncd service is masked." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync-daemon package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication. Note: If a required dependency exists for the rsync-daemon package, but the rsyncd service is not required, the service should be masked._." + impact: "There are packages that are dependent on the rsync package. If the rsync package is removed, these packages will be removed as well. Before removing the rsync package, review any dependent packages to determine if they are required on the system. If a dependent package is required, mask the rsyncd service and leave the rsync package installed." + remediation: "Run the following command to remove the rsync package: # dnf remove rsync-daemon OR Run the following command to mask the rsyncd service: # systemctl --now mask rsyncd." + compliance: + - cis: ["2.2.19"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rsync-daemon -> r:^package rsync-daemon is not installed" + - "c:systemctl is-enabled rsyncd -> r:masked|No such file or directory" + + # 2.3.1 Ensure NIS Client is not installed. (Automated) + - id: 32081 + title: "Ensure NIS Client is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client (ypbind) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the ypbind package: # dnf remove ypbind." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1028", "T1046", "T1052", "T1064", "T1076", "T1086", "T1091", "T1092", "T1118", "T1121", "T1127", "T1133", "T1137", "T1164", "T1170", "T1171", "T1173", "T1175", "T1180", "T1184", "T1191", "T1210", "T1221", "T1519"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ypbind -> r:^package ypbind is not installed" + + # 2.3.2 Ensure rsh client is not installed. (Automated) + - id: 32082 + title: "Ensure rsh client is not installed." + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the rsh package: # dnf remove rsh." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1028", "T1046", "T1052", "T1064", "T1076", "T1086", "T1091", "T1092", "T1118", "T1121", "T1127", "T1133", "T1137", "T1164", "T1170", "T1171", "T1173", "T1175", "T1180", "T1184", "T1191", "T1210", "T1221", "T1519"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q rsh -> r:^package rsh is not installed" + + # 2.3.3 Ensure talk client is not installed. (Automated) + - id: 32083 + title: "Ensure talk client is not installed." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the talk package: # dnf remove talk." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1028", "T1046", "T1052", "T1064", "T1076", "T1086", "T1091", "T1092", "T1118", "T1121", "T1127", "T1133", "T1137", "T1164", "T1170", "T1171", "T1173", "T1175", "T1180", "T1184", "T1191", "T1210", "T1221", "T1519"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q talk -> r:^package talk is not installed" + + # 2.3.4 Ensure telnet client is not installed. (Automated) + - id: 32084 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the telnet package: # dnf remove telnet." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1028", "T1046", "T1052", "T1064", "T1076", "T1086", "T1091", "T1092", "T1118", "T1121", "T1127", "T1133", "T1137", "T1164", "T1170", "T1171", "T1173", "T1175", "T1180", "T1184", "T1191", "T1210", "T1221", "T1519"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet -> r:^package telnet is not installed" + + # 2.3.5 Ensure LDAP client is not installed. (Automated) + - id: 32085 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Run the following command to remove the openldap-clients package: # dnf remove openldap-clients." + compliance: + - cis: ["2.3.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1028", "T1046", "T1052", "T1064", "T1076", "T1086", "T1091", "T1092", "T1118", "T1121", "T1127", "T1133", "T1137", "T1164", "T1170", "T1171", "T1173", "T1175", "T1180", "T1184", "T1191", "T1210", "T1221", "T1519"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q openldap-clients -> r:^package openldap-clients is not installed" + + # 2.3.6 Ensure TFTP client is not installed. (Automated) + - id: 32086 + title: "Ensure TFTP client is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + remediation: "Run the following command to remove tftp: # dnf remove tftp." + compliance: + - cis: ["2.3.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp -> r:^package tftp is not installed" + + # 2.3.7 Ensure FTP client is not installed. (Automated) + - id: 32087 + title: "Ensure FTP client is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove ftp: # dnf remove ftp." + compliance: + - cis: ["2.3.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ftp -> r:^package ftp is not installed" + + # 2.4 Ensure nonessential services are removed or masked. (Manual) - Not Implemented + + # 3.1.1 Ensure wireless interfaces are disabled. (Automated) - Not Implemented + # 3.1.2 Verify if IPv6 is enabled or disabled on the system. (Manual) - Not Implemented + + # 3.1.3 Ensure SCTP is disabled. (Automated) + - id: 32088 + title: "Ensure SCTP is disabled." + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: printf " install sctp /bin/true " >> /etc/modprobe.d/sctp.conf.' + compliance: + - cis: ["3.1.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:modprobe -n -v sctp -> r:^install\s*\t*/bin/true' + - "not c:lsmod -> r:^sctp" + + # 3.1.4 Ensure DCCP is disabled. (Automated) + - id: 32089 + title: "Ensure DCCP is disabled." + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: printf " install dccp /bin/true " >> /etc/modprobe.d/dccp.conf.' + compliance: + - cis: ["3.1.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:modprobe -n -v dccp -> r:^install\s*\t*/bin/true' + - "not c:lsmod -> r:^dccp" + + # 3.2.1 Ensure IP forwarding is disabled. (Automated) - Not Implemented + # 3.2.2 Ensure packet redirect sending is disabled. (Automated) - Not Implemented + ############################################### + # 3.3 Network Parameters (Host and Router) + ############################################### + # 3.3.1 Ensure source routed packets are not accepted. (Automated) - Not Implemented + # 3.3.2 Ensure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.3 Ensure secure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.4 Ensure suspicious packets are logged. (Automated) - Not Implemented + # 3.3.5 Ensure broadcast ICMP requests are ignored. (Automated) - Not Implemented + # 3.3.6 Ensure bogus ICMP responses are ignored. (Automated) - Not Implemented + # 3.3.7 Ensure Reverse Path Filtering is enabled. (Automated) - Not Implemented + # 3.3.8 Ensure TCP SYN Cookies is enabled. (Automated) - Not Implemented + # 3.3.9 Ensure IPv6 router advertisements are not accepted. (Automated) - Not Implemented + + # 3.4.1.1 Ensure firewalld is installed. (Automated) + - id: 32090 + title: "Ensure firewalld is installed." + description: "firewalld is a firewall management tool for Linux operating systems. It provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the iptables backend or provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the nftables utility. firewalld replaces iptables as the default firewall management tool. Use the firewalld utility to configure a firewall for less complex firewalls. The utility is easy to use and covers the typical use cases scenario. FirewallD supports both IPv4 and IPv6 networks and can administer separate firewall zones with varying degrees of trust as defined in zone profiles. Note: Starting in v0.6.0, FirewallD added support for acting as a front-end for the Linux kernel's netfilter framework via the nftables userspace utility, acting as an alternative to the nft command line program." + rationale: "A firewall utility is required to configure the Linux kernel's netfilter framework via the iptables or nftables back-end. The Linux kernel's netfilter framework host-based firewall can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host. Note: Only one firewall utility should be installed and configured. FirewallD is dependent on the iptables package." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install FirewallD and iptables: # dnf install firewalld iptables." + compliance: + - cis: ["3.4.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q firewalld -> r:^firewalld-" + - "c:rpm -q iptables -> r:^iptables-" + + # 3.4.1.2 Ensure iptables-services not installed with firewalld. (Automated) + - id: 32091 + title: "Ensure iptables-services not installed with firewalld." + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both firewalld and the services included in the iptables-services package may lead to conflict." + impact: "Running both firewalld and iptables/ip6tables service may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package # systemctl stop iptables # systemctl stop ip6tables # dnf remove iptables-services." + compliance: + - cis: ["3.4.1.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9", "CM-7"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q iptables-services -> r:^package iptables-services is not installed" + + # 3.4.1.3 Ensure nftables either not installed or masked with firewalld. (Automated) + - id: 32092 + title: "Ensure nftables either not installed or masked with firewalld." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables. _Note: Support for using nftables as the back-end for firewalld was added in release v0.6.0. In Fedora 19 Linux derivatives, firewalld utilizes iptables as its back-end by default." + rationale: "Running both firewalld and nftables may lead to conflict. Note: firewalld may configured as the front-end to nftables. If this case, nftables should be stopped and masked instead of removed." + remediation: 'Run the following command to remove nftables: # dnf remove nftables OR Run the following command to stop and mask nftables" systemctl --now mask nftables.' + compliance: + - cis: ["3.4.1.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q nftables -> r:^package nftables is not installed" + - "c:systemctl is-active nftables -> r:^inactive" + - "c:systemctl is-enabled nftables -> r:^masked" + + # 3.4.1.4 Ensure firewalld service enabled and running. (Automated) + - id: 32093 + title: "Ensure firewalld service enabled and running." + description: "firewalld.service enables the enforcement of firewall rules configured through firewalld." + rationale: "Ensure that the firewalld.service is enabled and running to enforce firewall rules configured through firewalld." + impact: "Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following command to unmask firewalld # systemctl unmask firewalld Run the following command to enable and start firewalld # systemctl --now enable firewalld." + compliance: + - cis: ["3.4.1.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled firewalld -> r:^enabled" + - "c:firewall-cmd --state -> r:^running" + + # 3.4.1.5 Ensure firewalld default zone is set. (Automated) - Not Implemented + # 3.4.1.6 Ensure network interfaces are assigned to appropriate zone. (Manual) - Not Implemented + # 3.4.1.7 Ensure firewalld drops unnecessary services and ports. (Manual) - Not Implemented + + # 3.4.2.1 Ensure nftables is installed. (Automated) + - id: 32094 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem. Note: - nftables is available in Linux kernel 3.13 and newer. - Only one firewall utility should be installed and configured." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install nftables # dnf install nftables." + compliance: + - cis: ["3.4.2.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^nftables-" + + # 3.4.2.2 Ensure firewalld is either not installed or masked with nftables. (Automated) + - id: 32095 + title: "Ensure firewalld is either not installed or masked with nftables." + description: 'firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with support for network/firewall "zones" to assign a level of trust to a network and its associated connections, interfaces or sources. It has support for IPv4, IPv6, Ethernet bridges and also for IPSet firewall settings. There is a separation of the runtime and permanent configuration options.' + rationale: "Running both nftables.service and firewalld.service may lead to conflict and unexpected results." + remediation: "Run the following command to remove firewalld # dnf remove firewalld OR Run the following command to stop and mask firewalld # systemctl --now mask firewalld." + compliance: + - cis: ["3.4.2.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q firewalld -> r:^package firewalld is not installed" + - "not c:firewall-cmd --state -> r:^running" + - "c:systemctl is-enabled firewalld -> r:^masked" + + # 3.4.2.3 Ensure iptables-services not installed with nftables. (Automated) + - id: 32096 + title: "Ensure iptables-services not installed with nftables." + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both nftables and the services included in the iptables-services package may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package # systemctl stop iptables # systemctl stop ip6tables # dnf remove iptables-services." + compliance: + - cis: ["3.4.2.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9", "CM-7"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q iptables-services -> r:^package iptables-services is not installed" + + # 3.4.2.4 Ensure iptables are flushed with nftables. (Manual) + - id: 32097 + title: "Ensure iptables are flushed with nftables." + description: "nftables is a replacement for iptables, ip6tables, ebtables and arptables." + rationale: "It is possible to mix iptables and nftables. However, this increases complexity and also the chance to introduce errors. For simplicity flush out all iptables rules, and ensure it is not loaded." + remediation: "Run the following commands to flush iptables: For iptables: # iptables -F For ip6tables: # ip6tables -F." + compliance: + - cis: ["3.4.2.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "not c:iptables -L -> r:^Chain|^Accept|^Reject|^target" + - "not c:ip6tables -L -> r:^Chain|^Accept|^Reject|^target" + + # 3.4.2.5 Ensure an nftables table exists. (Automated) + - id: 32098 + title: "Ensure an nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + impact: "Adding rules to a running nftables can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet Example: # nft create table inet filter." + compliance: + - cis: ["3.4.2.5"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list tables -> r:^table" + + # 3.4.2.6 Ensure nftables base chains exist. (Automated) + - id: 32099 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.4.2.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:nftables-" + - "c:nft list ruleset -> r:hook input" + - "c:nft list ruleset -> r:hook forward" + - "c:nft list ruleset -> r:hook output" + + # 3.4.2.7 Ensure nftables loopback traffic is configured. (Automated) - Not Implemented + # 3.4.2.8 Ensure nftables outbound and established connections are configured. (Manual) - Not Implemented + + # 3.4.2.9 Ensure nftables default deny firewall policy. (Automated) + - id: 32100 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue traversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over the network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; } # nft chain inet filter output { policy drop \\; }." + compliance: + - cis: ["3.4.2.9"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input && r:policy drop" + - "c:nft list ruleset -> r:hook forward && r:policy drop" + - "c:nft list ruleset -> r:hook output && r:policy drop" + + # 3.4.2.10 Ensure nftables service is enabled. (Automated) + - id: 32101 + title: "Ensure nftables service is enabled." + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables." + compliance: + - cis: ["3.4.2.10"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled nftables -> r:^enabled" + + # 3.4.2.11 Ensure nftables rules are permanent. (Automated) + - id: 32102 + title: "Ensure nftables rules are permanent." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames. The nftables service reads the /etc/sysconfig/nftables.conf file for a nftables file or files to include in the nftables ruleset. A nftables ruleset containing the input, forward, and output base chains allow network traffic to be filtered." + rationale: "Changes made to nftables ruleset only affect the live system, you will also need to configure the nftables ruleset to apply on boot." + remediation: 'Edit the /etc/sysconfig/nftables.conf file and un-comment or add a line with include for each nftables file you want included in the nftables ruleset on boot: Example: include "/etc/nftables/nftables.rules".' + compliance: + - cis: ["3.4.2.11"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "f:/etc/sysconfig/nftables.conf -> r:^include" + + # 3.4.3.1.1 Ensure iptables packages are installed. (Automated) + - id: 32103 + title: "Ensure iptables packages are installed." + description: "iptables is a utility program that allows a system administrator to configure the tables provided by the Linux kernel firewall, implemented as different Netfilter modules, and the chains and rules it stores. Different kernel modules and programs are used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames." + rationale: "A method of configuring and maintaining firewall rules is necessary to configure a Host Based Firewall." + remediation: "Run the following command to install iptables and iptables-services # dnf install iptables iptables-services." + compliance: + - cis: ["3.4.3.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q iptables -> r:^iptables-" + - "c:rpm -q iptables-services -> r:^iptables-services-" + + # 3.4.3.1.2 Ensure nftables is not installed with iptables. (Automated) + - id: 32104 + title: "Ensure nftables is not installed with iptables." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables." + rationale: "Running both iptables and nftables may lead to conflict." + remediation: "Run the following command to remove nftables: # dnf remove nftables." + compliance: + - cis: ["3.4.3.1.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9", "CM-7"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:package nftables is not installed" + + # 3.4.3.1.3 Ensure firewalld is either not installed or masked with iptables. (Automated) + - id: 32105 + title: "Ensure firewalld is either not installed or masked with iptables." + description: 'firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with support for network/firewall "zones" to assign a level of trust to a network and its associated connections, interfaces or sources. It has support for IPv4, IPv6, Ethernet bridges and also for IPSet firewall settings. There is a separation of the runtime and permanent configuration options.' + rationale: "Running iptables.service and\\or ip6tables.service with firewalld.service may lead to conflict and unexpected results." + remediation: "Run the following command to remove firewalld # yum remove firewalld OR Run the following command to stop and mask firewalld # systemctl --now mask firewalld." + compliance: + - cis: ["3.4.3.1.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q firewalld -> r:^package firewalld is not installed" + - "not c:firewall-cmd --state -> r:^running" + - "c:systemctl is-enabled firewalld -> r:^masked" + + # 3.4.3.2.1 Ensure iptables loopback traffic is configured. (Automated) + - id: 32106 + title: "Ensure iptables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP." + compliance: + - cis: ["3.4.3.2.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:ACCEPT && r:all && r:lo\s*\t**' + - 'c:iptables -L INPUT -v -n -> r:DROP && r:all && r:*\s*\t** && r:127.0.0.0' + - 'c:iptables -L OUTPUT -v -n -> r:ACCEPT && r:all && r:*\s*\t*lo' + + # 3.4.3.2.2 Ensure iptables outbound and established connections are configured. (Manual) - Not Implemented + # 3.4.3.2.3 Ensure iptables rules exist for all open ports. (Automated) - Not Implemented + + # 3.4.3.2.4 Ensure iptables default deny firewall policy. (Automated) + - id: 32107 + title: "Ensure iptables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP." + compliance: + - cis: ["3.4.3.2.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:iptables -L -> r:INPUT && r:policy DROP" + - "c:iptables -L -> r:FORWARD && r:policy DROP" + - "c:iptables -L -> r:OUTPUT && r:policy DROP" + + # 3.4.3.2.5 Ensure iptables rules are saved. (Automated) - Not Impemented + + # 3.4.3.2.6 Ensure iptables is enabled and active. (Automated) + - id: 32108 + title: "Ensure iptables is enabled and active." + description: "iptables.service is a utility for configuring and maintaining iptables." + rationale: "iptables.service will load the iptables rules saved in the file /etc/sysconfig/iptables at boot, otherwise the iptables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start iptables: # systemctl --now enable iptables." + compliance: + - cis: ["3.4.3.2.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled iptables -> r:^enabled" + - "c:systemctl is-active iptables -> r:^active" + + # 3.4.3.3.1 Ensure ip6tables loopback traffic is configured. (Automated) + - id: 32109 + title: "Ensure ip6tables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP." + compliance: + - cis: ["3.4.3.3.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:ACCEPT && r:all && r:lo\s*\t**' + - 'c:ip6tables -L INPUT -v -n -> r:DROP && r:all && r:*\s*\t** && r:::1' + - 'c:ip6tables -L OUTPUT -v -n -> r:ACCEPT && r:all && r:*\s*\t*lo' + + # 3.4.3.3.2 Ensure ip6tables outbound and established connections are configured. (Manual) - Not Implemented + # 3.4.3.3.3 Ensure ip6tables firewall rules exist for all open ports. (Automated) - Not Implemented + + # 3.4.3.3.4 Ensure ip6tables default deny firewall policy. (Automated) + - id: 32110 + title: "Ensure ip6tables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP." + compliance: + - cis: ["3.4.3.3.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:ip6tables -L -> r:INPUT && r:policy DROP" + - "c:ip6tables -L -> r:FORWARD && r:policy DROP" + - "c:ip6tables -L -> r:OUTPUT && r:policy DROP" + + # 3.4.3.3.5 Ensure ip6tables rules are saved. (Automated) - Not Implemented + + # 3.4.3.3.6 Ensure ip6tables is enabled and active. (Automated) + - id: 32111 + title: "Ensure ip6tables is enabled and active." + description: "ip6tables.service is a utility for configuring and maintaining ip6tables." + rationale: "ip6tables.service will load the iptables rules saved in the file /etc/sysconfig/ip6tables at boot, otherwise the ip6tables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start ip6tables: # systemctl --now start ip6tables." + compliance: + - cis: ["3.4.3.3.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled ip6tables -> r:^enabled" + - "c:systemctl is-active ip6tables -> r:^active" + + # 4.1.1.1 Ensure auditd is installed. (Automated) + - id: 32112 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # dnf install audit." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v8: ["8.2", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "AU-3", "AU-3(1)", "SI-5"] + - pci_dss_v3.2.1: ["10.1", "10.2", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:rpm -q audit -> r:^audit-" + + # 4.1.1.2 Ensure auditd service is enabled. (Automated) + - id: 32113 + title: "Ensure auditd service is enabled." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:^enabled" + + # 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled. (Automated) + - id: 32114 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd , so that potential malicious activity cannot go undetected." + remediation: "Run the following command to add audit=1 to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit=1'." + compliance: + - cis: ["4.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:grubby --info=ALL -> r:audit=1" + + # 4.1.1.4 Ensure audit_backlog_limit is sufficient. (Automated) + - id: 32115 + title: "Ensure audit_backlog_limit is sufficient." + description: "The backlog limit has a default setting of 64." + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more that 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected." + remediation: "Run the following command to add audit_backlog_limit= to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit_backlog_limit=' Example: # grubby --update-kernel ALL --args 'audit_backlog_limit=8192'." + compliance: + - cis: ["4.1.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:grubby --info=ALL -> n:\s*audit_backlog_limit=(d+) compare >= 8192' + + # 4.1.2.1 Ensure audit log storage size is configured. (Automated) + - id: 32116 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file\s*=' + + # 4.1.2.2 Ensure audit logs are not automatically deleted. (Automated) + - id: 32117 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file_action\s*=\s*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full. (Automated) + - id: 32118 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full. The admin_space_left_action parameter tells the system what action to take when the system has detected that it is low on disk space. Valid values are ignore, syslog, suspend, single, and halt. - ignore, the audit daemon does nothing - Syslog, the audit daemon will issue a warning to syslog - Suspend, the audit daemon will stop writing records to the disk - single, the audit daemon will put the computer system in single user mode - halt, the audit daemon will shutdown the system." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + impact: "If the admin_space_left_action parameter is set to halt the audit daemon will shutdown the system when the disk partition containing the audit logs becomes full." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root set admin_space_left_action to either halt or single in /etc/audit/auditd.conf. Example: admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - nist_sp_800-53: ["AU-12", "AU-2", "AU-8", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt|^\s*admin_space_left_action\s*=\s*single' + + # 4.1.3.1 Ensure changes to system administration scope (sudoers) is collected. (Automated) + - id: 32119 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers, or files in /etc/sudoers.d, will be written to when the file(s) or related attributes have changed. The audit records will be tagged with the identifier "scope".' + rationale: "Changes in the /etc/sudoers and /etc/sudoers.d files can indicate that an unauthorized change has been made to the scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor scope changes for system administrators. Example: # printf \" -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d -p wa -k scope \" >> /etc/audit/rules.d/50-scope.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1047", "T1051", "T1053", "T1054", "T1055", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1088", "T1089", "T1096", "T1097", "T1098", "T1100", "T1134", "T1136", "T1145", "T1146", "T1150", "T1156", "T1157", "T1165", "T1169", "T1175", "T1184", "T1190", "T1196", "T1198", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1489", "T1492", "T1494", "T1495", "T1501", "T1504", "T1505", "T1525", "T1530"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'c:auditctl -l -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'c:auditctl -l -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=\\s*\t*scope' + + # 4.1.3.2 Ensure actions as another user are always logged. (Automated) + - id: 32120 + title: "Ensure actions as another user are always logged." + description: "sudo provides users with temporary elevated privileges to perform operations, either as the superuser or another user." + rationale: "Creating an audit log of users with temporary elevated privileges and the operation(s) they performed is essential to reporting. Administrators will want to correlate the events written to the audit trail with the records written to sudo's logfile to verify if unauthorized commands have been executed." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor elevated privileges. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -C euid!=uid -F auid!=unset -S execve -k user_emulation -a always,exit -F arch=b32 -C euid!=uid -F auid!=unset -S execve -k user_emulation \" >> /etc/audit/rules.d/50-user_emulation.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1047", "T1051", "T1053", "T1054", "T1055", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1088", "T1089", "T1096", "T1097", "T1098", "T1100", "T1110", "T1134", "T1136", "T1145", "T1146", "T1150", "T1156", "T1157", "T1165", "T1169", "T1175", "T1184", "T1190", "T1196", "T1198", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1489", "T1492", "T1494", "T1495", "T1501", "T1504", "T1505", "T1525", "T1530"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + + # 4.1.3.3 Ensure events that modify the sudo log file are collected. (Automated) - Not Implemented + + # 4.1.3.4 Ensure events that modify date and time information are collected. (Automated) + - id: 32121 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the; - adjtimex - tune kernel clock - settimeofday - set time using timeval and timezone structures - stime - using seconds since 1/1/1970 - clock_settime - allows for the setting of several internal clocks and timers system calls have been executed. Further, ensure to write an audit record to the configured audit log file upon exit, tagging the records with a unique identifier such as "time-change".' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify date and time information. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S adjtimex,settimeofday,clock_settime -k time-change -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime -k time-change -w /etc/localtime -p wa -k time-change \" >> /etc/audit/rules.d/50-time-change.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64. In addition, add stime to the system call audit. Example: -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime,stime -k time-change." + compliance: + - cis: ["4.1.3.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_techniques: ["T1031", "T1034", "T1038", "T1044", "T1053", "T1073", "T1076", "T1078", "T1081", "T1088", "T1114", "T1145", "T1161", "T1176", "T1213", "T1214", "T1482", "T1484", "T1505", "T1525", "T1527", "T1528", "T1530"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change' + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change" + + # 4.1.3.5 Ensure events that modify the system's network environment are collected. (Automated) + - id: 32122 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitors the following system calls, and write an audit event on system call exit: - sethostname - set the systems host name - setdomainname - set the systems domain name The files being monitored are: - /etc/issue and /etc/issue.net - messages displayed pre-login - /etc/hosts - file containing host names and associated IP addresses - /etc/sysconfig/network - additional information that is valid to all network interfaces - /etc/sysconfig/network-scripts/ - directory containing network interface scripts and configurations files." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records should have a relevant tag associated with them." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's network environment. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S sethostname,setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname,setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale \" >> /etc/audit/rules.d/50-system_local.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_techniques: ["T1031", "T1034", "T1038", "T1044", "T1053", "T1073", "T1076", "T1078", "T1081", "T1088", "T1114", "T1145", "T1161", "T1176", "T1213", "T1214", "T1482", "T1484", "T1505", "T1525", "T1527", "T1528", "T1530"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sysconfig/network-scripts && r:-p wa && r:-k system-locale|key=system-locale' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/sysconfig/network-scripts && r:-p wa && r:-k system-locale|key=system-locale" + + # 4.1.3.6 Ensure use of privileged commands are collected. (Automated) - Not Implemented + # 4.1.3.7 Ensure unsuccessful file access attempts are collected. (Automated) - Not Implemented + + # 4.1.3.8 Ensure events that modify user/group information are collected. (Automated) + - id: 32123 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the modification of user or group information, including that of passwords and old passwords if in use. - /etc/group - system groups - /etc/passwd - system users - /etc/gshadow - encrypted password for each group - /etc/shadow - system user passwords - /etc/security/opasswd - storage of old passwords if the relevant PAM module is in use The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify user/group information. Example: # printf \" -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity \" >> /etc/audit/rules.d/50-identity.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.8"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1047", "T1051", "T1053", "T1054", "T1055", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1088", "T1089", "T1096", "T1097", "T1098", "T1100", "T1134", "T1136", "T1145", "T1146", "T1150", "T1156", "T1157", "T1165", "T1169", "T1175", "T1184", "T1190", "T1196", "T1198", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1489", "T1492", "T1494", "T1495", "T1501", "T1504", "T1505", "T1525", "T1530"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity' + - "c:auditctl -l -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity" + + # 4.1.3.9 Ensure discretionary access control permission modification events are collected. (Automated) - Not Implemented + + # 4.1.3.10 Ensure successful file system mounts are collected. (Automated) + - id: 32124 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful file system mounts. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=unset -k mounts -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=unset -k mounts \" >> /etc/audit/rules.d/50-perm_mod.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.10"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["CM-6"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + + # 4.1.3.11 Ensure session initiation information is collected. (Automated) + - id: 32125 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. - /var/run/utmp - tracks all currently logged in users. - /var/log/wtmp - file tracks logins, logouts, shutdown, and reboot events. - /var/log/btmp - keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier "session.".' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor session initiation information. Example: # printf \" -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k session -w /var/log/btmp -p wa -k session \" >> /etc/audit/rules.d/50-session.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.11"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_techniques: ["T1003", "T1004", "T1017", "T1019", "T1021", "T1023", "T1028", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1055", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1088", "T1089", "T1096", "T1097", "T1098", "T1100", "T1110", "T1134", "T1136", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1175", "T1184", "T1185", "T1190", "T1196", "T1197", "T1198", "T1206", "T1208", "T1209", "T1210", "T1213", "T1214", "T1215", "T1218", "T1484", "T1489", "T1492", "T1494", "T1495", "T1501", "T1504", "T1505", "T1525", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session' + - "c:auditctl -l -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session" + + # 4.1.3.12 Ensure login and logout events are collected. (Automated) + - id: 32126 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. - /var/log/lastlog - maintain records of the last time a user successfully logged in. - /var/run/faillock - directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor login and logout events. Example: # printf \" -w /var/log/lastlog -p wa -k logins -w /var/run/faillock -p wa -k logins \" >> /etc/audit/rules.d/50-login.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.12"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.8.1.3", "A.9.4.2"] + - mitre_techniques: ["T1003", "T1004", "T1017", "T1019", "T1021", "T1023", "T1028", "T1031", "T1034", "T1035", "T1036", "T1037", "T1038", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1055", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1088", "T1089", "T1096", "T1097", "T1098", "T1100", "T1110", "T1114", "T1134", "T1136", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1161", "T1162", "T1163", "T1165", "T1168", "T1169", "T1175", "T1176", "T1184", "T1185", "T1190", "T1196", "T1197", "T1198", "T1206", "T1208", "T1209", "T1210", "T1213", "T1214", "T1215", "T1218", "T1482", "T1484", "T1489", "T1492", "T1494", "T1495", "T1501", "T1504", "T1505", "T1525", "T1527", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins' + - "c:auditctl -l -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins" + - "c:auditctl -l -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins" + + # 4.1.3.13 Ensure file deletion events by users are collected. (Automated) + - id: 32127 + title: "Ensure file deletion events by users are collected." + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for: - unlink - remove a file - unlinkat - remove a file attribute - rename - rename a file - renameat rename a file attribute system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor file deletion events by users. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete -a always,exit -F arch=b32 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete \" >> /etc/audit/rules.d/50-delete.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.13"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + + # 4.1.3.14 Ensure events that modify the system's Mandatory Access Controls are collected. (Automated) + - id: 32128 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor SELinux, an implementation of mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux/ and /usr/share/selinux/ directories. Note: If a different Mandatory Access Control method is used, changes to the corresponding directories should be audited." + rationale: "Changes to files in the /etc/selinux/ and /usr/share/selinux/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's Mandatory Access Controls. Example: # printf \" -w /etc/selinux -p wa -k MAC-policy -w /usr/share/selinux -p wa -k MAC-policy \" >> /etc/audit/rules.d/50-MAC-policy.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.14"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_techniques: ["T1031", "T1034", "T1038", "T1044", "T1053", "T1073", "T1076", "T1078", "T1081", "T1088", "T1114", "T1145", "T1161", "T1176", "T1213", "T1214", "T1482", "T1484", "T1505", "T1525", "T1527", "T1528", "T1530"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/usr/share/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - "c:auditctl -l -> r:^-w && r:/etc/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy" + - "c:auditctl -l -> r:^-w && r:/usr/share/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy" + + # 4.1.3.15 Ensure successful and unsuccessful attempts to use the chcon command are recorded. (Automated) + - id: 32129 + title: "Ensure successful and unsuccessful attempts to use the chcon command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chcon command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chcon command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.15"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + + # 4.1.3.16 Ensure successful and unsuccessful attempts to use the setfacl command are recorded. (Automated) + - id: 32130 + title: "Ensure successful and unsuccessful attempts to use the setfacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the setfacl command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the setfacl command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-priv_cmd.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.16"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + + # 4.1.3.17 Ensure successful and unsuccessful attempts to use the chacl command are recorded. (Automated) + - id: 32131 + title: "Ensure successful and unsuccessful attempts to use the chacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chacl command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chacl command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.17"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k priv_cmd|-F key=priv_cmd' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k priv_cmd|-F key=priv_cmd' + + # 4.1.3.18 Ensure successful and unsuccessful attempts to use the usermod command are recorded. (Automated) + - id: 32132 + title: "Ensure successful and unsuccessful attempts to use the usermod command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the usermod command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the usermod command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k usermod \" >> /etc/audit/rules.d/50-usermod.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.18"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + + # 4.1.3.19 Ensure kernel module loading unloading and modification is collected. (Automated) + - id: 32133 + title: "Ensure kernel module loading unloading and modification is collected." + description: "Monitor the loading and unloading of kernel modules. All the loading / listing / dependency checking of modules is done by kmod via symbolic links. The following system calls control loading and unloading of modules: - init_module - load a module - finit_module - load a module (used when the overhead of using cryptographically signed modules to determine the authenticity of a module can be avoided) - delete_module - delete a module - create_module - create a loadable module entry - query_module - query the kernel for various bits pertaining to modules Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of modules." + rationale: "Monitoring the use of all the various ways to manipulate kernel modules could provide system administrators with evidence that an unauthorized change was made to a kernel module, possibly compromising the security of the system." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor kernel module modification. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S init_module,finit_module,delete_module,create_module,query_module -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules -a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules \" >> /etc/audit/rules.d/50-kernel_modules.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.19"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l-> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - "c:ls -l /usr/sbin/lsmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/rmmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/insmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modinfo -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modprobe -> r:/bin/kmod" + - "c:ls -l /usr/sbin/depmod -> r:/bin/kmod" + + # 4.1.3.20 Ensure the audit configuration is immutable. (Automated) + - id: 32134 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: This setting will require the system to be rebooted to update the active auditd configuration settings.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line -e 2 at the end of the file: Example: # printf -- \"-e 2\" >> /etc/audit/rules.d/99-finalize.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.20"] + - cis_csc_v8: ["3.3", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AC-3", "AU-3", "AU-3(1)", "MP-2"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "7.1", "9.4.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + condition: all + rules: + - 'not d:/etc/audit/rules.d -> r:\.+.rules$ -> !r:\s*\t*-e 2$' + + # 4.1.3.21 Ensure the running and on disk configuration is the same. (Manual) + - id: 32135 + title: "Ensure the running and on disk configuration is the same." + description: "The Audit system have both on disk and running configuration. It is possible for these configuration settings to differ. Note: Due to the limitations of augenrules and auditctl, it is not absolutely guaranteed that loading the rule sets via augenrules --load will result in all rules being loaded or even that the user will be informed if there was a problem loading the rules." + rationale: "Configuration differences between what is currently running and what is on disk could cause unexpected problems or may give a false impression of compliance requirements." + remediation: 'If the rules are not aligned across all three () areas, run the following command to merge and load all rules: # augenrules --load Check if reboot is required. if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then echo "Reboot required to load rules"; fi.' + compliance: + - cis: ["4.1.3.21"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:augenrules --check -> r:/usr/sbin/augenrules && r:No change" + + # 4.2.1.1 Ensure rsyslog is installed. (Automated) + - id: 32136 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is recommended in environments where journald does not meet operation requirements." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # dnf install rsyslog." + compliance: + - cis: ["4.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q rsyslog -> r:^rsyslog-" + + # 4.2.1.2 Ensure rsyslog service is enabled. (Automated) + - id: 32137 + title: "Ensure rsyslog service is enabled." + description: "Once the rsyslog package is installed, ensure that the service is enabled." + rationale: "If the rsyslog service is not enabled to start on boot, the system will not capture logging events." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:^enabled" + + # 4.2.1.3 Ensure journald is configured to send logs to rsyslog. (Manual) + - id: 32138 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the RSyslog service provides a consistent means of log collection and export." + rationale: "IF RSyslog is the preferred method for capturing logs, all logs of the system should be sent to it for further processing. Note: This recommendation only applies if rsyslog is the chosen method for client side logging. Do not apply this recommendation if journald is used." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.3"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AC-3", "AU-12", "AU-2", "AU-4", "MP-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + + # 4.2.1.4 Ensure rsyslog default file permissions are configured. (Automated) + - id: 32139 + title: "Ensure rsyslog default file permissions are configured." + description: "RSyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + impact: "The systems global umask could override, but only making the file permissions stricter, what is configured in RSyslog with the FileCreateMode directive. RSyslog also has it's own $umask directive that can alter the intended file creation mode. In addition, consideration should be given to how FileCreateMode is used. Thus it is critical to ensure that the intended file creation mode is not overridden with less restrictive settings in /etc/rsyslog.conf, /etc/rsyslog.d/*conf files and that FileCreateMode is set before any file is created." + remediation: "Edit either /etc/rsyslog.conf or a dedicated .conf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640 Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.4"] + - cis_csc_v8: ["3.3", "8.2"] + - cis_csc_v7: ["5.1", "6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)", "164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 0640|^\$FileCreateMode 0600|^\$FileCreateMode 0400' + - 'd:/etc/rsyslog.d/ -> r:\.+.conf -> r:^\$FileCreateMode 0640|^\$FileCreateMode 0600|^\$FileCreateMode 0400' + + # 4.2.1.5 Ensure logging is configured. (Manual) - Not Implemented + # 4.2.1.6 Ensure rsyslog is configured to send logs to a remote log host. (Manual) - Not Implemented + + # 4.2.1.7 Ensure rsyslog is not configured to receive logs from a remote client. (Automated) + - id: 32140 + title: "Ensure rsyslog is not configured to receive logs from a remote client." + description: "RSyslog supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: 'Should there be any active log server configuration found in the auditing section, modify those file and remove the specific lines highlighted by the audit. Ensure none of the following entries are present in any of /etc/rsyslog.conf or /etc/rsyslog.d/*.conf. Old format $ModLoad imtcp $InputTCPServerRun New format module(load="imtcp") input(type="imtcp" port="514") Restart the service: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.7"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not d:/etc/rsyslog.d -> r:\.+.conf$ -> r:^\s*\t*\$ModLoad imtcp|\s*\t*^\$InputTCPServerRun|^\s*\t*module load="imtcp"|^\s*\t*input type="imtcp" port="514"' + - 'not f:/etc/rsyslog.conf -> r:^\s*\t*\$ModLoad imtcp|^\s*\t*\$InputTCPServerRun|^\s*\t*module load="imtcp"|^\s*\t*input type="imtcp" port="514"' + + # 4.2.2.1.1 Ensure systemd-journal-remote is installed. (Manual) + - id: 32141 + title: "Ensure systemd-journal-remote is installed." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to install systemd-journal-remote: # dnf install systemd-journal-remote." + compliance: + - cis: ["4.2.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q systemd-journal-remote -> r:^systemd-journal-remote-" + + # 4.2.2.1.2 Ensure systemd-journal-remote is configured. (Manual) - Not Implemented + + # 4.2.2.1.3 Ensure systemd-journal-remote is enabled. (Manual) + - id: 32142 + title: "Ensure systemd-journal-remote is enabled." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralized log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to enable systemd-journal-remote: # systemctl --now enable systemd-journal-upload.service." + compliance: + - cis: ["4.2.2.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "CM-7", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:systemctl is-enabled systemd-journal-upload.service -> r:^\s*\t*enabled$' + + # 4.2.2.1.4 Ensure journald is not configured to receive logs from a remote client. (Automated) + - id: 32143 + title: "Ensure journald is not configured to receive logs from a remote client." + description: "Journald supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts. NOTE: - The same package, systemd-journal-remote, is used for both sending logs to remote hosts and receiving incoming logs. - With regards to receiving logs, there are two services; systemd-journal- remote.socket and systemd-journal-remote.service." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: "Run the following command to disable systemd-journal-remote.socket: # systemctl --now mask systemd-journal-remote.socket." + compliance: + - cis: ["4.2.2.1.4"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-remote.socket -> r:^masked" + + # 4.2.2.2 Ensure journald service is enabled. (Automated) + - id: 32144 + title: "Ensure journald service is enabled." + description: "Ensure that the systemd-journald service is enabled to allow capturing of logging events." + rationale: "If the systemd-journald service is not enabled to start on boot, the system will not capture logging events." + remediation: "By default the systemd-journald service does not have an [Install] section and thus cannot be enabled / disabled. It is meant to be referenced as Requires or Wants by other unit files. As such, if the status of systemd-journald is not static, investigate why." + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journald.service -> r:^static" + + # 4.2.2.3 Ensure journald is configured to compress large log files. (Automated) + - id: 32145 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.3", "6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Compress=yes' + + # 4.2.2.4 Ensure journald is configured to write logfiles to persistent disk. (Automated) + - id: 32146 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss due to a reboot." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Storage=persistent' + + # 4.2.2.5 Ensure journald is not configured to send logs to rsyslog. (Manual) + - id: 32147 + title: "Ensure journald is not configured to send logs to rsyslog." + description: "Data from journald should be kept in the confines of the service and not forwarded on to other services." + rationale: "IF journald is the method for capturing logs, all logs of the system should be handled by journald and not forwarded to other logging mechanisms. Note: This recommendation only applies if journald is the chosen method for client side logging. Do not apply this recommendation if rsyslog is used." + remediation: "Edit the /etc/systemd/journald.conf file and ensure that ForwardToSyslog=yes is removed. Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.5"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'not f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + + # 4.2.2.6 Ensure journald log rotation is configured per site policy. (Manual) - Not Implemented + # 4.2.2.7 Ensure journald default file permissions configured. (Manual) - Not Implemented + + # 4.2.3 Ensure permissions on all logfiles are configured. (Automated) + - id: 32148 + title: "Ensure permissions on all logfiles are configured." + description: "Log files contain information from many services on the local system, or in the event of a centralized log server, others systems logs as well. In general log files are found in /var/log/, although application can be configured to store logs elsewhere. Should your application store logs in another, ensure to run the same test on that location." + rationale: "It is important that log files have the correct permissions to ensure that sensitive data is protected and that only the appropriate users / groups have access to them." + remediation: 'Run the following command to set permissions on all existing log files in /var/log. Although the command is not destructive, ensure that the output of the audit procedure is captured in the event that the remediation causes issues. # find /var/log/ -type f -perm /g+wx,o+rwx -exec chmod --changes g-wx,o-rwx "{}" + If there are services that logs to other locations, ensure that those log files have the appropriate permissions.' + compliance: + - cis: ["4.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:sh -c "find /var/log/ -type f -perm /g+wx,o+rwx -exec ls -l "{}" +" -> r:\w+' + + # 4.3 Ensure logrotate is configured. (Manual) - Not Implemented + + # 5.1.1 Ensure cron daemon is enabled. (Automated) + - id: 32149 + title: "Ensure cron daemon is enabled." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: # systemctl --now enable crond." + compliance: + - cis: ["5.1.1"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - "c:systemctl is-enabled cron -> r:^enabled" + + # 5.1.2 Ensure permissions on /etc/crontab are configured. (Automated) + - id: 32150 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab." + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured. (Automated) + - id: 32151 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : # chown root:root /etc/cron.hourly # chmod og-rwx /etc/cron.hourly." + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:Access:\s*\(0\d00/\w\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured. (Automated) + - id: 32152 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily." + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:Access:\s*\(0700/drwx------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured. (Automated) + - id: 32153 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : # chown root:root /etc/cron.weekly # chmod og-rwx /etc/cron.weekly." + compliance: + - cis: ["5.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:Access:\s*\(0\d00/\w\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured. (Automated) + - id: 32154 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly." + compliance: + - cis: ["5.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:Access:\s*\(0\d00/\w\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured. (Automated) + - id: 32155 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab , but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d." + compliance: + - cis: ["5.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:Access:\s*\(0\d00/\w\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.1.8 Ensure cron is restricted to authorized users. (Automated) + - id: 32156 + title: "Ensure cron is restricted to authorized users." + description: "If cron is installed in the system, configure /etc/cron.allow to allow specific users to use these services. If /etc/cron.allow does not exist, then /etc/cron.deny is checked. Any user not specifically defined in those files is allowed to use cron. By removing the file, only users in /etc/cron.allow are allowed to use cron. Note: Even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: 'Run the following script to remove /etc/cron.deny, create /etc/cron.allow, and set the file mode on /etc/cron.allow`: #!/usr/bin/env bash { if rpm -q cronie >/dev/null; then [ -e /etc/cron.deny ] && rm -f /etc/cron.deny [ ! -e /etc/cron.allow ] && touch /etc/cron.allow chown root:root /etc/cron.allow chmod u-x,go-rwx /etc/cron.allow else echo "cron is not installed on the system" fi } OR Run the following command to remove cron: # dnf remove cronie.' + compliance: + - cis: ["5.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "f:/etc/cron.allow" + - "not f:/etc/cron.deny" + - 'c:stat -L /etc/cron.allow -> r:Access:\s*\(0\d\d0/-\w\w\w\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.1.9 Ensure at is restricted to authorized users. (Automated) + - id: 32157 + title: "Ensure at is restricted to authorized users." + description: "If at is installed in the system, configure /etc/at.allow to allow specific users to use these services. If /etc/at.allow does not exist, then /etc/at.deny is checked. Any user not specifically defined in those files is allowed to use at. By removing the file, only users in /etc/at.allow are allowed to use at. Note: Even though a given user is not listed in at.allow, at jobs can still be run as that user. The at.allow file only controls administrative access to the at command for scheduling and modifying at jobs." + rationale: "On many systems, only the system administrator is authorized to schedule at jobs. Using the at.allow file to control who can run at jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: 'Run the following script to remove /etc/at.deny, create /etc/at.allow, and set the file mode for /etc/at.allow: #!/usr/bin/env bash { if rpm -q at >/dev/null; then [ -e /etc/at.deny ] && rm -f /etc/at.deny [ ! -e /etc/at.allow ] && touch /etc/at.allow chown root:root /etc/at.allow chmod u-x,go-rwx /etc/at.allow else echo "at is not installed on the system" fi } OR Run the following command to remove at: # dnf remove at.' + compliance: + - cis: ["5.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "f:/etc/at.allow" + - "not f:/etc/at.deny" + - 'c:stat -L /etc/at.allow -> r:Access:\s*\(0\d\d0/-\w\w\w\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured. (Automated) + - id: 32158 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.2.2 Ensure permissions on SSH private host key files are configured. (Automated) + - id: 32159 + title: "Ensure permissions on SSH private host key files are configured." + description: "An SSH private key is one of two files used in SSH public key authentication. In this authentication method, the possession of the private key is proof of identity. Only a private key that corresponds to a public key will be able to authenticate successfully. The private keys need to be stored and handled carefully, and no copies of the private key should be distributed." + rationale: "If an unauthorized user obtains the private SSH host key file, the host could be impersonated." + remediation: "Run the following commands to set permissions, ownership, and group on the private SSH host key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chmod u-x,g-wx,o- rwx {} \\; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chown root:ssh_keys {} \\;." + compliance: + - cis: ["5.2.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sh -c "find /etc/ssh -xdev -type f -name \"ssh_host_*_key\" -exec stat {} \\;" -> r:Access:\s*\( && !r:-rw-r--r--' + + # 5.2.3 Ensure permissions on SSH public host key files are configured. (Automated) + - id: 32160 + title: "Ensure permissions on SSH public host key files are configured." + description: "An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully." + rationale: "If a public host key file is modified by an unauthorized user, the SSH service may be compromised." + remediation: "Run the following commands to set permissions and ownership on the SSH host public key files # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chmod u-x,go- wx {} \\; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chown root:root {} \\;." + compliance: + - cis: ["5.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sh -c "find /etc/ssh -xdev -type f -name \"ssh_host_*_key.pub\" -exec stat {} \\;" -> r:Access:\s*\( && !r:-rw-r--r--' + + # 5.2.4 Ensure SSH access is limited. (Automated) + - id: 32161 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: o The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: o The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: o The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: o The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers OR AllowGroups OR DenyUsers OR DenyGroups ." + compliance: + - cis: ["5.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1176", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowUsers\s+\w+|^\s*AllowGroups\s+\w+|^\s*DenyUsers\s+\w+|^\s*DenyGroups\s+\w+' + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowUsers\s+\w+|^\s*AllowGroups\s+\w+|^\s*DenyUsers\s+\w+|^\s*DenyGroups\s+\w+' + + # 5.2.5 Ensure SSH LogLevel is appropriate. (Automated) + - id: 32162 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE OR LogLevel INFO." + references: + - "https://www.ssh.com/ssh/sshd_config/" + compliance: + - cis: ["5.2.5"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*LogLevel\s+INFO|^\s*\t*LogLevel\s+VERBOSE' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*LogLevel\s+ && !r:INFO|VERBOSE' + + # 5.2.6 Ensure SSH PAM is enabled. (Automated) + - id: 32163 + title: "Ensure SSH PAM is enabled." + description: 'UsePAM Enables the Pluggable Authentication Module interface. If set to "yes" this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types.' + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + impact: "If UsePAM is enabled, you will not be able to run sshd(8) as a non-root user." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes." + compliance: + - cis: ["5.2.6"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*usepam\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*usepam\s+no' + + # 5.2.7 Ensure SSH root login is disabled. (Automated) + - id: 32164 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no." + compliance: + - cis: ["5.2.7"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1176", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*PermitRootLogin\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*PermitRootLogin\s+yes' + + # 5.2.8 Ensure SSH HostbasedAuthentication is disabled. (Automated) + - id: 32165 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no." + compliance: + - cis: ["5.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - mitre_techniques: ["T1004", "T1017", "T1021", "T1023", "T1031", "T1034", "T1040", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1072", "T1075", "T1076", "T1078", "T1084", "T1089", "T1097", "T1098", "T1110", "T1114", "T1133", "T1134", "T1136", "T1152", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1185", "T1197", "T1213", "T1484", "T1489", "T1501", "T1528", "T1530", "T1537", "T1538", "T1539"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*HostbasedAuthentication\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*HostbasedAuthentication\s+yes' + + # 5.2.9 Ensure SSH PermitEmptyPasswords is disabled. (Automated) + - id: 32166 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no." + compliance: + - cis: ["5.2.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - mitre_techniques: ["T1004", "T1017", "T1021", "T1023", "T1031", "T1034", "T1040", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1072", "T1075", "T1076", "T1078", "T1084", "T1089", "T1097", "T1098", "T1110", "T1114", "T1133", "T1134", "T1136", "T1152", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1185", "T1197", "T1213", "T1484", "T1489", "T1501", "T1528", "T1530", "T1537", "T1538", "T1539"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*PermitEmptyPasswords\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*PermitEmptyPasswords\s+yes' + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled. (Automated) + - id: 32167 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no." + compliance: + - cis: ["5.2.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*PermitUserEnvironment\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*PermitUserEnvironment\s+yes' + + # 5.2.11 Ensure SSH IgnoreRhosts is enabled. (Automated) + - id: 32168 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes." + compliance: + - cis: ["5.2.11"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*IgnoreRhosts\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*IgnoreRhosts\s+no' + + # 5.2.12 Ensure SSH X11 forwarding is disabled. (Automated) + - id: 32169 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no." + compliance: + - cis: ["5.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*X11Forwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*X11Forwarding\s+yes' + + # 5.2.13 Ensure SSH AllowTcpForwarding is disabled. (Automated) + - id: 32170 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments that employ mainframe systems as their application backends. In those environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no." + references: + - "https://www.ssh.com/ssh/tunneling/example" + compliance: + - cis: ["5.2.13"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*AllowTcpForwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*AllowTcpForwarding\s+yes' + + # 5.2.14 Ensure system-wide crypto policy is not over-ridden. (Automated) + - id: 32171 + title: "Ensure system-wide crypto policy is not over-ridden." + description: "System-wide Crypto policy can be over-ridden or opted out of for openSSH." + rationale: "Over-riding or opting out of the system-wide crypto policy could allow for the use of less secure Ciphers, MACs, KexAlgorithms and GSSAPIKexAlgorithm." + remediation: "Run the following commands: # sed -ri \"s/^\\s*(CRYPTO_POLICY\\s*=.*)$/# \\1/\" /etc/sysconfig/sshd # systemctl reload sshd." + compliance: + - cis: ["5.2.14"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - mitre_techniques: ["T1040", "T1070", "T1114", "T1119", "T1145", "T1208", "T1492", "T1493", "T1527", "T1530"] + - nist_sp_800-53: ["SC-8"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'not f:/etc/sysconfig/sshd -> ^\s*CRYPTO_POLICY=' + + # 5.2.15 Ensure SSH warning banner is configured. (Automated) + - id: 32172 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.2.15"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*banner\s*\t*/' + - 'f:/etc/ssh/sshd_config -> r:^\s*\t*banner\s*\t*/' + + # 5.2.16 Ensure SSH MaxAuthTries is set to 4 or less. (Automated) + - id: 32173 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4." + compliance: + - cis: ["5.2.16"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - mitre_techniques: ["T1004", "T1021", "T1023", "T1031", "T1034", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1072", "T1075", "T1076", "T1078", "T1084", "T1089", "T1097", "T1134", "T1152", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1185", "T1197", "T1213", "T1484", "T1489", "T1501", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*\t*MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxAuthTries\s*\t*(\d+) compare > 4' + + # 5.2.17 Ensure SSH MaxStartups is configured. (Automated) + - id: 32174 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: maxstartups 10:30:60." + compliance: + - cis: ["5.2.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*\t*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'c:sshd -T -> n:^\s*\t*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'c:sshd -T -> n:^\s*\t*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s+(\d+):\d+:\d+ compare > 10' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s+\d+:(\d+):\d+ compare > 30' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s+\d+:\d+:(\d+) compare > 60' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + + # 5.2.18 Ensure SSH MaxSessions is set to 10 or less. (Automated) + - id: 32175 + title: "Ensure SSH MaxSessions is set to 10 or less." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10." + compliance: + - cis: ["5.2.18"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*\t*maxsessions\s+(\d+) compare <= 10' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*maxsessions\s+(\d+) compare <= 10' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*maxsessions\s+(\d+) compare > 10' + + # 5.2.19 Ensure SSH LoginGraceTime is set to one minute or less. (Automated) + - id: 32176 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60." + compliance: + - cis: ["5.2.19"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*\t*logingracetime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*logingracetime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + + # 5.2.20 Ensure SSH Idle Timeout Interval is configured. (Automated) + - id: 32177 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. - ClientAliveInterval sets 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 default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax sets the number of client alive messages which may be sent without sshd receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. The default value is 3. o The client alive messages are sent through the encrypted channel o Setting ClientAliveCountMax to 0 disables connection termination Example: The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value reduces this risk. - The recommended ClientAliveInterval setting is no greater than 900 seconds (15 minutes) - The recommended ClientAliveCountMax setting is 0 - At the 15 minute interval, if the ssh session is inactive, the session will be terminated." + impact: "In some cases this setting may cause termination of long-running scripts over SSH or remote automation tools which rely on SSH. In developing the local site policy, the requirements of such scripts should be considered and appropriate ServerAliveInterval and ClientAliveInterval settings should be calculated to insure operational continuity." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy. This should include ClientAliveInterval between 1 and 900 and ClientAliveCountMax of 0: ClientAliveInterval 900 ClientAliveCountMax 0." + references: + - "https://man.openbsd.org/sshd_config" + compliance: + - cis: ["5.2.20"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.8.1.3"] + - mitre_techniques: ["T1031", "T1034", "T1038", "T1044", "T1053", "T1073", "T1076", "T1078", "T1081", "T1088", "T1110", "T1114", "T1145", "T1161", "T1176", "T1213", "T1214", "T1482", "T1484", "T1505", "T1525", "T1527", "T1528", "T1530"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*\t*clientaliveinterval\s*\t*(\d+) compare > 0 && n:^\s*\t*clientaliveinterval\s*\t*(\d+) compare <= 900' + - 'not c:sshd -T -> n:^\s*\t*clientalivecountmax\s*\t*(\d+) compare != 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*clientaliveinterval\s*\t*(\d+) compare > 0 && n:^\s*\t*clientaliveinterval\s*\t*(\d+) compare <= 900' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*clientalivecountmax\s*\t*(\d+) compare != 0' + + # 5.3.1 Ensure sudo is installed. (Automated) + - id: 32178 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plug-in architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plug-ins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers and any entries in /etc/sudoers.d. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo # dnf install sudo." + compliance: + - cis: ["5.3.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1176", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - "c:dnf list sudo -> r:^sudo.x86_64" + + # 5.3.2 Ensure sudo commands use pty. (Automated) + - id: 32179 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo terminal (pseudo-pty)." + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: "Edit the file /etc/sudoers with visudo or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["5.3.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*use_pty' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*use_pty' + + # 5.3.3 Ensure sudo log file exists. (Automated) + - id: 32180 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: 'Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile="" Example Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["5.3.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*logfile=' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*logfile=' + + # 5.3.4 Ensure users must provide password for escalation. (Automated) + - id: 32181 + title: "Ensure users must provide password for escalation." + description: "The operating system must be configured so that users must provide a password for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + impact: "This will prevent automated processes from being able to elevate privileges. To include Ansible and AWS builds." + remediation: "Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any line with occurrences of NOPASSWD tags in the file." + compliance: + - cis: ["5.3.4"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1176", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*\t*# && r:NOPASSWD' + - 'd:/etc/sudoers.d -> r:\.* -> !r:^\s*\t*# && r:NOPASSWD' + + # 5.3.5 Ensure re-authentication for privilege escalation is not disabled globally. (Automated) + - id: 32182 + title: "Ensure re-authentication for privilege escalation is not disabled globally." + description: "The operating system must be configured so that users must re-authenticate for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + remediation: "Configure the operating system to require users to reauthenticate for privilege escalation. Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any occurrences of !authenticate tags in the file(s)." + compliance: + - cis: ["5.3.5"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1176", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*\t*# && r:!authenticate' + - 'd:/etc/sudoers.d -> r:\.* -> !r:^\s*\t*# && r:!authenticate' + + # 5.3.6 Ensure sudo authentication timeout is configured correctly. (Automated) + - id: 32183 + title: "Ensure sudo authentication timeout is configured correctly." + description: "sudo caches used credentials for a default of 5 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized privileged access to another user." + remediation: "If the currently configured timeout is larger than 15 minutes, edit the file listed in the audit section with visudo -f and modify the entry timestamp_timeout= to 15 minutes or less as per your site policy. The value is in minutes. This particular entry may appear on its own, or on the same line as env_reset. See the following two examples: Defaults env_reset, timestamp_timeout=15 Defaults timestamp_timeout=15 Defaults env_reset." + references: + - "https://www.sudo.ws/man/1.9.0/sudoers.man.html" + compliance: + - cis: ["5.3.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1176", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'c:sudo -V -> r:Authentication timestamp timeout:\s*\t*5.0 minutes' + - 'f:/etc/sudoers -> n:timestamp_timeout=(\d+) compare < 15 && n:timestamp_timeout=(\d+) compare != -1' + + # 5.3.7 Ensure access to the su command is restricted. (Automated) + - id: 32184 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.3.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_wheel.so && r:use_uid && r:group=\w+' + + # 5.4.1 Ensure custom authselect profile is used. (Manual) - Not Implemented + + # 5.4.2 Ensure authselect includes with-faillock. (Automated) + - id: 32185 + title: "Ensure authselect includes with-faillock." + description: "The pam_faillock.so module maintains a list of failed authentication attempts per user during a specified interval and locks the account in case there were more than deny consecutive failed authentications. It stores the failure records into per-user files in the tally directory." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Run the following commands to include the with-faillock option to the current authselect profile: # authselect enable-feature with-faillock # authselect apply-changes." + compliance: + - cis: ["5.4.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.2.6"] + - mitre_techniques: ["T1004", "T1021", "T1023", "T1031", "T1034", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1072", "T1075", "T1076", "T1078", "T1084", "T1089", "T1097", "T1134", "T1152", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1185", "T1197", "T1213", "T1484", "T1489", "T1501", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:required && r:pam_faillock.so" + - "f:/etc/pam.d/system-auth -> r:required && r:pam_faillock.so" + + # 5.5.1 Ensure password creation requirements are configured. (Automated) + - id: 32186 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. - minlen=14 - password must be 14 characters or more Either of the following can be used to enforce complex passwords: - minclass=4 - provide at least four classes of characters for the new password OR - dcredit=-1 - provide at least one digit - ucredit=-1 - provide at least one uppercase character - ocredit=-1 - provide at least one special character - lcredit=-1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Run the following script to update the system-auth and password-auth files #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+.*enforce_for_r oot\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 enforce_for_root/' \"$file\" fi if grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=([4- 9]|[1-9][0-9]+)\\b.*$' \"$file\"; then sed -ri '/pwquality/s/retry=\\S+/retry=3/' \"$file\" elif ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 retry=3/' \"$file\" fi done authselect apply-changes." + compliance: + - cis: ["5.5.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - "f:/etc/pam.d/system-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s+\t*=\s+\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> r:^\s*minclass|^\s*\Scredit' + + # 5.5.2 Ensure lockout for failed password attempts is configured. (Automated) + - id: 32187 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. - deny= - Number of attempts before the account is locked - unlock_time= - Time in seconds before the account is unlocked Note: The maximum configurable value for unlock_time is 604800." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Set password lockouts and unlock times to conform to site policy. deny should be not greater than 5 and unlock_time should be 0 (never), or 900 seconds or greater. Depending on the version you are running, follow one of the two methods bellow. Versions 8.2 and later: Edit /etc/security/faillock.conf and update or add the following lines: deny = 5 unlock_time = 900 Versions 8.0 and 8.1: Run the following script to update the system-auth and password-auth files. This script will update/add the deny=5 and unlock_time=900 options. This script should be modified as needed to follow local site policy. #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if grep -Pq -- '^\\h*auth\\h+required\\h+pam_faillock\\.so(\\h+[^#\\n\\r]+)?\\h+deny=(0|[6-9]|[1- 9][0-9]+)\\b.*$' \"$file\"; then sed -ri '/pam_faillock.so/s/deny=\\S+/deny=5/g' \"$file\" elif ! grep -Pq -- '^\\h*auth\\h+required\\h+pam_faillock\\.so(\\h+[^#\\n\\r]+)?\\h+deny=\\d*\\b.*$' \"$file\"; then sed -r 's/^\\s*(auth\\s+required\\s+pam_faillock\\.so\\s+)([^{}#\\n\\r]+)?\\s*(\\{.*\\})?(.*)$ /\\1\\2\\3 deny=5 \\4/' $file fi if grep -P -- '^\\h*(auth\\h+required\\h+pam_faillock\\.so\\h+)([^#\\n\\r]+)?\\h+unlock_time=([1- 9]|[1-9][0-9]|[1-8][0-9][0-9])\\b.*$' \"$file\"; then sed -ri '/pam_faillock.so/s/unlock_time=\\S+/unlock_time=900/g' \"$file\" elif ! grep -Pq -- '^\\h*auth\\h+required\\h+pam_faillock\\.so(\\h+[^#\\n\\r]+)?\\h+unlock_time=\\d*\\b.*$ ' \"$file\"; then sed -ri 's/^\\s*(auth\\s+required\\s+pam_faillock\\.so\\s+)([^{}#\\n\\r]+)?\\s*(\\{.*\\})?(.*)$ /\\1\\2\\3 unlock_time=900 \\4/' \"$file\" fi done authselect apply-changes." + compliance: + - cis: ["5.5.2"] + - cis_csc_v8: ["6.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1"] + - hipaa: ["164.308(a)(3)(ii)(C)"] + - iso_27001-2013: ["A.9.2.6"] + - mitre_techniques: ["T1004", "T1021", "T1023", "T1031", "T1034", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1072", "T1075", "T1076", "T1078", "T1084", "T1089", "T1097", "T1134", "T1152", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1185", "T1197", "T1213", "T1484", "T1489", "T1501", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-2(1)"] + - pci_dss_v3.2.1: ["8.1.3"] + - pci_dss_v4.0: ["8.2.4", "8.2.5"] + - soc_2: ["CC6.2", "CC6.3"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_faillock.so\s*preauth' + - 'f:/etc/pam.d/password-auth -> !r:^\s*\t*# && r:auth && r:required && r:\s*\t*pam_faillock.so && r:\s*\t*authfail' + - 'f:/etc/pam.d/system-auth -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_faillock.so\s*preauth' + - 'f:/etc/pam.d/system-auth -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_faillock.so' + - 'f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:deny\s*\t*=\s*\t*(\d+) compare <= 5' + - 'f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:fail_interval\s*\t*=\s*\t*(\d+) compare <= 900' + + # 5.5.3 Ensure password reuse is limited. (Automated) + - id: 32188 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. - remember=<5> - Number of old passwords to remember." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note: These change only apply to accounts configured on the local system." + remediation: "Set remembered password history to conform to site policy. Run the following script to add or modify the pam_pwhistory.so and pam_unix.so lines to include the remember option: #!/usr/bin/env bash { file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/system-auth\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so\\s+([^# \\n\\r]+\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file elif grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?.*$' \"$file\"; then sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so/ s/$/ remember=5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/i password required pam_pwhistory.so remember=5 use_authtok' $file fi fi if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so\\s+([^#\\n\\r] +\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/ s/$/ remember=5/' $file fi fi authselect apply-changes }." + compliance: + - cis: ["5.5.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/common-password -> !r:^\s*\t*# && r:password\s*\t*requisite|password\s*\t*sufficient && r:pam_pwhistory.so|pam_unix.so && n:remember\s*\t*=\s*\t*(\d+) compare => 5' + + # 5.5.4 Ensure password hashing algorithm is SHA-512. (Automated) + - id: 32189 + title: "Ensure password hashing algorithm is SHA-512." + description: "A cryptographic hash function converts an arbitrary-length input into a fixed length output. Password hashing performs a one-way transformation of a password, turning the password into another string, called the hashed password." + rationale: "The SHA-512 algorithm provides stronger hashing than other hashing algorithms used for password hashing with Linux, providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note: These changes only apply to accounts configured on the local system." + remediation: "Set password hashing algorithm to sha512. Edit /etc/libuser.conf and edit of add the following line: crypt_style = sha512 Edit /etc/login.defs and edit or add the following line: ENCRYPT_METHOD SHA512 Run the following script to configure pam_unix.so to use the sha512 hashing algorithm: #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+sha512\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+(md5|blowfish|bigcrypt|sha256)\\b.*$' \"$file\"; then sed -ri 's/(md5|blowfish|bigcrypt|sha256)/sha512/' \"$file\" else sed -ri 's/(^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix.so\\s+)(.*)$/\\1s ha512 \\3/' $file fi fi done authselect apply-changes Note: This only effects local users and passwords created after updating the files to use sha512. If it is determined that the password algorithm being used is not SHA-512, once it is changed, it is recommended that all user ID's be immediately expired and forced to change their passwords on next login." + compliance: + - cis: ["5.5.4"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> r:\s*ENCRYPT_METHOD SHA512' + - 'f:/etc/libuser.conf -> r:\s*crypt_style = sha512' + - 'f:/etc/pam.d/password-auth -> r:\s*password && r:requisite|required|sufficient && r:pam_unix.so && r:sha512' + - 'f:/etc/pam.d/system-auth -> r:\s*password && r:requisite|required|sufficient && r:pam_unix.so && r:sha512' + + # 5.6.1.1 Ensure password expiration is 365 days or less. (Automated) + - id: 32190 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + compliance: + - cis: ["5.6.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:\d+:(\d+): compare > 365' + + # 5.6.1.2 Ensure minimum days between password changes is 7 or more. (Automated) + - id: 32191 + title: "Ensure minimum days between password changes is 7 or more." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs : PASS_MIN_DAYS 7 Modify user parameters for all users with a password set to match: # chage --mindays 7 ." + compliance: + - cis: ["5.6.1.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:(\d+): compare < 7' + + # 5.6.1.3 Ensure password expiration warning days is 7 or more. (Automated) + - id: 32192 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs : PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["5.6.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:\d+:\d+:(\d+): compare < 7' + + # 5.6.1.4 Ensure inactive password lock is 30 days or less. (Automated) + - id: 32193 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["5.6.1.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - "not c:useradd -D -> r:^INACTIVE=-1" + - 'not f:/etc/shadow -> n:^\w+:\w+:\w+:\w+:\w+:\w+:(\d+): compare > 30' + - 'not f:/etc/shadow -> r:^\w+:\w+:\w+:\w+:\w+:\w+:-1:' + + # 5.6.1.5 Ensure all users last password change date is in the past. (Automated) - Not Implemented + # 5.6.2 Ensure system accounts are secured. (Automated) - Not Implemented + # 5.6.3 Ensure default user shell timeout is 900 seconds or less. (Automated) - Not Implemented + + # 5.6.4 Ensure default group for the root account is GID 0. (Automated) + - id: 32194 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root account belongs to. This affects permissions of files that are created by the root account." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root account default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.6.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^\s*\t*# && r:root:\w+:\w+:0:' + + # 5.6.5 Ensure default user umask is 027 or more restrictive. (Automated) - Not Implemented + + # 6.1.1 Audit system file permissions. (Manual) + # 6.1.2 Ensure sticky bit is set on all world-writable directories. (Automated) - Not Implemented + + # 6.1.3 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 32195 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/passwd -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.4 Ensure permissions on /etc/shadow are configured. (Automated) + - id: 32196 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following commands to set owner, group, and permissions on /etc/shadow: # chown root:root /etc/shadow # chmod 0000 /etc/shadow." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/shadow -> r:0 root 0 root && n:shadow (\d+) compare == 0' + + # 6.1.5 Ensure permissions on /etc/group are configured. (Automated) + - id: 32197 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following commands to set owner, group, and permissions on /etc/group: # chown root:root /etc/group # chmod u-x,g-wx,o-wx /etc/group." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/group -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.6 Ensure permissions on /etc/gshadow are configured. (Automated) + - id: 32198 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run the following commands to set owner, group, and permissions on /etc/gshadow # chown root:root /etc/gshadow # chmod 0000 /etc/gshadow." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/gshadow -> r:0 root 0 root && n:gshadow (\d+) compare == 0' + + # 6.1.7 Ensure permissions on /etc/passwd- are configured. (Automated) + - id: 32199 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod u-x,go-wx /etc/passwd-." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/passwd- -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.8 Ensure permissions on /etc/shadow- are configured. (Automated) + - id: 32200 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/shadow- : # chown root:root /etc/shadow- # chmod 0000 /etc/shadow-." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/shadow- -> r:0 root 0 root && n:shadow- (\d+) compare == 0' + + # 6.1.9 Ensure permissions on /etc/group- are configured. (Automated) + - id: 32201 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/group-: # chown root:root /etc/group- # chmod u-x,go-wx /etc/group-." + compliance: + - cis: ["6.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/group- -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.10 Ensure permissions on /etc/gshadow- are configured. (Automated) + - id: 32202 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chmod 0000 /etc/gshadow-." + compliance: + - cis: ["6.1.10"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/gshadow -> r:0 root 0 root && n:gshadow (\d+) compare == 0' + + # 6.1.11 Ensure no world writable files exist. (Automated) - Not Implemented + # 6.1.12 Ensure no unowned files or directories exist. (Automated) - Not Implemented + # 6.1.13 Ensure no ungrouped files or directories exist. (Automated) - Not Implemented + # 6.1.14 Audit SUID executables. (Manual) - Not Implemented + # 6.1.15 Audit SGID executables. (Manual) - Not Implemented + + # 6.2.1 Ensure password fields are not empty. (Automated) + - id: 32203 + title: "Ensure password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'not f:/etc/shadow -> r:^\w+::' + + # 6.2.2 Ensure all groups in /etc/passwd exist in /etc/group. (Automated) - Not Implemented + # 6.2.3 Ensure no duplicate UIDs exist. (Automated) - Not Implemented + # 6.2.4 Ensure no duplicate GIDs exist. (Automated) - Not Implemented + # 6.2.5 Ensure no duplicate user names exist. (Automated) - Not Implemented + # 6.2.6 Ensure no duplicate group names exist. (Automated) - Not Implemented + # 6.2.7 Ensure root PATH Integrity. (Automated) - Not Implemented + + # 6.2.8 Ensure root is the only UID 0 account. (Automated) + - id: 32204 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: 'This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in recommendation "Ensure access to the su command is restricted".' + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'not f:/etc/passwd -> !r:^\s*\t*# && !r:^root: && r:^\w+:\w+:0:' + + # 6.2.9 Ensure all users' home directories exist. (Automated) - Not Implemented + # 6.2.10 Ensure users own their home directories. (Automated) - Not Implemented + # 6.2.11 Ensure users' home directories permissions are 750 or more restrictive. (Automated) - Not Implemented + # 6.2.12 Ensure users' dot files are not group or world writable. (Automated) - Not Implemented + # 6.2.13 Ensure users' .netrc Files are not group or world accessible. (Automated) - Not Implemented + # 6.2.14 Ensure no users have .forward files. (Automated) - Not Implemented + # 6.2.15 Ensure no users have .netrc files. (Automated) - Not Implemented + # 6.2.16 Ensure no users have .rhosts files. (Automated) -Not Implemented \ No newline at end of file diff --git a/etc/ruleset/sca/almalinux/cis_alma_linux_9.yml b/etc/ruleset/sca/almalinux/cis_alma_linux_9.yml new file mode 100644 index 0000000000..51498e3f6d --- /dev/null +++ b/etc/ruleset/sca/almalinux/cis_alma_linux_9.yml @@ -0,0 +1,4580 @@ +# Security Configuration Assessment +# CIS Checks for Alma Linux 9 +# Copyright (C) 2023, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Alma Linux 9 Benchmark v1.0.0 - 06-02-2022 + +policy: + id: "cis_alma_linux_9" + file: "cis_alma_linux_9.yml" + name: "CIS Benchmark for Alma Linux 9" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Alma Linux 9 systems running on x86 and x64 platforms. This document was tested against Alma Linux 9." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Alma Linux platform." + description: "Requirements for running the policy against Alma Linux 9." + condition: any + rules: + - "f:/etc/redhat-release -> r:^AlmaLinux && r:release 9" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # 1.1.1.1 Ensure mounting of squashfs filesystems is disabled. (Automated) + + - id: 32500 + title: "Ensure mounting of squashfs filesystems is disabled." + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: 'As Snap packages utilizes squashfs as a compressed filesystem, disabling squashfs will cause Snap packages to fail. Snap application packages of software are self-contained and work across a range of Linux distributions. This is unlike traditional Linux package management approaches, like APT or RPM, which require specifically adapted packages per Linux distribution on an application update and delay therefore application deployment from developers to their software''s end-user. Snaps themselves have no dependency on any external store ("App store"), can be obtained from any source and can be therefore used for upstream software deployment.' + remediation: "Run the following script to disable squashfs: #!/usr/bin/env bash { l_mname=\"squashfs\" # set module name # Check if the module exists on the system if [ -z \"$(modprobe -n -v \"$l_mname\" 2>&1 | grep -Pi -- \"\\h*modprobe:\\h+FATAL:\\h+Module\\h+$l_mname\\h+not\\h+found\\h+in\\h+directory\")\" ]; then # Remediate loadable l_loadable=\"$(modprobe -n -v \"$l_mname\")\" [ \"$(wc -l <<< \"$l_loadable\")\" -gt \"1\" ] && l_loadable=\"$(grep -P -- \"(^\\h*install|\\b$l_mname)\\b\" <<< \"$l_loadable\")\" if ! grep -Pq -- '^\\h*install \\/bin\\/(true|false)' <<< \"$l_loadable\"; then echo -e \" - setting module: \\\"$l_mname\\\" to be not loadable\" echo -e \"install $l_mname /bin/false\" >> /etc/modprobe.d/\"$l_mname\".conf fi # Remediate loaded if lsmod | grep \"$l_mname\" > /dev/null 2>&1; then echo -e \" - unloading module \\\"$l_mname\\\"\" modprobe -r \"$l_mname\" fi # Remediate deny list if ! modprobe --showconfig | grep -Pq -- \"^\\h*blacklist\\h+$l_mname\\b\"; then echo -e \" - deny listing \\\"$l_mname\\\"\" echo -e \"blacklist $l_mname\" >> /etc/modprobe.d/\"$l_mname\".conf fi else echo -e \" - Nothing to remediate\\n - Module \\\"$l_mname\\\" doesn't exist on the system\" fi }." + compliance: + - cis: ["1.1.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1050"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1005"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/false|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + - 'd:/etc/modprobe.d -> r:\.*.conf -> r:blacklist\t*\s*squashfs' + + # 1.1.1.2 Ensure mounting of udf filesystems is disabled. (Automated) + + - id: 32501 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: "Microsoft Azure requires the usage of udf. udf should not be disabled on systems run on Microsoft Azure." + remediation: "Run the following script to disable the udf filesystem: #!/usr/bin/env bash { l_mname=\"udf\" # set module name # Check if the module exists on the system if [ -z \"$(modprobe -n -v \"$l_mname\" 2>&1 | grep -Pi -- \"\\h*modprobe:\\h+FATAL:\\h+Module\\h+$l_mname\\h+not\\h+found\\h+in\\h+directory\")\" ]; then # Remediate loadable l_loadable=\"$(modprobe -n -v \"$l_mname\")\" [ \"$(wc -l <<< \"$l_loadable\")\" -gt \"1\" ] && l_loadable=\"$(grep -P -- \"(^\\h*install|\\b$l_mname)\\b\" <<< \"$l_loadable\")\" if ! grep -Pq -- '^\\h*install \\/bin\\/(true|false)' <<< \"$l_loadable\"; then echo -e \" - setting module: \\\"$l_mname\\\" to be not loadable\" echo -e \"install $l_mname /bin/false\" >> /etc/modprobe.d/\"$l_mname\".conf fi # Remediate loaded if lsmod | grep \"$l_mname\" > /dev/null 2>&1; then echo -e \" - unloading module \\\"$l_mname\\\"\" modprobe -r \"$l_mname\" fi # Remediate deny list if ! modprobe --showconfig | grep -Pq -- \"^\\h*blacklist\\h+$l_mname\\b\"; then echo -e \" - deny listing \\\"$l_mname\\\"\" echo -e \"blacklist $l_mname\" >> /etc/modprobe.d/\"$l_mname\".conf fi else echo -e \" - Nothing to remediate\\n - Module \\\"$l_mname\\\" doesn't exist on the system\" fi }." + compliance: + - cis: ["1.1.1.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1050"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1005"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v udf -> r:install /bin/false|Module udf not found" + - "not c:lsmod -> r:udf" + - 'd:/etc/modprobe.d -> r:\.*.conf -> r:blacklist\t*\s*udf' + + # 1.1.2.1 Ensure /tmp is a separate partition. (Automated) + + - id: 32502 + title: "Ensure /tmp is a separate partition." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "By design files saved to /tmp should have no expectation of surviving a reboot of the system. tmpfs is ram based and all files stored to tmpfs will be lost when the system is rebooted. If files need to be persistent through a reboot, they should be saved to /var/tmp not /tmp. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a configuration where /tmp is not a separate file system it will essentially have the whole disk available, as the default installation only creates a single / partition. On the other hand, a RAM-based /tmp (as with tmpfs) will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily. Another alternative is to create a dedicated partition for /tmp from a separate volume or disk. One of the downsides of a disk-based dedicated partition is that it will be slower than tmpfs which is RAM-based." + remediation: "First ensure that systemd is correctly configured to ensure that /tmp will be mounted at boot time. # systemctl unmask tmp.mount For specific configuration requirements of the /tmp mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 tmpfs /tmp 0 Example of using a volume or disk with specific mount options. The source location of the volume or disk will vary depending on your environment. /tmp defaults,nodev,nosuid,noexec 0 0." + references: + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + - "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html" + compliance: + - cis: ["1.1.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s' + - "c:systemctl is-enabled tmp.mount -> r:enabled|static|generated" + + # 1.1.2.2 Ensure nodev option set on /tmp partition. (Automated) + + - id: 32503 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s && r:nodev' + + # 1.1.2.3 Ensure noexec option set on /tmp partition. (Automated) + + - id: 32504 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s && r:noexec' + + # 1.1.2.4 Ensure nosuid option set on /tmp partition. (Automated) + + - id: 32505 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s && r:nosuid' + + # 1.1.3.1 Ensure separate partition exists for /var. (Automated) + + - id: 32506 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "The reasoning for mounting /var on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s' + + # 1.1.3.2 Ensure nodev option set on /var partition. (Automated) + + - id: 32507 + title: "Ensure nodev option set on /var partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s && r:nodev' + + # 1.1.3.3 Ensure nosuid option set on /var partition. (Automated) + + - id: 32508 + title: "Ensure nosuid option set on /var partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s && r:nosuid' + + # 1.1.4.1 Ensure separate partition exists for /var/tmp. (Automated) + + - id: 32509 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications. Temporary files residing in /var/tmp are to be preserved between reboots." + rationale: "The reasoning for mounting /var/tmp on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/tmp directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/tmp and cause potential disruption to daemons as the disk is full. Fine grained control over the mount Configuring /var/tmp as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var/tmp may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s' + + # 1.1.4.2 Ensure noexec option set on /var/tmp partition. (Automated) + + - id: 32510 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s && r:noexec' + + # 1.1.4.3 Ensure nosuid option set on /var/tmp partition. (Automated) + + - id: 32511 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s && r:nosuid' + + # 1.1.4.4 Ensure nodev option set on /var/tmp partition. (Automated) + + - id: 32512 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s && r:nodev' + + # 1.1.5.1 Ensure separate partition exists for /var/log. (Automated) + + - id: 32513 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "The reasoning for mounting /var/log on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log directory contains log files which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. Fine grained control over the mount Configuring /var/log as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of log data As /var/log contains log files, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.5.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_techniques: ["T0005", "T1499", "T1499.001"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s' + + # 1.1.5.2 Ensure nodev option set on /var/log partition. (Automated) + + - id: 32514 + title: "Ensure nodev option set on /var/log partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s && r:nodev' + + # 1.1.5.3 Ensure noexec option set on /var/log partition. (Automated) + + - id: 32515 + title: "Ensure noexec option set on /var/log partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot run executable binaries from /var/log." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s && r:noexec' + + # 1.1.5.4 Ensure nosuid option set on /var/log partition. (Automated) + + - id: 32516 + title: "Ensure nosuid option set on /var/log partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot create setuid files in /var/log." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s && r:nosuid' + + # 1.1.6.1 Ensure separate partition exists for /var/log/audit. (Automated) + + - id: 32517 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "The reasoning for mounting /var/log/audit on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log/audit directory contains the audit.log file which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/log/audit and cause auditd to trigger it's space_left_action as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var/log/audit as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of audit data As /var/log/audit contains audit logs, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.6.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s' + + # 1.1.6.2 Ensure noexec option set on /var/log/audit partition. (Automated) + + - id: 32518 + title: "Ensure noexec option set on /var/log/audit partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log/audit filesystem is only intended for audit logs, set this option to ensure that users cannot run executable binaries from /var/log/audit." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s && r:noexec' + + # 1.1.6.3 Ensure nodev option set on /var/log/audit partition. (Automated) + + - id: 32519 + title: "Ensure nodev option set on /var/log/audit partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log/audit filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s && r:nodev' + + # 1.1.6.4 Ensure nosuid option set on /var/log/audit partition. (Automated) + + - id: 32520 + title: "Ensure nosuid option set on /var/log/audit partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log/audit filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s && r:nosuid' + + # 1.1.7.1 Ensure separate partition exists for /home. (Automated) + + - id: 32521 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "The reasoning for mounting /home on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /home directory contains user generated data, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /home and impact all local users. Fine grained control over the mount Configuring /home as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. In the case of /home options such as usrquota/grpquota may be considered to limit the impact that users can have on each other with regards to disk resource exhaustion. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of user data As /home contains user data, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.7.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s' + + # 1.1.7.2 Ensure nodev option set on /home partition. (Automated) + + - id: 32522 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /home filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s && r:nodev' + + # 1.1.7.3 Ensure nosuid option set on /home partition. (Automated) + + - id: 32523 + title: "Ensure nosuid option set on /home partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /home filesystem is only intended for user file storage, set this option to ensure that users cannot create setuid files in /home." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s && r:nosuid' + + # 1.1.8.1 Ensure /dev/shm is a separate partition. (Automated) + + - id: 32524 + title: "Ensure /dev/shm is a separate partition." + description: "The /dev/shm directory is a world-writable directory that can function as shared memory that facilitates inter process communication (IPC)." + rationale: "Making /dev/shm its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /dev/shm useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by mounting tmpfs to /dev/shm." + impact: "Since the /dev/shm directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. /dev/shm utilizing tmpfs can be resized using the size={size} parameter in the relevant entry in /etc/fstab." + remediation: "For specific configuration requirements of the /dev/shm mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs /dev/shm defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 0 tmpfs." + references: + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + - "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html" + compliance: + - cis: ["1.1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + + # 1.1.8.2 Ensure nodev option set on /dev/shm partition. (Automated) + + - id: 32525 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s && r:nodev' + + # 1.1.8.3 Ensure noexec option set on /dev/shm partition. (Automated) + + - id: 32526 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Example: /dev/shm defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm NOTE It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s && r:noexec' + + # 1.1.8.4 Ensure nosuid option set on /dev/shm partition. (Automated) + + - id: 32527 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s && r:nosuid' + + # 1.1.9 Disable USB Storage. (Automated) + + - id: 32528 + title: "Disable USB Storage." + description: "USB storage provides a means to transfer and store files ensuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Run the following script to disable usb-storage: #!/usr/bin/env bash { l_mname=\"usb-storage\" # set module name # Check if the module exists on the system if [ -z \"$(modprobe -n -v \"$l_mname\" 2>&1 | grep -Pi -- \"\\h*modprobe:\\h+FATAL:\\h+Module\\h+$l_mname\\h+not\\h+found\\h+in\\h+directory\")\" ]; then # Remediate loadable l_loadable=\"$(modprobe -n -v \"$l_mname\")\" [ \"$(wc -l <<< \"$l_loadable\")\" -gt \"1\" ] && l_loadable=\"$(grep -P -- \"(^\\h*install|\\b$l_mname)\\b\" <<< \"$l_loadable\")\" if ! grep -Pq -- '^\\h*install \\/bin\\/(true|false)' <<< \"$l_loadable\"; then echo -e \" - setting module: \\\"$l_mname\\\" to be not loadable\" echo -e \"install $l_mname /bin/false\" >> /etc/modprobe.d/\"$l_mname\".conf fi # Remediate loaded if lsmod | grep \"$l_mname\" > /dev/null 2>&1; then echo -e \" - unloading module \\\"$l_mname\\\"\" modprobe -r \"$l_mname\" fi # Remediate deny list if ! modprobe --showconfig | grep -Pq -- \"^\\h*blacklist\\h+$(tr '-' '_' <<< \"$l_mname\")\\b\"; then echo -e \" - deny listing \\\"$l_mname\\\"\" echo -e \"blacklist $l_mname\" >> /etc/modprobe.d/\"$l_mname\".conf fi else echo -e \" - Nothing to remediate\\n - Module \\\"$l_mname\\\" doesn't exist on the system\" fi }." + compliance: + - cis: ["1.1.9"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["13.7"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.8.3.1"] + - mitre_mitigations: ["M1034"] + - mitre_tactics: ["TA0001", "TA0010"] + - mitre_techniques: ["T1091"] + - nist_sp_800-53: ["SC-18(4)"] + condition: all + rules: + - "c:modprobe -n -v usb-storage -> r:^install /bin/true" + - "not c:lsmod -> r:^usb-storage" + + # 1.2.1 Ensure GPG keys are configured. (Manual) - Not Implemented + + # 1.2.2 Ensure gpgcheck is globally activated. (Automated) + + - id: 32529 + title: "Ensure gpgcheck is globally activated." + description: "The gpgcheck option, found in the main section of the /etc/dnf/dnf.conf and individual /etc/yum.repos.d/* files, determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/dnf/dnf.conf and set gpgcheck=1 in the [main] section. Example: # sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' /etc/dnf/dnf.conf Edit any failing files in /etc/yum.repos.d/* and set all instances starting with gpgcheck to 1. Example: # find /etc/yum.repos.d/ -name \"*.repo\" -exec echo \"Checking:\" {} \\; -exec sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' {} \\;." + compliance: + - cis: ["1.2.2"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1195", "T1195.001"] + - nist_sp_800-53: ["SI-2"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'f:/etc/dnf/dnf.conf -> r:^\s*gpgcheck\s*=\s*1' + - 'not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck\s*=\s*0' + + # 1.2.3 Ensure package manager repositories are configured. (Manual) - Not Implemented + + # 1.2.4 Ensure repo_gpgcheck is globally activated. (Manual) - Not Implemented + + # 1.3.1 Ensure AIDE is installed. (Automated) + + - id: 32530 + title: "Ensure AIDE is installed." + description: "Advanced Intrusion Detection Environment (AIDE) is a intrusion detection tool that uses predefined rules to check the integrity of files and directories in the Linux operating system. AIDE has its own database to check the integrity of files and directories. AIDE takes a snapshot of files and directories including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # dnf install aide Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: Run the following commands: # aide --init # mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz." + references: + - "http://aide.sourceforge.net/stable/manual.html" + compliance: + - cis: ["1.3.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1565", "T1565.001"] + - nist_sp_800-53: ["AU-2"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:rpm -q aide -> r:aide-" + + # 1.3.2 Ensure filesystem integrity is regularly checked. (Automated) + + - id: 32531 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check OR if aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + references: + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service" + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer" + compliance: + - cis: ["1.3.2"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1036", "T1036.005"] + - nist_sp_800-53: ["AU-2"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:systemctl is-enabled aidecheck.service -> r:^enable" + - "c:systemctl is-enabled aidecheck.timer -> r:^enable" + - "c:systemctl status aidecheck.service -> r:active" + + # 1.3.3 Ensure cryptographic mechanisms are used to protect the integrity of audit tools. (Automated) + + - id: 32532 + title: "Ensure cryptographic mechanisms are used to protect the integrity of audit tools." + description: "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." + rationale: "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. Attackers may replace the audit tools or inject code into the existing tools with the purpose of providing the capability to hide or erase system activity from the audit logs. Audit tools should be cryptographically signed in order 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." + remediation: 'Add or update the following selection lines for "/etc/aide/aide.conf" to protect the integrity of the audit tools: # Audit Tools /sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512.' + compliance: + - cis: ["4.1.4.11"] + - cis_csc_v7: ["5.1"] + - cis_csc_v8: ["4.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/aide/aide.conf" + - 'f:/etc/aide/aide.conf -> r:/sbin/auditctl\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/auditd\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/ausearch\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/aureport\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/autrace\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/augenrules\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + + # 1.4.1 Ensure bootloader password is set. (Automated) + + - id: 32533 + title: "Ensure bootloader password is set." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + impact: 'If password protection is enabled, only the designated superuser can edit a Grub 2 menu item by pressing "e" or access the GRUB 2 command line by pressing "c" If GRUB 2 is set up to boot automatically to a password-protected menu entry the user has no option to back out of the password prompt to select another menu entry. Holding the SHIFT key will not display the menu in this case. The user must enter the correct username and password. If unable, the configuration files will have to be edited via the LiveCD or other means to fix the problem.' + remediation: "Create an encrypted password with grub2-setpassword: # grub2-setpassword Enter password: Confirm password: ." + compliance: + - cis: ["1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1046"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1542"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub2/grub.cfg -> r:^\s*\t*password' + + # 1.4.2 Ensure permissions on bootloader config are configured. (Automated) + + - id: 32534 + title: "Ensure permissions on bootloader config are configured." + description: "The grub files contain information on boot settings and passwords for unlocking boot options." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set ownership and permissions on your grub configuration files: Run the following command to set ownership and permissions on grub.cfg: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg Run the following command to set ownership and permissions on grubenv: # chown root:root /boot/grub2/grubenv # chmod u-x,og-rwx /boot/grub2/grubenv Run the following command to set ownership and permissions on user.cfg: # chown root:root /boot/grub2/user.cfg # chmod u-x,og-rwx /boot/grub2/user.cfg Note: This may require a re-boot to enable the change." + compliance: + - cis: ["1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005", "TA0007"] + - mitre_techniques: ["T1542"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /boot/grub2/grub.cfg -> r:Access:\s*\(0700/-r--------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat -L /boot/grub2/grubenv -> r:Access:\s*\(0600/-r--------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat -L /boot/grub2/user.cfg -> r:Access:\s*\(0600/-r--------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.5.1 Ensure core dump storage is disabled. (Automated) + + - id: 32535 + title: "Ensure core dump storage is disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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." + remediation: "Edit /etc/systemd/coredump.conf and edit or add the following line: Storage=none." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1005"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*Storage\s*=\s*none' + + # 1.5.2 Ensure core dump backtraces are disabled. (Automated) + + - id: 32536 + title: "Ensure core dump backtraces are disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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, increasing the risk to the system." + remediation: "Edit or add the following line in /etc/systemd/coredump.conf: ProcessSizeMax=0." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.2"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1005"] + - nist_sp_800-53: ["CM-6b"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*ProcessSizeMax\s*=\s*0' + + # 1.5.3 Ensure address space layout randomization (ASLR) is enabled. (Automated) - Not Implemented + + # 1.6.1.1 Ensure SELinux is installed. (Automated) + + - id: 32537 + title: "Ensure SELinux is installed." + description: "SELinux provides Mandatory Access Control." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install SELinux: # dnf install libselinux." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1068"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:rpm -q libselinux -> r:^libselinux-" + + # 1.6.1.2 Ensure SELinux is not disabled in bootloader configuration. (Automated) + + - id: 32538 + title: "Ensure SELinux is not disabled in bootloader configuration." + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + impact: "Files created while SELinux is disabled are not labeled at all. This behavior causes problems when changing to enforcing mode because files are labeled incorrectly or are not labeled at all. To prevent incorrectly labeled and unlabeled files from causing problems, file systems are automatically relabeled when changing from the disabled state to permissive or enforcing mode. This can be a long running process that should be accounted for as it may extend downtime during initial re-boot." + remediation: "Run the following command to remove the selinux=0 and enforcing=0 parameters: grubby --update-kernel ALL --remove-args \"selinux=0 enforcing=0\" Run the following command to remove the selinux=0 and enforcing=0 parameters if they were created by the deprecated grub2-mkconfig command: # grep -Prsq -- '\\h*([^#\\n\\r]+\\h+)?kernelopts=([^#\\n\\r]+\\h+)?(selinux|enforcing)=0\\b' /boot/grub2 /boot/efi && grub2-mkconfig -o \"$(grep -Prl -- '\\h*([^#\\n\\r]+\\h+)?kernelopts=([^#\\n\\r]+\\h+)?(selinux|enforcing)=0\\b' /boot/grub2 /boot/efi)\"." + compliance: + - cis: ["1.6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1068"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + - 'f:/boot/grub2/grub.cfg -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + + # 1.6.1.3 Ensure SELinux policy is configured. (Automated) + + - id: 32539 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1068"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+targeted$|^Loaded policy name:\s+mls$' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Ensure the SELinux mode is not disabled. (Automated) + + - id: 32540 + title: "Ensure the SELinux mode is not disabled." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes" + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$|^Permissive$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing|\s*SELINUX\s*=\s*permisive' + + # 1.6.1.5 Ensure the SELinux mode is enforcing. (Automated) + + - id: 32541 + title: "Ensure the SELinux mode is enforcing." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode the system not only avoids enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future. Running SELinux in Permissive mode, though helpful for developing SELinux policy, only logs access denial entries, but does not deny any operations." + remediation: "Run the following command to set SELinux's running mode: # setenforce 1 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes" + compliance: + - cis: ["1.6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + # 1.6.1.6 Ensure no unconfined services exist. (Automated) + - id: 32542 + title: "Ensure no unconfined services exist." + description: "Unconfined processes run in unconfined domains." + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules - it does not replace them." + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "not c:ps -eZ -> r:unconfined_service_t" + + # 1.6.1.7 Ensure SETroubleshoot is not installed. (Automated) + + - id: 32543 + title: "Ensure SETroubleshoot is not installed." + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # dnf remove setroubleshoot." + compliance: + - cis: ["1.6.1.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1543", "T1543.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "not c:rpm -qa setroubleshoot -> r:^setroubleshoot" + + # 1.6.1.8 Ensure the MCS Translation Service (mcstrans) is not installed. (Automated) + + - id: 32544 + title: "Ensure the MCS Translation Service (mcstrans) is not installed." + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf." + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # dnf remove mcstrans." + compliance: + - cis: ["1.6.1.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "not c:rpm -qa mcstrans -> r:mcstrans" + + # 1.7.1 Ensure message of the day is configured properly. (Automated) + + - id: 32545 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + condition: all + rules: + - "not f:/etc/mod" + - 'not f:/etc/motd -> r:\\v|\\r|\\m|\\s|alma' + + # 1.7.2 Ensure local login warning banner is configured properly. (Automated) + + - id: 32546 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.7.2"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + condition: any + rules: + - "not f:/etc/issue" + - 'not f:/etc/issue -> r:\\v|\\r|\\m|\\s|alma' + + # 1.7.3 Ensure remote login warning banner is configured properly. (Automated) + + - id: 32547 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1018", "T1082", "T1592", "T1592.004"] + condition: any + rules: + - "not f:/etc/issue.net" + - 'not f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|alma' + + # 1.7.4 Ensure permissions on /etc/motd are configured. (Automated) + + - id: 32548 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd : # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.5 Ensure permissions on /etc/issue are configured. (Automated) + + - id: 32549 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue : # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured. (Automated) + + - id: 32550 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.8.1 Ensure GNOME Display Manager is removed. (Automated) + + - id: 32551 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + impact: "Removing the GNOME Display manager will remove the Graphical User Interface (GUI) from the system." + remediation: "Run the following command to remove the gdm package # dnf remove gdm." + references: + - "https://wiki.gnome.org/Projects/GDM" + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "f:rpm -q gdm -> r:is not installed" + + # 1.8.2 Ensure GDM login banner is configured. (Automated) + + - id: 32552 + title: "Ensure GDM login banner is configured." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Run the following script to verify that the banner message is enabled and set: #!/usr/bin/env bash { l_pkgoutput=\"\" if command -v dpkg-query > /dev/null 2>&1; then l_pq=\"dpkg-query -W\" elif command -v rpm > /dev/null 2>&1; then l_pq=\"rpm -q\" fi l_pcl=\"gdm gdm3\" # Space seporated list of packages to check for l_pn in $l_pcl; do $l_pq \"$l_pn\" > /dev/null 2>&1 && l_pkgoutput=\"$l_pkgoutput\\n - Package: \\\"$l_pn\\\" exists on the system\\n - checking configuration\" done if [ -n \"$l_pkgoutput\" ]; then l_gdmprofile=\"gdm\" # Set this to desired profile name IaW Local site policy l_bmessage=\"'Authorized uses only. All activity may be monitored and reported'\" # Set to desired banner message if [ ! -f \"/etc/dconf/profile/$l_gdmprofile\" ]; then echo \"Creating profile \\\"$l_gdmprofile\\\"\" echo -e \"user-db:user\\nsystem-db:$l_gdmprofile\\nfile- db:/usr/share/$l_gdmprofile/greeter-dconf-defaults\" > /etc/dconf/profile/$l_gdmprofile fi if [ ! -d \"/etc/dconf/db/$l_gdmprofile.d/\" ]; then echo \"Creating dconf database directory \\\"/etc/dconf/db/$l_gdmprofile.d/\\\"\" mkdir /etc/dconf/db/$l_gdmprofile.d/ fi if ! grep -Piq '^\\h*banner-message-enable\\h*=\\h*true\\b' /etc/dconf/db/$l_gdmprofile.d/*; then echo \"creating gdm keyfile for machine-wide settings\" if ! grep -Piq -- '^\\h*banner-message-enable\\h*=\\h*' /etc/dconf/db/$l_gdmprofile.d/*; then l_kfile=\"/etc/dconf/db/$l_gdmprofile.d/01-banner-message\" echo -e \"\\n[org/gnome/login-screen]\\nbanner-message-enable=true\" >> \"$l_kfile\" else l_kfile=\"$(grep -Pil -- '^\\h*banner-message-enable\\h*=\\h*' /etc/dconf/db/$l_gdmprofile.d/*)\" ! grep -Pq '^\\h*\\[org\\/gnome\\/login-screen\\]' \"$l_kfile\" && sed -ri '/^\\s*banner- message-enable/ i\\[org/gnome/login-screen]' \"$l_kfile\" ! grep -Pq '^\\h*banner-message-enable\\h*=\\h*true\\b' \"$l_kfile\" && sed -ri 's/^\\s*(banner-message-enable\\s*=\\s*)(\\S+)(\\s*.*$)/\\1true \\3//' \"$l_kfile\" # sed -ri '/^\\s*\\[org\\/gnome\\/login-screen\\]/ a\\\\nbanner-message-enable=true' \"$l_kfile\" fi fi if ! grep -Piq \"^\\h*banner-message-text=[\\'\\\"]+\\S+\" \"$l_kfile\"; then sed -ri \"/^\\s*banner-message-enable/ a\\banner-message-text=$l_bmessage\" \"$l_kfile\" fi dconf update else echo -e \"\\n\\n - GNOME Desktop Manager isn't installed\\n - Recommendation is Not Applicable\\n - No remediation required\\n\" fi } Note: - There is no character limit for the banner message. gnome-shell autodetects longer stretches of text and enters two column mode. - The banner message cannot be read from an external file. OR Run the following command to remove the gdm package: # dnf remove gdm." + references: + - "https://help.gnome.org/admin/system-admin-guide/stable/login-banner.html.en" + compliance: + - cis: ["1.8.2"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm" + - "f:/etc/dconf/profile/gdm -> r:user-db:user" + - "f:/etc/dconf/profile/gdm -> r:system-db:gdm" + - "f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - 'd:/etc/dconf/db/gdm.d -> r:\.+ -> r:banner-message-enable=true' + - 'd:/etc/dconf/db/gdm.d -> r:\.+ -> r:banner-message-text=' + + # 1.8.3 Ensure GDM disable-user-list option is enabled. (Automated) + + - id: 32553 + title: "Ensure GDM disable-user-list option is enabled." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems. The disable-user-list option controls if a list of users is displayed on the login screen." + rationale: "Displaying the user list eliminates half of the Userid/Password equation that an unauthorized person would need to log on." + remediation: "Run the following script to enable the disable-user-list option: Note: the l_gdm_profile variable in the script can be changed if a different profile name is desired in accordance with local site policy. #!/usr/bin/env bash { l_gdmprofile=\"gdm\" if [ ! -f \"/etc/dconf/profile/$l_gdmprofile\" ]; then echo \"Creating profile \\\"$l_gdmprofile\\\"\" echo -e \"user-db:user\\nsystem-db:$l_gdmprofile\\nfile- db:/usr/share/$l_gdmprofile/greeter-dconf-defaults\" > /etc/dconf/profile/$l_gdmprofile fi if [ ! -d \"/etc/dconf/db/$l_gdmprofile.d/\" ]; then echo \"Creating dconf database directory \\\"/etc/dconf/db/$l_gdmprofile.d/\\\"\" mkdir /etc/dconf/db/$l_gdmprofile.d/ fi if ! grep -Piq '^\\h*disable-user-list\\h*=\\h*true\\b' /etc/dconf/db/$l_gdmprofile.d/*; then echo \"creating gdm keyfile for machine-wide settings\" if ! grep -Piq -- '^\\h*\\[org\\/gnome\\/login-screen\\]' /etc/dconf/db/$l_gdmprofile.d/*; then echo -e \"\\n[org/gnome/login-screen]\\n# Do not show the user list\\ndisable-user-list=true\" >> /etc/dconf/db/$l_gdmprofile.d/00-login- screen else sed -ri '/^\\s*\\[org\\/gnome\\/login-screen\\]/ a\\# Do not show the user list\\ndisable-user-list=true' $(grep -Pil -- '^\\h*\\[org\\/gnome\\/login- screen\\]' /etc/dconf/db/$l_gdmprofile.d/*) fi fi dconf update } Note: When the user profile is created or changed, the user will need to log out and log in again before the changes will be applied. OR Run the following command to remove the GNOME package: # dnf remove gdm." + references: + - "https://help.gnome.org/admin/system-admin-guide/stable/login-userlist-disable.html.en" + compliance: + - cis: ["1.8.3"] + - mitre_mitigations: ["M1028"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1087", "T1087.001", "T1087.002"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm" + - "f:/etc/dconf/profile/gdm -> r:user-db:user" + - "f:/etc/dconf/profile/gdm -> r:system-db:gdm" + - "f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - 'd:/etc/dconf/db/gdm.d -> r:\.+ -> r:banner-message-enable=true' + - 'd:/etc/dconf/db/gdm.d -> r:\.+ -> r:banner-message-text=' + - 'd:/etc/dconf/db/gdm.d -> r:\.+ -> r:disable-user-list=true' + + # 1.8.4 Ensure GDM screen locks when the user is idle. (Automated) + + - id: 32554 + title: "Ensure GDM screen locks when the user is idle." + description: "GNOME Desktop Manager can make the screen lock automatically whenever the user is idle for some amount of time. - idle-delay=uint32 {n} - Number of seconds of inactivity before the screen goes blank - lock-delay=uint32 {n} - Number of seconds after the screen is blank before locking the screen Example key file: # Specify the dconf path [org/gnome/desktop/session] # Number of seconds of inactivity before the screen goes blank # Set to 0 seconds if you want to deactivate the screensaver. idle-delay=uint32 900 # Specify the dconf path [org/gnome/desktop/screensaver] # Number of seconds after the screen is blank before locking the screen lock-delay=uint32 5." + rationale: "Setting a lock-out value reduces the window of opportunity for unauthorized user access to another user's session that has been left unattended." + remediation: "Create or edit a file in the /etc/dconf/profile/ and verify it includes the following: user-db:user system-db:{NAME_OF_DCONF_DATABASE} Note: local is the name of a dconf database used in the examples. Example: # echo -e '\\nuser-db:user\\nsystem-db:local' >> /etc/dconf/profile/user Create the directory /etc/dconf/db/{NAME_OF_DCONF_DATABASE}.d/ if it doesn't already exist: Example: # mkdir /etc/dconf/db/local.d Create the key file `/etc/dconf/db/{NAME_OF_DCONF_DATABASE}.d/{FILE_NAME} to provide information for the {NAME_OF_DCONF_DATABASE} database: Example script: #!/usr/bin/env bash { l_key_file=\"/etc/dconf/db/local.d/00-screensaver\" l_idmv=\"900\" # Set max value for idle-delay in seconds (between 1 and 900) l_ldmv=\"5\" # Set max value for lock-delay in seconds (between 0 and 5) { echo '# Specify the dconf path' echo '[org/gnome/desktop/session]' echo '' echo '# Number of seconds of inactivity before the screen goes blank' echo '# Set to 0 seconds if you want to deactivate the screensaver.' echo \"idle-delay=uint32 $l_idmv\" echo '' echo '# Specify the dconf path' echo '[org/gnome/desktop/screensaver]' echo '' echo '# Number of seconds after the screen is blank before locking the screen' echo \"lock-delay=uint32 $l_ldmv\" } > \"$l_key_file\" } Note: You must include the uint32 along with the integer key values as shown. Run the following command to update the system databases: # dconf update Note: Users must log out and back in again before the system-wide settings take effect." + references: + - "https://help.gnome.org/admin/system-admin-guide/stable/desktop-lockscreen.html.en" + compliance: + - cis: ["1.8.4"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["15"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - mitre_tactics: ["TA0027"] + - mitre_techniques: ["T1461"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm" + - "f:/etc/dconf/profile/gdm -> r:user-db:user" + - "f:/etc/dconf/profile/gdm -> r:system-db:gdm" + - 'd:/etc/dconf/db/local.d -> r:\.+ -> r:lock-delay=uint32' + + # 1.8.5 Ensure GDM screen locks cannot be overridden. (Automated) - Not Implemented + + # 1.8.6 Ensure GDM automatic mounting of removable media is disabled. (Automated) + + - id: 32555 + title: "Ensure GDM automatic mounting of removable media is disabled." + description: "By default GNOME automatically mounts removable media when inserted as a convenience to the user." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "Run the following script to disable automatic mounting of media for all GNOME users: #!/usr/bin/env bash { l_pkgoutput=\"\" l_gpname=\"local\" # Set to desired dconf profile name (default is local) # Check if GNOME Desktop Manager is installed. If package isn't installed, recommendation is Not Applicable\\n # determine system's package manager if command -v dpkg-query > /dev/null 2>&1; then l_pq=\"dpkg-query -W\" elif command -v rpm > /dev/null 2>&1; then l_pq=\"rpm -q\" fi # Check if GDM is installed l_pcl=\"gdm gdm3\" # Space seporated list of packages to check for l_pn in $l_pcl; do $l_pq \"$l_pn\" > /dev/null 2>&1 && l_pkgoutput=\"$l_pkgoutput\\n - Package: \\\"$l_pn\\\" exists on the system\\n - checking configuration\" done # Check configuration (If applicable) if [ -n \"$l_pkgoutput\" ]; then echo -e \"$l_pkgoutput\" # Look for existing settings and set variables if they exist l_kfile=\"$(grep -Prils -- '^\\h*automount\\b' /etc/dconf/db/*.d)\" l_kfile2=\"$(grep -Prils -- '^\\h*automount-open\\b' /etc/dconf/db/*.d)\" # Set profile name based on dconf db directory ({PROFILE_NAME}.d) if [ -f \"$l_kfile\" ]; then l_gpname=\"$(awk -F\\/ '{split($(NF-1),a,\".\");print a[1]}' <<< \"$l_kfile\")\" echo \" - updating dconf profile name to \\\"$l_gpname\\\"\" elif [ -f \"$l_kfile2\" ]; then l_gpname=\"$(awk -F\\/ '{split($(NF-1),a,\".\");print a[1]}' <<< \"$l_kfile2\")\" echo \" - updating dconf profile name to \\\"$l_gpname\\\"\" fi # check for consistency (Clean up configuration if needed) if [ -f \"$l_kfile\" ] && [ \"$(awk -F\\/ '{split($(NF-1),a,\".\");print a[1]}' <<< \"$l_kfile\")\" != \"$l_gpname\" ]; then sed -ri \"/^\\s*automount\\s*=/s/^/# /\" \"$l_kfile\" l_kfile=\"/etc/dconf/db/$l_gpname.d/00-media-automount\" fi if [ -f \"$l_kfile2\" ] && [ \"$(awk -F\\/ '{split($(NF-1),a,\".\");print a[1]}' <<< \"$l_kfile2\")\" != \"$l_gpname\" ]; then sed -ri \"/^\\s*automount-open\\s*=/s/^/# /\" \"$l_kfile2\" fi [ -z \"$l_kfile\" ] && l_kfile=\"/etc/dconf/db/$l_gpname.d/00-media- automount\" # Check if profile file exists if grep -Pq -- \"^\\h*system-db:$l_gpname\\b\" /etc/dconf/profile/*; then echo -e \"\\n - dconf database profile exists in: \\\"$(grep -Pl -- \"^\\h*system-db:$l_gpname\\b\" /etc/dconf/profile/*)\\\"\" else if [ ! -f \"/etc/dconf/profile/user\" ]; then l_gpfile=\"/etc/dconf/profile/user\" else l_gpfile=\"/etc/dconf/profile/user2\" fi echo -e \" - creating dconf database profile\" { echo -e \"\\nuser-db:user\" echo \"system-db:$l_gpname\" } >> \"$l_gpfile\" fi # create dconf directory if it doesn't exists l_gpdir=\"/etc/dconf/db/$l_gpname.d\" if [ -d \"$l_gpdir\" ]; then echo \" - The dconf database directory \\\"$l_gpdir\\\" exists\" else echo \" - creating dconf database directory \\\"$l_gpdir\\\"\" mkdir \"$l_gpdir\" fi # check automount-open setting if grep -Pqs -- '^\\h*automount-open\\h*=\\h*false\\b' \"$l_kfile\"; then echo \" - \\\"automount-open\\\" is set to false in: \\\"$l_kfile\\\"\" else echo \" - creating \\\"automount-open\\\" entry in \\\"$l_kfile\\\"\" ! grep -Psq -- '\\^\\h*\\[org\\/gnome\\/desktop\\/media-handling\\]\\b' \"$l_kfile\" && echo '[org/gnome/desktop/media-handling]' >> \"$l_kfile\" sed -ri '/^\\s*\\[org\\/gnome\\/desktop\\/media-handling\\]/a \\\\nautomount-open=false' \"$l_kfile\" fi # check automount setting if grep -Pqs -- '^\\h*automount\\h*=\\h*false\\b' \"$l_kfile\"; then echo \" - \\\"automount\\\" is set to false in: \\\"$l_kfile\\\"\" else echo \" - creating \\\"automount\\\" entry in \\\"$l_kfile\\\"\" ! grep -Psq -- '\\^\\h*\\[org\\/gnome\\/desktop\\/media-handling\\]\\b' \"$l_kfile\" && echo '[org/gnome/desktop/media-handling]' >> \"$l_kfile\" sed -ri '/^\\s*\\[org\\/gnome\\/desktop\\/media-handling\\]/a \\\\nautomount=false' \"$l_kfile\" fi # update dconf database dconf update else echo -e \"\\n - GNOME Desktop Manager package is not installed on the system\\n - Recommendation is not applicable\" fi } OR Run the following command to uninstall the GNOME desktop Manager package: # dnf remove gdm." + references: + - "https://access.redhat.com/solutions/20107" + compliance: + - cis: ["1.8.6"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0001", "TA0008"] + - mitre_techniques: ["T1091"] + condition: all + rules: + - "c:gsettings get org.gnome.desktop.media-handling automount -> r:^false" + + # 1.8.7 Ensure GDM disabling automatic mounting of removable media is not overridden. (Automated) - Not Implemented + # 1.8.8 Ensure GDM autorun-never is enabled. (Automated) - Not Implemented + # 1.8.9 Ensure GDM autorun-never is not overridden. (Automated) - Not Implemented + # 1.8.10 Ensure XDCMP is not enabled. (Automated) + - id: 32556 + title: "Ensure XDCMP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. - XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user - XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server." + remediation: "Edit the file /etc/gdm/custom.conf and remove the line: Enable=true." + compliance: + - cis: ["1.8.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1050"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1040", "T1056", "T1056.001", "T1557"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not f:/etc/gdm/custom.conf -> r:^\s*Enable\s*=\s*true' + + # 1.9 Ensure updates, patches, and additional security software are installed. (Manual) + - id: 32557 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available updates: # dnf update Once the update process is complete, verify if reboot is required to load changes. dnf needs-restarting -r." + compliance: + - cis: ["1.9"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - mitre_mitigations: ["M1051"] + - mitre_tactics: ["TA0004", "TA0008"] + - mitre_techniques: ["T1211"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'not c:sh -c "dnf check-update | egrep -v \"Updating|Last metadata|^$\"" -> r:^\w' + + # 1.10 Ensure system-wide crypto policy is not legacy. (Automated) + - id: 32558 + title: "Ensure system-wide crypto policy is not legacy." + description: "The system-wide crypto-policies followed by the crypto core components allow consistently deprecating and disabling algorithms system-wide. The individual policy levels (DEFAULT, LEGACY, FUTURE, and FIPS) are included in the crypto-policies(7) package." + rationale: "If the Legacy system-wide crypto policy is selected, it includes support for TLS 1.0, TLS 1.1, and SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are allowed, while RSA and Diffie-Hellman parameters are accepted if larger than 1023-bits. These legacy protocols and algorithms can make the system vulnerable to attacks, including those listed in RFC 7457." + impact: "Environments that require compatibility with older insecure protocols may require the use of the less secure LEGACY policy level." + remediation: "Run the following command to change the system-wide crypto policy # update-crypto-policies --set Example: # update-crypto-policies --set DEFAULT Run the following to make the updated system-wide crypto policy active # update-crypto-policies." + references: + - "https://access.redhat.com/articles/3642912#what-polices-are-provided-1" + compliance: + - cis: ["1.10"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["SC-8"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'f:/etc/crypto-policies/config -> r:^\s*LEGACY' + + # 2.1.1 Ensure time synchronization is in use. (Automated) + - id: 32559 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them. Note: If another method for time synchronization is being used, this section may be skipped." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Run the following command to install chrony: # dnf install chrony." + compliance: + - cis: ["2.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:rpm -q chrony -> r:^chrony-" + + # 2.1.2 Ensure chrony is configured. (Automated) + - id: 32560 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: 'Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include ''-u chrony'': OPTIONS="-u chrony".' + compliance: + - cis: ["2.1.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1070", "T1070.002"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "f:/etc/chrony.conf" + - 'f:/etc/chrony.conf -> r:^\s*\t*server|^\s*\t*pool' + - 'f:/etc/sysconfig/chronyd -> r:^\s*\t*OPTIONS\.*-u chrony' + + # 2.2.1 Ensure xorg-x11-server-common is not installed. (Automated) + - id: 32561 + title: "Ensure xorg-x11-server-common is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: 'Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime.' + remediation: "Run the following command to remove the X Windows Server packages: # dnf remove xorg-x11-server-common." + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q xorg-x11-server-common -> r:^package xorg-x11-server-common is not installed" + + # 2.2.2 Ensure Avahi Server is not installed. (Automated) + - id: 32562 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to stop, mask and remove avahi: # systemctl stop avahi-daemon.socket avahi-daemon.service # dnf remove avahi." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q avahi -> r:^package avahi is not installed" + + # 2.2.3 Ensure CUPS is not installed. (Automated) + - id: 32563 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface. Note: Removing CUPS will prevent printing from the system." + impact: "Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to remove cups: # dnf remove cups." + references: + - "http://www.cups.org." + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q cups -> r:^package cups is not installed" + + # 2.2.4 Ensure DHCP Server is not installed. (Automated) + - id: 32564 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that the dhcp-server package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcp: # dnf remove dhcp-server." + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dhcp-server -> r:^package dhcp-server is not installed" + + # 2.2.5 Ensure DNS Server is not installed. (Automated) + - id: 32565 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove bind: # dnf remove bind." + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q bind -> r:^package bind is not installed" + + # 2.2.6 Ensure VSFTP Server is not installed. (Automated) + - id: 32566 + title: "Ensure VSFTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "Unless there is a need to run the system as a FTP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # dnf remove vsftpd." + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q vsftpd -> r:^package vsftpd is not installed" + + # 2.2.7 Ensure TFTP Server is not installed. (Automated) + - id: 32567 + title: "Ensure TFTP Server is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "Unless there is a need to run the system as a TFTP server, it is recommended that the package be removed to reduce the potential attack surface. TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + impact: "TFTP is often used to provide files for network booting such as for PXE based installation of servers." + remediation: "Run the following command to remove tftp-server: # dnf remove tftp-server." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp-server -> r:^package tftp-server is not installed" + + # 2.2.8 Ensure a web server is not installed. (Automated) + - id: 32568 + title: "Ensure a web server is not installed." + description: "Web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the packages be removed to reduce the potential attack surface. Note: Several http servers exist. They should also be audited, and removed, if not required." + remediation: "Run the following command to remove httpd and nginx: # dnf remove httpd nginx." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nginx -> r:^package nginx is not installed" + - "c:rpm -q httpd -> r:^package httpd is not installed" + + # 2.2.9 Ensure IMAP and POP3 server is not installed. (Automated) + - id: 32569 + title: "Ensure IMAP and POP3 server is not installed." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface. Note: Several IMAP/POP3 servers exist and can use other service names. These should also be audited and the packages removed if not required." + remediation: "Run the following command to remove dovecot and cyrus-imapd: # dnf remove dovecot cyrus-imapd." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dovecot -> r:^package dovecot is not installed" + - "c:rpm -q cyrus-imapd -> r:^package cyrus-imapd is not installed" + + # 2.2.10 Ensure Samba is not installed. (Automated) + - id: 32570 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # dnf remove samba." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1005", "T1039", "T1083", "T1135", "T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q samba -> r:^package samba is not installed" + + # 2.2.11 Ensure HTTP Proxy Server is not installed. (Automated) + - id: 32571 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "Unless a system is specifically set up to act as a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface. Note: Several HTTP proxy servers exist. These should be checked and removed unless required." + remediation: "Run the following command to remove the squid package: # dnf remove squid." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q squid -> r:^package squid is not installed" + + # 2.2.12 Ensure net-snmp is not installed. (Automated) + - id: 32572 + title: "Ensure net-snmp is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. If SNMP v2 is absolutely necessary, modify the community strings' values. -." + remediation: "Run the following command to remove net-snmpd: # dnf remove net-snmp." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q net-snmp -> r:^package net-snmp is not installed" + + # 2.2.13 Ensure telnet-server is not installed. (Automated) + - id: 32573 + title: "Ensure telnet-server is not installed." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to remove the telnet-server package: # dnf remove telnet-server." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet-server -> r:^package telnet-server is not installed" + + # 2.2.14 Ensure dnsmasq is not installed. (Automated) + - id: 32574 + title: "Ensure dnsmasq is not installed." + description: "dnsmasq is a lightweight tool that provides DNS caching, DNS forwarding and DHCP (Dynamic Host Configuration Protocol) services." + rationale: "Unless a system is specifically designated to act as a DNS caching, DNS forwarding and/or DHCP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dnsmasq: # dnf remove dnsmasq." + compliance: + - cis: ["2.2.14"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + condition: all + rules: + - "c:rpm -q dnsmasq -> r:^package dnsmasq is not installed" + + # 2.2.15 Ensure mail transfer agent is configured for local-only mode. (Automated) + - id: 32575 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Note: - This recommendation is designed around the postfix mail server. - Depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1018", "T1210"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not c:ss -lntu -> r:\s*127.0.0.1:25\s*|\s*::1:25\s*' + + # 2.2.16 Ensure nfs-utils is not installed or the nfs-server service is masked. (Automated) + - id: 32576 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not require network shares, it is recommended that the nfs-utils package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization are dependent on the nfs-utils package. If the nfs-utils package is required as a dependency, the nfs-server service should be disabled and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove nfs-utils OR If the nfs-utils package is required as a dependency, run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1005", "T1039", "T1083", "T1135", "T1210"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q nfs-utils -> r:^package nfs-utils is not installed" + - "c:systemctl is-enabled nfs-server -> r:masked|No such file or directory" + + # 2.2.17 Ensure rpcbind is not installed or the rpcbind services are masked. (Automated) + - id: 32577 + title: "Ensure rpcbind is not installed or the rpcbind services are masked." + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening." + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization, and the nfs-utils package used for The Network File System (NFS), are dependent on the rpcbind package. If the rpcbind package is required as a dependency, the services rpcbind.service and rpcbind.socket should be stopped and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove rpcbind OR If the rpcbind package is required as a dependency, run the following commands to stop and mask the rpcbind.service and rpcbind.socket systemd units: # systemctl --now mask rpcbind.service # systemctl --now mask rpcbind.socket." + compliance: + - cis: ["2.2.17"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1498", "T1498.002", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rpcbind -> r:^package rpcbind is not installed" + - "c:systemctl is-enabled rpcbind -> r:masked|No such file or directory" + - "c:systemctl is-enabled rpcbind.socket -> r:masked|No such file or directory" + + # 2.2.18 Ensure rsync-daemon is not installed or the rsyncd service is masked. (Automated) + - id: 32578 + title: "Ensure rsync-daemon is not installed or the rsyncd service is masked." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync-daemon package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication. Note: If a required dependency exists for the rsync-daemon package, but the rsyncd service is not required, the service should be masked." + impact: "There are packages that are dependent on the rsync package. If the rsync package is removed, these packages will be removed as well. Before removing the rsync-daemon package, review any dependent packages to determine if they are required on the system. If a dependent package is required, mask the rsyncd service and leave the rsync-daemon package installed." + remediation: "Run the following command to remove the rsync package: # dnf remove rsync-daemon OR Run the following command to mask the rsyncd service: # systemctl --now mask rsyncd." + compliance: + - cis: ["2.2.18"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1105", "T1203", "T1210", "T1543", "T1543.002", "T1570"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rsync-daemon -> r:^package rsync-daemon is not installed" + - "c:systemctl is-enabled rsyncd -> r:masked|No such file or directory" + + # 2.3.1 Ensure telnet client is not installed. (Automated) + - id: 32579 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the telnet package: # dnf remove telnet." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_mitigations: ["M1041", "M1042"] + - mitre_tactics: ["TA0006", "TA0008"] + - mitre_techniques: ["T1040", "T1203", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet -> r:^package telnet is not installed" + + # 2.3.2 Ensure LDAP client is not installed. (Automated) + - id: 32580 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Run the following command to remove the openldap-clients package: # dnf remove openldap-clients." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q openldap-clients -> r:^package openldap-clients is not installed" + + # 2.3.3 Ensure TFTP client is not installed. (Automated) + - id: 32581 + title: "Ensure TFTP client is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + remediation: "Run the following command to remove tftp: # dnf remove tftp." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp -> r:^package tftp is not installed" + + # 2.3.4 Ensure FTP client is not installed. (Automated) + - id: 32582 + title: "Ensure FTP client is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove ftp: # dnf remove ftp." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ftp -> r:^package ftp is not installed" + + # 2.4 Ensure nonessential services listening on the system are removed or masked. (Manual) - Not Implemented + + # 3.1.1 Ensure IPv6 status is identified. (Manual) - Not Implemented + + # 3.1.2 Ensure wireless interfaces are disabled. (Automated) - Not Implemented + + # 3.1.3 Ensure TIPC is disabled. (Automated) + - id: 32583 + title: "Ensure TIPC is disabled." + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Run the following script to disable tipc: #!/usr/bin/env bash { l_mname=\"tipc\" # set module name # Check if the module exists on the system if [ -z \"$(modprobe -n -v \"$l_mname\" 2>&1 | grep -Pi -- \"\\h*modprobe:\\h+FATAL:\\h+Module\\h+$l_mname\\h+not\\h+found\\h+in\\h+directory\")\" ]; then # Remediate loadable l_loadable=\"$(modprobe -n -v \"$l_mname\")\" [ \"$(wc -l <<< \"$l_loadable\")\" -gt \"1\" ] && l_loadable=\"$(grep -P -- \"(^\\h*install|\\b$l_mname)\\b\" <<< \"$l_loadable\")\" if ! grep -Pq -- '^\\h*install \\/bin\\/(true|false)' <<< \"$l_loadable\"; then echo -e \" - setting module: \\\"$l_mname\\\" to be not loadable\" echo -e \"install $l_mname /bin/false\" >> /etc/modprobe.d/\"$l_mname\".conf fi # Remediate loaded if lsmod | grep \"$l_mname\" > /dev/null 2>&1; then echo -e \" - unloading module \\\"$l_mname\\\"\" modprobe -r \"$l_mname\" fi # Remediate deny list if ! modprobe --showconfig | grep -Pq -- \"^\\h*blacklist\\h+$l_mname\\b\"; then echo -e \" - deny listing \\\"$l_mname\\\"\" echo -e \"blacklist $l_mname\" >> /etc/modprobe.d/\"$l_mname\".conf fi else echo -e \" - Nothing to remediate\\n - Module \\\"$l_mname\\\" doesn't exist on the system\" fi }." + compliance: + - cis: ["3.1.3"] + - cis_csc_v7: ["9.2", "9.1"] + - iso_27001-2013: ["A.13.1.2", "A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1068", "T1210"] + condition: all + rules: + - 'c:modprobe -n -v tipc -> r:^install\s*\t*/bin/true' + - "not c:lsmod -> r:^tipc" + + # 3.2.1 Ensure IP forwarding is disabled. (Automated) - Not Implemented + # 3.2.2 Ensure packet redirect sending is disabled. (Automated) - Not Implemented + ############################################### + # 3.3 Network Parameters (Host and Router) + ############################################### + # 3.3.1 Ensure source routed packets are not accepted. (Automated) - Not Implemented + # 3.3.2 Ensure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.3 Ensure secure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.4 Ensure suspicious packets are logged. (Automated) - Not Implemented + # 3.3.5 Ensure broadcast ICMP requests are ignored. (Automated) - Not Implemented + # 3.3.6 Ensure bogus ICMP responses are ignored. (Automated) - Not Implemented + # 3.3.7 Ensure Reverse Path Filtering is enabled. (Automated) - Not Implemented + # 3.3.8 Ensure TCP SYN Cookies is enabled. (Automated) - Not Implemented + # 3.3.9 Ensure IPv6 router advertisements are not accepted. (Automated) - Not Implemented + + # 3.4.1.1 Ensure nftables is installed. (Automated) + - id: 32584 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install nftables # dnf install nftables." + compliance: + - cis: ["3.4.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^nftables-" + + # 3.4.1.2 Ensure a single firewall configuration utility is in use. (Automated) + - id: 32585 + title: "Ensure a single firewall configuration utility is in use." + description: "FirewallD - Is a firewall service daemon that provides a dynamic customizable host-based firewall with a D-Bus interface. Being dynamic, it enables creating, changing, and deleting the rules without the necessity to restart the firewall daemon each time the rules are changed NFTables - Includes the nft utility for configuration of the nftables subsystem of the Linux kernel Note: firewalld with nftables backend does not support passing custom nftables rules to firewalld, using the --direct option." + rationale: "In order to configure firewall rules for nftables, a firewall utility needs to be installed and active of the system. The use of more than one firewall utility may produce unexpected results." + remediation: "Run the following script to ensure that a single firewall utility is in use on the system: #!/usr/bin/env bash { l_output=\"\" l_output2=\"\" l_fwd_status=\"\" l_nft_status=\"\" l_fwutil_status=\"\" # Determine FirewallD utility Status rpm -q firewalld > /dev/null 2>&1 && l_fwd_status=\"$(systemctl is-enabled firewalld.service):$(systemctl is-active firewalld.service)\" # Determine NFTables utility Status rpm -q nftables > /dev/null 2>&1 && l_nft_status=\"$(systemctl is-enabled nftables.service):$(systemctl is-active nftables.service)\" l_fwutil_status=\"$l_fwd_status:$l_nft_status\" case $l_fwutil_status in enabled:active:masked:inactive|enabled:active:disabled:inactive) echo -e \"\\n - FirewallD utility is in use, enabled and active\\n - NFTables utility is correctly disabled or masked and inactive\\n - no remediation required\" ;; masked:inactive:enabled:active|disabled:inactive:enabled:active) echo -e \"\\n - NFTables utility is in use, enabled and active\\n - FirewallD utility is correctly disabled or masked and inactive\\n - no remediation required\" ;; enabled:active:enabled:active) echo -e \"\\n - Both FirewallD and NFTables utilities are enabled and active\\n - stopping and masking NFTables utility\" systemctl stop nftables && systemctl --now mask nftables ;; enabled:*:enabled:*) echo -e \"\\n - Both FirewallD and NFTables utilities are enabled\\n - remediating\" if [ \"$(awk -F: '{print $2}' <<< \"$l_fwutil_status\")\" = \"active\" ] && [ \"$(awk -F: '{print $4}' <<< \"$l_fwutil_status\")\" = \"inactive\" ]; then echo \" - masking NFTables utility\" systemctl stop nftables && systemctl --now mask nftables elif [ \"$(awk -F: '{print $4}' <<< \"$l_fwutil_status\")\" = \"active\" ] && [ \"$(awk -F: '{print $2}' <<< \"$l_fwutil_status\")\" = \"inactive\" ]; then echo \" - masking FirewallD utility\" systemctl stop firewalld && systemctl --now mask firewalld fi ;; *:active:*:active) echo -e \"\\n - Both FirewallD and NFTables utilities are active\\n - remediating\" if [ \"$(awk -F: '{print $1}' <<< \"$l_fwutil_status\")\" = \"enabled\" ] && [ \"$(awk -F: '{print $3}' <<< \"$l_fwutil_status\")\" != \"enabled\" ]; then echo \" - stopping and masking NFTables utility\" systemctl stop nftables && systemctl --now mask nftables elif [ \"$(awk -F: '{print $3}' <<< \"$l_fwutil_status\")\" = \"enabled\" ] && [ \"$(awk -F: '{print $1}' <<< \"$l_fwutil_status\")\" != \"enabled\" ]; then echo \" - stopping and masking FirewallD utility\" systemctl stop firewalld && systemctl --now mask firewalld fi ;; :enabled:active) echo -e \"\\n - NFTables utility is in use, enabled, and active\\n - FirewallD package is not installed\\n - no remediation required\" ;; :) echo -e \"\\n - Neither FirewallD or NFTables is installed.\\n - remediating\\n - installing NFTables\" dnf -q install nftables ;; *:*:) echo -e \"\\n - NFTables package is not installed on the system\\n - remediating\\n - installing NFTables\" dnf -q install nftables ;; *) echo -e \"\\n - Unable to determine firewall state\" ;; esac }." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-" + compliance: + - cis: ["3.4.1.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - "c:rpm -q firewalld -> r:^package firewalld is not installed" + - "not c:firewall-cmd --state -> r:^running" + - "c:systemctl is-enabled firewalld -> r:^masked" + + # 3.4.2.1 Ensure firewalld default zone is set. (Automated) - Not Implemented + + # 3.4.2.2 Ensure at least one nftables table exists. (Automated) + - id: 32586 + title: "Ensure at least one nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "Without a table, nftables will not filter network traffic." + impact: "Adding or modifying firewall rules can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example if FirewallD is not in use on the system: # nft create table inet filter Note: FirewallD uses the table inet firewalld NFTables table that is created when FirewallD is installed." + compliance: + - cis: ["3.4.2.2"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list tables -> r:^table" + + # 3.4.2.3 Ensure nftables base chains exist. (Automated) + - id: 32587 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.4.2.3"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:nftables-" + - "c:nft list ruleset -> r:hook input" + - "c:nft list ruleset -> r:hook forward" + - "c:nft list ruleset -> r:hook output" + + # 3.4.2.4 Ensure host based firewall loopback traffic is configured. (Automated) - Not Implemented + # 3.4.2.5 Ensure firewalld drops unnecessary services and ports. (Manual) - Not Implemented + # 3.4.2.6 Ensure nftables established connections are configured. (Manual) - Not Implemented + + # 3.4.2.7 Ensure nftables default deny firewall policy. (Automated) + - id: 32588 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue traversing the network stack. It is easier to explicitly permit acceptable usage than to deny unacceptable usage. Note: Changing firewall settings while connected over the network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "If NFTables utility is in use on your system: Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; }." + compliance: + - cis: ["3.4.2.7"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input && r:policy drop" + - "c:nft list ruleset -> r:hook forward && r:policy drop" + - "c:nft list ruleset -> r:hook output && r:policy drop" + + # 4.1.1.1 Ensure auditd is installed. (Automated) + - id: 32589 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # dnf install audit." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v8: ["8.2", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-2", "AU-3", "AU-3(1)", "SI-5"] + - pci_dss_v3.2.1: ["10.1", "10.2", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:rpm -q audit -> r:^audit-" + + # 4.1.1.2 Ensure auditing for processes that start prior to auditd is enabled. (Automated) + - id: 32590 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd , so that potential malicious activity cannot go undetected." + remediation: "Run the following command to update the grub2 configuration with audit=1: # grubby --update-kernel ALL --args 'audit=1'." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:grubby --info=ALL -> r:audit=1" + + # 4.1.1.3 Ensure audit_backlog_limit is sufficient. (Automated) + - id: 32591 + title: "Ensure audit_backlog_limit is sufficient." + description: "The backlog limit has a default setting of 64." + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more that 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected." + remediation: "Run the following command to add audit_backlog_limit= to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit_backlog_limit=' Example: # grubby --update-kernel ALL --args 'audit_backlog_limit=8192'." + compliance: + - cis: ["4.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:grubby --info=ALL -> n:\s*audit_backlog_limit=(\d+) compare >= 8192' + + # 4.1.1.4 Ensure auditd service is enabled. (Automated) + - id: 32592 + title: "Ensure auditd service is enabled." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:^enabled" + + # 4.1.2.1 Ensure audit log storage size is configured. (Automated) + - id: 32593 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1053"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file\s*=' + + # 4.1.2.2 Ensure audit logs are not automatically deleted. (Automated) + - id: 32594 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file_action\s*=\s*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full. (Automated) + - id: 32595 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full. The admin_space_left_action parameter tells the system what action to take when the system has detected that it is low on disk space. Valid values are ignore, syslog, suspend, single, and halt. - ignore, the audit daemon does nothing - Syslog, the audit daemon will issue a warning to syslog - Suspend, the audit daemon will stop writing records to the disk - single, the audit daemon will put the computer system in single user mode - halt, the audit daemon will shut down the system." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + impact: "If the admin_space_left_action parameter is set to halt the audit daemon will shutdown the system when the disk partition containing the audit logs becomes full." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root set admin_space_left_action to either halt or single in /etc/audit/auditd.conf. Example: admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-12", "AU-2", "AU-8", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt|^\s*admin_space_left_action\s*=\s*single' + + # 4.1.3.1 Ensure changes to system administration scope (sudoers) is collected. (Automated) + - id: 32596 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers, or files in /etc/sudoers.d, will be written to when the file(s) or related attributes have changed. The audit records will be tagged with the identifier "scope".' + rationale: "Changes in the /etc/sudoers and /etc/sudoers.d files can indicate that an unauthorized change has been made to the scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor scope changes for system administrators. Example: # printf \" -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d -p wa -k scope \" >> /etc/audit/rules.d/50-scope.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'c:auditctl -l -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'c:auditctl -l -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=\\s*\t*scope' + + # 4.1.3.2 Ensure actions as another user are always logged. (Automated) + - id: 32597 + title: "Ensure actions as another user are always logged." + description: "sudo provides users with temporary elevated privileges to perform operations, either as the superuser or another user." + rationale: "Creating an audit log of users with temporary elevated privileges and the operation(s) they performed is essential to reporting. Administrators will want to correlate the events written to the audit trail with the records written to sudo's logfile to verify if unauthorized commands have been executed." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor elevated privileges. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -C euid!=uid -F auid!=unset -S execve -k user_emulation -a always,exit -F arch=b32 -C euid!=uid -F auid!=unset -S execve -k user_emulation \" >> /etc/audit/rules.d/50-user_emulation.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + + # 4.1.3.3 Ensure events that modify the sudo log file are collected. (Automated) - Not Implemented + + # 4.1.3.4 Ensure events that modify date and time information are collected. (Automated) + - id: 32598 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the; - adjtimex - tune kernel clock - settimeofday - set time using timeval and timezone structures - stime - using seconds since 1/1/1970 - clock_settime - allows for the setting of several internal clocks and timers system calls have been executed. Further, ensure to write an audit record to the configured audit log file upon exit, tagging the records with a unique identifier such as "time-change".' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify date and time information. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S adjtimex,settimeofday,clock_settime -k time-change -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime -k time-change -w /etc/localtime -p wa -k time-change \" >> /etc/audit/rules.d/50-time-change.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64. In addition, add stime to the system call audit. Example: -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime,stime -k time-change." + compliance: + - cis: ["4.1.3.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change' + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change" + + # 4.1.3.5 Ensure events that modify the system's network environment are collected. (Automated) + - id: 32599 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitors the following system calls, and write an audit event on system call exit: - sethostname - set the systems host name - setdomainname - set the systems domain name The files being monitored are: - /etc/issue and /etc/issue.net - messages displayed pre-login - /etc/hosts - file containing host names and associated IP addresses - /etc/sysconfig/network - additional information that is valid to all network interfaces - /etc/sysconfig/network-scripts/ - directory containing network interface scripts and configurations files." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domain name of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records should have a relevant tag associated with them." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's network environment. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S sethostname,setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname,setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale \" >> /etc/audit/rules.d/50-system_local.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sysconfig/network-scripts && r:-p wa && r:-k system-locale|key=system-locale' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/sysconfig/network-scripts && r:-p wa && r:-k system-locale|key=system-locale" + + # 4.1.3.6 Ensure use of privileged commands are collected. (Automated) - Not Implemented + + # 4.1.3.7 Ensure unsuccessful file access attempts are collected. (Automated) - Not Implemented + + # 4.1.3.8 Ensure events that modify user/group information are collected. (Automated) + - id: 32600 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the modification of user or group information, including that of passwords and old passwords if in use. - /etc/group - system groups - /etc/passwd - system users - /etc/gshadow - encrypted password for each group - /etc/shadow - system user passwords - /etc/security/opasswd - storage of old passwords if the relevant PAM module is in use The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify user/group information. Example: # printf \" -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity \" >> /etc/audit/rules.d/50-identity.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.8"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity' + - "c:auditctl -l -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity" + + # 4.1.3.9 Ensure discretionary access control permission modification events are collected. (Automated) - Not Implemented + + # 4.1.3.10 Ensure successful file system mounts are collected. (Automated) + - id: 32601 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful file system mounts. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=unset -k mounts -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=unset -k mounts \" >> /etc/audit/rules.d/50-mounts.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.10"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1034"] + - mitre_tactics: ["TA0010"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["CM-6"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + + # 4.1.3.11 Ensure session initiation information is collected. (Automated) + - id: 32602 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. - /var/run/utmp - tracks all currently logged in users. - /var/log/wtmp - file tracks logins, logouts, shutdown, and reboot events. - /var/log/btmp - keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier "session.".' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor session initiation information. Example: # printf \" -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k session -w /var/log/btmp -p wa -k session \" >> /etc/audit/rules.d/50-session.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.11"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session' + - "c:auditctl -l -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session" + + # 4.1.3.12 Ensure login and logout events are collected. (Automated) + - id: 32603 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. - /var/log/lastlog - maintain records of the last time a user successfully logged in. - /var/run/faillock - directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor login and logout events. Example: # printf \" -w /var/log/lastlog -p wa -k logins -w /var/run/faillock -p wa -k logins \" >> /etc/audit/rules.d/50-login.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.12"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.8.1.3", "A.9.4.2"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins' + - "c:auditctl -l -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins" + - "c:auditctl -l -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins" + + # 4.1.3.13 Ensure file deletion events by users are collected. (Automated) + - id: 32604 + title: "Ensure file deletion events by users are collected." + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for: - unlink - remove a file - unlinkat - remove a file attribute - rename - rename a file - renameat rename a file attribute system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor file deletion events by users. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete -a always,exit -F arch=b32 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete \" >> /etc/audit/rules.d/50-delete.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.13"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + + # 4.1.3.14 Ensure events that modify the system's Mandatory Access Controls are collected. (Automated) + - id: 32605 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor SELinux, an implementation of mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux/ and /usr/share/selinux/ directories. Note: If a different Mandatory Access Control method is used, changes to the corresponding directories should be audited." + rationale: "Changes to files in the /etc/selinux/ and /usr/share/selinux/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's Mandatory Access Controls. Example: # printf \" -w /etc/selinux -p wa -k MAC-policy -w /usr/share/selinux -p wa -k MAC-policy \" >> /etc/audit/rules.d/50-MAC-policy.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.14"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/usr/share/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - "c:auditctl -l -> r:^-w && r:/etc/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy" + - "c:auditctl -l -> r:^-w && r:/usr/share/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy" + + # 4.1.3.15 Ensure successful and unsuccessful attempts to use the chcon command are recorded. (Automated) + - id: 32606 + title: "Ensure successful and unsuccessful attempts to use the chcon command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chcon command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chcon command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.15"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + + # 4.1.3.16 Ensure successful and unsuccessful attempts to use the setfacl command are recorded. (Automated) + - id: 32607 + title: "Ensure successful and unsuccessful attempts to use the setfacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the setfacl command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the setfacl command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.16"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + + # 4.1.3.17 Ensure successful and unsuccessful attempts to use the chacl command are recorded. (Automated) + - id: 32608 + title: "Ensure successful and unsuccessful attempts to use the chacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chacl command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chacl command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.17"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k priv_cmd|-F key=priv_cmd' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k priv_cmd|-F key=priv_cmd' + + # 4.1.3.18 Ensure successful and unsuccessful attempts to use the usermod command are recorded. (Automated) + - id: 32609 + title: "Ensure successful and unsuccessful attempts to use the usermod command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the usermod command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the usermod command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k usermod \" >> /etc/audit/rules.d/50-usermod.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.18"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + + # 4.1.3.19 Ensure kernel module loading unloading and modification is collected. (Automated) + - id: 32610 + title: "Ensure kernel module loading unloading and modification is collected." + description: "Monitor the loading and unloading of kernel modules. All the loading / listing / dependency checking of modules is done by kmod via symbolic links. The following system calls control loading and unloading of modules: - init_module - load a module - finit_module - load a module (used when the overhead of using cryptographically signed modules to determine the authenticity of a module can be avoided) - delete_module - delete a module - create_module - create a loadable module entry - query_module - query the kernel for various bits pertaining to modules Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of modules." + rationale: "Monitoring the use of all the various ways to manipulate kernel modules could provide system administrators with evidence that an unauthorized change was made to a kernel module, possibly compromising the security of the system." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor kernel module modification. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S init_module,finit_module,delete_module,create_module,query_module -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules -a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules \" >> /etc/audit/rules.d/50-kernel_modules.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.19"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l-> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - "c:ls -l /usr/sbin/lsmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/rmmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/insmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modinfo -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modprobe -> r:/bin/kmod" + - "c:ls -l /usr/sbin/depmod -> r:/bin/kmod" + + # 4.1.3.20 Ensure the audit configuration is immutable. (Automated) + - id: 32611 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: This setting will require the system to be rebooted to update the active auditd configuration settings.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line -e 2 at the end of the file: Example: # printf -- \"-e 2\" >> /etc/audit/rules.d/99-finalize.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.20"] + - cis_csc_v8: ["3.3", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AC-3", "AU-3", "AU-3(1)", "MP-2"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "7.1", "9.4.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + condition: all + rules: + - 'not d:/etc/audit/rules.d -> r:\.+.rules$ -> !r:\s*\t*-e 2$' + + # 4.1.3.21 Ensure the running and on disk configuration is the same. (Manual) + - id: 32612 + title: "Ensure the running and on disk configuration is the same." + description: "The Audit system have both on disk and running configuration. It is possible for these configuration settings to differ. Note: Due to the limitations of augenrules and auditctl, it is not absolutely guaranteed that loading the rule sets via augenrules --load will result in all rules being loaded or even that the user will be informed if there was a problem loading the rules." + rationale: "Configuration differences between what is currently running and what is on disk could cause unexpected problems or may give a false impression of compliance requirements." + remediation: 'If the rules are not aligned across all three () areas, run the following command to merge and load all rules: # augenrules --load Check if reboot is required. if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then echo "Reboot required to load rules"; fi.' + compliance: + - cis: ["4.1.3.21"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:augenrules --check -> r:/usr/sbin/augenrules && r:No change" + + # 4.1.4.1 Ensure audit log files are mode 0640 or less permissive. (Automated) - Not Implemented + # 4.1.4.2 Ensure only authorized users own audit log files. (Automated) - Not Implemented + + # 4.1.4.3 Ensure only authorized groups are assigned ownership of audit log files. (Automated) + - id: 32613 + title: "Ensure only authorized groups are assigned ownership of audit log files." + description: "Audit log files contain information about the system and system activity." + rationale: "Access to audit records can reveal system and configuration data to attackers, potentially compromising its confidentiality." + remediation: "Run the following command to configure the audit log files to be owned by adm group: # find $(dirname $(awk -F\"=\" '/^\\s*log_file\\s*=\\s*/ {print $2}' /etc/audit/auditd.conf | xargs)) -type f \\( ! -group adm -a ! -group root \\) -exec chgrp adm {} + Run the following command to configure the audit log files to be owned by the adm group: # chgrp adm /var/log/audit/ Run the following command to set the log_group parameter in the audit configuration file to log_group = adm: # sed -ri 's/^\\s*#?\\s*log_group\\s*=\\s*\\S+(\\s*#.*)?.*$/log_group = adm\\1/' /etc/audit/auditd.conf Run the following command to restart the audit daemon to reload the configuration file: # systemctl restart auditd." + compliance: + - cis: ["4.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'f:/etc/audit/auditd.conf -> r:log_group\s*\t*= && !r:adm|root' + + # 4.1.4.4 Ensure the audit log directory is 0750 or more restrictive. (Automated) - Not Implemented + + # 4.1.4.5 Ensure audit configuration files are 640 or more restrictive. (Automated) + - id: 32614 + title: "Ensure audit configuration files are 640 or more restrictive." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to remove more permissive mode than 0640 from the audit configuration files: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) -exec chmod u-x,g-wx,o-rwx {} +." + compliance: + - cis: ["4.1.4.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) -exec stat -Lc \"%n %a\" {} + -> r:\\w+ -> !r:000|040|200|400|600|240|440|640" + + # 4.1.4.6 Ensure audit configuration files are owned by root. (Automated) + - id: 32615 + title: "Ensure audit configuration files are owned by root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change ownership to root user: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -user root -exec chown root {} +." + compliance: + - cis: ["4.1.4.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:find /etc/audit/ -type f \\( -name '*.rules' -o -name '*.conf' \\) -exec stat -Lc \"%U\" {} + -> !r:root|\\s*" + + # 4.1.4.7 Ensure audit configuration files belong to group root. (Automated) + - id: 32616 + title: "Ensure audit configuration files belong to group root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change group to root: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -group root -exec chgrp root {} +." + compliance: + - cis: ["4.1.4.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) -exec stat -Lc \"%U\" {} + -> !r:root|\\s*" + + # 4.1.4.8 Ensure audit tools are 755 or more restrictive. (Automated) + - id: 32617 + title: "Ensure audit tools are 755 or more restrictive." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:stat -c "%n %a" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:\w+ && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + + # 4.1.4.9 Ensure audit tools are owned by root. (Automated) + - id: 32618 + title: "Ensure audit tools are owned by root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to change the owner of the audit tools to the root user: # chown root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:stat -c "%n %U" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> !r:root|\\s*' + + # 4.1.4.10 Ensure audit tools belong to group root. (Automated) + - id: 32619 + title: "Ensure audit tools belong to group root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules Run the following command to change owner and group of the audit tools to root user and group: # chown root:root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.10"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755 && r:\s*\t*root\s*\t*root' + + # 4.2.1.1 Ensure rsyslog is installed. (Automated) + - id: 32620 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is recommended in environments where journald does not meet operation requirements." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data enroute to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # dnf install rsyslog." + compliance: + - cis: ["4.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1005", "T1070", "T1070.002"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q rsyslog -> r:^rsyslog-" + + # 4.2.1.2 Ensure rsyslog service is enabled. (Automated) + - id: 32621 + title: "Ensure rsyslog service is enabled." + description: "Once the rsyslog package is installed, ensure that the service is enabled." + rationale: "If the rsyslog service is not enabled to start on boot, the system will not capture logging events." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1211", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:^enabled" + + # 4.2.1.3 Ensure journald is configured to send logs to rsyslog. (Manual) + - id: 32622 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the RSyslog service provides a consistent means of log collection and export." + rationale: "IF RSyslog is the preferred method for capturing logs, all logs of the system should be sent to it for further processing. Note: This recommendation only applies if rsyslog is the chosen method for client side logging. Do not apply this recommendation if journald is used." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.3"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006", "T1565"] + - nist_sp_800-53: ["AC-3", "AU-12", "AU-2", "AU-4", "MP-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + + # 4.2.1.4 Ensure rsyslog default file permissions are configured. (Automated) + - id: 32623 + title: "Ensure rsyslog default file permissions are configured." + description: "RSyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + impact: "The systems global umask could override, but only making the file permissions stricter, what is configured in RSyslog with the FileCreateMode directive. RSyslog also has its own $umask directive that can alter the intended file creation mode. In addition, consideration should be given to how FileCreateMode is used. Thus it is critical to ensure that the intended file creation mode is not overridden with less restrictive settings in /etc/rsyslog.conf, /etc/rsyslog.d/*conf files and that FileCreateMode is set before any file is created." + remediation: "Edit either /etc/rsyslog.conf or a dedicated .conf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640 Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.4"] + - cis_csc_v8: ["3.3", "8.2"] + - cis_csc_v7: ["5.1", "6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)", "164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.14.2.5", "A.8.1.3"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 0640|^\$FileCreateMode 0600|^\$FileCreateMode 0400' + - 'd:/etc/rsyslog.d/ -> r:\.+.conf -> r:^\$FileCreateMode 0640|^\$FileCreateMode 0600|^\$FileCreateMode 0400' + + # 4.2.1.5 Ensure logging is configured. (Manual) - Not Implemented + # 4.2.1.6 Ensure rsyslog is configured to send logs to a remote log host. (Manual) - Not Implemented + + # 4.2.1.7 Ensure rsyslog is not configured to receive logs from a remote client. (Automated) + - id: 32624 + title: "Ensure rsyslog is not configured to receive logs from a remote client." + description: "RSyslog supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside its operational boundary." + remediation: 'Should there be any active log server configuration found in the auditing section, modify those files and remove the specific lines highlighted by the audit. Ensure none of the following entries are present in any of /etc/rsyslog.conf or /etc/rsyslog.d/*.conf. New format module(load="imtcp") input(type="imtcp" port="514") -OR- Old format $ModLoad imtcp $InputTCPServerRun Restart the service: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.7"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not d:/etc/rsyslog.d -> r:\.+.conf$ -> r:^\s*\t*\$ModLoad imtcp|\s*\t*^\$InputTCPServerRun|^\s*\t*module load="imtcp"|^\s*\t*input type="imtcp" port="514"' + - 'not f:/etc/rsyslog.conf -> r:^\s*\t*\$ModLoad imtcp|^\s*\t*\$InputTCPServerRun|^\s*\t*module load="imtcp"|^\s*\t*input type="imtcp" port="514"' + + # 4.2.2.1.1 Ensure systemd-journal-remote is installed. (Manual) + - id: 32625 + title: "Ensure systemd-journal-remote is installed." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralized log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to install systemd-journal-remote: # dnf install systemd-journal-remote." + compliance: + - cis: ["4.2.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q systemd-journal-remote -> r:^systemd-journal-remote-" + + # 4.2.2.1.2 Ensure systemd-journal-remote is configured. (Manual) - Not Implemented + + # 4.2.2.1.3 Ensure systemd-journal-remote is enabled. (Manual) + - id: 32626 + title: "Ensure systemd-journal-remote is enabled." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralized log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to enable systemd-journal-remote: # systemctl --now enable systemd-journal-upload.service." + compliance: + - cis: ["4.2.2.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-12", "AU-2", "CM-7", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:systemctl is-enabled systemd-journal-upload.service -> r:^\s*\t*enabled$' + + # 4.2.2.1.4 Ensure journald is not configured to receive logs from a remote client. (Automated) + - id: 32627 + title: "Ensure journald is not configured to receive logs from a remote client." + description: "Journald supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts. NOTE: - The same package, systemd-journal-remote, is used for both sending logs to remote hosts and receiving incoming logs. - With regards to receiving logs, there are two services; systemd-journal- remote.socket and systemd-journal-remote.service." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: "Run the following command to disable systemd-journal-remote.socket: # systemctl --now mask systemd-journal-remote.socket." + compliance: + - cis: ["4.2.2.1.4"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-remote.socket -> r:^masked" + + # 4.2.2.2 Ensure journald service is enabled. (Automated) + - id: 32628 + title: "Ensure journald service is enabled." + description: "Ensure that the systemd-journald service is enabled to allow capturing of logging events." + rationale: "If the systemd-journald service is not enabled to start on boot, the system will not capture logging events." + remediation: "By default the systemd-journald service does not have an [Install] section and thus cannot be enabled / disabled. It is meant to be referenced as Requires or Wants by other unit files. As such, if the status of systemd-journald is not static, investigate why." + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journald.service -> r:^static" + + # 4.2.2.3 Ensure journald is configured to compress large log files. (Automated) + - id: 32629 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes Restart the service: # systemctl restart systemd-journald.service." + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.3", "6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1053"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Compress=yes' + + # 4.2.2.4 Ensure journald is configured to write logfiles to persistent disk. (Automated) + - id: 32630 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss due to a reboot." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent Restart the service: # systemctl restart systemd-journald.service." + compliance: + - cis: ["4.2.2.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Storage=persistent' + + # 4.2.2.5 Ensure journald is not configured to send logs to rsyslog. (Manual) + - id: 32631 + title: "Ensure journald is not configured to send logs to rsyslog." + description: "Data from journald should be kept in the confines of the service and not forwarded on to other services." + rationale: "IF journald is the method for capturing logs, all logs of the system should be handled by journald and not forwarded to other logging mechanisms. Note: This recommendation only applies if journald is the chosen method for client side logging. Do not apply this recommendation if rsyslog is used." + remediation: "Edit the /etc/systemd/journald.conf file and ensure that ForwardToSyslog=yes is removed. Restart the service: # systemctl restart systemd-journald.service." + compliance: + - cis: ["4.2.2.5"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006", "T1565"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'not f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + + # 4.2.2.6 Ensure journald log rotation is configured per site policy. (Manual) - Not Implemented + # 4.2.2.7 Ensure journald default file permissions configured. (Manual) - Not Implemented + + # 4.2.3 Ensure all logfiles have appropriate permissions and ownership. (Automated) + - id: 32632 + title: "Ensure all logfiles have appropriate permissions and ownership." + description: "Log files contain information from many services on the local system, or in the event of a centralized log server, others system's logs as well. In general log files are found in /var/log/, although application can be configured to store logs elsewhere. Should your application store its logs in another location, ensure to run the same test on that location." + rationale: "It is important that log files have the correct permissions to ensure that sensitive data is protected and that only the appropriate users / groups have access to them." + remediation: "Run the following script to update permissions and ownership on files in /var/log. Although the script is not destructive, ensure that the output of the audit procedure is captured in the event that the remediation causes issues. #!/usr/bin/env bash { echo -e \"\\n- Start remediation - logfiles have appropriate permissions and ownership\" UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) find /var/log -type f | while read -r fname; do bname=\"$(basename \"$fname\")\" fugname=\"$(stat -Lc \"%U %G\" \"$fname\")\" funame=\"$(awk '{print $1}' <<< \"$fugname\")\" fugroup=\"$(awk '{print $2}' <<< \"$fugname\")\" fuid=\"$(stat -Lc \"%u\" \"$fname\")\" fmode=\"$(stat -Lc \"%a\" \"$fname\")\" case \"$bname\" in lastlog | lastlog.* | wtmp | wtmp.* | wtmp-* | btmp | btmp.* | btmp- *) ! grep -Pq -- '^\\h*[0,2,4,6][0,2,4,6][0,4]\\h*$' <<< \"$fmode\" && echo -e \"- changing mode on \\\"$fname\\\"\" && chmod ug-x,o-wx \"$fname\" ! grep -Pq -- '^\\h*root\\h*$' <<< \"$funame\" && echo -e \"- changing owner on \\\"$fname\\\"\" && chown root \"$fname\" ! grep -Pq -- '^\\h*(utmp|root)\\h*$' <<< \"$fugroup\" && echo -e \"- changing group on \\\"$fname\\\"\" && chgrp root \"$fname\" ;; secure | auth.log | syslog | messages) ! grep -Pq -- '^\\h*[0,2,4,6][0,4]0\\h*$' <<< \"$fmode\" && echo -e \"- changing mode on \\\"$fname\\\"\" && chmod u-x,g-wx,o-rwx \"$fname\" ! grep -Pq -- '^\\h*(syslog|root)\\h*$' <<< \"$funame\" && echo -e \"- changing owner on \\\"$fname\\\"\" && chown root \"$fname\" ! grep -Pq -- '^\\h*(adm|root)\\h*$' <<< \"$fugroup\" && echo -e \"- changing group on \\\"$fname\\\"\" && chgrp root \"$fname\" ;; SSSD | sssd) ! grep -Pq -- '^\\h*[0,2,4,6][0,2,4,6]0\\h*$' <<< \"$fmode\" && echo -e \"- changing mode on \\\"$fname\\\"\" && chmod ug-x,o-rwx \"$fname\" ! grep -Piq -- '^\\h*(SSSD|root)\\h*$' <<< \"$funame\" && echo -e \"- changing owner on \\\"$fname\\\"\" && chown root \"$fname\" ! grep -Piq -- '^\\h*(SSSD|root)\\h*$' <<< \"$fugroup\" && echo -e \"- changing group on \\\"$fname\\\"\" && chgrp root \"$fname\" ;; gdm | gdm3) ! grep -Pq -- '^\\h*[0,2,4,6][0,2,4,6]0\\h*$' <<< \"$fmode\" && echo -e \"- changing mode on \\\"$fname\\\"\" && chmod ug-x,o-rwx ! grep -Pq -- '^\\h*root\\h*$' <<< \"$funame\" && echo -e \"- changing owner on \\\"$fname\\\"\" && chown root \"$fname\" ! grep -Pq -- '^\\h*(gdm3?|root)\\h*$' <<< \"$fugroup\" && echo -e \"- changing group on \\\"$fname\\\"\" && chgrp root \"$fname\" ;; *.journal | *.journal~) ! grep -Pq -- '^\\h*[0,2,4,6][0,4]0\\h*$' <<< \"$fmode\" && echo -e \"- changing mode on \\\"$fname\\\"\" && chmod u-x,g-wx,o-rwx \"$fname\" ! grep -Pq -- '^\\h*root\\h*$' <<< \"$funame\" && echo -e \"- changing owner on \\\"$fname\\\"\" && chown root \"$fname\" ! grep -Pq -- '^\\h*(systemd-journal|root)\\h*$' <<< \"$fugroup\" && echo -e \"- changing group on \\\"$fname\\\"\" && chgrp root \"$fname\" ;; *) ! grep -Pq -- '^\\h*[0,2,4,6][0,4]0\\h*$' <<< \"$fmode\" && echo -e \"- changing mode on \\\"$fname\\\"\" && chmod u-x,g-wx,o-rwx \"$fname\" if [ \"$fuid\" -ge \"$UID_MIN\" ] || ! grep -Pq -- '(adm|root|'\"$(id -gn \"$funame\")\"')' <<< \"$fugroup\"; then if [ -n \"$(awk -v grp=\"$fugroup\" -F: '$1==grp {print $4}' /etc/group)\" ] || ! grep -Pq '(syslog|root)' <<< \"$funame\"; then [ \"$fuid\" -ge \"$UID_MIN\" ] && echo -e \"- changing owner on \\\"$fname\\\"\" && chown root \"$fname\" ! grep -Pq -- '^\\h*(adm|root)\\h*$' <<< \"$fugroup\" && echo - e \"- changing group on \\\"$fname\\\"\" && chgrp root \"$fname\" fi fi ;; esac done echo -e \"- End remediation - logfiles have appropriate permissions and ownership\\n\" } Note: You may also need to change the configuration for your logging software or services for any logs that had incorrect permissions. If there are services that log to other locations, ensure that those log files have the appropriate permissions." + compliance: + - cis: ["4.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:sh -c "find /var/log/ -type f -perm /g+wx,o+rwx -exec ls -l "{}" +" -> r:\w+' + + # 4.3 Ensure logrotate is configured. (Manual) - Not Implemented + + # 5.1.1 Ensure cron daemon is enabled. (Automated) + - id: 32633 + title: "Ensure cron daemon is enabled." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: # systemctl --now enable crond." + compliance: + - cis: ["5.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - "c:systemctl is-enabled crond -> r:^enabled" + + # 5.1.2 Ensure permissions on /etc/crontab are configured. (Automated) + - id: 32634 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to this file could provide unprivileged users with the ability to elevate their privileges. Read access to this file could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab." + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured. (Automated) + - id: 32635 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : # chown root:root /etc/cron.hourly # chmod og-rwx /etc/cron.hourly." + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:Access:\s*\(0\d00/\w\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured. (Automated) + - id: 32636 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily." + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:Access:\s*\(0700/drwx------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured. (Automated) + - id: 32637 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : # chown root:root /etc/cron.weekly # chmod og-rwx /etc/cron.weekly." + compliance: + - cis: ["5.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:Access:\s*\(0\d00/\w\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured. (Automated) + - id: 32638 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly." + compliance: + - cis: ["5.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:Access:\s*\(0\d00/\w\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured. (Automated) + - id: 32639 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily, weekly and monthly jobs from /etc/crontab , but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d." + compliance: + - cis: ["5.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:Access:\s*\(0\d00/\w\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 5.1.8 Ensure cron is restricted to authorized users. (Automated) + - id: 32640 + title: "Ensure cron is restricted to authorized users." + description: "If cron is installed in the system, configure /etc/cron.allow to allow specific users to use these services. If /etc/cron.allow does not exist, then /etc/cron.deny is checked. Any user not specifically defined in those files is allowed to use cron. By removing the file, only users in /etc/cron.allow are allowed to use cron. Note: Even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: 'Run the following script to remove /etc/cron.deny, create /etc/cron.allow, and set the file mode on /etc/cron.allow: #!/usr/bin/env bash { if rpm -q cronie >/dev/null; then [ -e /etc/cron.deny ] && rm -f /etc/cron.deny [ ! -e /etc/cron.allow ] && touch /etc/cron.allow chown root:root /etc/cron.allow chmod u-x,go-rwx /etc/cron.allow else echo "cron is not installed on the system" fi } OR Run the following command to remove cron: # dnf remove cronie.' + compliance: + - cis: ["5.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "not f:/etc/cron.deny" + - 'c:stat /etc/cron.allow/ -> r:Access:\s*\t*\(0640/-rw-r-----\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)' + + # 5.1.9 Ensure at is restricted to authorized users. (Automated) + - id: 32641 + title: "Ensure at is restricted to authorized users." + description: "If at is installed in the system, configure /etc/at.allow to allow specific users to use these services. If /etc/at.allow does not exist, then /etc/at.deny is checked. Any user not specifically defined in those files is allowed to use at. By removing the file, only users in /etc/at.allow are allowed to use at. Note: Even though a given user is not listed in at.allow, at jobs can still be run as that user. The at.allow file only controls administrative access to the at command for scheduling and modifying at jobs." + rationale: "On many systems, only the system administrator is authorized to schedule at jobs. Using the at.allow file to control who can run at jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: 'Run the following script to remove /etc/at.deny, create /etc/at.allow, and set the file mode for /etc/at.allow: #!/usr/bin/env bash { if rpm -q at >/dev/null; then [ -e /etc/at.deny ] && rm -f /etc/at.deny [ ! -e /etc/at.allow ] && touch /etc/at.allow chown root:root /etc/at.allow chmod u-x,go-rwx /etc/at.allow else echo "at is not installed on the system" fi } OR Run the following command to remove at: # dnf remove at.' + compliance: + - cis: ["5.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "not f:/etc/at.deny" + - 'c:stat /etc/at.allow/ -> r:Access:\s*\t*\(0640/-rw-r-----\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)' + + # 5.2 Configure SSH Server + + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured. (Automated) + - id: 32642 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod u-x,go-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1098", "T1098.004", "T1543", "T1543.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:Access:\s*\t*\(0600/-rw-------\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*root\)\s*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)' + + # 5.2.2 Ensure permissions on SSH private host key files are configured. (Automated) - Not Implemented + # 5.2.3 Ensure permissions on SSH public host key files are configured. (Automated) - Not Implemented + + # 5.2.4 Ensure SSH access is limited. (Automated) + - id: 32643 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: o The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: o The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: o The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: o The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set one or more of the parameters as follows: AllowUsers -OR- AllowGroups -OR- DenyUsers -OR- DenyGroups ." + compliance: + - cis: ["5.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021", "T1021.004"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*Allowusers\s*\t*\w+|^\s*\t*Denyusers\s*\t*\w+|^\s*\t*Allowgroups\s*\t*\w+|^\s*\t*Denygroups\s*\t*\w+' + - 'f:/etc/ssh/sshd_config -> r:^\s*\t*Allowusers\s*\t*\w+|^\s*\t*Denyusers\s*\t*\w+|^\s*\t*Allowgroups\s*\t*\w+|^\s*\t*Denygroups\s*\t*\w+' + - 'd:/etc/ssh/sshd_config.d -> r:\.* -> r:^\s*\t*Allowusers\s*\t*\w+|^\s*\t*Denyusers\s*\t*\w+|^\s*\t*Allowgroups\s*\t*\w+|^\s*\t*Denygroups\s*\t*\w+' + + # 5.2.5 Ensure SSH LogLevel is appropriate. (Automated) + - id: 32644 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the LogLevel parameter as follows: LogLevel VERBOSE OR LogLevel INFO Run the following command to comment out any LogLevel parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than VERBOSE or INFO: # grep -Pi '^\\h*LogLevel\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi '(VERBOSE|INFO)' | while read -r l_out; do sed -ri \"/^\\s*LogLevel\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + references: + - "https://www.ssh.com/ssh/sshd_config/" + compliance: + - cis: ["5.2.5"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: any + rules: + - "c:sshd -T -> r:^loglevel VERBOSE|^loglevel INFO" + - "not f:/etc/ssh/sshd_config -> !r:^\\s*\\t*loglevel\\s*\\t*VERBOSE|^\\s*\\t*loglevel\\s*\\t*INFO" + + # 5.2.6 Ensure SSH PAM is enabled. (Automated) + - id: 32645 + title: "Ensure SSH PAM is enabled." + description: 'UsePAM Enables the Pluggable Authentication Module interface. If set to "yes" this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types.' + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + impact: "If UsePAM is enabled, you will not be able to run sshd as a non-root user." + remediation: "Edit or create a file in the directory /etc/ssh/sshd_config.d/ ending in *.conf or the /etc/ssh/sshd_config file and set the parameter as follows: UsePAM yes Run the following command to comment out any UsePAM parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than yes # grep -Pi '^\\h*UsePAM\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'yes' | while read -r l_out; do sed -ri \"/^\\s*UsePAM\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.6"] + - mitre_mitigations: ["M1035"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1021", "T1021.004"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - "c:sshd -T -> r:^usepam yes" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*UsePAM\\s*\\t*no" + + # 5.2.7 Ensure SSH root login is disabled. (Automated) + - id: 32646 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the PermitRootLogin parameter as follows: PermitRootLogin no Run the following command to comment out any PermitRootLogin parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi '^\\h*PermitRootLogin\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*PermitRootLogin\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.7"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - "c:sshd -T -> r:^permitrootlogin no" + - "f:/etc/ssh/sshd_config -> r:^\\s*\\t*PermitRootLogin\\s*\\t*no" + + # 5.2.8 Ensure SSH HostbasedAuthentication is disabled. (Automated) + - id: 32647 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the HostbasedAuthentication parameter as follows: HostbasedAuthentication no Run the following command to comment out any HostbasedAuthentication parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no: # grep -Pi '^\\h*HostbasedAuthentication\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*HostbasedAuthentication\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:sshd -T -> r:^hostbasedauthentication no" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*HostBasedAuthentication\\s*\\t*yes" + + # 5.2.9 Ensure SSH PermitEmptyPasswords is disabled. (Automated) + - id: 32648 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the PermitEmptyPasswords parameter as follows: PermitEmptyPasswords no Run the following command to comment out any PermitEmptyPasswords parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi '^\\h*PermitEmptyPasswords\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*PermitEmptyPasswords\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.9"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:sshd -T -> r:^permitemptypasswords no" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*PermitEmptyPasswords\\s*\\t*yes" + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled. (Automated) + - id: 32649 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the PermitUserEnvironment parameter as follows: PermitUserEnvironment no Run the following command to comment out any PermitUserEnvironment parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi '^\\h*PermitUserEnvironment\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*PermitUserEnvironment\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:sshd -T -> r:^permituserenvironment no" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*PermitUserEnvironment\\s*\\t*yes" + + # 5.2.11 Ensure SSH IgnoreRhosts is enabled. (Automated) + - id: 32650 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the IgnoreRhosts parameter as follows: IgnoreRhosts yes Run the following command to comment out any IgnoreRhosts parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than yes # grep -Pi '^\\h*IgnoreRhosts\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'yes' | while read -r l_out; do sed -ri \"/^\\s*IgnoreRhosts\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.11"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - "c:sshd -T -> r:^ignorerhosts yes" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*IgnoreRhosts\\s*\\t*no" + + # 5.2.12 Ensure SSH X11 forwarding is disabled. (Automated) + - id: 32651 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the X11Forwarding parameter as follows: X11Forwarding no Run the following command to comment out any X11Forwarding parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi '^\\h*X11Forwarding\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*X11Forwarding\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1210"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:sshd -T -> r:^x11forwarding no" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*x11forwarding\\s*\\t*yes" + + # 5.2.13 Ensure SSH AllowTcpForwarding is disabled. (Automated) + - id: 32652 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments that employ mainframe systems as their application backends. In those environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the AllowTcpForwarding parameter as follows: AllowTcpForwarding no Run the following command to comment out any AllowTcpForwarding parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no: # grep -Pi '^\\h*AllowTcpForwarding\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*AllowTcpForwarding\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + references: + - "https://www.ssh.com/ssh/tunneling/example" + compliance: + - cis: ["5.2.13"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1048", "T1048.002", "T1572"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:sshd -T -> r:^allowtcpforwarding && r:no$" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*AllowTcpForwarding\\s*\\t*yes" + + # 5.2.14 Ensure system-wide crypto policy is not over-ridden. (Automated) + - id: 32653 + title: "Ensure system-wide crypto policy is not over-ridden." + description: "System-wide Crypto policy can be over-ridden or opted out of for openSSH." + rationale: "Over-riding or opting out of the system-wide crypto policy could allow for the use of less secure Ciphers, MACs, KexAlgorithms and GSSAPIKexAlgorithm." + remediation: "Run the following commands: # sed -ri \"s/^\\s*(CRYPTO_POLICY\\s*=.*)$/# \\1/\" /etc/sysconfig/sshd /etc/ssh/sshd_config.d/*.conf # systemctl reload sshd." + compliance: + - cis: ["5.2.14"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["SC-8"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'not f:/etc/sysconfig/sshd -> ^\s*CRYPTO_POLICY=' + + # 5.2.15 Ensure SSH warning banner is configured. (Automated) + - id: 32654 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the Banner parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.2.15"] + - mitre_mitigations: ["M1035"] + - mitre_tactics: ["TA0001", "TA0007"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - "c:sshd -T -> r:^banner && r:/etc/issue.net$" + + # 5.2.16 Ensure SSH MaxAuthTries is set to 4 or less. (Automated) + - id: 32655 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the MaxAuthTries parameter as follows: MaxAuthTries 4 Run the following command to comment out any MaxAuthTries parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting greater than 4: # grep -Pi '^\\h*maxauthtries\\h+([5-9]|[1-9][0-9]+)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*maxauthtries\\s+([5-9]|[1-9][0-9]+)/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.16"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - mitre_mitigations: ["M1036"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:sshd -T -> n:^maxauthtries\\s+(\\d+) compare <= 4" + - "not f:/etc/ssh/sshd_config -> n:^\\s*\\t*maxauthtries\\s+(\\d+) compare > 4" + + # 5.2.17 Ensure SSH MaxStartups is configured. (Automated) + - id: 32656 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the MaxStartups parameter as follows: MaxStartups 10:30:60 Run the following command to comment out any MaxStartups parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting greater than 10:30:60: # grep -Pi '^\\s*maxstartups\\s+(((1[1-9]|[1-9][0-9][0-9]+):([0-9]+):([0- 9]+))|(([0-9]+):(3[1-9]|[4-9][0-9]|[1-9][0-9][0-9]+):([0-9]+))|(([0-9]+):([0- 9]+):(6[1-9]|[7-9][0-9]|[1-9][0-9][0-9]+)))' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*MaxStartups\\s+(((1[1-9]|[1-9][0-9][0-9]+):([0-9]+):([0-9]+))|(([0- 9]+):(3[1-9]|[4-9][0-9]|[1-9][0-9][0-9]+):([0-9]+))|(([0-9]+):([0-9]+):(6[1- 9]|[7-9][0-9]|[1-9][0-9][0-9]+)))/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1499", "T1499.002"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10 && n:^maxstartups\s+(\d+):\d+:\d+ compare >= 1' + - 'c:sshd -T -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30 && n:^maxstartups\s+(\d+):\d+:\d+ compare >= 1' + - 'c:sshd -T -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60 && n:^maxstartups\s+(\d+):\d+:\d+ compare >= 1' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxStartups\s*\t*(\d+):\d+:\d+ compare > 10' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxStartups\s*\t*(\d+):\d+:\d+ compare == 0' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxStartups\s*\t*\d+:(\d+):\d+ compare > 30' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxStartups\s*\t*\d+:(\d+):\d+ compare == 0' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxStartups\s*\t*\d+:\d+:(\d+) compare > 60' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxStartups\s*\t*\d+:\d+:(\d+) compare == 0' + + # 5.2.18 Ensure SSH MaxSessions is set to 10 or less. (Automated) + - id: 32657 + title: "Ensure SSH MaxSessions is set to 10 or less." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the MaxSessions parameter as follows: MaxSessions 10 Run the following command to comment out any MaxSessions parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting greater than 10 # grep -Pi '^\\s*MaxSessions\\s+(1[1-9]|[2-9][0-9]|[1-9][0-9][0-9]+)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*MaxSessions\\s+(1[1-9]|[2-9][0-9]|[1-9][0-9][0-9]+)/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.18"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1499", "T1499.002"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - "c:sshd -T -> n:^maxsessions\\s*\\t*(\\d+) compare <= 10" + - "not f:/etc/ssh/sshd_config -> n:^^\\s*\\t*MaxSessions\\s+(\\d+) compare > 10" + + # 5.2.19 Ensure SSH LoginGraceTime is set to one minute or less. (Automated) + - id: 32658 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60 Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the LoginGraceTime parameter as follows: LoginGraceTime 60 -or- LoginGraceTime 1m Run the following command to comment out any LoginGraceTime parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting equal to 0 or greater than 60 seconds: # grep -Pi '^\\s*LoginGraceTime\\s+(0|6[1-9]|[7-9][0-9]|[1-9][0-9][0- 9]+|[^1]m)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read - r l_out; do sed -ri \"/^\\s*LoginGraceTime\\s+(0|6[1-9]|[7-9][0-9]|[1-9][0-9][0- 9]+|[^1]m)/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.19"] + - mitre_mitigations: ["M1036"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003", "T1110.004"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*logingracetime\s*(\d+) compare <= 60 && n:^logingracetime\s*(\d+) compare >= 1' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*LoginGraceTime\s*\t*(\d+) compare > 60' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*LoginGraceTime\s*\t*(\d+) compare == 0' + + # 5.2.20 Ensure SSH Idle Timeout Interval is configured. (Automated) + - id: 32659 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "NOTE: To clarify, the two settings described below are only meant for idle connections from a protocol perspective and not meant to check if the user is active or not. An idle user does not mean an idle connection. SSH does not, and never had, intentionally the capability to drop idle users. In SSH versions before 8.2p1 there was a bug that caused these values to behave in such a manner that they were abused to disconnect idle users. This bug has been resolved in 8.2p1 and thus may no longer be abused to disconnect idle users. The two options ClientAliveInterval and ClientAliveCountMax control the timeout of SSH sessions. Taken directly from man 5 sshd_config: - ClientAliveInterval Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax Sets the number of client alive messages which may be sent without sshd(8) receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. It is important to note that the use of client alive messages is very different from TCPKeepAlive. The client alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option on. The client alive mechanism is valuable when the client or server depend on knowing when a connection has become unresponsive. The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds. Setting a zero ClientAliveCountMax disables connection termination. abled by TCPKeepAlive is spoofable." + rationale: "In order to prevent resource exhaustion, appropriate values should be set for both ClientAliveInterval and ClientAliveCountMax. Specifically, looking at the source code, ClientAliveCountMax must be greater than zero in order to utilize the ability of SSH to drop idle connections. If connections are allowed to stay open indefinitely, this can potentially be used as a DDOS attack or simple resource exhaustion could occur over unreliable networks. The example set here is a 45 second timeout. Consult your site policy for network timeouts and apply as appropriate." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the ClientAliveInterval and ClientAliveCountMax parameters according to site policy. Example: ClientAliveInterval 15 ClientAliveCountMax 3 Edit files ending in *.conf in the /etc/ssh/sshd_config.d/ directory and the /etc/ssh/sshd_config file and remove occurrences of the ClientAliveInterval and ClientAliveCountMax parameters not in accordence with local site policy. Run the following command to comment out any ClientAliveCountMax parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include the setting of 0 \"disabled\": # grep -Pi '^\\h*ClientAliveCountMax\\h+0\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*ClientAliveCountMax\\s+0/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + references: + - "https://man.openbsd.org/sshd_config" + compliance: + - cis: ["5.2.20"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - "c:sshd -T -> -> n:^clientaliveinterval\\s*\\t*(\\d+) compare > 0" + - "c:sshd -T -> -> n:^clientalivecountmax\\s*\\t*(\\d+) compare > 0" + + # 5.3.1 Ensure sudo is installed. (Automated) + - id: 32660 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plug-in architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plug-ins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers and any entries in /etc/sudoers.d. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo # dnf install sudo." + compliance: + - cis: ["5.3.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - "c:dnf list sudo -> r:^sudo.x86_64" + + # 5.3.2 Ensure sudo commands use pty. (Automated) + - id: 32661 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo terminal (pseudo-pty)." + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: "Edit the file /etc/sudoers with visudo or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["5.3.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1026", "M1038"] + - mitre_tactics: ["TA0001", "TA0003"] + - mitre_techniques: ["T1078", "T1078.003", "T1548", "T1548.003"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*use_pty' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*use_pty' + + # 5.3.3 Ensure sudo log file exists. (Automated) + - id: 32662 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files. Creation of additional log files can cause disk space exhaustion if not correctly managed. You should configure logrotate to manage the sudo log in accordance with your local policy." + remediation: 'Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile="" Example Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["5.3.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*logfile=' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*logfile=' + + # 5.3.4 Ensure users must provide password for escalation. (Automated) + - id: 32663 + title: "Ensure users must provide password for escalation." + description: "The operating system must be configured so that users must provide a password for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + impact: "This will prevent automated processes from being able to elevate privileges. To include Ansible and AWS builds." + remediation: "Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any line with occurrences of NOPASSWD tags in the file." + compliance: + - cis: ["5.3.4"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*\t*# && r:NOPASSWD' + - 'd:/etc/sudoers.d -> r:\.* -> !r:^\s*\t*# && r:NOPASSWD' + + # 5.3.5 Ensure re-authentication for privilege escalation is not disabled globally. (Automated) + - id: 32664 + title: "Ensure re-authentication for privilege escalation is not disabled globally." + description: "The operating system must be configured so that users must re-authenticate for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + remediation: "Configure the operating system to require users to reauthenticate for privilege escalation. Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any occurrences of !authenticate tags in the file(s)." + compliance: + - cis: ["5.3.5"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*\t*# && r:!authenticate' + - 'd:/etc/sudoers.d -> r:\.* -> !r:^\s*\t*# && r:!authenticate' + + # 5.3.6 Ensure sudo authentication timeout is configured correctly. (Automated) + - id: 32665 + title: "Ensure sudo authentication timeout is configured correctly." + description: "sudo caches used credentials for a default of 5 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized privileged access to another user." + remediation: "If the currently configured timeout is larger than 15 minutes, edit the file listed in the audit section with visudo -f and modify the entry timestamp_timeout= to 15 minutes or less as per your site policy. The value is in minutes. This particular entry may appear on its own, or on the same line as env_reset. See the following two examples: Defaults env_reset, timestamp_timeout=15 Defaults timestamp_timeout=15 Defaults env_reset." + references: + - "https://www.sudo.ws/man/1.9.0/sudoers.man.html" + compliance: + - cis: ["5.3.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'c:sudo -V -> r:Authentication timestamp timeout:\s*\t*15.0 minutes' + - 'f:/etc/sudoers -> n:timestamp_timeout=(\d+) compare < 15 && n:timestamp_timeout=(\d+) compare != -1' + + # 5.3.7 Ensure access to the su command is restricted. (Automated) + - id: 32666 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.3.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1078"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_wheel.so && r:use_uid && r:group=\w+' + + # 5.4.1 Ensure custom authselect profile is used. (Manual) - Not Implemented + + # 5.4.2 Ensure authselect includes with-faillock. (Automated) + - id: 32667 + title: "Ensure authselect includes with-faillock." + description: "The pam_faillock.so module maintains a list of failed authentication attempts per user during a specified interval and locks the account in case there were more than the configured number of consecutive failed authentications (this is defined by the deny parameter in the faillock configuration). It stores the failure records into per-user files in the tally directory." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Run the following commands to include the with-faillock option to the current authselect profile: # authselect enable-feature with-faillock # authselect apply-changes." + compliance: + - cis: ["5.4.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:required && r:pam_faillock.so" + - "f:/etc/pam.d/system-auth -> r:required && r:pam_faillock.so" + + # 5.5.1 Ensure password creation requirements are configured. (Automated) + - id: 32668 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. - minlen=14 - password must be 14 characters or more Either of the following can be used to enforce complex passwords: - minclass=4 - provide at least four classes of characters for the new password OR - dcredit=-1 - provide at least one digit - ucredit=-1 - provide at least one uppercase character - ocredit=-1 - provide at least one special character - lcredit=-1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Run the following script to update the system-auth and password-auth files #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+.*enforce_for_r oot\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 enforce_for_root/' \"$file\" fi if grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=([4- 9]|[1-9][0-9]+)\\b.*$' \"$file\"; then sed -ri '/pwquality/s/retry=\\S+/retry=3/' \"$file\" elif ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 retry=3/' \"$file\" fi done authselect apply-changes." + compliance: + - cis: ["5.5.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.002", "T1110.003", "T1178.001", "T1178.002", "T1178.003", "T1178.004"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - "f:/etc/pam.d/system-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s+\t*=\s+\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> r:^\s*minclass|^\s*\Scredit' + + # 5.5.2 Ensure lockout for failed password attempts is configured. (Automated) + - id: 32669 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. - deny= - Number of attempts before the account is locked - unlock_time= - Time in seconds before the account is unlocked Note: The maximum configurable value for unlock_time is 604800." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + impact: "Use of unlock_time=0 may allow an attacker to cause denial of service to legitimate users." + remediation: "Set password lockouts and unlock times to conform to site policy. deny should be greater than 0 and no greater than 5. unlock_time should be 0 (never), or 900 seconds or greater. Edit /etc/security/faillock.conf and update or add the following lines: deny = 5 unlock_time = 900." + compliance: + - cis: ["5.5.2"] + - cis_csc_v8: ["6.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1"] + - hipaa: ["164.308(a)(3)(ii)(C)"] + - iso_27001-2013: ["A.9.2.6"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - nist_sp_800-53: ["AC-2(1)"] + - pci_dss_v3.2.1: ["8.1.3"] + - pci_dss_v4.0: ["8.2.4", "8.2.5"] + - soc_2: ["CC6.2", "CC6.3"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_faillock.so\s*preauth' + - 'f:/etc/pam.d/password-auth -> !r:^\s*\t*# && r:auth && r:required && r:\s*\t*pam_faillock.so && r:\s*\t*authfail' + - 'f:/etc/pam.d/system-auth -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_faillock.so\s*preauth' + - 'f:/etc/pam.d/system-auth -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_faillock.so' + - 'f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:deny\s*\t*=\s*\t*(\d+) compare <= 5' + - 'f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:fail_interval\s*\t*=\s*\t*(\d+) compare <= 900' + + # 5.5.3 Ensure password reuse is limited. (Automated) + - id: 32670 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. - remember=<5> - Number of old passwords to remember." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note: These change only apply to accounts configured on the local system." + remediation: "Set remembered password history to conform to site policy. Run the following script to add or modify the pam_pwhistory.so and pam_unix.so lines to include the remember option: #!/usr/bin/env bash { file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/system-auth\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so\\s+([^# \\n\\r]+\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file elif grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?.*$' \"$file\"; then sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so/ s/$/ remember=5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/i password required pam_pwhistory.so remember=5 use_authtok' $file fi fi if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so\\s+([^#\\n\\r] +\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/ s/$/ remember=5/' $file fi fi authselect apply-changes }." + compliance: + - cis: ["5.5.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.004"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/system-auth -> !r:^\s*\t*# && r:password\s*\t*requisite|password\s*\t*sufficient && r:pam_pwhistory.so|pam_unix.so && n:remember\s*\t*=\s*\t*(\d+) compare => 5' + + # 5.5.4 Ensure password hashing algorithm is SHA-512 or yescrypt. (Automated) + - id: 32671 + title: "Ensure password hashing algorithm is SHA-512 or yescrypt." + description: "A cryptographic hash function converts an arbitrary-length input into a fixed length output. Password hashing performs a one-way transformation of a password, turning the password into another string, called the hashed password." + rationale: "The SHA-512 algorithm provides stronger hashing than other hashing algorithms used for password hashing with Linux, providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note: These changes only apply to accounts configured on the local system." + remediation: "Set password hashing algorithm to sha512. Edit /etc/libuser.conf and edit of add the following line: crypt_style = sha512 Edit /etc/login.defs and edit or add the following line: ENCRYPT_METHOD SHA512 Run the following script to configure pam_unix.so to use the sha512 hashing algorithm: #!/usr/bin/env bash { for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+sha512\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+(md5|blowfish|bigcrypt|sha256|yescrypt)\\b.*$' \"$file\"; then sed -ri 's/(md5|blowfish|bigcrypt|sha256|yescrypt)/sha512/' \"$file\" else sed -ri 's/(^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix.so\\s+)(.*)$/\\1s ha512 \\3/' \"$file\" fi fi done authselect apply-changes } Note: This only effects local users and passwords created after updating the files to use sha512. If it is determined that the password algorithm being used is not SHA-512, once it is changed, it is recommended that all user ID's be immediately expired and forced to change their passwords on next login." + compliance: + - cis: ["5.5.4"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1041"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1003", "T1003.008", "T1110", "T1110.002"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> r:\s*ENCRYPT_METHOD SHA512' + - 'f:/etc/libuser.conf -> r:\s*crypt_style = sha512' + - 'f:/etc/pam.d/password-auth -> r:\s*password && r:requisite|required|sufficient && r:pam_unix.so && r:sha512' + - 'f:/etc/pam.d/system-auth -> r:\s*password && r:requisite|required|sufficient && r:pam_unix.so && r:sha512' + + # 5.6.1.1 Ensure password expiration is 365 days or less. (Automated) + - id: 32672 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + compliance: + - cis: ["5.6.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.001", "T1110.002", "T1110.003", "T1110.004"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:\d+:(\d+): compare > 365' + + # 5.6.1.2 Ensure minimum days between password changes is configured. (Automated) + - id: 32673 + title: "Ensure minimum days between password changes is configured." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 1 in /etc/login.defs: PASS_MIN_DAYS 1 Modify user parameters for all users with a password set to match: # chage --mindays 1 ." + compliance: + - cis: ["5.6.1.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110.004"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:(\d+): compare < 7' + + # 5.6.1.3 Ensure password expiration warning days is 7 or more. (Automated) + - id: 32674 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs : PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["5.6.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1078"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:\d+:\d+:(\d+): compare < 7' + + # 5.6.1.4 Ensure inactive password lock is 30 days or less. (Automated) + - id: 32675 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["5.6.1.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.002", "T1078.003"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - "not c:useradd -D -> r:^INACTIVE=-1" + - 'not f:/etc/shadow -> n:^\w+:\w+:\w+:\w+:\w+:\w+:(\d+): compare > 30' + - 'not f:/etc/shadow -> r:^\w+:\w+:\w+:\w+:\w+:\w+:-1:' + + # 5.6.1.5 Ensure all users last password change date is in the past. (Automated) - Not Implemented + # 5.6.2 Ensure system accounts are secured. (Automated) - Not Implemented + # 5.6.3 Ensure default user shell timeout is 900 seconds or less. (Automated) - Not Implemented + + # 5.6.4 Ensure default group for the root account is GID 0. (Automated) + - id: 32676 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root account belongs to. This affects permissions of files that are created by the root account." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root account default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.6.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^\s*\t*# && r:root:\w+:\w+:0:' + + # 5.6.5 Ensure default user umask is 027 or more restrictive. (Automated) - Not Implemented + # 5.6.6 Ensure root password is set. (Automated) - Not Implemented + # 6.1.1 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 32677 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd: # chmod u-x,go-wx /etc/passwd # chown root:root /etc/passwd." + compliance: + - cis: ["6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/passwd -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.2 Ensure permissions on /etc/passwd- are configured. (Automated) + - id: 32678 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd-: # chmod u-x,go-wx /etc/passwd- # chown root:root /etc/passwd-." + compliance: + - cis: ["6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/passwd- -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.3 Ensure permissions on /etc/group are configured. (Automated) + - id: 32679 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group: # chmod u-x,go-wx /etc/group # chown root:root /etc/group." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/group -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.4 Ensure permissions on /etc/group- are configured. (Automated) + - id: 32680 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group-: # chmod u-x,go-wx /etc/group- # chown root:root /etc/group-." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/group- -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.5 Ensure permissions on /etc/shadow are configured. (Automated) + - id: 32681 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following commands to set mode, owner, and group on /etc/shadow: # chown root:root /etc/shadow # chmod 0000 /etc/shadow." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/shadow -> r:0 root 0 root && n:shadow (\d+) compare == 0' + + # 6.1.6 Ensure permissions on /etc/shadow- are configured. (Automated) + - id: 32682 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set mode, owner, and group on /etc/shadow-: # chown root:root /etc/shadow- # chmod 0000 /etc/shadow-." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/shadow- -> r:0 root 0 root && n:shadow- (\d+) compare == 0' + + # 6.1.7 Ensure permissions on /etc/gshadow are configured. (Automated) + - id: 32683 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run the following commands to set mode, owner, and group on /etc/gshadow: # chown root:root /etc/gshadow # chmod 0000 /etc/gshadow." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/gshadow -> r:0 root 0 root && n:gshadow (\d+) compare == 0' + + # 6.1.8 Ensure permissions on /etc/gshadow- are configured. (Automated) + - id: 32684 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set mode, owner, and group on /etc/gshadow-: # chown root:root /etc/gshadow- # chmod 0000 /etc/gshadow-." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/gshadow- -> r:0 root 0 root && n:gshadow- (\d+) compare == 0' + + # 6.1.9 Ensure no world writable files exist. (Automated) - Not Implemented + # 6.1.10 Ensure no unowned files or directories exist. (Automated) - Not Implemented + # 6.1.11 Ensure no ungrouped files or directories exist. (Automated) - Not Implemented + # 6.1.12 Ensure sticky bit is set on all world-writable directories. (Automated) - Not Implemented + # 6.1.13 Audit SUID executables. (Manual) - Not Implemented + # 6.1.14 Audit SGID executables. (Manual) - Not Implemented + # 6.1.15 Audit system file permissions. (Manual) - Not Implemented + + # 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords. (Automated) + - id: 32685 + title: "Ensure accounts in /etc/passwd use shadowed passwords." + description: "Local accounts can use shadowed passwords. With shadowed passwords, the passwords are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. Accounts with a shadowed password have an x in the second field in /etc/passwd." + rationale: "The /etc/passwd file also contains information like user ID's and group ID's that are used by many system programs. Therefore, the /etc/passwd file must remain world readable. In spite of encoding the password with a randomly-generated one-way hash function, an attacker could still break the system if they got access to the /etc/passwd file. This can be mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. This helps mitigate the risk of an attacker gaining access to the encoded passwords with which to perform a dictionary attack. Note: - All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user. - A user account with an empty second field in /etc/passwd allows the account to be logged into by providing only the username." + remediation: "Run the following command to set accounts to use shadowed passwords: # sed -e 's/^\\([a-zA-Z0-9_]*\\):[^:]*:/\\1:x:/' -i /etc/passwd Investigate to determine if the account is logged in and what it is being used for, to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1003", "T1003.008"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^\w+:x:' + + # 6.2.2 Ensure /etc/shadow password fields are not empty. (Automated) + - id: 32686 + title: "Ensure /etc/shadow password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + # 6.2.3 Ensure all groups in /etc/passwd exist in /etc/group. (Automated) - Not Implemented + + # 6.2.4 Ensure no duplicate UIDs exist. (Automated) - Not Implemented + # 6.2.5 Ensure no duplicate GIDs exist. (Automated) - Not Implemented + # 6.2.6 Ensure no duplicate user names exist. (Automated) - Not Implemented + # 6.2.7 Ensure no duplicate group names exist. (Automated) - Not Implemented + # 6.2.8 Ensure root PATH Integrity. (Automated) - Not Implemented + + # 6.2.9 Ensure root is the only UID 0 account. (Automated) + - id: 32687 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.9"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1548"] + condition: all + rules: + - 'not f:/etc/passwd -> !r:^\s*\t*# && !r:^root: && r:^\w+:\w+:0:' + + # 6.2.10 Ensure local interactive user home directories exist. (Automated) - Not Implemented + # 6.2.11 Ensure local interactive users own their home directories. (Automated) - Not Implemented + # 6.2.12 Ensure local interactive user home directories are mode 750 or more restrictive. (Automated) - Not Implemented + # 6.2.13 Ensure no local interactive user has .netrc files. (Automated) - Not Implemented + # 6.2.14 Ensure no local interactive user has .forward files. (Automated) - Not Implemented + # 6.2.15 Ensure no local interactive user has .rhosts files. (Automated) - Not Implemented + # 6.2.16 Ensure local interactive user dot files are not group or world writable. (Automated) - Not Implemented diff --git a/etc/ruleset/sca/amazon/cis_amazon_linux_1.yml b/etc/ruleset/sca/amazon/cis_amazon_linux_1.yml new file mode 100644 index 0000000000..ebfd8d4cf3 --- /dev/null +++ b/etc/ruleset/sca/amazon/cis_amazon_linux_1.yml @@ -0,0 +1,3200 @@ +# Security Configuration Assessment +# CIS Checks for Amazon Linux 1 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for Amazon Linux v2.1.0 - 08-19-2020 + +policy: + id: "cis_amazon_linux_1" + file: "cis_amazon_linux_1.yml" + name: "CIS Amazon Linux Benchmark v2.1.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Amazon Linux systems." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Amazon Linux version." + description: "Requirements for running the policy against Amazon Linux 1." + condition: any + rules: + - "f:/etc/system-release -> r:^Amazon Linux AMI release" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # 1.1.1.1 cramfs: filesystem + - id: 20000 + title: "Ensure mounting of cramfs filesystems is disabled." + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install cramfs /bin/true. Run the following command to unload the cramfs module: rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:install /bin/true|Module cramfs not found" + - "not c:lsmod -> r:cramfs" + + # 1.1.1.2 freevxfs: filesystem + - id: 20001 + title: "Ensure mounting of freevxfs filesystems is disabled." + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install freevxfs /bin/true. Run the following command to unload the freevxfs module: rmmod freevxfs" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v freevxfs -> r:install /bin/true|Module freevxfs not found" + - "not c:lsmod -> r:freevxfs" + + # 1.1.1.3 jffs2: filesystem + - id: 20002 + title: "Ensure mounting of jffs2 filesystems is disabled." + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install jffs2 /bin/true. Run the following command to unload the jffs2 module: rmmod jffs2" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v jffs2 -> r:install /bin/true|Module jffs2 not found" + - "not c:lsmod -> r:jffs2" + + # 1.1.1.4 hfs: filesystem + - id: 20003 + title: "Ensure mounting of hfs filesystems is disabled." + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfs /bin/true. Run the following command to unload the hfs module: rmmod hfs" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v hfs -> r:install /bin/true|Module hfs not found" + - "not c:lsmod -> r:hfs" + + # 1.1.1.5 hfsplus: filesystem + - id: 20004 + title: "Ensure mounting of hfsplus filesystems is disabled." + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfsplus /bin/true. Run the following command to unload the hfsplus module: rmmod hfsplus" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v hfsplus -> r:install /bin/true|Module hfsplus not found" + - "not c:lsmod -> r:hfsplus" + + # 1.1.1.6 squashfs: filesystem + - id: 20005 + title: "Ensure mounting of squashfs filesystems is disabled." + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install squashfs /bin/true. Run the following command to unload the squashfs module: rmmod squashfs" + compliance: + - cis: ["1.1.1.6"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + + # 1.1.1.7 udfs: filesystem + - id: 20006 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install udf /bin/true. Run the following command to unload the udf module: rmmod udf" + compliance: + - cis: ["1.1.1.7"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v udf -> r:install /bin/true|Module udf not found" + - "not c:lsmod -> r:udf" + + # 1.1.1.8 FAT: filesystem + - id: 20007 + title: "Ensure mounting of FAT filesystems is disabled." + description: "The FAT filesystem format is primarily used on older windows systems and portable USB drives or flash modules. It comes in three types FAT12 , FAT16 , and FAT32 all of which are supported by the vfat kernel module." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install vfat /bin/true. Run the following command to unload the vfat module: rmmod vfat" + compliance: + - cis: ["1.1.1.8"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v vfat -> r:install /bin/true|Module vfat not found" + - "not c:lsmod -> r:vfat" + + # 1.1.2 /tmp: partition + - id: 20008 + title: "Ensure separate partition exists for /tmp." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + # 1.1.3 /tmp: nodev + - id: 20009 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstabfile and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp:# mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + # 1.1.4 /tmp: nosuid + - id: 20010 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp: # mount -o remount,nosuid /tmp" + compliance: + - cis: ["1.1.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + # 1.1.5 /tmp: noexec + - id: 20011 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp: # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + # 1.1.6 Build considerations - Partition scheme. + - id: 20012 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + # 1.1.7 bind mount /var/tmp to /tmp + - id: 20013 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + # 1.1.8 nodev set on /var/tmp + - id: 20014 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp ." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + + # 1.1.9 nosuid set on /var/tmp + - id: 20015 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + # 1.1.10 noexec set on /var/tmp + - id: 20016 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.10"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + # 1.1.11 /var/log: partition + - id: 20017 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data ." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4", "10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + # 1.1.12 /var/log/audit: partition + - id: 20018 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4", "10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + # 1.1.13 /home: partition + - id: 20019 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + # 1.1.14 /home: nodev + - id: 20020 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + # 1.1.15 /dev/shm: nodev + - id: 20021 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + # 1.1.16 /dev/shm: nosuid + - id: 20022 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + # 1.1.17 /dev/shm: noexec + - id: 20023 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.17"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + # 1.1.19 Disable Automounting + - id: 20024 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run the following command to disable autofs: # chkconfig autofs off" + compliance: + - cis: ["1.1.19"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list autofs -> r:^\s*\t*autofs\.*on' + + ############################################### + # 1.2 Configure Software Updates + ############################################### + + # 1.2.3 Activate gpgcheck + - id: 20025 + title: "Ensure gpgcheck is globally activated." + description: "The gpgcheck option, found in the main section of the /etc/yum.conf and individual /etc/yum/repos.d/* files determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/yum.conf and set ' gpgcheck=1 ' in the [main] section. Edit any failing files in /etc/yum.repos.d/* and set all instances of gpgcheck to ' 1 '." + compliance: + - cis: ["1.2.3"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + condition: all + rules: + - "f:/etc/yum.conf -> r:^gpgcheck=1" + - "not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck=0" + + ############################################### + # 1.3 Filesystem Integrity Checking + ############################################### + + # 1.3.1 install AIDE + - id: 20026 + title: "Ensure AIDE is installed." + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install aide: yum install aide // Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: aide --init && mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: all + rules: + - 'c:rpm -q aide -> r:aide-\S*' + + # 1.3.2 AIDE regular checks + - id: 20027 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Run the following command: crontab -u root -e // Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check // Notes: The checking in this recommendation occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy. " + compliance: + - cis: ["1.3.2"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "c:crontab -u root -l -> r:aide" + - "c:grep -r aide /etc/cron.* /etc/crontab -> r:aide" + + ############################################### + # 1.4 Secure Boot Settings + ############################################### + # 1.4.1 Configure bootloader + - id: 20028 + title: "Ensure permissions on bootloader config are configured." + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually located at /boot/grub/menu.lst and linked as /boot/grub/grub.conf and /etc/grub.conf ." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub/menu.lst # chmod og-rwx /boot/grub/menu.lst" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub/menu.lst -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.4.2 Single user authentication + - id: 20029 + title: "Ensure authentication required for single user mode." + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Edit /etc/sysconfig/init and set SINGLE to ' /sbin/sulogin': SINGLE=/sbin/sulogin" + compliance: + - cis: ["1.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/sysconfig/init -> r:SINGLE\s*=\s*/sbin/sulogin' + + # 1.4.3 Ensure interactive boot is not enabled (Scored) + - id: 20030 + title: "Ensure interactive boot is not enabled." + description: "Interactive boot allows console users to interactively select which services start on boot. The PROMPT option provides console users the ability to interactively boot the system and select which services to start on boot . " + rationale: "Turn off the PROMPT option on the console to prevent console users from potentially overriding established security settings. " + remediation: "Edit the /etc/sysconfig/init file and set PROMPT to ' no ': PROMPT=no" + compliance: + - cis: ["1.4.3"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'f:/etc/sysconfig/init -> r:PROMPT\s*=\s*no' + + ############################################### + # 1.5 Additional Process Hardening + ############################################### + # 1.5.1 Restrict Core Dumps (Scored) + - id: 20031 + title: "Ensure core dumps are restricted." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 and Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:^fs.suid_dumpable\s*=\s*0\s*$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + + # 1.5.2 XD/NX enabled + - id: 20032 + title: "Ensure XD/NX support is enabled." + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.5.2"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:dmesg -> r:NX \(Execute Disable\) protection: active' + + # 1.5.3 Enable Randomized Virtual Memory Region Placement (Scored) + - id: 20033 + title: "Ensure address space layout randomization (ASLR) is enabled." + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2. Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + + # 1.5.4 Disable prelink + - id: 20034 + title: "Ensure prelink is disabled." + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal and uninstall prelink: prelink -ua && yum remove prelink" + compliance: + - cis: ["1.5.4"] + - cis_csc: ["3.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q prelink -> package prelink is not installed" + + ############################################### + # 1.6 Configure SELinux + ############################################### + + # 1.6.1.1 SELinux not disabled + - id: 20035 + title: "Ensure SELinux is not disabled in bootloader configuration." + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /boot/grub/menu.lst and remove all instances of selinux=0 and enforcing=0 on all kernel lines" + compliance: + - cis: ["1.6.1.1"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/menu.lst -> r:^\s*\t*kernel\.*selinux=0|^\s*\t*kernel\.*enforcing=0' + + # 1.6.1.2 Set selinux state + - id: 20036 + title: "Ensure the SELinux state is enforcing." + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing" + compliance: + - cis: ["1.6.1.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s+enabled' + - 'c:sestatus -> r:^Current mode:\s+enforcing' + - 'c:sestatus -> r:^Mode from config file:\s+enforcing' + - 'f:/etc/selinux/config -> r:^SELINUX\s*=\s*enforcing' + + # 1.6.1.3 Set selinux policy + - id: 20037 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + compliance: + - cis: ["1.6.1.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Policy from config file:\s+targeted|^Policy from config file:\s+mls' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Remove SETroubleshoot + - id: 20038 + title: "Ensure SETroubleshoot is not installed." + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # yum remove setroubleshoot" + compliance: + - cis: ["1.6.1.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:rpm -qa setroubleshoot -> r:setroubleshoot" + + # 1.6.1.5 Disable MCS Translation service mcstrans + - id: 20039 + title: "Ensure the MCS Translation Service (mcstrans) is not installed." + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # yum remove mcstrans" + compliance: + - cis: ["1.6.1.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:rpm -qa mcstrans -> r:mcstrans" + + # 1.6.1.6 Ensure no unconfined daemons exist + - id: 20040 + title: "Ensure no unconfined daemons exist." + description: "Daemons that are not defined in SELinux policy will inherit the security context of their parent process." + rationale: "Since daemons are launched and descend from the init process, they will inherit the security context label initrc_t . This could cause the unintended consequence of giving the process more permission than it requires." + remediation: "Investigate any unconfined daemons found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:ps -eZ -> r:initrc && !r:tr|ps|egrep|bash|awk" + + # 1.6.2 Install SELinux + - id: 20041 + title: "Ensure SELinux is installed." + description: "SELinux provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install libselinux: yum install libselinux" + compliance: + - cis: ["1.6.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q libselinux -> r:libselinux-\S+' + + ############################################### + # 1.7 Warning Banners + ############################################### + # 1.7.1.1 Configure message of the day (Scored) + - id: 20042 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v." + compliance: + - cis: ["1.7.1.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + + # 1.7.1.2 Configure local login warning banner (Not Scored) + - id: 20043 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.7.1.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + + # 1.7.1.3 Configure remote login warning banner (Not Scored) + - id: 20044 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.7.1.3"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + + # 1.7.1.4 Configure /etc/motd permissions (Not Scored) + - id: 20045 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.1.5 Configure /etc/issue permissions (Scored) + - id: 20046 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.1.6 Configure /etc/issue.net permissions (Not Scored) + - id: 20047 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.8 Ensure updates, patches, and additional security software are installed (Not Scored) + - id: 20048 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Site policy may mandate a testing period before install onto production systems for available updates. The audit and remediation here only cover security updates. Non-security updates can be audited with and comparing against site policy: # yum check-update" + compliance: + - cis: ["1.8"] + - cis_csc: ["4.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6", "SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: all + rules: + - "c:yum check-update --security -> r:No packages needed for security" + + ############################################### + # 2 OS Services + ############################################### + ############################################### + # 2.1 inetd Services + ############################################### + # 2.1.1 Disable chargen services (Scored) + + - id: 20049 + title: "Ensure chargen services are not enabled." + description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable chargen-dgram and chargen-stream: # chkconfig chargen-dgram off; # chkconfig chargen-stream off" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list chargen-dgram -> r:^\s*\t*chargen-dgram:\s*\t*on' + - 'c:chkconfig --list chargen-stream -> r:^\s*\t*chargen-stream:\s*\t*on' + + # 2.1.2 Disable daytime services (Scored) + - id: 20050 + title: "Ensure daytime services are not enabled." + description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable daytime-dgram and daytime-stream: # chkconfig daytime-dgram off; # chkconfig daytime-stream off" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list daytime-dgram -> r:^\s*\t*daytime-dgram:\s*\t*on' + - 'c:chkconfig --list daytime-stream -> r:^\s*\t*daytime-stream:\s*\t*on' + + # 2.1.3 Disable discard services (Scored) + - id: 20051 + title: "Ensure discard services are not enabled." + description: "discardis a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable discard-dgram and discard-stream: # chkconfig discard-dgram off; # chkconfig discard-stream off" + compliance: + - cis: ["2.1.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list discard-dgram -> r:^\s*\t*discard-dgram:\s*\t*on' + - 'c:chkconfig --list discard-stream -> r:^\s*\t*discard-stream:\s*\t*on' + + # 2.1.4 Disable echo-dgram (Scored) + - id: 20052 + title: "Ensure echo services are not enabled." + description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable echo-dgram and echo-stream: # chkconfig echo-dgram off; # chkconfig echo-stream off" + compliance: + - cis: ["2.1.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list echo-dgram -> r:^\s*\t*echo-dgram:\s*\t*on' + - 'c:chkconfig --list echo-stream -> r:^\s*\t*echo-stream:\s*\t*on' + + # 2.1.5 Disable time-stream (Scored) + - id: 20053 + title: "Ensure time services are not enabled." + description: "time is a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable time-dgram and time-stream: # chkconfig time-dgram off; # chkconfig time-stream off" + compliance: + - cis: ["2.1.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list time-dgram -> r:^\s*\t*time-dgram:\s*\t*on' + - 'c:chkconfig --list time-stream -> r:^\s*\t*time-stream:\s*\t*on' + + # 2.1.6 Remove rsh-server (Scored) + - id: 20054 + title: "Ensure rsh server is not enabled." + description: "The Berkeley rsh-server ( rsh , rlogin , rexec ) package contains legacy services that exchange credentials in clear-text." + rationale: "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." + remediation: "Run the following commands to disable rsh, rlogin, and rexec: # chkconfig rsh off # chkconfig rlogin off # chkconfig rexec off" + compliance: + - cis: ["2.1.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list rexec -> r:^\s*\t*rexec:\s*\t*on' + - 'c:chkconfig --list rlogin -> r:^\s*\t*rlogin:\s*\t*on' + - 'c:chkconfig --list rsh -> r:^\s*\t*rsh:\s*\t*on' + + # 2.1.7 Remove talk server (Scored) + - id: 20055 + title: "Ensure talk server is not enabled." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable talk: # chkconfig talk off" + compliance: + - cis: ["2.1.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list talk -> r:^\s*\t*talk:\s*\t*on' + + # 2.1.8 Remove telnet-server (Scored) + - id: 20056 + title: "Ensure telnet server is not enabled." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to disable telnet: # chkconfig telnet off" + compliance: + - cis: ["2.1.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list telnet -> r:^\s*\t*telnet:\s*\t*on' + + # 2.1.9 Ensure tftp server is not enabled (Scored) + - id: 20057 + title: "Ensure tftp server is not enabled." + description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package tftp-server is used to define and support a TFTP server." + rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." + remediation: "Run the following command to disable tftp: # chkconfig tftp off" + compliance: + - cis: ["2.1.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list tftp -> r:^\s*\t*tftp:\s*\t*on' + + # 2.1.10 Remove rsync service (Scored) + - id: 20058 + title: "Ensure rsync service is not enabled." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # chkconfig rsyncd off" + compliance: + - cis: ["2.1.10"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list rsync -> r:^\s*\t*rsync:\s*\t*on' + + # 2.1.11 Remove xinetd (Scored) + - id: 20059 + title: "Ensure xinetd is not enabled." + description: "The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." + remediation: "Run the following command to disable xinetd: # chkconfig xinetd off" + compliance: + - cis: ["2.1.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list xinetd -> r:^\s*\t*xinetd\.*on' + + ############################################## + # 2.2 Remove Legacy Services + ############################################### + + # 2.2.1.1 Ensure time synchronization is in use (Not Scored) + - id: 20060 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems or virtual systems where host based time synchronization is not available run the following commands and verify either ntp or chrony is installed: # rpm -q ntp # rpm -q chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and verify that host based synchronization is in use." + compliance: + - cis: ["2.2.2.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "not c:rpm -q ntp -> r:^package ntp is not installed" + - "not c:rpm -q chrony -> r:^package chrony is not installed" + + # 2.2.1.2 Configure Network Time Protocol (NTP) (Scored) + - id: 20061 + title: "Ensure ntp is configured." + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "1) Add or edit restrict lines in /etc/ntp.conf to match the following: - restrict -4 default kod nomodify notrap nopeer noquery and - restrict -4 default kod nomodify notrap nopeer noquery. 2) Add or edit server or pool lines to /etc/ntp.conf as appropriate: server . 3) Add or edit the daemonline in/etc/init.d/ntpd to include ' -u ntp:ntp ': daemon $prog -u ntp:ntp -p /var/run/ntpd.pid $OPTIONS" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/init.d/ntpd -> r:daemon\s*=\s* && r:-u ntp:ntp' + + # 2.2.1.3 Configure Network Time Protocol (Chrony) (Scored) + - id: 20062 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "1) Add or edit restrict lines in /etc/chrony.conf to match the following: - 1) Add or edit server or pool lines to /etc/chrony.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/chronyd to include: - OPTIONS='-u chronyd'" + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/sysconfig/chronyd -> r:^OPTIONS\s*=\s* && r:-u chrony' + + # 2.2.2 Remove X Windows (Scored) + - id: 20063 + title: "Ensure X Window System is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: # yum remove xorg-x11*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:rpm -qa xorg-x11* -> r:^xorg-x11" + + # 2.2.3 Disable Avahi Server (Scored) + - id: 20064 + title: "Ensure Avahi Server is not enabled." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface." + remediation: "Run the following command to disable avahi-daemon: # chkconfig avahi-daemon off" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list avahi-daemon -> r:^\s*\t*avahi-daemon\.*on' + + # 2.2.4 Ensure CUPS is not enabled (Scored) + - id: 20065 + title: "Ensure CUPS is not enabled." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups : # chkconfig cups off" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list cups -> r:^\s*\t*cups\.*on' + + # 2.2.5 Remove DHCP Server (Scored) + - id: 20066 + title: "Ensure DHCP Server is not enabled." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dhcpd: # chkconfig dhcpd off" + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on DHCP is available at https://www.isc.org/software/dhcp + condition: none + rules: + - 'c:chkconfig --list dhcpd -> r:^\s*\t*dhcpd\.*on' + + # 2.2.6 Remove LDAP Server (Scored) + - id: 20067 + title: "Ensure LDAP Server is not enabled." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # chkconfig slapd off" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on OpenLDAP is available at https://www.openldap.org + condition: none + rules: + - 'c:chkconfig --list slapd -> r:^\s*\t*slapd\.*on' + + # 2.2.7 Disable NFS and RPC (Scored) + - id: 20068 + title: "Ensure NFS and RPC are not enabled." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs, nfs-server and rpcbind: # chkconfig nfs off; # chkconfig rpcbind off" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list nfs -> r:^\s*\t*nfs\.*on' + - 'c:chkconfig --list rpcbind -> r:^\s*\t*rpcbind\.*on' + + # 2.2.8 Ensure DNS Server is not enabled (Scored) + - id: 20069 + title: "Ensure DNS Server is not enabled." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable named : # chkconfig named off" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list named -> r:^\s*\t*named\.*on' + + # 2.2.9 Remove FTP Server (Scored) + - id: 20070 + title: "Ensure FTP Server is not enabled." + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # chkconfig vsftpd off" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list vsftpd -> r:^\s*\t*vsftpd\.*on' + + # 2.2.10 Remove HTTP Server (Scored) + - id: 20071 + title: "Ensure HTTP server is not enabled." + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable httpd: # chkconfig httpd off" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list httpd -> r:^\s*\t*httpd\.*on' + + # 2.2.11 Remove Dovecot (IMAP and POP3 services) (Scored) + - id: 20072 + title: "Ensure IMAP and POP3 server is not enabled." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dovecot: # chkconfig dovecot off" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list dovecot -> r:^\s*\t*dovecot\.*on' + + # 2.2.12 Remove Samba (Scored) + - id: 20073 + title: "Ensure Samba is not enabled." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable smb: # chkconfig smb off" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list smb -> r:^\s*\t*smb\.*on' + + # 2.2.13 Remove HTTP Proxy Server (Scored) + - id: 20074 + title: "Ensure HTTP Proxy Server is not enabled." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # chkconfig squid off" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list squid -> r:^\s*\t*squid\.*on' + + # 2.2.14 Remove SNMP Server (Not Scored) + - id: 20075 + title: "Ensure SNMP Server is not enabled." + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # chkconfig snmpd off" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list snmpd -> r:^\s*\t*snmpd\.*on' + + # 2.2.15 Ensure mail transfer agent is configured for local-only mode (Scored) + - id: 20076 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Restart postfix: # service postfix restart" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - tsc: ["CC5.2", "CC6.4", "CC6.6", "CC6.7"] + condition: none + rules: + - 'c:netstat -an -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.+LISTEN' + + # 2.2.16 Remove NIS Server (Scored) + - id: 20077 + title: "Ensure NIS Server is not enabled." + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable ypserv: # chkconfig ypserv off" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list ypserv -> r:^\s*\t*ypserv\.*on' + + ############################################### + # 2.3 Service Clients + ############################################### + # 2.3.1 Remove NIS Client (Scored) + - id: 20078 + title: "Ensure NIS Client is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Run the following command to uninstall ypbind: # yum remove ypbind" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q ypbind -> package ypbind is not installed" + + # 2.3.2 Ensure rsh client is not installed (Scored) + - id: 20079 + title: "Ensure rsh client is not installed." + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin ." + remediation: "Run the following command to uninstall rsh : # yum remove rsh" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q rsh -> package rsh is not installed" + + # 2.3.3 Ensure talk client is not installed (Scored) + - id: 20080 + title: "Ensure talk client is not installed." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk : # yum remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q talk -> package talk is not installed" + + # 2.3.4 Ensure telnet client is not installed (Scored) + - id: 20081 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet : # yum remove telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q telnet -> package telnet is not installed" + + # 2.3.5 Ensure LDAP client is not installed (Scored) + - id: 20082 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients : # yum remove openldap-clients" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q openldap-clients -> package openldap-clients is not installed" + + ############################################### + # 3 Network Configuration and Firewalls + ############################################### + ############################################### + # 3.1 Modify Network Parameters (Host Only) + ############################################### + # 3.1.1 Disable IP Forwarding (Scored) + - id: 20083 + title: "Ensure IP forwarding is disabled." + description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." + rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + + # 3.1.2 Disable Send Packet Redirects (Scored) + - id: 20084 + title: "Ensure packet redirect sending is disabled." + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0; net.ipv4.conf.default.send_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0; # sysctl -w net.ipv4.conf.default.send_redirects=0; # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + ############################################### + # 3.2 Modify Network Parameters (Host and Router) + ############################################### + # 3.2.1 Disable Source Routed Packet Acceptance (Scored) + - id: 20085 + title: "Ensure source routed packets are not accepted." + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0; net.ipv4.conf.default.accept_source_route = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + + # 3.2.2 Disable ICMP Redirect Acceptance (Scored) + - id: 20086 + title: "Ensure ICMP redirects are not accepted." + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0; net.ipv4.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + + # 3.2.3 Disable Secure ICMP Redirect Acceptance (Scored) + - id: 20087 + title: "Ensure secure ICMP redirects are not accepted." + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0; net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + # 3.2.4 Log Suspicious Packets (Scored) + - id: 20088 + title: "Ensure suspicious packets are logged." + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1; net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + # 3.2.5 Enable Ignore Broadcast Requests (Scored) + - id: 20089 + title: "Ensure broadcast ICMP requests are ignored." + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + # 3.2.6 Enable Bad Error Message Protection (Scored) + - id: 20090 + title: "Ensure bogus ICMP responses are ignored." + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + # 3.2.7 Enable RFC-recommended Source Route Validation (Scored) + - id: 20091 + title: "Ensure Reverse Path Filtering is enabled." + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1; net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + # 3.2.8 Enable TCP SYN Cookies (Scored) + - id: 20092 + title: "Ensure TCP SYN Cookies is enabled." + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + ############################################### + # 3.3 IPv6 + ############################################### + # 3.3.1 Ensure IPv6 router advertisements are not accepted (Not Scored) + - id: 20093 + title: "Ensure IPv6 router advertisements are not accepted." + description: "This setting disables the system's ability to accept IPv6 router advertisements." + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 and net.ipv6.conf.default.accept_ra = 0 Then, run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0' + + # 3.3.2 Ensure IPv6 redirects are not accepted (Not Scored) + - id: 20094 + title: "Ensure IPv6 redirects are not accepted." + description: "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic." + rationale: "It is recommended that systems not accept ICMP redirects as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 || net.ipv6.conf.default.accept_redirects = 0 Then, run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirect /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirect /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0' + + # 3.3.3 Ensure IPv6 is disabled (Not Scored) + - id: 20095 + title: "Ensure IPv6 is disabled." + description: "Although IPv6 has many advantages over IPv4, few organizations have implemented IPv6." + rationale: "If IPv6 is not to be used, it is recommended that it be disabled to reduce the attack surface of the system." + remediation: "Edit /boot/grub/grub.conf to include ipv6.disable=1 on all kernel lines." + compliance: + - cis: ["3.3.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.conf -> r:^\s*\t*kernel && !r:ipv6.disable=1' + + ############################################### + # 3.4 TCP Wrappers + ############################################### + # 3.4.1 Ensure TCP Wrappers is installed (Scored) + - id: 20096 + title: "Ensure TCP Wrappers is installed." + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Run the following command to install tcp_wrappers: yum install tcp_wrappers" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "c:rpm -q tcp_wrappers -> r:^tcp_wrappers-" + - "c:rpm -q tcp_wrappers-libs -> r:^tcp_wrappers-libs-" + + # 3.4.3 Ensure /etc/hosts.deny is configured (Scored) + - id: 20097 + title: "Ensure /etc/hosts.deny is configured." + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." + remediation: "Run the following command to create /etc/hosts.deny: echo 'ALL: ALL' >> /etc/hosts.deny" + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'f:/etc/hosts.deny -> r:^ALL\s*:\s*ALL' + + # 3.4.4 Ensure permissions on /etc/hosts.allow are configured (Scored) + - id: 20098 + title: "Ensure permissions on /etc/hosts.allow are configured.." + description: "The /etc/hosts.allow file contains networking information that is used by many applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.allow : chown root:root /etc/hosts.allow and chmod 644 /etc/hosts.allow" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'c:stat /etc/hosts.allow -> r:^Access: \(0644/-rw-r--r--\) Uid: \( 0/ root\) Gid: \( 0/ root\)' + + # 3.4.5 Ensure permissions on /etc/hosts.deny are configured (Scored) + - id: 20099 + title: "Ensure permissions on /etc/hosts.deny are configured.." + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.deny : chown root:root /etc/hosts.deny and chmod 644 /etc/hosts.deny" + compliance: + - cis: ["3.4.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/hosts.deny -> r:^Access: \(0644/-rw-r--r--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + ############################################### + # 3.5 Uncommon Network Protocols + ############################################### + # 3.5.1 Ensure DCCP is disabled (Not Scored) + - id: 20100 + title: "Ensure DCCP is disabled." + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.5.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v dccp -> r:install /bin/true" + - "not c:lsmod -> r:dccp" + + # 3.5.2 Ensure SCTP is disabled (Not Scored) + - id: 20101 + title: "Ensure SCTP is disabled." + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.5.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v sctp -> r:install /bin/true" + - "not c:lsmod -> r:sctp" + + # 3.5.3 Ensure RDS is disabled (Not Scored) + - id: 20102 + title: "Ensure RDS is disabled." + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.5.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v rds -> r:install /bin/true" + - "not c:lsmod -> r:rds" + + # 3.5.4 Ensure TIPC is disabled (Not Scored) + - id: 20103 + title: "Ensure TIPC is disabled." + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.5.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v tipc -> r:install /bin/true" + - "not c:lsmod -> r:tipc" + + ############################################### + # 3.6 Firewall Configuration + ############################################### + # 3.6.1 Ensure iptables is installed (Scored) + - id: 20104 + title: "Ensure iptables is installed." + description: "iptables allows configuration of the IPv4 tables in the linux kernel and the rules stored within them. Most firewall configuration utilities operate as a front end to iptables ." + rationale: "iptables is required for firewall management and configuration." + remediation: "Run the following command to install iptables : yum install iptables" + compliance: + - cis: ["3.6.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.1"] + condition: all + rules: + - "c:rpm -q iptables -> r:iptables-" + + # 3.6.2 Ensure default deny firewall policy (Scored) + - id: 20105 + title: "Ensure default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: iptables -P INPUT DROP; iptables -P OUTPUT DROP and iptables -P FORWARD DROP" + compliance: + - cis: ["3.6.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)' + + # 3.6.3 Ensure loopback traffic is configured (Scored) + - id: 20106 + title: "Ensure loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.6.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + ############################################### + # 4 Logging and Auditing + ############################################### + + ############################################### + # 4 Logging and Auditing + ############################################### + ############################################### + # 4.1 Configure System Accounting (auditd) + ############################################### + + # 4.1.1.1 Ensure audit log storage size is configured (Not Scored) + - id: 20107 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = " + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file\s*=\s*\d+' + + # 4.1.1.2 Ensure system is disabled when audit logs are full (Scored) + - id: 20108 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^admin_space_left_action\s*=\s*halt' + + # 4.1.1.3 Ensure audit logs are not automatically deleted (Scored) + - id: 20109 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file_action\s*=\s*keep_logs' + + # 4.1.2 Ensure auditd service is enabled (Scored) + - id: 20110 + title: "Ensure auditd service is enabled." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd : # chkconfig auditd on" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1", "10.7"] + - tsc: ["CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:chkconfig --list auditd -> r:2:on && r:3:on && r:4:on && r:5:on" + + # 4.1.3 Ensure auditing for processes that start prior to auditd is enabled (Scored) + - id: 20111 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: "Edit /boot/grub/menu.lst to include audit=1 on all kernel lines. Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + compliance: + - cis: ["4.1.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.2.6", "10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/boot/grub/menu.lst -> r:^\s*\t*kernel && !r:audit=1' + + # 4.1.4 Ensure events that modify date and time information are collected (Scored) + - id: 20112 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier "time-change".' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -Farch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["3.6"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:-w /etc/localtime && r:-p wa && r:-k time-change" + + # 4.1.5 Ensure events that modify user/group information are collected (Scored) + - id: 20113 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity" + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /etc/group && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:-w /etc/passwd && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:-w /etc/gshadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:-w /etc/shadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:-w /etc/security/opasswd && r:-p wa && r:-k identity" + + # 4.1.6 Ensure events that modify the system's network environment are collected (Scored) + - id: 20114 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre-login), /etc/hosts (file containing host names and associated IP addresses), /etc/sysconfig/network file and /etc/sysconfig/network-scripts/ directory (containing network interface scripts and configurations)." + rationale: 'Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network and /etc/sysconfig/network-scripts/ is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier "system-locale."' + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale" + compliance: + - cis: ["4.1.6"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/issue && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/issue.net && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/hosts && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/sysconfig/network && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/sysconfig/network-scripts/ && r:-p wa && r:-k system-locale" + + # 4.1.7 Ensure events that modify the system's Mandatory Access Controls are collected (Scored) + - id: 20115 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux or directory." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy -w /usr/share/selinux/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /etc/selinux/ && r:-p wa && r:-k MAC-policy" + - "f:/etc/audit/audit.rules -> r:-w /usr/share/selinux/ && r:-p wa && r:-k MAC-policy" + + # 4.1.8 Ensure login and logout events are collected (Scored) + - id: 20116 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The /var/run/failock directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/lastlog -p wa -k logins -w /var/run/faillock/ -p wa -k logins" + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5", "16.10", "16.4"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /var/log/lastlog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:-w /var/run/faillock/ && r:-p wa && r:-k logins" + + # 4.1.9 Ensure session initiation information is collected (Scored) + - id: 20117 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier "session." The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier "logins.".' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k logins -w /var/log/btmp -p wa -k logins" + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5", "16.10", "16.4"] + - pci_dss: ["10.3"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /var/run/utmp && r:-p wa && r:-k session" + - "f:/etc/audit/audit.rules -> r:-w /var/log/wtmp && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:-w /var/log/btmp && r:-p wa && r:-k logins" + + # 4.1.10 Ensure discretionary access control permission modification events are collected (Scored) + - id: 20118 + title: "Ensure discretionary access control permission modification events are collected." + description: 'Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 500) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier "perm_mod."' + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=500 -F auid!=4294967295 -k perm_mod For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lrem" + compliance: + - cis: ["4.1.10"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod" + + # 4.1.11 Ensure unsuccessful unauthorized file access attempts are collected (Scored) + - id: 20119 + title: "Ensure unsuccessful unauthorized file access attempts are collected." + description: 'Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 500), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier "access."' + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access" + compliance: + - cis: ["4.1.11"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EACCES && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k access" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EPERM && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k access" + + # 4.1.13 Ensure successful file system mounts are collected (Scored) + - id: 20120 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S mount -F auid>=500 -F auid!=4294967295 -k mounts For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=500 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=500 -F auid!=4294967295 -k mounts" + compliance: + - cis: ["4.1.13"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k mounts" + + # 4.1.14 Ensure file deletion events by users are collected (Scored) + - id: 20121 + title: "Ensure file deletion events by users are collected." + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete" + compliance: + - cis: ["4.1.14"] + - pci_dss: ["10.5.5"] + - tsc: ["PI1.4", "PI1.5", "CC7.1", "CC7.2", "CC7.3", "CC8.1"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k delete" + + # 4.1.15 Ensure changes to system administration scope (sudoers) is collected (Scored) + - id: 20122 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier "scope."' + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d/ -p wa -k scope" + compliance: + - cis: ["4.1.15"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /etc/sudoers && r:-p wa && r:-k scope" + - "f:/etc/audit/audit.rules -> r:-w /etc/sudoers.d/ && r:-p wa && r:-k scope" + + # 4.1.16 Ensure system administrator actions (sudolog) are collected (Scored) + - id: 20123 + title: "Ensure system administrator actions (sudolog) are collected." + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions" + compliance: + - cis: ["4.1.16"] + - cis_csc: ["5.1", "5.5"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14", "AC.6", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /var/log/sudo.log && r:-p wa && r:-k actions" + + # 4.1.17 Ensure kernel module loading and unloading is collected (Scored) + - id: 20124 + title: "Ensure kernel module loading and unloading is collected." + description: 'Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of "modules".' + rationale: "Monitoring the use of insmod , rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions" + compliance: + - cis: ["4.1.17"] + - cis_csc: ["3"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /sbin/insmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:-w /sbin/rmmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:-w /sbin/modprobe && r:-p x && r:-k modules" + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b\d\d && r:-S init_module && r:-S delete_module && r:-k modules' + + # 4.1.18 Ensure the audit configuration is immutable (Scored) + - id: 20125 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl . Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following line to the end of the /etc/audit/audit.rules file. -e 2" + compliance: + - cis: ["4.1.18"] + - cis_csc: ["3", "6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:tail -1 /etc/audit/audit.rules -> r:^-e 2" + + ############################################### + # 4.2 Configure Logging + ############################################### + + # 4.2.1.1 Ensure rsyslog Service is enabled (Scored) + - id: 20126 + title: "Ensure rsyslog Service is enabled." + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system may default to the syslogd service or lackblogging instead." + remediation: "Run the following command to enable rsyslog : # chkconfig rsyslog on" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:chkconfig --list rsyslog -> r:2:on && r:3:on && r:4:on && r:5:on" + + # 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 20127 + title: "Ensure rsyslog default file permissions configured." + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\. -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + # 4.2.1.4 Ensure rsyslog is configured to send logs to a remote log host (Scored) + - id: 20128 + title: "Ensure rsyslog is configured to send logs to a remote log host." + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). *.* @@loghost.example.com Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:grep *.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf -> !r:# && r:*.* @@\.+' + + # 4.2.2.1 Ensure syslog-ng service is enabled (Scored) + - id: 20129 + title: "Ensure syslog-ng service is enabled." + description: "Once the syslog-ng package is installed it needs to be activated." + rationale: "If the syslog-ng service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable syslog-ng : # chkconfig syslog-ng on" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:chkconfig --list syslog-ng -> r:2:on && r:3:on && r:4:on && r:5:on" + + # 4.2.2.3 Ensure syslog-ng default file permissions configured (Scored) + - id: 20130 + title: "Ensure syslog-ng default file permissions configured." + description: "syslog-ng will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive syslog-ng data is archived and protected." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf and set perm option to 0640 or more restrictive: options { chain_hostnames(off); flush_lines(0); perm(0640); stats_freq(3600); threaded(yes); };" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:^options && r:perm\(0600\)|perm\(0640\)|perm\(0440\)|perm\(0400\)|perm\(0000\)' + + # 4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host (Not Scored) + - id: 20131 + title: "Ensure syslog-ng is configured to send logs to a remote log host." + description: "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp("logfile.example.com" port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the rsyslogd configuration: # pkill -HUP syslog-ng' + compliance: + - cis: ["4.2.2.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/syslog-ng/syslog-ng.conf -> !r:^# && r:destination logserver" + - 'f:/etc/syslog-ng/syslog-ng.conf -> !r:^# && r:log\.+source\.+destination' + + # 4.2.3 Ensure rsyslog or syslog-ng is installed (Scored) + - id: 20132 + title: "Ensure rsyslog or syslog-ng is installed." + description: "The rsyslog and syslog-ng software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog or syslog-ng using one of the following commands: # yum install rsyslog # yum install syslog-ng" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "not c:rpm -q rsyslog -> package rsyslog is not installed" + - "not c:rpm -q syslog-ng -> package syslog-ng is not installed" + + # 4.2.4 Ensure permissions on all logfiles are configured (Scored) + - id: 20133 + title: "Ensure permissions on all logfiles are configured." + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitivebdata is archived and protected." + remediation: "Run the following command to set permissions on all existing log files: # find /var/log -type f -exec chmod g-wx,o-rwx {} +" + compliance: + - cis: ["4.2.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + + ############################################### + # 5 System Access, Authentication and Authorization + ############################################### + ############################################### + # 5.2 Configure SSH + ############################################### + + # 5.1.1 Ensure cron daemon is enabled (Scored) + - id: 20134 + title: "Ensure cron daemon is enabled." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron : # chkconfig crond on" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:chkconfig --list crond -> r:2:on && r:3:on && r:4:on && r:5:on" + + # 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 20135 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 20136 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 20137 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 20138 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 20139 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\w00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 20140 + title: "Ensure permissions on /etc/cron.d are configured." + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.8 Ensure at/cron is restricted to authorized users (Scored) + - id: 20141 + title: "Ensure at/cron is restricted to authorized users." + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:stat /etc/cron.deny -> r:No such file or directory$" + - "c:stat /etc/at.deny -> r:No such file or directory$" + - 'c:stat /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + ############################################### + # 5.2 Configure SSH + ############################################### + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured (Scored) + - id: 20142 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: chown root:root /etc/ssh/sshd_config and chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2.2 Set SSH Protocol to 2 (Scored) + - id: 20143 + title: "Ensure SSH Protocol is set to 2." + description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:Protocol\s*\t*2' + + # 5.2.3 Set LogLevel to INFO (Scored) + - id: 20144 + title: "Ensure SSH LogLevel is set to INFO." + description: "The INFO parameter specifies that login and logout activity will be logged." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:LogLevel\s*\t*INFO' + + # 5.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) + - id: 20145 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.5"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.2.6 Set SSH IgnoreRhosts to Yes (Scored) + - id: 20146 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:IgnoreRhosts\s*\t*yes' + + # 5.2.7 Set SSH HostbasedAuthentication to No (Scored) + - id: 20147 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:HostbasedAuthentication\s*\t*no' + + # 5.2.8 Disable SSH Root Login (Scored) + - id: 20148 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["5.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitRootLogin\s*\t*no' + + # 5.2.9 Set SSH PermitEmptyPasswords to No (Scored) + - id: 20149 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitEmptyPasswords\s*\t*no' + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled (Scored) + - id: 20150 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitUserEnvironment\s*\t*no' + + # 5.2.12 Ensure SSH Idle Timeout Interval is configured (Scored) + - id: 20151 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 and ClientAliveCountMax 0" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare <= 300' + - 'f:$sshd_file -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare <= 3' + + # 5.2.13 Ensure SSH LoginGraceTime is set to one minute or less (Scored) + - id: 20152 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.13"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60' + + # 5.2.14 Ensure SSH access is limited (Scored) + - id: 20153 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. AllowGroups The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. DenyUsers The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. DenyGroups The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers ; AllowGroups ; DenyUsers and DenyGroups " + compliance: + - cis: ["5.2.14"] + - cis_csc: ["5.1", "5.8"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'f:$sshd_file -> r:^\s*AllowUsers' + - 'f:$sshd_file -> r:^\s*AllowGroups' + - 'f:$sshd_file -> r:^\s*DenyUsers' + - 'f:$sshd_file -> r:^\s*DenyGroups' + + # 5.2.15 Ensure SSH warning banner is configured (Scored) + - id: 20154 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*Banner\s*\t*/etc/issue.net' + + ############################################### + # 5.3 Configure PAM + ############################################### + # 5.3.1 Ensure password creation requirements are configured (Scored) + - id: 20155 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so try_first_pass retry=3 minlen=14 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1" + compliance: + - cis: ["5.3.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:grep pam_pwquality.so /etc/pam.d/password-auth -> r:try_first_pass && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'c:grep pam_pwquality.so /etc/pam.d/system-auth -> r:try_first_pass && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> n:dcredit\s*\t*=\s*\t*(\d+) compare = -1' + - 'f:/etc/security/pwquality.conf -> n:lcredit\s*\t*=\s*\t*(\d+) compare = -1' + - 'f:/etc/security/pwquality.conf -> n:ocredit\s*\t*=\s*\t*(\d+) compare = -1' + - 'f:/etc/security/pwquality.conf -> n:ucredit\s*\t*=\s*\t*(\d+) compare = -1' + + # 5.3.3 Ensure password reuse is limited (Scored) + - id: 20156 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the remember option and conform to site policy as shown: password sufficient pam_unix.so remember=5 or password required pam_pwhistory.so remember=5" + compliance: + - cis: ["5.3.3"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + + # 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 20157 + title: "Ensure password hashing algorithm is SHA-512." + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the sha512 option for pam_unix.so as shown: password sufficient pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.4"] + - pci_dss: ["3.6.1", "8.2.1"] + - tsc: ["CC6.1", "CC6.7"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + - 'f:/etc/pam.d/system-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + + ############################################### + # 5.4 User Accounts and Environment + ############################################### + ############################################### + # 5.4.1 Set Shadow Password Suite Parameters + ############################################### + # 5.4.1.1 Ensure password expiration is 365 days or less (Scored) + - id: 20158 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 90 and modify user parameters for all users with a password set to match: chage --maxdays 90 " + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + + # 5.4.1.2 Ensure minimum days between password changes is 7 or more (Scored) + - id: 20159 + title: "Ensure minimum days between password changes is 7 or more." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7 and modify user parameters for all users with a password set to match: chage --mindays 7 " + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + + # 5.4.1.3 Ensure password expiration warning days is 7 or more (Scored) + - id: 20160 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 and modify user parameters for all users with a password set to match: chage --warndays 7 " + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + # 5.4.1.4 Ensure inactive password lock is 30 days or less (Scored) + - id: 20161 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: useradd -D -f 30 and modify user parameters for all users with a password set to match: chage --inactive 30 " + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*(\d+) compare <= 30' + + # 5.4.3 Ensure default group for the root account is GID 0 (Scored) + - id: 20162 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["4.3"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\w:\w:0' + + # 5.4.4 Ensure default user umask is 027 or more restrictive (Scored) + - id: 20163 + title: "Ensure default user umask is 027 or more restrictive." + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["5.1"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + # 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 20164 + title: "Ensure default user shell timeout is 900 seconds or less." + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bashrc and /etc/profile files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + # 5.6 Ensure access to the su command is restricted (Scored) + - id: 20165 + title: "Ensure access to the su command is restricted.." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo , which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su , the su command will only allow users in the wheel group to execute su ." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid" + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/pam.d/su -> r:^auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + ############################################### + # 6 System Maintenance + ############################################### + ############################################### + # 6.1 System File Permissions + ############################################### + + # 6.1.2 Configure /etc/passwd permissions (Scored) + - id: 20166 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.44"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.3 Configure /etc/shadow permissions (Scored) + - id: 20167 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following command to set permissions on /etc/shadow: # chown root:root /etc/shadow # chmod 000 /etc/shadow" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.4 Configure /etc/group permissions (Scored) + - id: 20168 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.5 Configure /etc/gshadow permissions (Scored) + - id: 20169 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following command to set permissions on /etc/gshadow: # chown root:root /etc/gshadow # chmod 000 /etc/gshadow" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.6 Configure /etc/passwd- permissions (Scored) + - id: 20170 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod 644 /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.7 Configure /etc/shadow- permissions (Scored) + - id: 20171 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/shadow-: # chown root:root /etc/shadow- # chmod 000 /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.8 Configure /etc/group- permissions (Scored) + - id: 20172 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.9 Configure /etc/gshadow- permissions (Scored) + - id: 20173 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/gshadow-: # chown root:root /etc/gshadow- # chmod 000 /etc/gshadow-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + ############################################### + # 6.2 Review User and Group Settings + ############################################### + # 6.2.1 Check passwords fields (Scored) + - id: 20174 + title: "Ensure password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: passwd -l || Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + + # 6.2.2 Delete legacy entries in /etc/passwd (Scored) + - id: 20175 + title: "Ensure no legacy + entries exist in /etc/passwd." + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/passwd -> !r:^# && r:^+:" + + # 6.2.3 Delete legacy entries in /etc/shadow (Scored) + - id: 20176 + title: "Ensure no legacy + entries exist in /etc/shadow." + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/shadow -> !r:^# && r:^+:" + + # 6.2.4 Delete legacy entries in /etc/group (Scored) + - id: 20177 + title: "Ensure no legacy + entries exist in /etc/group." + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/group if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/group -> !r:^# && r:^+:" + + # 6.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) + - id: 20178 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' diff --git a/etc/ruleset/sca/amazon/cis_amazon_linux_2.yml b/etc/ruleset/sca/amazon/cis_amazon_linux_2.yml new file mode 100644 index 0000000000..3f02c7e1ae --- /dev/null +++ b/etc/ruleset/sca/amazon/cis_amazon_linux_2.yml @@ -0,0 +1,3391 @@ +# Security Configuration Assessment +# CIS Checks for Amazon Linux 2 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Amazon Linux 2 Benchmark v2.0.0 - 07-28-2021 + +policy: + id: "cis_amazon_linux_2" + file: "cis_amazon_linux_2.yml" + name: "CIS Amazon Linux 2 Benchmark v2.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Amazon Linux 2 systems." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Amazon Linux platform." + description: "Requirements for running the policy against Amazon Linux 2." + condition: any + rules: + - "f:/etc/system-release -> r:^Amazon && r:release 2" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # 1.1.1.1 Ensure mounting of cramfs filesystems is disabled. + - id: 20500 + title: "Ensure mounting of cramfs filesystems is disabled." + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/directory ending in .conf. Example: vim /etc/modprobe.d/cramfs.confand add the following line: install cramfs /bin/true. Run the following command to unload the cramfs module: rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:install /bin/true|Module cramfs not found" + - "not c:lsmod -> r:cramfs" + + # 1.1.1.2 Ensure mounting of squashfs filesystems is disabled. + - id: 20501 + title: "Ensure mounting of squashfs filesystems is disabled." + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install squashfs /bin/true. Run the following command to unload the squashfs module: rmmod squashfs" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + + # 1.1.1.3 Ensure mounting of udf filesystems is disabled.. + - id: 20502 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install udf /bin/true. Run the following command to unload the udf module: rmmod udf" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v udf -> r:install /bin/true|Module udf not found" + - "not c:lsmod -> r:udf" + + # 1.1.2 Ensure /tmp is configured. + - id: 20503 + title: "Ensure /tmp is configured." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set the noexecoption on the mount, making /tmpuseless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuidprogram and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + remediation: "Create or update an entry for /tmp in either /etc/fstab OR in a systemd tmp.mount file: If /etc/fstab is used: Configure /etc/fstab as appropriate. Example: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp: # mount -o remount,noexec,nodev,nosuid /tmp OR If systemd tmp.mount file is used: Run the following command to create the file /etc/systemd/system/tmp.mount if it doesn't exist: # [ ! -f /etc/systemd/system/tmp.mount ] && cp -v /usr/lib/systemd/system/tmp.mount /etc/systemd/system/ Edit the file /etc/systemd/system/tmp.mount: [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to reload the systemd daemon:# systemctl daemon-reload Run the following command to unmask tmp.mount: # systemctl unmask tmp.mpunt Run the following command to enable and start tmp.mount: # systemctl enable --now tmp.mount" + compliance: + - cis: ["1.1.2"] + - cis_csc: ["9.4", "13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: any + rules: + - 'c:mount -> r:\s/tmp\s' + - 'c:sh -c "systemctl show \"tmp.mount\" | grep -i \"unitfilestate\"" -> r:UnitFileState=enabled' + + # 1.1.3 Ensure noexec option set on /tmp partition. + - id: 20504 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file OR the /etc/systemd/system/local-fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstabfile and add noexecto the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,noexec /tmp OR IF systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + # 1.1.4 Ensure nodev option set on /tmp partition. + - id: 20505 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file OR the /etc/systemd/system/local-fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nodev /tmp OR IF systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + # 1.1.5 Ensure nosuid option set on /tmp partition. + - id: 20506 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file OR the /etc/systemd/system/local-fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nosuid /tmp OR IF systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuid to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nosuid,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["5.1", "13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + # 1.1.6 Ensure /dev/shm is configured. + - id: 20507 + title: "Ensure /dev/shm is configured." + description: "/dev/shm is a traditional shared memory concept. One program will create a memory portion, which other processes (if permitted) can access. Mounting tmpfs at /dev/shm is handled automatically by systemd." + rationale: "Any user can upload and execute files inside the /dev/shm similar to the /tmp partition. Configuring /dev/shm allows an administrator to set the noexec option on the mount, making /dev/shm useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "Edit /etc/fstab and add or edit the following line: tmpfs /dev/shm tmpfs defaults,noexec,nodev,nosuid,seclabel 0 0 Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm" + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.1", "13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s' + - 'f:/etc/fstab -> r:\s/dev/shm\s' + + # 1.1.7 Ensure noexec option set on /dev/shm partition. + - id: 20508 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm" + compliance: + - cis: ["1.1.7"] + - cis_csc: ["5.1", "13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + # 1.1.8 Ensure nodev option set on /dev/shm partition. + - id: 20509 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm" + compliance: + - cis: ["1.1.8"] + - cis_csc: ["5.1", "13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + # 1.1.9 Ensure nosuid option set on /dev/shm partition.. + - id: 20510 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm" + compliance: + - cis: ["1.1.9"] + - cis_csc: ["5.1", "13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + # 1.1.10 Ensure separate partition exists for /var. + - id: 20511 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.10"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + # 1.1.11 Ensure separate partition exists for /var/tmp. + - id: 20512 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications and is intended for temporary files that are preserved across reboots." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["5.1", "13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + # 1.1.12 Ensure /var/tmp partition includes the noexec option. + - id: 20513 + title: "Ensure /var/tmp partition includes the noexec option." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "For existing /var/tmp partitions, edit the /etc/fstab file and add noexec to the fourth field (mounting options) of the /var/tmp entry. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,noexec /var/tmp" + compliance: + - cis: ["1.1.12"] + - cis_csc: ["5.1", "13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + # 1.1.13 Ensure /var/tmp partition includes the nodev option. + - id: 20514 + title: "Ensure /var/tmp partition includes the nodev option." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp ." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nodev /var/tmp" + compliance: + - cis: ["1.1.13"] + - cis_csc: ["5.1", "13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + + # 1.1.14 Ensure /var/tmp partition includes the nosuid option. + - id: 20515 + title: "Ensure /var/tmp partition includes the nosuid option." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["5.1", "13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + # 1.1.15 Ensure separate partition exists for /var/log. + - id: 20516 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data ." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.15"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4", "10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + # 1.1.16 Ensure separate partition exists for /var/log/audit. + - id: 20517 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.16"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4", "10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + # 1.1.17 Ensure separate partition exists for /home. + - id: 20518 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.17"] + - cis_csc: ["5.1", "13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + # 1.1.18 Ensure /home partition includes the nodev option. + - id: 20519 + title: "Ensure /home partition includes the nodev option." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.18"] + - cis_csc: ["5.1", "13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + # 1.1.19 Ensure removable media partitions include noexec option - Can't be implemented. + # 1.1.20 Ensure nodev option set on removable media partitions - Can't be implemented. + # 1.1.21 Ensure nosuid option set on removable media partitions - Can't be implemented. + + # 1.1.22 Ensure sticky bit is set on all world-writable directories. + - id: 20520 + title: "Ensure sticky bit is set on all world-writable directories." + description: "Setting the sticky bit on world writable directories prevents users from deleting or renaming files in that directory that are not owned by them." + rationale: "This feature prevents the ability to delete or rename files in world writable directories (such as /tmp ) that are owned by another user." + remediation: "Run the following command to set the sticky bit on all world writable directories: # df --local -P | awk '{if (NR!=1) print $6}' | xargs -I '{}' find '{}' -xdev -type d \\( -perm -0002 -a ! -perm -1000 \\) 2>/dev/null | xargs -I '{}' chmod a+t '{}'" + compliance: + - cis: ["1.1.22"] + - cis_csc: ["8.4", "8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'not c:sh -c "df --local -P 2> /dev/null | awk ''{if (NR!=1) print $6}'' | xargs -I ''{}'' find ''{}'' -xdev -type d \\( -perm -0002 -a ! -perm -1000 \\) 2>/dev/null" -> r:^/' + + # 1.1.23 Disable Automounting. + - id: 20521 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run the following command to disable autofs: systemctl disable autofs" + compliance: + - cis: ["1.1.23"] + - cis_csc: ["8.4", "8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl show autofs.service -> r:unitfilestate=enabled" + + # 1.1.24 Disable USB Storage. + - id: 20522 + title: "Disable USB Storage." + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/usb_storage.conf Add the following line: install usb-storage /bin/true . Run the following command to unload the usb-storage module: rmmod usb-storage" + compliance: + - cis: ["1.1.24"] + - cis_csc: ["8.4", "8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v usb-storage -> r:install /bin/true" + - "not c:lsmod -> r:usb-storage" + + ############################################################ + # 1.2 Configure Software Updates. + ############################################################ + + # 1.2.1 Ensure GPG keys are configured -> can't be implemented - requires manual action. + # 1.2.2 Ensure package manager repositories are configured -> can't be implemented - requires manual action. + + # 1.2.3 Activate gpgcheck. + - id: 20523 + title: "Ensure gpgcheck is globally activated." + description: "The gpgcheck option, found in the main section of the /etc/yum.conf and individual /etc/yum/repos.d/* files determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/yum.conf and set ' gpgcheck=1 ' in the [main] section. Edit any failing files in /etc/yum.repos.d/* and set all instances of gpgcheck to ' 1 '." + compliance: + - cis: ["1.2.3"] + - cis_csc: ["3.4"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + condition: all + rules: + - "f:/etc/yum.conf -> r:gpgcheck=1" + - "not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck=0" + + ############################################################ + # 1.3 Filesystem Integrity Checking. + ############################################################ + + # 1.3.1 Ensure AIDE is installed. + - id: 20524 + title: "Ensure AIDE is installed." + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: yum install aide // Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: aide --init && mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: + - "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: all + rules: + - "c:rpm -q aide -> r:aide-" + + # 1.3.2 Ensure filesystem integrity is regularly checked. + - id: 20525 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check run the following command: crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check // Notes: The checking in this recommendation occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy. OR If aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simpleExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer " + compliance: + - cis: ["1.3.2"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "c:crontab -u root -l -> r:aide" + - "c:grep -r aide /etc/cron.* /etc/crontab -> r:aide" + - "c:systemctl is-enabled aidecheck.service -> r:enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:enabled" + - "c:systemctl status aidecheck.timer -> r:enabled" + + ############################################################ + # 1.4 Secure Boot Settings. + ############################################################ + + # 1.4.1 Ensure permissions on bootloader config are configured. + - id: 20526 + title: "Ensure permissions on bootloader config are configured." + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually located at /boot/grub2/grub.cfg and linked as /etc/grub2.cfg . On newer grub2 systems the encrypted bootloader password is contained in /boot/grub2/user.cfg" + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg # chown root:root /boot/grub2/user.cfg # chmod og-rwx /boot/grub2/user.cfg" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /boot/grub2/grub.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat -L /boot/grub2/user.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|cannot stat' + + # 1.4.2 Ensure authentication required for single user mode. + - id: 20527 + title: "Ensure authentication required for single user mode." + description: "Single user mode (rescue mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode (rescue mode) prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: 'Edit /usr/lib/systemd/system/rescue.service and /usr/lib/systemd/system/emergency.service and set ExecStart to use /sbin/sulogin or /usr/sbin/sulogin: ExecStart=-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default" ' + compliance: + - cis: ["1.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/usr/lib/systemd/system/rescue.service -> r:ExecStart=-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"|ExecStart=-/bin/sh -c "/usr/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"' + - 'f:/usr/lib/systemd/system/emergency.service -> r:ExecStart=-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"|ExecStart=-/bin/sh -c "/usr/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"' + + ############################################################ + # 1.5 Additional Process Hardening. + ############################################################ + + # 1.5.1 Ensure core dumps are restricted. + - id: 20528 + title: "Ensure core dumps are restricted." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0. Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:hard\s*\t*core\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + + # 1.5.2 Ensure XD/NX support is enabled. + - id: 20529 + title: "Ensure XD/NX support is enabled." + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system. Note: Ensure your system supports the XD or NX bit and has PAE support before implementing this recommendation as this may prevent it from booting if these are not supported by your hardware." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios" + compliance: + - cis: ["1.5.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sh -c "journalctl -k --boot | grep \"protection: \" | tail -1" -> r:protection: active' + - 'not c:sh -c "[[ -n $(grep noexec[0-9]*=off /proc/cmdline) || -z $(grep -E -i \" (pae|nx) \" /proc/cpuinfo) || -n $(grep \"\\sNX\\s.*\\sprotection:\\s\" /var/log/dmesg | grep -v active) ]] && echo \"NX Protection is not active\"" -> r:^NX Protection is not active$' + + # 1.5.3 Ensure address space layout randomization (ASLR) is enabled. + - id: 20530 + title: "Ensure address space layout randomization (ASLR) is enabled." + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2. Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + + # 1.5.4 Ensure prelink is not installed. + - id: 20531 + title: "Ensure prelink is not installed." + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal: # prelink -ua Run the following command to uninstall prelink: # yum remove prelink" + compliance: + - cis: ["1.5.4"] + - cis_csc: ["14.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q prelink -> r:package prelink is not installed" + + ############################################################ + # 1.6 Mandatory Access Control. + ############################################################ + # 1.6.1 Configure SELinux. + ############################################################ + + # 1.6.1.1 Ensure SELinux is installed. + - id: 20532 + title: "Ensure SELinux is installed." + description: "SELinux provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install libselinux: # yum install libselinux" + compliance: + - cis: ["1.6.1.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q libselinux -> r:libselinux-\S+' + + # 1.6.1.2 Ensure SELinux is not disabled in bootloader configuration. + - id: 20533 + title: "Ensure SELinux is not disabled in bootloader configuration." + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/grub and remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX="" || Run the following command to update the grub2 configuration: grub2-mkconfig -o /boot/grub2/grub.cfg' + compliance: + - cis: ["1.6.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*linux\.+selinux=0|linux\.+enforcing=0' + + # 1.6.1.3 Ensure SELinux policy is configured. + - id: 20534 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + compliance: + - cis: ["1.6.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s*\t*targeted$|^Loaded policy name:\s*\t*mls' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Ensure the SELinux mode is enforcing or permissive. + - id: 20535 + title: "Ensure the SELinux mode is enforcing or permissive." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t" + rationale: "Running SELinux in disabled mode is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive" + compliance: + - cis: ["1.6.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:getenforce -> r:Enforcing|Permisive" + - "f:/etc/selinux/config -> r:^SELINUX=enforcing|^SELINUX=Permisive" + + # 1.6.1.5 Ensure the SELinux mode is enforcing. + - id: 20536 + title: "Ensure the SELinux mode is enforcing." + description: "Set SELinux to enable when the system is booted" + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing" + compliance: + - cis: ["1.6.1.5"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:getenforce -> r:Enforcing" + - "f:/etc/selinux/config -> r:^SELINUX=enforcing" + + # 1.6.1.6 Ensure no unconfined services exist - Not implemented + + # 1.6.1.7 Ensure SETroubleshoot is not installed. + - id: 20537 + title: "Ensure SETroubleshoot is not installed." + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # yum remove setroubleshoot" + compliance: + - cis: ["1.6.1.7"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q setroubleshoot -> r:package setroubleshoot is not installed" + + # 1.6.1.8 Disable MCS Translation service mcstrans. + - id: 20538 + title: "Ensure the MCS Translation Service (mcstrans) is not installed." + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # yum remove mcstrans" + compliance: + - cis: ["1.6.1.8"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q mcstrans -> r:package mcstrans is not installed" + + ############################################################ + # 1.7 Warning Banners. + ############################################################ + + # 1.7.1 Ensure message of the day is configured properly. + - id: 20539 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m, \\r, \\s, \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd" + compliance: + - cis: ["1.7.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s|Amazon' + + # 1.7.2 Ensure local login warning banner is configured properly. + - id: 20540 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version -or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m, \\r, \\s, or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.7.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Amazon' + + # 1.7.3 "Ensure remote login warning banner is configured properly. + - id: 20541 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m, \\r, \\s, or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.7.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|Amazon' + + # 1.7.4 Ensure permissions on /etc/motd are configured. + - id: 20542 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.7.4"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.5 Ensure permissions on /etc/issue are configured. + - id: 20543 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.7.5"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured. + - id: 20544 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.7.6"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.8 Ensure updates, patches, and additional security software are installed. + - id: 20545 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available packages # yum update --security " + compliance: + - cis: ["1.8"] + - cis_csc: ["3.4", "3.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6", "SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: all + rules: + - 'c:sh -c " yum check-updates --security | grep \"No packages\"" -> r:No packages needed for security' + + ############################################################ + # 2 OS Services. + ############################################################ + ############################################################ + # 2.1.1 Time Synchronization. + ############################################################ + + # 2.1.1.1 Ensure time synchronization is in use. + - id: 20546 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Run One of the following commands to install chrony or NTP: to install chrony run the following command: # yum install chrony OR to install ntp: run the following command: # yum install ntp" + compliance: + - cis: ["2.1.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "not c:rpm -q ntp -> r:^package ntp is not installed" + - "not c:rpm -q chrony -> r:^package chrony is not installed" + + # 2.2.1.2 Ensure chrony is configured. + - id: 20547 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. Note: This recommendation only applies if chrony is in use on the system." + remediation: '1) Add or edit server or pool lines to /etc/chrony.conf as appropriate: server . 2) Add or edit the OPTIONS in /etc/sysconfig/chronyd to include ''-u chrony'':OPTIONS=" -u chrony"' + compliance: + - cis: ["2.1.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\.+$|^pool\.+$' + - 'f:/etc/sysconfig/chronyd -> r:^OPTIONS\s*=\s* && r:-u chrony' + + # 2.1.1.3 Ensure ntp is configured. + - id: 20548 + title: "Ensure ntp is configured." + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "1) Add or edit restrict lines in /etc/ntp.conf to match the following: - restrict -4 default kod nomodify notrap nopeer noquery and - restrict -4 default kod nomodify notrap nopeer noquery. 2) Add or edit server or pool lines to /etc/ntp.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': - OPTIONS='-u ntp:ntp'" + compliance: + - cis: ["2.1.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/sysconfig/ntpd -> r:^OPTIONS\s*=\s* && r:-u ntp:ntp' + - 'f:/usr/lib/systemd/system/ntpd.service -> r:^Execstart\s*=\s*/usr/sbin/ntpd\s+-u\s+ntp:ntp' + + # 2.1.2 Ensure X11 Server components are not installed. + - id: 20549 + title: " Ensure X Window System is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: # yum remove xorg-x11*" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - "c:rpm -q xorg-x11 -> r:package xorg-x11 is not installed" + + # 2.1.3 Ensure Avahi Server is not enabled. + - id: 20550 + title: " Ensure Avahi Server is not enabled." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable this package to reduce the potential attack surface." + remediation: "Run the following command to disable avahi-daemon: # systemctl disable avahi-daemon" + compliance: + - cis: ["2.1.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q avahi-autoipd -> r:package avahi-autoipd is not installed" + - "c:rpm -q avahi -> r:package avahi is not installed" + + # 2.1.4 Ensure CUPS is not enabled. + - id: 20551 + title: "Ensure CUPS is not enabled." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface. Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to disable cups: # systemctl disable cups" + compliance: + - cis: ["2.1.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q cups -> r:package cups is not installed" + + # 2.1.5 Ensure DHCP Server is not installed. + - id: 20552 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that the dhcp package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcp: # yum remove dhcp" + compliance: + - cis: ["2.1.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on DHCP is available at https://www.isc.org/software/dhcp + condition: all + rules: + - "c:rpm -q dhcp -> r:package dhcp is not installed" + + # 2.1.6 Ensure LDAP server is not installed. + - id: 20553 + title: "Ensure LDAP server is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to remove openldap-servers: # yum remove openldap-servers" + compliance: + - cis: ["2.1.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on OpenLDAP is available at https://www.openldap.org + condition: any + rules: + - "c:rpm -q openldap-servers -> r:package openldap-servers is not installed" + + # 2.1.7 Ensure DNS Server is not installed. + - id: 20554 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable named: # yum remove bind" + compliance: + - cis: ["2.1.7"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q bind -> r:package bind is not installed" + + # 2.1.8 Ensure FTP Server is not installed. + - id: 20555 + title: "Ensure FTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)" + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # yum remove vsftpd" + compliance: + - cis: ["2.1.8"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q vsftpd -> r:package vsftpd is not installed" + + # 2.1.9 Ensure HTTP server is not installed. + - id: 20556 + title: "Ensure HTTP server is not installed." + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove httpd: # yum remove httpd" + compliance: + - cis: ["2.1.9"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q httpd -> r:package httpd is not installed" + + # 2.1.10 Ensure IMAP and POP3 server is not installed. + - id: 20557 + title: "Ensure IMAP and POP3 server is not installed." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dovecot: # yum remove dovecot" + compliance: + - cis: ["2.1.10"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q dovecot -> r:package dovecot is not installed" + + # 2.1.11 Ensure Samba is not installed. + - id: 20558 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to remove smb: # yum remove samba" + compliance: + - cis: ["2.1.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q samba -> r:package samba is not installed" + + # 2.1.12 Ensure HTTP Proxy Server is not installed. + - id: 20559 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove squid: # yum remove squid" + compliance: + - cis: ["2.1.12"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q squid -> r:package squid is not installed" + + # 2.1.13 Ensure net-snmp is not installed. + - id: 20560 + title: "Ensure SNMP Server is not installed." + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3replaces the simple/clear text password sharing used in SNMPv2with more securely encoded parameters. If the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system." + remediation: "Run the following command to remove snmpd: # yum remove snmpd" + compliance: + - cis: ["2.1.13"] + - cis_csc: ["2.6", 9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q net-snmp -> r:package net-snmp is not installed" + + # 2.1.14 Ensure NIS server is not installed. + - id: 20561 + title: "Ensure NIS server is not installed." + description: "The ypserv package provides the Network Information Service (NIS). This service, formally known as Yellow Pages, is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the ypserv package be removed, and if required a more secure services be used." + remediation: "Run the following command to remove snmpd: # yum remove snmpd" + compliance: + - cis: ["2.1.14"] + - cis_csc: ["2.6", 9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q ypserv -> r:package ypserv is not installed" + + # 2.1.15 Ensure telnet-server is not installed. + - id: 20562 + title: "Ensure NIS server is not installed." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to remove telnet-server: # yum remove telnet-server" + compliance: + - cis: ["2.1.15"] + - cis_csc: ["2.6", 9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q telnet-server -> r:package telnet-server is not installed" + + # 2.1.16 Ensure mail transfer agent is configured for local-only mode. + - id: 20563 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only . Restart postfix: # systemctl restart postfix" + compliance: + - cis: ["2.1.16"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - tsc: ["CC5.2", "CC6.4", "CC6.6", "CC6.7"] + condition: none + rules: + - 'c:ss -lntu -> r:\.*:25\s* && !r:127.0.0.1:25\.*|::1:25\.*' + + # 2.1.17 Ensure nfs-utils is not installed or the nfs-server service is masked. + - id: 20564 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following command to remove nfs-utils: # yum remove nfs-utils OR If the nfs-package is required as a dependency, run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server" + compliance: + - cis: ["2.1.17"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - "c:rpm -q nfs-utils -> r:package nfs-utils is not installed" + - "c:systemctl is-enabled nfs-server -> r:masked" + + # 2.1.18 Ensure rpcbind is not installed or the rpcbind services are masked. + - id: 20565 + title: "Ensure rpcbind is not installed or the rpcbind services are masked." + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening" + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + remediation: "Run the following command to remove rpcbind: # yum remove rpcbind OR If the rpcbind is required as a dependency, run the following command to stop and mask the rpcbind and rpcbind.socket services: # systemctl --now mask nfs-server && # systemctl --now mask rpcbind.socket" + compliance: + - cis: ["2.1.18"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - "c:rpm -q rpcbind -> r:package rpcbind is not installed" + - "c:systemctl is-enabled rpcbind -> r:masked" + - "c:systemctl is-enabled rpcbind.socket -> r:masked" + + # 2.1.19 Ensure rsync is not installed or the rsyncd service is masked. + - id: 20566 + title: "Ensure rsync is not installed or the rsyncd service is masked." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to remove the rsync package: # yum remove rsync OR Run the following command to mask the rsyncd service: # systemctl --now mask rsyncd" + compliance: + - cis: ["2.1.19"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - "c:rpm -q rsync -> r:package rsync is not installed" + - "c:systemctl is-enabled rsyncd -> r:masked" + + ############################################################ + # 2.2 Service Clients. + ############################################################ + + # 2.2.1 Ensure NIS Client is not enabled. + - id: 20567 + title: "Ensure NIS Client is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Run the following command to uninstall ypbind: # yum remove ypbind" + compliance: + - cis: ["2.2.1"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q ypbind -> r:package ypbind is not installed" + + # 2.2.2 Ensure rsh client is not installed. + - id: 20568 + title: "Ensure rsh client is not installed." + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh, rcp and rlogin ." + remediation: "Run the following command to uninstall rsh: # yum remove rsh" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["16.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q rsh -> r:^package rsh is not installed" + + # 2.2.3 Ensure talk client is not installed. + - id: 20569 + title: "Ensure talk client is not installed." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk: # yum remove talk" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q talk -> r:^package talk is not installed" + + # 2.2.4 Ensure telnet client is not installed. + - id: 20570 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet: # yum remove telnet" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["16.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q telnet -> r:^package telnet is not installed" + + # 2.2.5 Ensure LDAP client is not installed. + - id: 20571 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients: # yum remove openldap-clients" + compliance: + - cis: ["2.2.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q openldap-clients -> r:^package openldap-clients is not installed" + + # 2.3 Ensure nonessential services are removed or masked - Not implemented + + ####################################################### + # 3 Network Configuration. + ####################################################### + ####################################################### + # 3.1 Disable unused network protocols and devices. + ####################################################### + + # 3.1.1 Disable IPv6. + - id: 20572 + title: "Disable IPv6." + description: "Although IPv6 has many advantages over IPv4, not all organizations have IPv6 or dual stack configurations implemented." + rationale: "If IPv6 or dual stack is not to be used, it is recommended that IPv6 be disabled to reduce the attack surface of the system." + remediation: > + Use one of the two following methods to disable IPv6 on the system: + + To disable IPv6 through the GRUB2 config: + + Edit /etc/default/grub and add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: + GRUB_CMDLINE_LINUX="ipv6.disable=1" + + Run the following command to update the grub2 configuration: + # grub2-mkconfig -o /boot/grub2/grub.cfg + + OR + + To disable IPv6 through sysctl settings: + + Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: + net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 + + Run the following commands to set the active kernel parameters: + # sysctl -w net.ipv6.conf.all.disable_ipv6=1 + # sysctl -w net.ipv6.conf.default.disable_ipv6=1 + # sysctl -w net.ipv6.route.flush=1 + compliance: + - cis: ["3.1.1"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not f:/boot/grub2/grub.cfg -> r:ipv6.disable\s*=\s*1' + - 'c:sysctl net.ipv6.conf.default.disable_ipv6 -> r:net\.ipv6\.conf\.default\.disable_ipv6\s*=\s*1' + - 'c:sysctl net.ipv6.conf.all.disable_ipv6 -> r:net\.ipv6\.conf\.all\.disable_ipv6\s*=\s*1' + + # 3.1.2 Ensure wireless interfaces are disabled -> Not implemented, requires manual action. + + ####################################################### + # 3.2 Network Parameters (Host Only). + ####################################################### + + # 3.2.1 Ensure IP forwarding is disabled. + - id: 20573 + title: "Ensure IP forwarding is disabled." + description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." + rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Run the following commands to restore the default parameters and set the active kernel parameters: # grep -Els '^\\s*net\\.ipv4\\.ip_forward\\s*=\\s*1' /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri 's/^\\s*(net\\.ipv4\\.ip_forward\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/' $filename; done; sysctl -w net.ipv4.ip_forward=0; sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'not c:grep -RhEs "net\.ipv4\.ip_forward" /etc/sysctl.conf /etc/sysctl.d/*.conf -> r:1' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' + - 'not c:grep -RhEs "net\.ipv6\.conf\.all\.forwarding" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf -> r:1' + + # 3.2.2 Ensure packet redirect sending is disabled. + - id: 20574 + title: "Ensure packet redirect sending is disabled." + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0; net.ipv4.conf.default.send_redirects = 0 and set the active kernel parameters. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0; # sysctl -w net.ipv4.conf.default.send_redirects=0; # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'not c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:1' + - 'not c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:1' + + ################################################## + # 3.3 Network Parameters (Host and Router). + ################################################## + + # 3.3.1 Ensure source routed packets are not accepted. + - id: 20575 + title: "Ensure source routed packets are not accepted." + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0; net.ipv4.conf.default.accept_source_route = 0 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'not c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:1' + - 'not c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:1' + - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0$' + - 'not c:grep -Rh net\.ipv6\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:1' + - 'not c:grep -Rh net\.ipv6\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d/* -> r:1' + + # 3.3.2 Ensure ICMP redirects are not accepted. + - id: 20576 + title: "Ensure ICMP redirects are not accepted." + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0; net.ipv4.conf.default.accept_redirects = 0 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'not c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:1' + - 'not c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:1' + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + + # 3.3.3 Ensure secure ICMP redirects are not accepted. + - id: 20577 + title: "Ensure secure ICMP redirects are not accepted." + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0; net.ipv4.conf.default.secure_redirects = 0 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'not c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:1' + - 'not c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:1' + + # 3.3.4 Ensure suspicious packets are logged. + - id: 20578 + title: "Ensure suspicious packets are logged." + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1; net.ipv4.conf.default.log_martians = 1 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.4"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'not c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:0' + - 'not c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:0' + + # 3.3.5 Ensure broadcast ICMP requests are ignored. + - id: 20579 + title: "Ensure broadcast ICMP requests are ignored." + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1 and set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'not c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:0' + + # 3.3.6 Ensure bogus ICMP responses are ignored. + - id: 20580 + title: "Ensure bogus ICMP responses are ignored." + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1 and set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'not c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:0' + + # 3.3.7 Ensure Reverse Path Filtering is enabled. + - id: 20581 + title: "Ensure Reverse Path Filtering is enabled." + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1; net.ipv4.conf.default.rp_filter = 1 and set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + - 'not c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:0' + - 'not c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:0' + + # 3.3.8 Ensure TCP SYN Cookies is enabled. + - id: 20582 + title: "Ensure TCP SYN Cookies is enabled." + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1 and set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'not c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:0' + + # 3.3.9 Ensure IPv6 router advertisements are not accepted. + - id: 20583 + title: "Ensure IPv6 router advertisements are not accepted." + description: "This setting disables the system's ability to accept IPv6 router advertisements." + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 and net.ipv6.conf.default.accept_ra = 0 Then, run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + - 'not c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:1' + - 'not c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:1' + + ############################################################ + # 3.4 Uncommon Network Protocols. + ############################################################ + + # 3.4.1 Ensure DCCP is disabled. + - id: 20584 + title: "Ensure DCCP is disabled." + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v dccp -> r:install /bin/true" + - "not c:lsmod -> r:dccp" + + # 3.4.2 Ensure SCTP is disabled. + - id: 20585 + title: "Ensure SCTP is disabled." + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.4.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v sctp -> r:install /bin/true" + - "not c:lsmod -> r:sctp" + + ############################################################ + # 3.5 Firewall Configuration. + ############################################################ + ############################################################ + # 3.5.1 Configure firewalld. + ############################################################ + + # 3.5.1.1 Ensure firewalld is installed. + - id: 20586 + title: "Ensure firewalld is installed." + description: "firewalld is a firewall management tool for Linux operating systems. It provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the iptables backend or provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the nftables utility. firewalld replaces iptables as the default firewall management tool. Use the firewalld utility to configure a firewall for less complex firewalls. The utility is easy to use and covers the typical use cases scenario. FirewallD supports both IPv4 and IPv6 networks and can administer separate firewall zones with varying degrees of trust as defined in zone profiles." + rationale: "A firewall utility is required to configure the Linux kernel's netfilter framework via the iptables or nftables back-end. The Linux kernel's netfilter framework host-based firewall can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + remediation: "Run the following command to install FirewallD and iptables: # yum install firewalld iptables" + compliance: + - cis: ["3.5.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:rpm -q firewalld -> r:firewalld-" + + # 3.5.1.2 Ensure iptables-services not installed with firewalld. + # 3.5.2.3 Ensure iptables-services not installed with nftables. + - id: 20587 + title: "Ensure iptables-services not installed with firewalld or nftables." + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package # systemctl stop iptables # systemctl stop ip6tables # yum remove iptables-services" + compliance: + - cis: ["3.5.1.2", "3.5.2.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:rpm -q iptables-services -> r:^iptables-services-" + - "not c:rpm -q firewalld -> r:firewalld-" + - "not c:rpm -q nftables -> r:nftables-" + + # 3.5.1.3 Ensure nftables either not installed or masked with firewalld. + - id: 20588 + title: "Ensure nftables either not installed or masked with firewalld." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables." + rationale: "Running both firewalld and nftables may lead to conflict." + remediation: "Run the following command to remove nftables: # yum remove nftables OR Run the following command to stop and mask nftables: # systemctl --now mask nftables" + compliance: + - cis: ["3.5.1.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "not c:systemctl is-enabled nftables -> r:enabled" + - "c:rpm -q nftables -> r:^package nftables is not installed" + - "c:rpm -q firewalld -> r:firewalld-" + + # 3.5.1.4 Ensure firewalld service enabled and running. + - id: 20589 + title: "Ensure firewalld service enabled and running." + description: "firewalld.service enables the enforcement of firewall rules configured through firewalld" + rationale: "Ensure that the firewalld.service is enabled and running to enforce firewall rules configured through firewalld." + remediation: "Run the following command to unmask firewalld # systemctl unmask firewalld Run the following command to enable and start firewalld # systemctl --now enable firewalld" + compliance: + - cis: ["3.5.1.4"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: any + rules: + - "c:systemctl is-enabled firewalld -> r:enabled" + - "c:firewalld --state -> r:running" + + # 3.5.1.5 Ensure firewalld default zone is set. + - id: 20590 + title: "Ensure firewalld default zone is set." + description: "A firewall zone defines the trust level for a connection, interface or source address binding. This is a one to many relation, which means that a connection, interface or source can only be part of one zone, but a zone can be used for many network connections, interfaces and sources. 1.- The default zone is the zone that is used for everything that is not explicitly bound/assigned to another zone. 2.- If no zone assigned to a connection, interface or source, only the default zone is used. 3.- The default zone is not always listed as being used for an interface or source as it will be used for it either way. This depends on the manager of the interfaces. Connections handled by NetworkManager are listed as NetworkManager requests to add the zone binding for the interface used by the connection. Also interfaces under control of the network service are listed also because the service requests it." + rationale: "Because the default zone is the zone that is used for everything that is not explicitly bound/assigned to another zone, it is important for the default zone to set." + remediation: "Run the following command to set the default zone: # firewall-cmd --set-default-zone= Example: # firewall-cmd --set-default-zone=public" + compliance: + - cis: ["3.5.1.5"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + references: + - https://firewalld.org/documentation + - https://firewalld.org/documentation/man-pages/firewalld.zone + condition: all + rules: + - "c:systemctl is-enabled firewalld -> r:enabled" + - "c:firewalld --state -> r:running" + + # 3.5.1.6 Ensure network interfaces are assigned to appropriate zone - Not implemented, requires manual operation. + # 3.5.1.7 Ensure firewalld drops unnecessary services and ports - Not implemented, requires manual operation. + + ############################################################ + # 3.5.2 Configure nftables. + ############################################################ + + # 3.5.2.1 Ensure nftables is installed. + - id: 20591 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + remediation: "Run the following command to install nftables # yum install nftables" + compliance: + - cis: ["3.5.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:rpm -q nftables -> r:nftables-" + + # 3.5.2.2.1 Ensure firewalld is either not installed or masked with nftables. + - id: 20592 + title: "Ensure firewalld is either not installed or masked with nftables." + description: "firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with support for network/firewall “zones” to assign a level of trust to a network and its associated connections, interfaces or sources. It has support for IPv4, IPv6, Ethernet bridges and also for IPSet firewall settings. There is a separation of the runtime and permanent configuration options." + rationale: "Running both nftables.service and firewalld.service may lead to conflict and unexpected results." + remediation: "Run the following command to remove firewalld # yum remove firewalld OR Run the following command to stop and mask firewalld # systemctl --now mask firewalld" + compliance: + - cis: ["3.5.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: any + rules: + - "c:rpm -q firewalld -> r:^package firewalld is not installed" + - "c:systemctl is-enabled firewalld -> r:masked" + + # 3.5.2.4 Ensure iptables are flushed with nftables. + - id: 20594 + title: "Ensure iptables are flushed with nftables." + description: "nftables is a replacement for iptables, ip6tables, ebtables and arptables" + rationale: "It is possible to mix iptables and nftables. However, this increases complexity and also the chance to introduce errors. For simplicity flush out all iptables rules, and ensure it is not loaded" + remediation: "Run the following commands to flush iptables: For iptables: # iptables -F For ip6tables: # ip6tables -F" + compliance: + - cis: ["3.5.2.4"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'not c:sh -c "iptables -L | egrep -v \"^target|^Chain\"" -> r:^\w+' + - 'not c:sh -c "ip6tables -L | egrep -v \"^target|^Chain\"" -> r:^\w+' + - "c:rpm -q nftables -> r:^nftables-" + + # 3.5.2.5 Ensure an nftables table exists. + - id: 20595 + title: "Ensure an nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example: # nft create table inet filter" + compliance: + - cis: ["3.5.2.5"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:nft list tables -> r:^table" + - "c:rpm -q nftables -> r:^nftables-" + + # 3.5.2.6 Ensure nftables base chains exist. + # 3.5.2.9 Ensure nftables default deny firewall policy. + - id: 20596 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; }" + compliance: + - cis: ["3.5.2.6", "3.5.2.9"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:nft list ruleset -> r:input" + - "c:nft list ruleset -> r:forward" + - "c:nft list ruleset -> r:output" + - "c:rpm -q nftables -> r:nftables-" + + # 3.5.2.7 Ensure nftables loopback traffic is configured - Not implemented, SCA limitation. + # 3.5.2.8 Ensure nftables outbound and established connections are configured - Not implemented, SCA limitation. + # 3.5.2.9 Ensure nftables default deny firewall policy - covered by 20596. + + # 3.5.2.10 Ensure nftables service is enabled. + - id: 20597 + title: "Ensure nftables service is enabled." + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables" + compliance: + - cis: ["3.5.2.10"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:systemctl is-enabled nftables -> r:enabled" + + # 3.5.2.11 Ensure nftables rules are permanent - Not implemented, requires manual operation. + + ############################################################ + # 3.5.3 Configure iptables. + ############################################################ + ############################################################ + # 3.5.3.1 Configure iptables software. + ############################################################ + + # 3.5.3.1.1 Ensure iptables packages are installed. + # 3.5.3.1.2 Ensure nftables is not installed with iptables. + # 3.5.3.1.3 Ensure firewalld is either not installed or masked with iptables. + - id: 20598 + title: "Ensure iptables packages are installed." + description: "iptables is a utility program that allows a system administrator to configure the tables provided by the Linux kernel firewall, implemented as different Netfilter modules, and the chains and rules it stores. Different kernel modules and programs are used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames." + rationale: "A method of configuring and maintaining firewall rules is necessary to configure a Host Based Firewall." + remediation: "Run the following command to install iptables and iptables-services # yum install iptables iptables-services" + compliance: + - cis: ["3.5.3.1.1", "3.5.3.1.2", "3.5.3.1.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:rpm -q firewalld -> r:^package firewalld is not installed" + - "c:rpm -q nftables -> r:^package nftables is not installed" + - "c:rpm -q iptables -> r:iptables-" + + ############################################################ + # 3.5.3.2 Configure IPv4 iptables. + ############################################################ + + # 3.5.3.2.1 Ensure iptables loopback traffic is configured - Not implemented, requires manual operation. + # 3.5.3.2.2 Ensure iptables outbound and established connections are configured - Not implemented, requires manual operation. + # 3.5.3.2.3 Ensure iptables rules exist for all open ports - Not implemented, SCA limitation. + + # 3.5.3.2.4 Ensure iptables default deny firewall policy. + - id: 20599 + title: "Ensure iptables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP" + compliance: + - cis: ["3.5.3.2.4"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:iptables -L INPUT -> r:policy DROP" + - "c:iptables -L FORWARD -> r:policy DROP" + - "c:iptables -L OUTPUT -> r:policy DROP" + + # 3.5.3.2.5 Ensure iptables rules are saved - Not implemented, requires manual operation. + + # 3.5.3.2.6 Ensure iptables is enabled and running. + - id: 20600 + title: "Ensure iptables is enabled and running." + description: "iptables.service is a utility for configuring and maintaining iptables." + rationale: "iptables.service will load the iptables rules saved in the file /etc/sysconfig/iptables at boot, otherwise the iptables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start iptables: # systemctl --now enable iptables" + compliance: + - cis: ["3.5.3.2.6"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:systemctl is-enabled iptables -> r:enabled" + - "c:systemctl status iptables -> r:active && r:running|exited" + + ############################################################ + # 3.5.3.3 Configure IPv6 iptables. + ############################################################ + + # 3.5.3.3.1 Ensure IPv6 loopback traffic is configured. + - id: 20601 + title: "Ensure IPv6 loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic tothe loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure" + remediation: "Run the following commands to implement the loopback rules:# ip6tables -A INPUT -i lo -j ACCEPT# ip6tables -A OUTPUT -o lo -j ACCEPT# ip6tables -A INPUT -s::1 -j DROP" + compliance: + - cis: ["3.5.3.3.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:ip6tables -L INPUT -v -n -> r:ACCEPT && r:lo" + - "c:ip6tables -L INPUT -v -n -> r:DROP" + - "c:ip6tables -L OUTPUT -v -n -> r:ACCEPT && r:lo" + + # 3.5.3.3.2 Ensure ip6tables outbound and established connections are configured - Not implemented, requires manual operation. + # 3.5.3.3.3 Ensure ip6tables firewall rules exist for all open ports - Not implemented, requires manual operation. + + # 3.5.3.3.4 Ensure ip6tables default deny firewall policy. + - id: 20602 + title: "Ensure ip6tables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP; # ip6tables -P OUTPUT DROP; # ip6tables -PFORWARD DROP" + compliance: + - cis: ["3.5.3.3.4"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:ip6tables -L INPUT -> r:policy DROP" + - "c:ip6tables -L FORWARD -> r:policy DROP" + - "c:ip6tables -L OUTPUT -> r:policy DROP" + + # 3.5.3.3.5 Ensure ip6tables rules are saved - Not implemented, requires manual operation. + + #3.5.3.3.6 Ensure ip6tables is enabled and running + - id: 20603 + title: "Ensure ip6tables is enabled and running." + description: "ip6tables.service is a utility for configuring and maintaining ip6tables." + rationale: "ip6tables.service will load the iptables rules saved in the file /etc/sysconfig/ip6tables at boot, otherwise the ip6tables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start iptables: # systemctl --now enable ip6tables" + compliance: + - cis: ["3.5.3.3.6"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:systemctl is-enabled ip6tables -> r:enabled" + - "c:systemctl status ip6tables -> r:active && r:running|exited" + + ############################################################ + # 4 Logging and Auditing. + ############################################################ + ############################################################ + # 4.1 Configure System Accounting (auditd). + ############################################################ + ############################################################ + # 4.1.1 Ensure auditing is enabled. + ############################################################ + + # 4.1.1.1 Ensure auditd is installed. + - id: 20604 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # yum install audit audit-libs" + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:rpm -q audit -> r:^audit-" + - "c:rpm -q audit-libs -> r:^audit-libs-" + + # 4.1.1.2 Ensure auditd service is enabled and running. + - id: 20605 + title: "Ensure auditd service is enabled and running." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl enable auditd" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1", "10.7"] + - tsc: ["CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:enabled" + - "c:systemctl status auditd -> r:active && r:running" + + # 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled. + - id: 20606 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected. Note: This recommendation is designed around the grub2 bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + remediation: 'Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX="audit=1" . Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg' + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.2.6", "10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*\t*linux && r:audit=1' + + ############################################################ + # 4.1.2 Configure Data Retention + ############################################################ + + # 4.1.2.1 Ensure audit log storage size is configured. + - id: 20607 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = " + compliance: + - cis: ["4.1.2.1"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file\s*=\s*\d+' + + # 4.1.2.2 Ensure audit logs are not automatically deleted. + - id: 20608 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.2.2"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file_action\s*=\s*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full. + - id: 20609 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.2.3"] + - cis_csc: [6.4"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt' + + # 4.1.2.4 Ensure audit_backlog_limit is sufficient - Not implmented, SCA limitation. + + # 4.1.3 Ensure events that modify date and time information are collected. + - id: 20610 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier "time-change".' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change, -a always,exit -F arch=b32 -S clock_settime -k time-change, -w /etc/localtime -p wa -k time-change. For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change, -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k timechange, -a always,exit -F arch=b64 -S clock_settime -k time-change, -a always,exit -F arch=b32 -S clock_settime -k time-change, -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.3"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/localtime && r:-p wa && r:-k time-change' + + # 4.1.4 Ensure events that modify user/group information are collected. + - id: 20611 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the group, passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/rules.d/audit.rules file: -w /etc/group -p wa -k identity, -w /etc/passwd -p wa -k identity, -w /etc/gshadow -p wa -k identity, -w /etc/shadow -p wa -k identity, -w /etc/security/opasswd -p wa -k identity" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/group && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/passwd && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/gshadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/shadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/security/opasswd && r:-p wa && r:-k identity' + + # 4.1.5 Ensure events that modify the system's network environment are collected. + - id: 20612 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre-login), /etc/hosts (file containing host names and associated IP addresses), /etc/sysconfig/network file and /etc/sysconfig/network-scripts/ directory (containing network interface scripts and configurations)." + rationale: 'Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network and /etc/sysconfig/network-scripts/ is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier "system-locale."' + remediation: "For 32 bit systems add the following lines to the /etc/audit/rules.d/audit.rules file: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale, -w /etc/issue -p wa -k system-locale, -w /etc/issue.net -p wa -k system-locale, -w /etc/hosts -p wa -k system-locale, -w /etc/sysconfig/network -p wa -k system-locale, -w /etc/sysconfig/network-scripts/ -p wa -k system-locale. For 64 bit systems add the following lines to the /etc/audit/rules.d/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale, -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale, -w /etc/issue -p wa -k system-locale, -w /etc/issue.net -p wa -k system-locale, -w /etc/hosts -p wa -k system-locale, -w /etc/sysconfig/network -p wa -k system-locale, -w /etc/sysconfig/network-scripts/ -p wa -k system-locale" + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/issue && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/issue.net && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/hosts && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sysconfig/network && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sysconfig/network-scripts/ && r:-p wa && r:-k system-locale' + + # 4.1.6 Ensure events that modify the system's Mandatory Access Controls are collected. + - id: 20613 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux/ and /usr/share/selinux/ directories." + rationale: "Changes to files in the /etc/selinux/ and /usr/share/selinux/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Add the following lines to the /etc/audit/rules.d/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy, -w /usr/share/selinux/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.6"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /etc/selinux/ && r:-p wa && r:-k MAC-policy" + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:-w /usr/share/selinux/ && r:-p wa && r:-k MAC-policy' + + # 4.1.7 Ensure login and logout events are collected. + - id: 20614 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The /var/run/faillock/ directory maintains records of login failures via the pam_faillock module. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/rules.d/audit.rules file: -w /var/log/lastlog -p wa -k logins, -w /var/run/faillock/ -p wa -k logins" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /var/log/lastlog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:-w /var/run/faillock/ && r:-p wa && r:-k logins" + + # 4.1.8 Ensure session initiation information is collected. + - id: 20615 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier "session." The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier "logins.".' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/rules.d/audit.rules file: -w /var/run/utmp -p wa -k session, -w /var/log/wtmp -p wa -k logins, -w /var/log/btmp -p wa -k logins" + compliance: + - cis: ["4.1.8"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.3"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /var/run/utmp && r:-p wa && r:-k session" + - "f:/etc/audit/audit.rules -> r:-w /var/log/wtmp && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:-w /var/log/btmp && r:-p wa && r:-k logins" + + # 4.1.9 Ensure discretionary access control permission modification events are collected. + - id: 20616 + title: "Ensure discretionary access control permission modification events are collected." + description: 'Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod, fchmod and fchmodat system calls affect the permissions associated with a file. The chown, fchown, fchownat and lchown system calls affect owner and group attributes on a file. The setxattr, lsetxattr, fsetxattr (set extended file attributes) and removexattr, lremovexattr, fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier "perm_mod."' + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 32 bit systems add the following lines to the /etc/audit/rules.d/audit.rules file: -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod For 64 bit systems add the following lines to the /etc/audit/rules.d/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lrem . Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.9"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + + # 4.1.10 Ensure unsuccessful unauthorized file access attempts are collected. + - id: 20617 + title: "Ensure unsuccessful unauthorized file access attempts are collected." + description: 'Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open, openat ) and truncation ( truncate, ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier "access."' + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/rules.d/audit.rules file: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access For 64 bit systems add the following lines to the /etc/audit/rules.d/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access . Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.10"] + - cis_csc: ["14.9"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access" + + # 4.1.11 Ensure use of privileged commands is collected - Not implemented, SCA limitation. + + # 4.1.12 Ensure successful file system mounts are collected. + - id: 20618 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems add the following lines to the /etc/audit/rules.d/audit.rules file: -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts For 64 bit systems add the following lines to the /etc/audit/rules.d/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts . Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.12"] + - cis_csc: ["6.3"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts" + + # 4.1.13 Ensure file deletion events by users are collected. + - id: 20619 + title: "Ensure file deletion events by users are collected." + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for ollowing system calls and tags them with the identifier "delete": unlink -remove a file unlinkat - remove a file attribute), rename (rename a file and renameat - rename a file attribute.' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems add the following lines to the /etc/audit/rules.d/audit.rules file: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete For 64 bit systems add the following lines to the /etc/audit/rules.d/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete . Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["6.3"] + - pci_dss: ["10.5.5"] + - tsc: ["PI1.4", "PI1.5", "CC7.1", "CC7.2", "CC7.3", "CC8.1"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete" + + # 4.1.14 Ensure changes to system administration scope (sudoers) is collected. + - id: 20620 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: "Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers or a file in the /etc/sudoers.d directory will be written to when the file or its attributes have changed." + rationale: "Changes in the /etc/sudoers file, or a file in the /etc/sudoers.d/ directory can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following lines to the /etc/audit/rules.d/audit.rules file: -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d/ -p wa -k scope . Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.14"] + - cis_csc: ["4.8", "6.3"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /etc/sudoers && r:-p wa && r:-k scope" + - "f:/etc/audit/audit.rules -> r:-w /etc/sudoers.d/ && r:-p wa && r:-k scope" + + # 4.1.15 Ensure system administrator command executions (sudo) are collected. + - id: 20621 + title: "Ensure system administrator command executions (sudo) are collected." + description: "sudo provides users with temporary elevated privileges to perform operations. Monitor the administrator with temporary elevated privileges and the operation(s) they performed." + rationale: "creating an audit log of administrators with temporary elevated privileges and the operation(s) they performed is essential to reporting. Administrators will want to correlate the events written to the audit trail with the records written to sudo logfile to verify if unauthorized commands have been executed." + remediation: "Add the following lines to the /etc/audit/rules.d/audit.rules file: -a exit,always -F arch=b32 -C euid!=uid -F euid=0 -F auid>=1000 -F auid!=4294967295 -S execve -k actions and -a always,exit -F arch=b64 -C euid!=uid -F euid=0 -F auid>=1000 -F auid!=4294967295 -S execve -k actions ." + compliance: + - cis: ["4.1.15"] + - cis_csc: ["4.9", "6.3"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14", "AC.6", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /var/log/sudo.log && r:-p wa && r:-k actions" + + # 4.1.16 Ensure kernel module loading and unloading is collected. + - id: 20622 + title: "Ensure kernel module loading and unloading is collected." + description: 'Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of "modules".' + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "For 32 bit systems add the following lines to the /etc/audit/rules.d/audit.rules file: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b32 -S init_module -S delete_module -k modules For 64 bit systems add the following lines to the /etc/audit/rules.d/audit.rules file: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b64 -S init_module -S delete_module -k modules " + compliance: + - cis: ["4.1.16"] + - cis_csc: ["6.3"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /sbin/insmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:-w /sbin/rmmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:-w /sbin/modprobe && r:-p x && r:-k modules" + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b\d\d && r:-S init_module && r:-S delete_module && r:-k modules' + + # 4.1.17 Ensure the audit configuration is immutable. + - id: 20623 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl . Setting the flag " -e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following line to the end of the /etc/audit/rules.d/audit.rules file: -e 2" + compliance: + - cis: ["4.1.17"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-e 2" + + ############################################################ + # 4.2 Configure Logging. + ############################################################ + ############################################################ + # 4.2.1 Configure rsyslog. + ############################################################ + + # 4.2.1.1 Ensure rsyslog is installed. + # 4.2.1.2 Ensure rsyslog Service is enabled. + - id: 20624 + title: "Ensure rsyslog Service is enabled and running." + description: "rsyslogneeds to be enabled and running to perform logging" + rationale: "If the rsyslog service is not activated the system may default to the syslogd service or lackblogging instead." + remediation: "Run the following command to enable rsyslog: # systemctl enable rsyslog" + compliance: + - cis: ["4.2.1.2", "4.2.1.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:rpm -q rsyslog -> r:rsyslog-" + - "c:systemctl is-enabled rsyslog -> r:^enabled$" + - "c:systemctl status rsyslog -> r:active && r:running" + + # 4.2.1.3 Ensure rsyslog default file permissions configured. + - id: 20625 + title: "Ensure rsyslog default file permissions configured." + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + # 4.2.1.4 Ensure logging is configured - Not implemented, requires manual operation. + + # 4.2.1.5 Ensure rsyslog is configured to send logs to a remote log host. + - id: 20626 + title: "Ensure rsyslog is configured to send logs to a remote log host." + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). *.* @@loghost.example.com Run the following command to reload the rsyslogd configuration: # systemctl restart rsyslog" + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:grep *.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf -> !r:# && r:*.* @@\.+' + + # 4.2.1.6 Ensure remote rsyslog messages are only accepted on designated log hosts - Not implemented, requires manual operation. + + ############################################################ + # 4.2.2 Configure journald. + ############################################################ + + # 4.2.2.1 Ensure journald is configured to send logs to rsyslog. + - id: 20627 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the rsyslog service provides a consistent means of log collection and export." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/systemd/journald.conf -> r:ForwardToSyslog=yes" + + # 4.2.2.2 Ensure journald is configured to compress large log files. + - id: 20628 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes" + compliance: + - cis: ["4.2.2.2"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/systemd/journald.conf -> r:Compress=yes" + + # 4.2.2.3 Ensure journald is configured to write logfiles to persistent disk. + - id: 20629 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/systemd/journald.conf -> r:Storage=persistent" + + # 4.2.3 Ensure logrotate is configured - Not implemented, requires manual operation. + # 4.2.4 Ensure permissions on all logfiles are configured - Not implemented, requires manual operation. + + #################################################### + # 5 Access, Authentication and Authorization. + #################################################### + #################################################### + # 5.1 Configure time-based job schedulers. + #################################################### + + # 5.1.1 Ensure cron daemon is enabled(Automated). + - id: 20630 + title: "Ensure cron daemon is enabled and running." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron : # systemctl enable crond " + compliance: + - cis: ["5.1.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled crond -> r:enabled" + - "c:systemctl status crond -> r:active && r:running" + + # 5.1.2 Ensure permissions on /etc/crontab are configured. + - id: 20631 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab; # chmod og-rwx /etc/crontab " + compliance: + - cis: ["5.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access: \(0\w00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured + - id: 20633 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly; # chmod og-rwx /etc/cron.hourly; " + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured + - id: 20634 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily; # chmod og-rwx /etc/cron.daily;" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured + - id: 20635 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly; # chmod og-rwx /etc/cron.weekly;" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured + - id: 20636 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly; # chmod og-rwx /etc/cron.monthly;" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access: \(0\w00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured + - id: 20637 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d/directory contains system cronjobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab, but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d; # chmod og-rwx /etc/cron.d;" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.8 Ensure cron is restricted to authorized users. + - id: 20638 + title: "Ensure at/cron is restricted to authorized users." + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.alloware allowed to use at and cron." + rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allowfile to control who can run cronjobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8", "5.1.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:stat -L /etc/cron.deny -> r:No such file or directory$" + - "c:stat -L /etc/at.deny -> r:No such file or directory$" + - 'c:stat -L /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat -L /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + ############################################################ + # 5.2 Configure sudo. + ############################################################ + + # 5.2.1 Ensure sudo is installed. + - id: 20639 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo. # yum install sudo" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:rpm -q sudo -> r:sudo-" + + # 5.2.2 Ensure sudo commands use pty. + - id: 20640 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo-pty." + rationale: "Attackers can run a malicious program using sudo, which would again fork a background process that remains even when the main program has finished executing. This can be mitigated by configuring sudo to run other commands only from a pseudo-pty, whether I/O logging is turned on or not." + remediation: "Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults use_pty" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s+use_pty' + - 'd:/etc/sudoers.d -> r:\. -> r:^\s*Defaults\s+use_pty' + + # 5.2.3 Ensure sudo log file exists. + - id: 20641 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file." + rationale: "A sudo log file simplifies auditing of sudo commands." + remediation: 'edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile=""' + compliance: + - cis: ["5.2.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^Defaults logfile="' + - 'd:/etc/sudoers.d -> r:\. -> r:^Defaults\s+logfile="' + + ############################################################ + # 5.3 Configure SSH Server. + ############################################################ + + # 5.3.1 Ensure permissions on /etc/ssh/sshd_config are configured. + - id: 20642 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: chown root:root /etc/ssh/sshd_config and chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.3.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access:\s*\t*\(0600/-rw-------\)\s*\t*Uid:\s*\t*\(\t*\s*0/\t*\s*root\)\s*\t*Gid:\s*\t*\(\t*\s*0/\t*\s*root\)$' + + # 5.3.2 Ensure permissions on SSH private host key files are configured. + - id: 20643 + title: "Ensure permissions on SSH private host key files are configured." + description: "An SSH private key is one of two files used in SSH public key authentication. In this authentication method, The possession of the private key is proof of identity. Only a private key that corresponds to a public key will be able to authenticate successfully. The private keys need to be stored and handled carefully, and no copies of the private key should be distributed." + rationale: "If an unauthorized user obtains the private SSH host key file, the host could be impersonated" + remediation: "Run the following commands to set ownership and permissions on the private SSH host key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chmod 0640 {} \\; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chown root:root {} \\;" + compliance: + - cis: ["5.3.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_rsa_key" -exec stat {} \; -> r:^Access:\t*\s*\(0600/-rw-------\)\t*\s*Uid:\t*\s*\(\t*\s*0/\t*\s*root\)\t*\s*Gid:\t*\s*\(\t*\s*0/\t*\s*root\)$' + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_ecdsa_key" -exec stat {} \; -> r:^Access:\t*\s*\(0600/-rw-------\)\t*\s*Uid:\t*\s*\(\t*\s*0/\t*\s*root\)\t*\s*Gid:\t*\s*\(\t*\s*0/\t*\s*root\)$' + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_ed25519_key" -exec stat {} \; -> r:^Access:\t*\s*\(0600/-rw-------\)\t*\s*Uid:\t*\s*\(\t*\s*0/\t*\s*root\)\t*\s*Gid:\t*\s*\(\t*\s*0/\t*\s*root\)$' + + # 5.3.3 Ensure permissions on SSH public host key files are configured. + - id: 20644 + title: "Ensure permissions on SSH private host key files are configured." + description: "An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully." + rationale: "If a public host key file is modified by an unauthorized user, the SSH service may be compromised." + remediation: "Run the following commands to set permissions and ownership on the SSH host public key: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chmod u-x,go-wx {} \\; #find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chown root:root {} \\;" + compliance: + - cis: ["5.3.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_rsa_key.pub" -exec stat {} \; -> r:^Access:\s*\(0644/-rw-r--r--\)\t*\s*Uid:\t*\s*\(\t*\s*0/\t*\s*root\)\t*\s*Gid:\t*\s*\(\t*\s*0/\t*\s*root\)$' + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_ecdsa_key.pub" -exec stat {} \; -> r:^Access:\s*\(0644/-rw-r--r--\)\t*\s*Uid:\t*\s*\(\t*\s*0/\t*\s*root\)\t*\s*Gid:\t*\s*\(\t*\s*0/\t*\s*root\)$' + - 'c:find /etc/ssh -xdev -type f -name "ssh_host_ed25519_key.pub" -exec stat {} \; -> r:^Access:\s*\(0644/-rw-r--r--\)\t*\s*Uid:\t*\s*\(\t*\s*0/\t*\s*root\)\t*\s*Gid:\t*\s*\(\t*\s*0/\t*\s*root\)$' + + # 5.3.4 Ensure SSH access is limited - Not implemented, requires manual operation. + + # 5.3.5 Ensure SSH LogLevel is appropriate. + - id: 20645 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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.VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + compliance: + - cis: ["5.3.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'f:$sshd_file -> r:^# && r:LogLevel\s*\t*INFO' + - 'f:$sshd_file -> r:^# && r:LogLevel\s*\t*VERBOSE' + + # 5.3.6 Ensure SSH X11 forwarding is disabled. + - id: 20646 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.3.6"] + - pci_dss: ["9.2"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*X11Forwarding\s*\t*no' + + # 5.3.7 Ensure SSH MaxAuthTries is set to 4 or less. + - id: 20647 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.3.7"] + - cis_csc: ["16.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'f:$sshd_file -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.3.8 Ensure SSH IgnoreRhosts is enabled. + - id: 20648 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.3.8"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:IgnoreRhosts\s*\t*yes' + + # 5.3.9 Ensure SSH HostbasedAuthentication is disabled. + - id: 20649 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.3.9"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:HostbasedAuthentication\s*\t*no' + + # 5.3.10 Ensure SSH root login is disabled. + - id: 20650 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.3.10"] + - cis_csc: ["4.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitRootLogin\s*\t*no' + + # 5.3.11 Ensure SSH PermitEmptyPasswords is disabled. + - id: 20651 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.3.11"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitEmptyPasswords\s*\t*no' + + # 5.3.12 Ensure SSH PermitUserEnvironment is disabled. + - id: 20652 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.3.12"] + - cis_csc: ["5.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*PermitUserEnvironment\s*\t*no' + + # 5.3.13 Ensure only strong Ciphers are used. + - id: 20653 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "This variable limits the ciphers that SSH can use during communication." + rationale: "Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised.: The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a 'Sweet32' attack; The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involvingLSB values, aka the 'Bar Mitzvah' issue; The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session; Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors; The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher is used, does not properly initialize memory for a MAC context data structure, which allows remote authenticated users to bypass intended ForceCommand and login-shell restrictions via packet data that provides a crafted callback address" + remediation: "Edit the /etc/ssh/sshd_configfile add/modify the Ciphersline to contain a comma separated list of the site approved ciphersExample:Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr" + compliance: + - cis: ["5.3.13"] + - cis_csc: ["14.4"] + - pci_dss: ["12.3.8"] + condition: none + rules: + - 'c:sh -c "sshd -T | grep ciphers" -> r:3des-cbc|aes192-cbc|aes256-cbc|arcfour|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se' + + # 5.3.14 Ensure only strong MAC algorithms are used. + - id: 20654 + title: "Ensure only strong MAC algorithms are used." + description: "This variable limits the types of MAC algorithms that SSH can use during communication." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information" + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example:MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256" + compliance: + - cis: ["5.3.14"] + - cis_csc: ["14.4", "16.5"] + - pci_dss: ["12.3.8"] + condition: none + rules: + - 'c:sh -c "sshd -T | grep macs" -> r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com' + + # 5.3.15 Ensure only strong Key Exchange algorithms are used. + - id: 20655 + title: "Ensure that strong Key Exchange algorithms are used." + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received" + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks" + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms.Example:'KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256'" + compliance: + - cis: ["5.3.15"] + - cis_csc: ["14.4"] + - pci_dss: ["12.3.8"] + condition: none + rules: + - 'c:sh -c "sshd -T | grep kexalgorithms" -> r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1' + + # 5.3.16 Ensure SSH Idle Timeout Interval is configured. + - id: 20656 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 and ClientAliveCountMax 0" + compliance: + - cis: ["5.3.16"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare <= 300' + - 'f:$sshd_file -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare <= 3' + - 'f:$sshd_file -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare >= 1' + - 'f:$sshd_file -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare >= 0' + + # 5.3.17 Ensure SSH LoginGraceTime is set to one minute or less. + - id: 20657 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.3.17"] + - cis_csc: ["5.1"] + - pci_dss: ["4.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60' + + # 5.3.18 Ensure SSH warning banner is configured. + - id: 20658 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.3.18"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*Banner\s*\t*/etc/issue.net' + + # 5.3.19 Ensure SSH PAM is enabled. + - id: 20659 + title: "Ensure SSH PAM is enabled." + description: "UsePAM Enables the Pluggable Authentication Module interface. If set to “yes” this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types." + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes" + compliance: + - cis: ["5.3.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:$sshd_file -> r:UsePAM yes" + + # 5.3.20 Ensure SSH AllowTcpForwarding is disabled. + - id: 20660 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and backdoors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no" + compliance: + - cis: ["5.3.20"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:$sshd_file -> r:AllowTcpForwarding no" + + # 5.3.21 Ensure SSH MaxStartups is configured. Not implemented, requires manual operation. + - id: 20661 + title: "Ensure SSH MaxStartups is configured. Not implemented, requires manual operation." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: maxstartups 10:30:60" + compliance: + - cis: ["5.3.21"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:maxstartups \d+:\d+:\d+' + + # 5.3.22 Ensure SSH MaxSessions is limited. + - id: 20662 + title: "Ensure SSH MaxSessions is limited." + description: "The MaxSessions parameter Specifies the maximum number of open sessions permitted per network connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10" + compliance: + - cis: ["5.3.22"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:MaxSessions \d+' + + ############################################################ + # 5.4 Configure PAM. + ############################################################ + + # 5.4.1 Ensure password creation requirements are configured. + - id: 20663 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy: minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy: minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy:password requisite pam_pwquality.so try_first_pass retry=3" + compliance: + - cis: ["5.4.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s*\t*=\s*\t*(\d+) compare >= 14' + + # 5.4.2 Ensure lockout for failed password attempts is configured - Not implemented, requires manual operation. + + # 5.4.3 Ensure password hashing algorithm is SHA-512. + - id: 20664 + title: "Ensure password hashing algorithm is SHA-512." + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these changes only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the sha512 option for pam_unix.so as shown: password sufficient pam_unix.so sha512" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["16.4"] + - pci_dss: ["3.6.1", "8.2.1"] + - tsc: ["CC6.1", "CC6.7"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + - 'f:/etc/pam.d/system-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + + # 5.4.4 Ensure password reuse is limited. + - id: 20665 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these changes only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the remember option and conform to site policy as shown: password sufficient pam_unix.so remember=5 or password required pam_pwhistory.so remember=5" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + + ############################################################ + # 5.5 User Accounts and Environment. + ############################################################ + ############################################################ + # 5.5.1 Set Shadow Password Suite Parameters. + ############################################################ + + # 5.5.1.1 Ensure password expiration is 365 days or less. + - id: 20666 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 90 and modify user parameters for all users with a password set to match: chage --maxdays 90 " + compliance: + - cis: ["5.5.1.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + + # 5.5.1.2 Ensure minimum days between password changes is configured. + - id: 20667 + title: "Ensure minimum days between password changes is 7 or more." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7 and modify user parameters for all users with a password set to match: chage --mindays 7 " + compliance: + - cis: ["5.5.1.2"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + + # 5.5.1.3 Ensure password expiration warning days is 7 or more. + - id: 20668 + title: "Ensure minimum days between password changes is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 and modify user parameters for all users with a password set to match: chage --warndays 7 " + compliance: + - cis: ["5.5.1.3"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + # 5.5.1.4 Ensure inactive password lock is 30 days or less. + - id: 20669 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: useradd -D -f 30 and modify user parameters for all users with a password set to match: chage --inactive 30 " + compliance: + - cis: ["5.5.1.4"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*(\d+) compare <= 30' + + # 5.5.1.5 Ensure all users last password change date is in the past - Not implemented, requires manual operation + # 5.5.2 Ensure system accounts are secured - Not implemented, requires manual operation + + # 5.5.3 Ensure default group for the root account is GID 0. + - id: 20670 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: usermod -g 0 root" + compliance: + - cis: ["5.5.3"] + - cis_csc: ["4.3"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\w:\w:0' + + # 5.5.4 Ensure default user shell timeout is configured. + - id: 20671 + title: " Ensure default user shell timeout is 900 seconds or less." + description: "TMOUT is an environmental setting that determines the timeout of a shell in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening" + remediation: "Edit the /etc/bashrc and /etc/profile files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.5.4"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + # 5.5.5 Ensure default user umask is configured. + - id: 20672 + title: "Ensure default user umask is 027 or more restrictive." + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umaskcommand into the standard shell configuration files ( .profile, .bashrc, etc.) in their home directories." + rationale: "Setting a very secure default value for umaskensures that users make a conscious choice about their file permissions. A default umasksetting of 077causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umaskof 022would make files readable by every user on the system." + remediation: "Edit the /etc/bashrc, /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.5.5"] + - cis_csc: ["13"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/bashrc -> !r:^\s*\t*# && n:umask 0(\d) compare <= 2' + - 'f:/etc/bashrc -> !r:^\s*\t*# && n:umask 0\d(\d) compare <= 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && n:umask 0\d(\d) compare <= 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask 0(\d) compare <= 2' + + # 5.6 Ensure root login is restricted to system console - Not implemented, requires manual operation + + # 5.7 Ensure access to the su command is restricted. + - id: 20673 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the wheel group to execute su ." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid" + compliance: + - cis: ["5.7"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/pam.d/su -> r:^auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + ############################################################ + # 6 System Maintenance. + ############################################################ + ############################################################ + # 6.1 System File Permissions. + ############################################################ + + # 6.1.1 Audit system file permissions - Not implemented, requires manual operation. + + # 6.1.2 Ensure permissions on /etc/passwd are configured. + - id: 20674 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod u-x,g-wx,o-wx /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.3 Ensure permissions on /etc/passwd- are configured + - id: 20675 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd- # chmod u-x,g-wx,o-wx /etc/passwd-" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/passwd- -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.4 Ensure permissions on /etc/shadow are configured. + - id: 20676 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following command to set permissions on /etc/shadow: # chown root:root /etc/shadow # chmod 000 /etc/shadow" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:stat -L /etc/shadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.5 Ensure permissions on /etc/shadow- are configured. + - id: 20677 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow- file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow- file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following command to set permissions on /etc/shadow-: # chown root:root /etc/shadow- # chmod 000 /etc/shadow-" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:stat -L /etc/shadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.6 Ensure permissions on /etc/gshadow- are configured. + - id: 20678 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow- file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow- file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following command to set permissions on /etc/gshadow-: # chown root:root /etc/gshadow- # chmod 000 /etc/gshadow-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:stat -L /etc/gshadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.7 Ensure permissions on /etc/gshadow are configured. + - id: 20679 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following command to set permissions on /etc/gshadow: # chown root:root /etc/gshadow # chmod 000 /etc/gshadow" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:stat -L /etc/gshadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.8 Ensure permissions on /etc/group are configured. + - id: 20680 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod u-x,g-wx,o-wx /etc/group" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'c:stat -L /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat -L /etc/group -> r:Access:\s*\(0600/-rw-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.9 Ensure permissions on /etc/group-are configured. + - id: 20681 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'c:stat -L /etc/group- -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat -L /etc/group- -> r:Access:\s*\(0600/-rw-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.10 Ensure no world writable files exist - Not implemented, requires manual operation. + # 6.1.11 Ensure no unowned files or directories exist - Not implemented, requires manual operation. + # 6.1.12 Ensure no ungrouped files or directories exist - Not implemented, requires manual operation. + # 6.1.13 Audit SUID executables - Not implemented, requires manual operation. + # 6.1.14 Audit SGID executables - Not implemented, requires manual operation. + + ############################################################ + # 6.2 User and Group Settings. + ############################################################ + + # 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords - Not implemented, requires manual operation. + + # 6.2.2 Ensure /etc/shadow password fields are not empty. + - id: 20682 + title: "Ensure password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: passwd -l || Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + + # 6.2.3 Ensure all groups in /etc/passwd exist in /etc/group - Not implemented, requires manual operation. + + # 6.2.4 Ensure shadow group is empty. + - id: 20683 + title: "Ensure shadow group is empty." + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group" + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily runa password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove any legacy '+' entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/etc/shadow -> r:^shadow:\.+:\.+:\.+:\.+' + + # 6.2.5 Ensure no duplicate user names exist - Not implemented, requires manual operation. + # 6.2.6 Ensure no duplicate group names exist - Not implemented, requires manual operation. + # 6.2.7 Ensure no duplicate UIDs exist - Not implemented, requires manual operation. + # 6.2.8 Ensure no duplicate GIDs exist - Not implemented, requires manual operation. + + # 6.2.9 Ensure root is the only UID 0 account. + - id: 20684 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.9"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^\s*\t*root: && r:^\w+:\w+:0:' +# 6.2.10 Ensure root PATH Integrity - Not implemented, requires manual operation. +# 6.2.11 Ensure all users' home directories exist - Not implemented, requires manual operation. +# 6.2.12 Ensure users own their home directories - Not implemented, requires manual operation. +# 6.2.13 Ensure users' home directories permissions are 750 or more restrictive - Not implemented, requires manual operation. +# 6.2.14 Ensure users' dot files are not group or world writable - Not implemented, requires manual operation. +# 6.2.15 Ensure no users have .forward files - Not implemented, requires manual operation. +# 6.2.16 Ensure no users have .netrc files - Not implemented, requires manual operation. +# 6.2.17 Ensure no users have .rhosts files - Not implemented, requires manual operation. diff --git a/etc/ruleset/sca/amazon/cis_amazon_linux_2023.yml b/etc/ruleset/sca/amazon/cis_amazon_linux_2023.yml new file mode 100644 index 0000000000..be7bbf5dfb --- /dev/null +++ b/etc/ruleset/sca/amazon/cis_amazon_linux_2023.yml @@ -0,0 +1,4601 @@ +# Security Configuration Assessment +# CIS Checks for Amazon Linux 2023 +# Copyright (C) 2023, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Amazon Linux 2023 Benchmark v1.0.0 - 06-02-2023 + +policy: + id: "cis_amazon_linux_2023" + file: "cis_amazon_linux_2023.yml" + name: "CIS Benchmark for Amazon Linux 2023 Benchmark v1.0.0." + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Amazon Linux 2023 systems running on x86 and x64 platforms. This document was tested against Amazon Linux 2023." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Amazon Linux platform." + description: "Requirements for running the policy against Amazon Linux 2023." + condition: any + rules: + - "f:/etc/system-release -> r:^Amazon && r:release 2023" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # 1 Initial Setup + # 1.1 Filesystem Configuration. + # 1.1.1 Disable unused filesystems + + # 1.1.1.1 Ensure mounting of squashfs filesystems is disabled. (Automated) + - id: 31000 + title: "Ensure mounting of squashfs filesystems is disabled." + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: 'As Snap packages utilizes squashfs as a compressed filesystem, disabling squashfs will cause Snap packages to fail. Snap application packages of software are self-contained and work across a range of Linux distributions. This is unlike traditional Linux package management approaches, like APT or RPM, which require specifically adapted packages per Linux distribution on an application update and delay therefore application deployment from developers to their software''s end-user. Snaps themselves have no dependency on any external store ("App store"), can be obtained from any source and can be therefore used for upstream software deployment.' + remediation: "Run the following script to disable squashfs: #!/usr/bin/env bash { l_mname=\"squashfs\" # set module name # Check if the module exists on the system if [ -z \"$(modprobe -n -v \"$l_mname\" 2>&1 | grep -Pi -- \"\\h*modprobe:\\h+FATAL:\\h+Module\\h+$l_mname\\h+not\\h+found\\h+in\\h+directory\")\" ]; then # Remediate loadable l_loadable=\"$(modprobe -n -v \"$l_mname\")\" [ \"$(wc -l <<< \"$l_loadable\")\" -gt \"1\" ] && l_loadable=\"$(grep -P -- \"(^\\h*install|\b$l_mname)\b\" <<< \"$l_loadable\")\" if ! grep -Pq -- '^\\h*install \/bin\/(true|false)' <<< \"$l_loadable\"; then echo -e \" - setting module: \"$l_mname\" to be not loadable\" echo -e \"install $l_mname \/bin\/false\" >> /etc/modprobe.d/\"$l_mname\".conf fi # Remediate loaded if lsmod | grep \"$l_mname\" > /dev/null 2>&1; then echo -e \" - unloading module \"$l_mname\"\" modprobe -r \"$l_mname\" fi # Remediate deny list if ! modprobe --showconfig | grep -Pq -- \"^\\h*blacklist\\h+$l_mname\b\"; then echo -e \" - deny listing \"$l_mname\"\" echo -e \"blacklist $l_mname\" >> /etc/modprobe.d/ $l_mname\".conf fi else echo -e \" - Nothing to remediate\\n - Module \"$l_mname\" doesn't exist on the system\" fi}." + compliance: + - cis: ["1.1.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1005"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1050"] + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/false|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + - 'd:/etc/modprobe.d -> r:\.*.conf -> r:blacklist\t*\s*squashfs' + + # 1.1.1.2 Ensure mounting of udf filesystems is disabled. (Automated) + - id: 31001 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: "Microsoft Azure requires the usage of udf. udf should not be disabled on systems run on Microsoft Azure." + remediation: "Run the following script to disable the udf filesystem: #!/usr/bin/env bash { l_mname=\"udf\" # set module name # Check if the module exists on the system if [ -z \"$(modprobe -n -v \"$l_mname\" 2>&1 | grep -Pi -- \"\\h*modprobe:\\h+FATAL:\\h +Module\\h+$l_mname\\h+not\\h+found\\h+in\\h+directory\")\" ]; then \\# Remediate loadable l_loadable=\"$(modprobe -n -v \"$l_mname\")\" [ \"$(wc -l <<< \"$l_loadable\")\" -gt \"1\" ] && l_loadable=\"$(grep -P -- \"(^\\h*install|\b$l_mname)\b\" <<< \"$l_loadable\")\" if ! grep -Pq -- '^\\h*install \/bin\/(true|false)' <<< \"$l_loadable\"; then echo -e \" - setting module: \"$l_mname\" to be not loadable\" echo -e \"install $l_mname /bin/false\" >> \/etc\/modprobe.d\/\"$l_mname\".conf fi \\# Remediate loaded if lsmod | grep \"$l_mname\" > \/dev\/null 2>&1; then echo -e \" - unloading module \"$l_mname\"\" modprobe -r \"$l_mname\" fi \\# Remediate deny list if ! modprobe --showconfig | grep -Pq -- \"^\\h*blacklist\\h+$l_mname\b\"; then echo -e \" - deny listing \"$l_mname\"\" echo -e \"blacklist $l_mname\" >> \/etc/modprobe.d\/\"$l_mname\".conf fi else echo -e \" - Nothing to remediate\\n - Module \"$l_mname\" doesn't exist on the system\" fi }." + compliance: + - cis: ["1.1.1.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1005"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1050"] + condition: all + rules: + - "c:modprobe -n -v udf -> r:install /bin/false|Module udf not found" + - "not c:lsmod -> r:udf" + - 'd:/etc/modprobe.d -> r:\.*.conf -> r:blacklist\t*\s*udf' + + # 1.1.2.1 Ensure /tmp is a separate partition. (Automated) + - id: 31002 + title: "Ensure /tmp is a separate partition." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "By design files saved to /tmp should have no expectation of surviving a reboot of the system. tmpfs is ram based and all files stored to tmpfs will be lost when the system is rebooted. If files need to be persistent through a reboot, they should be saved to /var/tmp not /tmp. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a configuration where /tmp is not a separate file system it will essentially have the whole disk available, as the default installation only creates a single / partition. On the other hand, a RAM-based /tmp (as with tmpfs) will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily. Another alternative is to create a dedicated partition for /tmp from a separate volume or disk. One of the downsides of a disk-based dedicated partition is that it will be slower than tmpfs which is RAM-based." + remediation: "First ensure that systemd is correctly configured to ensure that /tmp will be mounted at boot time. # systemctl unmask tmp.mount For specific configuration requirements of the /tmp mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 0 Example of using a volume or disk with specific mount options. The source location of the volume or disk will vary depending on your environment. /tmp defaults,nodev,nosuid,noexec 0 0." + references: + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + - https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html + compliance: + - cis: ["1.1.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:\s*/tmp\s' + - "c:systemctl is-enabled tmp.mount -> r:static|generated" + + # 1.1.2.2 Ensure nodev option set on /tmp partition. (Automated) + - id: 31003 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nodev" + + # 1.1.2.3 Ensure noexec option set on /tmp partition. (Automated) + - id: 31004 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:noexec" + + # 1.1.2.4 Ensure nosuid option set on /tmp partition. (Automated) + - id: 31005 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nosuid" + + # 1.1.3.1 Ensure separate partition exists for /var. (Automated) + - id: 31006 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "The reasoning for mounting /var on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["MP-2", "AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0006"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:\s*/var\s' + + # 1.1.3.2 Ensure nodev option set on /var partition. (Automated) + - id: 31007 + title: "Ensure nodev option set on /var partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:nodev" + + # 1.1.3.3 Ensure nosuid option set on /var partition. (Automated) + - id: 31008 + title: "Ensure nosuid option set on /var partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:nosuid" + + # 1.1.4.1 Ensure separate partition exists for /var/tmp. (Automated) + - id: 31009 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications. Temporary files residing in /var/tmp are to be preserved between reboots." + rationale: "The reasoning for mounting /var/tmp on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/tmp directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/tmp and cause potential disruption to daemons as the disk is full. Fine grained control over the mount Configuring /var/tmp as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var/tmp may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["CM-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:\s*/var/tmp\s' + + # 1.1.4.2 Ensure noexec option set on /var/tmp partition. (Automated) + - id: 31010 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:noexec" + + # 1.1.4.3 Ensure nosuid option set on /var/tmp partition. (Automated) + - id: 31011 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nosuid" + + # 1.1.4.4 Ensure nodev option set on /var/tmp partition. (Automated) + - id: 31012 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nodev" + + # 1.1.5.1 Ensure separate partition exists for /var/log. (Automated) + - id: 31013 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "The reasoning for mounting /var/log on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log directory contains log files which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. Fine grained control over the mount Configuring /var/log as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of log data As /var/log contains log files, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.5.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - nist_sp_800-53: ["CM-6"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:\s*/var/log\s' + + # 1.1.5.2 Ensure nodev option set on /var/log partition. (Automated) + - id: 31014 + title: "Ensure nodev option set on /var/log partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1038"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:nodev" + + # 1.1.5.3 Ensure noexec option set on /var/log partition. (Automated) + - id: 31015 + title: "Ensure noexec option set on /var/log partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot run executable binaries from /var/log." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:noexec" + + # 1.1.5.4 Ensure nosuid option set on /var/log partition. (Automated) + - id: 31016 + title: "Ensure nosuid option set on /var/log partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot create setuid files in /var/log." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:nosuid" + + # 1.1.6.1 Ensure separate partition exists for /var/log/audit. (Automated) + - id: 31017 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "The reasoning for mounting /var/log/audit on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log/audit directory contains the audit.log file which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/log/audit and cause auditd to trigger it's space_left_action as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var/log/audit as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of audit data As /var/log/audit contains audit logs, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.6.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - nist_sp_800-53: ["CM-6"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:\s*/var/log/audit\s' + + # 1.1.6.2 Ensure noexec option set on /var/log/audit partition. (Automated) + - id: 31018 + title: "Ensure noexec option set on /var/log/audit partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log/audit filesystem is only intended for audit logs, set this option to ensure that users cannot run executable binaries from /var/log/audit." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:noexec" + + # 1.1.6.3 Ensure nodev option set on /var/log/audit partition. (Automated) + - id: 31019 + title: "Ensure nodev option set on /var/log/audit partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log/audit filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:nodev" + + # 1.1.6.4 Ensure nosuid option set on /var/log/audit partition. (Automated) + - id: 31020 + title: "Ensure nosuid option set on /var/log/audit partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log/audit filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:nosuid" + + # 1.1.7.1 Ensure separate partition exists for /home. (Automated) + - id: 31021 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "The reasoning for mounting /home on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /home directory contains user generated data, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /home and impact all local users. Fine grained control over the mount Configuring /home as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. In the case of /home options such as usrquota/grpquota may be considered to limit the impact that users can have on each other with regards to disk resource exhaustion. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of user data As /home contains user data, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.7.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["CM-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1038"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:\s*/home\s' + + # 1.1.7.2 Ensure nodev option set on /home partition. (Automated) + - id: 31022 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /home filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1038"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:nodev" + + # 1.1.7.3 Ensure nosuid option set on /home partition. (Automated) + - id: 31023 + title: "Ensure nosuid option set on /home partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /home filesystem is only intended for user file storage, set this option to ensure that users cannot create setuid files in /home." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:nosuid" + + # 1.1.8.1 Ensure /dev/shm is a separate partition. (Automated) + - id: 31024 + title: "Ensure /dev/shm is a separate partition." + description: "The /dev/shm directory is a world-writable directory that can function as shared memory that facilitates inter process communication (IPC)." + rationale: "Making /dev/shm its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /dev/shm useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by mounting tmpfs to /dev/shm." + impact: "Since the /dev/shm directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. /dev/shm utilizing tmpfs can be resized using the size={size} parameter in the relevant entry in /etc/fstab." + remediation: "For specific configuration requirements of the /dev/shm mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs /dev/shm tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 0." + references: + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + - https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html + compliance: + - cis: ["1.1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:\s*/dev/shm\s' + + # 1.1.8.2 Ensure nodev option set on /dev/shm partition. (Automated) + - id: 31025 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /dev/shm -> r:nodev" + + # 1.1.8.3 Ensure noexec option set on /dev/shm partition. (Automated) + - id: 31026 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Example: /dev/shm defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm NOTE It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /dev/shm -> r:noexec" + + # 1.1.8.4 Ensure nosuid option set on /dev/shm partition. (Automated) + - id: 31027 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1038"] + condition: all + rules: + - "c:findmnt --kernel /dev/shm -> r:nosuid" + + # 1.1.9 Disable USB Storage. (Automated) + - id: 31028 + title: "Disable USB Storage." + description: "USB storage provides a means to transfer and store files ensuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/usb_storage.conf and add the following line: install usb-storage /bin/true Run the following command to unload the usb-storage module: rmmod usb-storage." + compliance: + - cis: ["1.1.9"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["13.7"] + - pci_dss_v3.2.1: ["9.7.1"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.8.3.1"] + - nist_sp_800-53: ["SC-18(4)"] + - mitre_techniques: ["T1091"] + - mitre_tactics: ["TA0001", "TA0010"] + - mitre_mitigations: ["M1034"] + condition: all + rules: + - "c:modprobe -n -v usb-storage -> r:install /bin/true" + - "not c:lsmod -> r:usb-storage" + + # 1.2 Configure Software Updates + # 1.2.1 Ensure GPG keys are configured. (Manual) - Not Implemented + + # 1.2.2 Ensure gpgcheck is globally activated. (Automated) + - id: 31029 + title: "Ensure gpgcheck is globally activated." + description: "The gpgcheck option, found in the main section of the /etc/dnf/dnf.conf and individual /etc/yum.repos.d/* files, determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/dnf/dnf.conf and set gpgcheck=1 in the [main] section. Example: # sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' /etc/dnf/dnf.conf Edit any failing files in /etc/yum.repos.d/* and set all instances starting with gpgcheck to 1. Example: # find /etc/yum.repos.d/ -name \"*.repo\" -exec echo \"Checking:\" {} \\; -exec sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' {} \\;." + compliance: + - cis: ["1.2.2"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + - mitre_techniques: ["T1195", "T1195.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "f:/etc/dnf/dnf.conf -> r:gpgcheck=1" + - "not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck=0" + + # 1.2.3 Ensure package manager repositories are configured. (Manual) - Not Implemented + # 1.2.4 Ensure gpgcheck is globally activated. (Automated) - Not Implemented + + # 1.3 Filesystem Integrity Checking + + # 1.3.1 Ensure AIDE is installed. (Automated) + - id: 31030 + title: "Ensure AIDE is installed." + description: "Advanced Intrusion Detection Environment (AIDE) is a intrusion detection tool that uses predefined rules to check the integrity of files and directories in the Linux operating system. AIDE has its own database to check the integrity of files and directories. AIDE takes a snapshot of files and directories including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # dnf install aide Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: Run the following commands: # aide --init # mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz." + references: + - "http://aide.sourceforge.net/stable/manual.html" + compliance: + - cis: ["1.3.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-2"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + - mitre_techniques: ["T1565", "T1565.001"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:rpm -q aide -> r:aide-" + + # 1.3.2 Ensure filesystem integrity is regularly checked. (Automated) + - id: 31031 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check OR if aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + references: + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service" + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer" + compliance: + - cis: ["1.3.2"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-2"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + - mitre_techniques: ["T1036", "T1036.005"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1022"] + condition: any + rules: + - "c:crontab -u root -l -> r:aide" + - "c:grep -r aide /etc/cron.* /etc/crontab -> r:aide" + - "c:systemctl is-enabled aidecheck.service -> r:enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:enabled" + - "c:systemctl status aidecheck.timer -> r:enabled" + + # 1.3.3 Ensure cryptographic mechanisms are used to protect the integrity of audit tools. (Automated) + - id: 31032 + title: "Ensure cryptographic mechanisms are used to protect the integrity of audit tools." + description: "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." + rationale: "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. Attackers may replace the audit tools or inject code into the existing tools with the purpose of providing the capability to hide or erase system activity from the audit logs. Audit tools should be cryptographically signed in order 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." + remediation: "Add or update the following selection lines for to a file ending in .conf in the /etc/aide.conf.d/ directory or to /etc/aide.conf to protect the integrity of the audit tools: # Audit Tools /sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512." + compliance: + - cis: ["1.3.3"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'f:/etc/aide.conf -> r:\/sbin\/(auditctl|auditd|ausearch|aureport|autrace|augenrules)\H*\b' + - 'd:/etc/aide.conf.d -> r:\.+.conf -> r:\/sbin\/(auditctl|auditd|ausearch|aureport|autrace|augenrules)\H*\b' + + # 1.4 Secure Boot Settings + + # 1.4.1 Ensure bootloader password is set. (Automated) + - id: 31033 + title: "Ensure bootloader password is set." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + impact: 'If password protection is enabled, only the designated superuser can edit a Grub 2 menu item by pressing "e" or access the GRUB 2 command line by pressing "c" If GRUB 2 is set up to boot automatically to a password-protected menu entry the user has no option to back out of the password prompt to select another menu entry. Holding the SHIFT key will not display the menu in this case. The user must enter the correct username and password. If unable, the configuration files will have to be edited via the LiveCD or other means to fix the problem You can add --unrestricted to the menu entries to allow the system to boot without entering a password. Password will still be required to edit menu items.' + remediation: "Create an encrypted password with grub2-setpassword: # grub2-setpassword Enter password: Confirm password: Run the following command to update the grub2 configuration: # grub2-mkconfig -o \"$(dirname \"$(find /boot -type f \\( -name 'grubenv' -o -name 'grub.conf' -o -name 'grub.cfg' \\) -exec grep -Pl '^\\h*(kernelopts=|linux|kernel)' {} \\;)\")/grub.cfg\"." + compliance: + - cis: ["1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1542"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1046"] + condition: any + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub2/grub.cfg -> r:^\s*\t*password' + + # 1.4.2 Ensure permissions on bootloader config are configured. (Automated) + - id: 31034 + title: "Ensure permissions on bootloader config are configured." + description: "The grub files contain information on boot settings and passwords for unlocking boot options. The grub2 configuration is usually grub.cfg. On newer grub2 systems the encrypted bootloader password is contained in user.cfg. If the system uses UEFI, /boot/efi is a vfat filesystem. The vfat filesystem itself doesn't have the concept of permissions but can be mounted under Linux with whatever permissions desired." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set ownership and permissions on your grub configuration files: Run the following command to set ownership and permissions on grub.cfg: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg Run the following command to set ownership and permissions on grubenv: # chown root:root /boot/grub2/grubenv # chmod u-x,og-rwx /boot/grub2/grubenv Run the following command to set ownership and permissions on user.cfg: # chown root:root /boot/grub2/user.cfg # chmod u-x,og-rwx /boot/grub2/user.cfg Note: This may require a re-boot to enable the change." + compliance: + - cis: ["1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1542"] + - mitre_tactics: ["TA0005", "TA0007"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -L /boot/grub/grub.cfg -> r:Access:\s*\(0400/-r--------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.5.1 Ensure address space layout randomization (ASLR) is enabled. (Automated) - Not Implemented + # 1.5.2 Ensure ptrace_scope is restricted. (Automated) - Not Implemented + # 1.5.3 Ensure core dump storage is disabled. (Automated) + - id: 31035 + title: "Ensure core dump storage is disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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." + remediation: "Edit /etc/systemd/coredump.conf and edit or add the following line: Storage=none." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.3"] + - cis_csc_v7: ["13.2"] + - cmmc_v2.0: ["AM.3.036"] + - nist_sp_800-53: ["CM-7"] + - mitre_techniques: ["T1005"] + - mitre_tactics: ["TA0007"] + - mitre_mitigations: ["M1057"] + condition: all + rules: + - "f:/etc/systemd/coredump.conf -> r:Storage=0" + + # 1.5.4 Ensure core dump backtraces are disabled. (Automated) + - id: 31036 + title: "Ensure core dump backtraces are disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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, increasing the risk to the system." + remediation: "Edit or add the following line in /etc/systemd/coredump.conf: ProcessSizeMax=0." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.4"] + - cis_csc_v7: ["13.2"] + - cmmc_v2.0: ["AM.3.036"] + - nist_sp_800-53: ["CM-6"] + - mitre_techniques: ["T1005"] + - mitre_tactics: ["TA0007"] + - mitre_mitigations: ["M1057"] + condition: all + rules: + - "f:/etc/systemd/coredump.conf -> r:ProcessSizeMax=0" + + # 1.6.1.1 Ensure SELinux is installed. (Automated) + - id: 31037 + title: "Ensure SELinux is installed." + description: "SELinux provides Mandatory Access Control." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install SELinux: # dnf install libselinux." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1068"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - "c:rpm -q libselinux -> r:libselinux-" + + # 1.6.1.2 Ensure SELinux is not disabled in bootloader configuration. (Automated) + - id: 31038 + title: "Ensure SELinux is not disabled in bootloader configuration." + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + impact: "Files created while SELinux is disabled are not labeled at all. This behavior causes problems when changing to enforcing mode because files are labeled incorrectly or are not labeled at all. To prevent incorrectly labeled and unlabeled files from causing problems, file systems are automatically relabeled when changing from the disabled state to permissive or enforcing mode. This can be a long running process that should be accounted for as it may extend downtime during initial re-boot." + remediation: "Run the following command to remove the selinux=0 and enforcing=0 parameters: grubby --update-kernel ALL --remove-args 'selinux=0 enforcing=0' Run the following command to remove the selinux=0 and enforcing=0 parameters if they were created by the deprecated grub2-mkconfig command: grep -Prsq -- '\\h*([^#\\n\\r]+\\h+)?kernelopts=([^#\\n\\r]+\\h+)?(selinux|enforcing)=0\\b' /boot/grub2 /boot/efi && grub2-mkconfig -o \"$(grep -Prl -- '\\h*([^#\\n\\r]+\\h+)?kernelopts=([^#\\n\\r]+\\h+)?(selinux|enforcing)=0\\b' /boot/grub2 /boot/efi)\"." + compliance: + - cis: ["1.6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1068"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1026"] + condition: none + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*linux\.+selinux=0|linux\.+enforcing=0' + - 'f:/boot/grub2/grubenv -> r:^\s*linux\.+selinux=0|linux\.+enforcing=0' + + # 1.6.1.3 Ensure SELinux policy is configured. (Automated) + - id: 31039 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1068"] + - mitre_tactics: ["TA0003"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded\s*policy\s*name:\s*\t*targeted$|^Loaded\s*policy\s*name:\s*\t*mls' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Ensure the SELinux mode is not disabled. (Automated) + - id: 31040 + title: "Ensure the SELinux mode is not disabled." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive." + references: + - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - "c:getenforce -> r:Enforcing|Permisive" + - "f:/etc/selinux/config -> r:^SELINUX=enforcing|^SELINUX=Permisive" + + # 1.6.1.5 Ensure the SELinux mode is enforcing. (Automated) + - id: 31041 + title: "Ensure the SELinux mode is enforcing." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode the system not only avoids enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future. Running SELinux in Permissive mode, though helpful for developing SELinux policy, only logs access denial entries, but does not deny any operations." + remediation: "Run the following command to set SELinux's running mode: # setenforce 1 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing." + references: + - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes + compliance: + - cis: ["1.6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:getenforce -> r:Enforcing" + - "f:/etc/selinux/config -> r:^SELINUX=enforcing" + + # 1.6.1.6 Ensure no unconfined services exist. (Automated) + - id: 31042 + title: "Ensure no unconfined services exist." + description: "Unconfined processes run in unconfined domains." + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules - it does not replace them." + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "not c:ps -eZ -> r:unconfined_service_t" + + # 1.6.1.7 Ensure SETroubleshoot is not installed. (Automated) + - id: 31043 + title: "Ensure SETroubleshoot is not installed." + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # dnf remove setroubleshoot." + compliance: + - cis: ["1.6.1.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1543", "T1543.002"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:rpm -q setroubleshoot -> r:^package\s*setroubleshoot\s*is\s*not\s*installed$' + + # 1.6.1.8 Ensure the MCS Translation Service (mcstrans) is not installed. (Automated) + - id: 31044 + title: "Ensure the MCS Translation Service (mcstrans) is not installed." + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf." + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # dnf remove mcstrans." + compliance: + - cis: ["1.6.1.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["SI-4"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1543", "T1543.002"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:rpm -q mcstrans -> r:^package\s*mcstrans\s*is\s*not\s*installed$' + + # 1.7.1 Ensure message of the day is configured properly. (Automated) + - id: 31045 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + - mitre_tactics: ["TA0007"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s|Amazon' + + # 1.7.2 Ensure local login warning banner is configured properly. (Automated) + - id: 31046 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.7.2"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + - mitre_tactics: ["TA0007"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Amazon' + + # 1.7.3 Ensure remote login warning banner is configured properly. (Automated) + - id: 31047 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + - mitre_techniques: ["T1018", "T1082", "T1592", "T1592.004"] + - mitre_tactics: ["TA0007"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|Amazon' + + # 1.7.4 Ensure permissions on /etc/motd are configured. (Automated) + - id: 31048 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd : # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.5 Ensure permissions on /etc/issue are configured. (Automated) + - id: 31049 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue : # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured. (Automated) + - id: 31050 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.8.1 Ensure GNOME Display Manager is removed. (Manual) + - id: 31051 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + impact: "Removing the GNOME Display manager will remove the GUI from the system." + remediation: "Run the following command to remove the gdm package # dnf remove gdm." + references: + - "https://wiki.gnome.org/Projects/GDM" + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1543", "T1543.002"] + - mitre_tactics: ["TA0002"] + condition: all + rules: + - "c:rpm -q gdm -> r:^package gdm is not installed$" + + # 1.8.2 Ensure GDM login banner is configured. (Automated) - Not Implemented + # 1.8.3 Ensure GDM disable-user-list option is enabled. (Automated) - Not Implemented + # 1.8.4 Ensure GDM screen locks when the user is idle. (Automated) - Not Implemented + # 1.8.5 Ensure GDM screen locks cannot be overridden. (Automated) - Not Implemented + # 1.8.6 Ensure GDM automatic mounting of removable media is disabled. (Automated) - Not Implemented + # 1.8.7 Ensure GDM disabling automatic mounting of removable media is not overridden. (Automated) - Not Implemented + # 1.8.8 Ensure GDM autorun-never is enabled. (Automated) - Not Implemented + # 1.8.9 Ensure GDM autorun-never is not overridden. (Automated) - Not Implemented + + # 1.8.10 Ensure XDMCP is not enabled. (Automated) + - id: 31052 + title: "Ensure XDMCP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. - XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user - XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server.." + remediation: "Edit the file /etc/gdm/custom.conf and remove the line: Enable=true." + compliance: + - cis: ["1.8.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1040", "T1056", "T1056.001", "T1557"] + - mitre_tactics: ["TA0002"] + - mitre_mitigations: ["M1050"] + condition: all + rules: + - 'not f:/etc/gdm/custom.conf -> r:^\s*Enable\s*=\s*true' + + # 1.9 Ensure updates, patches, and additional security software are installed. (Manual) + - id: 31053 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available updates: # dnf update." + compliance: + - cis: ["1.9"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + - mitre_techniques: ["T1211"] + - mitre_tactics: ["TA0004", "TA0008"] + - mitre_mitigations: ["M1051"] + condition: all + rules: + - "c:dnf check-update -> r:^No" + - "c:dnf needs-restarting -r -> r:Reboot should not be necessary" + + # 1.10 Ensure system-wide crypto policy is not legacy. (Automated) + - id: 31054 + title: "Ensure system-wide crypto policy is not legacy." + description: "The system-wide crypto-policies followed by the crypto core components allow consistently deprecating and disabling algorithms system-wide. The individual policy levels (DEFAULT, LEGACY, FUTURE, and FIPS) are included in the crypto-policies(7) package." + rationale: "If the Legacy system-wide crypto policy is selected, it includes support for TLS 1.0, TLS 1.1, and SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are allowed, while RSA and Diffie-Hellman parameters are accepted if larger than 1023-bits. These legacy protocols and algorithms can make the system vulnerable to attacks, including those listed in RFC 7457." + impact: "Environments that require compatibility with older insecure protocols may require the use of the less secure LEGACY policy level." + remediation: "Run the following command to change the system-wide crypto policy # update-crypto-policies --set Example: # update-crypto-policies --set DEFAULT Run the following to make the updated system-wide crypto policy active # update-crypto-policies." + references: + - "https://access.redhat.com/articles/3642912#what-polices-are-provided-1" + compliance: + - cis: ["1.10"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["SC-8"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - "not f:/etc/crypto-policies/config -> r:LEGACY" + + ############################################################ + # 2 Services. + ############################################################ + ############################################################ + # 2.1 Time Synchronization. + ############################################################ + + # 2.1.1 Ensure time synchronization is in use. (Automated) + - id: 31055 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them. Note: If another method for time synchronization is being used, this section may be skipped." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Run the following command to install chrony: # dnf install chrony." + compliance: + - cis: ["2.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - nist_800-53: ["AU-3", "AU-12"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:rpm -q chrony -> r:chrony-" + + # 2.1.2 Ensure chrony is configured. (Automated) + - id: 31056 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: 'Add or edit server or pool lines to /etc/chrony.conf as appropriate: server . Add or edit the OPTIONS in /etc/sysconfig/chronyd to include ''-u chrony'':OPTIONS=" -u chrony".' + compliance: + - cis: ["2.1.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - nist_800-53: ["AU-3", "AU-12"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + - mitre_techniques: ["T1070", "T1070.002"] + - mitre_tactics: ["TA0002"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\.+$|^pool\.+$' + - 'f:/etc/sysconfig/chronyd -> r:^OPTIONS\s*=\s* && r:-u chrony' + + # 2.2.1 Ensure xorg-x11-server-common is not installed. (Automated) + - id: 31057 + title: "Ensure xorg-x11-server-common is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: "Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the 'headless' Java packages for your specific Java runtime." + remediation: "Run the following command to remove the X Windows Server packages: # dnf remove xorg-x11-server-common." + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q xorg-x11-server-common -> r:^package xorg-x11-server-common is not installed$" + + # 2.2.2 Ensure Avahi Server is not installed. (Automated) + - id: 31058 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable this package to reduce the potential attack surface." + remediation: "Run the following commands to stop, mask and remove avahi: # systemctl stop avahi-daemon.socket avahi-daemon.service # dnf remove avahi." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q avahi -> r:^package avahi is not installed$" + + # 2.2.3 Ensure CUPS is not installed. (Automated) + - id: 31059 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface. Note: Removing CUPS will prevent printing from the system." + impact: "Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to remove cups: # dnf remove cups." + references: + - https://www.cups.org + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q cups -> r:^package cups is not installed$" + + # 2.2.4 Ensure DHCP Server is not installed. (Automated) + - id: 31060 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that the dhcp-server package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcp: # dnf remove dhcp-server." + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q dhcp-server -> r:^package dhcp-server is not installed$" + + # 2.2.5 Ensure DNS Server is not installed. (Automated) + - id: 31061 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove bind: # dnf remove bind." + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q bind -> r:^package bind is not installed$" + + # 2.2.6 Ensure VSFTP Server is not installed. (Automated) + - id: 31062 + title: "Ensure VSFTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "Unless there is a need to run the system as a FTP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # dnf remove vsftpd." + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q vsftpd -> r:^package vsftpd is not installed$" + + # 2.2.7 Ensure TFTP Server is not installed. (Automated) + - id: 31063 + title: "Ensure TFTP Server is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "Unless there is a need to run the system as a TFTP server, it is recommended that the package be removed to reduce the potential attack surface. TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + impact: "TFTP is often used to provide files for network booting such as for PXE based installation of servers." + remediation: "Run the following command to remove tftp-server: # dnf remove tftp-server." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q tftp-server -> r:^package tftp-server is not installed$" + + # 2.2.8 Ensure a web server is not installed. (Automated) + - id: 31064 + title: "Ensure a web server is not installed." + description: "Web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the packages be removed to reduce the potential attack surface. Note: Several http servers exist. They should also be audited, and removed, if not required." + remediation: "Run the following command to remove httpd and nginx: # dnf remove httpd nginx." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q httpd -> r:^package httpd is not installed$" + - "c:rpm -q nginx -> r:^package nginx is not installed$" + + # 2.2.9 Ensure IMAP and POP3 server is not installed. (Automated) + - id: 31065 + title: "Ensure IMAP and POP3 server is not installed." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface. Note: Several IMAP/POP3 servers exist and can use other service names. These should also be audited and the packages removed if not required." + remediation: "Run the following command to remove dovecot and cyrus-imapd: # dnf remove dovecot cyrus-imapd." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q dovecot -> r:^package dovecot is not installed$" + - "c:rpm -q cyrus-imapd -> r:^package cyrus-imapd is not installed$" + + # 2.2.10 Ensure Samba is not installed. (Automated) + - id: 31066 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # dnf remove samba." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1005", "T1039", "T1083", "T1135", "T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q samba -> r:^package samba is not installed$" + + # 2.2.11 Ensure HTTP Proxy Server is not installed. (Automated) + - id: 31067 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface. Note: Several HTTP proxy servers exist. These should be checked and removed unless required." + remediation: "Run the following command to remove the squid package: # dnf remove squid." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q squid -> r:^package squid is not installed$" + + # 2.2.12 Ensure net-snmp is not installed. (Automated) + - id: 31068 + title: "Ensure SNMP Server is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. If SNMP v2 is absolutely necessary, modify the community strings' values." + remediation: "Run the following command to remove net-snmp: # dnf remove net-snmp." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2", "2.6"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q net-snmp -> r:^package net-snmp is not installed$" + + # 2.2.13 Ensure telnet-server is not installed. (Automated) + - id: 31069 + title: "Ensure NIS server is not installed." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to remove the telnet-server package: # dnf remove telnet-server." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2", "2.6"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q telnet-server -> r:^package telnet-server is not installed$" + + # 2.2.14 Ensure dnsmasq is not installed. (Automated) + - id: 31070 + title: "Ensure dnsmasq is not installed." + description: "dnsmasq is a lightweight tool that provides DNS caching, DNS forwarding and DHCP (Dynamic Host Configuration Protocol) services." + rationale: "Unless a system is specifically designated to act as a DNS caching, DNS forwarding and/or DHCP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dnsmasq: # dnf remove dnsmasq." + compliance: + - cis: ["2.2.14"] + - nist_sp_800-53: ["CM-7"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q dnsmasq -> r:^package dnsmasq is not installed$" + + # 2.2.15 Ensure mail transfer agent is configured for local-only mode. (Automated) + - id: 31071 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Note: - This recommendation is designed around the postfix mail server. - Depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only. Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["SI-4"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1018", "T1210"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: none + rules: + - 'c:ss -lntu -> r:\.*:25\s* && !r:127.0.0.1:25\.*|::1:25\.*' + + # 2.2.16 Ensure nfs-utils is not installed or the nfs-server service is masked. (Automated) + - id: 31072 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization are dependent on the nfs-utils package. If the nfs-package is required as a dependency, the nfs-server should be disabled and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove nfs-utils OR If the nfs-package is required as a dependency, run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["SI-4"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1005", "T1039", "T1083", "T1135", "T1203", "T1210"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: any + rules: + - "c:rpm -q nfs-utils -> r:^package nfs-utils is not installed$" + - "c:systemctl is-enabled nfs-server -> r:masked" + + # 2.2.17 Ensure rpcbind is not installed or the rpcbind services are masked. (Automated) + - id: 31073 + title: "Ensure rpcbind is not installed or the rpcbind services are masked." + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening." + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization, and the nfs-utils package used for The Network File System (NFS), are dependent on the rpcbind package. If the rpcbind package is required as a dependency, the services rpcbind.service and rpcbind.socket should be stopped and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove rpcbind OR If the rpcbind package is required as a dependency, run the following commands to stop and mask the rpcbind.service and rpcbind. socket systemd units: # systemctl --now mask rpcbind.service # systemctl --now mask rpcbind.socket." + compliance: + - cis: ["2.2.17"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["SI-4"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1210", "T1498", "T1498.002", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: any + rules: + - "c:rpm -q rpcbind -> r:^package rpcbind is not installed$" + - "c:systemctl is-enabled rpcbind -> r:masked" + - "c:systemctl is-enabled rpcbind.socket -> r:masked" + + # 2.2.18 Ensure rsync-daemon is not installed or the rsyncd service is masked. (Automated) + - id: 31074 + title: "Ensure rsync-daemon is not installed or the rsyncd service is masked." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync-daemon package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication. Note: If a required dependency exists for the rsync-daemon package, but the rsyncd service is not required, the service should be masked." + impact: "There are packages that are dependent on the rsync package. If the rsync package is removed, these packages will be removed as well. Before removing the rsync-daemon package, review any dependent packages to determine if they are required on the system. If a dependent package is required, mask the rsyncd service and leave the rsync-daemon package installed." + remediation: "Run the following command to remove the rsync package: # dnf remove rsync-daemon OR Run the following command to mask the rsyncd service: # systemctl --now mask rsyncd." + compliance: + - cis: ["2.2.18"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["SI-4"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1105", "T1203", "T1210", "T1543", "T1543.002", "T1570"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: any + rules: + - "c:rpm -q rsync-daemon -> r:^package rsync-daemon is not installed$" + - "c:systemctl is-enabled rsyncd -> r:masked" + + ############################################################ + # 2.3 Service Clients. + ############################################################ + + # 2.3.1 Ensure telnet client is not installed. (Automated) + - id: 31075 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the telnet package: # dnf remove telnet." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1040", "T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0006", "TA0008"] + - mitre_mitigations: ["M1041", "M1042"] + condition: all + rules: + - "c:rpm -q telnet -> r:^package telnet is not installed$" + + # 2.3.2 Ensure LDAP client is not installed. (Automated) + - id: 31076 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Run the following command to remove the openldap-clients package: # dnf remove openldap-clients." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q openldap-clients -> r:^package openldap-clients is not installed$" + + # 2.3.3 Ensure TFTP client is not installed. (Automated) + - id: 31077 + title: "Ensure TFTP client is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + remediation: "Run the following command to remove tftp: # dnf remove tftp." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q tftp -> r:^package tftp is not installed$" + + # 2.3.4 Ensure FTP client is not installed. (Automated) + - id: 31078 + title: "Ensure FTP client is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove ftp: # dnf remove ftp." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q ftp -> r:^package ftp is not installed$" + + # 2.4 Ensure nonessential services listening on the system are removed or masked. (Manual) - Not implemented + + ############################################################ + # 3 Network Configuration + ############################################################ + + ####################################################### + # 3.1 Disable unused network protocols and devices. + ####################################################### + + # 3.1.1 Ensure IPv6 status is identified. (Manual) - Not implemented + # 3.1.2 Ensure wireless interfaces are disabled. (Automated) - Not implemented + # 3.1.3 Ensure TIPC is disabled. (Automated) - Not implemented + + ####################################################### + # 3.2 Network Parameters (Host Only). + ####################################################### + # 3.2.1 Ensure IP forwarding is disabled. (Automated) - Not implemented + # 3.2.2 Ensure packet redirect sending is disabled (Automated) - Not implemented + + ################################################## + # 3.3 Network Parameters (Host and Router). + ################################################## + # 3.3.1 Ensure source routed packets are not accepted (Automated) - Not implemented + # 3.3.2 Ensure ICMP redirects are not accepted (Automated) - Not implemented + # 3.3.3 Ensure secure ICMP redirects are not accepted. (Automated) - Not implemented + # 3.3.4 Ensure suspicious packets are logged. (Automated) - Not implemented + # 3.3.5 Ensure broadcast ICMP requests are ignored. (Automated) - Not implemented + # 3.3.6 Ensure bogus ICMP responses are ignored. (Automated) - Not implemented + # 3.3.7 Ensure Reverse Path Filtering is enabled. (Automated) - Not implemented + # 3.3.8 Ensure TCP SYN Cookies is enabled. (Automated) - Not implemented + # 3.3.9 Ensure IPv6 router advertisements are not accepted. (Automated) - Not implemented + + ############################################################ + # 3.4 Configure Host Based Firewall. + ############################################################ + + ############################################################ + # 3.4.1 Configure a firewall utility. + ############################################################ + + # 3.4.1.1 Ensure nftables is installed. (Automated) + - id: 31079 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install nftables # dnf install nftables." + compliance: + - cis: ["3.4.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["CA-9"] + - soc_2: ["CC6.6"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - "c:rpm -q nftables -> r:nftables-" + + # 3.4.1.2 Ensure a single firewall configuration utility is in use. (Automated) - Not implemented + + ############################################################ + # 3.4.2 Configure nfttables. + ############################################################ + + # 3.4.2.1 Ensure firewalld default zone is set. (Automated) - Not implemented + + # 3.4.2.2 Ensure at least one nftables table exists. (Automated) + - id: 31080 + title: "Ensure at least one nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "Without a table, nftables will not filter network traffic." + impact: "Adding or modifying firewall rules can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example if FirewallD is not in use on the system: # nft create table inet filter Note: FirewallD uses the table inet firewalld NFTables table that is created when FirewallD is installed." + compliance: + - cis: ["3.4.2.2"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["CA-9"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:nftables-" + - "c:nft list tables -> r:^table" + + # 3.4.2.3 Ensure nftables base chains exist. + - id: 31081 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.4.2.3"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["CA-9"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:nftables-" + - "c:nft list ruleset -> r:input" + - "c:nft list ruleset -> r:forward" + - "c:nft list ruleset -> r:output" + + # 3.4.2.4 Ensure host based firewall loopback traffic is configured. (Automated) - Not implemented + # 3.4.2.5 Ensure firewalld drops unnecessary services and ports. (Manual) - Not implemented + # 3.4.2.6 Ensure nftables established connections are configured. (Manual) - Not implemented + + # 3.4.2.7 Ensure nftables default deny firewall policy.(Automated) + - id: 31082 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue traversing the network stack. It is easier to explicitly permit acceptable usage than to deny unacceptable usage. Note: Changing firewall settings while connected over the network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "If NFTables utility is in use on your system: Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; }." + compliance: + - cis: ["3.4.2.9"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["CA-9"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:nftables-" + - "c:nft list ruleset -> r:input && r:drop" + - "c:nft list ruleset -> r:forward && r:drop" + - "c:nft list ruleset -> r:output && r:drop" + + ############################################################ + # 4 Logging and Auditing. + ############################################################ + + ############################################################ + # 4.1 Configure System Accounting (auditd). + ############################################################ + + ############################################################ + # 4.1.1 Ensure auditing is enabled. + ############################################################ + + # 4.1.1.1 Ensure auditd is installed. (Automated) + - id: 31083 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # dnf install audit." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v8: ["8.2", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "AU-3", "AU-3(1)", "SI-5"] + - pci_dss_v3.2.1: ["10.1", "10.2", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:rpm -q audit -> r:^audit-" + - "not c:rpm -q audit -> r:^package audit is not installed$" + + # 4.1.1.2 Ensure auditing for processes that start prior to auditd is enabled. (Automated) + - id: 31084 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd , so that potential malicious activity cannot go undetected." + remediation: "Run the following command to add audit=1 to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit=1'." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'not f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !n:audit=(\d+) compare == 1' + + # 4.1.1.3 Ensure audit_backlog_limit is sufficient. (Automated) + - id: 31085 + title: "Ensure audit_backlog_limit is sufficient." + description: "The backlog limit has a default setting of 64." + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more that 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected." + remediation: "Run the following command to add audit_backlog_limit= to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit_backlog_limit=' Example: # grubby --update-kernel ALL --args 'audit_backlog_limit=8192'." + compliance: + - cis: ["4.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'not f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !n:audit_backlog_limit=(\d+) compare >= 8192' + + # 4.1.1.4 Ensure auditd service is enabled. (Automated) + - id: 31086 + title: "Ensure auditd service is enabled." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:systemctl is-enabled auditd -> r:^\s*enabled' + + # 4.1.2.1 Ensure audit log storage size is configured. (Automated) + - id: 31087 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1053"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+$' + + # 4.1.2.2 Ensure audit logs are not automatically deleted. (Automated) + - id: 31088 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file_action\s*=\s*keep_logs$' + + # 4.1.2.3 Ensure system is disabled when audit logs are full. (Automated) + - id: 31089 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full. The admin_space_left_action parameter tells the system what action to take when the system has detected that it is low on disk space. Valid values are ignore, syslog, suspend, single, and halt. - ignore, the audit daemon does nothing - Syslog, the audit daemon will issue a warning to syslog - Suspend, the audit daemon will stop writing records to the disk - single, the audit daemon will put the computer system in single user mode - halt, the audit daemon will shutdown the system." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + impact: "If the admin_space_left_action parameter is set to halt the audit daemon will shutdown the system when the disk partition containing the audit logs becomes full." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root set admin_space_left_action to either halt or single in /etc/audit/auditd.conf. Example: admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - nist_sp_800-53: ["AU-12", "AU-2", "AU-8", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt|^\s*admin_space_left_action\s*=\s*single' + + # 4.1.3.1 Ensure changes to system administration scope (sudoers) is collected. (Automated) + - id: 31090 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers, or files in /etc/sudoers.d, will be written to when the file(s) or related attributes have changed. The audit records will be tagged with the identifier "scope".' + rationale: "Changes in the /etc/sudoers and /etc/sudoers.d files can indicate that an unauthorized change has been made to the scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor scope changes for system administrators. Example: # printf \" -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d -p wa -k scope \" >> /etc/audit/rules.d/50-scope.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1047"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'c:auditctl -l -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'c:auditctl -l -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=\\s*\t*scope' + + # 4.1.3.2 Ensure actions as another user are always logged. (Automated) + - id: 31091 + title: "Ensure actions as another user are always logged." + description: "sudo provides users with temporary elevated privileges to perform operations, either as the superuser or another user." + rationale: "Creating an audit log of users with temporary elevated privileges and the operation(s) they performed is essential to reporting. Administrators will want to correlate the events written to the audit trail with the records written to sudo's logfile to verify if unauthorized commands have been executed." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor elevated privileges. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -C euid!=uid -F auid!=unset -S execve -k user_emulation -a always,exit -F arch=b32 -C euid!=uid -F auid!=unset -S execve -k user_emulation \" >> /etc/audit/rules.d/50-user_emulation.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1047"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + + # 4.1.3.3 Ensure events that modify the sudo log file are collected. (Automated) - Not Implemented + + # 4.1.3.4 Ensure events that modify date and time information are collected. (Automated) + - id: 31092 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the; - adjtimex - tune kernel clock - settimeofday - set time using timeval and timezone structures - stime - using seconds since 1/1/1970 - clock_settime - allows for the setting of several internal clocks and timers system calls have been executed. Further, ensure to write an audit record to the configured audit log file upon exit, tagging the records with a unique identifier such as "time-change".' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify date and time information. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S adjtimex,settimeofday,clock_settime -k time-change -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime -k time-change -w /etc/localtime -p wa -k time-change \" >> /etc/audit/rules.d/50-time-change.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64. In addition, add stime to the system call audit. Example: -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime,stime -k time-change." + compliance: + - cis: ["4.1.3.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change' + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change" + + # 4.1.3.5 Ensure events that modify the system's network environment are collected. (Automated) + - id: 31093 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitors the following system calls, and write an audit event on system call exit: - sethostname - set the systems host name - setdomainname - set the systems domain name The files being monitored are: - /etc/issue and /etc/issue.net - messages displayed pre-login - /etc/hosts - file containing host names and associated IP addresses - /etc/sysconfig/network - additional information that is valid to all network interfaces - /etc/sysconfig/network-scripts/ - directory containing network interface scripts and configurations files." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records should have a relevant tag associated with them." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's network environment. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S sethostname,setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname,setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale \" >> /etc/audit/rules.d/50-system_local.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1047"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sysconfig/network-scripts/ && r:-p wa && r:-k system-locale|key=system-locale' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/sysconfig/network-scripts && r:-p wa && r:-k system-locale|key=system-locale" + + # 4.1.3.6 Ensure use of privileged commands are collected. (Automated) - Not Implemented + # 4.1.3.7 Ensure unsuccessful file access attempts are collected. (Automated) - Not Implemented + + # 4.1.3.8 Ensure events that modify user/group information are collected. (Automated) + - id: 31094 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the modification of user or group information, including that of passwords and old passwords if in use. - /etc/group - system groups - /etc/passwd - system users - /etc/gshadow - encrypted password for each group - /etc/shadow - system user passwords - /etc/security/opasswd - storage of old passwords if the relevant PAM module is in use The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify user/group information. Example: # printf \" -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity \" >> /etc/audit/rules.d/50-identity.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.8"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1047"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity' + - "c:auditctl -l -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity" + + # 4.1.3.9 Ensure discretionary access control permission modification events are collected. (Automated) - Not Implemented + + # 4.1.3.10 Ensure successful file system mounts are collected. (Automated) + - id: 31095 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful file system mounts. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=unset -k mounts -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=unset -k mounts \" >> /etc/audit/rules.d/50-mounts.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.10"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["CM-6"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0010"] + - mitre_mitigations: ["M1034"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + + # 4.1.3.11 Ensure session initiation information is collected. (Automated) + - id: 31096 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. - /var/run/utmp - tracks all currently logged in users. - /var/log/wtmp - file tracks logins, logouts, shutdown, and reboot events. - /var/log/btmp - keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier "session.".' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor session initiation information. Example: # printf \" -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k session -w /var/log/btmp -p wa -k session \" >> /etc/audit/rules.d/50-session.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.11"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0001"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session' + - "c:auditctl -l -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session" + + # 4.1.3.12 Ensure login and logout events are collected. (Automated) + - id: 31097 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. - /var/log/lastlog - maintain records of the last time a user successfully logged in. - /var/run/faillock - directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor login and logout events. Example: # printf \" -w /var/log/lastlog -p wa -k logins -w /var/run/faillock -p wa -k logins \" >> /etc/audit/rules.d/50-login.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.12"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.8.1.3", "A.9.4.2"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0001"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins' + - "c:auditctl -l -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins" + - "c:auditctl -l -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins" + + # 4.1.3.13 Ensure file deletion events by users are collected. (Automated) + - id: 31098 + title: "Ensure file deletion events by users are collected." + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for: - unlink - remove a file - unlinkat - remove a file attribute - rename - rename a file - renameat rename a file attribute system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor file deletion events by users. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete -a always,exit -F arch=b32 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete \" >> /etc/audit/rules.d/50-delete.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.13"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + + # 4.1.3.14 Ensure events that modify the system's Mandatory Access Controls are collected. (Automated) + - id: 31099 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor SELinux, an implementation of mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux/ and /usr/share/selinux/ directories. Note: If a different Mandatory Access Control method is used, changes to the corresponding directories should be audited." + rationale: "Changes to files in the /etc/selinux/ and /usr/share/selinux/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's Mandatory Access Controls. Example: # printf \" -w /etc/selinux -p wa -k MAC-policy -w /usr/share/selinux -p wa -k MAC-policy \" >> /etc/audit/rules.d/50-MAC-policy.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.14"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/usr/share/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - "c:auditctl -l -> r:^-w && r:/etc/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy" + - "c:auditctl -l -> r:^-w && r:/usr/share/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy" + + # 4.1.3.15 Ensure successful and unsuccessful attempts to use the chcon command are recorded. (Automated) + - id: 31100 + title: "Ensure successful and unsuccessful attempts to use the chcon command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chcon command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chcon command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.15"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + + # 4.1.3.16 Ensure successful and unsuccessful attempts to use the setfacl command are recorded. (Automated) + - id: 31101 + title: "Ensure successful and unsuccessful attempts to use the setfacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the setfacl command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the setfacl command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-priv_cmd.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.16"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + + # 4.1.3.17 Ensure successful and unsuccessful attempts to use the chacl command are recorded. (Automated) + - id: 31102 + title: "Ensure successful and unsuccessful attempts to use the chacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chacl command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chacl command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.17"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k priv_cmd|-F key=priv_cmd' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k priv_cmd|-F key=priv_cmd' + + # 4.1.3.18 Ensure successful and unsuccessful attempts to use the usermod command are recorded. (Automated) + - id: 31103 + title: "Ensure successful and unsuccessful attempts to use the usermod command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the usermod command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the usermod command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k usermod \" >> /etc/audit/rules.d/50-usermod.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.18"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + + # 4.1.3.19 Ensure kernel module loading unloading and modification is collected. (Automated) + - id: 31104 + title: "Ensure kernel module loading unloading and modification is collected." + description: "Monitor the loading and unloading of kernel modules. All the loading / listing / dependency checking of modules is done by kmod via symbolic links. The following system calls control loading and unloading of modules: - init_module - load a module - finit_module - load a module (used when the overhead of using cryptographically signed modules to determine the authenticity of a module can be avoided) - delete_module - delete a module - create_module - create a loadable module entry - query_module - query the kernel for various bits pertaining to modules Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of modules." + rationale: "Monitoring the use of all the various ways to manipulate kernel modules could provide system administrators with evidence that an unauthorized change was made to a kernel module, possibly compromising the security of the system." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor kernel module modification. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S init_module,finit_module,delete_module,create_module,query_module -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules -a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules \" >> /etc/audit/rules.d/50-kernel_modules.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.19"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1047"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l-> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - "c:ls -l /usr/sbin/lsmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/rmmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/insmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modinfo -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modprobe -> r:/bin/kmod" + - "c:ls -l /usr/sbin/depmod -> r:/bin/kmod" + + # 4.1.3.20 Ensure the audit configuration is immutable. (Automated) + - id: 31105 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: This setting will require the system to be rebooted to update the active auditd configuration settings.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line -e 2 at the end of the file: Example: # printf -- \"-e 2\" >> /etc/audit/rules.d/99-finalize.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.20"] + - cis_csc_v8: ["3.3", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AC-3", "AU-3", "AU-3(1)", "MP-2"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "7.1", "9.4.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:sh -c "grep -iEh ''^\s*\t*-e 2\s*$'' /etc/audit/rules.d/*.rules | tail -1" -> r:^\s*\t*-e 2\s*$' + + # 4.1.3.21 Ensure the running and on disk configuration is the same. (Manual) + - id: 31106 + title: "Ensure the running and on disk configuration is the same." + description: "The Audit system have both on disk and running configuration. It is possible for these configuration settings to differ. Note: Due to the limitations of augenrules and auditctl, it is not absolutely guaranteed that loading the rule sets via augenrules --load will result in all rules being loaded or even that the user will be informed if there was a problem loading the rules." + rationale: "Configuration differences between what is currently running and what is on disk could cause unexpected problems or may give a false impression of compliance requirements." + remediation: 'If the rules are not aligned across all three () areas, run the following command to merge and load all rules: # augenrules --load Check if reboot is required. if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then echo "Reboot required to load rules"; fi.' + compliance: + - cis: ["4.1.3.21"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:augenrules --check -> r:^\s*/usr/sbin/augenrules && r:No change$' + + # 4.1.4.1 Ensure audit log files are mode 0640 or less permissive. (Automated) -Not Implemented + # 4.1.4.2 Ensure only authorized users own audit log files (Automated) - Not Implemented + + # 4.1.4.3 Ensure only authorized groups are assigned ownership of audit log files (Automated) + - id: 31107 + title: "Ensure only authorized groups are assigned ownership of audit log files." + description: "Audit log files contain information about the system and system activity." + rationale: "Access to audit records can reveal system and configuration data to attackers, potentially compromising its confidentiality." + remediation: "Run the following command to configure the audit log files to be owned by adm group: # find $(dirname $(awk -F\"=\" '/^\\s*log_file\\s*=\\s*/ {print $2}' /etc/audit/auditd.conf | xargs)) -type f \\( ! -group adm -a ! -group root \\) -exec chgrp adm {} + Run the following command to configure the audit log files to be owned by the adm group: # chgrp adm /var/log/audit/ Run the following command to set the log_group parameter in the audit configuration file to log_group = adm: # sed -ri 's/^\\s*#?\\s*log_group\\s*=\\s*\\S+(\\s*#.*)?.*$/log_group = adm\\1/' /etc/audit/auditd.conf Run the following command to restart the audit daemon to reload the configuration file: # systemctl restart auditd." + compliance: + - cis: ["4.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*log_group\s*\t*=\s*\t*adm|^\s*\t*log_group\s*\t*=\s*\t*root' + - 'c:sh -c "DIR_NAME=$(awk -F\"=\" ''/^\s*\t*log_file\s*\t*/ {print $2}'' /etc/audit/auditd.conf); stat -c \"%G\" $DIR_NAME" -> r:adm|root' + + # 4.1.4.4 Ensure the audit log directory is 0750 or more restrictive (Automated) - Not Implemented + + # 4.1.4.5 Ensure audit configuration files are 640 or more restrictive (Automated) + - id: 31108 + title: "Ensure audit configuration files are 640 or more restrictive." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to remove more permissive mode than 0640 from the audit configuration files: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) -exec chmod u-x,g-wx,o-rwx {} +." + compliance: + - cis: ["4.1.4.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:sh -c "stat -Lc \"%n %a\" /etc/audit/*.rules" -> r:^/etc/audit && !r:640|600|400' + - 'not c:sh -c "stat -Lc \"%n %a\" /etc/audit/*.conf" -> r:^/etc/audit && !r:640|600|400' + + # 4.1.4.6 Ensure audit configuration files are owned by root (Automated) + - id: 31109 + title: "Ensure audit configuration files are owned by root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change ownership to root user: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -user root -exec chown root {} +." + compliance: + - cis: ["4.1.4.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:sh -c "stat -Lc \"%n %U\" /etc/audit/*.rules" -> r:^/etc/audit && !r:root' + - 'not c:sh -c "stat -Lc \"%n %U\" /etc/audit/*.conf" -> r:^/etc/audit && !r:root' + + # 4.1.4.7 Ensure audit configuration files belong to group root (Automated) + - id: 31110 + title: "Ensure audit configuration files belong to group root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change group to root: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -group root -exec chgrp root {} +." + compliance: + - cis: ["4.1.4.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:sh -c "stat -Lc \"%n %G\" /etc/audit/*.rules" -> r:^/etc/audit && !r:root' + - 'not c:sh -c "stat -Lc \"%n %G\" /etc/audit/*.conf" -> r:^/etc/audit && !r:root' + + # 4.1.4.8 Ensure audit tools are 755 or more restrictive (Automated) + - id: 31111 + title: "Ensure audit tools are 755 or more restrictive." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + + # 4.1.4.9 Ensure audit tools are owned by root (Automated) + - id: 31112 + title: "Ensure audit tools are owned by root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to change the owner of the audit tools to the root user: # chown root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:stat -c "%n %u %U %g %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:0 root 0 root' + + # 4.1.4.10 Ensure audit tools belong to group root (Automated) + - id: 31113 + title: "Ensure audit tools belong to group root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules Run the following command to change owner and group of the audit tools to root user and group: # chown root:root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.10"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %u %U %g %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:0 root 0 root' + + ############################################################ + # 4.2 Configure Logging + ############################################################ + + ############################################################ + # 4.2.1 Configure rsyslog + ############################################################ + # 4.2.1.1 Ensure rsyslog is installed. (Automated) + - id: 31114 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is recommended in environments where journald does not meet operation requirements." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # dnf install rsyslog." + compliance: + - cis: ["4.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["T1005", "T1070", "1070.002"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:rpm -q rsyslog -> r:^\s*\t*rsyslog-' + - 'not c:rpm -q rsyslog -> r:^\s*\t*package rsyslog is not installed$' + + # 4.2.1.2 Ensure rsyslog service is enabled. (Automated) + - id: 31115 + title: "Ensure rsyslog service is enabled." + description: "Once the rsyslog package is installed, ensure that the service is enabled." + rationale: "If the rsyslog service is not enabled to start on boot, the system will not capture logging events." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["T1070", "T1070.002", "T1211", "T1562", "1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:^enabled$" + + # 4.2.1.3 Ensure journald is configured to send logs to rsyslog. (Manual) + - id: 31116 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the RSyslog service provides a consistent means of log collection and export." + rationale: "IF RSyslog is the preferred method for capturing logs, all logs of the system should be sent to it for further processing. Note: This recommendation only applies if rsyslog is the chosen method for client side logging. Do not apply this recommendation if journald is used." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.3"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AC-3", "AU-12", "AU-2", "AU-4", "MP-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006", "T1565"] + - mitre_tactics: ["TA0040"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + + # 4.2.1.4 Ensure rsyslog default file permissions are configured. (Automated) + - id: 31117 + title: "Ensure rsyslog default file permissions are configured." + description: "RSyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + impact: "The systems global umask could override, but only making the file permissions stricter, what is configured in RSyslog with the FileCreateMode directive. RSyslog also has it's own $umask directive that can alter the intended file creation mode. In addition, consideration should be given to how FileCreateMode is used. Thus it is critical to ensure that the intended file creation mode is not overridden with less restrictive settings in /etc/rsyslog.conf, /etc/rsyslog.d/*conf files and that FileCreateMode is set before any file is created." + remediation: "Edit either /etc/rsyslog.conf or a dedicated .conf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640 Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.4"] + - cis_csc_v8: ["3.3", "8.2"] + - cis_csc_v7: ["5.1", "6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)", "164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 0640|^\$FileCreateMode 0600|^\$FileCreateMode 0400' + - 'd:/etc/rsyslog.d/ -> r:\.+.conf -> r:^\$FileCreateMode 0640|^\$FileCreateMode 0600|^\$FileCreateMode 0400' + + # 4.2.1.5 Ensure logging is configured. (Manual) - Not Implemented + # 4.2.1.6 Ensure rsyslog is configured to send logs to a remote log host. (Manual) - Not Implemented + + # 4.2.1.7 Ensure rsyslog is not configured to receive logs from a remote client. (Automated) + - id: 31118 + title: "Ensure rsyslog is not configured to receive logs from a remote client." + description: "RSyslog supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: 'Should there be any active log server configuration found in the auditing section, modify those file and remove the specific lines highlighted by the audit. Ensure none of the following entries are present in any of /etc/rsyslog.conf or /etc/rsyslog.d/*.conf. Old format $ModLoad imtcp $InputTCPServerRun New format module(load="imtcp") input(type="imtcp" port="514") Restart the service: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.7"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - 'not d:/etc/rsyslog.d -> r:\.+.conf$ -> r:^\s*\t*\$ModLoad imtcp|\s*\t*^\$InputTCPServerRun|^\s*\t*module load="imtcp"|^\s*\t*input type="imtcp" port="514"' + - 'not f:/etc/rsyslog.conf -> r:^\s*\t*\$ModLoad imtcp|^\s*\t*\$InputTCPServerRun|^\s*\t*module load="imtcp"|^\s*\t*input type="imtcp" port="514"' + + ############################################################ + # 4.2.2 Configure journald + ############################################################ + + # 4.2.2.1.1 Ensure systemd-journal-remote is installed. (Manual) + - id: 31119 + title: "Ensure systemd-journal-remote is installed." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to install systemd-journal-remote: # dnf install systemd-journal-remote." + compliance: + - cis: ["4.2.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - 'c:rpm -q systemd-journal-remote -> r:^\s*\t*systemd-journal-remote-' + - 'not c:rpm -q systemd-journal-remote -> r:^\s*\t*package systemd-journal-remote is not installed$' + + # 4.2.2.1.2 Ensure systemd-journal-remote is configured. (Manual) - Not Implemented + + # 4.2.2.1.3 Ensure systemd-journal-remote is enabled. (Manual) + - id: 31120 + title: "Ensure systemd-journal-remote is enabled." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to enable systemd-journal-remote: # systemctl --now enable systemd-journal-upload.service." + compliance: + - cis: ["4.2.2.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "CM-7", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - 'c:systemctl is-enabled systemd-journal-upload.service -> r:^\s*\t*enabled$' + + # 4.2.2.1.4 Ensure journald is not configured to receive logs from a remote client. (Automated) + - id: 31121 + title: "Ensure journald is not configured to receive logs from a remote client." + description: "Journald supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts. NOTE: - The same package, systemd-journal-remote, is used for both sending logs to remote hosts and receiving incoming logs. - With regards to receiving logs, there are two services; systemd-journal- remote.socket and systemd-journal-remote.service." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: "Run the following command to disable systemd-journal-remote.socket: # systemctl --now mask systemd-journal-remote.socket." + compliance: + - cis: ["4.2.2.1.4"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - 'c:systemctl is-enabled systemd-journal-remote.socket -> r:^\s*\t*masked$' + + # 4.2.2.2 Ensure journald service is enabled. (Automated) + - id: 31122 + title: "Ensure journald service is enabled." + description: "Ensure that the systemd-journald service is enabled to allow capturing of logging events." + rationale: "If the systemd-journald service is not enabled to start on boot, the system will not capture logging events." + remediation: "By default the systemd-journald service does not have an [Install] section and thus cannot be enabled / disabled. It is meant to be referenced as Requires or Wants by other unit files. As such, if the status of systemd-journald is not static, investigate why." + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journald.service -> r:static" + + # 4.2.2.3 Ensure journald is configured to compress large log files. (Automated) + - id: 31123 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.3", "6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1053"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Compress\s*\t*=\s*\t*yes' + + # 4.2.2.4 Ensure journald is configured to write logfiles to persistent disk. (Automated) + - id: 31124 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss due to a reboot." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Storage\s*\t*=\s*\t*persistent' + + # 4.2.2.5 Ensure journald is not configured to send logs to rsyslog. (Manual) + - id: 31125 + title: "Ensure journald is not configured to send logs to rsyslog." + description: "Data from journald should be kept in the confines of the service and not forwarded on to other services." + rationale: "IF journald is the method for capturing logs, all logs of the system should be handled by journald and not forwarded to other logging mechanisms. Note: This recommendation only applies if journald is the chosen method for client side logging. Do not apply this recommendation if rsyslog is used." + remediation: "Edit the /etc/systemd/journald.conf file and ensure that ForwardToSyslog=yes is removed. Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.5"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - 'not f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + + # 4.2.2.6 Ensure journald log rotation is configured per site policy. (Manual) - Not Implemented + # 4.2.2.7 Ensure journald default file permissions configured. (Manual) - Not Implemented + # 4.2.3 Ensure permissions on all logfiles are configured. (Automated) - Not Implemented + # 4.3 Ensure logrotate is configured. (Manual) - Not Implemented + + ############################################################ + # 5 Access, Authentication and Authorization + ############################################################ + + #################################################### + # 5.1 Configure time-based job schedulers. + #################################################### + + # 5.1.1 Ensure cron daemon is enabled. (Automated) + - id: 31126 + title: "Ensure cron daemon is enabled." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: # systemctl --now enable crond." + compliance: + - cis: ["5.1.1"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:systemctl is-enabled crond -> r:^\s*\t*enabled$' + + # 5.1.2 Ensure permissions on /etc/crontab are configured. (Automated) + - id: 31127 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab." + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured. (Automated) + - id: 31128 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : # chown root:root /etc/cron.hourly # chmod og-rwx /etc/cron.hourly." + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access:\s*\(0\d00/d\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured. (Automated) + - id: 31129 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily." + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access:\s*\(0\d00/drwx------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured. (Automated) + - id: 31130 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : # chown root:root /etc/cron.weekly # chmod og-rwx /etc/cron.weekly." + compliance: + - cis: ["5.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access:\s*\(0\d00/d\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured. (Automated) + - id: 31131 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly." + compliance: + - cis: ["5.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access:\s*\(0\d00/d\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured. (Automated) + - id: 31132 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab , but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d." + compliance: + - cis: ["5.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access:\s*\(0\d00/d\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)$' + + # 5.1.8 Ensure cron is restricted to authorized users. (Automated) + - id: 31133 + title: "Ensure cron is restricted to authorized users." + description: "If cron is installed in the system, configure /etc/cron.allow to allow specific users to use these services. If /etc/cron.allow does not exist, then /etc/cron.deny is checked. Any user not specifically defined in those files is allowed to use cron. By removing the file, only users in /etc/cron.allow are allowed to use cron. Note: Even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: 'Run the following script to remove /etc/cron.deny, create /etc/cron.allow, and set the file mode on /etc/cron.allow: #!/usr/bin/env bash { if rpm -q cronie >/dev/null; then [ -e /etc/cron.deny ] && rm -f /etc/cron.deny [ ! -e /etc/cron.allow ] && touch /etc/cron.allow chown root:root /etc/cron.allow chmod u-x,go-rwx /etc/cron.allow else echo "cron is not installed on the system" fi } OR Run the following command to remove cron: # dnf remove cronie.' + compliance: + - cis: ["5.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - "f:/etc/cron.allow" + - "not f:/etc/cron.deny" + - 'c:stat -L /etc/cron.allow -> r:^Access:\s*\(0\d\d0/-\w\w\w\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)$' + + # 5.1.9 Ensure at is restricted to authorized users. (Automated) + - id: 31134 + title: "Ensure at is restricted to authorized users." + description: "If at is installed in the system, configure /etc/at.allow to allow specific users to use these services. If /etc/at.allow does not exist, then /etc/at.deny is checked. Any user not specifically defined in those files is allowed to use at. By removing the file, only users in /etc/at.allow are allowed to use at. Note: Even though a given user is not listed in at.allow, at jobs can still be run as that user. The at.allow file only controls administrative access to the at command for scheduling and modifying at jobs." + rationale: "On many systems, only the system administrator is authorized to schedule at jobs. Using the at.allow file to control who can run at jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: 'Run the following script to remove /etc/at.deny, create /etc/at.allow, and set the file mode for /etc/at.allow: #!/usr/bin/env bash { if rpm -q at >/dev/null; then [ -e /etc/at.deny ] && rm -f /etc/at.deny [ ! -e /etc/at.allow ] && touch /etc/at.allow chown root:root /etc/at.allow chmod u-x,go-rwx /etc/at.allow else echo "at is not installed on the system" fi } OR Run the following command to remove at: # dnf remove at.' + compliance: + - cis: ["5.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - "f:/etc/at.allow" + - "not f:/etc/at.deny" + - 'c:stat -L /etc/at.allow -> r:^Access:\s*\(0\d\d0/-\w\w\w\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)$' + + #################################################### + # 5.2 Configure SSH Server + #################################################### + + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured. (Automated) + - id: 31135 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1098", "T1098.004", "T1543", "T1543.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)$' + + # 5.2.2 Ensure permissions on SSH private host key files are configured. (Automated) - Not Implemented + # 5.2.3 Ensure permissions on SSH public host key files are configured. (Automated) - Not Implemented + + # 5.2.4 Ensure SSH access is limited. (Automated) + - id: 31136 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: o The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: o The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: o The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: o The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set one or more of the parameters as follows: AllowUsers -OR- AllowGroups -OR- DenyUsers -OR- DenyGroups ." + compliance: + - cis: ["5.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1021", "T1021.004"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowUsers\s+\w+|^\s*AllowGroups\s+\w+|^\s*DenyUsers\s+\w+|^\s*DenyGroups\s+\w+' + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowUsers\s+\w+|^\s*AllowGroups\s+\w+|^\s*DenyUsers\s+\w+|^\s*DenyGroups\s+\w+' + + # 5.2.5 Ensure SSH LogLevel is appropriate. (Automated) + - id: 31137 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: 'Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the LogLevel parameter as follows: LogLevel VERBOSE OR LogLevel INFO Run the following command to comment out any LogLevel parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than VERBOSE or INFO: # grep -Pi ''^\\h*LogLevel\\b'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi ''(VERBOSE|INFO)'' | while read -r l_out; do sed -ri \"/^\\s*LogLevel\\s+/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + references: + - "https://www.ssh.com/ssh/sshd_config/" + compliance: + - cis: ["5.2.5"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*LogLevel\s+INFO|^\s*\t*LogLevel\s+VERBOSE' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*LogLevel\s+INFO|^\s*\t*LogLevel\s+VERBOSE' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*LogLevel\s+ && !r:INFO|VERBOSE' + + # 5.2.6 Ensure SSH PAM is enabled. (Automated) + - id: 31138 + title: "Ensure SSH PAM is enabled." + description: 'UsePAM Enables the Pluggable Authentication Module interface. If set to "yes" this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types.' + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + impact: "If UsePAM is enabled, you will not be able to run sshd(8) as a non-root user." + remediation: 'Edit or create a file in the directory /etc/ssh/sshd_config.d/ ending in *.conf or the /etc/ssh/sshd_config file and set the parameter as follows: UsePAM yes Run the following command to comment out any UsePAM parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than yes # grep -Pi ''^\\h*UsePAM\\b'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi ''yes'' | while read -r l_out; do sed -ri \"/^\\s*UsePAM\\s+/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + compliance: + - cis: ["5.2.6"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1021", "T1021.004"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1035"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*usepam\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*usepam\s+no' + + # 5.2.7 Ensure SSH root login is disabled. (Automated) + - id: 31139 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: 'Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the PermitRootLogin parameter as follows: PermitRootLogin no Run the following command to comment out any PermitRootLogin parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi ''^\\h*PermitRootLogin\\b'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi ''no'' | while read -r l_out; do sed -ri \"/^\\s*PermitRootLogin\\s+/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + compliance: + - cis: ["5.2.7"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + - mitre_techniques: ["T1021"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*PermitRootLogin\s+no' + - 'f:/etc/ssh/sshd_config -> r:^\s*\t*PermitRootLogin\s+no' + + # 5.2.8 Ensure SSH HostbasedAuthentication is disabled. (Automated) + - id: 31140 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: 'Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the HostbasedAuthentication parameter as follows: HostbasedAuthentication no Run the following command to comment out any HostbasedAuthentication parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no: # grep -Pi ''^\\h*HostbasedAuthentication\\b'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi ''no'' | while read -r l_out; do sed -ri \"/^\\s*HostbasedAuthentication\\s+/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + compliance: + - cis: ["5.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*HostbasedAuthentication\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*HostbasedAuthentication\s+yes' + + # 5.2.9 Ensure SSH PermitEmptyPasswords is disabled. (Automated) + - id: 31141 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: 'Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the PermitEmptyPasswords parameter as follows: PermitEmptyPasswords no Run the following command to comment out any PermitEmptyPasswords parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi ''^\\h*PermitEmptyPasswords\\b'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi ''no'' | while read -r l_out; do sed -ri \"/^\\s*PermitEmptyPasswords\\s+/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + compliance: + - cis: ["5.2.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1021"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*PermitEmptyPasswords\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*PermitEmptyPasswords\s+yes' + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled. (Automated) + - id: 31142 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)." + remediation: 'Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the PermitUserEnvironment parameter as follows: PermitUserEnvironment no Run the following command to comment out any PermitUserEnvironment parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi ''^\\h*PermitUserEnvironment\\b'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi ''no'' | while read -r l_out; do sed -ri \"/^\\s*PermitUserEnvironment\\s+/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + compliance: + - cis: ["5.2.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1021"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*PermitUserEnvironment\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*PermitUserEnvironment\s+yes' + + # 5.2.11 Ensure SSH IgnoreRhosts is enabled. (Automated) + - id: 31143 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: 'Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the IgnoreRhosts parameter as follows: IgnoreRhosts yes Run the following command to comment out any IgnoreRhosts parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than yes # grep -Pi ''^\\h*IgnoreRhosts\\b'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi ''yes'' | while read -r l_out; do sed -ri \"/^\s*IgnoreRhosts\s+/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + compliance: + - cis: ["5.2.11"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*IgnoreRhosts\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*IgnoreRhosts\s+no' + + # 5.2.12 Ensure SSH X11 forwarding is disabled. (Automated) + - id: 31144 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: 'Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the X11Forwarding parameter as follows: X11Forwarding no Run the following command to comment out any X11Forwarding parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi ''^\\h*X11Forwarding\\b'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi ''no'' | while read -r l_out; do sed -ri \"/^\\s*X11Forwarding\\s+/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + compliance: + - cis: ["5.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1210"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*X11Forwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*X11Forwarding\s+yes' + + # 5.2.13 Ensure SSH AllowTcpForwarding is disabled. (Automated) + - id: 31145 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments that employ mainframe systems as their application backends. In those environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: 'Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the AllowTcpForwarding parameter as follows: AllowTcpForwarding no Run the following command to comment out any AllowTcpForwarding parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no: # grep -Pi ''^\\h*AllowTcpForwarding\\b'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi ''no'' | while read -r l_out; do sed -ri "/^\\s*AllowTcpForwarding\\s+/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + references: + - "https://www.ssh.com/ssh/tunneling/example" + compliance: + - cis: ["5.2.13"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1048", "T1048.002", "T1572"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*AllowTcpForwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*AllowTcpForwarding\s+yes' + + # 5.2.14 Ensure system-wide crypto policy is not over-ridden. (Automated) + - id: 31146 + title: "Ensure system-wide crypto policy is not over-ridden." + description: "System-wide Crypto policy can be over-ridden or opted out of for openSSH." + rationale: "Over-riding or opting out of the system-wide crypto policy could allow for the use of less secure Ciphers, MACs, KexAlgorithms and GSSAPIKexAlgorithm." + remediation: "Run the following commands: # sed -ri \"s/^\\s*(CRYPTO_POLICY\\s*=.*)$/# \\1/\" /etc/sysconfig/sshd # systemctl reload sshd." + compliance: + - cis: ["5.2.14"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["SC-8"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'not f:/etc/sysconfig/sshd -> r:^\s*CRYPTO_POLICY\s*=' + + # 5.2.15 Ensure SSH warning banner is configured. (Automated) + - id: 31147 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the Banner parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.2.15"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_tactics: ["TA0001", "TA0007"] + - mitre_mitigations: ["M1035"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*\t*banner\s*\t*/' + - 'f:/etc/ssh/sshd_config -> r:^\s*\t*banner\s*\t*/' + + # 5.2.16 Ensure SSH MaxAuthTries is set to 4 or less. (Automated) + - id: 31148 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: 'Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the MaxAuthTries parameter as follows: MaxAuthTries 4 Run the following command to comment out any MaxAuthTries parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting greater than 4: # grep -Pi ''^\\h*maxauthtries\\h+([5-9]|[1-9][0-9]+)'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*maxauthtries\\s+([5-9]|[1-9][0-9]+)/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + compliance: + - cis: ["5.2.16"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1036"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*\t*MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxAuthTries\s*\t*(\d+) compare > 4' + + # 5.2.17 Ensure SSH MaxStartups is configured. (Automated) + - id: 31149 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: 'Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the MaxStartups parameter as follows: MaxStartups 10:30:60 Run the following command to comment out any MaxStartups parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting greater than 10:30:60: # grep -Pi ''^\\s*maxstartups\\s+(((1[1-9]|[1-9][0-9][0-9]+):([0-9]+):([0-9]+))|(([0-9]+):(3[1-9]|[4-9][0-9]|[1-9][0-9][0-9]+):([0-9]+))|(([0-9]+):([0-9]+):(6[1-9]|[7-9][0-9]|[1-9][0-9][0-9]+)))'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*MaxStartups\\s+(((1[1-9]|[1-9][0-9][0-9]+):([0-9]+):([0-9]+))|(([0-9]+):(3[1-9]|[4-9][0-9]|[1-9][0-9][0-9]+):([0-9]+))|(([0-9]+):([0-9]+):(6[1-9]|[7-9][0-9]|[1-9][0-9][0-9]+)))/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + compliance: + - cis: ["5.2.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1499", "T1499.002"] + - mitre_tactics: ["TA0040"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*\t*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'c:sshd -T -> n:^\s*\t*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'c:sshd -T -> n:^\s*\t*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s+(\d+):\d+:\d+ compare > 10' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s+\d+:(\d+):\d+ compare > 30' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s+\d+:\d+:(\d+) compare > 60' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + + # 5.2.18 Ensure SSH MaxSessions is set to 10 or less. (Automated) + - id: 31150 + title: "Ensure SSH MaxSessions is set to 10 or less." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: 'Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the MaxSessions parameter as follows: MaxSessions 10 Run the following command to comment out any MaxSessions parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting greater than 10 # grep -Pi ''^\\s*MaxSessions\\s+(1[1-9]|[2-9][0-9]|[1-9][0-9][0-9]+)'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*MaxSessions\\s+(1[1-9]|[2-9][0-9]|[1-9][0-9][0-9]+)/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + compliance: + - cis: ["5.2.18"] + - mitre_techniques: ["T1499", "T1499.002"] + - mitre_tactics: ["TA0040"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*\t*maxsessions\s+(\d+) compare <= 10' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*maxsessions\s+(\d+) compare <= 10' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*maxsessions\s+(\d+) compare > 10' + + # 5.2.19 Ensure SSH LoginGraceTime is set to one minute or less. (Automated) + - id: 31151 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: 'Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60 Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the LoginGraceTime parameter as follows: LoginGraceTime 60 -or- LoginGraceTime 1m Run the following command to comment out any LoginGraceTime parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting equal to 0 or greater than 60 seconds: # grep -Pi ''^\\s*LoginGraceTime\\s+(0|6[1-9]|[7-9][0-9]|[1-9][0-9][0-9]+|[^1]m)'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\s*LoginGraceTime\s+(0|6[1-9]|[7-9][0-9]|[1-9][0-9][0-9]+|[^1]m)/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + compliance: + - cis: ["5.2.19"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003", "T1110.004", "T1499", "T1499.002"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1036"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*\t*logingracetime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*logingracetime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + + # 5.2.20 Ensure SSH Idle Timeout Interval is configured. (Automated) + - id: 31152 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. - ClientAliveInterval sets 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 default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax sets the number of client alive messages which may be sent without sshd receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. The default value is 3. o The client alive messages are sent through the encrypted channel o Setting ClientAliveCountMax to 0 disables connection termination Example: The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value reduces this risk. - The recommended ClientAliveInterval setting is no greater than 900 seconds (15 minutes) - The recommended ClientAliveCountMax setting is 0 - At the 15 minute interval, if the ssh session is inactive, the session will be terminated." + impact: "In some cases this setting may cause termination of long-running scripts over SSH or remote automation tools which rely on SSH. In developing the local site policy, the requirements of such scripts should be considered and appropriate ServerAliveInterval and ClientAliveInterval settings should be calculated to insure operational continuity." + remediation: 'Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the ClientAliveInterval and ClientAliveCountMax parameters according to site policy. Example: ClientAliveInterval 15 ClientAliveCountMax 3 Edit files ending in *.conf in the /etc/ssh/sshd_config.d/ directory and the /etc/ssh/sshd_config file and remove occurrences of the ClientAliveInterval and ClientAliveCountMax parameters not in accordence with local site policy. Run the following command to comment out any ClientAliveCountMax parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include the setting of 0 \"disabled\": # grep -Pi ''^\\h*ClientAliveCountMax\\h+0\\b'' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*ClientAliveCountMax\\s+0/s/^/# /\" \"$(awk -F: ''{print $1}'' <<< $l_out)\";done.' + references: + - "https://man.openbsd.org/sshd_config" + compliance: + - cis: ["5.2.20"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*\t*clientaliveinterval\s*\t*(\d+) compare > 0' + - 'c:sshd -T -> n:^\s*\t*clientalivecountmax\s*\t*(\d+) compare > 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*clientaliveinterval\s*\t*(\d+) compare > 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*clientalivecountmax\s*\t*(\d+) compare > 0' + + #################################################### + # 5.3 Configure privilege escalation + #################################################### + + # 5.3.1 Ensure sudo is installed. (Automated) + - id: 31153 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plug-in architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plug-ins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers and any entries in /etc/sudoers.d. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo # dnf install sudo." + compliance: + - cis: ["5.3.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - "c:dnf list installed| grep sudo -> r:^sudo.x86_64" + + # 5.3.2 Ensure sudo commands use pty. (Automated) + - id: 31154 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo terminal (pseudo-pty)." + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: "Edit the file /etc/sudoers with visudo or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["5.3.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + - mitre_techniques: ["T1078", "T1078.003", "T1548", "T1548.003"] + - mitre_tactics: ["TA0001", "TA0003"] + - mitre_mitigations: ["M1026", "M1038"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*use_pty' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*use_pty' + + # 5.3.3 Ensure sudo log file exists. (Automated) + - id: 31155 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: 'Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile="" Example Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["5.3.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1026"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*logfile=' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*logfile=' + + # 5.3.4 Ensure users must provide password for escalation. (Automated) + - id: 31156 + title: "Ensure users must provide password for escalation." + description: "The operating system must be configured so that users must provide a password for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + impact: "This will prevent automated processes from being able to elevate privileges. To include Ansible and AWS builds." + remediation: "Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any line with occurrences of NOPASSWD tags in the file." + compliance: + - cis: ["5.3.4"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*\t*# && r:NOPASSWD' + - 'd:/etc/sudoers.d -> r:\.* -> !r:^\s*\t*# && r:NOPASSWD' + + # 5.3.5 Ensure re-authentication for privilege escalation is not disabled globally. (Automated) + - id: 31157 + title: "Ensure re-authentication for privilege escalation is not disabled globally." + description: "The operating system must be configured so that users must re-authenticate for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + remediation: "Configure the operating system to require users to reauthenticate for privilege escalation. Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any occurrences of !authenticate tags in the file(s)." + compliance: + - cis: ["5.3.5"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*\t*# && r:!authenticate' + - 'd:/etc/sudoers.d -> r:\.* -> !r:^\s*\t*# && r:!authenticate' + + # 5.3.6 Ensure sudo authentication timeout is configured correctly. (Automated) + - id: 31158 + title: "Ensure sudo authentication timeout is configured correctly." + description: "sudo caches used credentials for a default of 5 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized privileged access to another user." + remediation: "If the currently configured timeout is larger than 15 minutes, edit the file listed in the audit section with visudo -f and modify the entry timestamp_timeout= to 15 minutes or less as per your site policy. The value is in minutes. This particular entry may appear on its own, or on the same line as env_reset. See the following two examples: Defaults env_reset, timestamp_timeout=15 Defaults timestamp_timeout=15 Defaults env_reset." + references: + - "https://www.sudo.ws/man/1.9.0/sudoers.man.html" + compliance: + - cis: ["5.3.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'c:sudo -V -> r:Authentication timestamp timeout:\s*\t*15.0 minutes' + - 'f:/etc/sudoers -> n:timestamp_timeout=(\d+) compare < 15' + + # 5.3.7 Ensure access to the su command is restricted. (Automated) + - id: 31159 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.3.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1078"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_wheel.so && r:use_uid && r:group=\w+' + + #################################################### + # 5.4 Configure authselect + #################################################### + + # 5.4.1 Ensure custom authselect profile is used. (Manual) - Not Implemented + + # 5.4.2 Ensure authselect includes with-faillock. (Automated) + - id: 31160 + title: "Ensure authselect includes with-faillock." + description: "The pam_faillock.so module maintains a list of failed authentication attempts per user during a specified interval and locks the account in case there were more than deny consecutive failed authentications. It stores the failure records into per-user files in the tally directory." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Run the following commands to include the with-faillock option to the current authselect profile: # authselect enable-feature with-faillock # authselect apply-changes." + compliance: + - cis: ["5.4.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_faillock.so\s*preauth\s*silent' + - 'f:/etc/pam.d/password-auth -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_faillock.so\s*authfail' + - 'f:/etc/pam.d/password-auth -> !r:^\s*\t*# && r:account\s*\t*required\s*\t*pam_faillock.so' + - 'f:/etc/pam.d/system-auth -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_faillock.so\s*preauth\s*silent' + - 'f:/etc/pam.d/system-auth -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_faillock.so\s*authfail' + - 'f:/etc/pam.d/system-auth -> !r:^\s*\t*# && r:account\s*\t*required\s*\t*pam_faillock.so' + + #################################################### + # 5.5 Configure PAM + #################################################### + + # 5.5.1 Ensure password creation requirements are configured. (Automated) + - id: 31161 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. - minlen=14 - password must be 14 characters or more ** Either of the following can be used to enforce complex passwords:** - minclass=4 - provide at least four classes of characters for the new password OR - dcredit=-1 - provide at least one digit - ucredit=-1 - provide at least one uppercase character - ocredit=-1 - provide at least one special character - lcredit=-1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Run the following script to update the system-auth and password-auth files #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+.*enforce_for_r oot\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 enforce_for_root/' \"$file\" fi if grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=([4-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then sed -ri '/pwquality/s/retry=\\S+/retry=3/' \"$file\" elif ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 retry=3/' \"$file\" fi done authselect apply-changes." + compliance: + - cis: ["5.5.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - mitre_techniques: ["T1178.001", "T1178.002", "T1178.003", "T1178.004", "T1110", "T1110.001", "T1110.002", "T1110.003"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> !r:^\s*\t*# && r:password\s*\t*requisite\s*\t*pam_pwquality.so\s*try_first_pass\s*local_users_only\s*enforce_for_root\s*retry=3' + - 'f:/etc/pam.d/system-auth -> !r:^\s*\t*# && r:password\s*\t*requisite\s*\t*pam_pwquality.so\s*try_first_pass\s*local_users_only\s*enforce_for_root\s*retry=3' + - 'f:/etc/security/pwquality.conf -> !r:^\s*\t*# && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> !r:^\s*\t*# && n:minclass\s*\t*=\s*\t*(\d+) compare >=4' + + # 5.5.2 Ensure lockout for failed password attempts is configured. (Automated) + - id: 31162 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. - deny= - Number of attempts before the account is locked - unlock_time= - Time in seconds before the account is unlocked Note: The maximum configurable value for unlock_time is 604800." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Set password lockouts and unlock times to conform to site policy. deny should be not greater than 5 and unlock_time should be 0 (never), or 900 seconds or greater. Depending on the version you are running, follow one of the two methods bellow. Versions 8.2 and later: Edit /etc/security/faillock.conf and update or add the following lines: deny = 5 unlock_time = 900 Versions 8.0 and 8.1: Run the following script to update the system-auth and password-auth files. This script will update/add the deny=5 and unlock_time=900 options. This script should be modified as needed to follow local site policy. #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if grep -Pq -- '^\\h*auth\\h+required\\h+pam_faillock\\.so(\\h+[^#\\n\\r]+)?\\h+deny=(0|[6-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then sed -ri '/pam_faillock.so/s/deny=\\S+/deny=5/g' \"$file\" elif ! grep -Pq -- '^\\h*auth\\h+required\\h+pam_faillock\\.so(\\h+[^#\\n\\r]+)?\\h+deny=\\d*\\b.*$' \"$file\"; then sed -r 's/^\\s*(auth\\s+required\\s+pam_faillock\\.so\\s+)([^{}#\\n\\r]+)?\\s*(\\{.*\\})?(.*)$ /\\1\\2\\3 deny=5 \\4/' $file fi if grep -P -- '^\\h*(auth\\h+required\\h+pam_faillock\\.so\\h+)([^#\\n\\r]+)?\\h+unlock_time=([1-9]|[1-9][0-9]|[1-8][0-9][0-9])\\b.*$' \"$file\"; then sed -ri '/pam_faillock.so/s/unlock_time=\\S+/unlock_time=900/g' \"$file\" elif ! grep -Pq -- '^\\h*auth\\h+required\\h+pam_faillock\\.so(\\h+[^#\\n\\r]+)?\\h+unlock_time=\\d*\\b.*$ ' \"$file\"; then sed -ri 's/^\\s*(auth\\s+required\\s+pam_faillock\\.so\\s+)([^{}#\\n\\r]+)?\\s*(\\{.*\\})?(.*)$ /\\1\\2\\3 unlock_time=900 \\4/' \"$file\" fi done authselect apply-changes." + compliance: + - cis: ["5.5.2"] + - cis_csc_v8: ["6.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1"] + - hipaa: ["164.308(a)(3)(ii)(C)"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["AC-2(1)"] + - pci_dss_v3.2.1: ["8.1.3"] + - pci_dss_v4.0: ["8.2.4", "8.2.5"] + - soc_2: ["CC6.2", "CC6.3"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1027"] + condition: none + rules: + - 'f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:^\s*\t*deny\s*\t*=\s*\t*(\d+) compare > 5' + - 'f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:^\s*\t*deny\s*\t*=\s*\t*(\d+) compare == 0' + - 'not f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:^\s*\t*unlock_time\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:^\s*\t*unlock_time\s*\t*=\s*\t*(\d+) compare == 0' + + # 5.5.3 Ensure password reuse is limited. (Automated) + - id: 31163 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. - remember=<5> - Number of old passwords to remember." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note: These change only apply to accounts configured on the local system." + remediation: "Set remembered password history to conform to site policy. Run the following script to add or modify the pam_pwhistory.so and pam_unix.so lines to include the remember option: #!/usr/bin/env bash { file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/system-auth\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so\\s+([^# \\n\\r]+\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file elif grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?.*$' \"$file\"; then sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so/ s/$/ remember=5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/i password required pam_pwhistory.so remember=5 use_authtok' $file fi fi if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so\\s+([^#\\n\\r] +\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/ s/$/ remember=5/' $file fi fi authselect apply-changes }." + compliance: + - cis: ["5.5.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.004"] + condition: all + rules: + - 'f:/etc/pam.d/system-auth -> !r:^\s*\t*# && r:password\s*\t*requisite\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare => 5' + - 'f:/etc/pam.d/system-auth -> !r:^\s*\t*# && r:password\s*\t*sufficient\s*\t*pam_unix.so && n:remember\s*\t*=\s*\t*(\d+) compare => 5' + + # 5.5.4 Ensure password hashing algorithm is SHA-512. (Automated) + - id: 31164 + title: "Ensure password hashing algorithm is SHA-512." + description: "A cryptographic hash function converts an arbitrary-length input into a fixed length output. Password hashing performs a one-way transformation of a password, turning the password into another string, called the hashed password." + rationale: "The SHA-512 algorithm provides stronger hashing than other hashing algorithms used for password hashing with Linux, providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note: These changes only apply to accounts configured on the local system." + remediation: "Set password hashing algorithm to sha512. Edit /etc/libuser.conf and edit of add the following line: crypt_style = sha512 Edit /etc/login.defs and edit or add the following line: ENCRYPT_METHOD SHA512 Run the following script to configure pam_unix.so to use the sha512 hashing algorithm: #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+sha512\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+(md5|blowfish|bigcrypt|sha256)\\b.*$' \"$file\"; then sed -ri 's/(md5|blowfish|bigcrypt|sha256)/sha512/' \"$file\" else sed -ri 's/(^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix.so\\s+)(.*)$/\\1s ha512 \\3/' $file fi fi done authselect apply-changes Note: This only effects local users and passwords created after updating the files to use sha512. If it is determined that the password algorithm being used is not SHA-512, once it is changed, it is recommended that all user ID's be immediately expired and forced to change their passwords on next login." + compliance: + - cis: ["5.5.4"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1110", "T1110.002"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1041"] + condition: all + rules: + - 'f:/etc/libuser.conf -> r:^\s*\t*crypt_style\s*\t*=\s*\t*sha512' + - 'f:/etc/login.defs -> r:^\s*\t*ENCRYPT_METHOD\s*\t*SHA512' + - 'f:/etc/pam.d/password-auth -> !r:^\s*\t*# && r:password\s*\t*sufficient\s*\t*pam_unix.so && r:sha512' + - 'f:/etc/pam.d/system-auth -> !r:^\s*\t*# && r:password\s*\t*sufficient\s*\t*pam_unix.so && r:sha512' + + # #################################################### + # # 5.6 User Accounts and Environment + # #################################################### + + # #################################################### + # # 5.6.1 Set Shadow Password Suite Parameters. + # #################################################### + + # 5.6.1.1 Ensure password expiration is 365 days or less. (Automated) + - id: 31165 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + compliance: + - cis: ["5.6.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.001", "T1110.002", "T1110.003", "T1110.004"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:\d+:(\d+): compare > 365' + + # 5.6.1.2 Ensure minimum days between password changes is 7 or more. (Automated) + - id: 31166 + title: "Ensure minimum days between password changes is 7 or more." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs : PASS_MIN_DAYS 7 Modify user parameters for all users with a password set to match: # chage --mindays 7 ." + compliance: + - cis: ["5.6.1.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.004"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 1' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:(\d+): compare == 0' + + # 5.6.1.3 Ensure password expiration warning days is 7 or more. (Automated) + - id: 31167 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs : PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["5.6.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1078"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:\d+:\d+:(\d+): compare < 7' + + # 5.6.1.4 Ensure inactive password lock is 30 days or less. (Automated) + - id: 31168 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["5.6.1.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - mitre_techniques: ["T1078", "T1078.002", "T1078.003"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - "not c:useradd -D -> r:^INACTIVE=-1" + - 'not f:/etc/shadow -> n:^\w+:\w+:\w+:\w+:\w+:\w+:(\d+): compare > 30' + - 'not f:/etc/shadow -> r:^\w+:\w+:\w+:\w+:\w+:\w+:-1:' + + # 5.6.1.5 Ensure all users last password change date is in the past. (Automated) - No Implemented + # 5.6.2 Ensure system accounts are secured. (Automated) - Not Implemented + # 5.6.3 Ensure default user shell timeout is 900 seconds or less. (Automated) - Not Implemented + + # 5.6.4 Ensure default group for the root account is GID 0. (Automated) + - id: 31169 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root account belongs to. This affects permissions of files that are created by the root account." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root account default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.6.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1548"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^\s*\t*# && r:root:\w+:\w+:0:' + + # 5.6.5 Ensure default user umask is 027 or more restrictive. (Automated) - Not Implemented + + # 5.6.6 Ensure root password is set. (Automated) + - id: 31170 + title: "Ensure default group for the root account is GID 0." + description: "There are a number of methods to access the root account directly. Without a password set any user would be able to gain access and thus control over the entire system." + rationale: "Access to root should be secured at all times." + remediation: "Set the root password with: # passwd root." + compliance: + - cis: ["5.6.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1078"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - 'c:passwd -S root -> r:Password\s*set' + + #################################################### + # 6 System Maintenance + #################################################### + + #################################################### + # 6.1 System File Permissions + #################################################### + + # 6.1.1 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 31171 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd: # chmod u-x,go-wx /etc/passwd # chown root:root /etc/passwd." + compliance: + - cis: ["6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1003, T1003.008, T1222, T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/passwd -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.2 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 31172 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd: # chmod u-x,go-wx /etc/passwd # chown root:root /etc/passwd." + compliance: + - cis: ["6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1003, T1003.008, T1222, T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/passwd -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.3 Ensure permissions on /etc/passwd- are configured. (Automated) + - id: 31173 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod u-x,go-wx /etc/passwd-." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1003, T1003.008, T1222, T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/passwd- -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.4 Ensure permissions on /etc/group are configured. (Automated) + - id: 31174 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group: # chmod u-x,go-wx /etc/group # chown root:root /etc/group." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1003, T1003.008, T1222, T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/group -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.5 Ensure permissions on /etc/group- are configured. (Automated) + - id: 31175 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group-: # chmod u-x,go-wx /etc/group- # chown root:root /etc/group-." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/group- -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.6 Ensure permissions on /etc/shadow are configured. (Automated) + - id: 31176 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following commands to set mode, owner, and group on /etc/shadow: # chown root:root /etc/shadow # chmod 0000 /etc/shadow." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1003, T1003.008, T1222, T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/shadow -> r:^\s*/etc/shadow\s*\t*0\s*t*0/root\s*\t*0/root$|^\s*/etc/shadow\s*0\s*0\s*root\s*0\s*root$' + + # 6.1.7 Ensure permissions on /etc/shadow- are configured. (Automated) + - id: 31177 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set mode, owner, and group on /etc/shadow-: # chown root:root /etc/shadow- # chmod 0000 /etc/shadow-." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1003, T1003.008, T1222, T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/shadow- -> r:^\s*/etc/shadow-\s*\t*0\s*t*0/root\s*\t*0/root$|^\s*/etc/shadow-\s*0\s*0\s*root\s*0\s*root$' + + # 6.1.8 Ensure permissions on /etc/gshadow are configured. (Automated) + - id: 31178 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run the following commands to set mode, owner, and group on /etc/gshadow: # chown root:root /etc/gshadow # chmod 0000 /etc/gshadow." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1003, T1003.008, T1222, T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/gshadow -> r:^\s*/etc/gshadow\s*\t*0\s*t*0/root\s*\t*0/root$|^\s*/etc/gshadow\s*0\s*0\s*root\s*0\s*root$' + + # 6.1.9 Ensure permissions on /etc/gshadow- are configured. (Automated) + - id: 31179 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set mode, owner, and group on /etc/gshadow-: # chown root:root /etc/gshadow- # chmod 0000 /etc/gshadow-." + compliance: + - cis: ["6.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1003, T1003.008, T1222, T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/gshadow- -> r:^\s*/etc/gshadow-\s*\t*0\s*t*0/root\s*\t*0/root$|^\s*/etc/gshadow-\s*0\s*0\s*root\s*0\s*root$' + + # 6.1.10 Ensure no world writable files exist. (Automated) - Not Implemented + # 6.1.11 Ensure no unowned files or directories exist. (Automated) - Not Implemented + # 6.1.12 Ensure no ungrouped files or directories exist. (Automated) - Not Implemented + + # 6.1.13 Ensure sticky bit is set on all world-writable directories. (Automated) + - id: 31180 + title: "Ensure sticky bit is set on all world-writable directories." + description: "Setting the sticky bit on world writable directories prevents users from deleting or renaming files in that directory that are not owned by them." + rationale: "This feature prevents the ability to delete or rename files in world writable directories (such as /tmp ) that are owned by another user." + remediation: "Run the following command to set the sticky bit on all world writable directories: # df --local -P | awk '{if (NR!=1) print $6}' | xargs -I '{}' find '{}' -xdev -type d \\( -perm -0002 -a ! -perm -1000 \\) 2>/dev/null | xargs -I '{}' chmod a+t '{}'." + compliance: + - cis: ["6.1.13"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + - mitre_techniques: ["T1548"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1028"] + condition: all + rules: + - 'not c:sh -c "df --local -P 2> /dev/null | awk ''{if (NR!=1) print $6}'' | xargs -I ''{}'' find ''{}'' -xdev -type d \\( -perm -0002 -a ! -perm -1000 \\) 2>/dev/null" -> r:^/' + + # 6.1.14 Audit SUID executables. (Manual) + # 6.1.15 Audit SGID executables. (Manual) + # 6.1.16 Audit system file permissions. (Manual) + + #################################################### + # 6.2 User and Group Settings + #################################################### + + # 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords (Automated) + - id: 31181 + title: "Ensure accounts in /etc/passwd use shadowed passwords." + description: "Local accounts can use shadowed passwords. With shadowed passwords, the passwords are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. Accounts with a shadowed password have an x in the second field in /etc/passwd." + rationale: "The /etc/passwd file also contains information like user ID's and group ID's that are used by many system programs. Therefore, the /etc/passwd file must remain world readable. In spite of encoding the password with a randomly-generated one-way hash function, an attacker could still break the system if they got access to the /etc/passwd file. This can be mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. This helps mitigate the risk of an attacker gaining access to the encoded passwords with which to perform a dictionary attack. Note: - All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user. - A user account with an empty second field in /etc/passwd allows the account to be logged into by providing only the username." + remediation: "Run the following command to set accounts to use shadowed passwords: # sed -e 's/^\\([a-zA-Z0-9_]*\\):[^:]*:/\\1:x:/' -i /etc/passwd Investigate to determine if the account is logged in and what it is being used for, to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_techniques: ["T1003", "T1003.008"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'not f:/etc/passwd -> r:^\w+:x:' + + # 6.2.2 Ensure /etc/shadow password fields are not empty. (Automated) + - id: 31182 + title: "Ensure password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'not f:/etc/shadow -> r:^\w+::' + + # 6.2.3 Ensure all groups in /etc/passwd exist in /etc/group - Not implemente + # 6.2.4 Ensure no duplicate UIDs exist - Not implemented + # 6.2.5 Ensure no duplicate GIDs exist - Not implemented + # 6.2.6 Ensure no duplicate user names exist - Not implemented + # 6.2.7 Ensure no duplicate group names exist - Not implemented + # 6.2.8 Ensure root PATH Integrity - Not implemented + + # 6.2.9 Ensure root is the only UID 0 account. (Automated) + - id: 31183 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.9"] + - mitre_techniques: ["T1548"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - 'not f:/etc/passwd -> !r:^\s*\t*# && !r:^root: && r:^\w+:\w+:0:' + + # 6.2.10 Ensure local interactive user home directories exist (Automated) - Not Implemented + # 6.2.11 Ensure local interactive users own their home directories (Automated) - Not Implemented + # 6.2.12 Ensure local interactive user home directories are mode 750 or more restrictive (Automated) - Not Implemented + # 6.2.13 Ensure no local interactive user has .netrc files (Automated) - Not Implemented + # 6.2.14 Ensure no local interactive user has .forward files (Automated) - Not Implemented + # 6.2.15 Ensure no local interactive user has .rhosts files (Automated) - Not Implemented + # 6.2.16 Ensure local interactive user dot files are not group or world writable (Automated) - Not Implemented diff --git a/etc/ruleset/sca/applications/cis_apache_24.yml b/etc/ruleset/sca/applications/cis_apache_24.yml new file mode 100644 index 0000000000..e8d25da4fd --- /dev/null +++ b/etc/ruleset/sca/applications/cis_apache_24.yml @@ -0,0 +1,518 @@ +# Security Configuration Assessment +# CIS Checks for Apache +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for Apache 2.4 v1.5.0 - 06-12-2019 +# +# RPM based distributions locate its Apache configuration files under /etc/httpd +# Otherwise, Debian-based distros do it under /etc/apache2 +# Adapt this policy to each case by commuting the commented block of variables as well as the requirement rules + +policy: + id: "cis_apache" + file: "cis_apache_24.yml" + name: "CIS Apache HTTP Server 2.4 Benchmark v1.5.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Apache Web Server version 2.4 running on Linux." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that Apache is installed on the system. If your Apache installation is located at /etc/apache2, review the policy file" + description: "Requirements for running the SCA scan against the Apache policy." + condition: any + rules: + - "f:/etc/httpd/conf/httpd.conf" +# - 'f:/etc/apache2/apache2.conf' + +variables: + $main-conf: /etc/httpd/conf/httpd.conf + $conf-dirs: /etc/httpd/conf.d,/etc/httpd/modsecurity.d + $ssl-confs: /etc/httpd/conf.d/ssl.conf + $request-confs: /etc/httpd/conf/httpd.conf + $traceen: /etc/httpd/conf/httpd.conf + $enabled-modules: httpd -M + +# In case your installation is located in: /etc/apache2 use this block of variables +#variables: +# $main-conf: /etc/apache2/apache2.conf +# $conf-dirs: /etc/apache2/conf-enabled,/etc/apache2/mods-enabled,/etc/apache2/sites-enabled +# $ssl-confs: /etc/apache2/mods-enabled/ssl.conf +# $request-confs: /etc/apache2/mods-enabled/reqtimeout.conf +# $traceen: /etc/apache2/apache2.conf,/etc/apache2/conf-enabled/security.conf +# $enabled-modules: apachectl -M + +#2.3 Disable WebDAV Modules +checks: + - id: 10000 + title: "Ensure the WebDAV Modules Are Disabled" + description: "The Apache mod_dav and mod_dav_fs modules support WebDAV (Web-based Distributed Authoring and Versioning) functionality for Apache. WebDAV is an extension to the HTTP protocol which allows clients to create, move, and delete files and resources on the web server." + rationale: "Disabling WebDAV modules will improve the security posture of the web server by reducing the amount of potentially vulnerable code paths exposed to the network and reducing potential for unauthorized access to files via misconfigured WebDAV access controls." + remediation: "Perform either one of the following to disable WebDAV module: 1. For source builds with static modules run the Apache ./configure script without including the mod_dav, and mod_dav_fs in the --enable-modules=configure script options. $ cd $DOWNLOAD_HTTPD $ ./configure 2. For dynamically loaded modules comment out or remove the LoadModule directive for mod_dav, and mod_dav_fs modules from the httpd.conf file. ##LoadModule dav_module modules/mod_dav.so ##LoadModule dav_fs_module modules/mod_dav_fs.so" + compliance: + - cis: ["2.3"] + - cis_csc: ["9.1", "9.2"] + references: + - https://httpd.apache.org/docs/2.4/mod/mod_dav.html + condition: none + rules: + - 'c:$enabled-modules -> r:dav_\.+module' + + #2.4 Disable Status Module + - id: 10001 + title: "Ensure the Status Module Is Disabled" + description: "The Apache mod_status module provides current server performance statistics." + rationale: "When mod_status is loaded into the server, its handler capability is available in all configuration files, including per-directory files (e.g., .htaccess). The mod_status module may provide an adversary with information that can be used to refine exploits that depend on measuring server load." + remediation: "Perform either one of the following to disable the mod_status module: 1) For source builds with static modules, run the Apache ./configure script with the --disable-status configure script options. 2) For dynamically loaded modules, comment out or remove the LoadModule directive for the mod_status module from the httpd.conf file. ##LoadModule status_module modules/mod_status.so" + compliance: + - cis: ["2.4"] + - cis_csc: ["9.1", "9.2"] + references: + - https://httpd.apache.org/docs/2.4/mod/mod_status.html + condition: none + rules: + - "c:$enabled-modules -> r:status_module" + + #2.5 Disable Autoindex Module + - id: 10002 + title: "Ensure the Autoindex Module Is Disabled" + description: "The Apache mod_autoindex module automatically generates a web page listing the contents of directories on the server, typically used so an index.html does not have to be generated." + rationale: "Automated directory listings should not be enabled because they will reveal information helpful to an attacker such as naming conventions and directory paths. They may also reveal files that were not intended to be revealed." + remediation: "Perform either one of the following to disable the mod_autoindex module: 1. For source builds with static modules, run the Apache ./configure script with the --disable-autoindex configure script options. $ cd $DOWNLOAD_HTTPD $ ./configure -disable-autoindex. 2. For dynamically loaded modules, comment out or remove the LoadModule directive for mod_autoindex from the httpd.conf file. ## LoadModule autoindex_module modules/mod_autoindex.so" + compliance: + - cis: ["2.5"] + - cis_csc: ["18", "5.1"] + references: + - https://httpd.apache.org/docs/2.4/mod/mod_autoindex.html + condition: none + rules: + - "c:$enabled-modules -> r:autoindex_module" + + #2.6 Disable Proxy Modules + - id: 10003 + title: "Ensure the Proxy Modules Are Disabled" + description: "The Apache proxy modules allow the server to act as a proxy (either forward or reverse proxy) of HTTP and other protocols with additional proxy modules loaded. If the Apache installation is not intended to proxy requests to or from another network then the proxy module should not be loaded." + rationale: "Proxy servers can act as an important security control when properly configured, however a secure proxy server is not within the scope of this benchmark. A web server should be primarily a web server or a proxy server but not both, for the same reasons that other multi-use servers are not recommended. Scanning for web servers that will also proxy requests is a very common attack, as proxy servers are useful for anonymizing attacks on other servers, or possibly proxying requests into an otherwise protected network." + remediation: "Perform either one of the following to disable the proxy module: 1. For source builds with static modules, run the Apache ./configure script without including the mod_proxy in the --enable-modules=configure script options. $ cd $DOWNLOAD_HTTPD $ ./configure 2. For dynamically loaded modules, comment out or remove the LoadModule directive for mod_proxy module and all other proxy modules from the httpd.conf file. ##LoadModule proxy_module modules/mod_proxy.so ##LoadModule proxy_connect_module modules/mod_proxy_connect.so ##LoadModule proxy_ftp_module modules/mod_proxy_ftp.so ##LoadModule proxy_http_module modules/mod_proxy_http.so ##LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so ##LoadModule proxy_scgi_module modules/mod_proxy_scgi.so ##LoadModule proxy_ajp_module modules/mod_proxy_ajp.so ##LoadModule proxy_balancer_module modules/mod_proxy_balancer.so ##LoadModule proxy_express_module modules/mod_proxy_express.so ##LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so ##LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so" + compliance: + - cis: ["2.6"] + - cis_csc: ["9.1", "9.2"] + references: + - https://httpd.apache.org/docs/2.4/mod/mod_proxy.html + condition: none + rules: + - "c:$enabled-modules -> r:proxy_" + + #2.7 Disable User Directories Modules + - id: 10004 + title: "Ensure the User Directories Module Is Disabled" + description: "The UserDir directive must be disabled so that user home directories are not accessed via the web site with a tilde (~) preceding the username. The directive also sets the path name of the directory that will be accessed." + rationale: "The user directories should not be globally enabled since that allows anonymous access to anything users may want to share with other users on the network. Also consider that every time a new account is created on the system, there is potentially new content available via the web site." + remediation: "Perform either one of the following to disable the user directories module: 1. For source builds with static modules, run the Apache ./configure script with the --disable-userdir configure script options. $ cd $DOWNLOAD_HTTPD $ ./configure --disable-userdir 2. For dynamically loaded modules, comment out or remove the LoadModule directive for mod_userdir module from the httpd.conf file. ##LoadModule userdir_module modules/mod_userdir.so" + compliance: + - cis: ["2.7"] + - cis_csc: ["18", "5.1"] + references: + - https://httpd.apache.org/docs/2.4/mod/mod_userdir.html + condition: none + rules: + - "c:$enabled-modules -> userdir_" + + #2.8 Disable Info Module + - id: 10005 + title: "Ensure the Info Module Is Disabled" + description: "The Apache mod_info module provides information on the server configuration via access to a /server-info URL location." + rationale: "While having server configuration information available as a web page may be convenient it is recommended that this module NOT be enabled. Once mod_info is loaded into the server, its handler capability is available in per-directory .htaccess files and can leak sensitive information from the configuration directives of other Apache modules such as system paths, usernames/passwords, database names, etc." + remediation: "Perform either one of the following to disable the mod_info module: 1. For source builds with static modules, run the Apache ./configure script without including the mod_info in the --enable-modules=configure script options. $ cd $DOWNLOAD_HTTPD $ ./configure 2. For dynamically loaded modules, comment out or remove the LoadModule directive for the mod_info module from the httpd.conf file. ##LoadModule info_module modules/mod_info.so" + compliance: + - cis: ["2.8"] + - cis_csc: ["9.1", "9.2"] + references: + - https://httpd.apache.org/docs/2.4/mod/mod_info.html + condition: none + rules: + - "c:$enabled-modules -> r:info_module" + + #3.2 Give the Apache User Account an Invalid Shell + - id: 10006 + title: "Ensure the Apache User Account Has an Invalid Shell" + description: "The apache account must not be used as a regular login account, so it should be assigned an invalid or nologin shell to ensure it cannot be used to login." + rationale: "Service accounts such as the apache account are a risk if they can be used to get a login shell to the system." + remediation: "Change the apache account to use the nologin shell or an invalid shell such as /dev/null: # chsh -s /sbin/nologin apache" + compliance: + - cis: ["3.2"] + - cis_csc: ["16", "4.3"] + condition: all + rules: + - "f:/etc/passwd -> r:apache && r:/sbin/nologin$|/dev/null$" + + #3.3 Lock the Apache User Account + - id: 10007 + title: "Ensure the Apache User Account Is Locked" + description: "The user account under which Apache runs should not have a valid password, but should be locked." + rationale: "As a defense-in-depth measure the Apache user account should be locked to prevent logins, and to prevent a user from suing to apache using the password. In general, there should not be a need for anyone to have to su as apache, and when there is a need, then sudo should be used instead, which would not require the apache account password." + remediation: "Use the passwd command to lock the apache account: # passwd -l apache" + compliance: + - cis: ["3.3"] + - cis_csc: ["16", "16.8"] + condition: any + rules: + - 'c:passwd -S apache -> r:apache && r:\s*\t*L|\s*\t*LK' + - "c:passwd -S apache -> r:apache && r:Password locked" + + #4.4 Restrict Override for All Directories + - id: 10008 + title: "Ensure OverRide Is Disabled for All Directories" + description: "The Apache AllowOverride directive and the new AllowOverrideList directive allow for .htaccess files to be used to override much of the configuration, including authentication, handling of document types, auto generated indexes, access control, and options. When the server finds an .htaccess file (as specified by AccessFileName) it needs to know which directives declared in that file can override earlier access information. When this directive is set to None, then .htaccess files are completely ignored. In this case, the server will not even attempt to read .htaccess files in the filesystem. When this directive is set to All, then any directive which has the .htaccess context is allowed in .htaccess files." + rationale: ".htaccess files decentralizes access control and increases the risk of server configuration being changed inappropriately." + remediation: "Perform the following to implement the recommended state: 1. Search the Apache configuration files (httpd.conf and any included configuration files) to find AllowOverride directives. 2. Set the value for all AllowOverride directives to None. 3. Remove any AllowOverrideList directives found." + compliance: + - cis: ["4.4"] + - cis_csc: ["14.4", "14.6"] + references: + - https://httpd.apache.org/docs/2.4/mod/core.html#allowoverride + - https://httpd.apache.org/docs/2.4/mod/core.html#allowoverridelist + condition: all + rules: + - "d:$conf-dirs -> conf -> !r:^# && r:allowoverride|AllowOverride && r:none|None" + - "not d:$conf-dirs -> conf -> r:allowoverridelist|AllowOverrideList" + - "f:$main-conf -> !r:^# && r:allowoverride|AllowOverride && r:none|None" + - "f:$main-conf -> r:allowoverridelist|AllowOverrideList" + + #5.3 Minimize Options for Other Directories + - id: 10009 + title: "Ensure Options for Other Directories Are Minimized" + description: "The Apache Options directive allows for specific configuration of options, including execution of CGI, following symbolic links, server side includes, and content negotiation." + rationale: "Likewise, the options for other directories and hosts needs to be restricted to the minimal options required. A setting of None is recommended, however it is recognized that other options may be needed in some cases: Multiviews, FollowSymbolicLinks & SymLinksIfOwnerMatch, ExecCGI, Includes & IncludesNOEXEC, & Indexes." + remediation: "Perform the following to implement the recommended state: 1. Search the Apache configuration files (httpd.conf and any included configuration files) to find all elements. 2. Add or modify any existing Options directive to NOT have a value of Includes. Other options may be set if necessary and appropriate as described above." + compliance: + - cis: ["5.3"] + - cis_csc: ["18", "5.1"] + references: + - https://httpd.apache.org/docs/2.4/mod/core.html#options + - https://httpd.apache.org/docs/2.4/mod/mod_include.html + condition: none + rules: + - "d:$conf-dirs -> conf -> !r:^# && r:options && r:includes|Includes" + - "f:$main-conf -> !r:^# && r:options && r:includes|Includes" + + #5.4.2 Remove the Apache user manual + - id: 10010 + title: "Ensure Default HTML Content Is Removed" + description: "Apache installations have default content that is not needed or appropriate for production use. The primary function for the sample content is to provide a default web site, provide user manuals, or demonstrate special features of the web server. All content that is not needed should be removed." + rationale: "Historically, sample content and features have been remotely exploited and can provide different levels of access to the server. Usually these routines are not written for production use and consequently little thought was given to security in their development." + remediation: "Review all pre-installed content and remove content which is not required. In particular look for the unnecessary content which may be found in the document root directory, a configuration directory such as conf/extra directory, or as a Unix/Linux package. 1. Remove the default index.html or welcome page if it is a separate package. If it is part of main Apache httpd package such as it is on Red Hat Linux, then comment out the configuration as shown below. Removing a file such as the welcome.conf, is not recommended as it may get replaced if the package is updated. 2. Remove the Apache user manual content or comment out configurations referencing the manual. # yum erase httpd-manual 3. Remove or comment out any Server Information handler configuration. 4. Remove or comment out any other handler configuration such as perl-status." + compliance: + - cis: ["5.4"] + - cis_csc: ["18.9", "5.1"] + condition: none + rules: + - "d:/var/www -> index.html" + - "d:/var/www/html -> index.html" + - "d:$conf-dirs -> r:manual.conf|apache2-doc.conf" + - "d:$conf-dirs -> conf -> !r:^# && r:sethandler|SetHandler && r:server" + - "f:$main-conf -> !r:^# && r:sethandler|SetHandler && r:server" + - "d:$conf-dirs -> conf -> !r:^# && r:sethandler|SetHandler && r:perl" + - "f:$main-conf -> !r:^# && r:sethandler|SetHandler && r:perl" + + #5.5 Remove default CGI content printenv + - id: 10011 + title: "Ensure the Default CGI Content printenv Script Is Removed" + description: "Most Web Servers, including Apache installations have default CGI content which is not needed or appropriate for production use. The primary function for these sample programs is to demonstrate the capabilities of the web server. One common default CGI content for Apache installations is the script printenv. This script will print back to the requester all of the CGI environment variables which includes many server configuration details and system paths." + rationale: "CGI programs have a long history of security bugs and problems associated with improperly accepting user-input. Since these programs are often targets of attackers, we need to make sure that there are no unnecessary CGI programs that could potentially be used for malicious purposes. Usually these programs are not written for production use and consequently little thought was given to security in their development. The printenv script in particular will disclose inappropriate information about the web server including directory paths and detailed version and configuration information." + remediation: "Perform the following to implement the recommended state: 1. Locate cgi-bin files and directories enabled in the Apache configuration via Script, ScriptAlias, ScriptAliasMatch, or ScriptInterpreterSource directives. 2. Remove the printenvdefault CGI in cgi-bin directory if it is installed. # rm $APACHE_PREFIX/cgi-bin/printenv" + compliance: + - cis: ["5.5"] + - cis_csc: ["18", "4.7"] + condition: none + rules: + - "d:/var/www/cgi-bin -> printenv" + - "d:/usr/lib/cgi-bin -> printenv" + + #5.6 Remove default CGI content test-cgi + - id: 10012 + title: "Ensure the Default CGI Content test-cgi Script Is Removed" + description: "Most Web Servers, including Apache installations have default CGI content which is not needed or appropriate for production use. The primary function for these sample programs is to demonstrate the capabilities of the web server. A common default CGI content for Apache installations is the script test-cgi. This script will print back to the requester CGI environment variables which includes many server configuration details." + rationale: "CGI programs have a long history of security bugs and problems associated with improperly accepting user-input. Since these programs are often targets of attackers, we need to make sure that there are no unnecessary CGI programs that could potentially be used for malicious purposes. Usually these programs are not written for production use and consequently little thought was given to security in their development. The test-cgi script in particular will disclose inappropriate information about the web server including directory paths and detailed version and configuration information." + remediation: "Perform the following to implement the recommended state: 1. Locate cgi-bin files and directories enabled in the Apache configuration via Script, ScriptAlias, ScriptAliasMatch, or ScriptInterpreterSource directives. 2. Remove the test-cgi default CGI in cgi-bin directory if it is installed. # rm $APACHE_PREFIX/cgi-bin/test-cgi" + compliance: + - cis: ["5.6"] + - cis_csc: ["18.9", "4.7"] + condition: none + rules: + - "d:/var/www/cgi-bin -> test-cgi" + - "d:/usr/lib/cgi-bin -> test-cgi" + + #5.8 Disable HTTP Trace Method + - id: 10013 + title: "Ensure the HTTP TRACE Method Is Disabled" + description: "Use the Apache TraceEnable directive to disable the HTTP TRACE request method." + rationale: "The HTTP 1.1 protocol requires support for the TRACE request method which reflects the request back as a response and was intended for diagnostics purposes. The TRACE method is not needed and is easily subjected to abuse and should be disabled." + remediation: "Perform the following to implement the recommended state: 1. Locate the main Apache configuration file such as httpd.conf. 2. Add a TraceEnable directive to the server level configuration with a value of off. Server level configuration is the top-level configuration, not nested within any other directives like or ." + compliance: + - cis: ["5.8"] + - cis_csc: ["9.1", "9.2"] + references: + - https://www.ietf.org/rfc/rfc2616.txt + - https://httpd.apache.org/docs/2.4/mod/core.html#traceenable + condition: all + rules: + - "f:$traceen -> !r:^# && r:TraceEnable && r:off" + + #5.13 Restrict Listen Directive + - id: 10014 + title: "Ensure the IP Addresses for Listening for Requests Are Specified" + description: "The Apache Listen directive specifies the IP addresses and port numbers the Apache web server will listen for requests. Rather than be unrestricted to listen on all IP addresses available to the system, the specific IP address or addresses intended should be explicitly specified. Specifically, a Listen directive with no IP address specified, or with an IP address of zeros should not be used." + rationale: "Having multiple interfaces on web servers is fairly common, and without explicit Listen directives, the web server is likely to be listening on an inappropriate IP address / interface that was not intended for the web server. Single homed system with a single IP addressed are also required to have an explicit IP address in the Listen directive, in case additional interfaces are added to the system at a later date." + remediation: "Perform the following to implement the recommended state: 1. Find any Listen directives in the Apache configuration file with no IP address specified, or with an IP address of all zeros similar to the examples below. Keep in mind there may be both IPv4 and IPv6 addresses on the system. 2. Modify the Listen directives in the Apache configuration file to have explicit IP addresses according to the intended usage. Multiple Listen directives may be specified for each IP address & Port." + compliance: + - cis: ["5.13"] + - cis_csc: ["9.1", "9.2"] + references: + - https://httpd.apache.org/docs/2.4/mod/mpm_common.html#listen + condition: none + rules: + - 'd:$conf-dirs -> conf -> !r:^# && r:listen\s*\t*\d+$|Listen\s*\t*\d+$' + - "d:$conf-dirs -> conf -> !r:^# && r:listen|Listen && r:0.0.0.0" + - 'f:$main-conf -> !r:^# && r:listen\s*\t*\d+$|Listen\s*\t*\d+$' + - "f:$main-conf -> !r:^# && r:listen|Listen && r:0.0.0.0" + + #5.14 Restrict Browser Frame Options + - id: 10015 + title: "Ensure Browser Framing Is Restricted" + description: "The Header directive allows server HTTP response headers to be added, replaced or merged. We will use the directive to add a server HTTP response header to tell browsers to restrict all of the web pages from being framed by other web sites." + rationale: "Using iframes and regular web frames to embed malicious content along with expected web content has been a favored attack vector for attacking web clients for a long time. This can happen when the attacker lures the victim to a malicious web site, which using frames to include the expected content from the legitimate site. The attack can also be performed via XSS (either reflected, DOM or stored XSS) to add the malicious content to the legitimate web site. To combat this vector, an HTTP Response header, X-Frame-Options, has been introduced that allows a server to specify whether a web page may be loaded in any frame (DENY) or those frames that share the pages origin (SAMEORIGIN)." + remediation: "Perform the following to implement the recommended state: Add or modify the Header directive for the X-Frames-Options header in the Apache configuration to have the condition always, an action of append and a value of SAMEORIGIN or DENY, as shown below. Header always append X-Frame-Options SAMEORIGIN" + compliance: + - cis: ["5.14"] + - cis_csc: ["18", "5.1"] + references: + - https://httpd.apache.org/docs/2.4/mod/mod_headers.html#header + - https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header + - https://blogs.msdn.com/b/ie/archive/2009/01/27/ie8-security-part-vii-clickjacking-defenses.aspx + condition: all + rules: + - "f:$main-conf -> r:Header && r:always && r:append && r:X-Frame-Options && r:SAMEORIGIN|DENY" + + #7.6 Disable SSL Insecure Renegotiation + - id: 10016 + title: "Ensure Insecure SSL Renegotiation Is Not Enabled" + description: "A man-in-the-middle renegotiation attack was discovered in SSLv3 and TLSv1 in November, 2009 (CVE-2009-3555). First, a work around and then a fix was approved as an Internet Standard as RFC 574, Feb 2010. The work around, which removes the renegotiation, is available from OpenSSL as of version 0.9.8l and newer versions. For details: https://www.openssl.org/news/secadv_20091111.txt The SSLInsecureRenegotiation directive was added in Apache 2.2.15, for web servers linked with OpenSSL version 0.9.8m or later, to provide backward compatibility to clients with the older, unpatched SSL implementations." + rationale: "Enabling the SSLInsecureRenegotiation directive leaves the server vulnerable to man-in- the-middle renegotiation attack. Therefore, the SSLInsecureRenegotiation directive should not be enabled." + remediation: "Perform the following to implement the recommended state: Search the Apache configuration files for the SSLInsecureRenegotiation directive. If the directive is present modify the value to be off. If the directive is not present then no action is required. SSLInsecureRenegotiation off" + compliance: + - cis: ["7.6"] + - cis_csc: ["14.2", "14.4"] + references: + - https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslinsecurerenegotiation + - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2009-3555 + - https://azure.microsoft.com/en-us/services/multi-factor-authentication/ + condition: none + rules: + - 'f:$ssl-confs -> !r:^# && r:sslinsecurerenegotiation|SSLInsecureRenegotiation && r:\s+on$' + + #7.7 Ensure SSL Compression is not enabled + - id: 10017 + title: "Ensure SSL Compression is Not Enabled" + description: "The SSLCompression directive controls whether SSL compression is used by Apache when serving content over HTTPS. It is recommended that the SSLCompression directive be set to off." + rationale: "If SSL compression is enabled, HTTPS communication between the client and the server may be at increased risk to the CRIME attack. The CRIME attack increases a malicious actor's ability to derive the value of a session cookie, which commonly contains an authenticator. If the authenticator in a session cookie is derived, it can be used to impersonate the account associated with the authenticator." + remediation: "Perform the following to implement the recommended state: 1. Search the Apache configuration files for the SSLCompression directive. 2. If the directive is present, set it to off." + compliance: + - cis: ["7.7"] + - cis_csc: ["14.2", "14.4"] + references: + - https://httpd.apache.org/docs/2.4/mod/mod_ssl.html#sslcompression + - https://en.wikipedia.org/wiki/CRIME + + condition: none + rules: + - 'f:$ssl-confs -> !r:^# && r:sslcompression|SSLCompression && r:\s+on$' + + #8.1 Set ServerToken to Prod or ProductOnly + - id: 10018 + title: "Ensure ServerTokens is Set to 'Prod' or 'ProductOnly'" + description: "Configure the Apache ServerTokens directive to provide minimal information. By setting the value to Prod or ProductOnly. The only version information given in the server HTTP response header will be Apache rather than details on modules and versions installed." + rationale: "Information is power and identifying web server details greatly increases the efficiency of any attack, as security vulnerabilities are extremely dependent upon specific software versions and configurations. Excessive probing and requests may cause too much 'noise' being generated and may tip off an administrator. If an attacker can accurately target their exploits, the chances of successful compromise prior to detection increase dramatically. Script Kiddies are constantly scanning the Internet and documenting the version information openly provided by web servers. The purpose of this scanning is to accumulate a database of software installed on those hosts, which can then be used when new vulnerabilities are released." + remediation: "Perform the following to implement the recommended state: Add or modify the ServerTokens directive as shown below to have the value of Prod or ProductOnly: ServerTokens Prod" + compliance: + - cis: ["8.1"] + - cis_csc: ["18.9", "14.7"] + references: + - https://httpd.apache.org/docs/2.4/mod/core.html#servertokens + condition: any + rules: + - 'd:$conf-dirs -> conf -> !r:^# && r:servertokens|ServerTokens && r:\s+Prod|\s+ProductOnly' + + #8.2: Set ServerSignature to Off + - id: 10019 + title: "Ensure ServerSignature Is Not Enabled" + description: "Disable the server signatures which generates a signature line as a trailing footer at the bottom of server generated documents such as error pages." + rationale: "Server signatures are helpful when the server is acting as a proxy, since it helps the user distinguish errors from the proxy rather than the destination server, however in this context there is no need for the additional information." + remediation: "Perform the following to implement the recommended state: Add or modify the ServerSignature directive to have the value of Off: ServerSignature Off" + compliance: + - cis: ["8.2"] + - cis_csc: ["18", "13.2"] + references: + - https://httpd.apache.org/docs/2.4/mod/core.html#serversignature + condition: none + rules: + - 'd:$conf-dirs -> conf -> !r:^# && r:serversignature|ServerSignature && r:\s+on|\s+On' + + #9.1:Set TimeOut to 10 or less + - id: 10020 + title: "Ensure the TimeOut Is Set to 10 or Less" + description: "Denial of Service (DoS) is an attack technique with the intent of preventing a web site from serving normal user activity. DoS attacks, which are normally applied to the network layer, are also possible at the application layer. These malicious attacks can succeed by starving a system of critical resources, vulnerability exploit, or abuse of functionality. Although there is no 100% solution for preventing DoS attacks, the following recommendation uses the Timeout directive to mitigate some of the risk, by requiring more effort for a successful DoS attack. Of course, DoS attacks can happen in rather unintentional ways as well as intentional and these directives will help in many of those situations as well." + rationale: "One common technique for DoS is to initiate many connections to the server. By decreasing the timeout for old connections and we allow the server to free up resources more quickly and be more responsive. By making the server more efficient, it will be more resilient to DoS conditions. The Timeout directive affects several timeout values for Apache, so review the Apache document carefully." + remediation: "Perform the following to implement the recommended state: Add or modify the Timeout directive in the Apache configuration to have a value of 10 seconds or shorter. Timeout 10" + compliance: + - cis: ["9.1"] + - cis_csc: ["9", "5.1"] + references: + - https://httpd.apache.org/docs/2.4/mod/core.html#timeout + condition: all + rules: + - 'f:$main-conf -> !r:^# && && r:timeout|Timeout && n:\s+(\d+) compare <= 10' + + #9.2:Set the KeepAlive directive to On + - id: 10021 + title: "Ensure KeepAlive Is Enabled" + description: "The KeepAlive directive controls whether Apache will reuse the same TCP connection per client to process subsequent HTTP requests from that client. It is recommended that the KeepAlive directive be set to On." + rationale: "Allowing per-client reuse of TCP sockets reduces the amount of system and network resources required to serve requests. This efficiency gain may improve a server resiliency to DoS attacks." + remediation: "Perform the following to implement the recommended state: Add or modify the KeepAlive directive in the Apache configuration to have a value of On, so that KeepAlive connections are enabled. KeepAlive On" + compliance: + - cis: ["9.2"] + - cis_csc: ["9", "5.1"] + references: + - https://httpd.apache.org/docs/2.4/mod/core.html#keepalive + condition: none + rules: + - 'f:$main-conf -> !r:^# && r:keepalive|KeepAlive && r:\s+off|\s+Off' + + #9.3:Set MaxKeepAliveRequests to 100 or greater + - id: 10022 + title: "Ensure MaxKeepAliveRequests is Set to a Value of 100 or Greater" + description: "The MaxKeepAliveRequests directive limits the number of requests allowed per connection when KeepAlive is on. If it is set to 0, unlimited requests will be allowed." + rationale: "The MaxKeepAliveRequests directive is important to be used to mitigate the risk of Denial of Service (DoS) attack technique by reducing the overhead imposed on the server. The KeepAlive directive must be enabled before it is effective. Enabling KeepAlives allows for multiple HTTP requests to be sent while keeping the same TCP connection alive. This reduces the overhead of having to setup and tear down TCP connections for each request. By making the server more efficient, it will be more resilient to DoS conditions." + remediation: "Perform the following to implement the recommended state: Add or modify the MaxKeepAliveRequests directive in the Apache configuration to have a value of 100 or more. MaxKeepAliveRequests 100" + compliance: + - cis: ["9.3"] + - cis_csc: ["9", "5.1"] + references: + - https://httpd.apache.org/docs/2.4/mod/core.html#maxkeepaliverequests + condition: none + rules: + - 'f:$main-conf -> !r:^# && r:maxkeepaliverequests|MaxKeepAliveRequests && n:\s+(\d+) compare < 100' + + #9.4: Set KeepAliveTimeout Low to Mitigate Denial of Service + - id: 10023 + title: "Ensure KeepAliveTimeout is Set to a Value of 15 or Less" + description: "The KeepAliveTimeout directive specifies the number of seconds Apache will wait for a subsequent request before closing a connection that is being kept alive." + rationale: "The KeepAliveTimeout directive is used mitigate some of the risk, by requiring more effort for a successful DoS attack. By enabling KeepAlive and keeping the timeout relatively low for old connections and we allow the server to free up resources more quickly and be more responsive." + remediation: "Perform the following to implement the recommended state: Add or modify the KeepAliveTimeout directive in the Apache configuration to have a value of 15 or less. KeepAliveTimeout 15" + compliance: + - cis: ["9.4"] + - cis_csc: ["9", "5.1"] + references: + - https://httpd.apache.org/docs/2.4/mod/core.html#keepalivetimeout + condition: all + rules: + - 'f:$main-conf -> !r:^# && r:keepalivetimeout|KeepAliveTimeout && n:\s+(\d+) compare <= 15' + + #9.5 Set Timeout Limits for Request Headers + - id: 10024 + title: "Ensure the Timeout Limits for Request Headers is Set to 40 or Less" + description: "The RequestReadTimeout directive allows configuration of timeout limits for client requests. The header portion of the directive provides for an initial timeout value, a maximum timeout and a minimum rate. The minimum rate specifies that after the initial timeout, the server will wait an additional 1 second for each N bytes received. The recommended setting is to have a maximum timeout of 40 seconds or less. Keep in mind that for SSL/TLS virtual hosts the time for the TLS handshake must fit within the timeout." + rationale: "Setting a request header timeout is vital for mitigating Denial of Service attacks based on slow requests. The slow request attacks are particularly lethal and relative easy to perform, because they require very little bandwidth and can easily be done through anonymous proxies. Starting in June 2009 with the Slow Loris DoS attack, which used a slow GET request as published by Robert Hansen (RSnake) on his blog http://ha.ckers.org/slowloris/. Later in November 2010 at the OWASP App Sec DC conference Wong Onn Chee demonstrated a slow POST request attack which was even more effective." + remediation: "Perform the following to implement the recommended state: 1. Load the mod_requesttimeout module in the Apache configuration with the following configuration. LoadModule reqtimeout_module modules/mod_reqtimeout.so 2. Add a RequestReadTimeout directive similar to the one below with the maximum request header timeout value of 40 seconds or less. RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500" + compliance: + - cis: ["9.5"] + - cis_csc: ["9", "5.1"] + references: + - https://ha.ckers.org/slowloris/ + - https://www.owasp.org/index.php/H.....t.....t....p.......p....o....s....t + - https://httpd.apache.org/docs/2.4/mod/mod_reqtimeout.html + condition: any + rules: + - 'f:$main-conf -> !r:^# && r:loadmodule|LoadModule && r:\s+mod_reqtimeout' + - 'f:$request-confs -> !r:^# && r:requestreadtimeout|RequestReadTimeout && n:header=\d+\p(\d+) compare <= 40' + + #9.6 Set Timeout Limits for Request Body + - id: 10025 + title: "Ensure Timeout Limits for the Request Body is Set to 20 or Less" + description: "The RequestReadTimeout directive also allows setting timeout values for the body portion of a request. The directive provides for an initial timeout value, and a maximum timeout and minimum rate. The minimum rate specifies that after the initial timeout, the server will wait an additional 1 second for each N bytes are received. The recommended setting is to have a maximum timeout of 20 seconds or less. The default value is body=20,MinRate=500." + rationale: "It is not sufficient to timeout only on the header portion of the request, as the server will still be vulnerable to attacks like the OWASP Slow POST attack, which provide the body of the request very slowly. Therefore, the body portion of the request must have a timeout as well. A timeout of 20 seconds or less is recommended." + remediation: "Perform the following to implement the recommended state: 1. Load the mod_requesttimeout module in the Apache configuration with the following configuration. LoadModule reqtimeout_module modules/mod_reqtimeout.so 2. Add a RequestReadTimeout directive similar to the one below with the maximum request body timeout value of 20 seconds or less. RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500" + compliance: + - cis: ["9.6"] + - cis_csc: ["9", "5.1"] + references: + - https://httpd.apache.org/docs/2.4/mod/mod_reqtimeout.html + condition: any + rules: + - 'f:$main-conf -> !r:^# && r:loadmodule|LoadModule && r:\s+mod_reqtimeout' + - 'f:$request-confs -> !r:^# && r:requestreadtimeout|RequestReadTimeout && n:body=(\d+) compare <= 20' + + #10.1 Set the LimitRequestLine directive to 512 or less + - id: 10026 + title: "Ensure the LimitRequestLine directive is Set to 512 or less" + description: "Buffer Overflow attacks attempt to exploit an application by providing more data than the application buffer can contain. If the application allows copying data to the buffer to overflow the boundaries of the buffer, then the application is vulnerable to a buffer overflow. The results of Buffer overflow vulnerabilities vary, and may result in the application crashing, or may allow the attacker to execute instructions provided in the data. The Apache LimitRequest* directives allow the Apache web server to limit the sizes of requests and request fields and can be used to help protect programs and applications processing those requests. Specifically, the LimitRequestLine directive limits the allowed size of a client's HTTP request-line, which consists of the HTTP method, URI, and protocol version." + rationale: "The limiting of the size of the request line is helpful so that the web server can prevent an unexpectedly long or large request from being passed to a potentially vulnerable CGI program, module or application that would have attempted to process the request. Of course, the underlying dependency is that we need to set the limits high enough to not interfere with any one application on the server, while setting them low enough to be of value in protecting the applications. Since the configuration directive is available only at the server configuration level, it is not possible to tune the value for different portions of the same web server. Please read the Apache documentation carefully, as these requests may interfere with the expected functionality of some web applications." + remediation: "Perform the following to implement the recommended state: Add or modify the LimitRequestline directive in the Apache configuration to have a value of 512 or shorter. LimitRequestline 512" + compliance: + - cis: ["10.1"] + - cis_csc: ["9", "5.1"] + references: + - https://httpd.apache.org/docs/2.4/mod/core.html#limitrequestline + condition: all + rules: + - 'f:$main-conf -> !r:^# && r:limitrequestline|LimitRequestLine && n:\s(\d+) compare <= 512' + + #10.2 Set the LimitRequestFields directive to 100 or less + - id: 10027 + title: "Ensure the LimitRequestFields Directive is Set to 100 or Less" + description: "The LimitRequestFields directive limits the number of fields allowed in an HTTP request." + rationale: "The limiting of the number of fields is helpful so that the web server can prevent an unexpectedly high number of fields from being passed to a potentially vulnerable CGI program, module or application that would have attempted to process the request. Of course, the underlying dependency is that we need to set the limits high enough to not interfere with any one application on the server, while setting them low enough to be of value in protecting the applications. Since the configuration directives are available only at the server configuration level, it is not possible to tune the value for different portions of the same web server. Please read the Apache documentation carefully, as these requests may interfere with the expected functionality of some web applications." + remediation: "Perform the following to implement the recommended state: Add or modify the LimitRequestFields directive in the Apache configuration to have a value of 100 or less. If the directive is not present the default depends on a compile time configuration, but defaults to a value of 100. LimitRequestFields 100" + compliance: + - cis: ["10.2"] + - cis_csc: ["9", "5.1"] + references: + - https://httpd.apache.org/docs/2.4/mod/core.html#limitrequestfields + condition: all + rules: + - 'f:$main-conf -> !r:^# && r:limitrequestfields|LimitRequestFields && n:\s(\d+) compare <= 100' + + #10.3 Set the LimitRequestFieldsize directive to 1024 or less + - id: 10028 + title: "Ensure the LimitRequestFieldsize Directive is Set to 1024 or Less" + description: "The LimitRequestFieldSize limits the number of bytes that will be allowed in an HTTP request header. It is recommended that the LimitRequestFieldSize directive be set to 1024 or less." + rationale: "By limiting of the size of request headers is helpful so that the web server can prevent an unexpectedly long or large value from being passed to exploit a potentially vulnerable program. Of course, the underlying dependency is that we need to set the limits high enough to not interfere with any one application on the server, while setting them low enough to be of value in protecting the applications. Since the configuration directives are available only at the server configuration level, it is not possible to tune the value for different portions of the same web server. Please read the Apache documentation carefully, as these requests may interfere with the expected functionality of some web applications." + remediation: "Perform the following to implement the recommended state: Add or modify the LimitRequestFieldsize directive in the Apache configuration to have a value of 1024 or less. LimitRequestFieldsize 1024" + compliance: + - cis: ["10.3"] + - cis_csc: ["9", "5.1"] + references: + - https://httpd.apache.org/docs/2.4/mod/core.html#limitrequestfieldsize + condition: all + rules: + - 'f:$main-conf -> !r:^# && r:limitrequestfieldsize|LimitRequestFieldSize && n:\s(\d+) compare <= 1024' + + #10.4 Set the LimitRequestBody directive to 102400 or less + - id: 10029 + title: "Ensure the LimitRequestBody Directive is Set to 102400 or Less" + description: "The LimitRequestBody directive limits the number of bytes that are allowed in a request body. Size of requests may vary greatly; for example, during a file upload the size of the file must fit within this limit." + rationale: "The limiting of the size of the request body is helpful so that the web server can prevent an unexpectedly long or large request from being passed to a potentially vulnerable program. Of course, the underlying dependency is that we need to set the limits high enough to not interfere with any one application on the server, while setting them low enough to be of value in protecting the applications. The LimitRequestBody may be configured on a per directory, or per location context. Please read the Apache documentation carefully, as these requests may interfere with the expected functionality of some web applications." + remediation: "Perform the following to implement the recommended state: Add or modify the LimitRequestBody directive in the Apache configuration to have a value of 102400 (100K) or less. Please read the Apache documentation so that it is understood that this directive will limit the size of file up-loads to the web server. LimitRequestBody 102400" + compliance: + - cis: ["10.4"] + - cis_csc: ["9", "5.1"] + references: + - https://httpd.apache.org/docs/2.4/mod/core.html#limitrequestbody + condition: all + rules: + - 'f:$main-conf -> !r:^# && r:limitrequestbody|LimitRequestBody && n:\s(\d+) compare <= 102400' diff --git a/etc/ruleset/sca/applications/cis_iis_10.yml b/etc/ruleset/sca/applications/cis_iis_10.yml new file mode 100644 index 0000000000..54bc4dea90 --- /dev/null +++ b/etc/ruleset/sca/applications/cis_iis_10.yml @@ -0,0 +1,722 @@ +# Security Configuration Assessment +# CIS Checks for Microsoft IIS 10 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark v1.1.1 for Microsoft IIS 10 - 03-13-2019 + +policy: + id: "cis_iis_10" + file: "cis_iis_10.yml" + name: "CIS Microsoft IIS 10 Benchmark v1.1.1" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft IIS." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that IIS 10 is installed in the system" + description: "Requirements for running the SCA scan against IIS 10" + condition: all + rules: + - 'c:reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp -> r:IIS 10' + +checks: + # 1 Basic Configurations + - id: 22000 + title: "Ensure web content is on non-system partition" + description: "Web resources published through IIS are mapped, via Virtual Directories, to physical locations on disk. It is recommended to map all Virtual Directories to a non-system disk volume." + rationale: "Isolating web content from system files may reduce the probability of: - Web sites/applications exhausting system disk space - File IO vulnerability in the web site/application from affecting the confidentiality and/or integrity of system files" + remediation: "1. Browse to web content in C:\\inetpub\\wwwroot\\ 2. Copy or cut content onto a dedicated and restricted web folder on a non-systemdrive such as D:\\webroot\\ 3. Change mappings for any applications or Virtual Directories to reflect the new location To change the mapping for the application named app1 which resides under the Default Web Site, open IIS Manager: 1. Expand the server node 2. Expand Sites 3. Expand Default Web Site 4. Click on app1 5. In the Actions pane, select Basic Settings 6. In the Physical path text box, put the new location of the application, D:\\wwwroot\\app1 in the example above" + compliance: + - cis: ["1.1"] + - cis_csc: ["14"] + condition: none + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list vdir -> r:SystemDrive' + + #1.2 - Has to be done manually as each site needs to be verified individually + # title: "Ensure 'host headers' are on all sites" + + - id: 22001 + title: "Ensure 'directory browsing' is set to disabled" + description: "Directory browsing allows the contents of a directory to be displayed upon request from a web client. If directory browsing is enabled for a directory in Internet Information Services, users receive a page that lists the contents of the directory when the following two conditions are met: 1. No specific file is requested in the URL 2. The Default Documents feature is disabled in IIS, or if it is enabled, IIS is unable to locate a file in the directory that matches a name specified in the IIS default document list" + rationale: "Ensuring that directory browsing is disabled may reduce the probability of disclosing sensitive content that is inadvertently accessible via IIS." + remediation: "Enter the following command in AppCmd.exe to configure:%systemroot%\\system32\\inetsrv\\appcmd set config /section:directoryBrowse /enabled:false" + compliance: + - cis: ["1.3"] + - cis_csc: ["14"] + references: + - http://blogs.iis.net/thomad/archive/2008/02/10/moving-the-iis7-inetpub-directory-to-a-different-drive.aspx + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config /section:directoryBrowse -> r:directoryBrowse enabled="false"' + + - id: 22002 + title: "Ensure 'application pool identity' is configured for all application pools" + description: "Application Pool Identities are the actual users/authorities that will run the worker process - w3wp.exe. Assigning the correct user authority will help ensure that applications can function properly, while not giving overly permissive permissions on the system. These identities can further be used in ACLs to protect system content. It is recommended that each Application Pool run under a unique identity. IIS has additional built-in least privilege identities intended for use by Application Pools. It is recommended that the default Application Pool Identity be changed to a least privilege principle other than Network Service. Furthermore, it is recommended that all application pool identities be assigned a unique least privilege principal. To achieve isolation in IIS, application pools can be run as separate identities. IIS can be configured to automatically use the application pool identity if no anonymous user account is configured for a Web site. This can greatly reduce the number of accounts needed for Web sites and make management of the accounts easier. It is recommended the Application Pool Identity be set as the Anonymous User Identity. The name of the Application Pool account corresponds to the name of the Application Pool. Application Pool Identities were introduced in Windows Server 2008 SP2. It is recommended that Application Pools be set to run as ApplicationPoolIdentity unless there is an underlying reason that the application pool needs to run as a specified end user account. One example where this is needed is for web farms using Kerberos authentication" + rationale: "Setting Application Pools to use unique least privilege identities such as ApplicationPoolIdentity reduces the potential harm the identity could cause should the application ever become compromised. Additionally, it will simplify application pools configuration and account management." + remediation: "To change the ApplicationPool identity to the built-in ApplicationPoolIdentity using AppCmd.exe, run the following from a command prompt: Enter the following command in AppCmd.exe to configure %systemroot%\\system32\\inetsrv\\appcmd set config /section:applicationPools /[name=''].processModel.identityType:ApplicationPoolIdentity " + compliance: + - cis: ["1.4"] + - cis_csc: ["18"] + references: + - http://technet.microsoft.com/en-us/library/cc771170%28WS.10%29.aspx + - http://learn.iis.net/page.aspx/140/understanding-built-in-user-and-group-accounts-in-iis-7/ + - http://learn.iis.net/page.aspx/624/application-pool-identities/ + - http://blogs.iis.net/tomwoolums/archive/2008/12/17/iis-7-0-application-pools.aspx + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config /section:applicationPools -> r:processModel identityType="ApplicationPoolIdentity"' + + - id: 22003 + title: "Ensure 'unique application pools' is set for sites" + description: "IIS introduced a new security feature called Application Pool Identities that allows Application Pools to be run under unique accounts without the need to create and manage local or domain accounts. It is recommended that all Sites run under unique, dedicated Application Pools." + rationale: "By setting sites to run under unique Application Pools, resource-intensive applications can be assigned to their own application pools which could improve server and application performance.In addition, it can help maintain application availability: if an application in one pool fails, applications in other pools are not affected.Last, isolating applications helps mitigate the potential risk of one application being allowed access to the resources of another application. It is also recommended to stop any application pool that is not in use or was created by an installation such as .Net 4.0." + remediation: "The following appcmd.exe command will set the application pool for a given application: %systemroot%\\system32\\inetsrv\\appcmd set app '/' /applicationpool:" + compliance: + - cis: ["1.5"] + - cis_csc: ["14.6"] + references: + - http://technet.microsoft.com/en-us/library/cc753449%28WS.10%29.aspx + - http://blogs.iis.net/tomwoolums/archive/2008/12/17/iis-7-0-application-pools.aspx + - http://learn.iis.net/page.aspx/624/application-pool-identities/ + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list app -> r:applicationPool:DefaultAppPool' + + - id: 22004 + title: "Ensure 'application pool identity' is configured for anonymous user identity" + description: "To achieve isolation in IIS, application pools can be run as separate identities. IIS can be configured to automatically use the application pool identity if no anonymous user account is configured for a Web site. This can greatly reduce the number of accounts needed for Web sites and make management of the accounts easier. It is recommended the Application Pool Identity be set as the Anonymous User Identity." + rationale: "Configuring the anonymous user identity to use the application pool identity will help ensure site isolation - provided sites are set to use the application pool identity. Since a unique principal will run each application pool, it will ensure the identity is least privilege. Additionally, it will simplify Site management." + remediation: "To use AppCmd.exe to configure anonymousAuthenticationat the server level, the command would look like this: %systemroot%\\system32\\inetsrv\\appcmd set config -section:anonymousAuthentication /username:\"\" --password" + compliance: + - cis: ["1.6"] + - cis_csc: ["14.6"] + references: + - http://learn.iis.net/page.aspx/202/application-pool-identity-as-anonymous-user/ + - http://learn.iis.net/page.aspx/624/application-pool-identities/ + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list app -> r:anonymousAuthentication enabled="true"' + + - id: 22005 + title: " Ensure WebDav feature is disabled" + description: "WebDAV is an extension to the HTTP protocol which allows clients to create, move, and delete files and resources on the web server. This functionality is available in IIS when the WebDAV feature is enabled." + rationale: "WebDAV is not widely used, and it has serious security concerns because it may allow clients to modify unauthorized files on the web server. Therefore, the WebDav feature should be disabled." + remediation: "To disable this feature using PowerShell, enter the following command: Remove-WindowsFeature Web-DAV-Publishing Verify that Success is True" + compliance: + - cis: ["1.7"] + - cis_csc: ["9.2"] + condition: all + rules: + - "c:powershell.exe import-module servermanager;Get-WindowsFeature Web-DAV-Publishing -> r:available" + + # 2 Configure Authentication and Authorization + - id: 22006 + title: "Ensure 'global authorization rule' is set to restrict access" + description: "IIS introduced URL Authorization, which allows the addition of Authorization rules to the actual URL, instead of the underlying file system resource, as a way to protect it. Authorization rules can be configured at the server, web site, folder (including Virtual Directories), or file level. The native URL Authorization module applies to all requests, whether they are .NET managed or other types of files (e.g. static files or ASP files). It is recommended that URL Authorization be configured to only grant access to the necessary security principals." + rationale: "Configuring a global Authorization rule that restricts access will ensure inheritance of the settings down through the hierarchy of web directories; if that content is copied elsewhere, the authorization rules flow with it. This will ensure access to current and future content is only granted to the appropriate principals, mitigating risk of accidental or unauthorized access." + remediation: "To configure URL Authorization at the server level using command line utilities:Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd set config -section:system.webServer/security/authorization /-\"[users='*',roles='',verbs='']\"; %systemroot%\\system32\\inetsrv\\appcmd set config -section:system.webServer/security/authorization /+\"[accessType='Allow',roles='Administrators']\"" + compliance: + - cis: ["2.1"] + - cis_csc: ["18"] + references: + - http://www.iis.net/learn/manage/configuring-security/understanding-iis-url-authorization + - http://www.iis.net/learn/get-started/whats-new-in-iis-7/changes-in-security-between-iis-60-and-iis-7-and-above#Authorization + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config -section:system.webserver/security/authorization -> r:remove users="\*" roles="" verbs="" && accessType="Allow",roles="Administrators"' + + - id: 22007 + title: "Ensure access to sensitive site features is restricted to authenticated principals only" + description: "IIS supports both challenge-based and login redirection-based authentication methods. Challenge-based authentication methods, such as Integrated Windows Authentication, require a client to respond correctly to a server-initiated challenge. A login redirection based authentication method such as Forms Authentication relies on redirection to a login page to determine the identity of the principal. Challenge-based authentication and login redirection-based authentication methods cannot be used in conjunction with one another. Public servers/sites are typically configured to use Anonymous Authentication. This method typically works, provided the content or services is intended for use by the public. When sites, applications, or specific content containers are not intended for anonymous public use, an appropriate authentication mechanism should be utilized. Authentication will help confirm the identity of clients who request access to sites, application, and content. IIS provides the following authentication modules by default: Anonymous Authentication - allows anonymous users to access sites, applications, and/or content Integrated Windows Authentication - authenticates users using the NTLM or Kerberos protocols; Kerberos v5 requires a connection to Active Directory ASP.NET Impersonation - allows ASP.NET applications to run under a security context different from the default security context for an application Forms Authentication - enables a user to login to the configured space with a valid user name and password which is then validated against a database or other credentials store Basic authentication - requires a valid user name and password to access content Client Certificate Mapping Authentication - allows automatic authentication of users who log on with client certificates that have been configured; requires SSL Digest Authentication - uses Windows domain controller to authenticate users who request accessNote that none of the challenge-based authentication modules can be used at the same time Forms Authentication is enabled for certain applications/content. Forms Authentication does not rely on IIS authentication, so anonymous access for the ASP.NET application can be configured if Forms Authentication will be used. It is recommended that sites containing sensitive information, confidential data, or non public web services be configured with a credentials-based authentication mechanism" + rationale: "Configuring authentication will help mitigate the risk of unauthorized users accessing data and/or services, and in some cases reduce the potential harm that can be done to a system." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd set config - section:system.web/authentication /mode:" + compliance: + - cis: ["2.2"] + - cis_csc: ["14.6"] + references: + - http://learn.iis.net/page.aspx/377/using-aspnet-forms-authentication/rev/1 + - http://learn.iis.net/page.aspx/244/how-to-take-advantage-of-the-iis7-integrated-pipeline/ + - http://technet.microsoft.com/en-us/library/cc733010%28WS.10%29.aspx + - http://msdn.microsoft.com/en-us/library/aa480476.aspx + - https://technet.microsoft.com/en-us/library/hh831496(v=ws.11).aspx + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config -section:system.web/authentication -> r:cookieless="UseCookies" requireSSL="true"' + + - id: 22008 + title: "Ensure 'forms authentication' require SSL" + description: "Forms-based authentication can pass credentials across the network in clear text. It is therefore imperative that the traffic between client and server be encrypted using SSL, especially in cases where the site is publicly accessible. It is recommended that communications with any portion of a site using Forms Authentication be encrypted using SSL." + rationale: "Requiring SSL for Forms Authentication will protect the confidentiality of credentials during the login process, helping mitigate the risk of stolen user information." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd set config - section:system.web/authentication /mode:Forms" + compliance: + - cis: ["2.3"] + - cis_csc: ["14.4"] + references: + - http://technet.microsoft.com/en-us/library/cc771077(WS.10).aspx + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config -section:system.web/authentication -> r:requireSSL="true"' + + - id: 22009 + title: "Ensure 'forms authentication' is set to use cookies" + description: "Forms Authentication can be configured to maintain the site visitor's session identifier in either a URI or cookie. It is recommended that Forms Authentication be set to use cookies." + rationale: "Using cookies to manage session state may help mitigate the risk of session hi-jacking attempts by preventing ASP.NET from having to move session information to the URL. Moving session information identifiers into the URL may cause session IDs to show up in proxy logs, browsing history, and be accessible to client scripting via document.location." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd set config - section:system.web/authentication /forms.cookieless:\"UseCookies\"" + compliance: + - cis: ["2.4"] + - cis_csc: ["18"] + references: + - http://technet.microsoft.com/en-us/library/cc732830%28WS.10%29.aspx + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config -section:system.web/authentication -> r:cookieless="UseCookies"' + + #2.5 - Has to be done manually as each app name needs to be provided individually + # title: "Ensure 'cookie protection mode' is configured for forms authentication" + + #2.6 - Has to be done manually as each app name needs to be provided individually + # title: "Ensure transport layer security for 'basic authentication' is #configured" + + #2.7 - Has to be done manually as each app name needs to be provided individually + # title: "Ensure 'passwordFormat' is not set to clear" + + #2.8 - Has to be done manually as each app name needs to be provided individually + # title: "Ensure 'credentials' are not stored in configuration files" + + #3 ASP.NET Configuration Recommendations + + #3.1 - Has to be done manually as .NET versions used by each App may vary + # title: "Ensure 'deployment method retail' is set" + + #3.2 - Has to be done manually as each website name must be provided + # title: "Ensure 'debug' is turned off" + + #3.3 - Has to be done manually as each website name must be provided + # title: "Ensure custom error messages are not off" + + #3.4 - Has to be done manually as each website name must be provided + # title: "Ensure IIS HTTP detailed errors are hidden from displaying remotely" + + #3.5 - Has to be done manually as each website name must be provided + # title: "Ensure ASP.NET stack tracing is not enabled" + + #3.6 - Has to be done manually as each website name must be provided + # title: " Ensure 'httpcookie' mode is configured for session state" + + #3.7 - Has to be done manually as each website name must be provided + # title: "Ensure 'cookies' are set with HttpOnly attribute" + + - id: 22010 + title: "Ensure 'MachineKey validation method - .Net 3.5' is configured" + description: "The machineKey element of the ASP.NET web.config specifies the algorithm and keys that ASP.NET will use for encryption. The Machine Key feature can be managed to specify hashing and encryption settings for application services such as view state, Forms authentication, membership and roles, and anonymous identification." + rationale: "Setting the validation property to AES will provide confidentiality and integrity protection to the viewstate. AES is the strongest encryption algorithm supported by the validation property. Setting the validation property to SHA1 will provide integrity protection to the viewstate. SHA1 is the strongest hashing algorithm supported by the validation property." + remediation: "To set the Machine Key encryption at the global level using an appcmd.exe command: %systemroot%\\system32\\inetsrv\\appcmd set config /commit:WEBROOT /section:machineKey /validation:SHA1" + compliance: + - cis: ["3.8"] + - cis_csc: ["14.4"] + references: + - http://technet.microsoft.com/en-us/library/cc772271%28WS.10%29.aspx + - http://technet.microsoft.com/en-us/library/cc772287%28WS.10%29.aspx + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config /commit:WEBROOT /section:machineKey -> r:validation="SHA1"|validation="AES"' + + - id: 22011 + title: "Ensure 'MachineKey validation method - .Net 4.5' is configured" + description: "The machineKey element of the ASP.NET web.config specifies the algorithm and keys that ASP.NET will use for encryption. The Machine Key feature can be managed to specify hashing and encryption settings for application services such as view state, Forms authentication, membership and roles, and anonymous identification." + rationale: "SHA-2 is the strongest hashing algorithm supported by the validation property so it should be used as the validation method for the MachineKey in .Net 4.5." + remediation: "To set the Machine Key encryption at the global level using an appcmd.exe command: %systemroot%\\system32\\inetsrv\\appcmd set config /commit:WEBROOT /section:machineKey /validation:HMACSHA256" + compliance: + - cis: ["3.9"] + - cis_csc: ["14.4"] + references: + - http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-aspnet-configuration-management + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config /commit:WEBROOT /section:machineKey -> r:validation="HMACSHA256"' + + - id: 22012 + title: " Ensure global .NET trust level is configured" + description: "This only applies to .Net 2.0. Future versions have stopped supporting this feature. An application's trust level determines the permissions that are granted by the ASP.NET code access security (CAS) policy. CAS defines two trust categories: full trust and partial trust. An application that has full trust permissions may access all resource types on a server and perform privileged operations, while applications that run with partial trust have varying levels of operating permissions and access to resources. It is recommended that the global .NET Trust Level be set to Medium or lower." + rationale: "The CAS determines the permissions that are granted to the application on the server. Setting a minimal level of trust that is compatible with the applications will limit the potential harm that a compromised application could cause to a system." + remediation: "To set the .Net Trust Level to Medium at the server level using an appcmd.exe command: %systemroot%\\system32\\inetsrv\\appcmd set config /commit:WEBROOT /section:trust /level:Medium" + compliance: + - cis: ["3.10"] + - cis_csc: ["14.6"] + references: + - http://technet.microsoft.com/en-us/library/cc772237(WS.10).aspx + - http://msdn.microsoft.com/en-us/library/ms691448%28VS.90%29.aspx + - Professional IIS 7 by Ken Schaefer, Jeff Cochran, Scott Forsyth, Rob Baugh, Mike Everest, Dennis Glendenning + - http://support.microsoft.com/kb/2698981 + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config /commit:WEBROOT /section:trust -> r:level="Low"|level="Medium"' + + - id: 22013 + title: "Ensure X-Powered-By Header is removed" + description: "The x-powered-by headers may specify the underlying technology used by an application. Attackers are able to conduct reconnaissance on a website using these response headers. This header could be used to target attacks for specific known vulnerabilities associated with the underlying technology. Removing this header will prevent targeting of your application for specific exploits by non-determined attackers." + rationale: "While this is not the only way to fingerprint a site through the response headers, it makes it harder and prevents some potential attackers." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd.exe set config -section:system.webServer/httpProtocol /-\"customHeaders.[name='X-Powered-By']\" /commit:apphost" + compliance: + - cis: ["3.11"] + - cis_csc: ["5.1"] + references: + - https://blogs.msdn.microsoft.com/jpsanders/2015/10/07/remove-server-and-x-powered-by-headers-from-your-azure-mobile-apps/ + condition: none + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config -section:system.webServer/httpProtocol -> r:name="X-Powered-By"' + + - id: 22014 + title: "Ensure Server Header is removed" + description: "The server header may specify the underlying technology used by an application. Attackers are able to conduct reconnaissance on a website using these response headers. This header could be used to target attacks for specific known vulnerabilities associated with the underlying technology. Removing this header will prevent targeting of your application for specific exploits by non-determined attackers." + rationale: "While this is not the only way to fingerprint a site through the response headers, it makes it harder and prevents some potential attackers. The server header removal directive is a new feature in IIS 10 that can assist in mitigating this risk." + remediation: "Enter the following command to use AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd.exe set config -section:system.webServer/security/requestFiltering /removeServerHeader:\"True\" /commit:apphost" + compliance: + - cis: ["3.12"] + - cis_csc: ["5.1"] + references: + - https://blogs.msdn.microsoft.com/jpsanders/2015/10/07/remove-server-and-x-powered-by-headers-from-your-azure-mobile-apps/ + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config -section:system.webServer/security/requestFiltering -> r:removeServerHeader="true"' + + #4 Request Filtering and Other Restriction Modules + - id: 22015 + title: "Ensure 'maxAllowedContentLength' is configured" + description: "The maxAllowedContentLength Request Filter is the maximum size of the http request, measured in bytes, which can be sent from a client to the server. Configuring this value enables the total request size to be restricted to a configured value. It is recommended that the overall size of requests be restricted to a maximum value appropriate for the server, site, or application." + rationale: "Setting an appropriate value that has been tested for the maxAllowedContentLength filter will lower the impact an abnormally large request would otherwise have on IIS and/or web applications. This helps to ensure availability of web content and services, and may also help mitigate the risk of buffer overflow type attacks in unmanaged components." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd set config /section:requestfiltering /requestLimits.maxAllowedContentLength:30000000" + compliance: + - cis: ["4.1"] + - cis_csc: ["18"] + references: + - http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits + - http://learn.iis.net/page.aspx/143/use-request-filtering/ + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config /section:requestfiltering -> n:maxAllowedContentLength="(\d)" compare <= 30000000' + + - id: 22016 + title: "Ensure 'maxURL request filter' is configured" + description: "The maxURL attribute of the property is the maximum length (in Bytes) in which a requested URL can be (excluding query string) in order for IIS to accept. Configuring this Request Filter enables administrators to restrict the length of the requests that the server will accept. It is recommended that a limit be put on the length of URL." + rationale: "With a properly configured Request Filter limiting the amount of data accepted in the URL, chances of undesired application behaviors affecting the availability of content and services are reduced." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd set config /section:requestfiltering /requestLimits.maxURL:4096" + compliance: + - cis: ["4.2"] + - cis_csc: ["18"] + references: + - http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits + - http://learn.iis.net/page.aspx/143/use-request-filtering/ + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config /section:requestfiltering -> n:maxUrl="(\d)" compare <= 4096' + + - id: 22017 + title: "Ensure 'MaxQueryString request filter' is configured" + description: "The MaxQueryString Request Filter describes the upper limit on the length of the query string that the configured IIS server will allow for websites or applications. It is recommended that values always be established to limit the amount of data will can be accepted in the query string." + rationale: "With a properly configured Request Filter limiting the amount of data accepted in the query string, chances of undesired application behaviors such as app pool failures are reduced." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd set config /section:requestfiltering /requestLimits.maxQueryString:2048" + compliance: + - cis: ["4.3"] + - cis_csc: ["18"] + references: + - http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits + - http://learn.iis.net/page.aspx/143/use-request-filtering/ + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config /section:requestfiltering -> n:maxQueryString="(\d)" compare <= 2048' + + - id: 22018 + title: "maxQueryString" + description: "This feature is used to allow or reject all requests to IIS that contain non-ASCII characters. When using this feature, Request Filtering will deny the request if high-bit characters are present in the URL. The UrlScan equivalent is AllowHighBitCharacters. It is recommended that requests containing non-ASCII characters be rejected, where possible." + rationale: "This feature can help defend against canonicalization attacks, reducing the potential attack surface of servers, sites, and/or applications." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd set config /section:requestfiltering /allowHighBitCharacters:false" + compliance: + - cis: ["4.4"] + - cis_csc: ["18"] + references: + - http://learn.iis.net/page.aspx/143/use-request-filtering/ + - http://learn.iis.net/page.aspx/936/urlscan-1-reference/ + - Professional IIS 7 by Ken Schaefer, Jeff Cochran, Scott Forsyth, Rob Baugh, Mike Everest, Dennis Glendenning + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config /section:requestfiltering -> r:allowHighBitCharacters="false"' + + - id: 22019 + title: "Ensure Double-Encoded requests will be rejected" + description: "This Request Filter feature prevents attacks that rely on double-encoded requests and applies if an attacker submits a double-encoded request to IIS. When the double-encoded requests filter is enabled, IIS will go through a two iteration process of normalizing the request. If the first normalization differs from the second, the request is rejected and the error code is logged as a 404.11. The double-encoded requests filter was the VerifyNormalization option in UrlScan. It is recommended that double-encoded requests be rejected." + rationale: "This feature will help prevent attacks that rely on URLs that have been crafted to contain double-encoded request(s)." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd set config /section:requestfiltering /allowDoubleEscaping:false" + compliance: + - cis: ["4.5"] + - cis_csc: ["18"] + references: + - http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits + - http://learn.iis.net/page.aspx/143/use-request-filtering/ + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config /section:requestfiltering -> r:allowDoubleEscaping="false"' + + - id: 22020 + title: "Ensure 'HTTP Trace Method' is disabled" + description: "The HTTP TRACE method returns the contents of client HTTP requests in the entity-body of the TRACE response. Attackers could leverage this behavior to access sensitive information, such as authentication data or cookies, contained in the HTTP headers of the request. One such way to mitigate this is by using the element of the collection. The element replaces the [AllowVerbs] and [DenyVerbs] features in UrlScan. It is recommended the HTTP TRACE method be denied." + rationale: "Attackers may abuse HTTP TRACE functionality to gain access to information in HTTP headers such as cookies and authentication data. This risk can be mitigated by not allowing the TRACE verb." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd set config /section:requestfiltering /+verbs.[verb='TRACE',allowed='false']" + compliance: + - cis: ["4.6"] + - cis_csc: ["18"] + references: + - http://www.kb.cert.org/vuls/id/867593 + - http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/verbs + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd listconfig /section:requestfiltering -> r:verb="TRACE" allowed="false"' + + - id: 22021 + title: "Ensure Unlisted File Extensions are not allowed" + description: "The FileExtensions Request Filter allows administrators to define specific extensions their web server(s) will allow and disallow. The property allowUnlisted will cover all other file extensions not explicitly allowed or denied. Often times, extensions such as .config, .bat, .exe, to name a few, should never be served. The AllowExtensions and DenyExtensionsoptions are the UrlScan equivalents. It is recommended that all extensions be unallowed at the most global level possible, with only those necessary being allowed." + rationale: "Disallowing all but the necessary file extensions can greatly reduce the attack surface of applications and servers." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd set config /section:requestfiltering /fileExtensions.allowunlisted:false" + compliance: + - cis: ["4.7"] + - cis_csc: ["18"] + references: + - http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits + - http://www.iis.net/learn/manage/configuring-security/configure-request-filtering-in-iis + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd listconfig /section:requestfiltering -> r:fileExtensions\.+allowUnlisted="false"' + + - id: 22022 + title: "Ensure Handler is not granted Write and Script/Execute" + description: "Handler mappings can be configured to give permissions to Read, Write, Script, or Execute depending on what the use is for - reading static content, uploading files, executing scripts, etc. It is recommended to grant a handler either Execute/Scriptor Write permissions, but not both." + rationale: "By allowing both Execute/Scriptand Write permissions, a handler can run malicious code on the target server. Ensuring these two permissions are never together will help lower the risk of malicious code being executed on the server." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd set config /section:handlers /accessPolicy:Read,Script" + compliance: + - cis: ["4.8"] + - cis_csc: ["18"] + references: + - http://technet.microsoft.com/en-us/library/dd391910%28WS.10%29.aspx + - http://blogs.iis.net/thomad/archive/2006/11/05/quo-vadis-accessflags.aspx + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd list config /section:handlers -> r:accessPolicy="Read, Script"' + + - id: 22023 + title: "Ensure 'notListedIsapisAllowed' is set to false" + description: "The notListedIsapisAllowedattribute is a server-level setting that is located in the ApplicationHost.configfile in the element of the section under . This element ensures that malicious users cannot copy unauthorized ISAPI binaries to the Web server and then run them. It is recommended that notListedIsapisAllowedbe set to false." + rationale: "Restricting this attribute to falsewill help prevent potentially malicious ISAPI extensions from being run." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd.exe set config -section:system.webServer/security/isapiCgiRestriction /notListedIsapisAllowed:false" + compliance: + - cis: ["4.9"] + - cis_csc: ["18"] + references: + - http://technet.microsoft.com/en-us/library/dd378846%28WS.10%29.aspx + - http://www.iis.net/ConfigReference/system.webServer/security/isapiCgiRestriction + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd.exe list config -section:system.webServer/security/isapiCgiRestriction -> r:notListedIsapisAllowed="false"' + + - id: 22024 + title: "Ensure 'notListedCgisAllowed' is set to false" + description: "The notListedCgisAllowed attribute is a server-level setting that is located in the ApplicationHost.configfile in the element of the section under . This element ensures that malicious users cannot copy unauthorized CGI binaries to the Web server and then run them. It is recommended that notListedCgisAllowedbe set to false." + rationale: "Restricting this attribute to falsewill help prevent unlisted CGI extensions, including potentially malicious CGI scripts from being run." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd.exe set config -section:system.webServer/security/isapiCgiRestriction /notListedCgisAllowed:false" + compliance: + - cis: ["4.10"] + - cis_csc: ["18"] + references: + - http://technet.microsoft.com/en-us/library/dd391919%28WS.10%29.aspx + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd.exe list config -section:system.webServer/security/isapiCgiRestriction -> r:notListedCgisAllowed="false"' + + - id: 22025 + title: "Ensure 'Dynamic IP Address Restrictions' is enabled" + description: "IIS Dynamic IP Address Restrictions capability can be used to thwart DDos attacks. This is complimentary to the IP Addresses and Domain names Restrictions lists that can be manually maintained within IIS. In contrast, Dynamic IP address filtering allows administrators to configure the server to block access for IPs that exceed the specified request threshold. The default action Deny action for restrictions is to return a Forbidden response to the client." + rationale: "Dynamic IP address filtering allows administrators to configure the server to block access for IPs that exceed the specified number of requests or requests frequency. Ensure that you receive the Forbidden page once the block has been enforced." + remediation: 'Enter the following commands in powershell.exe to configure: Set-WebConfigurationProperty -pspath ''MACHINE/WEBROOT/APPHOST'' -filter "system.webServer/security/dynamicIpSecurity/denyByConcurrentRequests" -name"enabled" -value "True"Set-WebConfigurationProperty -pspath ''MACHINE/WEBROOT/APPHOST'' -filter "system.webServer/security/dynamicIpSecurity/denyByConcurrentRequests" -name "maxConcurrentRequests" -value ' + compliance: + - cis: ["4.11"] + - cis_csc: ["9.5"] + references: + - http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-dynamic-ip-address-restrictions + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd.exe list config -section:system.webServer/security/dynamicIpSecurity -> r:denyByConcurrentRequests enabled="true" && r:denyByRequestRate enabled="true"' + + #5 IIS Logging Recommendations + - id: 22026 + title: "Ensure Default IIS web log location is moved" + description: "IIS will log relatively detailed information on every request. These logs are usually the first item looked at in a security response, and can be the most valuable. Malicious users are aware of this, and will often try to remove evidence of their activities. It is therefore recommended that the default location for IIS log files be changed to a restricted, non system drive" + rationale: "Moving IIS logging to a restricted, non-system drive will help mitigate the risk of logs being maliciously altered, removed, or lost in the event of system drive failure(s)." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd set config -section:sites -siteDefaults.logfile.directory: " + compliance: + - cis: ["5.1"] + - cis_csc: ["6.4"] + references: + - https://technet.microsoft.com/en-us/library/cc770709(v=ws.10).aspx? + condition: none + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd.exe list config -section:system.applicationHost/sites -> r:directory="%SystemDrive%\inetpub\logs\LogFiles"' + + #5.2 - Has to be done manually, requires user interaction + # title: "Ensure Advanced IIS logging is enabled" + + #5.3 - Has to be done manually, requires user interaction + # title: "Ensure 'ETW Logging' is enabled" + + #6 FTP Requests + - id: 22027 + title: "Ensure FTP requests are encrypted" + description: "The new FTP Publishing Service for IIS supports adding an SSL certificate to an FTP site. Using an SSL certificate with an FTP site is also known as FTP-S or FTP over Secure Socket Layers (SSL). FTP-S is an RFC standard (RFC 4217) where an SSL certificate is added to an FTP site and thereby making it possible to perform secure file transfers." + rationale: "By using SSL, the FTP transmission is encrypted and secured from point to point and all FTP traffic as well as credentials are thereby guarded against interception." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd.exe set config -section:system.applicationHost/sites /siteDefaults.ftpServer.security.ssl.controlChannelPolicy:\"SslRequire\" /siteDefaults.ftpServer.security.ssl.dataChannelPolicy:\"SslRequire\" /commit:apphost" + compliance: + - cis: ["6.1"] + - cis_csc: ["14.4"] + references: + - http://www.windowsnetworking.com/articles_tutorials/IIS-FTP-Publishing-Service-Part3.html + - http://learn.iis.net/page.aspx/304/using-ftp-over-ssl/#03 + - https://tools.ietf.org/html/rfc4217 + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd.exe list config -section:system.applicationHost/sites -> r:controlChannelPolicy="SslRequire"&&dataChannelPolicy="SslRequire"' + + - id: 22028 + title: "Ensure FTP Logon attempt restrictions is enabled" + description: "IIS introduced a built-in network security feature to automatically block brute force FTP attacks. This can be used to mitigate a malicious client from attempting a brute-force attack on a discovered account, such as the local administrator account." + rationale: "Successful brute force FTP attacks can allow an otherwise unauthorized user to make changes to data that should not be made. This could allow the unauthorized user to modify website code by uploading malicious software or even changing functionality for items such as online payments." + remediation: "Enter the following command in AppCmd.exe to configure: %systemroot%\\system32\\inetsrv\\appcmd.exe set config -section:system.ftpServer/security/authentication /denyByFailure.enabled:\"True\" /commit:apphost" + compliance: + - cis: ["6.2"] + - cis_csc: ["9.1"] + references: + - http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-ftp-logon-attempt-restrictions + condition: all + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd.exe list config -section:system.ftpServer/security/authentication -> r:denyByFailure enabled="true"' + + #7 Transport Encryption + - id: 22029 + title: "Ensure HSTS Header is set" + description: 'HTTP Strict Transport Security (HSTS) allows a site to inform the user agent to communicate with the site only over HTTPS. This header takes two parameters: max-age, "specifies the number of seconds, after the reception of the STS header field, during whichthe user agent regards the host (from whom the message was received) as a Known HSTSHost [speaks only HTTPS]"; and includeSubDomains. includeSubDomains is an optionaldirective that defines how this policy is applied to subdomains. If includeSubDomains isincluded in the header, it provides the following definition: this HSTS Policy also applies toany hosts whose domain names are subdomains of the Known HSTS Host''s domain name.' + rationale: "HTTP Strict Transport Security (HSTS) is a simple and widely supported standard to protect visitors by ensuring that their browsers always connect to a website over HTTPS. HSTS exists to remove the need for the common, insecure practice of redirecting users from http:// to https:// URLs. HSTS relies on the User Agent/Browser to enforce the required behavior. All major browsers support it. If the browser doesn't support HSTS, it will be ignored.When a browser knows that a domain has enabled HSTS, it does two things:1. Always uses an https:// connection, even when clicking on an http:// link or after typing a domain into the location bar without specifying a protocol.2. Removes the ability for users to click through warnings about invalid certificates.A domain instructs browsers that it has enabled HSTS by returning an HTTP header over an HTTPS connection." + remediation: "To set the HTTP Header at the server level using an AppCmd.exe command, run the following command from an elevated command prompt: %systemroot%\\system32\\inetsrv\\appcmd.exe set config -section:system.webServer/httpProtocol /+\"customHeaders.[name='Strict-Transport-Security',value='max-age=480; preload']\"" + compliance: + - cis: ["7.1"] + - cis_csc: ["18"] + condition: all + references: + - http://tools.ietf.org/html/rfc6797#section-5.1 + - https://https.cio.gov/hsts/ + - https://www.iis.net/configreference/system.webserver/httpprotocol/customheaders#006 + rules: + - 'c:%systemroot%\system32\inetsrv\appcmd.exe list config -section:system.webServer/httpProtocol -> r:name="Strict-Transport-Security" && n:max-age=(\d) compare > 0' + + - id: 22030 + title: "Ensure SSLv2 is Disabled" + description: "This protocol is not considered cryptographically secure." + rationale: "Disabling weak protocols will help ensure the confidentiality and integrity of in-transit data." + remediation: "Set the following key is set to 0: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\SSL 2.0\\Server:Enabled HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\SSL 2.0\\Client:Enabled. Set the following key is set to 1: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\SSL 2.0\\Server:DisabledByDefault HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\SSL 2.0\\Client:DisabledByDefault" + compliance: + - cis: ["7.2"] + - cis_csc: ["14.4"] + references: + - http://technet.microsoft.com/en-us/library/dn786419.aspx + - http://technet.microsoft.com/en-us/library/dn786433.aspx + - http://msdn.microsoft.com/en-us/library/aa374757%28v=vs.85%29.aspx + - https://www.owasp.org/index.php/Testing_for_SSL-TLS_%28OWASP-CM-001%29 + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server -> Enabled -> 0' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client -> Enabled -> 0' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server -> DisabledByDefault -> 1' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Client -> DisabledByDefault -> 1' + + - id: 22031 + title: "Ensure SSLv3 is Disabled" + description: "This protocol is not considered cryptographically secure. Disabling it is recommended." + rationale: "Disabling weak protocols will help ensure the confidentiality and integrity of in-transit data." + remediation: "Set the following keys to 0: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\SSL 3.0\\Server:Enabled HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\SSL 3.0\\Client:Enabled. Set the following keys to 1: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\SSL 3.0\\Server:DisabledByDefault HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\SSL 3.0\\Client:DisabledByDefault" + compliance: + - cis: ["7.3"] + - cis_csc: ["14.4"] + references: + - https://www.openssl.org/~bodo/ssl-poodle.pdf + - http://technet.microsoft.com/en-us/library/dn786419.aspx + - https://www.owasp.org/index.php/Testing_for_SSL-TLS_%28OWASP-CM-001%29 + - http://technet.microsoft.com/en-us/library/dn786433.aspx + - http://msdn.microsoft.com/en-us/library/aa374757%28v=vs.85%29.aspx + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server -> Enabled -> 0' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client -> Enabled -> 0' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server -> DisabledByDefault -> 1' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Client -> DisabledByDefault -> 1' + + - id: 22032 + title: "Ensure TLS 1.0 is Disabled" + description: 'The PCI Data Security Standard 3.1 recommends disabling "early TLS" along with SSL: SSL and early TLS are not considered strong cryptography and cannot be used as a security control after June 30, 2016.' + rationale: "Disabling weak protocols will help ensure the confidentiality and integrity of in-transit data." + remediation: "Set the following key to 0: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\TLS 1.0\\Server:Enabled HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\TLS 1.0\\Client:Enabled. Set the following key is set to 1: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\TLS 1.0\\Server:DisabledByDefault HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\TLS 1.0\\Client:DisabledByDefault" + compliance: + - cis: ["7.4"] + - cis_csc: ["14.4"] + references: + - http://msdn.microsoft.com/en-us/library/aa374757%28v=vs.85%29.aspx + - https://www.owasp.org/index.php/Testing_for_SSL-TLS_%28OWASP-CM-001%29 + - http://technet.microsoft.com/en-us/library/dn786419.aspx + - http://technet.microsoft.com/en-us/library/dn786433.aspx + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server -> Enabled -> 0' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client -> Enabled -> 0' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server -> DisabledByDefault -> 1' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client -> DisabledByDefault -> 1' + + - id: 22033 + title: "Ensure TLS 1.1 is Disabled" + description: "TLS 1.1 is required for backward compatibility. Ensure you fully test your application to ensure that backwards compatibility is not needed. If it is, build in exceptions as necessary for backwards compatibility" + rationale: "Disabling weak protocols will help ensure the confidentiality and integrity of in-transit data" + remediation: "Set the following key to 0: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\TLS 1.1\\Server:Enabled HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\TLS 1.1\\Client:Enabled. Set the following key is set to 1: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\TLS 1.1\\Server:DisabledByDefault HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\TLS 1.1\\Client:DisabledByDefault" + compliance: + - cis: ["7.5"] + - cis_csc: ["14.4"] + references: + - http://technet.microsoft.com/en-us/library/dn786433.aspx + - https://www.owasp.org/index.php/Testing_for_SSL-TLS_%28OWASP-CM-001%29 + - http://technet.microsoft.com/en-us/library/dn786419.aspx + - http://msdn.microsoft.com/en-us/library/aa374757%28v=vs.85%29.aspx + - https://community.qualys.com/thread/16565-is-there-a-reason-for-still-having-tlsv11-enabled + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server -> Enabled -> 0' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client -> Enabled -> 0' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server -> DisabledByDefault -> 1' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client -> DisabledByDefault -> 1' + + - id: 22034 + title: "Ensure TLS 1.2 is Enabled" + description: "TLS 1.2 is the most recent and mature protocol for protecting the confidentiality and integrity of HTTP traffic." + rationale: "Enabling this protocol will help ensure the confidentiality and integrity of data in transit." + remediation: "Set the following key to 1: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\TLS 1.2\\Server:Enabled. Set the following key to 0: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Protocols\\TLS 1.2\\Server:DisabledByDefault" + compliance: + - cis: ["7.6"] + - cis_csc: ["14.4"] + references: + - http://msdn.microsoft.com/en-us/library/aa374757%28v=vs.85%29.aspx + - https://www.owasp.org/index.php/Testing_for_SSL-TLS_%28OWASP-CM-001%29 + - http://technet.microsoft.com/en-us/library/dn786419.aspx + - http://technet.microsoft.com/en-us/library/dn786433.aspx + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server -> Enabled -> 1' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server -> DisabledByDefault -> 0' + + - id: 22035 + title: "Ensure NULL Cipher Suites is Disabled" + description: "The NULL cipher does not provide data confidentiality or integrity. It is recommended that the NULL cipher be disabled." + rationale: "By disabling the NULL cipher, there is a better chance of maintaining data confidentiality and integrity." + remediation: "Set the following key to 0: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Ciphers\\NULL:Enabled" + compliance: + - cis: ["7.7"] + - cis_csc: ["14.4"] + references: + - https://www.owasp.org/index.php/Testing_for_SSL-TLS_%28OWASP-CM-001%29 + - http://technet.microsoft.com/en-us/library/dn786419.aspx + - http://technet.microsoft.com/en-us/library/dn786433.aspx + - http://msdn.microsoft.com/en-us/library/aa374757%28v=vs.85%29.aspx + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\NULL -> Enabled -> 0' + + - id: 22036 + title: "Ensure DES Cipher Suites is Disabled" + description: "DES is a weak symmetric-key cipher. It is recommended that it be disabled." + rationale: "By disabling DES, there is a better chance of maintaining data confidentiality and integrity." + remediation: "Set the following key to 0: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Ciphers\\DES 56/56:Enabled" + compliance: + - cis: ["7.8"] + - cis_csc: ["14.4"] + references: + - https://www.owasp.org/index.php/Testing_for_SSL-TLS_%28OWASP-CM-001%29 + - http://technet.microsoft.com/en-us/library/dn786419.aspx + - http://technet.microsoft.com/en-us/library/dn786433.aspx + - http://msdn.microsoft.com/en-us/library/aa374757%28v=vs.85%29.aspx + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\DES 56/56 -> Enabled -> 0' + + - id: 22037 + title: "Ensure RC4 Cipher Suites is Disabled" + description: "RC4 is a stream cipher that has known practical attacks. It is recommended that RC4 be disabled. The only RC4 cipher enabled by default on Server 2012 and 2012 R2 is RC4 128/128." + rationale: "The use of RC4 may increase an adversaries ability to read sensitive information sent over SSL/TLS." + remediation: "Set the following keys to 0 to disable RC4 40/128, RC4 56/128, RC4 64/128, RC4 128/128 ciphers: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Ciphers\\RC4 40/128:Enabled, HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Ciphers\\RC4 56/128:Enabled, HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Ciphers\\RC4 64/128:Enabled,HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Ciphers\\RC4 128/128:Enabled." + compliance: + - cis: ["7.9"] + - cis_csc: ["14.4"] + references: + - https://www.owasp.org/index.php/Testing_for_SSL-TLS_%28OWASP-CM-001%29 + - http://technet.microsoft.com/en-us/library/dn786419.aspx + - http://technet.microsoft.com/en-us/library/dn786433.aspx + - http://msdn.microsoft.com/en-us/library/aa374757%28v=vs.85%29.aspx + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4 40/128 -> Enabled -> 0' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4 56/128 -> Enabled -> 0' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4 64/128 -> Enabled -> 0' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4 128/128 -> Enabled -> 0' + + - id: 22038 + title: "Ensure AES 128/128 Cipher Suite is Disabled" + description: "Enabling AES 128/128 may be required for client compatibility. Enable or disable this cipher suite accordingly." + rationale: "This item is Scored for the following reasons and should be disabled: Enabling AES 256/256 is recommended. This cipher does not suffer from known practical attacks." + remediation: "Set the following key to 0: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Ciphers\\AES 128/128:Enabled" + compliance: + - cis: ["7.10"] + - cis_csc: ["14.4"] + references: + - https://www.owasp.org/index.php/Testing_for_SSL-TLS_%28OWASP-CM-001%29 + - http://technet.microsoft.com/en-us/library/dn786419.aspx + - http://technet.microsoft.com/en-us/library/dn786433.aspx + - http://msdn.microsoft.com/en-us/library/aa374757%28v=vs.85%29.aspx + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\AES 128/128 -> Enabled -> 0' + + - id: 22039 + title: "Ensure AES 256/256 Cipher Suite is Enabled" + description: "AES 256/256 is the most recent and mature cipher suite for protecting the confidentiality and integrity of HTTP traffic. Enabling AES 256/256 is recommended. This is enabled by default on Server 2012 and 2012 R2." + rationale: "Enabling this cipher will help ensure the confidentiality and integrity of data in transit." + remediation: "Set the following key to 1: HKLM\\SYSTEM\\CurrentControlSet\\Control\\SecurityProviders\\SCHANNEL\\Ciphers\\AES 128/128:Enabled" + compliance: + - cis: ["7.11"] + - cis_csc: ["14.4"] + references: + - https://www.owasp.org/index.php/Testing_for_SSL-TLS_%28OWASP-CM-001%29 + - http://technet.microsoft.com/en-us/library/dn786419.aspx + - http://technet.microsoft.com/en-us/library/dn786433.aspx + - http://msdn.microsoft.com/en-us/library/aa374757%28v=vs.85%29.aspx + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\AES 256/256 -> Enabled -> 1' + + - id: 22040 + title: "Ensure TLS Cipher Suite ordering is Configured" + description: "Cipher suites are a named combination of authentication, encryption, message authentication code, and key exchange algorithms used for the security settings of a network connection using TLS protocol. Clients send a cipher list and a list of ciphers that it supports in order of preference to a server. The server then replies with the cipher suite that it selects from the client cipher suite list" + rationale: "Cipher suites should be ordered from strongest to weakest in order to ensure that the more secure configuration is used for encryption between the server and client." + remediation: "Set HKLM\\SOFTWARE\\Policies\\Microsoft\\Cryptography\\Configuration\\SSL\\00010002:Functions to TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256." + compliance: + - cis: ["7.12"] + - cis_csc: ["14.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Cryptography\Configuration\SSL\00010002 -> Functions -> TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256.' diff --git a/etc/ruleset/sca/applications/cis_mysql5_6_community.yml b/etc/ruleset/sca/applications/cis_mysql5_6_community.yml new file mode 100644 index 0000000000..9a0bc18e09 --- /dev/null +++ b/etc/ruleset/sca/applications/cis_mysql5_6_community.yml @@ -0,0 +1,291 @@ +# Security Configuration Assessment +# CIS Checks for Oracle MySQL Community Edition 5.6 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for Oracle MySQL Community Edition 5.6 v1.1.0 - 08-15-2016 + +policy: + id: "cis_mysql_community" + file: "cis_mysql5_6_community.yml" + name: "CIS Oracle MySQL Community Server 5.6 Benchmark v1.1.0" + description: "This document, CIS Oracle MySQL Community Server 5.6 Benchmark, provides prescriptive guidance for establishing a secure configuration posture for MySQL Community Server 5.6. This guide was tested against MySQL Community Server 5.6 running on Ubuntu Linux 14.04, but applies to other linux distributions as well." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that MySQL is installed on the system" + description: "Requirements for running the SCA scan against the MySQL policy." + condition: any + rules: + - "d:/etc/mysql" + - "d:/var/lib/mysql" + +checks: + #1 Operating System Level Configuration + - id: 10500 + title: "Disable MySQL Command History" + description: "On Linux/UNIX, the MySQL client logs statements executed interactively to a history file. By default, this file is named .mysql_history in the user's home directory. Most interactive commands run in the MySQL client application are saved to a history file. The MySQL command history should be disabled." + rationale: "Disabling the MySQL command history reduces the probability of exposing sensitive information, such as passwords and encryption keys." + remediation: "Perform the following steps: 1. Remove .mysql_history if it exists. And 2. Set the MYSQL_HISTFILE environment variable to /dev/null. This will need to be placed in the shell's startup script. Or Create $HOME/.mysql_history as a symbolic to /dev/null." + compliance: + - cis: ["1.3"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/mysql-logging.html + - https://bugs.mysql.com/bug.php?id=72158 + condition: none + rules: + - "d:/home -> ^.mysql_history$" + - "d:/root -> ^.mysql_history$" + + - id: 10501 + title: "Disable Interactive Login" + description: "When created, the MySQL user may have interactive access to the operating system, which means that the MySQL user could login to the host as any other user would." + rationale: "Preventing the MySQL user from logging in interactively may reduce the impact of a compromised MySQL account. There is also more accountability as accessing the operating system where the MySQL server lies will require the user's own account. Interactive access by the MySQL user is unnecessary and should be disabled." + remediation: "Execute one of the following commands in a terminal: 'usermod -s /bin/false mysql' or 'usermod -s /sbin/nologin mysql'" + compliance: + - cis: ["1.5"] + condition: all + rules: + - "c:getent passwd mysql -> r:/bin/false|/sbin/nologin" + + - id: 10502 + title: "Verify That 'MYSQL_PWD' Is Not Set In Users' Profiles" + description: "MySQL can read a default database password from an environment variable called MYSQL_PWD." + rationale: "The use of the MYSQL_PWD environment variable implies the clear text storage of MySQL credentials. Avoiding this may increase assurance that the confidentiality of MySQL credentials is preserved." + remediation: "Check which users and/or scripts are setting MYSQL_PWD and change them to use a more secure method." + compliance: + - cis: ["1.6"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/environment-variables.html + condition: none + rules: + - "c:find /home -maxdepth 2 -type f -exec grep MYSQL_PWD {} + -> r:.profile|.bashrc|.bash_profile && r:$MYSQL_PWD" + + #4 General + - id: 10503 + title: "Ensure 'allow-suspicious-udfs' Is Set to 'FALSE'" + description: "This option prevents attaching arbitrary shared library functions as user-defined functions by checking for at least one corresponding method named _init, _deinit, _reset, _clear, or _add." + rationale: "Preventing shared libraries that do not contain user-defined functions from loading will reduce the attack surface of the server." + remediation: "Remove '--allow-suspicious-udfs' from the 'mysqld' start up command line. Or Remove 'allow-suspicious-udfs' from the MySQL option file." + compliance: + - cis: ["4.3"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/udf-security.html + - https://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_allow-suspicious-udfs + condition: none + rules: + - "c:my_print_defaults mysqld -> r:allow-suspicious-udfs" + + - id: 10504 + title: "Ensure 'local_infile' is Disabled" + description: "The 'local_infile' parameter dictates whether files located on the MySQL client's computer can be loaded or selected via 'LOAD DATA INFILE' or 'SELECT local_file'." + rationale: "Disabling 'local_infile' reduces an attacker's ability to read sensitive files off the affected server via a SQL injection vulnerability." + remediation: "Add a line local-infile=0 in the [mysqld] section of the MySQL configuration file and restart the MySQL service." + compliance: + - cis: ["4.4"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/string-functions.html#function_load-file + - https://dev.mysql.com/doc/refman/5.6/en/load-data.html + condition: all + rules: + - 'c:grep -Rh local-infile /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:local-infile\s*=\s*0' + + - id: 10505 + title: "Ensure 'mysqld' Is Not Started with '--skip-grant-tables'" + description: "This option causes mysqld to start without using the privilege system." + rationale: "If this option is used, all clients of the affected server will have unrestricted access to all databases." + remediation: "Open the MySQL configuration (e.g. my.cnf) file and set: skip-grant-tables = FALSE" + compliance: + - cis: ["4.5"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_skip-grant-tables + condition: all + rules: + - 'c:grep -Rh skip-grant-tables /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:skip-grant-tables\s*=\s*FALSE|skip-grant-tables\s*=\s*false' + + - id: 10506 + title: "Ensure '--skip-symbolic-links' Is Enabled" + description: "The symbolic-links and skip-symbolic-links options for MySQL determine whether symbolic link support is available. When use of symbolic links are enabled, they have different effects depending on the host platform. When symbolic links are disabled, then symbolic links stored in files or entries in tables are not used by the database. " + rationale: "Prevents sym links being used for data base files. This is especially important when MySQL is executing as root as arbitrary files may be overwritten. The symbolic-links option might allow someone to direct actions by to MySQL server to other files and/or directories." + remediation: "Open the MySQL configuration file (my.cnf), locate 'skip_symbolic_links' and set it to YES. If the option does not exist, create it in the 'mysqld' section." + compliance: + - cis: ["4.6"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/symbolic-links.html + - https://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_symbolic-links + condition: all + rules: + - 'c:grep -Rh skip_symbolic_links /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:skip_symbolic_links\s*=\s*YES|skip_symbolic_links\s*=\s*yes' + + - id: 10507 + title: "Ensure 'secure_file_priv' is not empty" + description: "The secure_file_priv option restricts to paths used by LOAD DATA INFILE or SELECT local_file. It is recommended that this option be set to a file system location that contains only resources expected to be loaded by MySQL." + rationale: "Setting secure_file_priv reduces an attacker's ability to read sensitive files off the affected server via a SQL injection vulnerability. " + remediation: "Add the line secure_file_priv= to the [mysqld] section of the MySQL configuration file and restart the MySQL service." + compliance: + - cis: ["4.8"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_secure_file_priv + condition: all + rules: + - 'c:grep -Rh secure_file_priv /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:secure_file_priv\s*=\s*\.' + + - id: 10508 + title: "Ensure 'sql_mode' Contains 'STRICT_ALL_TABLES'" + description: "When data changing statements are made (i.e. INSERT, UPDATE), MySQL can handle invalid or missing values differently depending on whether strict SQL mode is enabled. When strict SQL mode is enabled, data may not be truncated or otherwise 'adjusted' to make the data changing statement work." + rationale: "Without strict mode the server tries to do proceed with the action when an error might have been a more secure choice. For example, by default MySQL will truncate data if it does not fit in a field, which can lead to unknown behavior, or be leveraged by an attacker to circumvent data validation. " + remediation: "Add STRICT_ALL_TABLES to the sql_mode in the server's configuration file." + compliance: + - cis: ["4.9"] + condition: all + rules: + - "c:grep -Rh strict_all_tables /etc/mysql/my.cnf /etc/mysql/my.ini /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:strict_all_tables" + + #6 Auditing and Logging + - id: 10509 + title: "Ensure 'log_error' is not empty" + description: "The error log contains information about events such as mysqld starting and stopping, when a table needs to be checked or repaired, and, depending on the host operating system, stack traces when mysqld fails" + rationale: "Enabling error logging may increase the ability to detect malicious attempts against MySQL, and other critical messages, such as if the error log is not enabled then connection error might go unnoticed." + remediation: "Set the log-error option to the path for the error log in the MySQL configuration file (my.cnf or my.ini)." + compliance: + - cis: ["6.1"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/error-log.html + condition: all + rules: + - 'c:grep -Rh log_error /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:log_error\s*=\s*\S+\s*' + + - id: 10510 + title: "Ensure Log Files are not Stored on a non-system partition" + description: "MySQL log files can be set in the MySQL configuration to exist anywhere on the filesystem. It is common practice to ensure that the system filesystem is left uncluttered by application logs. System filesystems include the root, /var, or /usr." + rationale: "Moving the MySQL logs off the system partition will reduce the probability of denial of service via the exhaustion of available disk space to the operating system." + remediation: "In the MySQL configuration file (my.cnf), locate the log-bin entry and set it to a file not on root ('/'), /var, or /usr." + compliance: + - cis: ["6.2"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/binary-log.html + - https://dev.mysql.com/doc/refman/5.6/en/replication-options-binary-log.html + condition: none + rules: + - 'c:grep -Rh log_bin /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:log_bin\s*\t*/+$|log_bin\s*\t*/+var/*$|log_bin\s*\t*/+usr/*$' + + - id: 10511 + title: "Ensure 'log_warning' is set to 2" + description: "The log_warnings system variable, enabled by default, provides additional information to the MySQL log. A value of 1 enables logging of warning messages, and higher integer values tend to enable more logging." + rationale: "This might help to detect malicious behavior by logging communication errors and aborted connections." + remediation: "Ensure a line containing log-warnings = 2 is found in the mysqld section of the MySQL configuration file (my.cnf)." + compliance: + - cis: ["6.3"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_log-warnings + condition: all + rules: + - 'c:grep -Rh log_warnings /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:log_warnings\s*=\s*2' + + - id: 10512 + title: "Ensure 'log_raw' is set to 'OFF'" + description: "The log-raw MySQL option determines whether passwords are rewritten by the server so as not to appear in log files as plain text. If log-raw is enabled, then passwords are written to the various log files (general query log, slow query log, and binary log) in plain text. " + rationale: "With raw logging of passwords enabled someone with access to the log files might see plain text passwords." + remediation: "IN the MySQL configuration file (my.cnf), locate and set the value of this option: log-raw = OFF" + compliance: + - cis: ["6.4"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/password-logging.html + - https://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_log-raw + condition: all + rules: + - 'c:grep -Rh log-raw /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:log-raw\s*OFF$|log-raw\s*off$' + + #7 Authentication + - id: 10513 + title: "Ensure 'old_passwords' Is Not Set to '1' or 'ON'" + description: "This variable controls the password hashing method used by the PASSWORD() function and for the IDENTIFIED BY clause of the CREATE USER and GRANT statements. Before 5.6.6, the value can be 0 (or OFF), or 1 (or ON). As of 5.6.6, the following value can be one of the following: 0 - authenticate with the mysql_native_password plugin; 1 - authenticate with the mysql_old_password plugin; 2 - authenticate with the sha256_password plugin" + rationale: "The mysql_old_password plugin leverages an algorithm that can be quickly brute forced using an offline dictionary attack. See CVE-2003-1480 for additional details." + remediation: "Configure mysql to leverage the mysql_native_password or sha256_password plugin." + compliance: + - cis: ["7.1"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/password-hashing.html + - https://dev.mysql.com/doc/refman/5.6/en/sha256-authentication-plugin.html + - https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_old_passwords + - https://www.cvedetails.com/cve/CVE-2003-1480/ + condition: none + rules: + - 'c:grep -Rh old_passwords /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:old_passwords\s*=\s*1' + - 'c:grep -Rh old_passwords /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:old_passwords\s*=\s*ON|old_passwords\s*=\s*on' + + - id: 10514 + title: "Ensure 'secure_auth' is set to 'ON'" + description: "This option dictates whether the server will deny connections by clients that attempt to use accounts that have their password stored in the mysql_old_password format." + rationale: "Enabling this option will prevent all use of passwords employing the old format (and hence insecure communication over the network)." + remediation: "Add a line secure_auth=ON to the [mysqld] section of the MySQL option file." + compliance: + - cis: ["7.2"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_secure-auth + condition: all + rules: + - 'c:grep -Rh secure_auth /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:secure_auth\s*=\s*ON|secure_auth\s*=\s*on' + + - id: 10515 + title: "Ensure Passwords Are Not Stored in the Global Configuration" + description: "The [client] section of the MySQL configuration file allows setting a user and password to be used. Verify the password option is not used in the global configuration file (my.cnf)." + rationale: "The use of the password parameter may negatively impact the confidentiality of the user's password." + remediation: "Use the mysql_config_editor to store authentication credentials in .mylogin.cnf in encrypted form. If not possible, use the user-specific options file, .my.cnf., and restricting file access permissions to the user identity. " + compliance: + - cis: ["7.3"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/mysql-config-editor.html + condition: none + rules: + - 'c:grep -Rh password /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:^\s*password\.*' + + - id: 10516 + title: "Ensure 'sql_mode' Contains 'NO_AUTO_CREATE_USER'" + description: "NO_AUTO_CREATE_USER is an option for sql_mode that prevents a GRANT statement from automatically creating a user when authentication information is not provided." + rationale: "Blank passwords negate the benefits provided by authentication mechanisms. Without this setting an administrative user might accidentally create a user without a password." + remediation: "In the MySQL configuration file (my.cnf), find the sql_mode setting in the [mysqld] area, and add the NO_AUTO_CREATE_USER to the sql_mode setting." + compliance: + - cis: ["7.4"] + condition: all + rules: + - 'c:grep -Rh no_auto_create_user /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:\s*no_auto_create_user\s*$' + + - id: 10517 + title: "Ensure Password Policy is in Place" + description: "Password complexity includes password characteristics such as length, case, length, and character sets." + rationale: "Complex passwords help mitigate dictionary, brute forcing, and other password attacks. This recommendation prevents users from choosing weak passwords which can easily be guessed." + remediation: "Add to the global configuration: plugin-load=validate_password.so validate-password=FORCE_PLUS_PERMANENT validate_password_length=14 validate_password_mixed_case_count=1 validate_password_number_count=1 validate_password_special_char_count=1 validate_password_policy=MEDIUM. And change passwords for users which have passwords which are identical to their username. Restarting the server is required." + compliance: + - cis: ["7.6"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/validate-password-plugin.html + condition: all + rules: + - 'c:grep -Rh plugin-load /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:plugin-load\s*=\s*validate_password.so\s*$' + - 'c:grep -Rh validate-password /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:validate-password\s*=\s*force_plus_permanent\s*$' + - 'c:grep -Rh validate_password_length /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> n:validate_password_length\s*=\s*(\d+)\s$ compare >= 14' + - 'c:grep -Rh validate_password_mixed_case_count /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> n:validate_password_mixed_case_count\s*=\s*(\d+)\s*$ compare >= 1' + - 'c:grep -Rh validate_password_number_count /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> n:validate_password_number_count\s*=\s*(\d+)\s*$ compare >= 1' + - 'c:grep -Rh validate_password_special_char_count /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> n:validate_password_special_char_count\s*=\s*(\d+) compare >= 1' + - 'c:grep -Rh validate_password_policy /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:validate_password_policy\s*=\s*MEDIUM\s*|validate_password_policy\s*=\s*STRONG\s*|validate_password_policy\s*=\s*medium\s*|validate_password_policy\s*=\s*strong\s*' + + #9 Replication + - id: 10518 + title: "Ensure 'master_info_repository' is set to 'TABLE'" + description: "The master_info_repository setting determines to where a slave logs master status and connection information. The options are FILE or TABLE. Note also that this setting is associated with the sync_master_info setting as well." + rationale: "The password which the client uses is stored in the master info repository, which by default is a plaintext file. The TABLE master info repository is a bit safer, but with filesystem access it's still possible to gain access to the password the slave is using." + remediation: "Open the MySQL configuration file (my.cnf); locate master_info_repository; set the master_info_repository value to TABLE. Add the option if it does not exist." + compliance: + - cis: ["9.2"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/replication-options-slave.html#sysvar_master_info_repository + condition: all + rules: + - 'c:grep -Rh master_info_repository /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:master_info_repository\s*=\s*TABLE|master_info_repository\s*=\s*table' diff --git a/etc/ruleset/sca/applications/cis_mysql5_6_enterprise.yml b/etc/ruleset/sca/applications/cis_mysql5_6_enterprise.yml new file mode 100644 index 0000000000..fc595962b0 --- /dev/null +++ b/etc/ruleset/sca/applications/cis_mysql5_6_enterprise.yml @@ -0,0 +1,369 @@ +# Security Configuration Assessment +# CIS Checks for Oracle MySQL Entreprise Edition 5.6 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for Oracle MySQL Entreprise Edition 5.6 v1.1.0 - 08-15-2016 + +policy: + id: "cis_mysql_enterprise" + file: "cis_mysql5_6_enterprise.yml" + name: "CIS Oracle MySQL Enterprise Edition 5.6 Benchmark v1.1.0" + description: "This document, CIS Oracle MySQL Enterprise Edition 5.6 Benchmark, provides prescriptive guidance for establishing a secure configuration posture for MySQL Enterprise Edition 5.6. The tests were carried out against MySQL Enterprise Edition 5.6 running on Ubuntu Linux 14.04, but applies to other linux distributions as well." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that MySQL is installed on the system" + description: "Requirements for running the SCA scan against the MySQL policy." + condition: any + rules: + - "d:/etc/mysql" + - "d:/var/lib/mysql" + +checks: + #1 Operating System Level Configuration + - id: 11000 + title: "Disable MySQL Command History" + description: "On Linux/UNIX, the MySQL client logs statements executed interactively to a history file. By default, this file is named .mysql_history in the user's home directory. Most interactive commands run in the MySQL client application are saved to a history file. The MySQL command history should be disabled." + rationale: "Disabling the MySQL command history reduces the probability of exposing sensitive information, such as passwords and encryption keys." + remediation: "Perform the following steps: 1. Remove .mysql_history if it exists. And 2. Set the MYSQL_HISTFILE environment variable to /dev/null. This will need to be placed in the shell's startup script. Or Create $HOME/.mysql_history as a symbolic to /dev/null." + compliance: + - cis: ["1.3"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/mysql-logging.html + - https://bugs.mysql.com/bug.php?id=72158 + condition: none + rules: + - "d:/home -> ^.mysql_history$" + - "d:/root -> ^.mysql_history$" + + - id: 11001 + title: "Disable Interactive Login" + description: "When created, the MySQL user may have interactive access to the operating system, which means that the MySQL user could login to the host as any other user would." + rationale: "Preventing the MySQL user from logging in interactively may reduce the impact of a compromised MySQL account. There is also more accountability as accessing the operating system where the MySQL server lies will require the user's own account. Interactive access by the MySQL user is unnecessary and should be disabled." + remediation: "Execute one of the following commands in a terminal: 'usermod -s /bin/false mysql' or 'usermod -s /sbin/nologin mysql'" + compliance: + - cis: ["1.5"] + condition: all + rules: + - "c:getent passwd mysql -> r:/bin/false|/sbin/nologin" + + - id: 11002 + title: "Verify That 'MYSQL_PWD' Is Not Set In Users' Profiles" + description: "MySQL can read a default database password from an environment variable called MYSQL_PWD." + rationale: "The use of the MYSQL_PWD environment variable implies the clear text storage of MySQL credentials. Avoiding this may increase assurance that the confidentiality of MySQL credentials is preserved." + remediation: "Check which users and/or scripts are setting MYSQL_PWD and change them to use a more secure method." + compliance: + - cis: ["1.6"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/environment-variables.html + condition: none + rules: + - "c:find /home -maxdepth 2 -type f -exec grep MYSQL_PWD {} + -> r:.profile|.bashrc|.bash_profile && r:$MYSQL_PWD" + + #4 General + - id: 11003 + title: "Ensure 'allow-suspicious-udfs' Is Set to 'FALSE'" + description: "This option prevents attaching arbitrary shared library functions as user-defined functions by checking for at least one corresponding method named _init, _deinit, _reset, _clear, or _add." + rationale: "Preventing shared libraries that do not contain user-defined functions from loading will reduce the attack surface of the server." + remediation: "Remove '--allow-suspicious-udfs' from the 'mysqld' start up command line. Or Remove 'allow-suspicious-udfs' from the MySQL option file." + compliance: + - cis: ["4.3"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/udf-security.html + - https://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_allow-suspicious-udfs + condition: none + rules: + - "c:my_print_defaults mysqld -> r:allow-suspicious-udfs" + + - id: 11004 + title: "Ensure 'local_infile' is Disabled" + description: "The 'local_infile' parameter dictates whether files located on the MySQL client's computer can be loaded or selected via 'LOAD DATA INFILE' or 'SELECT local_file'." + rationale: "Disabling 'local_infile' reduces an attacker's ability to read sensitive files off the affected server via a SQL injection vulnerability." + remediation: "Add a line local-infile=0 in the [mysqld] section of the MySQL configuration file and restart the MySQL service." + compliance: + - cis: ["4.4"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/string-functions.html#function_load-file + - https://dev.mysql.com/doc/refman/5.6/en/load-data.html + condition: all + rules: + - 'c:grep -Rh local-infile /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:local-infile\s*=\s*0' + + - id: 11005 + title: "Ensure 'mysqld' Is Not Started with '--skip-grant-tables'" + description: "This option causes mysqld to start without using the privilege system." + rationale: "If this option is used, all clients of the affected server will have unrestricted access to all databases." + remediation: "Open the MySQL configuration (e.g. my.cnf) file and set: skip-grant-tables = FALSE" + compliance: + - cis: ["4.5"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_skip-grant-tables + condition: all + rules: + - 'c:grep -Rh skip-grant-tables /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:skip-grant-tables\s*=\s*FALSE|skip-grant-tables\s*=\s*false' + + - id: 11006 + title: "Ensure '--skip-symbolic-links' Is Enabled" + description: "The symbolic-links and skip-symbolic-links options for MySQL determine whether symbolic link support is available. When use of symbolic links are enabled, they have different effects depending on the host platform. When symbolic links are disabled, then symbolic links stored in files or entries in tables are not used by the database. " + rationale: "Prevents sym links being used for data base files. This is especially important when MySQL is executing as root as arbitrary files may be overwritten. The symbolic-links option might allow someone to direct actions by to MySQL server to other files and/or directories." + remediation: "Open the MySQL configuration file (my.cnf), locate 'skip_symbolic_links' and set it to YES. If the option does not exist, create it in the 'mysqld' section." + compliance: + - cis: ["4.6"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/symbolic-links.html + - https://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_symbolic-links + condition: all + rules: + - 'c:grep -Rh skip_symbolic_links /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:skip_symbolic_links\s*=\s*YES|skip_symbolic_links\s*=\s*yes' + + - id: 11007 + title: "Ensure 'secure_file_priv' is not empty" + description: "The secure_file_priv option restricts to paths used by LOAD DATA INFILE or SELECT local_file. It is recommended that this option be set to a file system location that contains only resources expected to be loaded by MySQL." + rationale: "Setting secure_file_priv reduces an attacker's ability to read sensitive files off the affected server via a SQL injection vulnerability. " + remediation: "Add the line secure_file_priv= to the [mysqld] section of the MySQL configuration file and restart the MySQL service." + compliance: + - cis: ["4.8"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_secure_file_priv + condition: all + rules: + - 'c:grep -Rh secure_file_priv /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:secure_file_priv\s*=\s*\.' + + - id: 11008 + title: "Ensure 'sql_mode' Contains 'STRICT_ALL_TABLES'" + description: "When data changing statements are made (i.e. INSERT, UPDATE), MySQL can handle invalid or missing values differently depending on whether strict SQL mode is enabled. When strict SQL mode is enabled, data may not be truncated or otherwise 'adjusted' to make the data changing statement work." + rationale: "Without strict mode the server tries to do proceed with the action when an error might have been a more secure choice. For example, by default MySQL will truncate data if it does not fit in a field, which can lead to unknown behavior, or be leveraged by an attacker to circumvent data validation. " + remediation: "Add STRICT_ALL_TABLES to the sql_mode in the server's configuration file." + compliance: + - cis: ["4.9"] + condition: all + rules: + - "c:grep -Rh strict_all_tables /etc/mysql/my.cnf /etc/mysql/my.ini /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:strict_all_tables" + + #6 Auditing and Logging + - id: 11009 + title: "Ensure 'log_error' is not empty" + description: "The error log contains information about events such as mysqld starting and stopping, when a table needs to be checked or repaired, and, depending on the host operating system, stack traces when mysqld fails" + rationale: "Enabling error logging may increase the ability to detect malicious attempts against MySQL, and other critical messages, such as if the error log is not enabled then connection error might go unnoticed." + remediation: "Set the log-error option to the path for the error log in the MySQL configuration file (my.cnf or my.ini)." + compliance: + - cis: ["6.1"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/error-log.html + condition: all + rules: + - 'c:grep -Rh log_error /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:log_error\s*=\s*\S+\s*' + + - id: 11010 + title: "Ensure Log Files are not Stored on a non-system partition" + description: "MySQL log files can be set in the MySQL configuration to exist anywhere on the filesystem. It is common practice to ensure that the system filesystem is left uncluttered by application logs. System filesystems include the root, /var, or /usr." + rationale: "Moving the MySQL logs off the system partition will reduce the probability of denial of service via the exhaustion of available disk space to the operating system." + remediation: "In the MySQL configuration file (my.cnf), locate the log-bin entry and set it to a file not on root ('/'), /var, or /usr." + compliance: + - cis: ["6.2"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/binary-log.html + - https://dev.mysql.com/doc/refman/5.6/en/replication-options-binary-log.html + condition: none + rules: + - 'c:grep -Rh log_bin /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:log_bin\s*\t*/+$|log_bin\s*\t*/+var/*$|log_bin\s*\t*/+usr/*$' + + - id: 11011 + title: "Ensure 'log_warning' is set to 2" + description: "The log_warnings system variable, enabled by default, provides additional information to the MySQL log. A value of 1 enables logging of warning messages, and higher integer values tend to enable more logging." + rationale: "This might help to detect malicious behavior by logging communication errors and aborted connections." + remediation: "Ensure a line containing log-warnings = 2 is found in the mysqld section of the MySQL configuration file (my.cnf)." + compliance: + - cis: ["6.3"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_log-warnings + condition: all + rules: + - 'c:grep -Rh log_warnings /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:log_warnings\s*=\s*2' + + - id: 11012 + title: "Ensure 'log_raw' is set to 'OFF'" + description: "The log-raw MySQL option determines whether passwords are rewritten by the server so as not to appear in log files as plain text. If log-raw is enabled, then passwords are written to the various log files (general query log, slow query log, and binary log) in plain text. " + rationale: "With raw logging of passwords enabled someone with access to the log files might see plain text passwords." + remediation: "IN the MySQL configuration file (my.cnf), locate and set the value of this option: log-raw = OFF" + compliance: + - cis: ["6.4"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/password-logging.html + - https://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_log-raw + condition: all + rules: + - 'c:grep -Rh log-raw /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:log-raw\s*OFF$|log-raw\s*off$' + + #7 Authentication + - id: 11013 + title: "Ensure 'old_passwords' Is Not Set to '1' or 'ON'" + description: "This variable controls the password hashing method used by the PASSWORD() function and for the IDENTIFIED BY clause of the CREATE USER and GRANT statements. Before 5.6.6, the value can be 0 (or OFF), or 1 (or ON). As of 5.6.6, the following value can be one of the following: 0 - authenticate with the mysql_native_password plugin; 1 - authenticate with the mysql_old_password plugin; 2 - authenticate with the sha256_password plugin" + rationale: "The mysql_old_password plugin leverages an algorithm that can be quickly brute forced using an offline dictionary attack. See CVE-2003-1480 for additional details." + remediation: "Configure mysql to leverage the mysql_native_password or sha256_password plugin." + compliance: + - cis: ["7.1"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/password-hashing.html + - https://dev.mysql.com/doc/refman/5.6/en/sha256-authentication-plugin.html + - https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_old_passwords + - https://www.cvedetails.com/cve/CVE-2003-1480/ + condition: none + rules: + - 'c:grep -Rh old_passwords /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:old_passwords\s*=\s*1' + - 'c:grep -Rh old_passwords /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:old_passwords\s*=\s*ON|old_passwords\s*=\s*on' + + - id: 11014 + title: "Ensure 'secure_auth' is set to 'ON'" + description: "This option dictates whether the server will deny connections by clients that attempt to use accounts that have their password stored in the mysql_old_password format." + rationale: "Enabling this option will prevent all use of passwords employing the old format (and hence insecure communication over the network)." + remediation: "Add a line secure_auth=ON to the [mysqld] section of the MySQL option file." + compliance: + - cis: ["7.2"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_secure-auth + condition: all + rules: + - 'c:grep -Rh secure_auth /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:secure_auth\s*=\s*ON|secure_auth\s*=\s*on' + + - id: 11015 + title: "Ensure Passwords Are Not Stored in the Global Configuration" + description: "The [client] section of the MySQL configuration file allows setting a user and password to be used. Verify the password option is not used in the global configuration file (my.cnf)." + rationale: "The use of the password parameter may negatively impact the confidentiality of the user's password." + remediation: "Use the mysql_config_editor to store authentication credentials in .mylogin.cnf in encrypted form. If not possible, use the user-specific options file, .my.cnf., and restricting file access permissions to the user identity. " + compliance: + - cis: ["7.3"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/mysql-config-editor.html + condition: none + rules: + - 'c:grep -Rh password /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:^\s*password\.*' + + - id: 11016 + title: "Ensure 'sql_mode' Contains 'NO_AUTO_CREATE_USER'" + description: "NO_AUTO_CREATE_USER is an option for sql_mode that prevents a GRANT statement from automatically creating a user when authentication information is not provided." + rationale: "Blank passwords negate the benefits provided by authentication mechanisms. Without this setting an administrative user might accidentally create a user without a password." + remediation: "In the MySQL configuration file (my.cnf), find the sql_mode setting in the [mysqld] area, and add the NO_AUTO_CREATE_USER to the sql_mode setting." + compliance: + - cis: ["7.4"] + condition: all + rules: + - 'c:grep -Rh no_auto_create_user /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:\s*no_auto_create_user\s*$' + + - id: 11017 + title: "Ensure Password Policy is in Place" + description: "Password complexity includes password characteristics such as length, case, length, and character sets." + rationale: "Complex passwords help mitigate dictionary, brute forcing, and other password attacks. This recommendation prevents users from choosing weak passwords which can easily be guessed." + remediation: "Add to the global configuration: plugin-load=validate_password.so validate-password=FORCE_PLUS_PERMANENT validate_password_length=14 validate_password_mixed_case_count=1 validate_password_number_count=1 validate_password_special_char_count=1 validate_password_policy=MEDIUM. And change passwords for users which have passwords which are identical to their username. Restarting the server is required." + compliance: + - cis: ["7.6"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/validate-password-plugin.html + condition: all + rules: + - 'c:grep -Rh plugin-load /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:plugin-load\s*=\s*validate_password.so\s*$' + - 'c:grep -Rh validate-password /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:validate-password\s*=\s*force_plus_permanent\s*$' + - 'c:grep -Rh validate_password_length /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> n:validate_password_length\s*=\s*(\d+)\s$ compare >= 14' + - 'c:grep -Rh validate_password_mixed_case_count /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> n:validate_password_mixed_case_count\s*=\s*(\d+)\s*$ compare >= 1' + - 'c:grep -Rh validate_password_number_count /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> n:validate_password_number_count\s*=\s*(\d+)\s*$ compare >= 1' + - 'c:grep -Rh validate_password_special_char_count /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> n:validate_password_special_char_count\s*=\s*(\d+) compare >= 1' + - 'c:grep -Rh validate_password_policy /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:validate_password_policy\s*=\s*MEDIUM\s*|validate_password_policy\s*=\s*STRONG\s*|validate_password_policy\s*=\s*medium\s*|validate_password_policy\s*=\s*strong\s*' + + #9 Replication + - id: 11018 + title: "Ensure 'master_info_repository' is set to 'TABLE'" + description: "The master_info_repository setting determines to where a slave logs master status and connection information. The options are FILE or TABLE. Note also that this setting is associated with the sync_master_info setting as well." + rationale: "The password which the client uses is stored in the master info repository, which by default is a plaintext file. The TABLE master info repository is a bit safer, but with filesystem access it's still possible to gain access to the password the slave is using." + remediation: "Open the MySQL configuration file (my.cnf); locate master_info_repository; set the master_info_repository value to TABLE. Add the option if it does not exist." + compliance: + - cis: ["9.2"] + references: + - https://dev.mysql.com/doc/refman/5.6/en/replication-options-slave.html#sysvar_master_info_repository + condition: all + rules: + - 'c:grep -Rh master_info_repository /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:master_info_repository\s*=\s*TABLE|master_info_repository\s*=\s*table' + + #10 Enterprise rules + - id: 11019 + title: "Ensure audit_log_connection_policy is not set to 'NONE'" + description: "The audit_log_connection_policy variable controls how the audit plugin writes connection events to the audit log file. " + rationale: "The audit_log_connection_policy offers three options: NONE, ERRORS, and ALL. Each option determines whether connection events are logged and the type of connection events that are logged. Setting a non 'NONE' value for audit_log_connection_policy ensures at a minimum, failed connection events are being logged. The ERRORS setting will log failed connection events and the ALL setting will log all connection events. For MySQL versions => 5.6.20, the audit_log_policy variable can override the audit_log_connection_policy, potentially invalidating this benchmark recommendation, therefore enforcing a setting for audit_log_connection_policy ensures the integrity of this recommendation." + remediation: "Set the audit_log_connection_policy option to ERRORS or ALL in the MySQL configuration file." + compliance: + - cis: ["6.5"] + condition: none + rules: + - 'c:grep -Rh audit_log_connection_policy /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:audit_log_connection_policy\s*=\s* && r:none|NONE' + + - id: 11020 + title: "Ensure audit_log_exclude_account is set to NULL" + description: "The audit_log_exclude_accounts variable enables the administrator to set accounts for which events will not be logged in the audit log." + rationale: "The audit_log_exclude_accounts variable has two permitted values, either NULL or a list of MySQL accounts. Setting this variable correctly ensures no single user is able to unintentionally evade being logged. Particular attention should be made to privileged accounts, as such accounts will generally be bestowed with more privileges than normal users, and should not be listed against this variable." + remediation: "Set audit_log_exclude_accounts=NULL in my.cnf." + compliance: + - cis: ["6.6"] + condition: all + rules: + - 'c:grep -Rh audit_log_exclude_accounts /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:audit_log_exclude_accounts\s*=\s* && r:null\s*$|NULL\s*$' + + - id: 11021 + title: "Ensure audit_log_include_accounts is set to NULL" + description: "The audit_log_include_accounts variable enables the administrator to set accounts for which events should be logged in the audit log." + rationale: "The audit_log_include_accounts variable has two permitted values, either NULL or a list of MySQL accounts. Setting this variable correctly ensures all MySQL users are being logged in the audit log." + remediation: "Set audit_log_include_accounts=NULL in my.cnf." + compliance: + - cis: ["6.7"] + condition: all + rules: + - 'c:grep -Rh audit_log_include_accounts /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:audit_log_include_accounts\s*=\s* && r:null\s*$|NULL\s*$' + + - id: 11022 + title: "Ensure audit_log_policy is set to log logins and connections" + description: "With the audit_log_policy setting the amount of information which is sent to the audit log is controlled. It must be set to log logins and connections." + rationale: "If this setting is set to QUERIES, CONNECTIONS or NONE then either connections or queries are not written to the audit log file." + remediation: "Set audit_log_policy='ALL' in the MySQL configuration file and activate the setting by restarting the server or executing SET GLOBAL audit_log_policy='ALL';" + compliance: + - cis: ["6.9"] + condition: all + rules: + - 'c:grep -Rh audit_log_policy /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> !r:^\s*\t*# && r:audit_log_policy\s*=\s* && r:ALL|LOGINS|all|logins' + + - id: 11023 + title: "Ensure audit_log_statement_policy is set to ALL" + description: "This setting controls whether statements are written to the audit log." + rationale: "This setting must be set to ALL to ensure all statement information is written to the audit log." + remediation: "Add the option audit_log_statement_policy='ALL' to the mysqld section of the MySQL configuration file and restart the server." + compliance: + - cis: ["6.10"] + condition: all + rules: + - 'c:grep -Rh audit_log_statement_policy /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:audit_log_statement_policy\s*=\s* && r:all$|ALL$' + + - id: 11024 + title: "Set audit_log_strategy to SYNCHRONOUS or SEMISYNCRONOUS" + description: "The audit_log_strategy must be set to SYNCHRONOUS or SEMISYNCHRONOUS." + rationale: "This setting controls how information is written to the audit log. It can be set to SYNCHRONOUS to make it fully durable or other settings which are less durable but have less performance overhead." + remediation: "Set audit_log_strategy='SEMISYNCHRONOUS' (or SYNCHRONOUS) in the mysqld section of the configuration file (my.cnf)." + compliance: + - cis: ["6.11"] + condition: all + rules: + - 'c:grep -Rh audit_log_strategy /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:audit_log_strategy\s*=\s* && r:semisynchronous|synchronous|SEMISYNCHRONOUS|SYNCHRONOUS' + + - id: 11025 + title: "Make sure the audit plugin can't be unloaded" + description: "Set audit_log to FORCE_PLUS_PERMANENT." + rationale: "This makes disables unloading on the plugin." + remediation: "Ensure a line audit_log = 'FORCE_PLUS_PERMANENT' is found in the mysqld section of the MySQL configuration file (my.cnf)." + compliance: + - cis: ["6.12"] + condition: all + rules: + - 'c:grep -Rh force_plus_permanent /etc/mysql/my.cnf /etc/mysql/mariadb.cnf /etc/mysql/conf.d /etc/mysql/mariadb.conf.d -> r:^audit_log\s*=\s*force_plus_permanent|^audit_log\s*=\s*FORCE_PLUS_PERMANENT' diff --git a/etc/ruleset/sca/applications/cis_postgre_sql_13.yml b/etc/ruleset/sca/applications/cis_postgre_sql_13.yml new file mode 100644 index 0000000000..2e33b389db --- /dev/null +++ b/etc/ruleset/sca/applications/cis_postgre_sql_13.yml @@ -0,0 +1,1140 @@ +# Security Configuration Assessment +# CIS Checks for PostgreSQL 13 +# Copyright (C) 2015, Wazuh Inc. + +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation + +# Based on: +# Center for Internet Security Benchmark for PostgreSQL 13 Benchmark v1.0.0 - 02-26-2021 + +policy: + id: "cis_postgresql_13" + file: "cis_postgre_sql_13.yml" + name: "CIS Benchmark for PostgreSQL 13" + description: "This document, CIS PostgreSQL 13 Benchmark, provides prescriptive guidance for establishing a secure configuration posture for PostgreSQL 13." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +variables: # default values, please provide based on your organization policies + $user: test_user # must be granted pg_read_all_settings and LOGIN and .pgpass exists + $host: localhost + $db: postgres + $log_destination: stderr #stderr + $log_filename: postgresql-%Y-%m-%d_%H%M%S.log #postgresql-%Y-%m-%d_%H%M%S.log + $log_directory: log # log + $log_policy: "0600" # 0600 + $log_rotation_age: 1d # 1d + $log_rotation_size: 10MB # 10MB + $syslog_facility: local0 # local0 + $syslog_ident: postgres # postgres + $log_timezone: America/New_York # server's timezone in the Operating System + +requirements: + title: "Check that postgreSQL13 is up and able to execute commands from shell" + description: "Requirements for running the SCA scan against the PostgreSQL13 setup. " + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "\\l" -w -> r:row' + - "c:psql --version -> r:13" + +checks: + # 1 Installation and Patches + + # 1.1 Ensure packages are obtained from authorized repositories (Manual) + # Not Applicable: requiers manual verification + + # 1.2 Ensure systemd Service Files Are Enabled (Automated) + - id: 24000 + title: Ensure systemd Service Files Are Enabled + description: Confirm, and correct if necessary, the PostgreSQL systemd service is enabled. + rationale: > + Enabling the systemd service on the OS ensures the database service is active when a + change of state occurs as in the case of a system startup or reboot. + remediation: > + Irrespective of package source, PostgreSQL services can be identified because it typically + includes the text string "postgresql". PGDG installs do not automatically register the service + as a "want" of the default systemd target. Multiple instances of PostgreSQL services often + distinguish themselves using a version number. + compliance: + - cis: ["1.2"] + - cis_csc: ["18", "5.1"] + references: + - https://linuxcommand.org/man_pages/runlevel8.html + - https://linuxcommand.org/man_pages/chkconfig8.html + - https://www.tldp.org/LDP/sag/html/run-levels-intro.html + condition: all + rules: + - c:sh -c "systemctl get-default | systemctl list-dependencies | grep postgres" -> r:postgres + + # 1.3 Ensure Data Cluster Initialized Successfully (Automated) + # Not Applicable: user switching + + # 2 Directory and File Permissions + # Not Applicable: user switching + + # 3 Logging Monitoring And Auditing + + # 3.1.1 + # Not Applicable: Not covered + + # 3.1.2 Ensure the log destinations are set correctly (Automated) --TODO-- + - id: 24001 + title: Ensure the log destinations are set correctly + description: > + PostgreSQL supports several methods for logging server messages, including stderr, + csvlog and syslog. On Windows, eventlog is also supported. One or more of these + destinations should be set for server log output. + rationale: > + If log_destination is not set, then any log messages generated by the core PostgreSQL + processes will be lost. + remediation: > + "Execute the following SQL statements to remediate this setting (in this example, setting the + log destination to csvlog): + + postgres=# alter system set log_destination = 'csvlog'; + + ALTER SYSTEM + + postgres=# select pg_reload_conf(); + + pg_reload_conf + + ---------------- + + t + + (1 row)" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["6.2", "6.3"] + references: + - https://www.postgresql.org/docs/current/runtime-config-logging.html + condition: all + rules: + - c:sh -c "psql -U $user -h $host $db -c \"SHOW log_destination\" | grep $log_destination$" -> r:\.+ + + # 3.1.3 Ensure the logging collector is enabled (Automated) + - id: 24002 + title: Ensure the logging collector is enabled + description: > + The logging collector is a background process that captures log messages sent to stderr + and redirects them into log files. The logging_collector setting must be enabled in order + for this process to run. It can only be set at server start. + rationale: > + "The logging collector approach is often more useful than logging to syslog, since some + types of messages might not appear in syslog output. One common example is dynamiclinker failure message; another may be error messages produced by scripts such as + archive_command. + Note: This setting must be enabled when log_destination is either stderr or csvlog and + for certain other logging parameters to take effect." + remediation: > + "Execute the following SQL statement(s) to remediate this setting: + + postgres=# alter system set logging_collector = 'on'; + + ALTER SYSTEM + + 26 | Page + + Unfortunately, this setting can only be changed at server (re)start. As root, restart the + + PostgreSQL service for this change to take effect: + + # whoami + + root + + # systemctl restart postgresql-13 + + # systemctl status postgresql-13|grep 'ago$' + + Active: active (running) since ; 1s ago" + compliance: + - cis: ["3.1.3"] + - cis_csc: ["6.2", "6.3"] + references: + - https://www.postgresql.org/docs/current/runtime-config-logging.html + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "SHOW logging_collector" -> r:\son' + + # 3.1.4 Ensure the log file destination directory is set correctly (Automated) + - id: 24003 + title: Ensure the log file destination directory is set correctly + description: > + The log_directory setting specifies the destination directory for log files when + log_destination is stderr or csvlog. It can be specified as relative to the cluster data + directory ($PGDATA) or as an absolute path. log_directory should be set according to your + organization's logging policy. + rationale: > + If log_directory is not set, it is interpreted as the absolute path '/' and PostgreSQL will + attempt to write its logs there (and typically fail due to a lack of permissions to that + directory). This parameter should be set to direct the logs into the appropriate directory + location as defined by your organization's logging policy. + remediation: > + "Execute the following SQL statement(s) to remediate this setting: + + postgres=# alter system set log_directory='/var/log/postgres'; + + ALTER SYSTEM + + postgres=# select pg_reload_conf(); + + pg_reload_conf + + ---------------- + + 28 | Page + + t + + (1 row) + + postgres=# SHOW log_directory; + + log_directory + + --------------- + + /var/log/postgres + + (1 row) + + Note: The use of /var/log/postgres, above, is an example. This should be set to an + appropriate path as defined by your organization's logging requirements. Having said that, + it is a good idea to have the logs outside of your PGDATA directory so that they are not + included by things like pg_basebackup or pgBackRest." + compliance: + - cis: ["3.1.4"] + - cis_csc: ["6.2", "6.3"] + references: + - https://www.postgresql.org/docs/current/runtime-config-logging.html + condition: all + rules: + - 'c:sh -c "psql -U $user -h $host $db -c \"SHOW log_directory\" | grep $log_directory$" -> r:\.+' + + # 3.1.5 Ensure the filename pattern for log files is set correctly (Automated) + - id: 24004 + title: Ensure the filename pattern for log files is set correctly + description: > + The log_filename setting specifies the filename pattern for log files. The value for + log_filename should match your organization's logging policy. + The value is treated as a strftime pattern, so %-escapes can be used to specify timevarying filenames. The supported %-escapes are similar to those listed in the Open Group's + strftime specification. If you specify a filename without escapes, you should plan to use a + log rotation utility to avoid eventually filling the partition that contains log_directory. If + there are any time-zone-dependent %-escapes, the computation is done in the zone + specified by log_timezone. Also, the system's strftime is not used directly, so platformspecific (nonstandard) extensions do not work. + If CSV-format output is enabled in log_destination, .csv will be appended to the log + filename. (If log_filename ends in .log, the suffix is replaced instead.) + rationale: > + If log_filename is not set, then the value of log_directory is appended to an empty string + try to write to a directory instead of a file. + remediation: | + "Execute the following SQL statement(s) to remediate this setting: + postgres=# alter system set log_filename='postgresql-%Y%m%d.log'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + postgres=# SHOW log_filename; + log_filename + ------------------- + postgresql-%Y%m%d.log + (1 row) + Note: In this example, a new logfile will be created for each day (e.g. postgresql20180901.log)" + compliance: + - cis: ["3.1.5"] + - cis_csc: ["6.2", "6.3"] + references: + - https://man7.org/linux/man-pages/man3/strftime.3.html + - https://www.postgresql.org/docs/current/runtime-config-logging.html + condition: all + rules: + - 'c:sh -c "psql -U $user -h $host $db -c \"SHOW log_filename\" | grep $log_filename" -> r:\.+' + + # 3.1.6 Ensure the log file permissions are set correctly (Automated) + - id: 24005 + title: Ensure the log file permissions are set correctly + description: > + The log_file_mode setting determines the file permissions for log files when + logging_collector is enabled. The parameter value is expected to be a numeric mode + specification in the form accepted by the chmod and umask system calls. (To use the + customary octal format, the number must start with a 0 (zero).) + The permissions should be set to allow only the necessary access to authorized personnel. + In most cases the best setting is 0600, so that only the server owner can read or write the + log files. The other commonly useful setting is 0640, allowing members of the owner's + group to read the files, although to make use of that, you will need to alter the + log_directory setting to store the log files outside the cluster data directory. + rationale: > + Log files often contain sensitive data. Allowing unnecessary access to log files may + inadvertently expose sensitive data to unauthorized personnel. + remediation: | + "Execute the following SQL statement(s) to remediate this setting (with the example assuming a desired value of 0600): + postgres=# alter system set log_file_mode = '0600'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + 33 | Page + ---------------- + t + (1 row) + postgres=# SHOW log_file_mode; + log_file_mode + --------------- + 0600 + (1 row)" + compliance: + - cis: ["3.1.6"] + - cis_csc: ["14.4", "14.6"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: all + rules: + - 'c:sh -c "psql -U $user -h $host $db -c \"SHOW log_file_mode\" | grep $log_file_mode" -> r:\.+' + + # 3.1.7 Ensure 'log_truncate_on_rotation' is enabled (Automated) + - id: 24006 + title: Ensure 'log_truncate_on_rotation' is enabled + description: > + "Enabling the log_truncate_on_rotation setting when logging_collector is enabled + causes PostgreSQL to truncate (overwrite) existing log files with the same name during log + rotation instead of appending to them. For example, using this setting in combination with + a log_filename setting value like postgresql-%H.log would result in generating 24 hourly + log files and then cyclically overwriting them: + + postgresql-00.log + + postgresql-01.log + + [...] + + postgresql-23.log + + Note: Truncation will occur only when a new file is being opened due to time-based + rotation, not during server startup or size-based rotation (see later in this benchmark for + size-based rotation details)." + rationale: > + If this setting is disabled, pre-existing log files will be appended to if log_filename is + configured in such a way that static names are generated. + Enabling or disabling the truncation should only be decided when also considering the + value of log_filename and log_rotation_age/log_rotation_size. + remediation: | + "Execute the following SQL statement(s) to remediate this setting: + postgres=# alter system set log_truncate_on_rotation = 'on'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + postgres=# SHOW log_truncate_on_rotation; + log_truncate_on_rotation + -------------------------- + on + (1 row)" + compliance: + - cis: ["3.1.7"] + - cis_csc: ["6.3", "6.4"] + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "SHOW log_truncate_on_rotation" -> r:\son' + + # 3.1.8 Ensure the maximum log file lifetime is set correctly (Automated) + - id: 24007 + title: Ensure the maximum log file lifetime is set correctly + description: > + When logging_collector is enabled, the log_rotation_age parameter determines the + maximum lifetime of an individual log file (depending on the value of log_filename). After + this many minutes have elapsed, a new log file will be created via automatic log file + rotation. Current best practices advise log rotation at least daily, but your organization's + logging policy should dictate your rotation schedule. + rationale: Log rotation is a standard best practice for log management. + remediation: | + "Execute the following SQL statement(s) to remediate this setting (in this example, setting it + to one hour): + postgres=# alter system set log_rotation_age='1h'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row)" + compliance: + - cis: ["3.1.8"] + - cis_csc: ["6.3", "6.4"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: all + rules: + - 'c:sh -c "psql -U $user -h $host $db -c \"SHOW log_rotation_age\" | grep $log_rotation_age" -> r:\.+' + + # 3.1.9 Ensure the maximum log file size is set correctly (Automated) + - id: 24008 + title: Ensure the maximum log file size is set correctly + description: > + The log_rotation_size setting determines the maximum size of an individual log file. + Once the maximum size is reached, automatic log file rotation will occur. + rationale: > + If this is set to zero, size-triggered creation of new log files is disabled. This will prevent + automatic log file rotation when files become too large, which could put log data at + increased risk of loss (unless age-based rotation is configured). + remediation: | + "Execute the following SQL statement(s) to remediate this setting (in this example, setting it to 1GB): + postgres=# alter system set log_rotation_size = '1GB'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row)" + compliance: + - cis: ["3.1.9"] + - cis_csc: ["6.3", "6.4"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: all + rules: + - 'c:sh -c "psql -U $user -h $host $db -c \"SHOW log_rotation_size\" | grep $log_rotation_size" -> r:\.+' + + # 3.1.10 Ensure the correct syslog facility is selected (Manual) + - id: 24009 + title: Ensure the correct syslog facility is selected + description: > + The syslog_facility setting specifies the syslog "facility" to be used when logging to + syslog is enabled. You can choose from any of the 'local' facilities. Your organization's logging policy should dictate which facility to use based on the syslog + daemon in use. + rationale: > + If not set to the appropriate facility, the PostgreSQL log messages may be intermingled with + other applications' log messages, incorrectly routed, or potentially dropped (depending on + your syslog configuration). + remediation: | + "Execute the following SQL statement(s) to remediate this setting (in this example, setting it to the LOCAL1 facility): + postgres= alter system set syslog_facility = 'LOCAL1'; + ALTER SYSTEM + postgres= select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row)" + compliance: + - cis: ["3.1.10"] + - cis_csc: ["6", "6.2"] + references: + - https://tools.ietf.org/html/rfc3164 section-4.1.1 + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: all + rules: + - 'c:sh -c "psql -U $user -h $host $db -c \"show syslog_facility\" | grep $syslog_facility" -> r:\.+' + + # 3.1.11 Ensure the program name for PostgreSQL syslog messages is correct (Automated) + - id: 24010 + title: Ensure the program name for PostgreSQL syslog messages is correct + description: > + The syslog_ident setting specifies the program name used to identify PostgreSQL + messages in syslog logs. An example of a possible program name is postgres. + rationale: > + If this is not set correctly, it may be difficult or impossible to distinguish PostgreSQL + messages from other messages in syslog logs. + remediation: | + "Execute the following SQL statement(s) to remediate this setting (in this example, assuming a program name of proddb): + postgres=# alter system set syslog_ident = 'proddb'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + postgres=# show syslog_ident; + syslog_ident + -------------- + proddb + (1 row)" + compliance: + - cis: ["3.1.11"] + - cis_csc: ["6", "6.3"] + references: + - https://tools.ietf.org/html/rfc3164#section-4.1.3 + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: all + rules: + - 'c:sh -c "psql -U $user -h $host $db -c \"show syslog_ident\" | grep $syslog_ident" -> r:\.+' + + # 3.1.12 Ensure the correct messages are written to the server log (Automated) + - id: 24011 + title: Ensure the correct messages are written to the server log + description: > + The log_min_messages setting specifies the message levels that are written to the server + log. Each level includes all the levels that follow it. The lower the level (vertically, below), + the fewer messages are sent. + rationale: > + If this is not set to the correct value, too many messages or too few messages may be + written to the server log. + remediation: | + Execute the following SQL statement(s) as superuser to remediate this setting (in this example, to set it to warning): + postgres=# alter system set log_min_messages = 'warning'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + compliance: + - cis: ["3.1.12"] + - cis_csc: ["6", "6.4"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: none + rules: + - 'c:psql -U $user -h $host $db -c "SHOW log_min_messages" -> r:\serror|\slog$|\sfatal$|\spanic$' + + ## 3.1.13 Ensure the correct SQL statements generating errors are recorded (Automated) + - id: 24012 + title: Ensure the correct SQL statements generating errors are recorded + description: > + The log_min_error_statement setting causes all SQL statements generating errors at or + above the specified severity level to be recorded in the server log. Each level includes all + the levels that follow it. The lower the level (vertically, below), the fewer messages are + recorded. + + ERROR is considered the best practice setting. Changes should only be made in accordance + with your organization's logging policy. + + Note: To effectively turn off logging of failing statements, set this parameter to PANIC. + rationale: > + If this is not set to the correct value, too many erring SQL statements or too few erring SQL + statements may be written to the server log. + remediation: | + Execute the following SQL statement(s) as superuser to remediate this setting (in the example, to error): + postgres=# alter system set log_min_error_statement = 'error'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + compliance: + - cis: ["3.1.13"] + - cis_csc: ["6", "6.4"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: none + rules: + - 'c:psql -U $user -h $host $db -c "SHOW log_min_error_statement" -> r:\slog$|\sfatal$|\spanic$' + + ## 3.1.14 Ensure 'debug_print_parse' is disabled (Automated) + - id: 24013 + title: Ensure 'debug_print_parse' is disabled + description: > + The debug_print_parse setting enables printing the resulting parse tree for each executed + query. These messages are emitted at the LOG message level. Unless directed otherwise by + your organization's logging policy, it is recommended this setting be disabled by setting it + to off. + rationale: > + Enabling any of the DEBUG printing variables may cause the logging of sensitive information + that would otherwise be omitted based on the configuration of the other logging settings. + remediation: | + Execute the following SQL statement(s) to remediate this setting: + postgres= alter system set debug_print_parse='off'; + ALTER SYSTEM + postgres= select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + compliance: + - cis: ["3.1.14"] + - cis_csc: ["6", "5.1"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "show debug_print_parse" -> r:\soff' + + ## 3.1.15 Ensure 'debug_print_rewritten' is disabled (Automated) + - id: 24014 + title: Ensure 'debug_print_rewritten' is disabled + description: > + The debug_print_rewritten setting enables printing the query rewriter output for each + executed query. These messages are emitted at the LOG message level. Unless directed + otherwise by your organization's logging policy, it is recommended this setting be disabled + by setting it to off. + rationale: > + Enabling any of the DEBUG printing variables may cause the logging of sensitive information + that would otherwise be omitted based on the configuration of the other logging settings. + remediation: | + Execute the following SQL statement(s) to disable this setting: + postgres=# alter system set debug_print_rewritten = 'off'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + compliance: + - cis: ["3.1.15"] + - cis_csc: ["6", "5.1"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html+ + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "show debug_print_rewritten" -> r:\soff' + + ## 3.1.16 Ensure 'debug_print_plan' is disabled (Automated) + - id: 24015 + title: Ensure 'debug_print_plan' is disabled + description: > + The debug_print_plan setting enables printing the execution plan for each executed query. + These messages are emitted at the LOG message level. Unless directed otherwise by your + organization's logging policy, it is recommended this setting be disabled by setting it to off. + rationale: > + Enabling any of the DEBUG printing variables may cause the logging of sensitive information + that would otherwise be omitted based on the configuration of the other logging settings. + remediation: | + Execute the following SQL statement(s) to disable this setting: + postgres=# alter system set debug_print_plan = 'off'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + compliance: + - cis: ["3.1.16"] + - cis_csc: ["6", "5.1"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "show debug_print_plan" -> r:\soff' + + ## 3.1.17 Ensure 'debug_pretty_print' is enabled (Automated) + - id: 24016 + title: Ensure 'debug_pretty_print' is enabled + description: > + Enabling debug_pretty_print indents the messages produced by debug_print_parse, + debug_print_rewritten, or debug_print_plan making them significantly easier to read. + rationale: > + If this setting is disabled, the "compact" format is used instead, significantly reducing + readability of the DEBUG statement log messages. + remediation: | + Execute the following SQL statement(s) to enable this setting: + postgres=# alter system set debug_pretty_print = 'on'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + compliance: + - cis: ["3.1.17"] + - cis_csc: ["6", "6.3"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "show debug_pretty_print" -> r:\son' + + ## 3.1.18 Ensure 'log_connections' is enabled (Automated) + - id: 24017 + title: Ensure 'log_connections' is enabled + description: > + Enabling the log_connections setting causes each attempted connection to the server to + be logged, as well as successful completion of client authentication. This parameter cannot + be changed after session start. + rationale: > + PostgreSQL does not maintain an internal record of attempted connections to the database + for later auditing. It is only by enabling the logging of these attempts that one can + determine if unexpected attempts are being made. + + Note that enabling this without also enabling log_disconnections provides little value. + Generally, you would enable/disable the pair together. + remediation: | + Execute the following SQL statement(s) to enable this setting: + postgres=# alter system set log_connections = 'on'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + compliance: + - cis: ["3.1.18"] + - cis_csc: ["6", "6.3"] + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "SHOW log_connections" -> r:\son' + + ## 3.1.19 Ensure 'log_disconnections' is enabled (Automated) + - id: 24018 + title: Ensure 'log_disconnections' is enabled (Automated) + description: > + Enabling the log_disconnections setting logs the end of each session, including session + duration. This parameter cannot be changed after session start. + rationale: > + PostgreSQL does not maintain the beginning or ending of a connection internally for later + review. It is only by enabling the logging of these that one can examine connections for + failed attempts, 'over long' duration, or other anomalies. + + Note that enabling this without also enabling log_connections provides little value. + Generally, you would enable/disable the pair together + remediation: | + Execute the following SQL statement(s) to enable this setting: + postgres= alter system set log_disconnections = 'on'; + ALTER SYSTEM + postgres= select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + compliance: + - cis: ["3.1.19"] + - cis_csc: ["6", "6.3"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "SHOW log_disconnections" -> r:\son' + + ## 3.1.20 Ensure 'log_error_verbosity' is set correctly (Automated) + - id: 24019 + title: Ensure 'log_error_verbosity' is set correctly + description: > + The log_error_verbosity setting specifies the verbosity (amount of detail) of logged + messages. + rationale: > + If this is not set to the correct value, too many details or too few details may be logged. + remediation: | + Execute the following SQL statement(s) as superuser to remediate this setting (in this example, to verbose): + postgres=# alter system set log_error_verbosity = 'verbose'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + compliance: + - cis: ["3.1.20"] + - cis_csc: ["6", "6.3"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "SHOW log_error_verbosity" -> r:\sverbose' + + ## 3.1.21 Ensure 'log_hostname' is set correctly (Automated) + - id: 24020 + title: Ensure 'log_hostname' is set correctly + description: > + Enabling the log_hostname setting causes the hostname of the connecting host to be logged + in addition to the host's IP address for connection log messages. Disabling the setting + causes only the connecting host's IP address to be logged, and not the hostname. Unless + your organization's logging policy requires hostname logging, it is best to disable this + setting so as not to incur the overhead of DNS resolution for each statement that is logged. + rationale: > + Depending on your hostname resolution setup, enabling this setting might impose a nonnegligible performance penalty. Additionally, the IP addresses that are logged can be + resolved to their DNS names when reviewing the logs (unless dynamic host names are + being used as part of your DHCP setup). + remediation: | + Execute the following SQL statement(s) to remediate this setting (in this example, to off): + postgres=# alter system set log_hostname='off'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + compliance: + - cis: ["3.1.21"] + - cis_csc: ["6", "5.1"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "SHOW log_hostname" -> r:\soff' + + ## 3.1.22 Ensure 'log_line_prefix' is set correctly (Automated) + - id: 24021 + title: Ensure 'log_line_prefix' is set correctly + description: > + The log_line_prefix setting specifies a printf-style string that is prefixed to each log line. + If blank, no prefix is used. You should configure this as recommended by the pgBadger + development team unless directed otherwise by your organization's logging policy. + + % characters begin "escape sequences" that are replaced with status information as + outlined below. Unrecognized escapes are ignored. Other characters are copied straight to + the log line. Some escapes are only recognized by session processes and will be treated as + empty by background processes such as the main server process. Status information may + be aligned either left or right by specifying a numeric literal after the % and before the + option. A negative value will cause the status information to be padded on the right with + spaces to give it a minimum width, whereas a positive value will pad on the left. Padding + can be useful to aid human readability in log files. + rationale: > + Properly setting log_line_prefix allows for adding additional information to each log + entry (such as the user, or the database). Said information may then be of use in auditing or + security reviews. + remediation: | + Execute the following SQL statement(s) to remediate this setting: + postgres=# alter system set log_line_prefix = '%m [%p]: [%l-1] + db=%d,user=%u,app=%a,client=%h'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + compliance: + - cis: ["3.1.22"] + - cis_csc: ["6", "6.3"] + references: + - https://pgbadger.darold.net/ + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "SHOW log_disconnections" -> r:%m\s\[%p\]:\s\[%l-1\]\sdb=%d,user=%u,app=%a,client=%h' + + ## 3.1.23 Ensure 'log_statement' is set correctly (Automated) + - id: 24022 + title: Ensure 'log_statement' is set correctly + description: > + The log_statement setting specifies the types of SQL statements that are logged. + It is recommended this be set to ddl unless otherwise directed by your organization's + logging policy. + rationale: > + Setting log_statement to align with your organization's security and logging policies + facilitates later auditing and review of database activities. + remediation: | + Execute the following SQL statement(s) as superuser to remediate this setting: + postgres=# alter system set log_statement='ddl'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + t + (1 row) + compliance: + - cis: ["3.1.23"] + - cis_csc: ["6", "6.3"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "SHOW log_statement" -> r:\sdll' + + ## 3.1.24 Ensure 'log_timezone' is set correctly (Automated) + - id: 24023 + title: Ensure 'log_timezone' is set correctly + description: > + The log_timezone setting specifies the time zone to use in timestamps within log messages. + This value is cluster-wide, so that all sessions will report timestamps consistently. Unless + directed otherwise by your organization's logging policy, set this to either GMT or UTC. + rationale: > + Log entry timestamps should be configured for an appropriate time zone as defined by + your organization's logging policy to ensure a lack of confusion around when a logged + event occurred. + + Note that this setting affects only the timestamps present in the logs. It does not affect the + time zone in use by the database itself (for example, select now()), nor does it affect the + host's time zone. + remediation: | + Execute the following SQL statement(s) to remediate this setting: + postgres=# alter system set log_timezone = 'GMT'; + ALTER SYSTEM + postgres=# select pg_reload_conf(); + pg_reload_conf + ---------------- + 72 | Page + t + (1 row) + compliance: + - cis: ["3.1.24"] + - cis_csc: ["6", "6.3"] + references: + - https://www.postgresql.org/docs/current/static/runtime-config-logging.html + - https://en.wikipedia.org/wiki/Time_zone + condition: all + rules: + - 'c:sh -c "psql -U $user -h $host $db -c \"SHOW log_timezone\" | grep $log_timezone" -> r:\.+' + + ## 3.2 Ensure the PostgreSQL Audit Extension (pgAudit) is enabled (Automated) + - id: 24024 + title: Ensure the PostgreSQL Audit Extension (pgAudit) is enabled + description: > + The PostgreSQL Audit Extension (pgAudit) provides detailed session and/or object audit + logging via the standard PostgreSQL logging facility. The goal of pgAudit is to provide + PostgreSQL users with the capability to produce audit logs often required to comply with + government, financial, or ISO certifications. + rationale: > + Basic statement logging can be provided by the standard logging facility with + log_statement = all. This is acceptable for monitoring and other uses but does not + provide the level of detail generally required for an audit. It is not enough to have a list of + all the operations performed against the database, it must also be possible to find + particular statements that are of interest to an auditor. The standard logging facility shows + what the user requested, while pgAudit focuses on the details of what happened while the + database was satisfying the request. + + When logging SELECT and DML statements, pgAudit can be configured to log a separate entry + for each relation referenced in a statement. No parsing is required to find all statements + that touch a particular table. In fact, the goal is that the statement text is provided primarily + for deep forensics and should not be required for an audit. + remediation: | + To install and enable pgAudit, simply install the appropriate rpm from the PGDG repo: + # whoami + root + pgauditlogtofile_96.x86_64 : PostgreSQL Audit Log To File Extension + [root@centos8 ~]# dnf -y install pgaudit15_13 + Last metadata expiration check: 0:24:09 ago on Mon 14 Dec 2020 06:59:52 PM + UTC. + Dependencies resolved. + ============================================================================= + Package Architecture Version Repository Size + ============================================================================= + Installing: + pgaudit15_13 x86_64 1.5.0-1.rhel8 pgdg13 52 k + Transaction Summary + ============================================================================= + Install 1 Package + Total download size: 52 k + Installed size: 93 k + Downloading Packages: + pgaudit15_13-1.5.0-1.rhel8.x86_64.rpm 54 kB/s | 52 kB 00:00 + ----------------------------------------------------------------------------- + Total 54 kB/s | 52 kB 00:00 + 75 | Page + Running transaction check + Transaction check succeeded. + Running transaction test + Transaction test succeeded. + Running transaction + Preparing : 1/1 + Installing : pgaudit15_13-1.5.0-1.rhel8.x86_64 1/1 + Running scriptlet: pgaudit15_13-1.5.0-1.rhel8.x86_64 1/1 + Verifying : pgaudit15_13-1.5.0-1.rhel8.x86_64 1/1 + Installed: + pgaudit15_13-1.5.0-1.rhel8.x86_64 + Complete! + pgAudit is now installed and ready to be configured. Next, we need to alter the postgresql.conf configuration file to: + • enable pgAudit as an extension in the shared_preload_libraries parameter + • indicate which classes of statements we want to log via the pgaudit.log parameter + and, finally, restart the PostgreSQL service: + $ vi ${PGDATA}/postgresql.conf + Find the shared_preload_libraries entry, and add 'pgaudit' to it (preserving any existing entries): + shared_preload_libraries = 'pgaudit' + OR + shared_preload_libraries = 'pgaudit,somethingelse' + Now, add a new pgaudit-specific entry: + # for this example we are logging the ddl and write operations + pgaudit.log='ddl,write' + Restart the PostgreSQL server for changes to take affect: + # whoami + root + # systemctl restart postgresql-13 + # systemctl status postgresql-13|grep 'ago$' + Active: active (running) since [date] 10s ago + compliance: + - cis: ["3.2"] + - cis: ["6", "6.2"] + references: + - https://www.pgaudit.org/ + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "show shared_preload_libraries" -> r:pgaudit' + + ## 4 User Access and Authorization + + ## 4.1 Ensure sudo is configured correctly (Manual) + ## Not Aplicable: requires user switching + + ## 4.2 Ensure excessive administrative privileges are revoked (Manual) + ## Not Aplicable: requires user switching + + ## 4.3 Ensure excessive function privileges are revoked (Automated) + ## Not Aplicable: requires user switching + + ## 4.4 Ensure excessive DML privileges are revoked (Manual) + ## Not Aplicable: subjective + + ## 4.5 Use pg_permission extension to audit object permissions (Automated) + - id: 24025 + title: Use pg_permission extension to audit object permissions + description: > + Using a PostgreSQL extension called pg_permissions it is possible to declare which DB + users should have which permissions on a given object and generate a report showing + compliance/deviation. + rationale: > + Auditing permissions in a PostgreSQL database can be intimidating given the default + manner in which permissions are presented. The pg_permissions extension greatly + simplifies this presentation and allows the user to declare what permissions should exist + and then report on differences from that ideal. + + compliance: + - cis: ["4.5"] + - cis_csc: ["5.1"] + references: + - https://github.com/cybertec-postgresql/pg_permission + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "select * from pg_available_extensions where name=\"pg_permissions\";" -> r:pg_permissions && !r:(0\srows) && !r:ERROR' + + ## 4.6 Ensure Row Level Security (RLS) is configured correctly (Manual) + ## Not Aplicable: subjective + + ## 4.7 Ensure the set_user extension is installed (Automated) + - id: 24026 + title: Ensure the set_user extension is installed + description: > + PostgreSQL access to the superuser database role must be controlled and audited to + prevent unauthorized access. + rationale: > + Even when reducing and limiting the access to the superuser role as described earlier in + this benchmark, it is still difficult to determine who accessed the superuser role and what + actions were taken using that role. As such, it is ideal to prevent anyone from logging in as + the superuser and forcing them to escalate their role. This model is used at the OS level by + the use of sudo and should be emulated in the database. The set_user extension allows for + this setup. + + compliance: + - cis: ["4.7"] + - cis_csc: ["5.1", "5.8", "4.3"] + references: + - https://github.com/pgaudit/set_user + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "select * from pg_available_extensions where name=\"set_user\";" -> r:set_user && !r:(0\srows) && !r:ERROR' + + # 4.8 Make use of default roles (Manual) + # Not Aplicable: subjective + + # 5 Connection and Login + # Not Aplicable: requires user interaction + + # 6 PostgreSQL Settings + # 6.7 Ensure FIPS 140-2 OpenSSL Cryptography Is Used (Automated) + - id: 24027 + title: Ensure FIPS 140-2 OpenSSL Cryptography Is Used + description: > + Install, configure, and use OpenSSL on a platform that has a NIST certified FIPS 140-2 + installation of OpenSSL. This provides PostgreSQL instances the ability to generate and + validate cryptographic hashes to protect unclassified information requiring confidentiality + and cryptographic protection, in accordance with the data owner's requirements. + rationale: > + Federal Information Processing Standard (FIPS) Publication 140-2 is a computer security + standard developed by a U.S. Government and industry working group for validating the + quality of cryptographic modules. Use of weak, or untested, encryption algorithms + undermine the purposes of utilizing encryption to protect data. PostgreSQL uses OpenSSL + for the underlying encryption layer. + The database and application must implement cryptographic modules adhering to the + higher standards approved by the federal government since this provides assurance they + have been tested and validated. It is the responsibility of the data owner to assess the + cryptography requirements in light of applicable federal laws, Executive Orders, directives, + policies, regulations, and standards. + For detailed information, refer to NIST FIPS Publication 140-2, Security Requirements for + Cryptographic Modules. Note that the product's cryptographic modules must be validated + and certified by NIST as FIPS-compliant. The security functions validated as part of FIPS + 140-2 for cryptographic modules are described in FIPS 140-2 Annex A. Currently only Red + Hat Enterprise Linux is certified as a FIPS 140-2 distribution of OpenSSL. For other + operating systems, users must obtain or build their own FIPS 140-2 OpenSSL libraries. + + compliance: + - cis: ["6.7"] + - cis_csc: ["14.2", "14.4"] + references: + - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/security_hardening/using-the-system-wide-cryptographic-policies_security-hardening#switching-the-system-to-fips-mode_using-the-system-wide-cryptographic-policies + - https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp1758.pdf + - https://csrc.nist.gov/publications/fips + condition: all + rules: + - 'c:fips-mode-setup --check -> r:FIPS\smode\sis\senabled' + + # 6.8 Ensure SSL is enabled and configured correctly (Automated) + - id: 24028 + title: Ensure SSL is enabled and configured correctly + description: > + SSL on a PostgreSQL server should be enabled (set to on) and configured to encrypt TCP + traffic to and from the server. + rationale: > + If SSL is not enabled and configured correctly, this increases the risk of data being + compromised in transit. + + compliance: + - cis: ["6.8"] + - cis_csc: ["14.2", "14.4"] + references: + - https://www.postgresql.org/docs/current/static/ssl-tcp.html + - http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-52r1.pdf + - https://www.postgresql.org/docs/current/static/libpq-ssl.html + condition: all + rules: + - 'c:psql -U $user -h $host $db -c "SHOW ssl" -> r:\son' + + # 7 Replication + + # 8 Special Configuration Considerations + # 8.3 Ensure the backup and restore tool, 'pgBackRest', is installed and configured (Automated) + - id: 24029 + title: Ensure the backup and restore tool, 'pgBackRest', is installed and configured + description: > + pgBackRest aims to be a simple, reliable backup and restore system that can seamlessly + scale up to the largest databases and workloads. Instead of relying on traditional backup + tools like tar and rsync, pgBackRest implements all backup features internally and uses a + custom protocol for communicating with remote systems. Removing reliance on tar and + rsync allows for better solutions to database-specific backup challenges. The custom + remote protocol allows for more flexibility and limits the types of connections that are + required to perform a backup which increases security. + rationale: > + The native PostgreSQL backup facility pg_dump provides adequate logical backup + operations but does not provide for Point In Time Recovery (PITR). The PostgreSQL facility + pg_basebackup performs physical backup of the database files and does provide for PITR, + but it is constrained by single threading. Both of these methodologies are standard in the + PostgreSQL ecosystem and appropriate for particular backup/recovery needs. pgBackRest + offers another option with much more robust features and flexibility. + pgBackRest is open-source software developed to perform efficient backups on PostgreSQL + databases that measure in tens of terabytes and greater. It supports per file checksums, + compression, partial/failed backup resume, high-performance parallel transfer, + asynchronous archiving, tablespaces, expiration, full/differential/incremental, + local/remote operation via SSH, hard-linking, restore, backup encryption, and more. + pgBackRest is written in C and Perl and does not depend on rsync or tar but instead + performs its own deltas which gives it maximum flexibility. Finally, pgBackRest provides an + easy-to-use internal repository listing backup details accessible via the pgbackrest info + command. + remediation: > + pgBackRest is not installed nor configured for PostgreSQL by default, but instead is + maintained as a GitHub project. Fortunately, it is a part of the PGDG repository and can be + easily installed: + + $ whoami + + root + + $ dnf -y install pgbackrest + + [snip] + + Installed: + + pgbackrest-2.31-1.rhel8.x86_64 + + Complete! + + Once installed, pgBackRest must be configured for things like stanza name, backup + location, retention policy, logging, etc. Please consult the configuration guide. + If employing pgBackRest for your backup/recovery solution, ensure the repository, base + backups, and WAL archives are stored on a reliable file system separate from the database + server. Further, the external storage system where backups resided should have limited + access to only those system administrators as necessary. Finally, as with any + backup/recovery solution, stringent testing must be conducted. A backup is only good if + it can be restored successfully. + compliance: + - cis: ["8.3"] + - cis_csc: ["10", "10.1", "10.2"] + references: + - https://pgbackrest.org/ + - https://github.com/pgbackrest/pgbackrest + - https://www.postgresql.org/docs/current/static/app-pgdump.html + - https://www.postgresql.org/docs/current/static/app-pgbasebackup.html + condition: none + rules: + - "c:pgbackrest -> -bash: pgbackrest: command not found" diff --git a/etc/ruleset/sca/applications/cis_sqlserver_2012.yml b/etc/ruleset/sca/applications/cis_sqlserver_2012.yml new file mode 100644 index 0000000000..4c84d3e013 --- /dev/null +++ b/etc/ruleset/sca/applications/cis_sqlserver_2012.yml @@ -0,0 +1,459 @@ +# Security Configuration Assessment +# CIS Microsoft SQL Server 2012 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on Center for Internet Security Benchmark for Microsoft SQL Server 2012 v1.5.0 - 05-31-2019 + +policy: + id: "cis_sqlserver_2012" + file: "cis_sqlserver_2012.yml" + name: "CIS Microsoft SQL Server 2012 Benchmark v1.5.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft SQL Server 2012." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform has Microsoft SQL Server 2012" + description: "Requirements for running the CIS Microsoft SQL Server 2012 Benchmark" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows' + +variables: + $User: + +checks: + ###################################################### + # 2 Surface Area Reduction + ###################################################### + # 2.1 Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0' (Scored) + - id: 11500 + title: "Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0'" + description: "Enabling Ad Hoc Distributed Queries allows users to query data and execute statements on external data sources. This functionality should be disabled." + rationale: "This feature can be used to remotely access and exploit vulnerabilities on remote SQL Server instances and to run unsafe Visual Basic for Application functions." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ad Hoc Distributed Queries', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ad-hoc-distributed-queries-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ad Hoc Distributed Queries' ;\" -> r:Ad Hoc Distributed Queries\\s+0\\s+0" + + # 2.2 Ensure 'CLR Enabled' Server Configuration Option is set to '0' (Scored) + - id: 11501 + title: "Ensure 'CLR Enabled' Server Configuration Option is set to '0'" + description: "The clr enabled option specifies whether user assemblies can be run by SQL Server." + rationale: "Enabling use of CLR assemblies widens the attack surface of SQL Server and puts it at risk from both inadvertent and malicious assemblies." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'clr enabled', 0; RECONFIGURE;" + compliance: + - cis: ["2.2"] + - cis_csc: ["18.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + references: + - "https://docs.microsoft.com/en-us/sql/t-sql/statements/create-assembly-transact-sql" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'clr enabled';\" -> r:0\\s+0" + + # 2.3 Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0' + - id: 11502 + title: "Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0'" + description: "The cross db ownership chaining option controls cross-database ownership chaining across all databases at the instance (or server) level." + rationale: "When enabled, this option allows a member of the db_owner role in a database to gain access to objects owned by a login in any other database, causing an unnecessary information disclosure. When required, cross-database ownership chaining should only be enabled for the specific databases requiring it instead of at the instance level for all databases by using the ALTER DATABASE SET DB_CHAINING ON command. This database option may not be changed on the master , model , or tempdb system databases." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'cross db ownership chaining', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.3"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/cross-db-ownership-chaining-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'cross db ownership chaining';\" -> r:0\\s+0" + + # 2.4 Ensure 'Database Mail XPs' Server Configuration Option is set to '0' + - id: 11503 + title: "Ensure 'Database Mail XPs' Server Configuration Option is set to '0'" + description: "The Database Mail XPs option controls the ability to generate and transmit email messages from SQL Server." + rationale: "Disabling the Database Mail XPs option reduces the SQL Server surface, eliminates a DOS attack vector and channel to exfiltrate data from the database server to a remote host." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Database Mail XPs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.4"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/database-mail/database-mail" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Database Mail XPs';\" -> r:0\\s+0" + + # 2.5 Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0' + - id: 11504 + title: "Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0'" + description: "The Ole Automation Procedures option controls whether OLE Automation objects can be instantiated within Transact-SQL batches. These are extended stored procedures that allow SQL Server users to execute functions external to SQL Server." + rationale: "Enabling this option will increase the attack surface of SQL Server and allow users to execute functions in the security context of SQL Server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ole Automation Procedures', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.5"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ole-automation-procedures-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ole Automation Procedures';\" -> r:0\\s+0" + + # 2.6 Ensure 'Remote Access' Server Configuration Option is set to '0' + - id: 11505 + title: "Ensure 'Remote Access' Server Configuration Option is set to '0'" + description: "The remote access option controls the execution of local stored procedures on remote servers or remote stored procedures on local server." + rationale: "Functionality can be abused to launch a Denial-of-Service (DoS) attack on remote servers by off-loading query processing to a target." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'remote access', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-remote-access-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote access';\" -> r:0\\s+0" + + # 2.7 Ensure 'Remote Admin Connections' Server Configuration Option is set to '0' (Scored) + - id: 11506 + title: "Ensure 'Remote Admin Connections' Server Configuration Option is set to '0'" + description: "The remote admin connections option controls whether a client application on a remote computer can use the Dedicated Administrator Connection (DAC)." + rationale: 'The Dedicated Administrator Connection (DAC) lets an administrator access a running server to execute diagnostic functions or Transact-SQL statements, or to troubleshoot problems on the server, even when the server is locked or running in an abnormal state and not responding to a SQL Server Database Engine connection. In a cluster scenario, the administrator may not actually be logged on to the same node that is currently hosting the SQL Server instance and thus is considered "remote". Therefore, this setting should usually be enabled ( 1 ) for SQL Server failover clusters; otherwise it should be disabled ( 0 ) which is the default.' + remediation: "Run the following T-SQL command on non-clustered installations: EXECUTE sp_configure 'remote admin connections', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/remote-admin-connections-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"USE master; SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote admin connections' AND SERVERPROPERTY('IsClustered') = 0;\" -> r:0\\s*\\t*0|0 rows affected" + + # 2.8 Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0' (Scored) + - id: 11507 + title: "Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0'" + description: "The scan for startup procs option, if enabled, causes SQL Server to scan for and automatically run all stored procedures that are set to execute upon service startup." + rationale: "Enforcing this control reduces the threat of an entity leveraging these facilities for malicious purposes." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'scan for startup procs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.8"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-scan-for-startup-procs-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'scan for startup procs';\" -> r:0\\s+0" + + # 2.9 Ensure 'Trustworthy' Database Property is set to 'Off' (Scored) + - id: 11508 + title: "Ensure 'Trustworthy' Database Property is set to 'Off'" + description: "The TRUSTWORTHY database option allows database objects to access objects in other databases under certain circumstances." + rationale: "Provides protection from malicious CLR assemblies or extended procedures." + remediation: "Execute the following T-SQL statement against the databases (replace below) returned by the Audit Procedure: ALTER DATABASE [] SET TRUSTWORTHY OFF;" + compliance: + - cis: ["2.9"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/trustworthy-database-property" + - "https://support.microsoft.com/it-it/help/2183687/guidelines-for-using-the-trustworthy-database-setting-in-sql-server" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name FROM sys.databases WHERE is_trustworthy_on = 1 AND name != ''msdb'';" -> r:0 rows affected' + + # 2.11 Ensure SQL Server is configured to use non-standard ports (Not Scored) + - id: 11509 + title: "Ensure SQL Server is configured to use non-standard ports" + description: "If enabled, the default SQL Server instance will be assigned a default port of TCP:1433 for TCP/IP communication. Administrators can also configure named instances to use TCP:1433 for communication. TCP:1433 is a widely known SQL Server port and this port assignment should be changed." + rationale: "Using a non-default port helps protect the database from attacks directed to the default port." + remediation: "1: In SQL Server Configuration Manager, in the console pane, expand SQL Server Network Configuration, expand Protocols for , and then double-click the TCP/IP or VIA protocol. 2: In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear in the format IP1 , IP2 , up to IPAll . One of these is for the IP address of the loopback adapter, 127.0.0.1 . Additional IP addresses appear for each IP Address on the computer. 3: Change the TCP Port field from 1433 to another non-standard port or leave the TCP Port field empty and set the TCP Dynamic Ports value to 0 to enable dynamic port assignment and then click OK. 4: In the console pane, click SQL Server Services. 5: In the details pane, right-click SQL Server () and then click Restart, to stop and restart SQL Server." + compliance: + - cis: ["2.11"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-a-server-to-listen-on-a-specific-tcp-port" + condition: none + rules: + - "c:sqlcmd -Q \"DECLARE @value nvarchar(256); EXECUTE master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQLServer\\SuperSocketNetLib\\Tcp\\IPAll', N'TcpPort', @value OUTPUT, N'no_output'; SELECT @value AS TCP_Port WHERE @value = '1433'; \" -> r:1433" + + # 2.13 Ensure 'sa' Login Account is set to 'Disabled' (Scored) + - id: 11510 + title: "Ensure 'sa' Login Account is set to 'Disabled'" + description: "The sa account is a widely known and often widely used SQL Server account with sysadmin privileges. This is the original login created during installation and always has the principal_id=1 and sid=0x01 ." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal." + remediation: "Execute the following T-SQL query: USE [master] GO DECLARE @tsql nvarchar(max) SET @tsql = 'ALTER LOGIN ' + SUSER_NAME(0x01) + ' DISABLE' EXEC (@tsql) GO" + compliance: + - cis: ["2.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-server-principals-transact-sql" + - "https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-login-transact-sql" + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, is_disabled FROM sys.server_principals WHERE sid = 0x01 AND is_disabled = 0;" -> r:0 rows affected' + + # 2.14 Ensure 'sa' Login Account has been renamed (Scored) + - id: 11511 + title: "Ensure 'sa' Login Account has been renamed" + description: "The sa account is a widely known and often widely used SQL Server login with sysadmin privileges. The sa login is the original login created during installation and always has principal_id=1 and sid=0x01 ." + rationale: "It is more difficult to launch password-guessing and brute-force attacks against the sa login if the name is not known." + remediation: "Replace the value within the below syntax and execute to rename the sa login. ALTER LOGIN sa WITH NAME = ;" + compliance: + - cis: ["2.14"] + - cis_csc: ["5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode" + condition: none + rules: + - 'c:sqlcmd -Q "SELECT name FROM sys.server_principals WHERE sid = 0x01;" -> r:sa' + + # 2.15 Ensure 'xp_cmdshell' Server Configuration Option is set to '0' + - id: 11512 + title: "Ensure 'xp_cmdshell' Server Configuration Option is set to '0'" + description: "The xp_cmdshell option controls whether the xp_cmdshell extended stored procedure can be used by an authenticated SQL Server user to execute operating-system command shell commands and return results as rows within the SQL client." + rationale: "The xp_cmdshell procedure is commonly used by attackers to read or write data to/from the underlying Operating System of a database server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'xp_cmdshell', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.15"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/xp-cmdshell-transact-sql" + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/xp-cmdshell-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'xp_cmdshell';\" -> r:0\\s+0" + + # 2.16 Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases + - id: 11513 + title: "Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases" + description: "AUTO_CLOSE determines if a given database is closed or not after a connection terminates. If enabled, subsequent connections to the given database will require the database to be reopened and relevant procedure caches to be rebuilt." + rationale: "Because authentication of users for contained databases occurs within the database not at the server\\instance level, the database must be opened every time to authenticate a user. The frequent opening/closing of the database consumes additional server resources and may contribute to a denial of service." + remediation: "Execute the following T-SQL, replacing with each database name found by the Audit Procedure: ALTER DATABASE SET AUTO_CLOSE OFF;" + compliance: + - cis: ["2.16"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/databases/security-best-practices-with-contained-databases" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, containment, containment_desc, is_auto_close_on FROM sys.databases WHERE containment <> 0 and is_auto_close_on = 1;" -> r:0 rows affected' + + # 2.17 Ensure no login exists with the name 'sa' (Scored) + - id: 11514 + title: "Ensure no login exists with the name 'sa'" + description: "The sa login (e.g. principal) is a widely known and often widely used SQL Server account. Therefore, there should not be a login called sa even when the original sa login ( principal_id = 1 ) has been renamed." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal name." + remediation: "Execute the appropriate ALTER or DROP statement below based on the principal_id returned for the login named sa . Replace the value within the below syntax and execute to rename the sa login. USE [master] GO -- If principal_id = 1 or the login owns database objects, rename the sa login ALTER LOGIN [sa] WITH NAME = ; GO -- If the login owns no database objects, then drop it -- Do NOT drop the login if it is principal_id = 1 DROP LOGIN sa" + compliance: + - cis: ["2.17"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sqlcmd -Q "SELECT principal_id, name FROM sys.server_principals WHERE name = ''sa'';" -> r:0 rows affected' + + ########################################################### + # 3 Authentication and Authorization + ########################################################### + # 3.1 Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode' (Scored) + - id: 11515 + title: "Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode'" + description: "Uses Windows Authentication to validate attempted connections." + rationale: "Windows provides a more robust authentication mechanism than SQL Server authentication." + remediation: "Perform either the GUI or T-SQL method shown: GUI Method: 1. Open SQL Server Management Studio. 2. Open the Object Explorer tab and connect to the target database instance. 3. Right click the instance name and select Properties. 4. Select the Security page from the left menu. 5. Set the Server authentication setting to Windows Authentication Mode. or T-SQL Method: Run the following T-SQL in a Query Window: USE [master] GO EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'LoginMode', REG_DWORD, 1 GO Restart the SQL Server service for the change to take effect." + compliance: + - cis: ["3.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/server-properties-security-page" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT SERVERPROPERTY(''IsIntegratedSecurityOnly'') as [login_mode];" -> r:^1' + + # 3.8 Ensure only the default permissions specified by Microsoft are granted to the public server role (Scored) + - id: 11516 + title: "Ensure only the default permissions specified by Microsoft are granted to the public server role" + description: "public is a special fixed server role containing all logins. Unlike other fixed server roles, permissions can be changed for the public role. In keeping with the principle of least privileges, the public server role should not be used to grant permissions at the server scope as these would be inherited by all users." + rationale: "Every SQL Server login belongs to the public role and cannot be removed from this role. Therefore, any permissions granted to this role will be available to all logins unless they have been explicitly denied to specific logins or user-defined server roles." + remediation: "Add the extraneous permissions found in the Audit query results to the specific logins to user-defined server roles which require the access. Revoke the from the public role as shown below USE [master] GO REVOKE FROM public; GO" + compliance: + - cis: ["3.8"] + - cis_csc: ["5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles" + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles#permissions-of-fixed-server-roles" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT * FROM master.sys.server_permissions WHERE (grantee_principal_id = SUSER_SID(N''public'') and state_desc LIKE ''GRANT%'') AND NOT (state_desc = ''GRANT'' and [permission_name] = ''VIEW ANY DATABASE'' and class_desc = ''SERVER'') AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 2) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 3) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 4) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 5); " -> r:0 rows affected' + + # 3.10 Ensure Windows local groups are not SQL Logins (Scored) + - id: 11517 + title: "Ensure Windows local groups are not SQL Logins" + description: "Local Windows groups should not be used as logins for SQL Server instances." + rationale: "Allowing local Windows groups as SQL Logins provides a loophole whereby anyone with OS level administrator rights (and no SQL Server rights) could add users to the local Windows groups and thereby give themselves or others access to the SQL Server instance." + remediation: "1. For each LocalGroupName login, if needed create an equivalent AD group containing only the required user accounts. 2. Add the AD group or individual Windows accounts as a SQL Server login and grant it the permissions required. 3. Drop the LocalGroupName login using the syntax below after replacing . USE [master] GO DROP LOGIN [] GO" + compliance: + - cis: ["3.10"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + condition: all + rules: + - 'c:sqlcmd -Q "USE [master] SELECT pr.[name] AS LocalGroupName, pe.[permission_name], pe.[state_desc] FROM sys.server_principals pr JOIN sys.server_permissions pe ON pr.[principal_id] = pe.[grantee_principal_id] WHERE pr.[type_desc] = ''WINDOWS_GROUP'' AND pr.[name] like CAST(SERVERPROPERTY(''MachineName'') AS nvarchar) + ''%'';" -> r:0 rows affected' + + ########################################################### + # 4 Password Policies + ########################################################### + + # 4.2 Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role (Scored) + - id: 11518 + title: "Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role" + description: "Applies the same password expiration policy used in Windows to passwords used inside SQL Server." + rationale: "Ensuring SQL logins comply with the secure password policy applied by the Windows Server Benchmark will ensure the passwords for SQL logins with sysadmin privileges are changed on a frequent basis to help prevent compromise via a brute force attack. CONTROL SERVER is an equivalent permission to sysadmin and logins with that permission should also be required to have expiring passwords." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_EXPIRATION = ON;" + compliance: + - cis: ["4.2"] + - cis_csc: ["16.2, 16.10"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "http://msdn.microsoft.com/en-us/library/ms161959(v=sql.110).aspx" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT l.[name], ''sysadmin membership'' AS ''Access_Method'' FROM sys.sql_logins AS l WHERE IS_SRVROLEMEMBER(''sysadmin'',name) = 1 AND l.is_expiration_checked <> 1 UNION ALL SELECT l.[name], ''CONTROL SERVER'' AS ''Access_Method'' FROM sys.sql_logins AS l JOIN sys.server_permissions AS p ON l.principal_id = p.grantee_principal_id WHERE p.type = ''CL'' AND p.state IN (''G'', ''W'') AND l.is_expiration_checked <> 1;" -> r:0 rows affected' + + # 4.3 Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins (Scored) + - id: 11519 + title: "Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins" + description: "Applies the same password complexity policy used in Windows to passwords used insideSQL Server." + rationale: "Ensure SQL authenticated login passwords comply with the secure password policy applied by the Windows Server Benchmark so that they cannot be easily compromised via brute force attack." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_POLICY = ON; Note: In the case of AWS RDS do not perform this remediation for the Master account." + compliance: + - cis: ["4.3"] + - cis_csc: ["16, 4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "http://msdn.microsoft.com/en-us/library/ms161959(v=sql.110).aspx" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, is_disabled FROM sys.sql_logins WHERE is_policy_checked = 0;" -> r:0 rows affected' + + ########################################################## + # 5 Auditing and Logging + ########################################################## + # 5.1 Ensure 'Maximum number of error log files' is set to greater than or equal to '12' + - id: 11520 + title: "Ensure 'Maximum number of error log files' is set to greater than or equal to '12'" + description: "SQL Server error log files must be protected from loss. The log files must be backed up before they are overwritten. Retaining more error logs helps prevent loss from frequent recycling before backups can occur." + rationale: "The SQL Server error log contains important information about major server events and login attempt information as well." + remediation: "Adjust the number of logs to prevent data loss. The default value of 6 may be insufficient for a production environment. Perform either the GUI or T-SQL method shown: GUI Method 1. Open SQL Server Management Studio. 2. Open Object Explorer and connect to the target instance. 3. Navigate to the Management tab in Object Explorer and expand. Right click on the SQL Server Logs file and select Configure 4. Check the Limit the number of error log files before they are recycled 5. Set the Maximum number of error log files to greater than or equal to 12 T-SQL Method Run the following T-SQL to change the number of error log files, replace with your desired number of error log files: EXEC master.sys.xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', REG_DWORD, ;" + compliance: + - cis: ["5.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - "http://msdn.microsoft.com/en-us/library/ms177285(v=sql.110).aspx" + condition: all + rules: + - "c:sqlcmd -Q \"DECLARE @NumErrorLogs int; EXEC master.sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', @NumErrorLogs OUTPUT; SELECT ISNULL(@NumErrorLogs, -1) AS [NumberOfLogFiles];\" -> n:^\\s*(\\d+) compare >= 12" + + # 5.2 Ensure 'Default Trace Enabled' Server Configuration Option is set to '1' (Scored) + - id: 11521 + title: "Ensure 'Default Trace Enabled' Server Configuration Option is set to '1'" + description: "The default trace provides audit logging of database activity including account creations, privilege elevation and execution of DBCC commands." + rationale: "Default trace provides valuable audit information regarding security-related activities on the server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'default trace enabled', 1; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["5.2"] + - cis_csc: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/default-trace-enabled-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'default trace enabled';\" -> r:1\\s+1" + + ########################################################### + # 6 Application Development + ########################################################### + # 6.2 Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies (Scored) + - id: 11522 + title: "Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies" + description: "Setting CLR Assembly Permission Sets to SAFE_ACCESS will prevent assemblies from accessing external system resources such as files, the network, environment variables, or the registry." + rationale: "Assemblies with EXTERNAL_ACCESS or UNSAFE permission sets can be used to access sensitive areas of the operating system, steal and/or transmit data and alter the state and other protection measures of the underlying Windows Operating System. Assemblies which are Microsoft-created ( is_user_defined = 0 ) are excluded from this check as they are required for overall system functionality." + remediation: "ALTER ASSEMBLY WITH PERMISSION_SET = SAFE;" + compliance: + - cis: ["6.2"] + - cis_csc: ["18"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: + - "http://msdn.microsoft.com/en-us/library/ms345101(v=sql.110).aspx" + - "http://msdn.microsoft.com/en-us/library/ms189790(v=sql.110).aspx" + - "http://msdn.microsoft.com/en-us/library/ms186711(v=sql.110).aspx" + condition: none + rules: + - 'c:sqlcmd -Q "SELECT name, permission_set_desc FROM sys.assemblies WHERE is_user_defined = 1;" -> r:EXTERNAL_ACCESS|UNSAFE' diff --git a/etc/ruleset/sca/applications/cis_sqlserver_2014.yml b/etc/ruleset/sca/applications/cis_sqlserver_2014.yml new file mode 100644 index 0000000000..a56c0655ff --- /dev/null +++ b/etc/ruleset/sca/applications/cis_sqlserver_2014.yml @@ -0,0 +1,457 @@ +# Security Configuration Assessment +# CIS Microsoft SQL Server 2014 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on Center for Internet Security Benchmark for Microsoft SQL Server 2014 v1.4.0 - 05-31-2019 + +policy: + id: "cis_sqlserver_2014" + file: "cis_sqlserver_2014" + name: "CIS Microsoft SQL Server 2014 Benchmark v1.4.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft SQL Server 2014." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform has Microsoft SQL Server 2014" + description: "Requirements for running the CIS Microsoft SQL Server 2014 Benchmark" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows' + +variables: + $User: + +checks: + ###################################################### + # 2 Surface Area Reduction + ###################################################### + # 2.1 Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0' (Scored) + - id: 12000 + title: "Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0'" + description: "Enabling Ad Hoc Distributed Queries allows users to query data and execute statements on external data sources. This functionality should be disabled." + rationale: "This feature can be used to remotely access and exploit vulnerabilities on remote SQL Server instances and to run unsafe Visual Basic for Application functions." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ad Hoc Distributed Queries', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ad-hoc-distributed-queries-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ad Hoc Distributed Queries' ;\" -> r:Ad Hoc Distributed Queries\\s+0\\s+0" + + # 2.2 Ensure 'CLR Enabled' Server Configuration Option is set to '0' (Scored) + - id: 12001 + title: "Ensure 'CLR Enabled' Server Configuration Option is set to '0'" + description: "The clr enabled option specifies whether user assemblies can be run by SQL Server." + rationale: "Enabling use of CLR assemblies widens the attack surface of SQL Server and puts it at risk from both inadvertent and malicious assemblies." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'clr enabled', 0; RECONFIGURE;" + compliance: + - cis: ["2.2"] + - cis_csc: ["18.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + references: + - "https://docs.microsoft.com/en-us/sql/t-sql/statements/create-assembly-transact-sql" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'clr enabled';\" -> r:0\\s+0" + + # 2.3 Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0' + - id: 12002 + title: "Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0'" + description: "The cross db ownership chaining option controls cross-database ownership chaining across all databases at the instance (or server) level." + rationale: "When enabled, this option allows a member of the db_owner role in a database to gain access to objects owned by a login in any other database, causing an unnecessary information disclosure. When required, cross-database ownership chaining should only be enabled for the specific databases requiring it instead of at the instance level for all databases by using the ALTER DATABASE SET DB_CHAINING ON command. This database option may not be changed on the master , model , or tempdb system databases." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'cross db ownership chaining', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.3"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/cross-db-ownership-chaining-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'cross db ownership chaining';\" -> r:0\\s+0" + + # 2.4 Ensure 'Database Mail XPs' Server Configuration Option is set to '0' + - id: 12003 + title: "Ensure 'Database Mail XPs' Server Configuration Option is set to '0'" + description: "The Database Mail XPs option controls the ability to generate and transmit email messages from SQL Server." + rationale: "Disabling the Database Mail XPs option reduces the SQL Server surface, eliminates a DOS attack vector and channel to exfiltrate data from the database server to a remote host." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Database Mail XPs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.4"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/database-mail/database-mail" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Database Mail XPs';\" -> r:0\\s+0" + + # 2.5 Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0' + - id: 12004 + title: "Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0'" + description: "The Ole Automation Procedures option controls whether OLE Automation objects can be instantiated within Transact-SQL batches. These are extended stored procedures that allow SQL Server users to execute functions external to SQL Server." + rationale: "Enabling this option will increase the attack surface of SQL Server and allow users to execute functions in the security context of SQL Server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ole Automation Procedures', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.5"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ole-automation-procedures-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ole Automation Procedures';\" -> r:0\\s+0" + + # 2.6 Ensure 'Remote Access' Server Configuration Option is set to '0' + - id: 12005 + title: "Ensure 'Remote Access' Server Configuration Option is set to '0'" + description: "The remote access option controls the execution of local stored procedures on remote servers or remote stored procedures on local server." + rationale: "Functionality can be abused to launch a Denial-of-Service (DoS) attack on remote servers by off-loading query processing to a target." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'remote access', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-remote-access-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote access';\" -> r:0\\s+0" + + # 2.7 Ensure 'Remote Admin Connections' Server Configuration Option is set to '0' (Scored) + - id: 12006 + title: "Ensure 'Remote Admin Connections' Server Configuration Option is set to '0'" + description: "The remote admin connections option controls whether a client application on a remote computer can use the Dedicated Administrator Connection (DAC)." + rationale: 'The Dedicated Administrator Connection (DAC) lets an administrator access a running server to execute diagnostic functions or Transact-SQL statements, or to troubleshoot problems on the server, even when the server is locked or running in an abnormal state and not responding to a SQL Server Database Engine connection. In a cluster scenario, the administrator may not actually be logged on to the same node that is currently hosting the SQL Server instance and thus is considered "remote". Therefore, this setting should usually be enabled ( 1 ) for SQL Server failover clusters; otherwise it should be disabled ( 0 ) which is the default.' + remediation: "Run the following T-SQL command on non-clustered installations: EXECUTE sp_configure 'remote admin connections', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/remote-admin-connections-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"USE master; SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote admin connections' AND SERVERPROPERTY('IsClustered') = 0;\" -> r:0\\s*\\t*0|0 rows affected" + + # 2.8 Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0' (Scored) + - id: 12007 + title: "Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0'" + description: "The scan for startup procs option, if enabled, causes SQL Server to scan for and automatically run all stored procedures that are set to execute upon service startup." + rationale: "Enforcing this control reduces the threat of an entity leveraging these facilities for malicious purposes." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'scan for startup procs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.8"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-scan-for-startup-procs-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'scan for startup procs';\" -> r:0\\s+0" + + # 2.9 Ensure 'Trustworthy' Database Property is set to 'Off' (Scored) + - id: 12008 + title: "Ensure 'Trustworthy' Database Property is set to 'Off'" + description: "The TRUSTWORTHY database option allows database objects to access objects in other databases under certain circumstances." + rationale: "Provides protection from malicious CLR assemblies or extended procedures." + remediation: "Execute the following T-SQL statement against the databases (replace below) returned by the Audit Procedure: ALTER DATABASE [] SET TRUSTWORTHY OFF;" + compliance: + - cis: ["2.9"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/trustworthy-database-property" + - "https://support.microsoft.com/it-it/help/2183687/guidelines-for-using-the-trustworthy-database-setting-in-sql-server" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name FROM sys.databases WHERE is_trustworthy_on = 1 AND name != ''msdb'';" -> r:0 rows affected' + + # 2.11 Ensure SQL Server is configured to use non-standard ports (Not Scored) + - id: 12009 + title: "Ensure SQL Server is configured to use non-standard ports" + description: "If enabled, the default SQL Server instance will be assigned a default port of TCP:1433 for TCP/IP communication. Administrators can also configure named instances to use TCP:1433 for communication. TCP:1433 is a widely known SQL Server port and this port assignment should be changed." + rationale: "Using a non-default port helps protect the database from attacks directed to the default port." + remediation: "1: In SQL Server Configuration Manager, in the console pane, expand SQL Server Network Configuration, expand Protocols for , and then double-click the TCP/IP or VIA protocol. 2: In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear in the format IP1 , IP2 , up to IPAll . One of these is for the IP address of the loopback adapter, 127.0.0.1 . Additional IP addresses appear for each IP Address on the computer. 3: Change the TCP Port field from 1433 to another non-standard port or leave the TCP Port field empty and set the TCP Dynamic Ports value to 0 to enable dynamic port assignment and then click OK. 4: In the console pane, click SQL Server Services. 5: In the details pane, right-click SQL Server () and then click Restart, to stop and restart SQL Server." + compliance: + - cis: ["2.11"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-a-server-to-listen-on-a-specific-tcp-port" + condition: none + rules: + - "c:sqlcmd -Q \"DECLARE @value nvarchar(256); EXECUTE master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQLServer\\SuperSocketNetLib\\Tcp\\IPAll', N'TcpPort', @value OUTPUT, N'no_output'; SELECT @value AS TCP_Port WHERE @value = '1433'; \" -> r:1433" + + # 2.13 Ensure 'sa' Login Account is set to 'Disabled' (Scored) + - id: 12010 + title: "Ensure 'sa' Login Account is set to 'Disabled'" + description: "The sa account is a widely known and often widely used SQL Server account with sysadmin privileges. This is the original login created during installation and always has the principal_id=1 and sid=0x01 ." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal." + remediation: "Execute the following T-SQL query: USE [master] GO DECLARE @tsql nvarchar(max) SET @tsql = 'ALTER LOGIN ' + SUSER_NAME(0x01) + ' DISABLE' EXEC (@tsql) GO" + compliance: + - cis: ["2.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-server-principals-transact-sql" + - "https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-login-transact-sql" + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, is_disabled FROM sys.server_principals WHERE sid = 0x01 AND is_disabled = 0;" -> r:0 rows affected' + + # 2.14 Ensure 'sa' Login Account has been renamed (Scored) + - id: 12011 + title: "Ensure 'sa' Login Account has been renamed" + description: "The sa account is a widely known and often widely used SQL Server login with sysadmin privileges. The sa login is the original login created during installation and always has principal_id=1 and sid=0x01 ." + rationale: "It is more difficult to launch password-guessing and brute-force attacks against the sa login if the name is not known." + remediation: "Replace the value within the below syntax and execute to rename the sa login. ALTER LOGIN sa WITH NAME = ;" + compliance: + - cis: ["2.14"] + - cis_csc: ["5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode" + condition: none + rules: + - 'c:sqlcmd -Q "SELECT name FROM sys.server_principals WHERE sid = 0x01;" -> r:sa' + + # 2.15 Ensure 'xp_cmdshell' Server Configuration Option is set to '0' + - id: 12012 + title: "Ensure 'xp_cmdshell' Server Configuration Option is set to '0'" + description: "The xp_cmdshell option controls whether the xp_cmdshell extended stored procedure can be used by an authenticated SQL Server user to execute operating-system command shell commands and return results as rows within the SQL client." + rationale: "The xp_cmdshell procedure is commonly used by attackers to read or write data to/from the underlying Operating System of a database server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'xp_cmdshell', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.15"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/xp-cmdshell-transact-sql" + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/xp-cmdshell-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'xp_cmdshell';\" -> r:0\\s+0" + + # 2.16 Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases + - id: 12013 + title: "Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases" + description: "AUTO_CLOSE determines if a given database is closed or not after a connection terminates. If enabled, subsequent connections to the given database will require the database to be reopened and relevant procedure caches to be rebuilt." + rationale: "Because authentication of users for contained databases occurs within the database not at the server\\instance level, the database must be opened every time to authenticate a user. The frequent opening/closing of the database consumes additional server resources and may contribute to a denial of service." + remediation: "Execute the following T-SQL, replacing with each database name found by the Audit Procedure: ALTER DATABASE SET AUTO_CLOSE OFF;" + compliance: + - cis: ["2.16"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/databases/security-best-practices-with-contained-databases" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, containment, containment_desc, is_auto_close_on FROM sys.databases WHERE containment <> 0 and is_auto_close_on = 1;" -> r:0 rows affected' + + # 2.17 Ensure no login exists with the name 'sa' (Scored) + - id: 12014 + title: "Ensure no login exists with the name 'sa'" + description: "The sa login (e.g. principal) is a widely known and often widely used SQL Server account. Therefore, there should not be a login called sa even when the original sa login ( principal_id = 0x01 ) has been renamed." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal name." + remediation: "Execute the appropriate ALTER or DROP statement below based on the principal_id returned for the login named sa . Replace the value within the below syntax and execute to rename the sa login. USE [master] GO -- If principal_id = 1 or the login owns database objects, rename the sa login ALTER LOGIN [sa] WITH NAME = ; GO -- If the login owns no database objects, then drop it -- Do NOT drop the login if it is principal_id = 1 DROP LOGIN sa" + compliance: + - cis: ["2.17"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sqlcmd -Q "SELECT principal_id, name FROM sys.server_principals WHERE name = ''sa'';" -> r:0 rows affected' + + ########################################################### + # 3 Authentication and Authorization + ########################################################### + # 3.1 Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode' (Scored) + - id: 12015 + title: "Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode'" + description: "Uses Windows Authentication to validate attempted connections." + rationale: "Windows provides a more robust authentication mechanism than SQL Server authentication." + remediation: "Perform either the GUI or T-SQL method shown: GUI Method: 1. Open SQL Server Management Studio. 2. Open the Object Explorer tab and connect to the target database instance. 3. Right click the instance name and select Properties. 4. Select the Security page from the left menu. 5. Set the Server authentication setting to Windows Authentication Mode. or T-SQL Method: Run the following T-SQL in a Query Window: USE [master] GO EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'LoginMode', REG_DWORD, 1 GO Restart the SQL Server service for the change to take effect." + compliance: + - cis: ["3.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/server-properties-security-page" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT SERVERPROPERTY(''IsIntegratedSecurityOnly'') as [login_mode];" -> r:^1' + + # 3.8 Ensure only the default permissions specified by Microsoft are granted to the public server role (Scored) + - id: 12016 + title: "Ensure only the default permissions specified by Microsoft are granted to the public server role" + description: "public is a special fixed server role containing all logins. Unlike other fixed server roles, permissions can be changed for the public role. In keeping with the principle of least privileges, the public server role should not be used to grant permissions at the server scope as these would be inherited by all users." + rationale: "Every SQL Server login belongs to the public role and cannot be removed from this role. Therefore, any permissions granted to this role will be available to all logins unless they have been explicitly denied to specific logins or user-defined server roles." + remediation: "Add the extraneous permissions found in the Audit query results to the specific logins to user-defined server roles which require the access. Revoke the from the public role as shown below USE [master] GO REVOKE FROM public; GO" + compliance: + - cis: ["3.8"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles" + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles#permissions-of-fixed-server-roles" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT * FROM master.sys.server_permissions WHERE (grantee_principal_id = SUSER_SID(N''public'') and state_desc LIKE ''GRANT%'') AND NOT (state_desc = ''GRANT'' and [permission_name] = ''VIEW ANY DATABASE'' and class_desc = ''SERVER'') AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 2) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 3) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 4) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 5); " -> r:0 rows affected' + + # 3.10 Ensure Windows local groups are not SQL Logins (Scored) + - id: 12017 + title: "Ensure Windows local groups are not SQL Logins" + description: "Local Windows groups should not be used as logins for SQL Server instances." + rationale: "Allowing local Windows groups as SQL Logins provides a loophole whereby anyone with OS level administrator rights (and no SQL Server rights) could add users to the local Windows groups and thereby give themselves or others access to the SQL Server instance." + remediation: "1. For each LocalGroupName login, if needed create an equivalent AD group containing only the required user accounts. 2. Add the AD group or individual Windows accounts as a SQL Server login and grant it the permissions required. 3. Drop the LocalGroupName login using the syntax below after replacing . USE [master] GO DROP LOGIN [] GO" + compliance: + - cis: ["3.10"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + condition: all + rules: + - 'c:sqlcmd -Q "USE [master] SELECT pr.[name] AS LocalGroupName, pe.[permission_name], pe.[state_desc] FROM sys.server_principals pr JOIN sys.server_permissions pe ON pr.[principal_id] = pe.[grantee_principal_id] WHERE pr.[type_desc] = ''WINDOWS_GROUP'' AND pr.[name] like CAST(SERVERPROPERTY(''MachineName'') AS nvarchar) + ''%'';" -> r:0 rows affected' + + ########################################################### + # 4 Password Policies + ########################################################### + # 4.2 Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role (Scored) + - id: 12018 + title: "Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role" + description: "Applies the same password expiration policy used in Windows to passwords used inside SQL Server." + rationale: "Ensuring SQL logins comply with the secure password policy applied by the Windows Server Benchmark will ensure the passwords for SQL logins with sysadmin privileges are changed on a frequent basis to help prevent compromise via a brute force attack. CONTROL SERVER is an equivalent permission to sysadmin and logins with that permission should also be required to have expiring passwords." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_EXPIRATION = ON;" + compliance: + - cis: ["4.2"] + - cis_csc: ["16.2, 16.10"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "http://msdn.microsoft.com/en-us/library/ms161959(v=sql.120).aspx" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT l.[name], ''sysadmin membership'' AS ''Access_Method'' FROM sys.sql_logins AS l WHERE IS_SRVROLEMEMBER(''sysadmin'',name) = 1 AND l.is_expiration_checked <> 1 UNION ALL SELECT l.[name], ''CONTROL SERVER'' AS ''Access_Method'' FROM sys.sql_logins AS l JOIN sys.server_permissions AS p ON l.principal_id = p.grantee_principal_id WHERE p.type = ''CL'' AND p.state IN (''G'', ''W'') AND l.is_expiration_checked <> 1;" -> r:0 rows affected' + + # 4.3 Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins (Scored) + - id: 12019 + title: "Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins" + description: "Applies the same password complexity policy used in Windows to passwords used insideSQL Server." + rationale: "Ensure SQL authenticated login passwords comply with the secure password policy applied by the Windows Server Benchmark so that they cannot be easily compromised via brute force attack." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_POLICY = ON; Note: In the case of AWS RDS do not perform this remediation for the Master account." + compliance: + - cis: ["4.3"] + - cis_csc: ["16, 4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "http://msdn.microsoft.com/en-us/library/ms161959(v=sql.120).aspx" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, is_disabled FROM sys.sql_logins WHERE is_policy_checked = 0;" -> r:0 rows affected' + + ########################################################## + # 5 Auditing and Logging + ########################################################## + # 5.1 Ensure 'Maximum number of error log files' is set to greater than or equal to '12' + - id: 12020 + title: "Ensure 'Maximum number of error log files' is set to greater than or equal to '12'" + description: "SQL Server error log files must be protected from loss. The log files must be backed up before they are overwritten. Retaining more error logs helps prevent loss from frequent recycling before backups can occur." + rationale: "The SQL Server error log contains important information about major server events and login attempt information as well." + remediation: "Adjust the number of logs to prevent data loss. The default value of 6 may be insufficient for a production environment. Perform either the GUI or T-SQL method shown: GUI Method 1. Open SQL Server Management Studio. 2. Open Object Explorer and connect to the target instance. 3. Navigate to the Management tab in Object Explorer and expand. Right click on the SQL Server Logs file and select Configure 4. Check the Limit the number of error log files before they are recycled 5. Set the Maximum number of error log files to greater than or equal to 12 T-SQL Method Run the following T-SQL to change the number of error log files, replace with your desired number of error log files: EXEC master.sys.xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', REG_DWORD, ;" + compliance: + - cis: ["5.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - "http://msdn.microsoft.com/en-us/library/ms177285(v=sql.120).aspx" + condition: all + rules: + - "c:sqlcmd -Q \"DECLARE @NumErrorLogs int; EXEC master.sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', @NumErrorLogs OUTPUT; SELECT ISNULL(@NumErrorLogs, -1) AS [NumberOfLogFiles];\" -> n:^\\s*(\\d+) compare >= 12" + + # 5.2 Ensure 'Default Trace Enabled' Server Configuration Option is set to '1' (Scored) + - id: 12021 + title: "Ensure 'Default Trace Enabled' Server Configuration Option is set to '1'" + description: "The default trace provides audit logging of database activity including account creations, privilege elevation and execution of DBCC commands." + rationale: "Default trace provides valuable audit information regarding security-related activities on the server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'default trace enabled', 1; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["5.2"] + - cis_csc: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/default-trace-enabled-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'default trace enabled';\" -> r:1\\s+1" + + ########################################################### + # 6 Application Development + ########################################################### + # 6.2 Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies (Scored) + - id: 12022 + title: "Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies" + description: "Setting CLR Assembly Permission Sets to SAFE_ACCESS will prevent assemblies from accessing external system resources such as files, the network, environment variables, or the registry." + rationale: "Assemblies with EXTERNAL_ACCESS or UNSAFE permission sets can be used to access sensitive areas of the operating system, steal and/or transmit data and alter the state and other protection measures of the underlying Windows Operating System. Assemblies which are Microsoft-created ( is_user_defined = 0 ) are excluded from this check as they are required for overall system functionality." + remediation: "ALTER ASSEMBLY WITH PERMISSION_SET = SAFE;" + compliance: + - cis: ["6.2"] + - cis_csc: ["18"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: + - "http://msdn.microsoft.com/en-us/library/ms345101(v=sql.120).aspx" + - "http://msdn.microsoft.com/en-us/library/ms189790(v=sql.120).aspx" + - "http://msdn.microsoft.com/en-us/library/ms186711(v=sql.120).aspx" + condition: none + rules: + - 'c:sqlcmd -Q "SELECT name, permission_set_desc FROM sys.assemblies WHERE is_user_defined = 1;" -> r:EXTERNAL_ACCESS|UNSAFE' diff --git a/etc/ruleset/sca/applications/cis_sqlserver_2016.yml b/etc/ruleset/sca/applications/cis_sqlserver_2016.yml new file mode 100644 index 0000000000..d31470fbff --- /dev/null +++ b/etc/ruleset/sca/applications/cis_sqlserver_2016.yml @@ -0,0 +1,667 @@ +# Security Configuration Assessment +# CIS Microsoft SQL Server 2016 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on Center for Internet Security Benchmark for Microsoft SQL Server 2016 v1.3.0 - 04-30-2021 + +policy: + id: "cis_sqlserver_2016" + file: "cis_sqlserver_2016.yml" + name: "CIS Microsoft SQL Server 2016 Benchmark v1.3.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft SQL Server 2016." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform has Microsoft SQL Server 2016" + description: "Requirements for running the CIS Microsoft SQL Server 2016 Benchmark" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows' + +checks: + ###################################################### + # 2 Surface Area Reduction + ###################################################### + # 2.1 Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0' + - id: 13000 + title: Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0' + description: > + Enabling Ad Hoc Distributed Queries allows users to query data and execute statements on + external data sources. This functionality should be disabled. + rationale: > + This feature can be used to remotely access and exploit vulnerabilities on remote SQL + Server instances and to run unsafe Visual Basic for Application functions. + remediation: > + Run the following T-SQL command: + EXECUTE sp_configure 'show advanced options', 1; + RECONFIGURE; + EXECUTE sp_configure 'Ad Hoc Distributed Queries', 0; + RECONFIGURE; + GO + EXECUTE sp_configure 'show advanced options', 0; + RECONFIGURE; + compliance: + - cis: ["2.1"] + - cis_csc: ["9.1"] + references: + - https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/adhoc-distributed-queries-server-configuration-option + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ad Hoc Distributed Queries' ;\" -> r:Ad Hoc Distributed Queries\\s+0\\s+0" + + # 2.2 Ensure 'CLR Enabled' Server Configuration Option is set to '0' + - id: 13001 + title: Ensure 'CLR Enabled' Server Configuration Option is set to '0' + description: The clr enabled option specifies whether user assemblies can be run by SQL Server. + rationale: > + Enabling use of CLR assemblies widens the attack surface of SQL Server and puts it at risk + from both inadvertent and malicious assemblies. + remediation: > + Run the following T-SQL command: + EXECUTE sp_configure 'clr enabled', 0; + RECONFIGURE; + compliance: + - cis: ["2.2"] + - cis_csc: ["18.9"] + references: + - https://docs.microsoft.com/en-us/sql/t-sql/statements/create-assembly-transactsql + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'clr enabled';\" -> r:0\\s+0" + + # 2.3 Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0' + - id: 13002 + title: Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0' + description: > + The cross db ownership chaining option controls cross-database ownership chaining + across all databases at the instance (or server) level. + rationale: > + When enabled, this option allows a member of the db_owner role in a database to gain + access to objects owned by a login in any other database, causing an unnecessary + information disclosure. When required, cross-database ownership chaining should only be + enabled for the specific databases requiring it instead of at the instance level for all + databases by using the ALTER DATABASESET DB_CHAINING ON command. + This database option may not be changed on the master, model, or tempdb system + databases. + remediation: > + Run the following T-SQL command: + EXECUTE sp_configure 'cross db ownership chaining', 0; + RECONFIGURE; + GO + compliance: + - cis: ["2.3"] + - cis_csc: ["14.4"] + references: + - https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/crossdb-ownership-chaining-server-configuration-option + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'cross db ownership chaining';\" -> r:0\\s+0" + + # 2.4 Ensure 'Database Mail XPs' Server Configuration Option is set to '0' + - id: 13003 + title: Ensure 'Database Mail XPs' Server Configuration Option is set to '0' + description: > + The Database Mail XPs option controls the ability to generate and transmit email + messages from SQL Server. + rationale: > + Disabling the Database Mail XPs option reduces the SQL Server surface, eliminates a DOS + attack vector and channel to exfiltrate data from the database server to a remote host. + remediation: > + Run the following T-SQL command: + EXECUTE sp_configure 'show advanced options', 1; + RECONFIGURE; + EXECUTE sp_configure 'Database Mail XPs', 0; + RECONFIGURE; + GO + EXECUTE sp_configure 'show advanced options', 0; + RECONFIGURE; + compliance: + - cis: ["2.4"] + - cis_csc: ["18"] + references: + - https://docs.microsoft.com/en-us/sql/relational-databases/databasemail/database-mail + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Database Mail XPs';\" -> r:0\\s+0" + + # 2.5 Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0' + - id: 13004 + title: Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0' + description: > + The Ole Automation Procedures option controls whether OLE Automation objects can be + instantiated within Transact-SQL batches. These are extended stored procedures that allow + SQL Server users to execute functions external to SQL Server. + rationale: > + Enabling this option will increase the attack surface of SQL Server and allow users to + execute functions in the security context of SQL Server. + remediation: > + Run the following T-SQL command: + EXECUTE sp_configure 'show advanced options', 1; + RECONFIGURE; + EXECUTE sp_configure 'Ole Automation Procedures', 0; + RECONFIGURE; + GO + EXECUTE sp_configure 'show advanced options', 0; + RECONFIGURE; + compliance: + - cis: ["2.5"] + - cis_csc: ["18"] + references: + - https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/oleautomation-procedures-server-configuration-option + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ole Automation Procedures';\" -> r:0\\s+0" + + # 2.6 Ensure 'Remote Access' Server Configuration Option is set to '0' + - id: 13005 + title: Ensure 'Remote Access' Server Configuration Option is set to '0' + description: > + The remote access option controls the execution of local stored procedures on remote + servers or remote stored procedures on local server. + rationale: > + Functionality can be abused to launch a Denial-of-Service (DoS) attack on remote servers + by off-loading query processing to a target. + remediation: > + Run the following T-SQL command: + EXECUTE sp_configure 'show advanced options', 1; + RECONFIGURE; + EXECUTE sp_configure 'remote access', 0; + RECONFIGURE; + GO + EXECUTE sp_configure 'show advanced options', 0; + RECONFIGURE; + compliance: + - cis: ["2.6"] + - cis_csc: ["9.1"] + references: + - https://docs.microsoft.com/en-us/sql/database-engine/configurewindows/configure-the-remote-access-server-configuration-option + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote access';\" -> r:0\\s+0" + + # 2.7 Ensure 'Remote Admin Connections' Server Configuration Option is set to '0' + - id: 13006 + title: Ensure 'Remote Admin Connections' Server Configuration Option is set to '0' + description: > + The remote admin connections option controls whether a client application on a remote + computer can use the Dedicated Administrator Connection (DAC). + rationale: > + The Dedicated Administrator Connection (DAC) lets an administrator access a running + server to execute diagnostic functions or Transact-SQL statements, or to troubleshoot + problems on the server, even when the server is locked or running in an abnormal state + and not responding to a SQL Server Database Engine connection. In a cluster scenario, the + administrator may not actually be logged on to the same node that is currently hosting the + SQL Server instance and thus is considered "remote". Therefore, this setting should usually + be enabled (1) for SQL Server failover clusters; otherwise, it should be disabled (0) which is + the default. + remediation: > + Run the following T-SQL command on non-clustered installations: + EXECUTE sp_configure 'remote admin connections', 0; + RECONFIGURE; + GO + compliance: + - cis: ["2.7"] + - cis_csc: ["9.1"] + references: + - https://docs.microsoft.com/en-us/sql/database-engine/configurewindows/remote-admin-connections-server-configuration-option + condition: all + rules: + - "c:sqlcmd -Q \"USE master; SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote admin connections' AND SERVERPROPERTY('IsClustered') = 0;\" -> r:remote admin connections\\s+0\\s+0" + + # 2.8 Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0' + - id: 13007 + title: Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0' + description: > + The scan for startup procs option, if enabled, causes SQL Server to scan for and + automatically run all stored procedures that are set to execute upon service startup. + rationale: > + Enforcing this control reduces the threat of an entity leveraging these facilities for + malicious purposes. + remediation: > + Run the following T-SQL command: + EXECUTE sp_configure 'show advanced options', 1; + RECONFIGURE; + EXECUTE sp_configure 'scan for startup procs', 0; + RECONFIGURE; + GO + EXECUTE sp_configure 'show advanced options', 0; + RECONFIGURE; + + Restart the Database Engine. + compliance: + - cis: ["2.8"] + - cis_csc: ["18"] + references: + - https://docs.microsoft.com/en-us/sql/database-engine/configurewindows/configure-the-scan-for-startup-procs-server-configuration-option + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'scan for startup procs';\" -> r:0\\s+0" + + # 2.9 Ensure 'Trustworthy' Database Property is set to 'Off' + - id: 13008 + title: Ensure 'Trustworthy' Database Property is set to 'Off' + description: > + The TRUSTWORTHY database option allows database objects to access objects in other + databases under certain circumstances. + rationale: > + Provides protection from malicious CLR assemblies or extended procedures. + remediation: > + Execute the following T-SQL statement against the databases (replace below) returned by the Audit Procedure: + ALTER DATABASE [] SET TRUSTWORTHY OFF; + compliance: + - cis: ["2.9"] + - cis_csc: ["14.4"] + references: + - https://docs.microsoft.com/en-us/sql/relational-databases/security/trustworthydatabase-property + - https://support.microsoft.com/it-it/help/2183687/guidelines-for-using-thetrustworthy-database-setting-in-sql-server + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name FROM sys.databases WHERE is_trustworthy_on = 1 AND name != ''msdb'';" -> r:0 rows affected' + + # 2.11 Ensure SQL Server is configured to use non-standard ports + - id: 13009 + title: Ensure SQL Server is configured to use non-standard ports + description: > + If installed, a default SQL Server instance will be assigned a default port of TCP:1433 for + TCP/IP communication. Administrators can also manually configure named instances to + use TCP:1433 for communication. TCP:1433 is a widely known SQL Server port and this + port assignment should be changed. In a multi-instance scenario, each instance must be + assigned its own dedicated TCP/IP port. + rationale: > + Using a non-default port helps protect the database from attacks directed to the default + port. + remediation: > + 1. In SQL Server Configuration Manager, in the console pane, expand SQL Server + Network Configuration, expand Protocols for , and then doubleclick the TCP/IP protocol + 2. In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses + appear in the format IP1, IP2, up to IPAll. One of these is for the IP address of the + loopback adapter, 127.0.0.1. Additional IP addresses appear for each IP Address on + the computer. + 3. Under IPAll, change the TCP Port field from 1433 to a non-standard port or leave + the TCP Port field empty and set the TCP Dynamic Ports value to 0 to enable + dynamic port assignment and then click OK. + 4. In the console pane, click SQL Server Services. + 5. In the details pane, right-click SQL Server () and then click + Restart, to stop and restart SQL Server. + compliance: + - cis: ["2.11"] + - cis_csc: ["9"] + references: + - https://docs.microsoft.com/en-us/sql/database-engine/configurewindows/configure-a-server-to-listen-on-a-specific-tcp-port + condition: none + rules: + - "c:sqlcmd -Q \"DECLARE @value nvarchar(256); EXECUTE master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQLServer\\SuperSocketNetLib\\Tcp\\IPAll', N'TcpPort', @value OUTPUT, N'no_output'; SELECT @value AS TCP_Port WHERE @value = '1433'; \" -> r:1433" + + # 2.13 Ensure the 'sa' Login Account is set to 'Disabled' + - id: 13010 + title: Ensure the 'sa' Login Account is set to 'Disabled' + description: > + The sa account is a widely known and often widely used SQL Server account with sysadmin + privileges. This is the original login created during installation and always has the + principal_id=1 and sid=0x01. + rationale: > + Enforcing this control reduces the probability of an attacker executing brute force attacks + against a well-known principal. + remediation: > + Execute the following T-SQL query: + USE [master] + GO + DECLARE @tsql nvarchar(max) + SET @tsql = 'ALTER LOGIN ' + SUSER_NAME(0x01) + ' DISABLE' + EXEC (@tsql) + GO + compliance: + - cis: ["2.13"] + - cis_csc: ["5.1"] + references: + - https://docs.microsoft.com/en-us/sql/relational-databases/system-catalogviews/sys-server-principals-transact-sql + - https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-login-transact-sql + - https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-anauthentication-mode + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, is_disabled FROM sys.server_principals WHERE sid = 0x01 AND is_disabled = 0;" -> r:0 rows affected' + + # 2.14 Ensure the 'sa' Login Account has been renamed + - id: 13011 + title: Ensure the 'sa' Login Account has been renamed + description: > + The sa account is a widely known and often widely used SQL Server login with sysadmin + privileges. The sa login is the original login created during installation and always has + principal_id=1 and sid=0x01. + rationale: > + It is more difficult to launch password-guessing and brute-force attacks against the sa login + if the name is not known. + remediation: > + Replace the value within the below syntax and execute to rename the sa login. + ALTER LOGIN sa WITH NAME = ; + compliance: + - cis: ["2.14"] + - cis_csc: ["5"] + references: + - https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-anauthentication-mode + condition: none + rules: + - 'c:sqlcmd -Q "SELECT name FROM sys.server_principals WHERE sid = 0x01;" -> r:^sa' + + # 2.15 Ensure 'xp_cmdshell' Server Configuration Option is set to '0' + - id: 13012 + title: Ensure 'xp_cmdshell' Server Configuration Option is set to '0' + description: > + The xp_cmdshell option controls whether the xp_cmdshell extended stored procedure can + be used by an authenticated SQL Server user to execute operating-system command shell + commands and return results as rows within the SQL client. + rationale: > + The xp_cmdshell procedure is commonly used by attackers to read or write data to/from + the underlying Operating System of a database server. + remediation: > + Run the following T-SQL command: + EXECUTE sp_configure 'show advanced options', 1; + RECONFIGURE; + EXECUTE sp_configure 'xp_cmdshell', 0; + RECONFIGURE; + GO + EXECUTE sp_configure 'show advanced options', 0; + RECONFIGURE; + compliance: + - cis: ["2.15"] + - cis_csc: ["18"] + references: + - https://docs.microsoft.com/en-us/sql/relational-databases/system-storedprocedures/xp-cmdshell-transact-sql + - https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/xpcmdshell-server-configuration-option + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'xp_cmdshell';\" -> r:0\\s+0" + + # 2.16 Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases + - id: 13013 + title: Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases + description: > + AUTO_CLOSE determines if a given database is closed or not after a connection terminates. If + enabled, subsequent connections to the given database will require the database to be + reopened and relevant procedure caches to be rebuilt. + rationale: > + Because authentication of users for contained databases occurs within the database not at + the server\instance level, the database must be opened every time to authenticate a user. + The frequent opening/closing of the database consumes additional server resources and + may contribute to a denial of service. + remediation: > + Execute the following T-SQL, replacing with each database name found by the Audit Procedure: + ALTER DATABASE SET AUTO_CLOSE OFF; + compliance: + - cis: ["2.16"] + - cis_csc: ["18"] + references: + - https://docs.microsoft.com/en-us/sql/relational-databases/databases/securitybest-practices-with-contained-databases + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, containment, containment_desc, is_auto_close_on FROM sys.databases WHERE containment <> 0 and is_auto_close_on = 1;" -> r:0 rows affected' + + # 2.17 Ensure no login exists with the name 'sa' + - id: 13014 + title: Ensure no login exists with the name 'sa' + description: > + The sa login (e.g. principal) is a widely known and often widely used SQL Server account. + Therefore, there should not be a login called sa even when the original sa login + (principal_id = 1) has been renamed. + rationale: > + Enforcing this control reduces the probability of an attacker executing brute force attacks + against a well-known principal name. + remediation: > + Execute the appropriate ALTER or DROP statement below based on the principal_id + returned for the login named sa. Replace the value within the below + syntax and execute to rename the sa login. + USE [master] + GO + -- If principal_id = 1 or the login owns database objects, rename the sa + login + ALTER LOGIN [sa] WITH NAME = ; + GO + -- If the login owns no database objects, then drop it + -- Do NOT drop the login if it is principal_id = 1 + DROP LOGIN sa + compliance: + - cis: ["2.17"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sqlcmd -Q "SELECT principal_id, name FROM sys.server_principals WHERE name = ''sa'';" -> r:0 rows affected' + + ########################################################### + # 3 Authentication and Authorization + ########################################################### + # 3.1 Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode' + - id: 13015 + title: Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode' + description: Uses Windows Authentication to validate attempted connections. + rationale: Windows provides a more robust authentication mechanism than SQL Server authentication. + remediation: > + Perform either the GUI or T-SQL method shown: + 1.1.1.5 GUI Method + 1. Open SQL Server Management Studio. + 2. Open the Object Explorer tab and connect to the target database instance. + 3. Right click the instance name and select Properties. + 4. Select the Security page from the left menu. + 5. Set the Server authentication setting to Windows Authentication Mode. + + 1.1.1.6 T-SQL Method + Run the following T-SQL in a Query Window: + USE [master] + GO + EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', + N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 1 + GO + + Restart the SQL Server service for the change to take effect. + compliance: + - cis: ["3.1"] + - cis_csc: ["16.9"] + references: + - https://docs.microsoft.com/en-us/sql/database-engine/configurewindows/server-properties-security-page + condition: all + rules: + - 'c:sqlcmd -Q "SELECT SERVERPROPERTY(''IsIntegratedSecurityOnly'') as [login_mode];" -> r:^1' + + # 3.8 Ensure only the default permissions specified by Microsoft are granted to the public server role + - id: 13016 + title: Ensure only the default permissions specified by Microsoft are granted to the public server role + description: > + public is a special fixed server role containing all logins. Unlike other fixed server roles, + permissions can be changed for the public role. In keeping with the principle of least + privileges, the public server role should not be used to grant permissions at the server + scope as these would be inherited by all users. + rationale: > + Every SQL Server login belongs to the public role and cannot be removed from this role. + Therefore, any permissions granted to this role will be available to all logins unless they + have been explicitly denied to specific logins or user-defined server roles. + remediation: > + 1. Add the extraneous permissions found in the Audit query results to the specific + logins to user-defined server roles which require the access. + 2. Revoke the from the public role as shown below + USE [master] + GO + REVOKE FROM public; + GO + compliance: + - cis: ["3.8"] + - cis_csc: ["5.1"] + references: + - https://docs.microsoft.com/en-us/sql/relationaldatabases/security/authentication-access/server-level-roles + - https://docs.microsoft.com/en-us/sql/relationaldatabases/security/authentication-access/server-level-roles#permissions-of-fixedserver-roles + condition: all + rules: + - 'c:sqlcmd -Q "SELECT * FROM master.sys.server_permissions WHERE (grantee_principal_id = SUSER_SID(N''public'') and state_desc LIKE ''GRANT%'') AND NOT (state_desc = ''GRANT'' and [permission_name] = ''VIEW ANY DATABASE'' and class_desc = ''SERVER'') AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 2) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 3) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 4) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 5); " -> r:0 rows affected' + + # 3.10 Ensure Windows local groups are not SQL Logins + - id: 13017 + title: Ensure Windows local groups are not SQL Logins + description: Local Windows groups should not be used as logins for SQL Server instances. + rationale: > + Allowing local Windows groups as SQL Logins provides a loophole whereby anyone with + OS level administrator rights (and no SQL Server rights) could add users to the local + Windows groups and thereby give themselves or others access to the SQL Server instance. + remediation: > + 1. For each LocalGroupName login, if needed create an equivalent AD group containing only the required user accounts. + 2. Add the AD group or individual Windows accounts as a SQL Server login and grant it the permissions required. + 3. Drop the LocalGroupName login using the syntax below after replacing . + USE [master] + GO + DROP LOGIN [] + GO + compliance: + - cis: ["3.10"] + - cis_csc: ["14.4"] + condition: all + rules: + - 'c:sqlcmd -Q "USE [master] SELECT pr.[name] AS LocalGroupName, pe.[permission_name], pe.[state_desc] FROM sys.server_principals pr JOIN sys.server_permissions pe ON pr.[principal_id] = pe.[grantee_principal_id] WHERE pr.[type_desc] = ''WINDOWS_GROUP'' AND pr.[name] like CAST(SERVERPROPERTY(''MachineName'') AS nvarchar) + ''%'';" -> r:0 rows affected' + + ########################################################### + # 4 Password Policies + ########################################################### + # 4.2 Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role + - id: 13018 + title: Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role + description: Applies the same password expiration policy used in Windows to passwords used inside SQL Server. + rationale: > + Ensuring SQL logins comply with the secure password policy applied by the Windows + Server Benchmark will ensure the passwords for SQL logins with sysadmin privileges are + changed on a frequent basis to help prevent compromise via a brute force attack. CONTROL + SERVER is an equivalent permission to sysadmin and logins with that permission should + also be required to have expiring passwords. + remediation: > + For each found by the Audit Procedure, execute the following T-SQL statement: + ALTER LOGIN [] WITH CHECK_EXPIRATION = ON; + compliance: + - cis: ["4.2"] + - cis_csc: ["16.2"] + references: + - https://docs.microsoft.com/en-us/sql/relational-databases/security/passwordpolicy?view=sql-server-2016 + condition: all + rules: + - 'c:sqlcmd -Q "SELECT l.[name], ''sysadmin membership'' AS ''Access_Method'' FROM sys.sql_logins AS l WHERE IS_SRVROLEMEMBER(''sysadmin'',name) = 1 AND l.is_expiration_checked <> 1 UNION ALL SELECT l.[name], ''CONTROL SERVER'' AS ''Access_Method'' FROM sys.sql_logins AS l JOIN sys.server_permissions AS p ON l.principal_id = p.grantee_principal_id WHERE p.type = ''CL'' AND p.state IN (''G'', ''W'') AND l.is_expiration_checked <> 1;" -> r:0 rows affected' + + # 4.3 Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins + - id: 13019 + title: Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins + description: Applies the same password complexity policy used in Windows to passwords used inside SQL Server. + rationale: > + Ensure SQL authenticated login passwords comply with the secure password policy applied + by the Windows Server Benchmark so that they cannot be easily compromised via brute + force attack. + remediation: > + For each found by the Audit Procedure, execute the following T-SQL statement: + ALTER LOGIN [] WITH CHECK_POLICY = ON; + + Note: In the case of AWS RDS do not perform this remediation for the Master account. + compliance: + - cis: ["4.3"] + - cis_csc: ["16"] + references: + - https://docs.microsoft.com/en-us/sql/relational-databases/security/passwordpolicy + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, is_disabled FROM sys.sql_logins WHERE is_policy_checked = 0;" -> r:0 rows affected' + + ########################################################## + # 5 Auditing and Logging + ########################################################## + # 5.1 Ensure 'Maximum number of error log files' is set to greater than or equal to '12' + - id: 13020 + title: Ensure 'Maximum number of error log files' is set to greater than or equal to '12' + description: > + SQL Server error log files must be protected from loss. The log files must be backed up + before they are overwritten. Retaining more error logs helps prevent loss from frequent + recycling before backups can occur. + rationale: > + The SQL Server error log contains important information about major server events and + login attempt information as well. + remediation: > + Adjust the number of logs to prevent data loss. The default value of 6 may be insufficient for + a production environment. Perform either the GUI or T-SQL method shown: + + 1.1.1.9 GUI Method + 1. Open SQL Server Management Studio. + 2. Open Object Explorer and connect to the target instance. + 3. Navigate to the Management tab in Object Explorer and expand. Right click on the SQL Server Logs file and select Configure + 4. Check the Limit the number of error log files before they are recycled + 5. Set the Maximum number of error log files to greater than or equal to 12 + + 1.1.1.10T-SQL Method + Run the following T-SQL to change the number of error log files, replace + with your desired number of error log files: + EXEC master.sys.xp_instance_regwrite + N'HKEY_LOCAL_MACHINE', + N'Software\Microsoft\MSSQLServer\MSSQLServer', + N'NumErrorLogs', + REG_DWORD, + ; + compliance: + - cis: ["5.1"] + - cis_csc: ["6.3"] + references: + - https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/scmservices-configure-sql-server-error-logs + condition: all + rules: + - "c:sqlcmd -Q \"DECLARE @NumErrorLogs int; EXEC master.sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', @NumErrorLogs OUTPUT; SELECT ISNULL(@NumErrorLogs, -1) AS [NumberOfLogFiles];\" -> n:^\\s*(\\d+) compare >= 12" + + # 5.2 Ensure 'Default Trace Enabled' Server Configuration Option is set to '1' + - id: 13021 + title: Ensure 'Default Trace Enabled' Server Configuration Option is set to '1' + description: > + The default trace provides audit logging of database activity including account creations, + privilege elevation and execution of DBCC commands. + rationale: Default trace provides valuable audit information regarding security-related activities on the server. + remediation: > + Run the following T-SQL command: + EXECUTE sp_configure 'show advanced options', 1; + RECONFIGURE; + EXECUTE sp_configure 'default trace enabled', 1; + RECONFIGURE; + GO + EXECUTE sp_configure 'show advanced options', 0; + RECONFIGURE; + compliance: + - cis: ["5.2"] + - cis_csc: ["6.2"] + references: + - https://docs.microsoft.com/en-us/sql/database-engine/configurewindows/default-trace-enabled-server-configuration-option + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'default trace enabled';\" -> r:1\\s+1" + + ########################################################### + # 6 Application Development + ########################################################### + # 6.2 Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies + - id: 13022 + title: Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies + description: > + Setting CLR Assembly Permission Sets to SAFE_ACCESS will prevent assemblies from + accessing external system resources such as files, the network, environment variables, or + the registry. + rationale: > + Assemblies with EXTERNAL_ACCESS or UNSAFE permission sets can be used to access + sensitive areas of the operating system, steal and/or transmit data and alter the state and + other protection measures of the underlying Windows Operating System. + + Assemblies which are Microsoft-created (is_user_defined = 0) are excluded from this + check as they are required for overall system functionality. + remediation: > + USE ; + GO + ALTER ASSEMBLY WITH PERMISSION_SET = SAFE; + compliance: + - cis: ["6.2"] + - cis_csc: ["18"] + references: + - https://docs.microsoft.com/en-us/sql/relational-databases/clrintegration/security/clr-integration-code-access-security + - https://docs.microsoft.com/en-us/sql/relational-databases/system-catalogviews/sys-assemblies-transact-sql + - https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-assembly-transactsql + condition: none + rules: + - 'c:sqlcmd -Q "SELECT name, permission_set_desc FROM sys.assemblies WHERE is_user_defined = 1;" -> r:EXTERNAL_ACCESS|UNSAFE' diff --git a/etc/ruleset/sca/applications/cis_sqlserver_2017.yml b/etc/ruleset/sca/applications/cis_sqlserver_2017.yml new file mode 100644 index 0000000000..5a140f403f --- /dev/null +++ b/etc/ruleset/sca/applications/cis_sqlserver_2017.yml @@ -0,0 +1,454 @@ +# Security Configuration Assessment +# CIS Microsoft SQL Server 2017 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on Center for Internet Security Benchmark for Microsoft SQL Server 2017 v1.1.0 - 06-30-2020 + +policy: + id: "cis_sqlserver_2017" + file: "cis_sqlserver_2017.yml" + name: "CIS Microsoft SQL Server 2017 Benchmark v1.1.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft SQL Server 2017." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform has Microsoft SQL Server 2017" + description: "Requirements for running the CIS Microsoft SQL Server 2017 Benchmark" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows' + +checks: + ###################################################### + # 2 Surface Area Reduction + ###################################################### + # 2.1 Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0' (Scored) + - id: 12500 + title: "Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0'" + description: "Enabling Ad Hoc Distributed Queries allows users to query data and execute statements on external data sources. This functionality should be disabled." + rationale: "This feature can be used to remotely access and exploit vulnerabilities on remote SQL Server instances and to run unsafe Visual Basic for Application functions." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ad Hoc Distributed Queries', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ad-hoc-distributed-queries-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ad Hoc Distributed Queries' ;\" -> r:Ad Hoc Distributed Queries\\s+0\\s+0" + + # 2.2 Ensure 'CLR Enabled' Server Configuration Option is set to '0' (Scored) + - id: 12501 + title: "Ensure 'CLR Enabled' Server Configuration Option is set to '0'" + description: "The clr enabled option specifies whether user assemblies can be run by SQL Server." + rationale: "Enabling use of CLR assemblies widens the attack surface of SQL Server and puts it at risk from both inadvertent and malicious assemblies." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'clr enabled', 0; RECONFIGURE;" + compliance: + - cis: ["2.2"] + - cis_csc: ["18.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + references: + - "https://docs.microsoft.com/en-us/sql/t-sql/statements/create-assembly-transact-sql" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'clr enabled';\" -> r:0\\s+0" + + # 2.3 Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0' + - id: 12502 + title: "Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0'" + description: "The cross db ownership chaining option controls cross-database ownership chaining across all databases at the instance (or server) level." + rationale: "When enabled, this option allows a member of the db_owner role in a database to gain access to objects owned by a login in any other database, causing an unnecessary information disclosure. When required, cross-database ownership chaining should only be enabled for the specific databases requiring it instead of at the instance level for all databases by using the ALTER DATABASE SET DB_CHAINING ON command. This database option may not be changed on the master , model , or tempdb system databases." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'cross db ownership chaining', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.3"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/cross-db-ownership-chaining-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'cross db ownership chaining';\" -> r:0\\s+0" + + # 2.4 Ensure 'Database Mail XPs' Server Configuration Option is set to '0' + - id: 12503 + title: "Ensure 'Database Mail XPs' Server Configuration Option is set to '0'" + description: "The Database Mail XPs option controls the ability to generate and transmit email messages from SQL Server." + rationale: "Disabling the Database Mail XPs option reduces the SQL Server surface, eliminates a DOS attack vector and channel to exfiltrate data from the database server to a remote host." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Database Mail XPs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.4"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/database-mail/database-mail" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Database Mail XPs';\" -> r:0\\s+0" + + # 2.5 Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0' + - id: 12504 + title: "Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0'" + description: "The Ole Automation Procedures option controls whether OLE Automation objects can be instantiated within Transact-SQL batches. These are extended stored procedures that allow SQL Server users to execute functions external to SQL Server." + rationale: "Enabling this option will increase the attack surface of SQL Server and allow users to execute functions in the security context of SQL Server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ole Automation Procedures', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.5"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ole-automation-procedures-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ole Automation Procedures';\" -> r:0\\s+0" + + # 2.6 Ensure 'Remote Access' Server Configuration Option is set to '0' + - id: 12505 + title: "Ensure 'Remote Access' Server Configuration Option is set to '0'" + description: "The remote access option controls the execution of local stored procedures on remote servers or remote stored procedures on local server." + rationale: "Functionality can be abused to launch a Denial-of-Service (DoS) attack on remote servers by off-loading query processing to a target." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'remote access', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-remote-access-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote access';\" -> r:0\\s+0" + + # 2.7 Ensure 'Remote Admin Connections' Server Configuration Option is set to '0' (Scored) + - id: 12506 + title: "Ensure 'Remote Admin Connections' Server Configuration Option is set to '0'" + description: "The remote admin connections option controls whether a client application on a remote computer can use the Dedicated Administrator Connection (DAC)." + rationale: 'The Dedicated Administrator Connection (DAC) lets an administrator access a running server to execute diagnostic functions or Transact-SQL statements, or to troubleshoot problems on the server, even when the server is locked or running in an abnormal state and not responding to a SQL Server Database Engine connection. In a cluster scenario, the administrator may not actually be logged on to the same node that is currently hosting the SQL Server instance and thus is considered "remote". Therefore, this setting should usually be enabled ( 1 ) for SQL Server failover clusters; otherwise it should be disabled ( 0 ) which is the default.' + remediation: "Run the following T-SQL command on non-clustered installations: EXECUTE sp_configure 'remote admin connections', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/remote-admin-connections-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"USE master; SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote admin connections' AND SERVERPROPERTY('IsClustered') = 0;\" -> r:0\\s*\\t*0|0 rows affected" + + # 2.8 Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0' (Scored) + - id: 12507 + title: "Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0'" + description: "The scan for startup procs option, if enabled, causes SQL Server to scan for and automatically run all stored procedures that are set to execute upon service startup." + rationale: "Enforcing this control reduces the threat of an entity leveraging these facilities for malicious purposes." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'scan for startup procs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.8"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-scan-for-startup-procs-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'scan for startup procs';\" -> r:0\\s+0" + + # 2.9 Ensure 'Trustworthy' Database Property is set to 'Off' (Scored) + - id: 12508 + title: "Ensure 'Trustworthy' Database Property is set to 'Off'" + description: "The TRUSTWORTHY database option allows database objects to access objects in other databases under certain circumstances." + rationale: "Provides protection from malicious CLR assemblies or extended procedures." + remediation: "Execute the following T-SQL statement against the databases (replace below) returned by the Audit Procedure: ALTER DATABASE [] SET TRUSTWORTHY OFF;" + compliance: + - cis: ["2.9"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/trustworthy-database-property" + - "https://support.microsoft.com/it-it/help/2183687/guidelines-for-using-the-trustworthy-database-setting-in-sql-server" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name FROM sys.databases WHERE is_trustworthy_on = 1 AND name != ''msdb'';" -> r:0 rows affected' + + # 2.11 Ensure SQL Server is configured to use non-standard ports (Not Scored) + - id: 12509 + title: "Ensure SQL Server is configured to use non-standard ports" + description: "If installed, a default SQL Server instance will be assigned a default port of TCP:1433 for TCP/IP communication. Administrators can also configure named instances to use TCP:1433 for communication TCP:1433 is a widely known SQL Server port and this port assignment should be changed. In a multi-instance scenario, each instance must be assigned its own dedicated TCP/IP port." + rationale: "Using a non-default port helps protect the database from attacks directed to the default port." + remediation: "1: In SQL Server Configuration Manager, in the console pane, expand SQL Server Network Configuration, expand Protocols for , and then double-click the TCP/IP protocol. 2: In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear in the format IP1 , IP2 , up to IPAll . One of these is for the IP address of the loopback adapter, 127.0.0.1 . Additional IP addresses appear for each IP Address on the computer. 3: Under IPALL, change the TCP Port field from 1433 to a non-standard port or leave the TCP Port field empty and set the TCP Dynamic Ports value to 0 to enable dynamic port assignment and then click OK. 4: In the console pane, click SQL Server Services. 5: In the details pane, right-click SQL Server () and then click Restart, to stop and restart SQL Server." + compliance: + - cis: ["2.11"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-a-server-to-listen-on-a-specific-tcp-port" + condition: none + rules: + - "c:sqlcmd -Q \"DECLARE @value nvarchar(256); EXECUTE master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQLServer\\SuperSocketNetLib\\Tcp\\IPAll', N'TcpPort', @value OUTPUT, N'no_output'; SELECT @value AS TCP_Port WHERE @value = '1433'; \" -> r:1433" + + # 2.13 Ensure the 'sa' Login Account is set to 'Disabled' (Scored) + - id: 12510 + title: "Ensure the 'sa' Login Account is set to 'Disabled'" + description: "The sa account is a widely known and often widely used SQL Server account with sysadmin privileges. This is the original login created during installation and always has the principal_id=1 and sid=0x01 ." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal." + remediation: "Execute the following T-SQL query: USE [master] GO DECLARE @tsql nvarchar(max) SET @tsql = 'ALTER LOGIN ' + SUSER_NAME(0x01) + ' DISABLE' EXEC (@tsql) GO" + compliance: + - cis: ["2.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-server-principals-transact-sql" + - "https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-login-transact-sql" + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, is_disabled FROM sys.server_principals WHERE sid = 0x01 AND is_disabled = 0;" -> r:0 rows affected' + + # 2.14 Ensure the 'sa' Login Account has been renamed (Scored) + - id: 12511 + title: "Ensure the 'sa' Login Account has been renamed" + description: "The sa account is a widely known and often widely used SQL Server login with sysadmin privileges. The sa login is the original login created during installation and always has principal_id=1 and sid=0x01 ." + rationale: "It is more difficult to launch password-guessing and brute-force attacks against the sa login if the name is not known." + remediation: "Replace the value within the below syntax and execute to rename the sa login. ALTER LOGIN sa WITH NAME = ;" + compliance: + - cis: ["2.14"] + - cis_csc: ["5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode" + condition: none + rules: + - 'c:sqlcmd -Q "SELECT name FROM sys.server_principals WHERE sid = 0x01;" -> r:sa' + + # 2.15 Ensure 'xp_cmdshell' Server Configuration Option is set to '0' + - id: 12512 + title: "Ensure 'xp_cmdshell' Server Configuration Option is set to '0'" + description: "The xp_cmdshell option controls whether the xp_cmdshell extended stored procedure can be used by an authenticated SQL Server user to execute operating-system command shell commands and return results as rows within the SQL client." + rationale: "The xp_cmdshell procedure is commonly used by attackers to read or write data to/from the underlying Operating System of a database server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'xp_cmdshell', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.15"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/xp-cmdshell-transact-sql" + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/xp-cmdshell-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'xp_cmdshell';\" -> r:0\\s+0" + + # 2.16 Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases + - id: 12513 + title: "Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases" + description: "AUTO_CLOSE determines if a given database is closed or not after a connection terminates. If enabled, subsequent connections to the given database will require the database to be reopened and relevant procedure caches to be rebuilt." + rationale: "Because authentication of users for contained databases occurs within the database not at the server\\instance level, the database must be opened every time to authenticate a user. The frequent opening/closing of the database consumes additional server resources and may contribute to a denial of service." + remediation: "Execute the following T-SQL, replacing with each database name found by the Audit Procedure: ALTER DATABASE SET AUTO_CLOSE OFF;" + compliance: + - cis: ["2.16"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/databases/security-best-practices-with-contained-databases" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, containment, containment_desc, is_auto_close_on FROM sys.databases WHERE containment <> 0 and is_auto_close_on = 1;" -> r:0 rows affected' + + # 2.17 Ensure no login exists with the name 'sa' (Scored) + - id: 12514 + title: "Ensure no login exists with the name 'sa'" + description: "The sa login (e.g. principal) is a widely known and often widely used SQL Server account. Therefore, there should not be a login called sa even when the original sa login ( principal_id = 1 ) has been renamed." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal name." + remediation: "Execute the appropriate ALTER or DROP statement below based on the principal_id returned for the login named sa . Replace the value within the below syntax and execute to rename the sa login. USE [master] GO -- If principal_id = 1 or the login owns database objects, rename the sa login ALTER LOGIN [sa] WITH NAME = ; GO -- If the login owns no database objects, then drop it -- Do NOT drop the login if it is principal_id = 1 DROP LOGIN sa" + compliance: + - cis: ["2.17"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sqlcmd -Q "SELECT principal_id, name FROM sys.server_principals WHERE name = ''sa'';" -> r:0 rows affected' + + ########################################################### + # 3 Authentication and Authorization + ########################################################### + # 3.1 Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode' (Scored) + - id: 12515 + title: "Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode'" + description: "Uses Windows Authentication to validate attempted connections." + rationale: "Windows provides a more robust authentication mechanism than SQL Server authentication." + remediation: "Perform either the GUI or T-SQL method shown: GUI Method: 1. Open SQL Server Management Studio. 2. Open the Object Explorer tab and connect to the target database instance. 3. Right click the instance name and select Properties. 4. Select the Security page from the left menu. 5. Set the Server authentication setting to Windows Authentication Mode. or T-SQL Method: Run the following T-SQL in a Query Window: USE [master] GO EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'LoginMode', REG_DWORD, 1 GO Restart the SQL Server service for the change to take effect." + compliance: + - cis: ["3.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/server-properties-security-page" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT SERVERPROPERTY(''IsIntegratedSecurityOnly'') as [login_mode];" -> r:^1' + + # 3.8 Ensure only the default permissions specified by Microsoft are granted to the public server role (Scored) + - id: 12516 + title: "Ensure only the default permissions specified by Microsoft are granted to the public server role" + description: "public is a special fixed server role containing all logins. Unlike other fixed server roles, permissions can be changed for the public role. In keeping with the principle of least privileges, the public server role should not be used to grant permissions at the server scope as these would be inherited by all users." + rationale: "Every SQL Server login belongs to the public role and cannot be removed from this role. Therefore, any permissions granted to this role will be available to all logins unless they have been explicitly denied to specific logins or user-defined server roles." + remediation: "Add the extraneous permissions found in the Audit query results to the specific logins to user-defined server roles which require the access. Revoke the __ from the public role as shown below USE [master] GO REVOKE FROM public; GO" + compliance: + - cis: ["3.8"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles" + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles#permissions-of-fixed-server-roles" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT * FROM master.sys.server_permissions WHERE (grantee_principal_id = SUSER_SID(N''public'') and state_desc LIKE ''GRANT%'') AND NOT (state_desc = ''GRANT'' and [permission_name] = ''VIEW ANY DATABASE'' and class_desc = ''SERVER'') AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 2) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 3) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 4) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 5); " -> r:0 rows affected' + + # 3.10 Ensure Windows local groups are not SQL Logins (Scored) + - id: 12517 + title: "Ensure Windows local groups are not SQL Logins" + description: "Local Windows groups should not be used as logins for SQL Server instances." + rationale: "Allowing local Windows groups as SQL Logins provides a loophole whereby anyone with OS level administrator rights (and no SQL Server rights) could add users to the local Windows groups and thereby give themselves or others access to the SQL Server instance." + remediation: "1. For each LocalGroupName login, if needed create an equivalent AD group containing only the required user accounts. 2. Add the AD group or individual Windows accounts as a SQL Server login and grant it the permissions required. 3. Drop the LocalGroupName login using the syntax below after replacing . USE [master] GO DROP LOGIN [] GO" + compliance: + - cis: ["3.10"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + condition: all + rules: + - 'c:sqlcmd -Q "USE [master] SELECT pr.[name] AS LocalGroupName, pe.[permission_name], pe.[state_desc] FROM sys.server_principals pr JOIN sys.server_permissions pe ON pr.[principal_id] = pe.[grantee_principal_id] WHERE pr.[type_desc] = ''WINDOWS_GROUP'' AND pr.[name] like CAST(SERVERPROPERTY(''MachineName'') AS nvarchar) + ''%'';" -> r:0 rows affected' + + ########################################################### + # 4 Password Policies + ########################################################### + # 4.2 Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role (Scored) + - id: 12518 + title: "Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role" + description: "Applies the same password expiration policy used in Windows to passwords used inside SQL Server." + rationale: "Ensuring SQL logins comply with the secure password policy applied by the Windows Server Benchmark will ensure the passwords for SQL logins with sysadmin privileges are changed on a frequent basis to help prevent compromise via a brute force attack. CONTROL SERVER is an equivalent permission to sysadmin and logins with that permission should also be required to have expiring passwords." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_EXPIRATION = ON;" + compliance: + - cis: ["4.2"] + - cis_csc: ["16.2, 16.10"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/password-policy" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT l.[name], ''sysadmin membership'' AS ''Access_Method'' FROM sys.sql_logins AS l WHERE IS_SRVROLEMEMBER(''sysadmin'',name) = 1 AND l.is_expiration_checked <> 1 UNION ALL SELECT l.[name], ''CONTROL SERVER'' AS ''Access_Method'' FROM sys.sql_logins AS l JOIN sys.server_permissions AS p ON l.principal_id = p.grantee_principal_id WHERE p.type = ''CL'' AND p.state IN (''G'', ''W'') AND l.is_expiration_checked <> 1;" -> r:0 rows affected' + + # 4.3 Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins (Scored) + - id: 12519 + title: "Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins" + description: "Applies the same password complexity policy used in Windows to passwords used insideSQL Server." + rationale: "Ensure SQL authenticated login passwords comply with the secure password policy applied by the Windows Server Benchmark so that they cannot be easily compromised via brute force attack." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_POLICY = ON; Note: In the case of AWS RDS do not perform this remediation for the Master account." + compliance: + - cis: ["4.3"] + - cis_csc: ["16, 4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/password-policy" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, is_disabled FROM sys.sql_logins WHERE is_policy_checked = 0;" -> r:0 rows affected' + + ########################################################## + # 5 Auditing and Logging + ########################################################## + # 5.1 Ensure 'Maximum number of error log files' is set to greater than or equal to '12' + - id: 12520 + title: "Ensure 'Maximum number of error log files' is set to greater than or equal to '12'" + description: "SQL Server error log files must be protected from loss. The log files must be backed up before they are overwritten. Retaining more error logs helps prevent loss from frequent recycling before backups can occur." + rationale: "The SQL Server error log contains important information about major server events and login attempt information as well." + remediation: "Adjust the number of logs to prevent data loss. The default value of 6 may be insufficient for a production environment. Perform either the GUI or T-SQL method shown: GUI Method 1. Open SQL Server Management Studio. 2. Open Object Explorer and connect to the target instance. 3. Navigate to the Management tab in Object Explorer and expand. Right click on the SQL Server Logs file and select Configure 4. Check the Limit the number of error log files before they are recycled 5. Set the Maximum number of error log files to greater than or equal to 12 T-SQL Method Run the following T-SQL to change the number of error log files, replace with your desired number of error log files: EXEC master.sys.xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', REG_DWORD, ;" + compliance: + - cis: ["5.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/scm-services-configure-sql-server-error-logs" + condition: all + rules: + - "c:sqlcmd -Q \"DECLARE @NumErrorLogs int; EXEC master.sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', @NumErrorLogs OUTPUT; SELECT ISNULL(@NumErrorLogs, -1) AS [NumberOfLogFiles];\" -> n:^\\s*(\\d+) compare >= 12" + + # 5.2 Ensure 'Default Trace Enabled' Server Configuration Option is set to '1' (Scored) + - id: 12521 + title: "Ensure 'Default Trace Enabled' Server Configuration Option is set to '1'" + description: "The default trace provides audit logging of database activity including account creations, privilege elevation and execution of DBCC commands." + rationale: "Default trace provides valuable audit information regarding security-related activities on the server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'default trace enabled', 1; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["5.2"] + - cis_csc: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/default-trace-enabled-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'default trace enabled';\" -> r:1\\s+1" + + ########################################################### + # 6 Application Development + ########################################################### + # 6.2 Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies (Scored) + - id: 12522 + title: "Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies" + description: "Setting CLR Assembly Permission Sets to SAFE_ACCESS will prevent assemblies from accessing external system resources such as files, the network, environment variables, or the registry." + rationale: "Assemblies with EXTERNAL_ACCESS or UNSAFE permission sets can be used to access sensitive areas of the operating system, steal and/or transmit data and alter the state and other protection measures of the underlying Windows Operating System. Assemblies which are Microsoft-created ( is_user_defined = 0 ) are excluded from this check as they are required for overall system functionality." + remediation: "ALTER ASSEMBLY WITH PERMISSION_SET = SAFE;" + compliance: + - cis: ["6.2"] + - cis_csc: ["18"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration/security/clr-integration-code-access-security" + - "https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-assemblies-transact-sql" + - "https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-assembly-transact-sql" + condition: none + rules: + - 'c:sqlcmd -Q "SELECT name, permission_set_desc FROM sys.assemblies WHERE is_user_defined = 1;" -> r:EXTERNAL_ACCESS|UNSAFE' diff --git a/etc/ruleset/sca/applications/cis_sqlserver_2019.yml b/etc/ruleset/sca/applications/cis_sqlserver_2019.yml new file mode 100644 index 0000000000..4f1bc603ee --- /dev/null +++ b/etc/ruleset/sca/applications/cis_sqlserver_2019.yml @@ -0,0 +1,438 @@ +# Security Configuration Assessment +# CIS Microsoft SQL Server 2019 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on Center for Internet Security Benchmark for Microsoft SQL Server 2019 v1.1.0 - 05-31-2019 + +policy: + id: "cis_sqlserver_2019" + file: "cis_sqlserver_2019" + name: "CIS Microsoft SQL Server 2019 Benchmark v1.1.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft SQL Server 2019." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform has Microsoft SQL Server 2019" + description: "Requirements for running the CIS Microsoft SQL Server 2019 Benchmark" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows' + +variables: + $User: + +checks: + ###################################################### + # 2 Surface Area Reduction + ###################################################### + # 2.1 Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0' (Scored) + - id: 13500 + title: "Ensure 'Ad Hoc Distributed Queries' Server Configuration Option is set to '0'" + description: "Enabling Ad Hoc Distributed Queries allows users to query data and execute statements on external data sources. This functionality should be disabled." + rationale: "This feature can be used to remotely access and exploit vulnerabilities on remote SQL Server instances and to run unsafe Visual Basic for Application functions." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ad Hoc Distributed Queries', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ad-hoc-distributed-queries-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ad Hoc Distributed Queries' ;\" -> r:Ad Hoc Distributed Queries\\s+0\\s+0" + + # 2.2 Ensure 'CLR Enabled' Server Configuration Option is set to '0' (Scored) + - id: 13501 + title: "Ensure 'CLR Enabled' Server Configuration Option is set to '0'" + description: "The clr enabled option specifies whether user assemblies can be run by SQL Server." + rationale: "Enabling use of CLR assemblies widens the attack surface of SQL Server and puts it at risk from both inadvertent and malicious assemblies." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'clr enabled', 0; RECONFIGURE;" + compliance: + - cis: ["2.2"] + - cis_csc: ["18.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + references: + - "https://docs.microsoft.com/en-us/sql/t-sql/statements/create-assembly-transact-sql" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'clr enabled';\" -> r:0\\s+0" + + # 2.3 Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0' + - id: 13502 + title: "Ensure 'Cross DB Ownership Chaining' Server Configuration Option is set to '0'" + description: "The cross db ownership chaining option controls cross-database ownership chaining across all databases at the instance (or server) level." + rationale: "When enabled, this option allows a member of the db_owner role in a database to gain access to objects owned by a login in any other database, causing an unnecessary information disclosure. When required, cross-database ownership chaining should only be enabled for the specific databases requiring it instead of at the instance level for all databases by using the ALTER DATABASE SET DB_CHAINING ON command. This database option may not be changed on the master , model , or tempdb system databases." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'cross db ownership chaining', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.3"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/cross-db-ownership-chaining-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'cross db ownership chaining';\" -> r:0\\s+0" + + # 2.4 Ensure 'Database Mail XPs' Server Configuration Option is set to '0' + - id: 13503 + title: "Ensure 'Database Mail XPs' Server Configuration Option is set to '0'" + description: "The Database Mail XPs option controls the ability to generate and transmit email messages from SQL Server." + rationale: "Disabling the Database Mail XPs option reduces the SQL Server surface, eliminates a DOS attack vector and channel to exfiltrate data from the database server to a remote host." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Database Mail XPs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.4"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/database-mail/database-mail" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Database Mail XPs';\" -> r:0\\s+0" + + # 2.5 Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0' + - id: 13504 + title: "Ensure 'Ole Automation Procedures' Server Configuration Option is set to '0'" + description: "The Ole Automation Procedures option controls whether OLE Automation objects can be instantiated within Transact-SQL batches. These are extended stored procedures that allow SQL Server users to execute functions external to SQL Server." + rationale: "Enabling this option will increase the attack surface of SQL Server and allow users to execute functions in the security context of SQL Server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'Ole Automation Procedures', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["2.5"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/ole-automation-procedures-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'Ole Automation Procedures';\" -> r:0\\s+0" + + # 2.6 Ensure 'Remote Access' Server Configuration Option is set to '0' + - id: 13505 + title: "Ensure 'Remote Access' Server Configuration Option is set to '0'" + description: "The remote access option controls the execution of local stored procedures on remote servers or remote stored procedures on local server." + rationale: "Functionality can be abused to launch a Denial-of-Service (DoS) attack on remote servers by off-loading query processing to a target." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'remote access', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-remote-access-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote access';\" -> r:0\\s+0" + + # 2.7 Ensure 'Remote Admin Connections' Server Configuration Option is set to '0' (Scored) + - id: 13506 + title: "Ensure 'Remote Admin Connections' Server Configuration Option is set to '0'" + description: "The remote admin connections option controls whether a client application on a remote computer can use the Dedicated Administrator Connection (DAC)." + rationale: 'The Dedicated Administrator Connection (DAC) lets an administrator access a running server to execute diagnostic functions or Transact-SQL statements, or to troubleshoot problems on the server, even when the server is locked or running in an abnormal state and not responding to a SQL Server Database Engine connection. In a cluster scenario, the administrator may not actually be logged on to the same node that is currently hosting the SQL Server instance and thus is considered "remote". Therefore, this setting should usually be enabled ( 1 ) for SQL Server failover clusters; otherwise it should be disabled ( 0 ) which is the default.' + remediation: "Run the following T-SQL command on non-clustered installations: EXECUTE sp_configure 'remote admin connections', 0; RECONFIGURE; GO" + compliance: + - cis: ["2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/remote-admin-connections-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"USE master; SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'remote admin connections' AND SERVERPROPERTY('IsClustered') = 0;\" -> r:0\\s*\\t*0|0 rows affected" + + # 2.8 Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0' (Scored) + - id: 13507 + title: "Ensure 'Scan For Startup Procs' Server Configuration Option is set to '0'" + description: "The scan for startup procs option, if enabled, causes SQL Server to scan for and automatically run all stored procedures that are set to execute upon service startup." + rationale: "Enforcing this control reduces the threat of an entity leveraging these facilities for malicious purposes." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'scan for startup procs', 0; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE; Restart the Database Engine." + compliance: + - cis: ["2.8"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-scan-for-startup-procs-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'scan for startup procs';\" -> r:0\\s+0" + + # 2.9 Ensure 'Trustworthy' Database Property is set to 'Off' (Scored) + - id: 13508 + title: "Ensure 'Trustworthy' Database Property is set to 'Off'" + description: "The TRUSTWORTHY database option allows database objects to access objects in other databases under certain circumstances." + rationale: "Provides protection from malicious CLR assemblies or extended procedures." + remediation: "Execute the following T-SQL statement against the databases (replace below) returned by the Audit Procedure: ALTER DATABASE [] SET TRUSTWORTHY OFF;" + compliance: + - cis: ["2.9"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/trustworthy-database-property" + - "https://support.microsoft.com/it-it/help/2183687/guidelines-for-using-the-trustworthy-database-setting-in-sql-server" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name FROM sys.databases WHERE is_trustworthy_on = 1 AND name != ''msdb'';" -> r:0 rows affected' + + # 2.11 Ensure SQL Server is configured to use non-standard ports (Not Scored) + - id: 13509 + title: "Ensure SQL Server is configured to use non-standard ports" + description: "If installed, the default SQL Server instance will be assigned a default port of TCP:1433 for TCP/IP communication. Administrators can also manually configure named instances to use TCP:1433 for communication. TCP:1433 is a widely known SQL Server port and this port assignment should be changed. In a multi-instance scenario, each instance must be assigned its own TCP/IP port." + rationale: "Using a non-default port helps protect the database from attacks directed to the default port." + remediation: "1: In SQL Server Configuration Manager, in the console pane, expand SQL Server Network Configuration, expand Protocols for , and then double-click the TCP/IP protocol. 2: In the TCP/IP Properties dialog box, on the IP Addresses tab, several IP addresses appear in the format IP1 , IP2 , up to IPAll . One of these is for the IP address of the loopback adapter, 127.0.0.1 . Additional IP addresses appear for each IP Address on the computer. 3: Under IPALL, change the TCP Port field from 1433 to another non-standard port or leave the TCP Port field empty and set the TCP Dynamic Ports value to 0 to enable dynamic port assignment and then click OK. 4: In the console pane, click SQL Server Services. 5: In the details pane, right-click SQL Server () and then click Restart, to stop and restart SQL Server." + compliance: + - cis: ["2.11"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-a-server-to-listen-on-a-specific-tcp-port" + condition: none + rules: + - "c:sqlcmd -Q \"DECLARE @value nvarchar(256); EXECUTE master.dbo.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SOFTWARE\\Microsoft\\Microsoft SQL Server\\MSSQLServer\\SuperSocketNetLib\\Tcp\\IPAll', N'TcpPort', @value OUTPUT, N'no_output'; SELECT @value AS TCP_Port WHERE @value = '1433'; \" -> r:1433" + + # 2.13 Ensure the 'sa' Login Account is set to 'Disabled' (Scored) + - id: 13510 + title: "Ensure the 'sa' Login Account is set to 'Disabled'" + description: "The sa account is a widely known and often widely used SQL Server account with sysadmin privileges. This is the original login created during installation and always has the principal_id=1 and sid=0x01 ." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal." + remediation: "Execute the following T-SQL query: USE [master] GO DECLARE @tsql nvarchar(max) SET @tsql = 'ALTER LOGIN ' + SUSER_NAME(0x01) + ' DISABLE' EXEC (@tsql) GO" + compliance: + - cis: ["2.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-server-principals-transact-sql" + - "https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-login-transact-sql" + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, is_disabled FROM sys.server_principals WHERE sid = 0x01 AND is_disabled = 0;" -> r:0 rows affected' + + # 2.14 Ensure the 'sa' Login Account has been renamed (Scored) + - id: 13511 + title: "Ensure the 'sa' Login Account has been renamed" + description: "The sa account is a widely known and often widely used SQL Server login with sysadmin privileges. The sa login is the original login created during installation and always has principal_id=1 and sid=0x01 ." + rationale: "It is more difficult to launch password-guessing and brute-force attacks against the sa login if the name is not known." + remediation: "Replace the value within the below syntax and execute to rename the sa login. ALTER LOGIN sa WITH NAME = ;" + compliance: + - cis: ["2.14"] + - cis_csc: ["5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/choose-an-authentication-mode" + condition: none + rules: + - 'c:sqlcmd -Q "SELECT name FROM sys.server_principals WHERE sid = 0x01;" -> r:^sa' + + # 2.15 Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases + - id: 13512 + title: "Ensure 'AUTO_CLOSE' is set to 'OFF' on contained databases" + description: "AUTO_CLOSE determines if a given database is closed or not after a connection terminates. If enabled, subsequent connections to the given database will require the database to be reopened and relevant procedure caches to be rebuilt." + rationale: "Because authentication of users for contained databases occurs within the database not at the server\\instance level, the database must be opened every time to authenticate a user. The frequent opening/closing of the database consumes additional server resources and may contribute to a denial of service." + remediation: "Execute the following T-SQL, replacing with each database name found by the Audit Procedure: ALTER DATABASE SET AUTO_CLOSE OFF;" + compliance: + - cis: ["2.15"] + - cis_csc: ["18"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/databases/security-best-practices-with-contained-databases" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, containment, containment_desc, is_auto_close_on FROM sys.databases WHERE containment <> 0 and is_auto_close_on = 1;" -> r:0 rows affected' + + # 2.16 Ensure no login exists with the name 'sa' (Scored) + - id: 13513 + title: "Ensure no login exists with the name 'sa'" + description: "The sa login (e.g. principal) is a widely known and often widely used SQL Server account. Therefore, there should not be a login called sa even when the original sa login ( principal_id = 1 ) has been renamed." + rationale: "Enforcing this control reduces the probability of an attacker executing brute force attacks against a well-known principal name." + remediation: "Execute the appropriate ALTER or DROP statement below based on the principal_id returned for the login named sa . Replace the value within the below syntax and execute to rename the sa login. USE [master] GO -- If principal_id = 1 or the login owns database objects, rename the sa login ALTER LOGIN [sa] WITH NAME = ; GO -- If the login owns no database objects, then drop it -- Do NOT drop the login if it is principal_id = 1 DROP LOGIN sa" + compliance: + - cis: ["2.16"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.6", "CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sqlcmd -Q "SELECT principal_id, name FROM sys.server_principals WHERE name = ''sa'';" -> r:0 rows affected' + + ########################################################### + # 3 Authentication and Authorization + ########################################################### + # 3.1 Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode' (Scored) + - id: 13514 + title: "Ensure 'Server Authentication' Property is set to 'Windows Authentication Mode'" + description: "Uses Windows Authentication to validate attempted connections." + rationale: "Windows provides a more robust authentication mechanism than SQL Server authentication." + remediation: "Perform either the GUI or T-SQL method shown: GUI Method: 1. Open SQL Server Management Studio. 2. Open the Object Explorer tab and connect to the target database instance. 3. Right click the instance name and select Properties. 4. Select the Security page from the left menu. 5. Set the Server authentication setting to Windows Authentication Mode. or T-SQL Method: Run the following T-SQL in a Query Window: USE [master] GO EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'LoginMode', REG_DWORD, 1 GO Restart the SQL Server service for the change to take effect." + compliance: + - cis: ["3.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/server-properties-security-page" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT SERVERPROPERTY(''IsIntegratedSecurityOnly'') as [login_mode];" -> r:^1' + + # 3.8 Ensure only the default permissions specified by Microsoft are granted to the public server role (Scored) + - id: 13515 + title: "Ensure only the default permissions specified by Microsoft are granted to the public server role" + description: "public is a special fixed server role containing all logins. Unlike other fixed server roles, permissions can be changed for the public role. In keeping with the principle of least privileges, the public server role should not be used to grant permissions at the server scope as these would be inherited by all users." + rationale: "Every SQL Server login belongs to the public role and cannot be removed from this role. Therefore, any permissions granted to this role will be available to all logins unless they have been explicitly denied to specific logins or user-defined server roles." + remediation: "Add the extraneous permissions found in the Audit query results to the specific logins to user-defined server roles which require the access. Revoke the from the public role as shown below USE [master] GO REVOKE FROM public; GO" + compliance: + - cis: ["3.8"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles" + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles#permissions-of-fixed-server-roles" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT * FROM master.sys.server_permissions WHERE (grantee_principal_id = SUSER_SID(N''public'') and state_desc LIKE ''GRANT%'') AND NOT (state_desc = ''GRANT'' and [permission_name] = ''VIEW ANY DATABASE'' and class_desc = ''SERVER'') AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 2) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 3) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 4) AND NOT (state_desc = ''GRANT'' and [permission_name] = ''CONNECT'' and class_desc = ''ENDPOINT'' and major_id = 5); " -> r:0 rows affected' + + # 3.10 Ensure Windows local groups are not SQL Logins (Scored) + - id: 13516 + title: "Ensure Windows local groups are not SQL Logins" + description: "Local Windows groups should not be used as logins for SQL Server instances." + rationale: "Allowing local Windows groups as SQL Logins provides a loophole whereby anyone with OS level administrator rights (and no SQL Server rights) could add users to the local Windows groups and thereby give themselves or others access to the SQL Server instance." + remediation: "1. For each LocalGroupName login, if needed create an equivalent AD group containing only the required user accounts. 2. Add the AD group or individual Windows accounts as a SQL Server login and grant it the permissions required. 3. Drop the LocalGroupName login using the syntax below after replacing . USE [master] GO DROP LOGIN [] GO" + compliance: + - cis: ["3.10"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + condition: all + rules: + - 'c:sqlcmd -Q "USE [master] SELECT pr.[name] AS LocalGroupName, pe.[permission_name], pe.[state_desc] FROM sys.server_principals pr JOIN sys.server_permissions pe ON pr.[principal_id] = pe.[grantee_principal_id] WHERE pr.[type_desc] = ''WINDOWS_GROUP'' AND pr.[name] like CAST(SERVERPROPERTY(''MachineName'') AS nvarchar) + ''%'';" -> r:0 rows affected' + + ########################################################### + # 4 Password Policies + ########################################################### + # 4.2 Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role (Scored) + - id: 13517 + title: "Ensure 'CHECK_EXPIRATION' Option is set to 'ON' for All SQL Authenticated Logins Within the Sysadmin Role" + description: "Applies the same password expiration policy used in Windows to passwords used inside SQL Server." + rationale: "Ensuring SQL logins comply with the secure password policy applied by the Windows Server Benchmark will ensure the passwords for SQL logins with sysadmin privileges are changed on a frequent basis to help prevent compromise via a brute force attack. CONTROL SERVER is an equivalent permission to sysadmin and logins with that permission should also be required to have expiring passwords." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_EXPIRATION = ON;" + compliance: + - cis: ["4.2"] + - cis_csc: ["16.2, 16.10"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/password-policy" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT l.[name], ''sysadmin membership'' AS ''Access_Method'' FROM sys.sql_logins AS l WHERE IS_SRVROLEMEMBER(''sysadmin'',name) = 1 AND l.is_expiration_checked <> 1 UNION ALL SELECT l.[name], ''CONTROL SERVER'' AS ''Access_Method'' FROM sys.sql_logins AS l JOIN sys.server_permissions AS p ON l.principal_id = p.grantee_principal_id WHERE p.type = ''CL'' AND p.state IN (''G'', ''W'') AND l.is_expiration_checked <> 1;" -> r:0 rows affected' + + # 4.3 Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins (Scored) + - id: 13518 + title: "Ensure 'CHECK_POLICY' Option is set to 'ON' for All SQL Authenticated Logins" + description: "Applies the same password complexity policy used in Windows to passwords used insideSQL Server." + rationale: "Ensure SQL authenticated login passwords comply with the secure password policy applied by the Windows Server Benchmark so that they cannot be easily compromised via brute force attack." + remediation: "For each found by the Audit Procedure, execute the following T-SQL statement: ALTER LOGIN WITH CHECK_POLICY = ON; Note: In the case of AWS RDS do not perform this remediation for the Master account." + compliance: + - cis: ["4.3"] + - cis_csc: ["16, 4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/security/password-policy" + condition: all + rules: + - 'c:sqlcmd -Q "SELECT name, is_disabled FROM sys.sql_logins WHERE is_policy_checked = 0;" -> r:0 rows affected' + + ########################################################## + # 5 Auditing and Logging + ########################################################## + # 5.1 Ensure 'Maximum number of error log files' is set to greater than or equal to '12' + - id: 13519 + title: "Ensure 'Maximum number of error log files' is set to greater than or equal to '12'" + description: "SQL Server error log files must be protected from loss. The log files must be backed up before they are overwritten. Retaining more error logs helps prevent loss from frequent recycling before backups can occur." + rationale: "The SQL Server error log contains important information about major server events and login attempt information as well." + remediation: "Adjust the number of logs to prevent data loss. The default value of 6 may be insufficient for a production environment. Perform either the GUI or T-SQL method shown: GUI Method: 1. Open SQL Server Management Studio. 2. Open Object Explorer and connect to the target instance. 3. Navigate to the Management tab in Object Explorer and expand. Right click on the SQL Server Logs file and select Configure 4. Check the Limit the number of error log files before they are recycled 5. Set the Maximum number of error log files to greater than or equal to 12. T-SQL Method: Run the following T-SQL to change the number of error log files, replace with your desired number of error log files: EXEC master.sys.xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', REG_DWORD, ;" + compliance: + - cis: ["5.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - "http://msdn.microsoft.com/en-us/library/ms177285(v=sql.120).aspx" + condition: all + rules: + - "c:sqlcmd -Q \"DECLARE @NumErrorLogs int; EXEC master.sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'Software\\Microsoft\\MSSQLServer\\MSSQLServer', N'NumErrorLogs', @NumErrorLogs OUTPUT; SELECT ISNULL(@NumErrorLogs, -1) AS [NumberOfLogFiles];\" -> n:^\\s*(\\d+) compare >= 12" + + # 5.2 Ensure 'Default Trace Enabled' Server Configuration Option is set to '1' (Scored) + - id: 13520 + title: "Ensure 'Default Trace Enabled' Server Configuration Option is set to '1'" + description: "The default trace provides audit logging of database activity including account creations, privilege elevation and execution of DBCC commands." + rationale: "Default trace provides valuable audit information regarding security-related activities on the server." + remediation: "Run the following T-SQL command: EXECUTE sp_configure 'show advanced options', 1; RECONFIGURE; EXECUTE sp_configure 'default trace enabled', 1; RECONFIGURE; GO EXECUTE sp_configure 'show advanced options', 0; RECONFIGURE;" + compliance: + - cis: ["5.2"] + - cis_csc: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + references: + - "https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/default-trace-enabled-server-configuration-option" + condition: all + rules: + - "c:sqlcmd -Q \"SELECT name, CAST(value as int) as value_configured, CAST(value_in_use as int) as value_in_use FROM sys.configurations WHERE name = 'default trace enabled';\" -> r:1\\s+1" + + ########################################################### + # 6 Application Development + ########################################################### + # 6.2 Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies (Scored) + - id: 13521 + title: "Ensure 'CLR Assembly Permission Set' is set to 'SAFE_ACCESS' for All CLR Assemblies" + description: "Setting CLR Assembly Permission Sets to SAFE_ACCESS will prevent assemblies from accessing external system resources such as files, the network, environment variables, or the registry." + rationale: "Assemblies with EXTERNAL_ACCESS or UNSAFE permission sets can be used to access sensitive areas of the operating system, steal and/or transmit data and alter the state and other protection measures of the underlying Windows Operating System. Assemblies which are Microsoft-created ( is_user_defined = 0 ) are excluded from this check as they are required for overall system functionality." + remediation: "ALTER ASSEMBLY WITH PERMISSION_SET = SAFE;" + compliance: + - cis: ["6.2"] + - cis_csc: ["18"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: + - "https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration/security/clr-integration-code-access-security" + - "https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-assemblies-transact-sql" + - "https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-assembly-transact-sql" + condition: none + rules: + - 'c:sqlcmd -Q "SELECT name, permission_set_desc FROM sys.assemblies WHERE is_user_defined = 1;" -> r:EXTERNAL_ACCESS|UNSAFE' diff --git a/etc/ruleset/sca/applications/web_vulnerabilities.yml b/etc/ruleset/sca/applications/web_vulnerabilities.yml new file mode 100644 index 0000000000..66e4a75d9d --- /dev/null +++ b/etc/ruleset/sca/applications/web_vulnerabilities.yml @@ -0,0 +1,182 @@ +# Security Configuration Assessment +# Checks for web-related vulnerabilities on Linux systems +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation + +policy: + id: "web_vulnerabilities" + file: "web_vulnerabilities.yml" + name: "System audit for web-related vulnerabilities" + description: "Guidance for establishing a secure configuration for web-related vulnerabilities." + +requirements: + title: Check if web-server files are present + description: "Requirements for running the SCA scan against the web-vulnerability policy." + condition: any + rules: + - "f:$php.ini" + - "d:$web_dirs" + +# In case your configuration files are not located on these paths, set the variables to match your php.ini file and your web directory +# Other possible default locations for php.ini: /var/www/conf/php.ini,/etc/php5/apache2/php.ini +# Other possible default locations for web directory: /var/htdocs,/home/httpd,/usr/local/apache,/usr/local/apache2,/usr/local/www +variables: + $php.ini: /etc/php.ini + $web_dirs: /var/www + +# PHP checks +checks: + - id: 14000 + title: "PHP - Ensure 'Register globals' are not enabled" + condition: all + rules: + - 'f:$php.ini -> r:^register_globals\s*\t*=\s*\t*Off|register_globals\s*\t*=\s*\t*off' + + - id: 14001 + title: "PHP - Ensure 'Expose PHP' is not enabled" + condition: all + rules: + - 'f:$php.ini -> r:^expose_php\s*\t*=\s*\t*Off|^expose_php\s*\t*=\s*\t*off' + + - id: 14002 + title: "PHP - Ensure 'Allow URL fopen' is not enabled" + condition: all + rules: + - 'f:$php.ini -> r:^allow_url_fopen\s*\t*=\s*\t*Off|^allow_url_fopen\s*\t*=\s*\t*off' + + - id: 14003 + title: "PHP - Ensure 'Displaying of errors' is not enabled" + condition: all + rules: + - 'f:$php.ini -> r:^display_errors\s*\t*=\s*\t*Off|^display_errors\s*\t*=\s*\t*off' + + # WEB checks + - id: 14004 + title: "Web exploits: '.yop' is an uncommon file name inside htdocs - Possible compromise" + compliance: + - pci_dss: ["6.5", "6.6", "11.4"] + - nist_800_53: ["SA.11", "SC.5", "SI.3", "SI.4"] + - tsc: ["CC6.6", "CC7.1", "CC8.1", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - "d:$web_dirs -> ^.yop$" + + - id: 14005 + title: "Web exploits: 'id' is an uncommon file name inside htdocs - Possible compromise" + compliance: + - pci_dss: ["6.5", "6.6", "11.4"] + - nist_800_53: ["SA.11", "SC.5", "SI.3", "SI.4"] + - tsc: ["CC6.6", "CC7.1", "CC8.1", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - "d:$web_dirs -> ^id$" + + - id: 14006 + title: "Web exploits: '.ssh' is an uncommon file name inside htdocs" + compliance: + - pci_dss: ["6.5", "6.6", "11.4"] + - nist_800_53: ["SA.11", "SC.5", "SI.3", "SI.4"] + - tsc: ["CC6.6", "CC7.1", "CC8.1", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - "d:$web_dirs -> ^.ssh$" + + - id: 14007 + title: "Web exploits: '...' is an uncommon file name inside htdocs - Possible compromise" + compliance: + - pci_dss: ["6.5", "6.6", "11.4"] + - nist_800_53: ["SA.11", "SC.5", "SI.3", "SI.4"] + - tsc: ["CC6.6", "CC7.1", "CC8.1", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - "d:$web_dirs -> ^...$" + + - id: 14008 + title: "Web exploits: '.shell' is an uncommon file name inside htdocs - Possible compromise" + compliance: + - pci_dss: ["6.5", "6.6", "11.4"] + - nist_800_53: ["SA.11", "SC.5", "SI.3", "SI.4"] + - tsc: ["CC6.6", "CC7.1", "CC8.1", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - "d:$web_dirs -> ^.shell$" + + # Outdated Web applications + - id: 14009 + title: "Web vulnerability - Outdated WordPress installation" + compliance: + - pci_dss: ["6.5", "6.6", "11.4"] + - nist_800_53: ["SA.11", "SC.5", "SI.3", "SI.4"] + - tsc: ["CC6.6", "CC7.1", "CC8.1", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'd:$web_dirs -> ^version.php$ -> r:^\.wp_version && r:4.4.2' + + - id: 14010 + title: "Web vulnerability - Outdated Joomla installation" + compliance: + - pci_dss: ["6.5", "6.6", "11.4"] + - nist_800_53: ["SA.11", "SC.5", "SI.3", "SI.4"] + - tsc: ["CC6.6", "CC7.1", "CC8.1", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'd:$web_dirs -> ^version.php$ -> r:var \.RELEASE && r:3.4.8' + + - id: 14011 + title: "Web vulnerability - Outdated osCommerce (v2.2) installation" + compliance: + - pci_dss: ["6.5", "6.6", "11.4"] + - nist_800_53: ["SA.11", "SC.5", "SI.3", "SI.4"] + - tsc: ["CC6.6", "CC7.1", "CC8.1", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - "d:$web_dirs -> ^application_top.php$ -> r:osCommerce && r:2.2-" + + # Known backdoors + - id: 14012 + title: "Web vulnerability - Backdoors / Web based malware found - eval(base64_decode)" + compliance: + - pci_dss: ["6.5", "6.6", "11.4"] + - nist_800_53: ["SA.11", "SC.5", "SI.3", "SI.4"] + - tsc: ["CC6.6", "CC7.1", "CC8.1", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'd:$web_dirs -> .php$ -> r:eval\(base64_decode\(\paWYo' + + - id: 14013 + title: "Web vulnerability - Backdoors / Web based malware found - eval(base64_decode(POST))" + compliance: + - pci_dss: ["6.5", "6.6", "11.4"] + - nist_800_53: ["SA.11", "SC.5", "SI.3", "SI.4"] + - tsc: ["CC6.6", "CC7.1", "CC8.1", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'd:$web_dirs -> .php$ -> r:eval\(base64_decode\(\S_POST' + + - id: 14014 + title: "Web vulnerability - .htaccess file compromised" + compliance: + - pci_dss: ["6.5", "6.6", "11.4"] + - nist_800_53: ["SA.11", "SC.5", "SI.3", "SI.4"] + - tsc: ["CC6.6", "CC7.1", "CC8.1", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: + - https://blog.sucuri.net/2011/05/understanding-htaccess-attacks-part-1.html + condition: none + rules: + - 'd:$web_dirs -> ^.htaccess$ -> r:RewriteCond\s+\S+HTTP_REFERERS\s+\S+google' + + - id: 14015 + title: "Web vulnerability - .htaccess file compromised - auto append" + compliance: + - pci_dss: ["6.5", "6.6", "11.4"] + - nist_800_53: ["SA.11", "SC.5", "SI.3", "SI.4"] + - tsc: ["CC6.6", "CC7.1", "CC8.1", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: + - https://blog.sucuri.net/2011/05/understanding-htaccess-attacks-part-1.html + condition: none + rules: + - 'd:$web_dirs -> ^.htaccess$ -> r:^php_value\s*auto_append_file' diff --git a/etc/ruleset/sca/centos/6/cis_centos6_linux.yml b/etc/ruleset/sca/centos/6/cis_centos6_linux.yml new file mode 100644 index 0000000000..809ed8d363 --- /dev/null +++ b/etc/ruleset/sca/centos/6/cis_centos6_linux.yml @@ -0,0 +1,3224 @@ +# Security Configuration Assessment +# CIS Checks for CentOS 6 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for CentOS 6 v2.0.2 - 06-02-2016 + +policy: + id: "cis_centos6_linux" + file: "cis_centos6_linux.yml" + name: "CIS CentOS Linux 6 Benchmark v2.0.2" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for CentOS 6 systems running on x86 and x64 platforms. This document was tested against CentOS 6." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check CentOS 6 version" + description: "Requirements for running the policy against CentOS 6." + condition: any + rules: + - "f:/etc/redhat-release -> r:^CentOS && r:release 6" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # 1.1.1.1 cramfs: filesystem + - id: 5500 + title: "Ensure mounting of cramfs filesystems is disabled" + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install cramfs /bin/true. Run the following command to unload the cramfs module: rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:install /bin/true|Module cramfs not found" + - "not c:lsmod -> r:cramfs" + + # 1.1.1.2 freevxfs: filesystem + - id: 5501 + title: "Ensure mounting of freevxfs filesystems is disabled" + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install freevxfs /bin/true. Run the following command to unload the freevxfs module: rmmod freevxfs" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v freevxfs -> r:install /bin/true|Module freevxfs not found" + - "not c:lsmod -> r:freevxfs" + + # 1.1.1.3 jffs2: filesystem + - id: 5502 + title: "Ensure mounting of jffs2 filesystems is disabled" + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install jffs2 /bin/true. Run the following command to unload the jffs2 module: rmmod jffs2" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v jffs2 -> r:install /bin/true|Module jffs2 not found" + - "not c:lsmod -> r:jffs2" + + # 1.1.1.4 hfs: filesystem + - id: 5503 + title: "Ensure mounting of hfs filesystems is disabled" + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfs /bin/true. Run the following command to unload the hfs module: rmmod hfs" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v hfs -> r:install /bin/true|Module hfs not found" + - "not c:lsmod -> r:hfs" + # 1.1.1.5 hfsplus: filesystem + - id: 5504 + title: "Ensure mounting of hfsplus filesystems is disabled" + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfsplus /bin/true. Run the following command to unload the hfsplus module: rmmod hfsplus" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v hfsplus -> r:install /bin/true|Module hfsplus not found" + - "not c:lsmod -> r:hfsplus" + # 1.1.1.6 squashfs: filesystem + - id: 5505 + title: "Ensure mounting of squashfs filesystems is disabled" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install squashfs /bin/true. Run the following command to unload the squashfs module: rmmod squashfs" + compliance: + - cis: ["1.1.1.6"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + + # 1.1.1.7 udfs: filesystem + - id: 5506 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install udf /bin/true. Run the following command to unload the udf module: rmmod udf" + compliance: + - cis: ["1.1.1.7"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v udf -> r:install /bin/true|Module udf not found" + - "not c:lsmod -> r:udf" + + # 1.1.1.8 FAT: filesystem + - id: 5507 + title: "Ensure mounting of FAT filesystems is disabled" + description: "The FAT filesystem format is primarily used on older windows systems and portable USB drives or flash modules. It comes in three types FAT12 , FAT16 , and FAT32 all of which are supported by the vfat kernel module." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install vfat /bin/true. Run the following command to unload the vfat module: rmmod vfat" + compliance: + - cis: ["1.1.1.8"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v vfat -> r:install /bin/true|Module vfat not found" + - "not c:lsmod -> r:vfat" + + # 1.1.2 /tmp: partition + - id: 5508 + title: "Ensure separate partition exists for /tmp" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + # 1.1.3 /tmp: nodev + - id: 5509 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstabfile and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp:# mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + # 1.1.4 /tmp: nosuid + - id: 5510 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp: # mount -o remount,nosuid /tmp" + compliance: + - cis: ["1.1.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + # 1.1.5 /tmp: noexec + - id: 5511 + title: "Ensure noexec option set on /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp: # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + # 1.1.6 Build considerations - Partition scheme. + - id: 5512 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + # 1.1.7 bind mount /var/tmp to /tmp + - id: 5513 + title: "Ensure separate partition exists for /var/tmp" + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + # 1.1.8 nodev set on /var/tmp + - id: 5514 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp ." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + + # 1.1.9 nosuid set on /var/tmp + - id: 5515 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + # 1.1.10 noexec set on /var/tmp + - id: 5516 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.10"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + # 1.1.11 /var/log: partition + - id: 5517 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data ." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4", "10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + # 1.1.12 /var/log/audit: partition + - id: 5518 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4", "10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + # 1.1.13 /home: partition + - id: 5519 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + # 1.1.14 /home: nodev + - id: 5520 + title: "Ensure nodev option set on /home partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + # 1.1.15 /dev/shm: nodev + - id: 5521 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + # 1.1.16 /dev/shm: nosuid + - id: 5522 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + # 1.1.17 /dev/shm: noexec + - id: 5523 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.17"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + # 1.1.22 Disable Automounting + - id: 5524 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run the following command to disable autofs: # chkconfig autofs off" + compliance: + - cis: ["1.1.22"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list autofs -> r:^\s*\t*autofs\.*on' + + ############################################### + # 1.2 Configure Software Updates + ############################################### + + # 1.2.2 Activate gpgcheck + - id: 5525 + title: "Ensure gpgcheck is globally activated" + description: "The gpgcheck option, found in the main section of the /etc/yum.conf and individual /etc/yum/repos.d/* files determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/yum.conf and set ' gpgcheck=1 ' in the [main] section. Edit any failing files in /etc/yum.repos.d/* and set all instances of gpgcheck to ' 1 '." + compliance: + - cis: ["1.2.3"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + condition: all + rules: + - "f:/etc/yum.conf -> r:^gpgcheck=1" + - "not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck=0" + + ############################################### + # 1.3 Filesystem Integrity Checking + ############################################### + + # 1.3.1 install AIDE + - id: 5526 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install aide: yum install aide // Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: aide --init && mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: all + rules: + - 'c:rpm -q aide -> r:aide-\S*' + + # 1.3.2 AIDE regular checks + - id: 5527 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Run the following command: crontab -u root -e // Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check // Notes: The checking in this recommendation occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy. " + compliance: + - cis: ["1.3.2"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "c:crontab -u root -l -> r:aide" + - "c:grep -r aide /etc/cron.* /etc/crontab -> r:aide" + + ############################################### + # 1.4 Secure Boot Settings + ############################################### + # 1.4.1 Configure bootloader + - id: 5528 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually located at /boot/grub/grub.conf and linked as /boot/grub/menu.lst and /etc/grub.conf ." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub/grub.conf # chmod og-rwx /boot/grub/grub.conf" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /boot/grub/grub.conf -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.4.2 Set Boot Loader Password (Scored) + - id: 5529 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: "Create an encrypted password with grub-md5-crypt: # grub-md5-crypt Password: Retype Password: Copy and paste the into the global section of /boot/grub/grub.conf : password --md5 " + compliance: + - cis: ["1.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.conf -> r:^password --md5\s\.+' + + # 1.4.3 Single user authentication + - id: 5530 + title: "Ensure authentication required for single user mode" + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Edit /etc/sysconfig/init and set SINGLE to ' /sbin/sulogin': SINGLE=/sbin/sulogin" + compliance: + - cis: ["1.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/sysconfig/init -> r:SINGLE\s*=\s*/sbin/sulogin' + + # 1.4.4 Ensure interactive boot is not enabled (Scored) + - id: 5531 + title: "Ensure interactive boot is not enabled" + description: "Interactive boot allows console users to interactively select which services start on boot. The PROMPT option provides console users the ability to interactively boot the system and select which services to start on boot . " + rationale: "Turn off the PROMPT option on the console to prevent console users from potentially overriding established security settings. " + remediation: "Edit the /etc/sysconfig/init file and set PROMPT to ' no ': PROMPT=no" + compliance: + - cis: ["1.4.4"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'f:/etc/sysconfig/init -> r:PROMPT\s*=\s*no' + + ############################################### + # 1.5 Additional Process Hardening + ############################################### + # 1.5.1 Restrict Core Dumps (Scored) + - id: 5532 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 and Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:^fs.suid_dumpable\s*=\s*0\s*$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + + # 1.5.2 XD/NX enabled + - id: 5533 + title: "Ensure XD/NX support is enabled" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.5.2"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sh -c "dmesg | grep NX" -> r:NX \(Execute Disable\) protection: active' + + # 1.5.3 Enable Randomized Virtual Memory Region Placement (Scored) + - id: 5534 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2. Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + + # 1.5.4 Disable prelink + - id: 5535 + title: "Ensure prelink is disabled" + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal and uninstall prelink: prelink -ua && yum remove prelink" + compliance: + - cis: ["1.5.4"] + - cis_csc: ["3.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q prelink -> package prelink is not installed" + + ############################################### + # 1.6 Configure SELinux + ############################################### + + # 1.6.1.1 SELinux not disabled + - id: 5536 + title: "Ensure SELinux is not disabled in bootloader configuration" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /boot/grub/grub.conf and remove all instances of selinux=0 and enforcing=0 on all kernel lines" + compliance: + - cis: ["1.6.1.1"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.conf -> r:^\s*\t*kernel\.*selinux=0|^\s*\t*kernel\.*enforcing=0' + + # 1.6.1.2 Set selinux state + - id: 5537 + title: "Ensure the SELinux state is enforcing" + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing" + compliance: + - cis: ["1.6.1.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s+enabled' + - 'c:sestatus -> r:^Current mode:\s+enforcing' + - 'c:sestatus -> r:^Mode from config file:\s+enforcing' + - 'f:/etc/selinux/config -> r:^SELINUX\s*=\s*enforcing' + + # 1.6.1.3 Set selinux policy + - id: 5538 + title: "Ensure SELinux policy is configured" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + compliance: + - cis: ["1.6.1.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Policy from config file:\s+targeted|^Policy from config file:\s+mls' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Remove SETroubleshoot + - id: 5539 + title: "Ensure SETroubleshoot is not installed" + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # yum remove setroubleshoot" + compliance: + - cis: ["1.6.1.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:rpm -qa setroubleshoot -> r:setroubleshoot" + + # 1.6.1.5 Disable MCS Translation service mcstrans + - id: 5540 + title: "Ensure the MCS Translation Service (mcstrans) is not installed" + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # yum remove mcstrans" + compliance: + - cis: ["1.6.1.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:rpm -qa mcstrans -> r:mcstrans" + + # 1.6.1.6 Ensure no unconfined daemons exist + - id: 5541 + title: "Ensure no unconfined daemons exist" + description: "Daemons that are not defined in SELinux policy will inherit the security context of their parent process." + rationale: "Since daemons are launched and descend from the init process, they will inherit the security context label initrc_t . This could cause the unintended consequence of giving the process more permission than it requires." + remediation: "Investigate any unconfined daemons found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:ps -eZ -> r:initrc && !r:tr|ps|egrep|bash|awk" + # 1.6.2 Install SELinux + - id: 5542 + title: "Ensure SELinux is installed" + description: "SELinux provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install libselinux: yum install libselinux" + compliance: + - cis: ["1.6.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q libselinux -> r:libselinux-\S+' + + ############################################### + # 1.7 Warning Banners + ############################################### + # 1.7.1.1 Configure message of the day (Scored) + - id: 5543 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v." + compliance: + - cis: ["1.7.1.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + + # 1.7.1.2 Configure local login warning banner (Not Scored) + - id: 5544 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.7.1.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + + # 1.7.1.3 Configure remote login warning banner (Not Scored) + - id: 5545 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.7.1.3"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + + # 1.7.1.4 Configure /etc/motd permissions (Not Scored) + - id: 5546 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.1.5 Configure /etc/issue permissions (Scored) + - id: 5547 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + # 1.7.1.6 Configure /etc/issue.net permissions (Not Scored) + - id: 5548 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.2 Ensure GDM login banner is configured (Scored) + - id: 5549 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Create the /etc/dconf/profile/gdm file with the following contents: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults || Create or edit the banner-message-enable and banner-message-text options in /etc/dconf/db/gdm.d/01-banner-message : [org/gnome/login-screen] banner-message-enable=true banner-message-text='Authorized uses only. All activity may be monitored and reported.' || Run the following command to update the system databases: dconf update" + compliance: + - cis: ["1.7.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm -> r:user-db:user" + - "f:/etc/dconf/profile/gdm -> r:system-db:gdm" + - "f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - "f:/etc/dconf/db/gdm.d/01-banner-message -> r:banner-message-enable=true" + - 'f:/etc/dconf/db/gdm.d/01-banner-message -> r:banner-message-text=\.+' + + # 1.8 Ensure updates, patches, and additional security software are installed (Not Scored) + - id: 5550 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Site policy may mandate a testing period before install onto production systems for available updates. The audit and remediation here only cover security updates. Non-security updates can be audited with and comparing against site policy: # yum check-update" + compliance: + - cis: ["1.8"] + - cis_csc: ["4.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6", "SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: all + rules: + - "c:yum check-update --security -> r:No packages needed for security" + + ############################################### + # 2 OS Services + ############################################### + ############################################### + # 2.1 inetd Services + ############################################### + # 2.1.1 Disable chargen services (Scored) + + - id: 5551 + title: "Ensure chargen services are not enabled" + description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable chargen-dgram and chargen-stream: # chkconfig chargen-dgram off; # chkconfig chargen-stream off" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list chargen-dgram -> r:^\s*\t*chargen-dgram:\s*\t*on' + - 'c:chkconfig --list chargen-stream -> r:^\s*\t*chargen-stream:\s*\t*on' + + # 2.1.2 Disable daytime services (Scored) + - id: 5552 + title: "Ensure daytime services are not enabled" + description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable daytime-dgram and daytime-stream: # chkconfig daytime-dgram off; # chkconfig daytime-stream off" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list daytime-dgram -> r:^\s*\t*daytime-dgram:\s*\t*on' + - 'c:chkconfig --list daytime-stream -> r:^\s*\t*daytime-stream:\s*\t*on' + + # 2.1.3 Disable discard services (Scored) + - id: 5553 + title: "Ensure discard services are not enabled" + description: "discardis a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable discard-dgram and discard-stream: # chkconfig discard-dgram off; # chkconfig discard-stream off" + compliance: + - cis: ["2.1.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list discard-dgram -> r:^\s*\t*discard-dgram:\s*\t*on' + - 'c:chkconfig --list discard-stream -> r:^\s*\t*discard-stream:\s*\t*on' + + # 2.1.4 Disable echo-dgram (Scored) + - id: 5554 + title: "Ensure echo services are not enabled" + description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable echo-dgram and echo-stream: # chkconfig echo-dgram off; # chkconfig echo-stream off" + compliance: + - cis: ["2.1.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list echo-dgram -> r:^\s*\t*echo-dgram:\s*\t*on' + - 'c:chkconfig --list echo-stream -> r:^\s*\t*echo-stream:\s*\t*on' + + # 2.1.5 Disable time-stream (Scored) + - id: 5555 + title: "Ensure time services are not enabled" + description: "time is a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable time-dgram and time-stream: # chkconfig time-dgram off; # chkconfig time-stream off" + compliance: + - cis: ["2.1.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list time-dgram -> r:^\s*\t*time-dgram:\s*\t*on' + - 'c:chkconfig --list time-stream -> r:^\s*\t*time-stream:\s*\t*on' + + # 2.1.6 Remove rsh-server (Scored) + - id: 5556 + title: "Ensure rsh server is not enabled" + description: "The Berkeley rsh-server ( rsh , rlogin , rexec ) package contains legacy services that exchange credentials in clear-text." + rationale: "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." + remediation: "Run the following commands to disable rsh, rlogin, and rexec: # chkconfig rsh off # chkconfig rlogin off # chkconfig rexec off" + compliance: + - cis: ["2.1.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list rexec -> r:^\s*\t*rexec:\s*\t*on' + - 'c:chkconfig --list rlogin -> r:^\s*\t*rlogin:\s*\t*on' + - 'c:chkconfig --list rsh -> r:^\s*\t*rsh:\s*\t*on' + + # 2.1.7 Remove talk server (Scored) + - id: 5557 + title: "Ensure talk server is not enabled" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable talk: # chkconfig talk off" + compliance: + - cis: ["2.1.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list talk -> r:^\s*\t*talk:\s*\t*on' + + # 2.1.8 Remove telnet-server (Scored) + - id: 5558 + title: "Ensure telnet server is not enabled" + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to disable telnet: # chkconfig telnet off" + compliance: + - cis: ["2.1.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list telnet -> r:^\s*\t*telnet:\s*\t*on' + + # 2.1.9 Ensure tftp server is not enabled (Scored) + - id: 5559 + title: "Ensure tftp server is not enabled" + description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package tftp-server is used to define and support a TFTP server." + rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." + remediation: "Run the following command to disable tftp: # chkconfig tftp off" + compliance: + - cis: ["2.1.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list tftp -> r:^\s*\t*tftp:\s*\t*on' + + # 2.1.10 Remove rsync service (Scored) + - id: 5560 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # chkconfig rsyncd off" + compliance: + - cis: ["2.1.10"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list rsync -> r:^\s*\t*rsync:\s*\t*on' + + # 2.1.11 Remove xinetd (Scored) + - id: 5561 + title: "Ensure xinetd is not enabled" + description: "The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." + remediation: "Run the following command to disable xinetd: # chkconfig xinetd off" + compliance: + - cis: ["2.1.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list xinetd -> r:^\s*\t*xinetd\.*on' + + ############################################## + # 2.2 Remove Legacy Services + ############################################### + + # 2.2.1.1 Ensure time synchronization is in use (Not Scored) + - id: 5562 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems or virtual systems where host based time synchronization is not available run the following commands and verify either ntp or chrony is installed: # rpm -q ntp # rpm -q chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and verify that host based synchronization is in use." + compliance: + - cis: ["2.2.2.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "not c:rpm -q ntp -> r:^package ntp is not installed" + - "not c:rpm -q chrony -> r:^package chrony is not installed" + + # 2.2.1.2 Configure Network Time Protocol (NTP) (Scored) + - id: 5563 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "1) Add or edit restrict lines in /etc/ntp.conf to match the following: - restrict -4 default kod nomodify notrap nopeer noquery and - restrict -4 default kod nomodify notrap nopeer noquery. 2) Add or edit server or pool lines to /etc/ntp.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': - OPTIONS='-u ntp:ntp'" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/sysconfig/ntpd -> r:^OPTIONS\s*=\s* && r:-u ntp:ntp' + + # 2.2.1.3 Configure Network Time Protocol (Chrony) (Scored) + - id: 5564 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "1) Add or edit restrict lines in /etc/chrony.conf to match the following: - 1) Add or edit server or pool lines to /etc/chrony.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/chronyd to include: - OPTIONS='-u chronyd'" + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/sysconfig/chronyd -> r:^OPTIONS\s*=\s* && r:-u chrony' + + # 2.2.2 Remove X Windows (Scored) + - id: 5565 + title: "Ensure X Window System is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: # yum remove xorg-x11*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:rpm -qa xorg-x11* -> r:^xorg-x11" + + # 2.2.3 Disable Avahi Server (Scored) + - id: 5566 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface." + remediation: "Run the following command to disable avahi-daemon: # chkconfig avahi-daemon off" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list avahi-daemon -> r:^\s*\t*avahi-daemon\.*on' + + # 2.2.4 Ensure CUPS is not enabled (Scored) + - id: 5567 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups : # chkconfig cups off" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list cups -> r:^\s*\t*cups\.*on' + + # 2.2.5 Remove DHCP Server (Scored) + - id: 5568 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dhcpd: # chkconfig dhcpd off" + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on DHCP is available at https://www.isc.org/software/dhcp + condition: none + rules: + - 'c:chkconfig --list dhcpd -> r:^\s*\t*dhcpd\.*on' + + # 2.2.6 Remove LDAP Server (Scored) + - id: 5569 + title: "Ensure LDAP Server is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # chkconfig slapd off" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on OpenLDAP is available at https://www.openldap.org + condition: none + rules: + - 'c:chkconfig --list slapd -> r:^\s*\t*slapd\.*on' + + # 2.2.7 Disable NFS and RPC (Scored) + - id: 5570 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs, nfs-server and rpcbind: # chkconfig nfs off; # chkconfig rpcbind off" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list nfs -> r:^\s*\t*nfs\.*on' + - 'c:chkconfig --list rpcbind -> r:^\s*\t*rpcbind\.*on' + + # 2.2.8 Ensure DNS Server is not enabled (Scored) + - id: 5571 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable named : # chkconfig named off" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list named -> r:^\s*\t*named\.*on' + + # 2.2.9 Remove FTP Server (Scored) + - id: 5572 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # chkconfig vsftpd off" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list vsftpd -> r:^\s*\t*vsftpd\.*on' + + # 2.2.10 Remove HTTP Server (Scored) + - id: 5573 + title: "Ensure HTTP server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable httpd: # chkconfig httpd off" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list httpd -> r:^\s*\t*httpd\.*on' + + # 2.2.11 Remove Dovecot (IMAP and POP3 services) (Scored) + - id: 5574 + title: "Ensure IMAP and POP3 server is not enabled" + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dovecot: # chkconfig dovecot off" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list dovecot -> r:^\s*\t*dovecot\.*on' + + # 2.2.12 Remove Samba (Scored) + - id: 5575 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable smb: # chkconfig smb off" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list smb -> r:^\s*\t*smb\.*on' + + # 2.2.13 Remove HTTP Proxy Server (Scored) + - id: 5576 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # chkconfig squid off" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list squid -> r:^\s*\t*squid\.*on' + + # 2.2.14 Remove SNMP Server (Not Scored) + - id: 5577 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # chkconfig snmpd off" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list snmpd -> r:^\s*\t*snmpd\.*on' + + # 2.2.15 Ensure mail transfer agent is configured for local-only mode (Scored) + - id: 5578 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Restart postfix: # service postfix restart" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - tsc: ["CC5.2", "CC6.4", "CC6.6", "CC6.7"] + condition: none + rules: + - 'c:netstat -an -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.+LISTEN' + + # 2.2.16 Remove NIS Server (Scored) + - id: 5579 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable ypserv: # chkconfig ypserv off" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list ypserv -> r:^\s*\t*ypserv\.*on' + + ############################################### + # 2.3 Service Clients + ############################################### + # 2.3.1 Remove NIS Client (Scored) + - id: 5580 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Run the following command to uninstall ypbind: # yum remove ypbind" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q ypbind -> package ypbind is not installed" + + # 2.3.2 Ensure rsh client is not installed (Scored) + - id: 5581 + title: "Ensure rsh client is not installed" + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin ." + remediation: "Run the following command to uninstall rsh : # yum remove rsh" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q rsh -> package rsh is not installed" + + # 2.3.3 Ensure talk client is not installed (Scored) + - id: 5582 + title: "Ensure talk client is not installed" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk : # yum remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q talk -> package talk is not installed" + + # 2.3.4 Ensure telnet client is not installed (Scored) + - id: 5583 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet : # yum remove telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q telnet -> package telnet is not installed" + + # 2.3.5 Ensure LDAP client is not installed (Scored) + - id: 5584 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients : # yum remove openldap-clients" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q openldap-clients -> package openldap-clients is not installed" + + ############################################### + # 3 Network Configuration and Firewalls + ############################################### + ############################################### + # 3.1 Modify Network Parameters (Host Only) + ############################################### + # 3.1.1 Disable IP Forwarding (Scored) + - id: 5585 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." + rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + + # 3.1.2 Disable Send Packet Redirects (Scored) + - id: 5586 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0; net.ipv4.conf.default.send_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0; # sysctl -w net.ipv4.conf.default.send_redirects=0; # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + ############################################### + # 3.2 Modify Network Parameters (Host and Router) + ############################################### + # 3.2.1 Disable Source Routed Packet Acceptance (Scored) + - id: 5587 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0; net.ipv4.conf.default.accept_source_route = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + + # 3.2.2 Disable ICMP Redirect Acceptance (Scored) + - id: 5588 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0; net.ipv4.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + + # 3.2.3 Disable Secure ICMP Redirect Acceptance (Scored) + - id: 5589 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0; net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + # 3.2.4 Log Suspicious Packets (Scored) + - id: 5590 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1; net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + # 3.2.5 Enable Ignore Broadcast Requests (Scored) + - id: 5591 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + # 3.2.6 Enable Bad Error Message Protection (Scored) + - id: 5592 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + # 3.2.7 Enable RFC-recommended Source Route Validation (Scored) + - id: 5593 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1; net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + # 3.2.8 Enable TCP SYN Cookies (Scored) + - id: 5594 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + ############################################### + # 3.3 IPv6 + ############################################### + # 3.3.1 Ensure IPv6 router advertisements are not accepted (Not Scored) + - id: 5595 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the system's ability to accept IPv6 router advertisements." + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 and net.ipv6.conf.default.accept_ra = 0 Then, run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0' + + # 3.3.2 Ensure IPv6 redirects are not accepted (Not Scored) + - id: 5596 + title: "Ensure IPv6 redirects are not accepted" + description: "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic." + rationale: "It is recommended that systems not accept ICMP redirects as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 || net.ipv6.conf.default.accept_redirects = 0 Then, run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirect /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirect /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0' + + # 3.3.3 Ensure IPv6 is disabled (Not Scored) + - id: 5597 + title: "Ensure IPv6 is disabled" + description: "Although IPv6 has many advantages over IPv4, few organizations have implemented IPv6." + rationale: "If IPv6 is not to be used, it is recommended that it be disabled to reduce the attack surface of the system." + remediation: "Edit /boot/grub/grub.conf to include ipv6.disable=1 on all kernel lines." + compliance: + - cis: ["3.3.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.conf -> r:^\s*\t*kernel && !r:ipv6.disable=1' + + ############################################### + # 3.4 TCP Wrappers + ############################################### + # 3.4.1 Ensure TCP Wrappers is installed (Scored) + - id: 5598 + title: "Ensure TCP Wrappers is installed" + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Run the following command to install tcp_wrappers: yum install tcp_wrappers" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "c:rpm -q tcp_wrappers -> r:^tcp_wrappers-" + - "c:rpm -q tcp_wrappers-libs -> r:^tcp_wrappers-libs-" + + # 3.4.3 Ensure /etc/hosts.deny is configured (Scored) + - id: 5599 + title: "Ensure /etc/hosts.deny is configured" + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." + remediation: "Run the following command to create /etc/hosts.deny: echo 'ALL: ALL' >> /etc/hosts.deny" + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'f:/etc/hosts.deny -> r:^ALL\s*:\s*ALL' + + # 3.4.4 Ensure permissions on /etc/hosts.allow are configured (Scored) + - id: 5600 + title: "Ensure permissions on /etc/hosts.allow are configured." + description: "The /etc/hosts.allow file contains networking information that is used by many applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.allow : chown root:root /etc/hosts.allow and chmod 644 /etc/hosts.allow" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'c:stat -L /etc/hosts.allow -> r:^Access: \(0644/-rw-r--r--\) Uid: \( 0/ root\) Gid: \( 0/ root\)' + + # 3.4.5 Ensure permissions on /etc/hosts.deny are configured (Scored) + - id: 5601 + title: "Ensure permissions on /etc/hosts.deny are configured." + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.deny : chown root:root /etc/hosts.deny and chmod 644 /etc/hosts.deny" + compliance: + - cis: ["3.4.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/hosts.deny -> r:^Access: \(0644/-rw-r--r--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + ############################################### + # 3.5 Uncommon Network Protocols + ############################################### + # 3.5.1 Ensure DCCP is disabled (Not Scored) + - id: 5602 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.5.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v dccp -> r:install /bin/true" + - "not c:lsmod -> r:dccp" + + # 3.5.2 Ensure SCTP is disabled (Not Scored) + - id: 5603 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.5.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v sctp -> r:install /bin/true" + - "not c:lsmod -> r:sctp" + + # 3.5.3 Ensure RDS is disabled (Not Scored) + - id: 5604 + title: "Ensure RDS is disabled" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.5.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v rds -> r:install /bin/true" + - "not c:lsmod -> r:rds" + + # 3.5.4 Ensure TIPC is disabled (Not Scored) + - id: 5605 + title: "Ensure TIPC is disabled" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.5.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v tipc -> r:install /bin/true" + - "not c:lsmod -> r:tipc" + + ############################################### + # 3.6 Firewall Configuration + ############################################### + # 3.6.1 Ensure iptables is installed (Scored) + - id: 5606 + title: "Ensure iptables is installed" + description: "iptables allows configuration of the IPv4 tables in the linux kernel and the rules stored within them. Most firewall configuration utilities operate as a front end to iptables ." + rationale: "iptables is required for firewall management and configuration." + remediation: "Run the following command to install iptables : yum install iptables" + compliance: + - cis: ["3.6.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.1"] + condition: all + rules: + - "c:rpm -q iptables -> r:iptables-" + + # 3.6.2 Ensure default deny firewall policy (Scored) + - id: 5607 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: iptables -P INPUT DROP; iptables -P OUTPUT DROP and iptables -P FORWARD DROP" + compliance: + - cis: ["3.6.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)' + + # 3.6.3 Ensure loopback traffic is configured (Scored) + - id: 5608 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.6.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + ############################################### + # 4 Logging and Auditing + ############################################### + + ############################################### + # 4 Logging and Auditing + ############################################### + ############################################### + # 4.1 Configure System Accounting (auditd) + ############################################### + + # 4.1.1.1 Ensure audit log storage size is configured (Not Scored) + - id: 5609 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = " + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file\s*=\s*\d+' + + # 4.1.1.2 Ensure system is disabled when audit logs are full (Scored) + - id: 5610 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^admin_space_left_action\s*=\s*halt' + + # 4.1.1.3 Ensure audit logs are not automatically deleted (Scored) + - id: 5611 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file_action\s*=\s*keep_logs' + + # 4.1.2 Ensure auditd service is enabled (Scored) + - id: 5612 + title: "Ensure auditd service is enabled" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd : # chkconfig auditd on" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1", "10.7"] + - tsc: ["CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:chkconfig --list auditd -> r:2:on && r:3:on && r:4:on && r:5:on" + + # 4.1.3 Ensure auditing for processes that start prior to auditd is enabled (Scored) + - id: 5613 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: "Edit /boot/grub/grub.conf to include audit=1 on all kernel lines. Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + compliance: + - cis: ["4.1.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.2.6", "10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/boot/grub/grub.conf -> r:^\s*\t*kernel && !r:audit=1' + + # 4.1.4 Ensure events that modify date and time information are collected (Scored) + - id: 5614 + title: "Ensure events that modify date and time information are collected" + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier "time-change".' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -Farch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["3.6"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:-w /etc/localtime && r:-p wa && r:-k time-change" + + # 4.1.5 Ensure events that modify user/group information are collected (Scored) + - id: 5615 + title: "Ensure events that modify user/group information are collected" + description: 'Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity" + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /etc/group && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:-w /etc/passwd && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:-w /etc/gshadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:-w /etc/shadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:-w /etc/security/opasswd && r:-p wa && r:-k identity" + + # 4.1.6 Ensure events that modify the system's network environment are collected (Scored) + - id: 5616 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre-login), /etc/hosts (file containing host names and associated IP addresses), /etc/sysconfig/network file and /etc/sysconfig/network-scripts/ directory (containing network interface scripts and configurations)." + rationale: 'Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network and /etc/sysconfig/network-scripts/ is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier "system-locale."' + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale" + compliance: + - cis: ["4.1.6"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/issue && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/issue.net && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/hosts && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/sysconfig/network && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/sysconfig/network-scripts/ && r:-p wa && r:-k system-locale" + + # 4.1.7 Ensure events that modify the system's Mandatory Access Controls are collected (Scored) + - id: 5617 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux or directory." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy -w /usr/share/selinux/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /etc/selinux/ && r:-p wa && r:-k MAC-policy" + - "f:/etc/audit/audit.rules -> r:-w /usr/share/selinux/ && r:-p wa && r:-k MAC-policy" + + # 4.1.8 Ensure login and logout events are collected (Scored) + - id: 5618 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The /var/run/failock directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/lastlog -p wa -k logins -w /var/run/faillock/ -p wa -k logins" + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5", "16.10", "16.4"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /var/log/lastlog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:-w /var/run/faillock/ && r:-p wa && r:-k logins" + + # 4.1.9 Ensure session initiation information is collected (Scored) + - id: 5619 + title: "Ensure session initiation information is collected" + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier "session." The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier "logins.".' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k logins -w /var/log/btmp -p wa -k logins" + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5", "16.10", "16.4"] + - pci_dss: ["10.3"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /var/run/utmp && r:-p wa && r:-k session" + - "f:/etc/audit/audit.rules -> r:-w /var/log/wtmp && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:-w /var/log/btmp && r:-p wa && r:-k logins" + + # 4.1.10 Ensure discretionary access control permission modification events are collected (Scored) + - id: 5620 + title: "Ensure discretionary access control permission modification events are collected" + description: 'Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 500) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier "perm_mod."' + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=500 -F auid!=4294967295 -k perm_mod For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lrem" + compliance: + - cis: ["4.1.10"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod" + + # 4.1.11 Ensure unsuccessful unauthorized file access attempts are collected (Scored) + - id: 5621 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: 'Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 500), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier "access."' + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access" + compliance: + - cis: ["4.1.11"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EACCES && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k access" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EPERM && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k access" + + # 4.1.13 Ensure successful file system mounts are collected (Scored) + - id: 5622 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S mount -F auid>=500 -F auid!=4294967295 -k mounts For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=500 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=500 -F auid!=4294967295 -k mounts" + compliance: + - cis: ["4.1.13"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k mounts" + + # 4.1.14 Ensure file deletion events by users are collected (Scored) + - id: 5623 + title: "Ensure file deletion events by users are collected" + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete" + compliance: + - cis: ["4.1.14"] + - pci_dss: ["10.5.5"] + - tsc: ["PI1.4", "PI1.5", "CC7.1", "CC7.2", "CC7.3", "CC8.1"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k delete" + + # 4.1.15 Ensure changes to system administration scope (sudoers) is collected (Scored) + - id: 5624 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: 'Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier "scope."' + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d/ -p wa -k scope" + compliance: + - cis: ["4.1.15"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /etc/sudoers && r:-p wa && r:-k scope" + - "f:/etc/audit/audit.rules -> r:-w /etc/sudoers.d/ && r:-p wa && r:-k scope" + + # 4.1.16 Ensure system administrator actions (sudolog) are collected (Scored) + - id: 5625 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions" + compliance: + - cis: ["4.1.16"] + - cis_csc: ["5.1", "5.5"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14", "AC.6", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /var/log/sudo.log && r:-p wa && r:-k actions" + + # 4.1.17 Ensure kernel module loading and unloading is collected (Scored) + - id: 5626 + title: "Ensure kernel module loading and unloading is collected" + description: 'Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of "modules".' + rationale: "Monitoring the use of insmod , rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions" + compliance: + - cis: ["4.1.17"] + - cis_csc: ["3"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /sbin/insmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:-w /sbin/rmmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:-w /sbin/modprobe && r:-p x && r:-k modules" + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b\d\d && r:-S init_module && r:-S delete_module && r:-k modules' + + # 4.1.18 Ensure the audit configuration is immutable (Scored) + - id: 5627 + title: "Ensure the audit configuration is immutable" + description: 'Set system audit so that audit rules cannot be modified with auditctl . Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following line to the end of the /etc/audit/audit.rules file. -e 2" + compliance: + - cis: ["4.1.18"] + - cis_csc: ["3", "6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:tail -1 /etc/audit/audit.rules -> r:^-e 2" + + ############################################### + # 4.2 Configure Logging + ############################################### + + # 4.2.1.1 Ensure rsyslog Service is enabled (Scored) + - id: 5628 + title: "Ensure rsyslog Service is enabled" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system may default to the syslogd service or lackblogging instead." + remediation: "Run the following command to enable rsyslog : # chkconfig rsyslog on" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:chkconfig --list rsyslog -> r:2:on && r:3:on && r:4:on && r:5:on" + # 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 5629 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\. -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + # 4.2.1.4 Ensure rsyslog is configured to send logs to a remote log host (Scored) + - id: 5630 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). *.* @@loghost.example.com Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:grep *.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf -> !r:# && r:*.* @@\.+' + + # 4.2.2.1 Ensure syslog-ng service is enabled (Scored) + - id: 5631 + title: "Ensure syslog-ng service is enabled" + description: "Once the syslog-ng package is installed it needs to be activated." + rationale: "If the syslog-ng service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable syslog-ng : # chkconfig syslog-ng on" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:chkconfig --list syslog-ng -> r:2:on && r:3:on && r:4:on && r:5:on" + + # 4.2.2.3 Ensure syslog-ng default file permissions configured (Scored) + - id: 5632 + title: "Ensure syslog-ng default file permissions configured" + description: "syslog-ng will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive syslog-ng data is archived and protected." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf and set perm option to 0640 or more restrictive: options { chain_hostnames(off); flush_lines(0); perm(0640); stats_freq(3600); threaded(yes); };" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:^options && r:perm\(0600\)|perm\(0640\)|perm\(0440\)|perm\(0400\)|perm\(0000\)' + + # 4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host (Not Scored) + - id: 5633 + title: "Ensure syslog-ng is configured to send logs to a remote log host" + description: "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp("logfile.example.com" port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the rsyslogd configuration: # pkill -HUP syslog-ng' + compliance: + - cis: ["4.2.2.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/syslog-ng/syslog-ng.conf -> !r:^# && r:destination logserver" + - 'f:/etc/syslog-ng/syslog-ng.conf -> !r:^# && r:log\.+source\.+destination' + + # 4.2.3 Ensure rsyslog or syslog-ng is installed (Scored) + - id: 5634 + title: "Ensure rsyslog or syslog-ng is installed" + description: "The rsyslog and syslog-ng software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog or syslog-ng using one of the following commands: # yum install rsyslog # yum install syslog-ng" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "not c:rpm -q rsyslog -> package rsyslog is not installed" + - "not c:rpm -q syslog-ng -> package syslog-ng is not installed" + + # 4.2.4 Ensure permissions on all logfiles are configured (Scored) + - id: 5635 + title: "Ensure permissions on all logfiles are configured" + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitivebdata is archived and protected." + remediation: "Run the following command to set permissions on all existing log files: # find /var/log -type f -exec chmod g-wx,o-rwx {} +" + compliance: + - cis: ["4.2.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + + ############################################### + # 5 System Access, Authentication and Authorization + ############################################### + ############################################### + # 5.2 Configure SSH + ############################################### + + # 5.1.1 Ensure cron daemon is enabled (Scored) + - id: 5636 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron : # chkconfig crond on" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:chkconfig --list crond -> r:2:on && r:3:on && r:4:on && r:5:on" + + # 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 5637 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 5638 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 5639 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 5640 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 5641 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access: \(0\w00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 5642 + title: "Ensure permissions on /etc/cron.d are configured" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.8 Ensure at/cron is restricted to authorized users (Scored) + - id: 5643 + title: "Ensure at/cron is restricted to authorized users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:stat -L /etc/cron.deny -> r:No such file or directory$" + - "c:stat -L /etc/at.deny -> r:No such file or directory$" + - 'c:stat -L /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat -L /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + ############################################### + # 5.2 Configure SSH + ############################################### + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured (Scored) + - id: 5644 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: chown root:root /etc/ssh/sshd_config and chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2.2 Set SSH Protocol to 2 (Scored) + - id: 5645 + title: "Ensure SSH Protocol is set to 2" + description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:Protocol\s*\t*2' + + # 5.2.3 Set LogLevel to INFO (Scored) + - id: 5646 + title: "Ensure SSH LogLevel is set to INFO" + description: "The INFO parameter specifies that login and logout activity will be logged." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:LogLevel\s*\t*INFO' + + # 5.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) + - id: 5647 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.5"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.2.6 Set SSH IgnoreRhosts to Yes (Scored) + - id: 5648 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:IgnoreRhosts\s*\t*yes' + + # 5.2.7 Set SSH HostbasedAuthentication to No (Scored) + - id: 5649 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:HostbasedAuthentication\s*\t*no' + + # 5.2.8 Disable SSH Root Login (Scored) + - id: 5650 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["5.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitRootLogin\s*\t*no' + + # 5.2.9 Set SSH PermitEmptyPasswords to No (Scored) + - id: 5651 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitEmptyPasswords\s*\t*no' + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled (Scored) + - id: 5652 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitUserEnvironment\s*\t*no' + + # 5.2.12 Ensure SSH Idle Timeout Interval is configured (Scored) + - id: 5653 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 and ClientAliveCountMax 0" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare <= 300' + - 'f:$sshd_file -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare <= 3' + + # 5.2.13 Ensure SSH LoginGraceTime is set to one minute or less (Scored) + - id: 5654 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.13"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60' + + # 5.2.14 Ensure SSH access is limited (Scored) + - id: 5655 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. AllowGroups The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. DenyUsers The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. DenyGroups The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers ; AllowGroups ; DenyUsers and DenyGroups " + compliance: + - cis: ["5.2.14"] + - cis_csc: ["5.1", "5.8"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'f:$sshd_file -> r:^\s*AllowUsers' + - 'f:$sshd_file -> r:^\s*AllowGroups' + - 'f:$sshd_file -> r:^\s*DenyUsers' + - 'f:$sshd_file -> r:^\s*DenyGroups' + + # 5.2.15 Ensure SSH warning banner is configured (Scored) + - id: 5656 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*Banner\s*\t*/etc/issue.net' + + ############################################### + # 5.3 Configure PAM + ############################################### + # 5.3.1 Ensure password creation requirements are configured (Scored) + - id: 5657 + title: "Ensure password creation requirements are configured" + description: "The pam_cracklib.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_cracklib.so and to conform to site policy: password requisite pam_cracklib.so try_first_pass retry=3 minlen=14 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1" + compliance: + - cis: ["5.3.1"] + - cis_csc: ["5.7", "16.12"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:grep pam_cracklib.so /etc/pam.d/password-auth -> r:try_first_pass && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'c:grep pam_cracklib.so /etc/pam.d/system-auth -> r:try_first_pass && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + + # 5.3.3 Ensure password reuse is limited (Scored) + - id: 5658 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the remember option and conform to site policy as shown: password sufficient pam_unix.so remember=5 or password required pam_pwhistory.so remember=5" + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + + # 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 5659 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the sha512 option for pam_unix.so as shown: password sufficient pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.14"] + - pci_dss: ["3.6.1", "8.2.1"] + - tsc: ["CC6.1", "CC6.7"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + - 'f:/etc/pam.d/system-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + ############################################### + # 5.4 User Accounts and Environment + ############################################### + ############################################### + # 5.4.1 Set Shadow Password Suite Parameters + ############################################### + # 5.4.1.1 Ensure password expiration is 365 days or less (Scored) + - id: 5660 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 90 and modify user parameters for all users with a password set to match: chage --maxdays 90 " + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + + # 5.4.1.2 Ensure minimum days between password changes is 7 or more (Scored) + - id: 5661 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7 and modify user parameters for all users with a password set to match: chage --mindays 7 " + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + + # 5.4.1.3 Ensure password expiration warning days is 7 or more (Scored) + - id: 5662 + title: "Ensure password expiration warning days is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 and modify user parameters for all users with a password set to match: chage --warndays 7 " + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + # 5.4.1.4 Ensure inactive password lock is 30 days or less (Scored) + - id: 5663 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: useradd -D -f 30 and modify user parameters for all users with a password set to match: chage --inactive 30 " + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*(\d+) compare <= 30' + + # 5.4.3 Ensure default group for the root account is GID 0 (Scored) + - id: 5664 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\w:\w:0' + + # 5.4.4 Ensure default user umask is 027 or more restrictive (Scored) + - id: 5665 + title: "Ensure default user umask is 027 or more restrictive" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["13"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + # 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 5666 + title: "Ensure default user shell timeout is 900 seconds or less" + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bashrc and /etc/profile files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + # 5.6 Ensure access to the su command is restricted (Scored) + - id: 5667 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo , which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su , the su command will only allow users in the wheel group to execute su ." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid" + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/pam.d/su -> r:^auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + ############################################### + # 6 System Maintenance + ############################################### + ############################################### + # 6.1 System File Permissions + ############################################### + + # 6.1.2 Configure /etc/passwd permissions (Scored) + - id: 5668 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.3 Configure /etc/shadow permissions (Scored) + - id: 5669 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following command to set permissions on /etc/shadow: # chown root:root /etc/shadow # chmod 000 /etc/shadow" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/shadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.4 Configure /etc/group permissions (Scored) + - id: 5670 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.5 Configure /etc/gshadow permissions (Scored) + - id: 5671 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following command to set permissions on /etc/gshadow: # chown root:root /etc/gshadow # chmod 000 /etc/gshadow" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/gshadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.6 Configure /etc/passwd- permissions (Scored) + - id: 5672 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod 644 /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/passwd- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.7 Configure /etc/shadow- permissions (Scored) + - id: 5673 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/shadow-: # chown root:root /etc/shadow- # chmod 000 /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/shadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.8 Configure /etc/group- permissions (Scored) + - id: 5674 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.9 Configure /etc/gshadow- permissions (Scored) + - id: 5675 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/gshadow-: # chown root:root /etc/gshadow- # chmod 000 /etc/gshadow-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/gshadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + ############################################### + # 6.2 Review User and Group Settings + ############################################### + # 6.2.1 Check passwords fields (Scored) + - id: 5676 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: passwd -l || Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + + # 6.2.2 Delete legacy entries in /etc/passwd (Scored) + - id: 5677 + title: 'Ensure no legacy "+" entries exist in /etc/passwd' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/passwd -> !r:^# && r:^+:" + + # 6.2.3 Delete legacy entries in /etc/shadow (Scored) + - id: 5678 + title: 'Ensure no legacy "+" entries exist in /etc/shadow' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.3"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/shadow -> !r:^# && r:^+:" + + # 6.2.4 Delete legacy entries in /etc/group (Scored) + - id: 5679 + title: 'Ensure no legacy "+" entries exist in /etc/group' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/group if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/group -> !r:^# && r:^+:" + + # 6.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) + - id: 5680 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' diff --git a/etc/ruleset/sca/centos/7/cis_centos7_linux.yml b/etc/ruleset/sca/centos/7/cis_centos7_linux.yml new file mode 100644 index 0000000000..e53c37fe45 --- /dev/null +++ b/etc/ruleset/sca/centos/7/cis_centos7_linux.yml @@ -0,0 +1,4431 @@ +# Security Configuration Assessment +# CIS Checks for CentOS 7 +# Copyright (C) 2023, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security CentOS 7 Benchmark v3.1.2 - 08-31-2021 + +policy: + id: "cis_centos7_linux" + file: "cis_centos7_linux.yml" + name: "CIS CentOS Linux 7 Benchmark v3.1.2." + description: "This document provides prescriptive guidance for establishing a secure configuration posture for CentOS 7 systems running on x86 and x64 platforms. This document was tested against CentOS 7." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check CentOS 7 platform." + description: "Requirements for running the policy against CentOS 7." + condition: any + rules: + - "f:/etc/system-release -> r:^CentOS && r:release 7" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + ############################################## + # 1.1 Filesystem Configuration + ############################################## + + # 1.1.1.1 Ensure mounting of cramfs filesystems is disabled. (Automated) + - id: 6000 + title: "Ensure mounting of cramfs filesystems is disabled." + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/cramfs.conf and add the following line: install cramfs /bin/true Run the following command to unload the cramfs module: # rmmod cramfs." + compliance: + - cis: ["1.1.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:install /bin/true|Module cramfs not found" + - "not c:lsmod -> r:cramfs" + + # 1.1.1.2 Ensure mounting of squashfs filesystems is disabled. (Automated) + - id: 6001 + title: "Ensure mounting of squashfs filesystems is disabled." + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: 'Disabling squashfs will prevent the use of snap. Snap is a package manager for Linux for installing Snap packages. "Snap" application packages of software are self-contained and work across a range of Linux distributions. This is unlike traditional Linux package management approaches, like APT or RPM, which require specifically adapted packages per Linux distribution on an application update and delay therefore application deployment from developers to their software''s end-user. Snaps themselves have no dependency on any external store ("App store"), can be obtained from any source and can be therefore used for upstream software deployment. When snaps are deployed on versions of Linux, the Ubuntu app store is used as default back-end, but other stores can be enabled as well.' + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/squashfs.conf and add the following line: install squashfs /bin/true Run the following command to unload the squashfs module: # rmmod squashfs." + compliance: + - cis: ["1.1.1.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + + # 1.1.1.3 Ensure mounting of udf filesystems is disabled. (Automated) + - id: 6002 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/udf.conf and add the following line: install udf /bin/true Run the following command to unload the udf module: # rmmod udf." + compliance: + - cis: ["1.1.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:modprobe -n -v udf -> r:install /bin/true|Module udf not found" + - "not c:lsmod -> r:udf" + + # 1.1.2 Ensure /tmp is configured. (Automated) + - id: 6003 + title: "Ensure /tmp is configured." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a default installation a disk-based /tmp will essentially have the whole disk available, as it only creates a single / partition. On the other hand, a RAM-based /tmp as with tmpfs will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily." + remediation: "Create or update an entry for /tmp in either /etc/fstab OR in a systemd tmp.mount file: If /etc/fstab is used: configure /etc/fstab as appropriate. Example: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp # mount -o remount,noexec,nodev,nosuid /tmp OR if systemd tmp.mount file is used: run the following command to create the file /etc/systemd/system/tmp.mount if it doesn't exist: # [ ! -f /etc/systemd/system/tmp.mount ] && cp -v /usr/lib/systemd/system/tmp.mount /etc/systemd/system/ Edit the file /etc/systemd/system/tmp.mount: [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to reload the systemd daemon: # systemctl daemon-reload Run the following command to unmask and start tmp.mount: # systemctl --now unmask tmp.mount." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + compliance: + - cis: ["1.1.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.4", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'c:findmnt -n /tmp -> r:\s/tmp\s' + - 'f:/etc/fstab -> r:\s/tmp\s' + - 'c:systemctl show "tmp.mount" -> r:^\s*UnitFileState=enabled' + + # 1.1.3 Ensure noexec option set on /tmp partition. (Automated) + - id: 6004 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file OR the /etc/systemd/system/local- fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,noexec /tmp OR if systemd is used to mount /tmp:_ Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount." + compliance: + - cis: ["1.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:findmnt -n /tmp -> r:noexec" + + # 1.1.4 Ensure nodev option set on /tmp partition. (Automated) + - id: 6005 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file OR the /etc/systemd/system/local- fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nodev /tmp OR if systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount." + compliance: + - cis: ["1.1.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:findmnt -n /tmp -> r:nodev" + + # 1.1.5 Ensure nosuid option set on /tmp partition. (Automated) + - id: 6006 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,nosuid /tmp OR if systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuid to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount: # systemctl restart tmp.mount." + compliance: + - cis: ["1.1.5"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - "c:findmnt -n /tmp -> r:nosuid" + + # 1.1.6 Ensure /dev/shm is configured. (Automated) + - id: 6007 + title: "Ensure /dev/shm is configured." + description: "/dev/shm is a traditional shared memory concept. One program will create a memory portion, which other processes (if permitted) can access. Mounting tmpfs at /dev/shm is handled automatically by systemd." + rationale: "Any user can upload and execute files inside the /dev/shm similar to the /tmp partition. Configuring /dev/shm allows an administrator to set the noexec option on the mount, making /dev/shm useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "Edit /etc/fstab and add or edit the following line: tmpfs /dev/shm tmpfs defaults,noexec,nodev,nosuid,seclabel 0 0 Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm." + compliance: + - cis: ["1.1.6"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:findmnt -n /dev/shm -> r:\s/dev/shm\s' + - 'f:/etc/fstab -> r:\s/dev/shm\s' + + # 1.1.7 Ensure noexec option set on /dev/shm partition. (Automated) + - id: 6008 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm." + compliance: + - cis: ["1.1.7"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["2.6", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - "c:findmnt -n /dev/shm -> r:noexec" + + # 1.1.8 Ensure nodev option set on /dev/shm partition. (Automated) + - id: 6009 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm." + compliance: + - cis: ["1.1.8"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - "c:findmnt -n /dev/shm -> r:nodev" + + # 1.1.9 Ensure nosuid option set on /dev/shm partition. (Automated) + - id: 6010 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm." + compliance: + - cis: ["1.1.9"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - "c:findmnt -n /dev/shm -> r:nosuid" + + # 1.1.10 Ensure separate partition exists for /var. (Automated) + - id: 6011 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:findmnt -n /var -> r:\s/var\s' + + # 1.1.11 Ensure separate partition exists for /var/tmp. (Automated) + - id: 6012 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications and is intended for temporary files that are preserved across reboots." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:findmnt -n /var/tmp -> r:\s/var/tmp\s' + + # 1.1.12 Ensure /var/tmp partition includes the noexec option. (Automated) + - id: 6013 + title: "Ensure /var/tmp partition includes the noexec option." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "For existing /var/tmp partitions, edit the /etc/fstab file and add noexec to the fourth field (mounting options) of the /var/tmp entry. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,noexec /var/tmp." + compliance: + - cis: ["1.1.12"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - "c:findmnt -n /var/tmp -> r:noexec" + + # 1.1.13 Ensure /var/tmp partition includes the nodev option. (Automated) + - id: 6014 + title: "Ensure /var/tmp partition includes the nodev option." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." + remediation: "For existing /var/tmp partitions, edit the /etc/fstab file and add nodev to the fourth field (mounting options) of the /var/tmp entry. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nodev /var/tmp." + compliance: + - cis: ["1.1.13"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - "c:findmnt -n /var/tmp -> r:nodev" + + # 1.1.14 Ensure /var/tmp partition includes the nosuid option. (Automated) + - id: 6015 + title: "Ensure /var/tmp partition includes the nosuid option." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "For existing /var/tmp partitions, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) of the /var/tmp entry. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,nosuid /var/tmp." + compliance: + - cis: ["1.1.14"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - "c:findmnt -n /var/tmp -> r:nosuid" + + # 1.1.15 Ensure separate partition exists for /var/log. (Automated) + - id: 6016 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.15"] + - cis_csc_v8: ["4.1", "8.3"] + - cis_csc_v7: ["6.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["10.7", "11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["A1.1", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:findmnt -n /var/log -> r:\s/var/log\s' + + # 1.1.16 Ensure separate partition exists for /var/log/audit. (Automated) + - id: 6017 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd , it may not perform as desired." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.16"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt -n /var/log/audit -> r:\s/var/log/audit\s' + + # 1.1.17 Ensure separate partition exists for /home. (Automated) + - id: 6018 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:findmnt -n /home -> r:\s/home\s' + + # 1.1.18 Ensure /home partition includes the nodev option. (Automated) + - id: 6019 + title: "Ensure /home partition includes the nodev option." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "For existing /home partitions, edit the /etc/fstab file and add nodev to the fourth field (mounting options) of the /home entry. See the fstab(5) manual page for more information. Run the following command to remount /home: # mount -o remount,nodev /home." + compliance: + - cis: ["1.1.18"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - "c:findmnt -n /home -> r:nodev" + + # 1.1.19 Ensure removable media partitions include noexec option. (Automated) - Not Implemented + # 1.1.20 Ensure nodev option set on removable media partitions. (Automated) - Not Implemented + # 1.1.21 Ensure nosuid option set on removable media partitions. (Automated) - Not Implemented + # 1.1.22 Ensure sticky bit is set on all world-writable directories. (Automated) - Not Implemented + + # 1.1.23 Disable Automounting. (Automated) + - id: 6020 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "Run the following command to mask autofs: # systemctl --now mask autofs OR run the following command to remove autofs # yum remove autofs." + compliance: + - cis: ["1.1.23"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.4", "8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - 'not c:systemctl show "autofs.service" -> r:\s*unitfilestate=enabled' + + # 1.1.24 Disable USB Storage. (Automated) + - id: 6021 + title: "Disable USB Storage." + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/usb_storage.conf Add the following line: install usb-storage /bin/true Run the following command to unload the usb-storage module: rmmod usb-storage." + compliance: + - cis: ["1.1.24"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["8.4", "8.5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.12.2.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:modprobe -n -v usb-storage -> r:install /bin/true" + - "not c:lsmod -> r:usb-storage" + + ############################################### + # 1.2 Configure Software Updates + ############################################### + # 1.2.1 Ensure GPG keys are configured (Manual) - Not Implemented + # 1.2.2 Ensure package manager repositories are configured (Manual) - Not Implemented + + # 1.2.3 Ensure gpgcheck is globally activated. (Automated) + - id: 6022 + title: "Ensure gpgcheck is globally activated." + description: "The gpgcheck option, found in the main section of the /etc/yum.conf and individual /etc/yum/repos.d/*.repo files determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/yum.conf and set 'gpgcheck=1' in the [main] section. Edit any failing files in /etc/yum.repos.d/*.repo and set all instances of gpgcheck to 1." + compliance: + - cis: ["1.2.3"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - "f:/etc/yum.conf -> r:gpgcheck=1" + - 'd:/etc/yum.repos.d/ -> r:\.*.repo -> r:gpgcheck=1' + + ############################################### + # 1.3 Filesystem Integrity Checking + ############################################### + + # 1.3.1 Ensure AIDE is installed. (Automated) + - id: 6023 + title: "Ensure AIDE is installed." + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system. Note: The prelinking feature can interfere with AIDE because it alters binaries to speed up their start up times. Run prelink -ua to restore the binaries to their prelinked state, thus avoiding false positives from AIDE." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # yum install aide Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: Run the following commands: # aide --init # mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz." + references: + - "http://aide.sourceforge.net/stable/manual.html" + compliance: + - cis: ["1.3.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AC-6(9)"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:rpm -q aide -> r:aide-\S*' + + # 1.3.2 Ensure filesystem integrity is regularly checked. (Automated) + - id: 6024 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check OR if aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + references: + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service" + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer" + compliance: + - cis: ["1.3.2"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AC-6(9)"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:systemctl is-enabled aidecheck.service -> r:enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:enabled" + - "c:systemctl status aidecheck.timer -> r:enabled" + + ############################################### + # 1.4 Secure Boot Settings + ############################################### + + # 1.4.1 Ensure bootloader password is set. (Automated) - Not Implemented + # 1.4.2 Ensure permissions on bootloader config are configured. (Automated) - Not Implemented + + # 1.4.3 Ensure authentication required for single user mode. (Automated) + - id: 6025 + title: "Ensure authentication required for single user mode." + description: "Single user mode (rescue mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader. Note: The systemctl option --fail is synonymous with --job-mode=fail. Using either is acceptable." + rationale: "Requiring authentication in single user mode (rescue mode) prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: 'Edit /usr/lib/systemd/system/rescue.service and /usr/lib/systemd/system/emergency.service and set ExecStart to use /sbin/sulogin or /usr/sbin/sulogin: ExecStart=-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default".' + compliance: + - cis: ["1.4.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/usr/lib/systemd/system/rescue.service -> r:ExecStart=-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"|ExecStart=-/bin/sh -c "/usr/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"' + - 'f:/usr/lib/systemd/system/emergency.service -> r:ExecStart=-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"|ExecStart=-/bin/sh -c "/usr/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"' + + ############################################### + # 1.5 Additional Process Hardening + ############################################### + # 1.5.1 Ensure core dumps are restricted. (Automated) + - id: 6026 + title: "Ensure core dumps are restricted." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5)). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0 If systemd-coredump is installed: edit /etc/systemd/coredump.conf and add/modify the following lines: Storage=none ProcessSizeMax=0 Run the command: systemctl daemon-reload." + compliance: + - cis: ["1.5.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/security/limits.conf -> r:hard\s*\t*core\s*\t*0$' + - 'd:/etc/security/limits.d/ -> r:\. -> r:hard\s*\t*core\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + - 'f:/etc/sysctl.conf -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + - 'd:/etc/sysctl.d/ -> r:\. -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + + # 1.5.2 Ensure XD/NX support is enabled. (Automated) + - id: 6027 + title: "Ensure XD/NX support is enabled." + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system. Note: Ensure your system supports the XD or NX bit and has PAE support before implementing this recommendation as this may prevent it from booting if these are not supported by your hardware." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.5.2"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'c:journalctl -> r:\s*protection:\s*\t*active' + + # 1.5.3 Ensure address space layout randomization (ASLR) is enabled. (Automated) + - id: 6028 + title: "Ensure address space layout randomization (ASLR) is enabled." + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2." + compliance: + - cis: ["1.5.3"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + - 'f:/etc/sysctl.conf -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'd:/etc/sysctl.d -> r:\.* -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + + # 1.5.4 Ensure prelink is not installed. (Automated) + - id: 6029 + title: "Ensure prelink is not installed." + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following command to restore binaries to normal: # prelink -ua Run the following command to uninstall prelink: # yum remove prelink." + compliance: + - cis: ["1.5.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:rpm -q prelink -> r:package prelink is not installed" + + ############################################### + # 1.6 Mandatory Access Control + ############################################### + # 1.6.1.1 Ensure SELinux is installed. (Automated) + - id: 6030 + title: "Ensure SELinux is installed." + description: "SELinux provides Mandatory Access Control." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install SELinux: # yum install libselinux." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:rpm -q libselinux -> r:libselinux-\S+' + + # 1.6.1.2 Ensure SELinux is not disabled in bootloader configuration. (Automated) - Not Implemented + + # 1.6.1.3 Ensure SELinux policy is configured. (Automated) + - id: 6031 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only. Note: If your organization requires stricter policies, ensure that they are set in the /etc/selinux/config file." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + - 'c:sestatus -> r:^Loaded policy name:\s*\t*targeted$|^Loaded policy name:\s*\t*mls' + + # 1.6.1.4 Ensure the SELinux mode is enforcing or permissive. (Automated) + - id: 6032 + title: "Ensure the SELinux mode is enforcing or permissive." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes" + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing|^Permissive" + - "f:/etc/selinux/config -> r:^SELINUX=enforcing|^SELINUX=permissive" + + # 1.6.1.5 Ensure the SELinux mode is enforcing. (Automated) + - id: 6033 + title: "Ensure the SELinux mode is enforcing." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode the system not only avoids enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future. Running SELinux in Permissive mode, though helpful for developing SELinux policy, only logs access denial entries, but does not deny any operations." + remediation: "Run the following command to set SELinux's running mode: # setenforce 1 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes" + compliance: + - cis: ["1.6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing" + - "f:/etc/selinux/config -> r:^SELINUX=enforcing" + + # 1.6.1.6 Ensure no unconfined services exist. (Automated) + - id: 6034 + title: "Ensure no unconfined services exist." + description: "Unconfined processes run in unconfined domains Note: Occasionally certain daemons such as backup or centralized management software may require running unconfined. Any such software should be carefully analyzed and documented before such an exception is made." + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules - it does not replace them." + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:ps -eZ -> r:unconfined_service_t" + + # 1.6.1.7 Ensure SETroubleshoot is not installed. (Automated) + - id: 6035 + title: "Ensure SETroubleshoot is not installed." + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to Uninstall setroubleshoot: # yum remove setroubleshoot." + compliance: + - cis: ["1.6.1.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.9.1.1"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q setroubleshoot -> r:package setroubleshoot is not installed" + + # 1.6.1.8 Ensure the MCS Translation Service (mcstrans) is not installed. (Automated) + - id: 6036 + title: "Ensure the MCS Translation Service (mcstrans) is not installed." + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf." + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # yum remove mcstrans." + compliance: + - cis: ["1.6.1.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q mcstrans -> r:package mcstrans is not installed" + + ############################################### + # 1.7 Command Line Warning Banners + ############################################### + + # 1.7.1 Ensure message of the day is configured properly. (Automated) + - id: 6037 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + + # 1.7.2 Ensure local login warning banner is configured properly. (Automated) + - id: 6038 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.7.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + + # 1.7.3 Ensure remote login warning banner is configured properly. (Automated) + - id: 6039 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + + # 1.7.4 Ensure permissions on /etc/motd are configured. (Automated) + - id: 6040 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd : # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.5 Ensure permissions on /etc/issue are configured. (Automated) + - id: 6041 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue : # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured. (Automated) + - id: 6042 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + ############################################### + # 1.8 GNOME Display Manager + ############################################### + # 1.8.1 Ensure GNOME Display Manager is removed. (Manual) + - id: 6043 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + impact: "Removing the GNOME Display manager will remove the GUI from the system." + remediation: "Run the following command to remove the gdm package # yum remove gdm." + references: + - "https://wiki.gnome.org/Projects/GDM" + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q gdm -> r:package gdm is not installed" + + # 1.8.2 Ensure GDM login banner is configured. (Automated) + - id: 6044 + title: "Ensure GDM login banner is configured." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Note: If a graphical login is not required, it should be removed to reduce the attack surface of the system." + remediation: "Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/01-banner-message) [org/gnome/login-screen] banner-message-enable=true banner-message-text='' Example Banner Text: 'Authorized users only. All activity may be monitored and reported.' Run the following command to update the system databases: # dconf update." + compliance: + - cis: ["1.8.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm -> r:user-db:user" + - "f:/etc/dconf/profile/gdm -> r:system-db:gdm" + - "f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:banner-message-enable=true' + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:banner-message-text=\.+' + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:disable-user-list=true' + + # 1.8.3 Ensure last logged in user display is disabled. (Automated) + - id: 6045 + title: "Ensure last logged in user display is disabled." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Displaying the last logged in user eliminates half of the Userid/Password equation that an unauthorized person would need to log on. Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Notes: - - If a graphical login is not required, it should be removed to reduce the attack surface of the system. If a different GUI login service is in use and required on the system, consult your documentation to disable displaying the last logged on user." + remediation: "Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/00-login-screen) [org/gnome/login-screen] # Do not show the user list disable-user-list=true Run the following command to update the system databases: # dconf update." + compliance: + - cis: ["1.8.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm -> r:user-db:user" + - "f:/etc/dconf/profile/gdm -> r:system-db:gdm" + - "f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:disable-user-list=true' + + # 1.8.4 Ensure XDCMP is not enabled. (Automated) + - id: 6046 + title: "Ensure XDCMP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. - XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user - XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server." + remediation: "Edit the file /etc/gdm/custom.conf and remove the line Enable=true." + references: + - "https://help.gnome.org/admin/gdm/2.32/configuration.html.en" + compliance: + - cis: ["1.8.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - 'f:/etc/gdm/custom.conf -> r:^\s*Enable\s*=\s*true' + + # 1.9 Ensure updates, patches, and additional security software are installed. (Manual) + + ############################################### + # 2 OS Services + ############################################### + ############################################### + # 2.1 inetd Services + ############################################### + + # 2.1.1 Ensure xinetd is not installed (Automated) + - id: 6047 + title: "Ensure xinetd is not installed." + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed to reduce the attack surface are of the system. Note: If an xinetd service or services are required, ensure that any xinetd service not required is stopped and disabled." + remediation: "Run the following command to remove xinetd: # yum remove xinetd." + compliance: + - cis: ["2.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q xinetd -> r:package xinetd is not installed" + + ############################################### + # 2.2 Special Purpose Services + ############################################### + + # 2.2.1.1 Ensure time synchronization is in use. (Manual) + - id: 6048 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them. Note: - If another method for time synchronization is being used, this section may be skipped. - Only one time synchronization package should be installed." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Run One of the following commands to install chrony or NTP: To install chrony, run the following command: # yum install chrony OR To install ntp, run the following command: # yum install ntp Note: On systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization." + compliance: + - cis: ["2.2.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: any + rules: + - "c:rpm -q chrony ntp -> r:chrony-" + - "c:rpm -q ntp -> r:ntp-" + + # 2.2.1.2 Ensure chrony is configured. (Automated) + - id: 6049 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. Note: This recommendation only applies if chrony is in use on the system." + remediation: 'Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include ''-u chrony'': OPTIONS="-u chrony".' + compliance: + - cis: ["2.2.1.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\.+$|^pool\.+$' + - 'f:/etc/sysconfig/chronyd -> r:^OPTIONS\s*=\s* && r:-u chrony' + + # 2.2.1.3 Ensure ntp is configured. (Automated) + - id: 6050 + title: "Ensure ntp is configured." + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. Note: This recommendation only applies if ntp is in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: 'Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ''-u ntp:ntp'': OPTIONS="-u ntp:ntp" Reload the systemd daemon: systemctl daemon-reload Enable and start the ntp service: systemctl --now enable ntpd.' + compliance: + - cis: ["2.2.1.3"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled ntpd -> r:enabled" + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/sysconfig/ntpd -> r:^OPTIONS\s*=\s* && r:-u ntp:ntp' + + # 2.2.2 Ensure X11 Server components are not installed. (Automated) + - id: 6051 + title: "Ensure X11 Server components are not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: 'Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime.' + remediation: "Run the following command to remove the X Windows Server packages: # yum remove xorg-x11-server*." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -qa xorg-x11-server* -> r:^xorg-x11-server" + + # 2.2.3 Ensure Avahi Server is not installed. (Automated) + - id: 6052 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to stop, mask and remove avahi-autoipd and avahi: # systemctl stop avahi-daemon.socket avahi-daemon.service # yum remove avahi-autoipd avahi." + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q avahi-autoipd -> r:package avahi-autoipd is not installed" + - "c:rpm -q avahi -> r:package avahi is not installed" + + # 2.2.4 Ensure CUPS is not installed. (Automated) + - id: 6053 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface. Note: Removing CUPS will prevent printing from the system." + impact: "Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to remove cups: # yum remove cups." + references: + - "http://www.cups.org" + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q cups -> r:package cups is not installed" + + # 2.2.5 Ensure DHCP Server is not installed. (Automated) + - id: 6054 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that the dhcp package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcp: # yum remove dhcp." + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dhcp -> r:package dhcp is not installed" + + # 2.2.6 Ensure LDAP server is not installed. (Automated) + - id: 6055 + title: "Ensure LDAP server is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to remove openldap-servers: # yum remove openldap-servers." + references: + - "http://www.openldap.org" + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q openldap-servers -> r:package openldap-servers is not installed" + + # 2.2.7 Ensure DNS Server is not installed. (Automated) + - id: 6056 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove bind: # yum remove bind." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q bind -> r:package bind is not installed" + + # 2.2.8 Ensure FTP Server is not installed. (Automated) + - id: 6057 + title: "Ensure FTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface. Note: Additional FTP servers also exist and should be removed if not required." + remediation: "Run the following command to remove vsftpd: # yum remove vsftpd." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q vsftpd -> r:package vsftpd is not installed" + + # 2.2.9 Ensure HTTP server is not installed. (Automated) + - id: 6058 + title: "Ensure HTTP server is not installed." + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be removed to reduce the potential attack surface. Notes: - Several http servers exist. apache, apache2, lighttpd, and nginx are example packages that provide an HTTP server. - These and other packages should also be audited, and removed if not required." + remediation: "Run the following command to remove httpd: # yum remove httpd." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q httpd -> r:package httpd is not installed" + + # 2.2.10 Ensure IMAP and POP3 server is not installed. (Automated) + - id: 6059 + title: "Ensure IMAP and POP3 server is not installed." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface. Notes: - Several IMAP/POP3 servers exist and can use other service names. courier-imap and cyrus-imap are example services that provide a mail server. - These and other services should also be audited and the packages removed if not required." + remediation: "Run the following command to remove dovecot: # yum remove dovecot." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dovecot -> r:package dovecot is not installed" + + # 2.2.11 Ensure Samba is not installed. (Automated) + - id: 6060 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # yum remove samba." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q samba -> r:package samba is not installed" + + # 2.2.12 Ensure HTTP Proxy Server is not installed. (Automated) + - id: 6061 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "Unless a system is specifically set up to act as a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface. Note: Several HTTP proxy servers exist. These should be checked and removed unless required." + remediation: "Run the following command to remove the squid package: # yum remove squid." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q squid -> r:package squid is not installed" + + # 2.2.13 Ensure net-snmp is not installed. (Automated) + - id: 6062 + title: "Ensure net-snmp is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. If SNMP v2 is absolutely necessary, modify the community strings' values. -." + remediation: "Run the following command to remove net-snmpd: # yum remove net-snmp." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q net-snmp -> r:package net-snmp is not installed" + + # 2.2.14 Ensure NIS server is not installed. (Automated) + - id: 6063 + title: "Ensure NIS server is not installed." + description: "The ypserv package provides the Network Information Service (NIS). This service, formally known as Yellow Pages, is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the ypserv package be removed, and if required a more secure services be used." + remediation: "Run the following command to remove ypserv: # yum remove ypserv." + compliance: + - cis: ["2.2.14"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ypserv -> r:package ypserv is not installed" + + # 2.2.15 Ensure telnet-server is not installed. (Automated) + - id: 6064 + title: "Ensure telnet-server is not installed." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to remove the telnet-server package: # yum remove telnet-server." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet-server -> r:package telnet-server is not installed" + + # 2.2.16 Ensure mail transfer agent is configured for local-only mode. (Automated) + - id: 6065 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Notes: - This recommendation is designed around the postfix mail server. - Depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - 'c:ss -lntu -> r:LISTEN\.*:25\s* && !r:127.0.0.1:25\.*|\s*\.*::1' + + # 2.2.17 Ensure nfs-utils is not installed or the nfs-server service is masked. (Automated) + - id: 6066 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not require network shares, it is recommended that the nfs-utils package be removed to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # yum remove nfs-utils OR If the nfs-package is required as a dependency, run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server." + compliance: + - cis: ["2.2.17"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nfs-utils -> r:package nfs-utils is not installed" + + # 2.2.18 Ensure rpcbind is not installed or the rpcbind services are masked. (Automated) + - id: 6067 + title: "Ensure rpcbind is not installed or the rpcbind services are masked." + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening." + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # yum remove rpcbind OR If the rpcbind package is required as a dependency, run the following commands to stop and mask the rpcbind and rpcbind.socket services: # systemctl --now mask rpcbind # systemctl --now mask rpcbind.socket." + compliance: + - cis: ["2.2.18"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rpcbind -> r:package rpcbind is not installed" + - "c:systemctl is-enabled rpcbind -> r:masked" + - "c:systemctl is-enabled rpcbind.socket -> r:masked" + + # 2.2.19 Ensure rsync is not installed or the rsyncd service is masked. (Automated) + - id: 6068 + title: "Ensure rsync is not installed or the rsyncd service is masked." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication. Note: If a required dependency exists for the rsync package, but the rsyncd service is not required, the service should be masked." + impact: "There are packages that are dependent on the rsync package. If the rsync package is removed, these packages will be removed as well. Before removing the rsync package, review any dependent packages to determine if they are required on the system. If a dependent package is required, mask the rsyncd service and leave the rsync package installed." + remediation: "Run the following command to remove the rsync package: # yum remove rsync OR Run the following command to mask the rsyncd service: # systemctl --now mask rsyncd." + compliance: + - cis: ["2.2.19"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rsync -> r:package rprsynccbind is not installed" + - "c:systemctl is-enabled rsyncd -> r:masked" + + ############################################### + # 2.3 Service Clients + ############################################### + + # 2.3.1 Ensure NIS Client is not installed. (Automated) + - id: 6069 + title: "Ensure NIS Client is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the ypbind package: # yum remove ypbind." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ypbind -> r:package ypbind is not installed" + + # 2.3.2 Ensure rsh client is not installed. (Automated) + - id: 6070 + title: "Ensure rsh client is not installed." + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the rsh package: # yum remove rsh." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q rsh -> r:package rsh is not installed" + + # 2.3.3 Ensure talk client is not installed. (Automated) + - id: 6071 + title: "Ensure talk client is not installed." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the talk package: # yum remove talk." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q talk -> r:package talk is not installed" + + # 2.3.4 Ensure telnet client is not installed. (Automated) + - id: 6072 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the telnet package: # yum remove telnet." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet -> r:package telnet is not installed" + + # 2.3.5 Ensure LDAP client is not installed. (Automated) + - id: 6073 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Run the following command to remove the openldap-clients package: # yum remove openldap-clients." + compliance: + - cis: ["2.3.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q openldap-clients -> r:package openldap-clients is not installed" + + # 2.4 Ensure nonessential services are removed or masked. (Manual) + - id: 6074 + title: "Ensure nonessential services are removed or masked." + description: "A network port is identified by its number, the associated IP address, and the type of the communication protocol such as TCP or UDP. A listening port is a network port on which an application or process listens on, acting as a communication endpoint. Each listening port can be open or closed (filtered) using a firewall. In general terms, an open port is a network port that accepts incoming packets from remote locations." + rationale: "Services listening on the system pose a potential risk as an attack vector. These services should be reviewed, and if not required, the service should be stopped, and the package containing the service should be removed. If required packages have a dependency, the service should be stopped and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove the package containing the service: # yum remove OR If required packages have a dependency: Run the following command to stop and mask the service: # systemctl --now mask ." + compliance: + - cis: ["2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:lsof -i -P -n -> r:(ESTABLISHED)" + + ############################################### + # 3 Network Configuration and Firewalls + ############################################### + ############################################### + # 3.1 Disable unused network protocols and devices + ############################################### + + # 3.1.1 Disable IPv6. (Manual) + - id: 6075 + title: "Disable IPv6." + description: "Although IPv6 has many advantages over IPv4, not all organizations have IPv6 or dual stack configurations implemented." + rationale: "If IPv6 or dual stack is not to be used, it is recommended that IPv6 be disabled to reduce the attack surface of the system." + impact: "If IPv6 is disabled through sysctl config, SSH X11forwarding may no longer function as expected. We recommend that SSH X11fowarding be disabled, but if required, the following will allow for SSH X11forwarding with IPv6 disabled through sysctl config: Add the following line the /etc/ssh/sshd_config file: AddressFamily inet Run the following command to re-start the openSSH server: # systemctl restart sshd." + remediation: 'Use one of the two following methods to disable IPv6 on the system: To disable IPv6 through the GRUB2 config: Edit /etc/default/grub and add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX="ipv6.disable=1" Ru the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg OR To disable IPv6 through sysctl settings: Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.disable_ipv6=1 # sysctl -w net.ipv6.conf.default.disable_ipv6=1 # sysctl -w net.ipv6.route.flush=1.' + compliance: + - cis: ["3.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*\t*linux && !r:ipv6.disable=1' + - 'c:sysctl net.ipv6.conf.all.disable_ipv6 -> r:net.ipv6.conf.all.disable_ipv6\s*=\s*0' + - 'c:sysctl net.ipv6.conf.default.disable_ipv6 -> r:net.ipv6.conf.default.disable_ipv6\s*=\s*0' + + # 3.1.2 Ensure wireless interfaces are disabled. (Automated) - Not Implemented + + ################################################## + # 3.2 Network Parameters (Host Only) + ################################################## + + # 3.2.1 Ensure IP forwarding is disabled. (Automated) + - id: 6076 + title: "Ensure IP forwarding is disabled." + description: "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not." + rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Run the following commands to restore the default parameters and set the active kernel parameters: # grep -Els \"^\\s*net\\.ipv4\\.ip_forward\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv4\\.ip_forward\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv4.ip_forward=0; sysctl -w net.ipv4.route.flush=1 # grep -Els \"^\\s*net\\.ipv6\\.conf\\.all\\.forwarding\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv6\\.conf\\.all\\.forwarding\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv6.conf.all.forwarding=0; sysctl -w net.ipv6.route.flush=1." + compliance: + - cis: ["3.2.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.ip_forward\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.ip_forward\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.ip_forward\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.ip_forward\s*=\s*1$' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.ip_forward\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.forwarding\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.forwarding\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.forwarding\s*=\s*1$' + + # 3.2.2 Ensure packet redirect sending is disabled. (Automated) + - id: 6077 + title: "Ensure packet redirect sending is disabled." + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.2.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + ################################################## + # 3.3 Network Parameters (Host and Router) + ################################################## + + # 3.3.1 Ensure source routed packets are not accepted. (Automated) + - id: 6078 + title: "Ensure source routed packets are not accepted." + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1 IF IPv6 is not disabled: Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_source_route=0 # sysctl -w net.ipv6.conf.default.accept_source_route=0 # sysctl -w net.ipv6.route.flush=1." + compliance: + - cis: ["3.3.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + + # 3.3.2 Ensure ICMP redirects are not accepted. (Automated) + - id: 6079 + title: "Ensure ICMP redirects are not accepted." + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects and net.ipv6.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1 IF IPv6 is not disabled Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1." + compliance: + - cis: ["3.3.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + + # 3.3.3 Ensure secure ICMP redirects are not accepted. (Automated) + - id: 6080 + title: "Ensure secure ICMP redirects are not accepted." + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + # 3.3.4 Ensure suspicious packets are logged. (Automated) + - id: 6081 + title: "Ensure suspicious packets are logged." + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + # 3.3.5 Ensure broadcast ICMP requests are ignored. (Automated) + - id: 6082 + title: "Ensure broadcast ICMP requests are ignored." + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.5"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + # 3.3.6 Ensure bogus ICMP responses are ignored. (Automated) + - id: 6083 + title: "Ensure bogus ICMP responses are ignored." + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.6"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + # 3.3.7 Ensure Reverse Path Filtering is enabled. (Automated) + - id: 6084 + title: "Ensure Reverse Path Filtering is enabled." + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.7"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + + # 3.3.8 Ensure TCP SYN Cookies is enabled. (Automated) + - id: 6085 + title: "Ensure TCP SYN Cookies is enabled." + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + # 3.3.9 Ensure IPv6 router advertisements are not accepted. (Automated) + - id: 6086 + title: "Ensure IPv6 router advertisements are not accepted." + description: "This setting disables the system's ability to accept IPv6 router advertisements." + rationale: "It is recommended that systems do not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "IF IPv6 is enabled: Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1." + compliance: + - cis: ["3.3.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_raa -> r:^net.ipv6.conf.all.accept_raa\s*=\s*1$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:^net.ipv6.conf.default.accept_ra\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv6.conf.all.accept_raa\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.accept_raa\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.accept_raa\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.accept_raa\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv6.conf.default.accept_ra\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.default.accept_ra\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.default.accept_ra\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.default.accept_ra\s*=\s*1$' + + ############################################### + # 3.4 Uncommon Network Protocols + ############################################### + + - id: 6087 + title: "Ensure DCCP is disabled." + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/dccp.conf Add the following line: install dccp /bin/true." + compliance: + - cis: ["3.4.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:modprobe -n -v dccp -> r:install\s*\t*/bin/true' + - "not c:lsmod -> r:dccp" + + # 3.4.2 Ensure SCTP is disabled. (Automated) + - id: 6088 + title: "Ensure SCTP is disabled." + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/sctp.conf Add the following line: install sctp /bin/true." + compliance: + - cis: ["3.4.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:modprobe -n -v sctp -> r:install\s*\t*/bin/true' + - "not c:lsmod -> r:sctp" + + ############################################### + # 3.5 Firewall Configuration + ############################################### + ############################################### + # 3.5.1 Configure firewalld + ############################################### + + # 3.5.1.1 Ensure firewalld is installed. (Automated) + - id: 6089 + title: "Ensure firewalld is installed." + description: "firewalld is a firewall management tool for Linux operating systems. It provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the iptables backend or provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the nftables utility. firewalld replaces iptables as the default firewall management tool. Use the firewalld utility to configure a firewall for less complex firewalls. The utility is easy to use and covers the typical use cases scenario. FirewallD supports both IPv4 and IPv6 networks and can administer separate firewall zones with varying degrees of trust as defined in zone profiles. Note: Starting in v0.6.0, FirewallD added support for acting as a front-end for the Linux kernel's netfilter framework via the nftables userspace utility, acting as an alternative to the nft command line program." + rationale: "A firewall utility is required to configure the Linux kernel's netfilter framework via the iptables or nftables back-end. The Linux kernel's netfilter framework host-based firewall can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host. Note: Only one firewall utility should be installed and configured. FirewallD is dependent on the iptables package." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install FirewallD and iptables: # yum install firewalld iptables." + compliance: + - cis: ["3.5.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q firewalld -> r:firewalld-" + - "c:rpm -q iptables -> r:iptables-" + + # 3.5.1.2 Ensure iptables-services not installed with firewalld. (Automated) + - id: 6090 + title: "Ensure iptables-services not installed with firewalld." + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both firewalld and the services included in the iptables-services package may lead to conflict." + impact: "Running both firewalld and iptables/ip6tables service may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package # systemctl stop iptables # systemctl stop ip6tables # yum remove iptables-services." + compliance: + - cis: ["3.5.1.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q iptables-services -> r:package iptables-services is not installed" + + # 3.5.1.3 Ensure nftables either not installed or masked with firewalld. (Automated) + - id: 6091 + title: "Ensure nftables either not installed or masked with firewalld." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables. _Note: Support for using nftables as the back-end for firewalld was added in release v0.6.0. In Fedora 19 Linux derivatives, firewalld utilizes iptables as its back-end by default." + rationale: "Running both firewalld and nftables may lead to conflict. Note: firewalld may configured as the front-end to nftables. If this case, nftables should be stopped and masked instead of removed." + remediation: 'Run the following command to remove nftables: # yum remove nftables OR Run the following command to stop and mask nftables" systemctl --now mask nftables.' + compliance: + - cis: ["3.5.1.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q nftables -> r:package nftables is not installed" + - 'not c:systemctl status nftables -> r:active \(running\)|\(exited\)' + - "c:systemctl is-enabled nftables -> r:masked" + + # 3.5.1.4 Ensure firewalld service enabled and running. (Automated) + - id: 6092 + title: "Ensure firewalld service enabled and running." + description: "firewalld.service enables the enforcement of firewall rules configured through firewalld." + rationale: "Ensure that the firewalld.service is enabled and running to enforce firewall rules configured through firewalld." + impact: "Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following command to unmask firewalld # systemctl unmask firewalld Run the following command to enable and start firewalld # systemctl --now enable firewalld." + compliance: + - cis: ["3.5.1.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled firewalld -> r:enabled" + - "c:firewall-cmd --state -> r:running" + + # 3.5.1.5 Ensure firewalld default zone is set. (Automated) - Not Implemented + # 3.5.1.6 Ensure network interfaces are assigned to appropriate zone. (Manual) - Not Implemented + # 3.5.1.7 Ensure firewalld drops unnecessary services and ports. (Manual) - Not Implemented + ############################################### + # 3.5.2 Configure nftables + ############################################### + + # 3.5.2.1 Ensure nftables is installed. (Automated) + - id: 6093 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem. Note: - nftables is available in Linux kernel 3.13 and newer. - Only one firewall utility should be installed and configured." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install nftables # yum install nftables." + compliance: + - cis: ["3.5.2.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:nftables-" + + # 3.5.2.2 Ensure firewalld is either not installed or masked with nftables. (Automated) + - id: 6094 + title: "Ensure firewalld is either not installed or masked with nftables." + description: 'firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with support for network/firewall "zones" to assign a level of trust to a network and its associated connections, interfaces or sources. It has support for IPv4, IPv6, Ethernet bridges and also for IPSet firewall settings. There is a separation of the runtime and permanent configuration options.' + rationale: "Running both nftables.service and firewalld.service may lead to conflict and unexpected results." + remediation: "Run the following command to remove firewalld # yum remove firewalld OR Run the following command to stop and mask firewalld # systemctl --now mask firewalld." + compliance: + - cis: ["3.5.2.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q firewalld -> r:package firewalld is not installed" + - "c:command -v firewall-cmd >/dev/null && firewall-cmd --state -> r:not running" + - "c:systemctl is-enabled firewalld -> r:masked" + + # 3.5.2.3 Ensure iptables-services not installed with nftables. (Automated) + - id: 6095 + title: "Ensure iptables-services not installed with nftables." + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both nftables and the services included in the iptables-services package may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package # systemctl stop iptables # systemctl stop ip6tables # yum remove iptables-services." + compliance: + - cis: ["3.5.2.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q iptables-services -> r:package iptables-services is not installed" + + # 3.5.2.4 Ensure iptables are flushed with nftables. (Manual) + - id: 6096 + title: "Ensure iptables are flushed with nftables." + description: "nftables is a replacement for iptables, ip6tables, ebtables and arptables." + rationale: "It is possible to mix iptables and nftables. However, this increases complexity and also the chance to introduce errors. For simplicity flush out all iptables rules, and ensure it is not loaded." + remediation: "Run the following commands to flush iptables: For iptables: # iptables -F For ip6tables: # ip6tables -F." + compliance: + - cis: ["3.5.2.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: none + rules: + - "c:iptables -L -> r:Chain INPUT" + - "c:ip6tables -L -> r:Chain INPUT" + + # 3.5.2.5 Ensure an nftables table exists. (Automated) + - id: 6097 + title: "Ensure an nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + impact: "Adding rules to a running nftables can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example: # nft create table inet filter." + compliance: + - cis: ["3.5.2.5"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list tables -> r:table" + + # 3.5.2.6 Ensure nftables base chains exist. (Automated) + - id: 6098 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.5.2.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:type filter hook input priority 0" + - "c:nft list ruleset -> r:type filter forward priority 0" + - "c:nft list ruleset -> r:type filter hook output priority 0" + + # 3.5.2.7 Ensure nftables loopback traffic is configured. (Automated) + - id: 6099 + title: "Ensure nftables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # nft add rule inet filter input iif lo accept # nft create rule inet filter input ip saddr 127.0.0.0/8 counter drop IF IPv6 is enabled: Run the following command to implement the IPv6 loopback rules: # nft add rule inet filter input ip6 saddr ::1 counter drop." + compliance: + - cis: ["3.5.2.7"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:nft list ruleset -> r:iif "lo" accept' + - "c:nft list ruleset -> r:ip saddr 127.0.0.0/8 counter packets 0 bytes 0 drop" + + # 3.5.2.8 Ensure nftables outbound and established connections are configured. (Manual) + - id: 6100 + title: "Ensure nftables outbound and established connections are configured." + description: "Configure the firewall rules for new outbound and established connections." + rationale: "If rules are not in place for new outbound and established connections, all packets will be dropped by the default policy preventing network usage." + remediation: "Configure nftables in accordance with site policy. The following commands will implement a policy to allow all outbound connections and all established connections: # nft add rule inet filter input ip protocol tcp ct state established accept # nft add rule inet filter input ip protocol udp ct state established accept # nft add rule inet filter input ip protocol icmp ct state established accept # nft add rule inet filter output ip protocol tcp ct state new,related,established accept # nft add rule inet filter output ip protocol udp ct state new,related,established accept # nft add rule inet filter output ip protocol icmp ct state new,related,established accept." + compliance: + - cis: ["3.5.2.8"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:ip protocol tcp ct state established accept" + - "c:nft list ruleset -> r:ip protocol udp ct state established accept" + - "c:nft list ruleset -> r:ip protocol icmp ct state established accept" + - "c:nft list ruleset -> r:ip protocol tcp ct state established,related,new accept" + - "c:nft list ruleset -> r:ip protocol udp ct state established,related,new accept" + - "c:nft list ruleset -> r:ip protocol icmp ct state established,related,new accept" + + # 3.5.2.9 Ensure nftables default deny firewall policy. (Automated) + - id: 6101 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue traversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over the network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; } # nft chain inet filter output { policy drop \\; }." + compliance: + - cis: ["3.5.2.9"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:type filter hook input priority 0; policy drop;" + - "c:nft list ruleset -> r:type filter hook forward priority 0; policy drop;" + - "c:nft list ruleset -> r:type filter hook output priority 0; policy drop;" + + # 3.5.2.10 Ensure nftables service is enabled. (Automated) + - id: 6102 + title: "Ensure nftables service is enabled." + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables." + compliance: + - cis: ["3.5.2.10"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled nftables -> r:enabled" + + # 3.5.2.11 Ensure nftables rules are permanent. (Automated) + - id: 6103 + title: "Ensure nftables rules are permanent." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames. The nftables service reads the /etc/sysconfig/nftables.conf file for a nftables file or files to include in the nftables ruleset. A nftables ruleset containing the input, forward, and output base chains allow network traffic to be filtered." + rationale: "Changes made to nftables ruleset only affect the live system, you will also need to configure the nftables ruleset to apply on boot." + remediation: 'Edit the /etc/sysconfig/nftables.conf file and un-comment or add a line with include for each nftables file you want included in the nftables ruleset on boot: Example: include "/etc/nftables/nftables.rules".' + compliance: + - cis: ["3.5.2.11"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'f:/etc/sysconfig/nftables.conf -> r:^include "/etc/nftables/nftables.rules"' + - 'not f:/etc/sysconfig/nftables.conf -> r:#\s*include "/etc/nftables/nftables.rules"' + + ############################################### + # 3.5.3 Configure iptables + ############################################### + ############################################### + #3.5.3.1 Configure iptables software + ############################################### + + # 3.5.3.1.1 Ensure iptables packages are installed. (Automated) + - id: 6104 + title: "Ensure iptables packages are installed." + description: "iptables is a utility program that allows a system administrator to configure the tables provided by the Linux kernel firewall, implemented as different Netfilter modules, and the chains and rules it stores. Different kernel modules and programs are used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames." + rationale: "A method of configuring and maintaining firewall rules is necessary to configure a Host Based Firewall." + remediation: "Run the following command to install iptables and iptables-services # yum install iptables iptables-services." + compliance: + - cis: ["3.5.3.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q iptables -> r:iptables-" + - "c:rpm -q iptables-services -> r:iptables-services-" + + # 3.5.3.1.2 Ensure nftables is not installed with iptables. (Automated) + - id: 6105 + title: "Ensure nftables is not installed with iptables." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables." + rationale: "Running both iptables and nftables may lead to conflict." + remediation: "Run the following command to remove nftables: # yum remove nftables." + compliance: + - cis: ["3.5.3.1.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:package nftables is not installed" + + # 3.5.3.1.3 Ensure firewalld is either not installed or masked with iptables. (Automated) + - id: 6106 + title: "Ensure firewalld is either not installed or masked with iptables." + description: 'firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with support for network/firewall "zones" to assign a level of trust to a network and its associated connections, interfaces or sources. It has support for IPv4, IPv6, Ethernet bridges and also for IPSet firewall settings. There is a separation of the runtime and permanent configuration options.' + rationale: "Running iptables.service and\\or ip6tables.service with firewalld.service may lead to conflict and unexpected results." + remediation: "Run the following command to remove firewalld # yum remove firewalld OR Run the following command to stop and mask firewalld # systemctl --now mask firewalld." + compliance: + - cis: ["3.5.3.1.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q firewalld -> r:package firewalld is not installed" + - 'not c:systemctl status firewalld -> r:active \(running\)' + - "c:systemctl is-enabled firewalld -> r:masked" + + # 3.5.3.2.1 Ensure iptables loopback traffic is configured. (Automated) + - id: 6107 + title: "Ensure iptables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP." + compliance: + - cis: ["3.5.3.2.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)' + + # 3.5.3.2.2 Ensure iptables outbound and established connections are configured. (Manual) - Not Implemented + # 3.5.3.2.3 Ensure iptables rules exist for all open ports. (Automated) - Not Implemented + + # 3.5.3.2.4 Ensure iptables default deny firewall policy. (Automated) + - id: 6108 + title: "Ensure iptables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP." + compliance: + - cis: ["3.5.3.2.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - 'c:iptables -L -> r:/Chain INPUT \(policy DROP\)|Chain FORWARD \(policy DROP\)|Chain OUTPUT \(policy DROP\)' + - 'c:iptables -L -> r:/Chain INPUT \(policy REJECT\)|Chain FORWARD \(policy REJECT\)|Chain OUTPUT \(policy REJECT\)' + + # 3.5.3.2.5 Ensure iptables rules are saved. (Automated) + - id: 6109 + title: "Ensure iptables rules are saved." + description: "The iptables-services package includes the /etc/sysconfig/iptables file. The iptables rules in this file will be loaded by the iptables.service during boot, or when it is started or re-loaded." + rationale: "If the iptables rules are not saved and a system re-boot occurs, the iptables rules will be lost." + remediation: "Run the following commands to create or update the /etc/sysconfig/iptables file: Run the following command to review the current running iptables configuration: # iptables -L Output should include: Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere DROP all -- loopback/8 anywhere ACCEPT tcp -- anywhere anywhere state ESTABLISHED ACCEPT udp -- anywhere anywhere state ESTABLISHED ACCEPT icmp -- anywhere anywhere state ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:ssh state NEW Chain FORWARD (policy DROP) target prot opt source destination Chain OUTPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere state NEW,ESTABLISHED ACCEPT udp -- anywhere anywhere state NEW,ESTABLISHED ACCEPT icmp -- anywhere anywhere state NEW,ESTABLISHED Run the following command to save the verified running configuration to the file /etc/sysconfig/iptables: # service iptables save iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]." + compliance: + - cis: ["3.5.3.2.5"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "f:/etc/sysconfig/iptables -> r::INPUT DROP|:FORWARD DROP|:OUTPUT DROP" + - 'c:service iptables save -> r:iptables: Saving firewall rules to /etc/sysconfig/iptables:\[ OK \]' + + # 3.5.3.2.6 Ensure iptables is enabled and running. (Automated) + - id: 6110 + title: "Ensure iptables is enabled and running." + description: "iptables.service is a utility for configuring and maintaining iptables." + rationale: "iptables.service will load the iptables rules saved in the file /etc/sysconfig/iptables at boot, otherwise the iptables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start iptables: # systemctl --now enable iptables." + compliance: + - cis: ["3.5.3.2.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled iptables -> r:enabled" + - 'c:systemctl status iptables -> r:active \(running\)|\(exited\)' + + # 3.5.3.3.1 Ensure ip6tables loopback traffic is configured. (Automated) + - id: 6111 + title: "Ensure ip6tables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP." + compliance: + - cis: ["3.5.3.3.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:ip6tables -L INPUT -v -n -> r:Chain INPUT" + - "c:ip6tables -L OUTPUT -v -n -> r:Chain OUTPUT" + + # 3.5.3.3.2 Ensure ip6tables outbound and established connections are configured. (Manual) - Not Implemented + # 3.5.3.3.3 Ensure ip6tables firewall rules exist for all open ports. (Automated) - Not Implemented + + # 3.5.3.3.4 Ensure ip6tables default deny firewall policy. (Automated) + - id: 6112 + title: "Ensure ip6tables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP." + compliance: + - cis: ["3.5.3.3.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - 'c:ip6tables -L -> r:/Chain INPUT \(policy DROP\)|Chain FORWARD \(policy DROP\)|Chain OUTPUT \(policy DROP\)' + - 'c:ip6tables -L -> r:/Chain INPUT \(policy REJECT\)|Chain FORWARD \(policy REJECT\)|Chain OUTPUT \(policy REJECT\)' + + # 3.5.3.3.5 Ensure ip6tables rules are saved. (Automated) + - id: 6113 + title: "Ensure ip6tables rules are saved." + description: "The iptables-services package includes the /etc/sysconfig/ip6tables file. The ip6tables rules in this file will be loaded by the ip6tables.service during boot, or when it is started or re-loaded." + rationale: "If the ip6tables rules are not saved and a system re-boot occurs, the ip6tables rules will be lost." + remediation: "Run the following commands to create or update the /etc/sysconfig/ip6tables file: Run the following command to review the current running iptables configuration: # ip6tables -L Output should include: Chain INPUT (policy DROP) target prot opt source destination ACCEPT all anywhere anywhere DROP all localhost anywhere ACCEPT tcp anywhere anywhere state ESTABLISHED ACCEPT udp anywhere anywhere state ESTABLISHED ACCEPT icmp anywhere anywhere state ESTABLISHED ACCEPT tcp anywhere anywhere tcp dpt:ssh state NEW Chain FORWARD (policy DROP) target prot opt source destination Chain OUTPUT (policy DROP) target prot opt source destination ACCEPT all anywhere anywhere ACCEPT tcp anywhere anywhere state NEW,ESTABLISHED ACCEPT udp anywhere anywhere state NEW,ESTABLISHED ACCEPT icmp anywhere anywhere state NEW,ESTABLISHED Run the following command to save the verified running configuration to the file /etc/sysconfig/ip6tables: # service ip6tables save ip6tables: Saving firewall rules to /etc/sysconfig/ip6table[ OK ]." + compliance: + - cis: ["3.5.3.3.5"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "f:/etc/sysconfig/ip6tables -> r::INPUT DROP|:FORWARD DROP|:OUTPUT DROP" + - 'c:service ip6tables save -> r:iptables: Saving firewall rules to /etc/sysconfig/ip6tables:\[ OK \]' + + # 3.5.3.3.6 Ensure ip6tables is enabled and running. (Automated) + - id: 6114 + title: "Ensure ip6tables is enabled and running." + description: "ip6tables.service is a utility for configuring and maintaining ip6tables." + rationale: "ip6tables.service will load the iptables rules saved in the file /etc/sysconfig/ip6tables at boot, otherwise the ip6tables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start ip6tables: # systemctl --now start ip6tables." + compliance: + - cis: ["3.5.3.3.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled ip6tables -> r:enabled" + - 'c:systemctl status ip6tables -> r:active \(running\)|\(exited\)' + + ############################################### + # 4 Logging and Auditing + ############################################### + ############################################### + # 4.1 Configure System Accounting (auditd) + ############################################### + + # 4.1.1.1 Ensure auditd is installed. (Automated) + - id: 6115 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # yum install audit audit-libs." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q audit -> r:^audit-" + - "c:rpm -q audit-libs -> r:^audit-libs-" + + # 4.1.1.2 Ensure auditd service is enabled and running. (Automated) + - id: 6116 + title: "Ensure auditd service is enabled and running." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable and start auditd : # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:^enabled" + - 'c:systemctl status auditd -> r:Active: active \(running\)' + + # 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled. (Automated) - Not Implemented + + # 4.1.2.1 Ensure audit log storage size is configured. (Automated) + - id: 6117 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started. Notes: - The max_log_file parameter is measured in megabytes. - Other methods of log rotation may be appropriate based on site policy. One example is time-based rotation strategies which don't have native support in auditd configurations. Manual audit of custom configurations should be evaluated for effectiveness and completeness." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file = \d+' + + # 4.1.2.2 Ensure audit logs are not automatically deleted. (Automated) + - id: 6118 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.2", "6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file_action\s*=\s*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full. (Automated) + - id: 6119 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt' + + # 4.1.2.4 Ensure audit_backlog_limit is sufficient. (Automated) - Not Implemented + + # 4.1.3 Ensure events that modify date and time information are collected. (Automated) + - id: 6120 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier "time-change" Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot.' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems edit or create a file in the \/etc\/audit\/rules.d\/ directory ending in .rules. Example: vi \/etc\/audit\/rules.d\/time-change.rules and add the following lines: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w \/etc\/localtime -p wa -k time-change For 64 bit systems edit or create a file in the \/etc\/audit\/rules.d\/ directory ending in .rules. Example: vi \/etc\/audit\/rules.d\/time-change.rules and add the following lines: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -Farch=b32 -S clock_settime -k time-change -w \/etc\/localtime -p wa -k time-change. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/localtime && r:-p wa && r:-k time-change' + + # 4.1.4 Ensure events that modify user/group information are collected. (Automated) + - id: 6121 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file. Note: Reloading the auditd config to set active settings may require a system reboot.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-identity.rules Add the following lines: -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity." + compliance: + - cis: ["4.1.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/group && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/passwd && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/gshadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/shadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/security/opasswd && r:-p wa && r:-k identity' + + # 4.1.5 Ensure events that modify the system's network environment are collected. (Automated) + - id: 6122 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre-login), /etc/hosts (file containing host names and associated IP addresses) and /etc/sysconfig/network (directory containing network interface scripts and configurations) files. Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: 'Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier "system-locale.".' + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-system_local.rules Add the following lines: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-system_local.rules Add the following lines: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale." + compliance: + - cis: ["4.1.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5", "6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2", "A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: any + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/issue && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/issue.net && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/hosts && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sysconfig/network && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sysconfig/network-scripts/ && r:-p wa && r:-k system-locale' + + # 4.1.6 Ensure events that modify the system's Mandatory Access Controls are collected. (Automated) + - id: 6123 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux/ and /usr/share/selinux/ directories. Note: - If a different Mandatory Access Control method is used, changes to the corresponding directories should be audited. - Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Changes to files in the /etc/selinux/ and /usr/share/selinux/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-MAC_policy.rules Add the following lines: -w /etc/selinux/ -p wa -k MAC-policy -w /usr/share/selinux/ -p wa -k MAC-policy." + compliance: + - cis: ["4.1.6"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/selinux/ && r:-p wa && r:-k MAC-policy' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /usr/share/selinux/ && r:-p wa && r:-k MAC-policy' + + # 4.1.7 Ensure login and logout events are collected. (Automated) + - id: 6124 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. - The file /var/log/lastlog maintain records of the last time a user successfully logged in. - The /var/run/faillock/ directory maintains records of login failures via the pam_faillock module. Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-logins.rules Add the following lines: -w /var/log/lastlog -p wa -k logins -w /var/run/faillock/ -p wa -k logins." + compliance: + - cis: ["4.1.7"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.8.1.3", "A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/log/lastlog && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/run/faillog/ && r:-p wa && r:-k logins' + + # 4.1.8 Ensure session initiation information is collected. (Automated) + - id: 6125 + title: "Ensure session initiation information is collected." + description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file \/var\/run\/utmp tracks all currently logged in users. All audit records will be tagged with the identifier \"session.\" The \/var\/log\/wtmp file tracks logins, logouts, shutdown, and reboot events. The file \/var\/log\/btmp keeps track of failed login attempts and can be read by entering the command \/usr\/bin\/last -f \/var\/log\/btmp .All audit records will be tagged with the identifier \"logins.\" Notes: - The last command can be used to read \/var\/log\/wtmp (last with no parameters) and \/var\/run\/utmp (last -f \/var\/run\/utmp) - Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-session.rules Add the following lines: -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k logins -w /var/log/btmp -p wa -k logins." + compliance: + - cis: ["4.1.8"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.8.1.3", "A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/run/utmp && r:-p wa && r:-k session' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/log/wtmp && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /var/log/btmp && r:-p wa && r:-k logins' + + # 4.1.9 Ensure discretionary access control permission modification events are collected. (Automated) + - id: 6126 + title: "Ensure discretionary access control permission modification events are collected." + description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >=1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\" Note: Systems may have been customized to change the default UID_MIN. To confirm the UID_MIN for your system, run the following command: # awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs If your systems' UID_MIN is not 1000, replace audit>=1000 with audit>= in the Audit and Remediation procedures. Reloading the auditd config to set active settings may require a system reboot." + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-perm_mod.rules Add the following lines: -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-perm_mod.rules Add the following lines: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod." + compliance: + - cis: ["4.1.9"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + + # 4.1.10 Ensure unsuccessful unauthorized file access attempts are collected. (Automated) + - id: 6127 + title: "Ensure unsuccessful unauthorized file access attempts are collected." + description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation (creat), opening (open , openat) and truncation ( truncate , ftruncate) of files. An audit log record will only be written if the user is a non-privileged user (auid>=1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\" Note: Systems may have been customized to change the default UID_MIN. To confirm the UID_MIN for your system, run the following command: # awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs If your systems' UID_MIN is not 1000, replace audit>=1000 with audit>= in the Audit and Remediation procedures. Reloading the auditd config to set active settings may require a system reboot." + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-access.rules Add the following lines: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-access.rules Add the following lines: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access." + compliance: + - cis: ["4.1.10"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + + # 4.1.11 Ensure use of privileged commands is collected. (Automated) - Not Implemented + + # 4.1.12 Ensure successful file system mounts are collected. (Automated) + - id: 6128 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user Note: Systems may have been customized to change the default UID_MIN. To confirm the UID_MIN for your system, run the following command: # awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs If your systems' UID_MIN is not 1000, replace audit>=1000 with audit>= in the Audit and Remediation procedures. Reloading the auditd config to set active settings may require a system reboot." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-mounts.rules Add the following lines: -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-mounts.rules Add the following lines: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts." + compliance: + - cis: ["4.1.12"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' + + # 4.1.13 Ensure file deletion events by users are collected. (Automated) + - id: 6129 + title: "Ensure file deletion events by users are collected." + description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for following system calls and tags them with the identifier \"delete\": - unlink - remove a file - unlinkat - remove a file attribute - rename - rename a file - renameat - rename a file attribute Note: Systems may have been customized to change the default UID_MIN. To confirm the UID_MIN for your system, run the following command: # awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs If your systems' UID_MIN is not 1000, replace audit>=1000 with audit>= in the Audit and Remediation procedures. Reloading the auditd config to set active settings may require a system reboot." + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-deletion.rules Add the following lines: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-deletion.rules Add the following lines: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete." + compliance: + - cis: ["4.1.13"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2", "13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' + + # 4.1.14 Ensure changes to system administration scope (sudoers) is collected. (Automated) + - id: 6130 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: "Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers or a file in the /etc/sudoers.d directory will be written to when the file or its attributes have changed. Note: Reloading the auditd config to set active settings may require a system reboot." + rationale: "Changes in the /etc/sudoers file, or a file in the /etc/sudoers.d/ directory can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules _Example: vi /etc/audit/rules.d/50-scope.rules Add the following lines: -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d/ -p wa -k scope." + compliance: + - cis: ["4.1.14"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers && r:-p wa && r:-k scope' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers.d/ && r:-p wa && r:-k scope' + + # 4.1.15 Ensure system administrator command executions (sudo) are collected. (Automated) + - id: 6131 + title: "Ensure system administrator command executions (sudo) are collected." + description: "sudo provides users with temporary elevated privileges to perform operations. Monitor the administrator with temporary elevated privileges and the operation(s) they performed." + rationale: "creating an audit log of administrators with temporary elevated privileges and the operation(s) they performed is essential to reporting. Administrators will want to correlate the events written to the audit trail with the records written to sudo logfile to verify if unauthorized commands have been executed. Note: Systems may have been customized to change the default UID_MIN. To confirm the UID_MIN for your system, run the following command: # awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs If your systems' UID_MIN is not 1000, replace audit>=1000 with audit>= in the Audit and Remediation procedures. Reloading the auditd config to set active settings may require a system reboot." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules: Example: vi /etc/audit/rules.d/50-actions.rules Add the following line: -a exit,always -F arch=b32 -C euid!=uid -F euid=0 -F auid>=1000 -F auid!=4294967295 -S execve -k actions For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules: Example: vi /etc/audit/rules.d/50-actions.rules Add the following lines: -a always,exit -F arch=b64 -C euid!=uid -F euid=0 -F auid>=1000 -F auid!=4294967295 -S execve -k actions -a always,exit -F arch=b32 -C euid!=uid -F euid=0 -F auid>=1000 -F auid!=4294967295 -S execve -k actions." + compliance: + - cis: ["4.1.15"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-a exit,always -F arch=b32 -C euid!=uid -F euid=0 -Fauid>=1000 -F auid!=4294967295 -S execve -k actions' + + # 4.1.16 Ensure kernel module loading and unloading is collected. (Automated) + - id: 6132 + title: "Ensure kernel module loading and unloading is collected." + description: 'Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of "modules". Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot.' + rationale: "Monitoring the use of insmod , rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-modules.rules Add the following lines: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b32 -S init_module -S delete_module -k modules For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-modules.rules Add the following lines: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b64 -S init_module -S delete_module -k modules." + compliance: + - cis: ["4.1.16"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /sbin/insmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /sbin/rmmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /sbin/modprobe && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-a && r:always,exit|exit,always && r:-F arch=b\d\d && r:-S init_module && r:-S delete_module && r:-k modules' + + # 4.1.17 Ensure the audit configuration is immutable. (Automated) + - id: 6133 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: This setting will require the system to be rebooted to update the active auditd configuration settings.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the following line at the end of the file: -e 2." + compliance: + - cis: ["4.1.17"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:^-e 2' + + ############################################### + # 4.2 Configure Logging + ############################################### + + # 4.2.1.1 Ensure rsyslog is installed. (Automated) + - id: 6134 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is a recommended replacement to the original syslogd daemon. rsyslog provides improvements over syslogd, including: connection-oriented (i.e. TCP) transmission of logs - - The option to log to database formats - Encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # yum install rsyslog." + compliance: + - cis: ["4.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q rsyslog -> r:^rsyslog-" + + # 4.2.1.2 Ensure rsyslog Service is enabled and running. (Automated) + - id: 6135 + title: "Ensure rsyslog Service is enabled and running." + description: "rsyslog needs to be enabled and running to perform logging." + rationale: "If the rsyslog service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable and start rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:enabled" + - 'c:systemctl status rsyslog -> r:active \(running\)' + + # 4.2.1.3 Ensure rsyslog default file permissions configured. (Automated) + - id: 6136 + title: "Ensure rsyslog default file permissions configured." + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files. The $FileCreateMode parameter specifies the file creation mode with which rsyslogd creates new files. If not specified, the value 0644 is used. Notes: - The value given must always be a 4-digit octal number, with the initial digit being zero. - This setting can be overridden by a less restrictive setting in any file ending in .conf in the /etc/rsyslog.d/ directory." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640." + compliance: + - cis: ["4.2.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\.*.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + # 4.2.1.4 Ensure logging is configured. (Manual) - Not Implemented + + # 4.2.1.5 Ensure rsyslog is configured to send logs to a remote log host. (Automated) + - id: 6137 + title: "Ensure rsyslog is configured to send logs to a remote log host." + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead. Note: Ensure that the selection of logfiles being sent follows local site policy." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add one of the following lines: Newer syntax: action(type="omfwd" target="" port="" protocol="tcp" action.resumeRetryCount="" queue.type="LinkedList" queue.size=") Example: *.* action(type="omfwd" target="192.168.2.100" port="514" protocol="tcp" action.resumeRetryCount="100" queue.type="LinkedList" queue.size="1000") Older syntax: *.* @@ Example: *.* @@192.168.2.100 Run the following command to reload the rsyslog configuration: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.5"] + - cis_csc_v8: ["8.9"] + - cis_csc_v7: ["6.6", "6.8"] + - nist_sp_800-53: ["AU-6(3)"] + - pci_dss_v3.2.1: ["10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.3.3"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^[^#]\s*\S+\.\*\s+@' + - 'd:/etc/rsyslog.d/ -> r:\.*.conf -> r:^[^#]\s*\S+\.\*\s+@' + + # 4.2.1.6 Ensure remote rsyslog messages are only accepted on designated log hosts. (Manual) + - id: 6138 + title: "Ensure remote rsyslog messages are only accepted on designated log hosts." + description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port. Note: The $ModLoad imtcp line can have the .so extension added to the end of the module, or use the full path to the module." + rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." + remediation: "For hosts that are designated as log hosts, edit the \/etc\/rsyslog.conf file and un-comment or add the following lines: $ModLoad imtcp $InputTCPServerRun 514 For hosts that are not designated as log hosts, edit the \/etc\/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514 Run the following command to reload the rsyslogd configuration: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not f:/etc/rsyslog.conf -> r:^#$ModLoad\s*\t*imtcp' + - 'not d:/etc/rsyslog.d/*.conf -> r:^#$ModLoad\s*\t*imtcp' + - 'not f:/etc/rsyslog.conf -> r:^#$InputTCPServerRun\s*\t*514' + - 'not d:/etc/rsyslog.d/*.conf -> r:^#$InputTCPServerRun\s*\t*514' + + ############################################### + # 4.2 Configure journald + ############################################### + + # 4.2.2.1 Ensure journald is configured to send logs to rsyslog. (Automated) + - id: 6139 + title: "Ensure journald is configured to send logs to rsyslog." + description: 'Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the rsyslog service provides a consistent means of log collection and export. Notes: - This recommendation assumes that recommendation 4.2.1.5, "Ensure rsyslog is configured to send logs to a remote log host" has been implemented. - The main configuration file /etc/systemd/journald.conf is read before any of the custom *.conf files. If there are custom configs present, they override the main configuration parameters - As noted in the journald man pages: journald logs may be exported to rsyslog either through the process mentioned here, or through a facility like systemd-journald.service. There are trade-offs involved in each implementation, where ForwardToSyslog will immediately capture all events (and forward to an external log server, if properly configured), but may not capture all boot-up activities. Mechanisms such as systemd-journald.service, on the other hand, will record bootup events, but may delay sending the information to rsyslog, leading to the potential for log manipulation prior to export. Be aware of the limitations of all tools employed to secure a system.' + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes." + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf" + compliance: + - cis: ["4.2.2.1"] + - cis_csc_v8: ["8.9"] + - cis_csc_v7: ["6.5"] + - nist_sp_800-53: ["AU-6(3)"] + - pci_dss_v3.2.1: ["10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.3.3"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*ForwardToSyslog\s*=\s*yes' + + # 4.2.2.2 Ensure journald is configured to compress large log files. (Automated) + - id: 6140 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large. Note: The main configuration file /etc/systemd/journald.conf is read before any of the custom *.conf files. If there are custom configs present, they override the main configuration parameters." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes." + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf" + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Compress\s*=\s*yes' + + # 4.2.2.3 Ensure journald is configured to write logfiles to persistent disk. (Automated) + - id: 6141 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss. Note: The main configuration file /etc/systemd/journald.conf is read before any of the custom *.conf files. If there are custom configs present, they override the main configuration parameters." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent." + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf" + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Storage\s*=\s*persistent' + + # 4.2.3 Ensure permissions on all logfiles are configured. (Manual) + - id: 6142 + title: "Ensure permissions on all logfiles are configured." + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected. Other/world should not have the ability to view this information. Group should not have the ability to modify this information." + remediation: 'Run the following commands to set permissions on all existing log files: # find /var/log -type f -exec chmod g-wx,o-rwx "{}" + Note: The configuration for your logging software or services may need to also be modified for any logs that had incorrect permissions, otherwise, the permissions may be reverted to the incorrect permissions.' + compliance: + - cis: ["4.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:find /var/log -type f -ls -> r:^$' + + # 4.2.4 Ensure logrotate is configured. (Manual) - Not Implemented + #################################################### + # 5 Access, Authentication and Authorization + #################################################### + #################################################### + # 5.1 Configure time-based job schedulers + #################################################### + + # 5.1.1 Ensure cron daemon is enabled and running. (Automated) + - id: 6143 + title: "Ensure cron daemon is enabled and running." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run. If another method for scheduling tasks is not being used, cron is used to execute them, and needs to be enabled and running." + remediation: "Run the following command to enable and start cron: # systemctl --now enable crond OR Run the following command to remove cron: # yum remove cronie." + compliance: + - cis: ["5.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:systemctl is-enabled crond -> r:enabled" + - 'c:systemctl status crond -> r:Active: active \(running\) since \w+ \d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d' + + # 5.1.2 Ensure permissions on /etc/crontab are configured. (Automated) + - id: 6144 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab: # chown root:root /etc/crontab # chmod u-x,og-rwx /etc/crontab OR Run the following command to remove cron: # yum remove cronie." + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured. (Automated) + - id: 6145 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.hourly/ directory: # chown root:root /etc/cron.hourly/ # chmod og-rwx /etc/cron.hourly/ OR Run the following command to remove cron # yum remove cronie." + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured. (Automated) + - id: 6146 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily directory: # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily OR Run the following command to remove cron: # yum remove cronie." + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured. (Automated) + - id: 6147 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly/ directory: # chown root:root /etc/cron.weekly/ # chmod og-rwx /etc/cron.weekly/ OR Run the following command to remove cron: # yum remove cronie." + compliance: + - cis: ["5.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured. (Automated) + - id: 6148 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly directory: # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly OR Run the following command to remove cron: # yum remove cronie." + compliance: + - cis: ["5.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured. (Automated) + - id: 6149 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d/ directory contains system cron jobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab , but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d directory: # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d OR Run the following command to remove cron: # yum remove cronie." + compliance: + - cis: ["5.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.8 Ensure cron is restricted to authorized users. (Automated) + - id: 6150 + title: "Ensure cron is restricted to authorized users." + description: "If cron is installed in the system, configure /etc/cron.allow to allow specific users to use these services. If /etc/cron.allow does not exist, then /etc/cron.deny is checked. Any user not specifically defined in those files is allowed to use cron. By removing the file, only users in /etc/cron.allow are allowed to use cron. Note: Even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following command to remove /etc/cron.deny: # rm /etc/cron.deny Run the following command to create /etc/cron.allow # touch /etc/cron.allow Run the following commands to set the owner and permissions on /etc/cron.allow: # chown root:root /etc/cron.allow # chmod u-x,og-rwx /etc/cron.allow OR Run the following command to remove cron # yum remove cronie." + compliance: + - cis: ["5.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:stat /etc/cron.deny -> r:No such file or directory$" + - 'c:stat /etc/cron.allow -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.9 Ensure at is restricted to authorized users. (Automated) + - id: 6151 + title: "Ensure at is restricted to authorized users." + description: "If at is installed in the system, configure /etc/at.allow to allow specific users to use these services. If /etc/at.allow does not exist, then /etc/at.deny is checked. Any user not specifically defined in those files is allowed to use at. By removing the file, only users in /etc/at.allow are allowed to use at. Note: Even though a given user is not listed in at.allow, at jobs can still be run as that user. The at.allow file only controls administrative access to the at command for scheduling and modifying at jobs." + rationale: "On many systems, only the system administrator is authorized to schedule at jobs. Using the at.allow file to control who can run at jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following command to remove /etc/at.deny: # rm /etc/at.deny Run the following command to create /etc/at.allow # touch /etc/at.allow Run the following commands to set the owner and permissions on /etc/at.allow: # chown root:root /etc/at.allow # chmod u-x,og-rwx /etc/at.allow OR Run the following command to remove at: # yum remove at." + compliance: + - cis: ["5.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:stat /etc/at.deny -> r:No such file or directory$" + - 'c:stat /etc/at.allow -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + ############################################### + # 5.2 Configure Sudo + ############################################### + + # 5.2.1 Ensure sudo is installed. (Automated) + - id: 6152 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo. # yum install sudo." + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:rpm -q sudo -> r:sudo-" + + # 5.2.2 Ensure sudo commands use pty. (Automated) + - id: 6153 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo-pty Note: visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks for parse errors. If the sudoers file is currently being edited you will receive a message to try again later. The -f option allows you to tell visudo which file to edit." + rationale: "Attackers can run a malicious program using sudo, which would again fork a background process that remains even when the main program has finished executing. This can be mitigated by configuring sudo to run other commands only from a pseudo-pty, whether I/O logging is turned on or not." + remediation: "Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["5.2.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s+use_pty' + - 'd:/etc/sudoers.d -> r:\. -> r:^\s*Defaults\s+use_pty' + + # 5.2.3 Ensure sudo log file exists. (Automated) + - id: 6154 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file Note: visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks for parse errors. If the sudoers file is currently being edited you will receive a message to try again later. The -f option allows you to tell visudo which file to edit." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "Editing the sudo configuration incorrectly can cause sudo to stop functioning." + remediation: 'edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile="" Example: Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["5.2.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^Defaults logfile="' + - 'd:/etc/sudoers.d -> r:\. -> r:^Defaults\s+logfile="' + + # ############################################### + # # 5.3 Configure SSH Server + # ############################################### + + # 5.3.1 Ensure permissions on /etc/ssh/sshd_config are configured. (Automated) + - id: 6155 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.3.2 Ensure permissions on SSH private host key files are configured. (Automated) - Not Implemented + # 5.3.3 Ensure permissions on SSH public host key files are configured. (Automated) - Not Implemented + + # 5.3.4 Ensure SSH access is limited. (Automated) + - id: 6156 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: o The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: o The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: o The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: o The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers OR AllowGroups OR DenyUsers OR DenyGroups ." + compliance: + - cis: ["5.3.4"] + - cis_csc_v8: ["3.3", "5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "MP.L2-3.8.2", "SC.L2-3.13.3"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC6.3"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowUsers\s+\w*|^\s*AllowGroups\s+\w*|^\s*DenyUsers\s+\w*|^\s*DenyGroups\s+\w*' + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowUsers\s+\w*|^\s*AllowGroups\s+\w*|^\s*DenyUsers\s+\w*|^\s*DenyGroups\s+\w*' + + # 5.3.5 Ensure SSH LogLevel is appropriate. (Automated) + - id: 6157 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE OR LogLevel INFO." + references: + - "https://www.ssh.com/ssh/sshd_config/" + compliance: + - cis: ["5.3.5"] + - cis_csc_v8: ["8.2", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*LogLevel\s+VERBOSE|^\s*LogLevel\s+INFO' + - 'f:/etc/ssh/sshd_config ->!r:^# && r:loglevel\s*(VERBOSE|INFO)' + + # 5.3.6 Ensure SSH X11 forwarding is disabled. (Automated) + - id: 6158 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through an existing SSH shell session to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + impact: "X11 programs on the server will not be able to be forwarded to a ssh-client display." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no." + compliance: + - cis: ["5.3.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*x11forwarding\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*x11forwarding\s+yes' + + # 5.3.7 Ensure SSH MaxAuthTries is set to 4 or less. (Automated) + - id: 6159 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4." + compliance: + - cis: ["5.3.7"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'f:/etc/ssh/sshd_config -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.3.8 Ensure SSH IgnoreRhosts is enabled. (Automated) + - id: 6160 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes." + compliance: + - cis: ["5.3.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:\s*ignorerhosts\s*yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*ignorerhosts\s+no' + + # 5.3.9 Ensure SSH HostbasedAuthentication is disabled. (Automated) + - id: 6161 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no." + compliance: + - cis: ["5.3.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*HostbasedAuthentication\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sHostbasedAuthentication\s+yes' + + # 5.3.10 Ensure SSH root login is disabled. (Automated) + - id: 6162 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no." + compliance: + - cis: ["5.3.10"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitRootLogin\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitRootLogin\s+yes' + + # 5.3.11 Ensure SSH PermitEmptyPasswords is disabled. (Automated) + - id: 6163 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no." + compliance: + - cis: ["5.3.11"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitEmptyPasswords\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitEmptyPasswords\s+yes' + + # 5.3.12 Ensure SSH PermitUserEnvironment is disabled. (Automated) + - id: 6164 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing a Trojan's programs)." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no." + compliance: + - cis: ["5.3.12"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitUserEnvironment\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitUserEnvironment\s+yes' + + # 5.3.13 Ensure only strong Ciphers are used. (Automated) + - id: 6165 + title: "Ensure only strong Ciphers are used." + description: "This variable limits the ciphers that SSH can use during communication. Note: Some organizations may have stricter requirements for approved ciphers. Ensure that ciphers used are in compliance with site policy." + rationale: 'Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised. - The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a "Sweet32" attack - The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involving LSB values, aka the "Bar Mitzvah" issue - The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session - Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors.' + remediation: "Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers Example: Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128- gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr." + references: + - "https://nvd.nist.gov/vuln/detail/CVE-2016-2183" + - "https://nvd.nist.gov/vuln/detail/CVE-2015-2808" + - "https://www.kb.cert.org/vuls/id/565052" + - "https://www.openssh.com/txt/cbc.adv" + - "https://nvd.nist.gov/vuln/detail/CVE-2008-5161" + - "https://nvd.nist.gov/vuln/detail/CVE-2013-4548" + compliance: + - cis: ["5.3.13"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - "c: sshd -T -C user=root -> r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc|arcfour|arcfour128|arcfour256|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se" + - "not f:/etc/ssh/sshd_config -> r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc|arcfour|arcfour128|arcfour256|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se" + + # 5.3.14 Ensure only strong MAC algorithms are used. (Automated) + - id: 6166 + title: "Ensure only strong MAC algorithms are used." + description: "This variable Specifies the available MAC (message authentication code) algorithms. The MAC algorithm is used in protocol version 2 for data integrity protection. Multiple algorithms must be comma-separated. Note: Some organizations may have stricter requirements for approved MACs. Ensure that MACs used are in compliance with site policy." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information." + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2- 512,hmac-sha2-256." + references: + - "http://www.mitls.org/pages/attacks/SLOTH" + compliance: + - cis: ["5.3.14"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["14.4", "16.5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c: sshd -T -C user=root -> r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com" + - "not f:/etc/ssh/sshd_config -> r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com" + + # 5.3.15 Ensure only strong Key Exchange algorithms are used. (Automated) + - id: 6167 + title: "Ensure only strong Key Exchange algorithms are used." + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received Note: Some organizations may have stricter requirements for approved Key Exchange algorithms. Ensure that Key Exchange algorithms used are in compliance with site policy." + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks." + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms Example: KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2- nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange- sha256." + compliance: + - cis: ["5.3.15"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c: sshd -T -C user=root -> r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1" + - "not f:/etc/ssh/sshd_config -> r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1" + + # 5.3.16 Ensure SSH Idle Timeout Interval is configured. (Automated) + - id: 6168 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. - ClientAliveInterval sets 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 default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax sets the number of client alive messages which may be sent without sshd receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. The default value is 3. o The client alive messages are sent through the encrypted channel o Setting ClientAliveCountMax to 0 disables connection termination Example: The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value reduces this risk. - The recommended ClientAliveInterval setting is no greater than 900 seconds (15 minutes) - The recommended ClientAliveCountMax setting is 0 - At the 15 minute interval, if the ssh session is inactive, the session will be terminated." + impact: "In some cases this setting may cause termination of long-running scripts over SSH or remote automation tools which rely on SSH. In developing the local site policy, the requirements of such scripts should be considered and appropriate ServerAliveInterval and ClientAliveInterval settings should be calculated to insure operational continuity." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy. This should include ClientAliveInterval between 1 and 900 and ClientAliveCountMax of 0: ClientAliveInterval 900 ClientAliveCountMax 0." + references: + - "https://man.openbsd.org/sshd_config" + compliance: + - cis: ["5.3.16"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*clientaliveinterval\s*\t*(\d+) compare => 1 && n:^\s*clientaliveinterval\s*\t*(\d+) compare <= 900' + - 'c:sshd -T -C user=root -> n:^\s*clientalivecountmax\s*\t*(\d+) compare == 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*clientaliveinterval\s*\t*(\d+) compare => 1 && n:^\s*clientaliveinterval\s*\t*(\d+) compare <= 900' + - 'f:/etc/ssh/sshd_config -> n:^\s*clientalivecountmax\s*\t*(\d+) compare == 0' + + # 5.3.17 Ensure SSH LoginGraceTime is set to one minute or less. (Automated) + - id: 6169 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60." + compliance: + - cis: ["5.3.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*logingracetime\s*\t*(\d+) compare => 1 && n:^\s*logingracetime\s*\t*(\d+) compare <= 60' + - 'f:/etc/ssh/sshd_config -> n:^\s*logingracetime\s*\t*(\d+) compare => 1 && n:^\s*logingracetime\s*\t*(\d+) compare <= 60' + + # 5.3.18 Ensure SSH warning banner is configured. (Automated) + - id: 6170 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.3.18"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*Banner\s*\t*/etc/issue.net' + + # 5.3.19 Ensure SSH PAM is enabled. (Automated) + - id: 6171 + title: "Ensure SSH PAM is enabled." + description: 'UsePAM Enables the Pluggable Authentication Module interface. If set to "yes" this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types.' + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + impact: "If UsePAM is enabled, you will not be able to run sshd(5) as a non-root user." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes." + compliance: + - cis: ["5.3.19"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*usepam\s*yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*UsePAM\s+no' + + # 5.3.20 Ensure SSH AllowTcpForwarding is disabled. (Automated) + - id: 6172 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments that employ mainframe systems as their application backends. In those environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no." + references: + - "https://www.ssh.com/ssh/tunneling/example" + compliance: + - cis: ["5.3.20"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2", "13.5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.1", "A.13.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*allowtcpforwarding\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*AllowTcpForwarding\s+yes' + + # 5.3.21 Ensure SSH MaxStartups is configured. (Automated) + - id: 6173 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: maxstartups 10:30:60." + compliance: + - cis: ["5.3.21"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*maxstartups\s*10:30:60' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s*(\d+):\S*:\S* compare <=10 && n:^\s*maxstartups\s*\S*:(\d+):\S* compare <=30 && n:^\s*maxstartups\s*\S*:\S*:(\d+) compare <=60' + + # 5.3.22 Ensure SSH MaxSessions is limited. (Automated) + - id: 6174 + title: "Ensure SSH MaxSessions is limited." + description: "The MaxSessions parameter Specifies the maximum number of open sessions permitted per network connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10." + compliance: + - cis: ["5.3.22"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*maxsessions\s*(\d+) compare <= 10' + - 'f:/etc/ssh/sshd_config -> n:^\s*MaxSessions\s*(\d+) compare <= 10' + + ############################################### + # 5.4 Configure PAM + ############################################### + + # 5.4.1 Ensure password creation requirements are configured. (Automated) + - id: 6175 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. The following options are set in the /etc/security/pwquality.conf file: Password Length: - minlen = 14 - password must be 14 characters or more Password complexity: - minclass = 4 - The minimum number of required classes of characters for the new password (digits, uppercase, lowercase, others) OR - dcredit = -1 - provide at least one digit - ucredit = -1 - provide at least one uppercase character - ocredit = -1 - provide at least one special character - lcredit = -1 - provide at least one lowercase character The following is set in the /etc/pam.d/password-auth and /etc/pam.d/system-auth files - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies. Notes: - Settings in /etc/security/pwquality.conf must use spaces around the = symbol. - Additional modules options may be set in the /etc/pam.d/password-auth and /etc/pam.d/system-auth files." + rationale: "Strong passwords and limited attempts before locking an account protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so try_first_pass retry=3." + compliance: + - cis: ["5.4.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: any + rules: + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s*=\s*(\d+) compare >= 14 && n:^\s*minclass\s*=\s*(\d+) compare == 4' + - 'f:/etc/security/pwquality.conf -> r:dcredit\s*=\s*-1s*|\s*ucredit\s*=\s*-1\s*|\s*lcredit\s*=\s*-1\s*|\s*ocredit\s*=\s*-1' + + # 5.4.2 Ensure lockout for failed password attempts is configured. (Automated) + - id: 6176 + title: "Ensure lockout for failed password attempts is configured." + description: 'Lock out users after n unsuccessful consecutive login attempts. These settings are commonly configured with the pam_faillock.so module. Some environments may continue using the pam_tally2.so module, where this older method may simplify automation in mixed environments. Set the lockout number in deny= to the policy in effect at your site. unlock_time=_n_ is the number of seconds the account remains locked after the number of attempts configured in deny=_n_ has been met. Notes: - Additional module options may be set, recommendation only covers those listed here. - When modifying authentication configuration using the authconfig utility, the system-auth and password-auth files are overwritten with the settings from the authconfig utility. This can be avoided by creating symbolic links in place of the configuration files, which authconfig recognizes and does not overwrite. These symbolic links are the default for Fedora 19 derived distributions. - Use of the "audit" keyword may log credentials in the case of user error during - authentication. This risk should be evaluated in the context of the site policies of your organization. If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_faillock.so or the pam_tally2.so module, the user can be unlocked by issuing following commands. This command sets the failed count to 0, effectively unlocking the user. If pam_faillock.so is used: o o # faillock --user --reset o o # pam_tally2 -u --reset If pam_tally2.so is used:.' + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: 'Edit the files /etc/pam.d/system-auth and /etc/pam.d/password-auth and add the following lines: Modify the deny= and unlock_time= parameters to conform to local site policy, Not to be greater than deny=5 To use pam_faillock.so module, add the following lines to the auth section: auth required pam_faillock.so preauth silent audit deny=5 unlock_time=900 auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900 The auth sections should look similar to the following example: Note: The ordering on the lines in the auth section is important. The preauth line needs to below the line auth required pam_env.so and above all password validation lines. The authfail line needs to be after all password validation lines such as pam_sss.so. Incorrect order can cause you to be locked out of the system Example: auth required pam_env.so auth required pam_faillock.so preauth silent audit deny=5 unlock_time=900 # <- Under "auth required pam_env.so" auth sufficient pam_unix.so nullok try_first_pass auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900 # <- Last auth line before "auth requisite pam_succeed_if.so" auth requisite pam_succeed_if.so uid >= 1000 quiet_success auth required pam_deny.so Add the following line to the account section: account required pam_faillock.so Example: account required pam_faillock.so account required pam_unix.so account sufficient pam_localuser.so account sufficient pam_pam_succeed_if.so uid < 1000 quiet account required pam_permit.so OR To use the pam_tally2.so module, add the following line to the auth section: auth required pam_tally2.so deny=5 onerr=fail unlock_time=900 The auth sections should look similar to the following example: Note: The ordering on the lines in the auth section is important. the additional line needs to below the line auth required pam_env.so and above all password validation lines. Example: auth required pam_env.so auth required pam_tally2.so deny=5 onerr=fail unlock_time=900 # <- Under "auth required pam_env.so" auth sufficient pam_unix.so nullok try_first_pass auth requisite pam_succeed_if.so uid >= 1000 quiet_success auth required pam_deny.so Add the following line to the account section: account required pam_tally2.so Example: account required pam_tally2.so account required pam_unix.so account sufficient pam_localuser.so account sufficient pam_pam_succeed_if.so uid < 1000 quiet account required pam_permit.so.' + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/security_guide" + compliance: + - cis: ["5.4.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'f:/etc/pam.d/system-auth -> r:\s*auth\s+\S+\s+pam' + - 'f:/etc/pam.d/password-auth -> r:\s*auth\s+\S+\s+pam' + - 'f:/etc/pam.d/system-auth -> r:\s*account\s+required\s+pam_faillock.so\s*' + - 'f:/etc/pam.d/password-auth -> r:\s*account\s+required\s+pam_faillock.so\s*' + - 'f:/etc/pam.d/system-auth -> r:\s*auth\s+\S+\s+pam_\(tally2|unix\).so' + - 'f:/etc/pam.d/password-auth -> r:\s*auth\s+\S+\s+pam_\(tally2|unix\).so' + - 'f:/etc/pam.d/system-auth -> r:\s*account\s+required\s+pam_tally2.so\s*' + - 'f:/etc/pam.d/password-auth -> r:\s*account\s+required\s+pam_tally2.so\s*' + + # 5.4.3 Ensure password hashing algorithm is SHA-512. (Automated) + - id: 6177 + title: "Ensure password hashing algorithm is SHA-512." + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm. Note: - These changes only apply to accounts configured on the local system. - Additional module options may be set, recommendation only covers those listed here." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include sha512 option and remove the md5 option for pam_unix.so: password sufficient pam_unix.so sha512 Note: - Any system accounts that need to be expired should be carefully done separately by the - system administrator to prevent any potential problems. If it is determined that the password algorithm being used is not SHA-512, once it is changed, it is recommended that all user ID's be immediately expired and forced to change their passwords on next login, In accordance with local site policies. - To accomplish this, the following command can be used. o This command intentionally does not affect the root account. The root account's password will also need to be changed. # awk -F: '( $3<'\"$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs)\"' && $1 !~ /^(nfs)?nobody$/ && $1 != \"root\" ) { print $1 }' /etc/passwd | xargs -n 1 chage -d 0." + compliance: + - cis: ["5.4.3"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: any + rules: + - 'f:/etc/pam.d/system-auth -> r:\s*password\s+\(sufficient|requisite|required\)\s+pam_unix.so\s*sha512' + - 'f:/etc/pam.d/password-auth -> r:\s*password\s+\(sufficient|requisite|required\)\s+pam_unix.so\s*sha512' + + # 5.4.4 Ensure password reuse is limited. (Automated) + - id: 6178 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. Note: Additional module options may be set, recommendation only covers those listed here." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password." + remediation: "Edit both the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the remember option and conform to site policy as shown: Note: Add or modify the line containing the pam_pwhistory.so after the first occurrence of password requisite: password required pam_pwhistory.so remember=5 Example: (Second line is modified) password requisite pam_pwquality.so try_first_pass local_users_only authtok_type= password required pam_pwhistory.so use_authtok remember=5 retry=3 password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok password required pam_deny.so." + compliance: + - cis: ["5.4.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["16"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: any + rules: + - 'f:/etc/pam.d/system-auth -> n:\s*password\s+\(requisite|required\)\s+pam_pwhistory.so\s*remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/password-auth -> n:\s*password\s+\(requisite|required\)\s+pam_pwhistory.so\s*remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> n:\s*password\s+\(requisite|required\)\s+pam_pwhistory.so\s*remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/password-auth -> n:\s*password\s+\(requisite|required\)\s+pam_pwhistory.so\s*remember=(\d+) compare >= 5' + + # 5.5.1.1 Ensure password expiration is 365 days or less. (Automated) + - id: 6179 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days. Notes: - A value of -1 will disable password expiration. - The password expiration must be greater than the minimum days between password changes or users will be unable to change their password." + rationale: "The window of opportunity for an attacker to leverage compromised credentials via a brute force attack, using already compromised credentials, or gaining the credentials by other means, can be limited by the age of the password. Therefore, reducing the maximum age of a password can also reduce an attacker's window of opportunity. Requiring passwords to be changed helps to mitigate the risk posed by the poor security practice of passwords being used for multiple accounts, and poorly implemented off-boarding and change of responsibility policies. This should not be considered a replacement for proper implementation of these policies and practices. Note: If it is believed that a user's password may have been compromised, the user's account should be locked immediately. Local policy should be followed to ensure the secure update of their password." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + compliance: + - cis: ["5.5.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:(\d+):\S*:\S*:\S*:\S* compare > 365' + + # 5.5.1.2 Ensure minimum days between password changes is configured. (Automated) + - id: 6180 + title: "Ensure minimum days between password changes is configured." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 1 in /etc/login.defs : PASS_MIN_DAYS 1 Modify user parameters for all users with a password set to match: # chage --mindays 1 ." + compliance: + - cis: ["5.5.1.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 1' + - 'not f:/etc/shadow -> n:^\w+:\S*:\S*:(\d+):\S*:\S*:\S*:\S*:\S* compare < 1' + - 'not f:/etc/shadow -> r:^\w+:\S*:\S*::\S*:\S*:\S*:\S*:\S*' + + # 5.5.1.3 Ensure password expiration warning days is 7 or more. (Automated) + - id: 6181 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs : PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["5.5.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + - 'f:/etc/shadow -> n:^\w+:\S*:\S*:\S*:\S*:(\d+):\S*:\S*:\S* compare >= 7' + - 'not f:/etc/shadow -> r:^\w+:\S*:\S*:\S*:\S*::\S*:\S*:\S*' + + # 5.5.1.4 Ensure inactive password lock is 30 days or less. (Automated) + - id: 6182 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled. Note: A value of -1 would disable this setting." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["5.5.1.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.9"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*\t*(\d+) compare <= 30' + - 'f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:\S*:\S*:(\d+):\S*:\S* compare <= 30' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && r:^\w+:\S*:\S*:\S*:\S*:\S*::\S*:\S*' + + # 5.5.1.5 Ensure all users last password change date is in the past. (Automated) - Not Implemented + # 5.5.2 Ensure system accounts are secured. (Automated) - Not Implemented + + # 5.5.3 Ensure default group for the root account is GID 0. (Automated) + - id: 6183 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.5.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/passwd -> r:^root:x:0:0" + + # 5.5.4 Ensure default user shell timeout is configured. (Automated) - Not Implemented + # 5.5.5 Ensure default user umask is configured. (Automated) - Not Implemented + # 5.6 Ensure root login is restricted to system console. (Manual) - Not Implemented + + # 5.7 Ensure access to the su command is restricted. (Automated) + - id: 6184 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/su -> r:^auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + ############################################### + # 6 System Maintenance + ############################################### + ############################################### + # 6.1 System File Permissions + ############################################### + + # 6.1.1 Audit system file permissions. (Manual) - Not Implemented + + # 6.1.2 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 6185 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/passwd : # chown root:root /etc/passwd # chmod u-x,g-wx,o-wx /etc/passwd." + compliance: + - cis: ["6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.3 Ensure permissions on /etc/passwd- are configured. (Automated) + - id: 6186 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/passwd- : # chown root:root /etc/passwd- # chmod u-x,go-wx /etc/passwd-." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0644/-rw-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.4 Ensure permissions on /etc/shadow are configured. (Automated) + - id: 6187 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following commands to set owner, group, and permissions on /etc/shadow : # chown root:root /etc/shadow # chmod 0000 /etc/shadow." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.5 Ensure permissions on /etc/shadow- are configured. (Automated) + - id: 6188 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/shadow- : # chown root:root /etc/shadow- # chmod 0000 /etc/shadow-." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.6 Ensure permissions on /etc/gshadow- are configured. (Automated) + - id: 6189 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chmod 0000 /etc/gshadow-." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.7 Ensure permissions on /etc/gshadow are configured. (Automated) + - id: 6190 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run the following commands to set owner, group, and permissions on /etc/gshadow : # chown root:root /etc/gshadow # chmod 0000 /etc/gshadow." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.8 Ensure permissions on /etc/group are configured. (Automated) + - id: 6191 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following commands to set owner, group, and permissions on /etc/group : # chown root:root /etc/group # chmod u-x,g-wx,o-wx /etc/group." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.9 Ensure permissions on /etc/group- are configured. (Automated) + - id: 6192 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/group-: # chown root:root /etc/group- # chmod u-x,go-wx /etc/group-." + compliance: + - cis: ["6.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.10 Ensure no world writable files exist. (Automated) - Not Implemented + # 6.1.11 Ensure no unowned files or directories exist. (Automated) - Not Implemented + # 6.1.12 Ensure no ungrouped files or directories exist. (Automated) - Not Implemented + # 6.1.13 Audit SUID executables. (Manual) - Not Implemented + # 6.1.14 Audit SGID executables. (Manual) - Not Implemented + + ############################################### + # 6.2 User and Group Settings + ############################################### + + # 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords. (Automated) + - id: 6193 + title: "Ensure accounts in /etc/passwd use shadowed passwords." + description: "Local accounts can uses shadowed passwords. With shadowed passwords, The passwords are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. Accounts with a shadowed password have an x in the second field in /etc/passwd." + rationale: "The /etc/passwd file also contains information like user ID's and group ID's that are used by many system programs. Therefore, the /etc/passwd file must remain world readable. In spite of encoding the password with a randomly-generated one-way hash function, an attacker could still break the system if they got access to the /etc/passwd file. This can be mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. This helps mitigate the risk of an attacker gaining access to the encoded passwords with which to perform a dictionary attack. Notes: - All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user. - A user account with an empty second field in /etc/passwd allows the account to be logged into by providing only the username." + remediation: "If any accounts in the /etc/passwd file do not have a single x in the password field, run the following command to set these accounts to use shadowed passwords: # sed -e 's/^\\([a-zA-Z0-9_]*\\):[^:]*:/\\1:x:/' -i /etc/passwd Investigate to determine if the account is logged in and what it is being used for, to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'not f:/etc/passwd -> !r:^\w+:x:' + + # 6.2.2 Ensure /etc/shadow password fields are not empty. (Automated) + - id: 6194 + title: "Ensure /etc/shadow password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + + # 6.2.3 Ensure all groups in /etc/passwd exist in /etc/group. (Automated) - Not Implemented + # 6.2.4 Ensure shadow group is empty. (Automated) - Not Implemented + # 6.2.5 Ensure no duplicate user names exist. (Automated) - Not Implemented + # 6.2.6 Ensure no duplicate group names exist. (Automated) - Not Implemented + # 6.2.7 Ensure no duplicate UIDs exist. (Automated) - Not Implemented + # 6.2.8 Ensure no duplicate GIDs exist. (Automated) - Not Implemented + + # 6.2.9 Ensure root is the only UID 0 account. (Automated) + - id: 6195 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^\s*root && n:^\w+:\S*:(\d+):\S*:\S*:\S*:\S* compare == 0' + + # 6.2.10 Ensure root PATH Integrity. (Automated) - Not Implemented + # 6.2.11 Ensure all users' home directories exist. (Automated) - Not Implemented + # 6.2.12 Ensure users own their home directories. (Automated) - Not Implemented + # 6.2.13 Ensure users' home directories permissions are 750 or more restrictive. (Automated) - Not Implemented + # 6.2.14 Ensure users' dot files are not group or world writable. (Automated) - Not Implemented + # 6.2.15 Ensure no users have .forward files. (Automated) - Not Implemented + # 6.2.16 Ensure no users have .netrc files. (Automated) - Not Implemented + # 6.2.17 Ensure no users have .rhosts files. (Automated) - Not Implemented diff --git a/etc/ruleset/sca/centos/8/cis_centos8_linux.yml b/etc/ruleset/sca/centos/8/cis_centos8_linux.yml new file mode 100644 index 0000000000..14a6c9d0b5 --- /dev/null +++ b/etc/ruleset/sca/centos/8/cis_centos8_linux.yml @@ -0,0 +1,4451 @@ +# Security Configuration Assessment +# CIS Checks for CentOS 8 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security CentOS Linux 8 Benchmark v2.0.0 - 02-23-2022 + +policy: + id: "cis_centos8_linux" + file: "cis_centos8_linux.yml" + name: "CIS CentOS Linux 8 Benchmark v2.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for CentOS Linux 8 systems running on x86 and x64 platforms. This document was tested against CentOS Linux 8." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Centos 8 family platform" + description: "Requirements for running the policy against CentOS 8 family." + condition: any + rules: + - "f:/etc/redhat-release -> r:^Centos && r:release 8" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # 1.1.1.1 Ensure mounting of cramfs filesystems is disabled. (Automated) + - id: 6500 + title: "Ensure mounting of cramfs filesystems is disabled." + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf with a line that reads install cramfs /bin/false and a line the reads blacklist cramfs. Example: # printf "install cramfs /bin/false blacklist cramfs " >> /etc/modprobe.d/cramfs.conf Run the following command to unload the cramfs module: # modprobe -r cramfs.' + compliance: + - cis: ["1.1.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:^install|Module cramfs not found" + - "not c:lsmod -> r:cramfs" + - 'd:/etc/modprobe.d -> r:\.+ -> r:^blacklist\s*\t*cramfs' + + # 1.1.1.2 Ensure mounting of squashfs filesystems is disabled. (Automated) + - id: 6501 + title: "Ensure mounting of squashfs filesystems is disabled." + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: 'As Snap packages utilizes squashfs as a compressed filesystem, disabling squashfs will cause Snap packages to fail. Snap application packages of software are self-contained and work across a range of Linux distributions. This is unlike traditional Linux package management approaches, like APT or RPM, which require specifically adapted packages per Linux distribution on an application update and delay therefore application deployment from developers to their software''s end-user. Snaps themselves have no dependency on any external store ("App store"), can be obtained from any source and can be therefore used for upstream software deployment.' + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf with the lines that reads install squashfs /bin/false and blacklist squashfs. Example: # printf "install squashfs /bin/false blacklist squashfs " >> /etc/modprobe.d/squashfs.conf Run the following command to unload the squashfs module: # modprobe -r squashfs.' + compliance: + - cis: ["1.1.1.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:^install|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + - 'd:/etc/modprobe.d -> r:\.+ -> r:^blacklist\s*\t*squashfs' + + # 1.1.1.3 Ensure mounting of udf filesystems is disabled. (Automated) + - id: 6502 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: "Microsoft Azure requires the usage of udf. udf should not be disabled on systems run on Microsoft Azure." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf with a line that reads install udf /bin/false. Example: # printf "install udf /bin/false blacklist udf " >> /etc/modprobe.d/udf.conf Run the following command to unload the udf module: # modprobe -r udf.' + compliance: + - cis: ["1.1.1.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v udf -> r:^install|Module udf not found" + - "not c:lsmod -> r:udf" + - 'd:/etc/modprobe.d -> r:\.+ -> r:^blacklist\s*\t*udf' + + # 1.1.2.1 Ensure /tmp is a separate partition. (Automated) + - id: 6503 + title: "Ensure /tmp is a separate partition." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a configuration where /tmp is not a separate file system it will essentially have the whole disk available, as the default installation only creates a single / partition. On the other hand, a RAM-based /tmp (as with tmpfs) will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily. Another alternative is to create a dedicated partition for /tmp from a separate volume or disk. One of the downsides of a disk-based dedicated partition is that it will be slower than tmpfs which is RAM-based. /tmp utilizing tmpfs can be resized using the size={size} parameter in the relevant entry in /etc/fstab." + remediation: "First ensure that systemd is correctly configured to ensure that /tmp will be mounted at boot time. # systemctl unmask tmp.mount For specific configuration requirements of the /tmp mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs /tmp 0 tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 Example of using a volume or disk with specific mount options. The source location of the volume or disk will vary depending on your environment. /tmp defaults,nodev,nosuid,noexec 0 0." + references: + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + - "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html" + compliance: + - cis: ["1.1.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + # 1.1.2.2 Ensure nodev option set on /tmp partition. (Automated) + - id: 6504 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - 'c:mount -> r:\s/tmp\s && !r:nodev' + + # 1.1.2.3 Ensure noexec option set on /tmp partition. (Automated) + - id: 6505 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/tmp\s && !r:noexec' + + # 1.1.2.4 Ensure nosuid option set on /tmp partition. (Automated) + - id: 6506 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/tmp\s && !r:nosuid' + + # 1.1.3.1 Ensure separate partition exists for /var. (Automated) + - id: 6507 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "The reasoning for mounting /var on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behaviour. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + # 1.1.3.2 Ensure nodev option set on /var partition. (Automated) + - id: 6508 + title: "Ensure nodev option set on /var partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/var\s && !r:nodev' + + # 1.1.3.3 Ensure noexec option set on /var partition. (Automated) + - id: 6509 + title: "Ensure noexec option set on /var partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot run executable binaries from /var." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/var\s && !r:noexec' + + # 1.1.3.4 Ensure nosuid option set on /var partition. (Automated) + - id: 6510 + title: "Ensure nosuid option set on /var partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/var\s && !r:nosuid' + + # 1.1.4.1 Ensure separate partition exists for /var/tmp. (Automated) + - id: 6511 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications. Temporary file residing in /var/tmp is to be preserved between reboots." + rationale: "The reasoning for mounting /var/tmp on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/tmp directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/tmp and cause the potential disruption to daemons as the disk is full. Fine grained control over the mount Configuring /var/tmp as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var/tmp may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + # 1.1.4.2 Ensure noexec option set on /var/tmp partition. (Automated) + - id: 6512 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/var/tmp\s && !r:noexec' + + # 1.1.4.3 Ensure nosuid option set on /var/tmp partition. (Automated) + - id: 6513 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/var/tmp\s && !r:nosuid' + + # 1.1.4.4 Ensure nodev option set on /var/tmp partition. (Automated) + - id: 6514 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/var/tmp\s && !r:nodev' + + # 1.1.5.1 Ensure separate partition exists for /var/log. (Automated) + - id: 6515 + title: "Configure /var/log The /var/log directory is used by system services to store log data. 1.1.5.1 Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "The reasoning for mounting /var/log on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log directory contain the log files that can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. Fine grained control over the mount Configuring /var/log as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of log data As /var/log contains log files, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.5"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + # 1.1.5.2 Ensure nodev option set on /var/log partition. (Automated) + - id: 6516 + title: "Ensure nodev option set on /var/log partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/var/log\s && !r:nodev' + + # 1.1.5.3 Ensure noexec option set on /var/log partition. (Automated) + - id: 6517 + title: "Ensure noexec option set on /var/log partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot run executable binaries from /var/log." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/var/log\s && !r:noexec' + + # 1.1.5.4 Ensure nosuid option set on /var/log partition. (Automated) + - id: 6518 + title: "Ensure nosuid option set on /var/log partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot create setuid files in /var/log." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/var/log\s && !r:noexec' + + # 1.1.6.1 Ensure separate partition exists for /var/log/audit. (Automated) + - id: 6519 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "The reasoning for mounting /var/log/audit on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log/audit directory contain the audit.log file that can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/log/audit and cause auditd to trigger it's space_left_action as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var/log/audit as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of audit data As /var/log/audit contains audit logs, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.6.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + # 1.1.6.2 Ensure noexec option set on /var/log/audit partition. (Automated) + - id: 6520 + title: "Ensure noexec option set on /var/log/audit partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log/audit filesystem is only intended for audit logs, set this option to ensure that users cannot run executable binaries from /var/log/audit." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/var/log/audit\s && !r:noexec' + + # 1.1.6.3 Ensure nodev option set on /var/log/audit partition. (Automated) + - id: 6521 + title: "Ensure nodev option set on /var/log/audit partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log/audit filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/var/log/audit\s && !r:nodev' + + # 1.1.6.4 Ensure nosuid option set on /var/log/audit partition. (Automated) + - id: 6522 + title: "Ensure nosuid option set on /var/log/audit partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log/audit filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/var/log/audit\s && !r:nosuid' + + # 1.1.7.1 Ensure separate partition exists for /home. (Automated) + - id: 6523 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "The reasoning for mounting /home on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /home directory contains user generated data, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /home and impact all local users. Fine grained control over the mount Configuring /home as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. In the case of /home options such as usrquota/grpquota may be considered to limit the impact that users can have on each other with regards to disk resource exhaustion. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of user data As /home contains user data, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.7.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + # 1.1.7.2 Ensure nodev option set on /home partition. (Automated) + - id: 6524 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /home filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/home\s && !r:nodev' + + # 1.1.7.3 Ensure nosuid option set on /home partition. (Automated) + - id: 6525 + title: "Ensure nosuid option set on /home partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /home filesystem is only intended for user file storage, set this option to ensure that users cannot create setuid files in /home." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/home\s && !r:nodev' + + # 1.1.7.4 Ensure usrquota option set on /home partition. (Automated) + - id: 6526 + title: "Ensure usrquota option set on /home partition." + description: "The usrquota mount option allows for the filesystem to have disk quotas configured." + rationale: "To ensure the availability of disk space on /home, it is important to limit the impact a single user or group can cause for other users (or the wider system) by accidentally filling up the partition. Quotas can also be applied to inodes for filesystems where inode exhaustion is a concern." + remediation: "Edit the /etc/fstab file and add usrquota to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,usrquota,grpquota,nodev,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home Create the quota database. This example will ignore any existing quota files. # quotacheck -cugv /home quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. quotacheck: Scanning /dev/sdb [/home] done quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Checked 8 directories and 0 files quotacheck: Old file not found. quotacheck: Old file not found. Restore SELinux context on the quota database files. Order of operations is important as quotaon will set the immutable attribute on the files and thus restorecon will fail. # restorecon /home/aquota.user Enable quotas on the partition: # quotaon -vug /home /dev/sdb [/home]: group quotas turned on /dev/sdb [/home]: user quotas turned on." + compliance: + - cis: ["1.1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/home\s && !r:usrquota' + - "c:quotaon -p user -> r:user" + + # 1.1.7.5 Ensure grpquota option set on /home partition. (Automated) + - id: 6527 + title: "Ensure grpquota option set on /home partition." + description: "The grpquota mount option allows for the filesystem to have disk quotas configured." + rationale: "To ensure the availability of disk space on /home, it is important to limit the impact a single user or group can cause for other users (or the wider system) by accidentally filling up the partition. Quotas can also be applied to inodes for filesystems where inode exhaustion is a concern." + remediation: "Edit the /etc/fstab file and add grpquota to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,usrquota,grpquota,nodev,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home Create the quota database. This example will ignore any existing quota files. # quotacheck -cugv /home quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. quotacheck: Scanning /dev/sdb [/home] done quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Checked 8 directories and 0 files quotacheck: Old file not found. quotacheck: Old file not found. Restore SELinux context on the quota database files. Order of operations is important as quotaon will set the immutable attribute on the files and thus restorecon will fail. # restorecon /home/aquota.group Enable quotas on the partition: # quotaon -vug /home /dev/sdb [/home]: group quotas turned on /dev/sdb [/home]: user quotas turned on." + compliance: + - cis: ["1.1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && !r:grpquota' + - "c:quotaon -p group -> r:user" + + # 1.1.8.1 Ensure nodev option set on /dev/shm partition. (Automated) + - id: 6528 + title: "Configure /dev/shm 1.1.8.1 Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/dev/shm\s && !r:nodev' + + # 1.1.8.2 Ensure noexec option set on /dev/shm partition. (Automated) + - id: 6529 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Example: /dev/shm defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm NOTE It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/dev/shm\s && !r:nodev' + + # 1.1.8.3 Ensure nosuid option set on /dev/shm partition. (Automated) + - id: 6530 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/dev/shm\s && !r:nosuid' + + # 1.1.9 Disable Automounting. (Automated) + - id: 6531 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "If there are no other packages that depends on autofs, remove the package with: # dnf remove autofs Run the following command to disable autofs if it is required: # systemctl --now disable autofs." + compliance: + - cis: ["1.1.9"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: none + rules: + - "c:systemctl is-enabled autofs -> r:^enabled" + + # 1.1.10 Disable USB Storage. (Automated) + - id: 6532 + title: "Disable USB Storage." + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/usb_storage.conf and add the following line: install usb-storage /bin/true Run the following command to unload the usb-storage module: rmmod usb-storage." + compliance: + - cis: ["1.1.10"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["13.7"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.8.3.1"] + condition: all + rules: + - "c:modprobe -n -v usb-storage -> r:install /bin/true" + - "not c:lsmod -> r:usb-storage" + + # 1.2.1 Ensure GPG keys are configured. (Manual) - Not Implemented + + # 1.2.2 Ensure gpgcheck is globally activated. (Automated) + - id: 6533 + title: "Ensure gpgcheck is globally activated." + description: "The gpgcheck option, found in the main section of the /etc/dnf/dnf.conf and individual /etc/yum.repos.d/* files, determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/dnf/dnf.conf and set gpgcheck=1 in the [main] section. Example: # sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' /etc/dnf/dnf.conf Edit any failing files in /etc/yum.repos.d/* and set all instances starting with gpgcheck to 1. Example: # find /etc/yum.repos.d/ -name \"*.repo\" -exec echo \"Checking:\" {} \\; -exec sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' {} \\;." + compliance: + - cis: ["1.2.2"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'f:/etc/dnf/dnf.conf -> r:^gpgcheck\s*\t*=\s*\t*1' + - 'not d:/etc/yum.repos.d/ -> r:\.+ -> r:gpgcheck=0' + + # 1.2.3 Ensure package manager repositories are configured. (Manual) - Not Implemented + + # 1.3.1 Ensure AIDE is installed. (Automated) + - id: 6534 + title: "Ensure AIDE is installed." + description: "Advanced Intrusion Detection Environment (AIDE) is a intrusion detection tool that uses predefined rules to check the integrity of files and directories in the Linux operating system. AIDE has its own database to check the integrity of files and directories. AIDE takes a snapshot of files and directories including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # dnf install aide Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: Run the following commands: # aide --init # mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz." + references: + - "http://aide.sourceforge.net/stable/manual.html" + compliance: + - cis: ["1.3.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AC-6(9)"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:rpm -q aide -> r:aide-" + + # 1.3.2 Ensure filesystem integrity is regularly checked. (Automated) + - id: 6535 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check OR if aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + references: + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service" + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer" + compliance: + - cis: ["1.3.2"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AC-6(9)"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:systemctl is-enabled aidecheck.service -> r:enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:enabled" + - "c:systemctl status aidecheck.timer -> r:active" + + # 1.4.1 Ensure bootloader password is set. (Automated) + - id: 6536 + title: "Ensure bootloader password is set." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + impact: 'If password protection is enabled, only the designated superuser can edit a Grub 2 menu item by pressing "e" or access the GRUB 2 command line by pressing "c" If GRUB 2 is set up to boot automatically to a password-protected menu entry the user has no option to back out of the password prompt to select another menu entry. Holding the SHIFT key will not display the menu in this case. The user must enter the correct username and password. If unable, the configuration files will have to be edited via the LiveCD or other means to fix the problem You can add --unrestricted to the menu entries to allow the system to boot without entering a password. Password will still be required to edit menu items.' + remediation: "Create an encrypted password with grub2-setpassword: # grub2-setpassword Enter password: Confirm password: Run the following command to update the grub2 configuration: # grub2-mkconfig -o \"$(dirname \"$(find /boot -type f \\( -name 'grubenv' -o - name 'grub.conf' -o -name 'grub.cfg' \\) -exec grep -Pl '^\\h*(kernelopts=|linux|kernel)' {} \\;)\")/grub.cfg\"." + compliance: + - cis: ["1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + # 1.4.2 Ensure permissions on bootloader config are configured. (Automated) + - id: 6537 + title: "Ensure permissions on bootloader config are configured." + description: "The grub files contain information on boot settings and passwords for unlocking boot options. The grub2 configuration is usually grub.cfg. On newer grub2 systems the encrypted bootloader password is contained in user.cfg. If the system uses UEFI, /boot/efi is a vfat filesystem. The vfat filesystem itself doesn't have the concept of permissions but can be mounted under Linux with whatever permissions desired." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set ownership and permissions on your grub configuration file(s): # [ -f /boot/grub2/grub.cfg ] && chown root:root /boot/grub2/grub.cfg # [ -f /boot/grub2/grub.cfg ] && chmod og-rwx /boot/grub2/grub.cfg # [ -f /boot/grub2/grubenv ] && chown root:root /boot/grub2/grubenv # [ -f /boot/grub2/grubenv ] && chmod og-rwx /boot/grub2/grubenv # [ -f /boot/grub2/user.cfg ] && chown root:root /boot/grub2/user.cfg # [ -f /boot/grub2/user.cfg ] && chmod og-rwx /boot/grub2/user.cfg OR If the system uses UEFI, edit /etc/fstab and add the fmask=0077, uid=0, and gid=0 options: Example: /boot/efi vfat defaults,umask=0027,fmask=0077,uid=0,gid=0 0 0 Note: This may require a re-boot to enable the change." + compliance: + - cis: ["1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /boot/grub2/grub.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat -L /boot/grub2/grubenv -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat -L /boot/grub2/user.cfg -> r:Access:\s*\(0600/-r--------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.4.3 Ensure authentication is required when booting into rescue mode. (Automated) + - id: 6538 + title: "Ensure authentication is required when booting into rescue mode." + description: "Rescue mode (former single user mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in rescue mode (former single user mode) prevents an unauthorized user from rebooting the system into rescue mode to gain root privileges without credentials." + remediation: "The systemd drop-in files must be created if it is necessary to change the default settings: Create the file /etc/systemd/system/rescue.service.d/00-require-auth.conf which contains only the configuration to be overridden: [Service] ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue." + compliance: + - cis: ["1.4.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "f:/usr/lib/systemd/system/rescue.service -> r: systemd-sulogin-shell" + - 'd:/etc/systemd/system/rescue.service.d/ -> r:\.+ -> r: systemd-sulogin-shell' + + # 1.5.1 Ensure core dump storage is disabled. (Automated) + - id: 6539 + title: "Additional Process Hardening 1.5.1 Ensure core dump storage is disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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." + remediation: "Edit /etc/systemd/coredump.conf and edit or add the following line: Storage=none." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*Storage\s*=\s*none' + + # 1.5.2 Ensure core dump backtraces are disabled. (Automated) + - id: 6540 + title: "Ensure core dump backtraces are disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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, increasing the risk to the system." + remediation: "Edit or add the following line in /etc/systemd/coredump.conf: ProcessSizeMax=0." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.2"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*ProcessSizeMax\s*=\s*0' + + # 1.5.3 Ensure address space layout randomization (ASLR) is enabled. (Automated) + - id: 6541 + title: "Ensure address space layout randomization (ASLR) is enabled." + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: 'Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: Example: # printf " kernel.randomize_va_space = 2 " >> /etc/sysctl.d/60-kernel_sysctl.conf Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2.' + compliance: + - cis: ["1.5.3"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: any + rules: + - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + - 'f:/etc/sysctl.conf -> r:^\s*kernel.randomize_va_space\s*=\s*2' + - 'd:/etc/sysctl.d/ -> r:\.+ -> r:^\s*kernel.randomize_va_space\s*=\s*2' + + # 1.6.1.1 Ensure SELinux is installed. (Automated) + - id: 6542 + title: "Ensure SELinux is installed." + description: "SELinux provides Mandatory Access Control." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install SELinux: # dnf install libselinux." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:rpm -q libselinux -> r:libselinux-" + + # 1.6.1.2 Ensure SELinux is not disabled in bootloader configuration. (Automated) + - id: 6543 + title: "Ensure SELinux is not disabled in bootloader configuration." + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + impact: "Files created while SELinux is disabled are not labeled at all. This behavior causes problems when changing to enforcing mode because files are labeled incorrectly or are not labeled at all. To prevent incorrectly labeled and unlabeled files from causing problems, file systems are automatically relabeled when changing from the disabled state to permissive or enforcing mode. This can be a long running process that should be accounted for as it may extend downtime during initial re-boot." + remediation: "Run the following command to remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: grubby --update-kernel ALL --remove-args 'selinux=0 enforcing=0'." + compliance: + - cis: ["1.6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not f:/boot/grub2/grubenv -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + + # 1.6.1.3 Ensure SELinux policy is configured. (Automated) + - id: 6544 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+targeted$|^Loaded policy name:\s+mls$' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Ensure the SELinux mode is not disabled. (Automated) + - id: 6545 + title: "Ensure the SELinux mode is not disabled." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes" + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$|^Permissive$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing|\s*SELINUX\s*=\s*permisive' + + # 1.6.1.5 Ensure the SELinux mode is enforcing. (Automated) + - id: 6546 + title: "Ensure the SELinux mode is enforcing." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode the system not only avoids enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future. Running SELinux in Permissive mode, though helpful for developing SELinux policy, only logs access denial entries, but does not deny any operations." + remediation: "Run the following command to set SELinux's running mode: # setenforce 1 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes" + compliance: + - cis: ["1.6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + # 1.6.1.6 Ensure no unconfined services exist. (Automated) + - id: 6547 + title: "Ensure no unconfined services exist." + description: "Unconfined processes run in unconfined domains." + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules it does not replace them." + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "not c:ps -eZ -> r:unconfined_service_t" + + # 1.6.1.7 Ensure SETroubleshoot is not installed. (Automated) + - id: 6548 + title: "Ensure SETroubleshoot is not installed." + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # dnf remove setroubleshoot." + compliance: + - cis: ["1.6.1.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.9.1.1"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "not c:rpm -qa setroubleshoot -> r:^setroubleshoot" + + # 1.6.1.8 Ensure the MCS Translation Service (mcstrans) is not installed. (Automated) + - id: 6549 + title: "Ensure the MCS Translation Service (mcstrans) is not installed." + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf." + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # dnf remove mcstrans." + compliance: + - cis: ["1.6.1.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "not c:rpm -qa mcstrans -> r:^mcstrans" + + # 1.7.1 Ensure message of the day is configured properly. (Automated) + - id: 6550 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - "not f:/etc/motd" + - 'not f:/etc/motd -> r:\\v|\\r|\\m|\\s' + + # 1.7.2 Ensure local login warning banner is configured properly. (Automated) + - id: 6551 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.7.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'not f:/etc/issue -> r:\\v|\\r|\\m|\\s' + + # 1.7.3 Ensure remote login warning banner is configured properly. (Automated) + - id: 6552 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + + # 1.7.4 Ensure permissions on /etc/motd are configured. (Automated) + - id: 6553 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd : # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.5 Ensure permissions on /etc/issue are configured. (Automated) + - id: 6554 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue : # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured. (Automated) + - id: 6555 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.8.1 Ensure GNOME Display Manager is removed. (Manual) + - id: 6556 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + impact: "Removing the GNOME Display manager will remove the GUI from the system." + remediation: "Run the following command to remove the gdm package # dnf remove gdm." + references: + - "https://wiki.gnome.org/Projects/GDM" + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "f:rpm -q gdm -> r:is not installed" + + # 1.8.2 Ensure GDM login banner is configured. (Automated) + - id: 6557 + title: "Ensure GDM login banner is configured." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Note: If a graphical login is not required, it should be removed to reduce the attack surface of the system." + remediation: "Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/01-banner-message) [org/gnome/login-screen] banner-message-enable=true banner-message-text='' Example Banner Text: 'Authorized users only. All activity may be monitored and reported.' Run the following command to update the system databases: # dconf update." + compliance: + - cis: ["1.8.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm" + - "f:/etc/dconf/profile/gdm -> r:user-db:user" + - "f:/etc/dconf/profile/gdm -> r:system-db:gdm" + - "f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - 'd:/etc/dconf/db/gdm.d -> r:\.+ -> r:banner-message-enable=true' + - 'd:/etc/dconf/db/gdm.d -> r:\.+ -> r:banner-message-text=' + + # 1.8.3 Ensure last logged in user display is disabled. (Automated) + - id: 6558 + title: "Ensure last logged in user display is disabled." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Displaying the last logged in user eliminates half of the Userid/Password equation that an unauthorized person would need to log on. Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Notes: - - If a graphical login is not required, it should be removed to reduce the attack surface of the system. If a different GUI login service is in use and required on the system, consult your documentation to disable displaying the last logged on user." + remediation: "Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/00-login-screen) [org/gnome/login-screen] # Do not show the user list disable-user-list=true Run the following command to update the system databases: # dconf update." + compliance: + - cis: ["1.8.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm" + - "f:/etc/dconf/profile/gdm -> r:user-db:user" + - "f:/etc/dconf/profile/gdm -> r:system-db:gdm" + - "f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - 'd:/etc/dconf/db/gdm.d -> r:\.+ -> r:disable-user-list=true' + + # 1.8.4 Ensure XDMCP is not enabled. (Automated) + - id: 6559 + title: "Ensure XDMCP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. - XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user - XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server." + remediation: "Edit the file /etc/gdm/custom.conf and remove the line Enable=true." + references: + - "https://help.gnome.org/admin/gdm/2.32/configuration.html.en" + compliance: + - cis: ["1.8.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not f:/etc/gdm/custom.conf -> r:^\s*Enable\s*=\s*true' + + # 1.8.5 Ensure automatic mounting of removable media is disabled. (Automated) + - id: 6560 + title: "Ensure automatic mounting of removable media is disabled." + description: "By default GNOME automatically mounts removable media when inserted as a convenience to the user." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "Ensure that automatic mounting of media is disabled for all GNOME users: # cat << EOF >> /etc/dconf/db/local.d/00-media-automount [org/gnome/desktop/media-handling] automount=false automount-open=false EOF Apply the changes with: # dconf update." + references: + - "https://access.redhat.com/solutions/20107" + compliance: + - cis: ["1.8.5"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - "c:gsettings get org.gnome.desktop.media-handling automount -> r:^false" + - "c:gsettings get org.gnome.desktop.media-handling automount-open -> r:^false" + + # 1.9 Ensure updates, patches, and additional security software are installed. (Manual) + - id: 6561 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available updates: # dnf update." + compliance: + - cis: ["1.9"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'not c:sh -c "dnf check-update | egrep -v \"Updating|Last metadata|^$\"" -> r:^\w' + + # 1.10 Ensure system-wide crypto policy is not legacy. (Automated) + - id: 6562 + title: "Ensure system-wide crypto policy is not legacy." + description: "The system-wide crypto-policies followed by the crypto core components allow consistently deprecating and disabling algorithms system-wide. The individual policy levels (DEFAULT, LEGACY, FUTURE, and FIPS) are included in the crypto-policies(7) package." + rationale: "If the Legacy system-wide crypto policy is selected, it includes support for TLS 1.0, TLS 1.1, and SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are allowed, while RSA and Diffie-Hellman parameters are accepted if larger than 1023-bits. These legacy protocols and algorithms can make the system vulnerable to attacks, including those listed in RFC 7457." + impact: "Environments that require compatibility with older insecure protocols may require the use of the less secure LEGACY policy level." + remediation: "Run the following command to change the system-wide crypto policy # update-crypto-policies --set Example: # update-crypto-policies --set DEFAULT Run the following to make the updated system-wide crypto policy active # update-crypto-policies." + references: + - "https://access.redhat.com/articles/3642912#what-polices-are-provided-1" + compliance: + - cis: ["1.10"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'f:/etc/crypto-policies/config -> r:^\s*LEGACY' + + # 2.1.1 Ensure time synchronization is in use. (Automated) + - id: 6563 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them. Note: If another method for time synchronization is being used, this section may be skipped." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Run the following command to install chrony: # dnf install chrony." + compliance: + - cis: ["2.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:rpm -q chrony -> r:^chrony-" + + # 2.1.2 Ensure chrony is configured. (Automated) + - id: 6564 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: 'Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include ''-u chrony'': OPTIONS="-u chrony".' + compliance: + - cis: ["2.1.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "f:/etc/chrony.conf" + - 'f:/etc/chrony.conf -> r:^\s*\t*server|^\s*\t*pool' + - 'f:/etc/sysconfig/chronyd -> r:^\s*\t*OPTIONS\.*-u chrony' + + # 2.2.1 Ensure xinetd is not installed. (Automated) + - id: 6565 + title: "Ensure xinetd is not installed." + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed to reduce the attack surface are of the system. Note: If an xinetd service or services are required, ensure that any xinetd service not required is stopped and disabled." + remediation: "Run the following command to remove xinetd: # dnf remove xinetd." + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q xinetd -> r:^package xinetd is not installed" + + # 2.2.2 Ensure xorg-x11-server-common is not installed. (Automated) + - id: 6566 + title: "Ensure xorg-x11-server-common is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: 'Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime.' + remediation: "Run the following command to remove the X Windows Server packages: # dnf remove xorg-x11-server-common." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q xorg-x11-server-common -> r:^package xorg-x11-server-common is not installed" + + # 2.2.3 Ensure Avahi Server is not installed. (Automated) + - id: 6567 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to stop, mask and remove avahi-autoipd and avahi: # systemctl stop avahi-daemon.socket avahi-daemon.service # dnf remove avahi-autoipd avahi." + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q avahi -> r:^package avahi is not installed" + - "c:rpm -q avahi-autoipd -> r:^package avahi-autoipd is not installed" + + # 2.2.4 Ensure CUPS is not installed. (Automated) + - id: 6568 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface. Note: Removing CUPS will prevent printing from the system." + impact: "Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to remove cups: # dnf remove cups." + references: + - "http://www.cups.org." + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q cups -> r:^package cups is not installed" + + # 2.2.5 Ensure DHCP Server is not installed. (Automated) + - id: 6569 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that the rpm -q dhcp-server package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcp: # dnf remove dhcp-server." + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dhcp-server -> r:^package dhcp-server is not installed" + + # 2.2.6 Ensure DNS Server is not installed. (Automated) + - id: 6570 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove bind: # dnf remove bind." + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q bind -> r:^package bind is not installed" + + # 2.2.7 Ensure FTP Server is not installed. (Automated) + - id: 6571 + title: "Ensure FTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove ftp: # dnf remove ftp." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ftp -> r:^package ftp is not installed" + + # 2.2.8 Ensure VSFTP Server is not installed. (Automated) + - id: 6572 + title: "Ensure VSFTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "Unless there is a need to run the system as a FTP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # dnf remove vsftpd." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q vsftpd -> r:^package vsftpd is not installed" + + # 2.2.9 Ensure TFTP Server is not installed. (Automated) + - id: 6573 + title: "Ensure TFTP Server is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + remediation: "Run the following command to remove tftp-server: # dnf remove tftp-server." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp-server -> r:^package tftp-server is not installed" + + # 2.2.10 Ensure a web server is not installed. (Automated) + - id: 6574 + title: "Ensure a web server is not installed." + description: "Web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the packages be removed to reduce the potential attack surface. Note: Several http servers exist. They should also be audited, and removed, if not required." + remediation: "Run the following command to remove httpd and nginx: # dnf remove httpd nginx." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nginx -> r:^package nginx is not installed" + - "c:rpm -q httpd -> r:^package httpd is not installed" + + # 2.2.11 Ensure IMAP and POP3 server is not installed. (Automated) + - id: 6575 + title: "Ensure IMAP and POP3 server is not installed." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface. Note: Several IMAP/POP3 servers exist and can use other service names. These should also be audited and the packages removed if not required." + remediation: "Run the following command to remove dovecot and cyrus-imapd: # dnf remove dovecot cyrus-imapd." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dovecot -> r:^package dovecot is not installed" + - "c:rpm -q cyrus-imapd -> r:^package cyrus-imapd is not installed" + + # 2.2.12 Ensure Samba is not installed. (Automated) + - id: 6576 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # dnf remove samba." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q samba -> r:^package samba is not installed" + + # 2.2.13 Ensure HTTP Proxy Server is not installed. (Automated) + - id: 6577 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "Unless a system is specifically set up to act as a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface. Note: Several HTTP proxy servers exist. These should be checked and removed unless required." + remediation: "Run the following command to remove the squid package: # dnf remove squid." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q squid -> r:^package squid is not installed" + + # 2.2.14 Ensure net-snmp is not installed. (Automated) + - id: 6578 + title: "Ensure net-snmp is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. If SNMP v2 is absolutely necessary, modify the community strings' values. -." + remediation: "Run the following command to remove net-snmpd: # dnf remove net-snmp." + compliance: + - cis: ["2.2.14"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q net-snmp -> r:^package net-snmp is not installed" + + # 2.2.15 Ensure NIS server is not installed. (Automated) + - id: 6579 + title: "Ensure NIS server is not installed." + description: "The ypserv package provides the Network Information Service (NIS). This service, formally known as Yellow Pages, is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the ypserv package be removed, and if required a more secure services be used." + remediation: "Run the following command to remove ypserv: # dnf remove ypserv." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ypserv -> r:^package ypserv is not installed" + + # 2.2.16 Ensure telnet-server is not installed. (Automated) + - id: 6580 + title: "Ensure telnet-server is not installed." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to remove the telnet-server package: # dnf remove telnet-server." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet-server -> r:^package telnet-server is not installed" + + # 2.2.17 Ensure mail transfer agent is configured for local-only mode. (Automated) + - id: 6581 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Notes: - This recommendation is designed around the postfix mail server. - Depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.17"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not c:ss -lntu -> r:\s*127.0.0.1:25\s*|\s*::1:25\s*' + + # 2.2.18 Ensure nfs-utils is not installed or the nfs-server service is masked. (Automated) + - id: 6582 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not require network shares, it is recommended that the nfs-utils package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization are dependent on the nfs-utils package. If the nfs-package is required as a dependency, the nfs-server should be disabled and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove nfs-utils OR If the nfs-package is required as a dependency, run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server." + compliance: + - cis: ["2.2.18"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q nfs-utils -> r:^package nfs-utils is not installed" + - "c:systemctl is-enabled nfs-server -> r:masked|No such file or directory" + + # 2.2.19 Ensure rpcbind is not installed or the rpcbind services are masked. (Automated) + - id: 6583 + title: "Ensure rpcbind is not installed or the rpcbind services are masked." + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening." + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization, and the nfs-utils package used for The Network File System (NFS), are dependent on the rpcbind package. If the rpcbind package is required as a dependency, the services rpcbind.service and rpcbind.socket should be stopped and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove rpcbind OR If the rpcbind package is required as a dependency, run the following commands to stop and mask the rpcbind and rpcbind.socket services: # systemctl --now mask rpcbind # systemctl --now mask rpcbind.socket." + compliance: + - cis: ["2.2.19"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rpcbind -> r:^package rpcbind is not installed" + - "c:systemctl is-enabled rpcbind -> r:masked|No such file or directory" + - "c:systemctl is-enabled rpcbind.socket -> r:masked|No such file or directory" + + # 2.2.20 Ensure rsync is not installed or the rsyncd service is masked. (Automated) + - id: 6584 + title: "Ensure rsync is not installed or the rsyncd service is masked." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication. Note: If a required dependency exists for the rsync package, but the rsyncd service is not required, the service should be masked." + impact: "There are packages that are dependent on the rsync package. If the rsync package is removed, these packages will be removed as well. Before removing the rsync package, review any dependent packages to determine if they are required on the system. If a dependent package is required, mask the rsyncd service and leave the rsync package installed." + remediation: "Run the following command to remove the rsync package: # dnf remove rsync OR Run the following command to mask the rsyncd service: # systemctl --now mask rsyncd." + compliance: + - cis: ["2.2.20"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rsync -> r:^package rsync is not installed" + - "c:systemctl is-enabled rsyncd -> r:masked|No such file or directory" + + # 2.3.1 Ensure NIS Client is not installed. (Automated) + - id: 6585 + title: "Ensure NIS Client is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the ypbind package: # dnf remove ypbind." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ypbind -> r:^package ypbind is not installed" + + # 2.3.2 Ensure rsh client is not installed. (Automated) + - id: 6586 + title: "Ensure rsh client is not installed." + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh, rcp and rlogin." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the rsh package: # dnf remove rsh." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q rsh -> r:^package rsh is not installed" + + # 2.3.3 Ensure talk client is not installed. (Automated) + - id: 6587 + title: "Ensure talk client is not installed." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the talk package: # dnf remove talk." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q talk -> r:^package talk is not installed" + + # 2.3.4 Ensure telnet client is not installed. (Automated) + - id: 6588 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the telnet package: # dnf remove telnet." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet -> r:^package telnet is not installed" + + # 2.3.5 Ensure LDAP client is not installed. (Automated) + - id: 6589 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Run the following command to remove the openldap-clients package: # dnf remove openldap-clients." + compliance: + - cis: ["2.3.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q openldap-clients -> r:^package openldap-clients is not installed" + + # 2.3.6 Ensure TFTP client is not installed. (Automated) + - id: 6590 + title: "Ensure TFTP client is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + remediation: "Run the following command to remove tftp: # dnf remove tftp." + compliance: + - cis: ["2.3.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp -> r:^package tftp is not installed" + + # 2.4 Ensure nonessential services are removed or masked. (Manual) - Not Implemented + + # 3.1.1 Verify if IPv6 is enabled on the system. (Manual) - Not Implemented + + # 3.1.2 Ensure SCTP is disabled. (Automated) + - id: 6591 + title: "Ensure SCTP is disabled." + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: printf " install sctp /bin/true " >> /etc/modprobe.d/sctp.conf.' + compliance: + - cis: ["3.1.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:modprobe -n -v sctp -> r:^install\s*\t*/bin/true' + - "not c:lsmod -> r:^sctp" + + # 3.1.3 Ensure DCCP is disabled. (Automated) + - id: 6592 + title: "Ensure DCCP is disabled." + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: printf " install dccp /bin/true " >> /etc/modprobe.d/dccp.conf.' + compliance: + - cis: ["3.1.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:modprobe -n -v dccp -> r:^install\s*\t*/bin/true' + - "not c:lsmod -> r:^dccp" + + # 3.1.4 Ensure wireless interfaces are disabled. (Automated) - Not Implemented + + # 3.2.1 Ensure IP forwarding is disabled. (Automated) - Not Implemented + # 3.2.2 Ensure packet redirect sending is disabled. (Automated) - Not Implemented + # 3.3.1 Ensure source routed packets are not accepted. (Automated) - Not Implemented + # 3.3.2 Ensure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.3 Ensure secure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.4 Ensure suspicious packets are logged. (Automated) - Not Implemented + # 3.3.5 Ensure broadcast ICMP requests are ignored. (Automated) - Not Implemented + # 3.3.6 Ensure bogus ICMP responses are ignored. (Automated) - Not Implemented + # 3.3.7 Ensure Reverse Path Filtering is enabled. (Automated) - Not Implemented + # 3.3.8 Ensure TCP SYN Cookies is enabled. (Automated) - Not Implemented + # 3.3.9 Ensure IPv6 router advertisements are not accepted. (Automated) - Not Implemented + + # 3.4.1.1 Ensure firewalld is installed. (Automated) + - id: 6593 + title: "Ensure firewalld is installed." + description: "firewalld is a firewall management tool for Linux operating systems. It provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the iptables backend or provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the nftables utility. firewalld replaces iptables as the default firewall management tool. Use the firewalld utility to configure a firewall for less complex firewalls. The utility is easy to use and covers the typical use cases scenario. FirewallD supports both IPv4 and IPv6 networks and can administer separate firewall zones with varying degrees of trust as defined in zone profiles. Note: Starting in v0.6.0, FirewallD added support for acting as a front-end for the Linux kernel's netfilter framework via the nftables userspace utility, acting as an alternative to the nft command line program." + rationale: "A firewall utility is required to configure the Linux kernel's netfilter framework via the iptables or nftables back-end. The Linux kernel's netfilter framework host-based firewall can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host. Note: Only one firewall utility should be installed and configured. FirewallD is dependent on the iptables package." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install FirewallD and iptables: # dnf install firewalld iptables." + compliance: + - cis: ["3.4.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q firewalld -> r:^firewalld-" + - "c:rpm -q iptables -> r:^iptables-" + + # 3.4.1.2 Ensure iptables-services not installed with firewalld. (Automated) + - id: 6594 + title: "Ensure iptables-services not installed with firewalld." + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both firewalld and the services included in the iptables-services package may lead to conflict." + impact: "Running both firewalld and iptables/ip6tables service may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package # systemctl stop iptables # systemctl stop ip6tables # dnf remove iptables-services." + compliance: + - cis: ["3.4.1.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q iptables-services -> r:^package iptables-services is not installed" + + # 3.4.1.3 Ensure nftables either not installed or masked with firewalld. (Automated) + - id: 6595 + title: "Ensure nftables either not installed or masked with firewalld." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables. _Note: Support for using nftables as the back-end for firewalld was added in release v0.6.0. In Fedora 19 Linux derivatives, firewalld utilizes iptables as its back-end by default." + rationale: "Running both firewalld and nftables may lead to conflict. Note: firewalld may configured as the front-end to nftables. If this case, nftables should be stopped and masked instead of removed." + remediation: 'Run the following command to remove nftables: # dnf remove nftables OR Run the following command to stop and mask nftables" systemctl --now mask nftables.' + compliance: + - cis: ["3.4.1.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q nftables -> r:^package nftables is not installed" + - "c:systemctl is-active nftables -> r:^inactive" + - "c:systemctl is-enabled nftables -> r:^masked" + + # 3.4.1.4 Ensure firewalld service enabled and running. (Automated) + - id: 6596 + title: "Ensure firewalld service enabled and running." + description: "firewalld.service enables the enforcement of firewall rules configured through firewalld." + rationale: "Ensure that the firewalld.service is enabled and running to enforce firewall rules configured through firewalld." + impact: "Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following command to unmask firewalld # systemctl unmask firewalld Run the following command to enable and start firewalld # systemctl --now enable firewalld." + compliance: + - cis: ["3.4.1.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled firewalld -> r:^enabled" + - "c:firewall-cmd --state -> r:^running" + + # 3.4.1.5 Ensure firewalld default zone is set. (Automated) - Not Implemented + # 3.4.1.6 Ensure network interfaces are assigned to appropriate zone. (Manual) - Not Implemented + + # 3.4.1.7 Ensure firewalld drops unnecessary services and ports. (Manual) - Not Implemented + + # 3.4.2.1 Ensure nftables is installed. (Automated) + - id: 6597 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem. Note: - nftables is available in Linux kernel 3.13 and newer. - Only one firewall utility should be installed and configured." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install nftables # dnf install nftables." + compliance: + - cis: ["3.4.2.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^nftables-" + + # 3.4.2.2 Ensure firewalld is either not installed or masked with nftables. (Automated) + - id: 6598 + title: "Ensure firewalld is either not installed or masked with nftables." + description: 'firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with support for network/firewall "zones" to assign a level of trust to a network and its associated connections, interfaces or sources. It has support for IPv4, IPv6, Ethernet bridges and also for IPSet firewall settings. There is a separation of the runtime and permanent configuration options.' + rationale: "Running both nftables.service and firewalld.service may lead to conflict and unexpected results." + remediation: "Run the following command to remove firewalld # dnf remove firewalld OR Run the following command to stop and mask firewalld # systemctl --now mask firewalld." + compliance: + - cis: ["3.4.2.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q firewalld -> r:^package firewalld is not installed" + - "not c:firewall-cmd --state -> r:^running" + - "c:systemctl is-enabled firewalld -> r:^masked" + + # 3.4.2.3 Ensure iptables-services not installed with nftables. (Automated) + - id: 6599 + title: "Ensure iptables-services not installed with nftables." + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both nftables and the services included in the iptables-services package may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package # systemctl stop iptables # systemctl stop ip6tables # dnf remove iptables-services." + compliance: + - cis: ["3.4.2.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q iptables-services -> r:^package iptables-services is not installed" + + # 3.4.2.4 Ensure iptables are flushed with nftables. (Manual) - Not Implemented + + # 3.4.2.5 Ensure an nftables table exists. (Automated) + - id: 6600 + title: "Ensure an nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + impact: "Adding rules to a running nftables can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example: # nft create table inet filter." + compliance: + - cis: ["3.4.2.5"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:nft list tables -> r:\w+' + + # 3.4.2.6 Ensure nftables base chains exist. (Automated) + - id: 6601 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.4.2.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input" + - "c:nft list ruleset -> r:hook forward" + - "c:nft list ruleset -> r:hook output" + + # 3.4.2.7 Ensure nftables loopback traffic is configured. (Automated) + - id: 6602 + title: "Ensure nftables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # nft add rule inet filter input iif lo accept # nft create rule inet filter input ip saddr 127.0.0.0/8 counter drop IF IPv6 is enabled: Run the following command to implement the IPv6 loopback rules: # nft add rule inet filter input ip6 saddr ::1 counter drop." + compliance: + - cis: ["3.4.2.7"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:sh -c "nft list ruleset | awk ''/hook input/,/}/''" -> r:iif "lo" accept' + - 'c:sh -c "nft list ruleset | awk ''/hook input/,/}/''" -> r:ip saddr|ip6 saddr' + + # 3.4.2.8 Ensure nftables outbound and established connections are configured. (Manual) -Not Implemented + + # 3.4.2.9 Ensure nftables default deny firewall policy. (Automated) + - id: 6603 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue traversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over the network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; } # nft chain inet filter output { policy drop \\; }." + compliance: + - cis: ["3.4.2.9"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input && r:policy drop" + - "c:nft list ruleset -> r:hook forward && r:policy drop" + - "c:nft list ruleset -> r:hook output && r:policy drop" + + # 3.4.2.10 Ensure nftables service is enabled. (Automated) + - id: 6604 + title: "Ensure nftables service is enabled." + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables." + compliance: + - cis: ["3.4.2.10"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled nftables -> r:^enabled" + + # 3.4.2.11 Ensure nftables rules are permanent. (Automated) + - id: 6605 + title: "Ensure nftables rules are permanent." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames. The nftables service reads the /etc/sysconfig/nftables.conf file for a nftables file or files to include in the nftables ruleset. A nftables ruleset containing the input, forward, and output base chains allow network traffic to be filtered." + rationale: "Changes made to nftables ruleset only affect the live system, you will also need to configure the nftables ruleset to apply on boot." + remediation: 'Edit the /etc/sysconfig/nftables.conf file and un-comment or add a line with include for each nftables file you want included in the nftables ruleset on boot: Example: include "/etc/nftables/nftables.rules".' + compliance: + - cis: ["3.4.2.11"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "f:/etc/nftables.conf -> r:include *" + + # 3.4.3.1.1 Ensure iptables packages are installed. (Automated) + - id: 6606 + title: "Ensure iptables packages are installed." + description: "iptables is a utility program that allows a system administrator to configure the tables provided by the Linux kernel firewall, implemented as different Netfilter modules, and the chains and rules it stores. Different kernel modules and programs are used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames." + rationale: "A method of configuring and maintaining firewall rules is necessary to configure a Host Based Firewall." + remediation: "Run the following command to install iptables and iptables-services # dnf install iptables iptables-services." + compliance: + - cis: ["3.4.3.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q iptables -> r:^iptables-" + - "c:rpm -q iptables-services -> r:^iptables-services-" + + # 3.4.3.1.2 Ensure nftables is not installed with iptables. (Automated) + - id: 6607 + title: "Ensure nftables is not installed with iptables." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables." + rationale: "Running both iptables and nftables may lead to conflict." + remediation: "Run the following command to remove nftables: # dnf remove nftables." + compliance: + - cis: ["3.4.3.1.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:package nftables is not installed" + + # 3.4.3.1.3 Ensure firewalld is either not installed or masked with iptables. (Automated) + - id: 6608 + title: "Ensure firewalld is either not installed or masked with iptables." + description: 'firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with support for network/firewall "zones" to assign a level of trust to a network and its associated connections, interfaces or sources. It has support for IPv4, IPv6, Ethernet bridges and also for IPSet firewall settings. There is a separation of the runtime and permanent configuration options.' + rationale: "Running iptables.service and\\or ip6tables.service with firewalld.service may lead to conflict and unexpected results." + remediation: "Run the following command to remove firewalld # yum remove firewalld OR Run the following command to stop and mask firewalld # systemctl --now mask firewalld." + compliance: + - cis: ["3.4.3.1.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q firewalld -> r:^package firewalld is not installed" + - "not c:systemctl status firewalld -> r:active && r:running" + - "c:systemctl is-enabled firewalld -> r:^masked" + + # 3.4.3.2.1 Ensure iptables loopback traffic is configured. (Automated) + - id: 6609 + title: "Ensure iptables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP." + compliance: + - cis: ["3.4.3.2.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + # 3.4.3.2.2 Ensure iptables outbound and established connections are configured. (Manual) - Not Implemented + # 3.4.3.2.3 Ensure iptables rules exist for all open ports. (Automated) - Not Implemented + + # 3.4.3.2.4 Ensure iptables default deny firewall policy. (Automated) + - id: 6610 + title: "Ensure iptables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP." + compliance: + - cis: ["3.4.3.2.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:iptables -L -> r:^Chain INPUT && r:policy DROP" + - "c:iptables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:iptables -L -> r:^Chain OUTPUT && r:policy DROP" + + # 3.4.3.2.5 Ensure iptables rules are saved. (Automated) - Not Implemented + + # 3.4.3.2.6 Ensure iptables is enabled and active. (Automated) + - id: 6611 + title: "Ensure iptables is enabled and active." + description: "iptables.service is a utility for configuring and maintaining iptables." + rationale: "iptables.service will load the iptables rules saved in the file /etc/sysconfig/iptables at boot, otherwise the iptables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start iptables: # systemctl --now enable iptables." + compliance: + - cis: ["3.4.3.2.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled iptables -> r:^enabled" + - "c:systemctl is-active iptables -> r:^active" + + # 3.4.3.3.1 Ensure ip6tables loopback traffic is configured. (Automated) + - id: 6612 + title: "Ensure ip6tables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP." + compliance: + - cis: ["3.4.3.3.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:ACCEPT\s*\t*all\s*\t*lo && r:\s*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:DROP\s*\t*all\s*\t*lo && r:\s*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:ACCEPT\s*\t*all\s*\t*lo && r:\s*::/0' + + # 3.4.3.3.2 Ensure ip6tables outbound and established connections are configured. (Manual) - Not Implemented + # 3.4.3.3.3 Ensure ip6tables firewall rules exist for all open ports. (Automated) - Not Implemented + + # 3.4.3.3.4 Ensure ip6tables default deny firewall policy. (Automated) + - id: 6613 + title: "Ensure ip6tables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP." + compliance: + - cis: ["3.4.3.3.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:ip6tables -L -> r:^Chain INPUT && r:policy DROP" + - "c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP" + + # 3.4.3.3.5 Ensure ip6tables rules are saved. (Automated) - Not Implemented + + # 3.4.3.3.6 Ensure ip6tables is enabled and active. (Automated) + - id: 6614 + title: "Ensure ip6tables is enabled and active." + description: "ip6tables.service is a utility for configuring and maintaining ip6tables." + rationale: "ip6tables.service will load the iptables rules saved in the file /etc/sysconfig/ip6tables at boot, otherwise the ip6tables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start ip6tables: # systemctl --now start ip6tables." + compliance: + - cis: ["3.4.3.3.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled ip6tables -> r:^enabled" + - "c:systemctl is-active ip6tables -> r:^active" + + # 4.1.1.1 Ensure auditd is installed. (Automated) + - id: 6615 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # dnf install audit." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v8: ["8.2", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:rpm -q audit -> r:^audit-" + + # 4.1.1.2 Ensure auditd service is enabled. (Automated) + - id: 6616 + title: "Ensure auditd service is enabled." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:^enabled" + + # 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled. (Automated) + - id: 6617 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd , so that potential malicious activity cannot go undetected." + remediation: "Run the following command to add audit=1 to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit=1'." + compliance: + - cis: ["4.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "not f:/boot/grub2/grubenv -> r:kernelopts= && !r:audit=1" + + # 4.1.1.4 Ensure audit_backlog_limit is sufficient. (Automated) + - id: 6618 + title: "Ensure audit_backlog_limit is sufficient." + description: "The backlog limit has a default setting of 64." + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more that 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected." + remediation: "Run the following command to add audit_backlog_limit= to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit_backlog_limit=' Example: # grubby --update-kernel ALL --args 'audit_backlog_limit=8192'." + compliance: + - cis: ["4.1.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts= && n:audit_backlog_limit=(\d+) compare >= 8192' + + # 4.1.2.1 Ensure audit log storage size is configured. (Automated) + - id: 6619 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' + + # 4.1.2.2 Ensure audit logs are not automatically deleted. (Automated) + - id: 6620 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full. (Automated) + - id: 6621 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full. The admin_space_left_action parameter tells the system what action to take when the system has detected that it is low on disk space. Valid values are ignore, syslog, suspend, single, and halt. - ignore, the audit daemon does nothing - Syslog, the audit daemon will issue a warning to syslog - Suspend, the audit daemon will stop writing records to the disk - single, the audit daemon will put the computer system in single user mode - halt, the audit daemon will shutdown the system." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + impact: "If the admin_space_left_action parameter is set to halt the audit daemon will shutdown the system when the disk partition containing the audit logs becomes full." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root set admin_space_left_action to either halt or single in /etc/audit/auditd.conf. Example: admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt|^\s*admin_space_left_action\s*=\s*single' + + # 4.1.3.1 Ensure changes to system administration scope (sudoers) is collected. (Automated) + - id: 6622 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers, or files in /etc/sudoers.d, will be written to when the file(s) or related attributes have changed. The audit records will be tagged with the identifier "scope".' + rationale: "Changes in the /etc/sudoers and /etc/sudoers.d files can indicate that an unauthorized change has been made to the scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor scope changes for system administrators. Example: # printf \" -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d -p wa -k scope \" >> /etc/audit/rules.d/50-scope.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.1"] + - cis_csc_v7: ["4.8"] + - iso_27001-2013: ["A.12.4.3"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'c:auditctl -l -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'c:auditctl -l -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=\\s*\t*scope' + + # 4.1.3.2 Ensure actions as another user are always logged. (Automated) + - id: 6623 + title: "Ensure actions as another user are always logged." + description: "sudo provides users with temporary elevated privileges to perform operations, either as the superuser or another user." + rationale: "Creating an audit log of users with temporary elevated privileges and the operation(s) they performed is essential to reporting. Administrators will want to correlate the events written to the audit trail with the records written to sudo's logfile to verify if unauthorized commands have been executed." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor elevated privileges. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -C euid!=uid -F auid!=unset -S execve -k user_emulation -a always,exit -F arch=b32 -C euid!=uid -F auid!=unset -S execve -k user_emulation \" >> /etc/audit/rules.d/50-user_emulation.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + + # 4.1.3.3 Ensure events that modify the sudo log file are collected. (Automated) - Not Implemented + + # 4.1.3.4 Ensure events that modify date and time information are collected. (Automated) + - id: 6624 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the; - adjtimex - tune kernel clock - settimeofday - set time using timeval and timezone structures - stime - using seconds since 1/1/1970 - clock_settime - allows for the setting of several internal clocks and timers system calls have been executed. Further, ensure to write an audit record to the configured audit log file upon exit, tagging the records with a unique identifier such as "time-change".' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify date and time information. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S adjtimex,settimeofday,clock_settime -k time-change -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime -k time-change -w /etc/localtime -p wa -k time-change \" >> /etc/audit/rules.d/50-time-change.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64. In addition, add stime to the system call audit. Example: -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime,stime -k time-change." + compliance: + - cis: ["4.1.3.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change' + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change" + + # 4.1.3.5 Ensure events that modify the system's network environment are collected. (Automated) + - id: 6625 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitors the following system calls, and write an audit event on system call exit: - sethostname - set the systems host name - setdomainname - set the systems domain name The files being monitored are: - /etc/issue and /etc/issue.net - messages displayed pre-login - /etc/hosts - file containing host names and associated IP addresses - /etc/sysconfig/network - additional information that is valid to all network interfaces - /etc/sysconfig/network-scripts/ - directory containing network interface scripts and configurations files." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records should have a relevant tag associated with them." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's network environment. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S sethostname,setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname,setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale \" >> /etc/audit/rules.d/50-system_local.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.5"] + - cis_csc_v7: ["5.5"] + - iso_27001-2013: ["A.12.1.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sysconfig/network-scripts/ && r:-p wa && r:-k system-locale|key=system-locale' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/sysconfig/network-scripts/ && r:-p wa && r:-k system-locale|key=system-locale" + + # 4.1.3.6 Ensure use of privileged commands are collected. (Automated) - Not Implemented + + # 4.1.3.7 Ensure unsuccessful file access attempts are collected. (Automated) - Not Implemented + + # 4.1.3.8 Ensure events that modify user/group information are collected. (Automated) + - id: 6626 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the modification of user or group information, including that of passwords and old passwords if in use. - /etc/group - system groups - /etc/passwd - system users - /etc/gshadow - encrypted password for each group - /etc/shadow - system user passwords - /etc/security/opasswd - storage of old passwords if the relevant PAM module is in use The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify user/group information. Example: # printf \" -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity \" >> /etc/audit/rules.d/50-identity.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.8"] + - cis_csc_v7: ["4.8"] + - iso_27001-2013: ["A.12.4.3"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity' + - "c:auditctl -l -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity" + + # 4.1.3.9 Ensure discretionary access control permission modification events are collected. (Automated) - Not Implemented + + # 4.1.3.10 Ensure successful file system mounts are collected. (Automated) + - id: 6627 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful file system mounts. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=unset -k mounts -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=unset -k mounts \" >> /etc/audit/rules.d/50-perm_mod.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.10"] + - cis_csc_v7: ["5.1"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + + # 4.1.3.11 Ensure session initiation information is collected. (Automated) + - id: 6628 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. - /var/run/utmp - tracks all currently logged in users. - /var/log/wtmp - file tracks logins, logouts, shutdown, and reboot events. - /var/log/btmp - keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier "session.".' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor session initiation information. Example: # printf \" -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k session -w /var/log/btmp -p wa -k session \" >> /etc/audit/rules.d/50-session.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.11"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session' + - "c:auditctl -l -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session" + + # 4.1.3.12 Ensure login and logout events are collected. (Automated) + - id: 6629 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. - /var/log/lastlog - maintain records of the last time a user successfully logged in. - /var/run/faillock - directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor login and logout events. Example: # printf \" -w /var/log/lastlog -p wa -k logins -w /var/run/faillock -p wa -k logins \" >> /etc/audit/rules.d/50-login.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.12"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.8.1.3", "A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins' + - "c:auditctl -l -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins" + - "c:auditctl -l -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins" + + # 4.1.3.13 Ensure file deletion events by users are collected. (Automated) + - id: 6630 + title: "Ensure file deletion events by users are collected." + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for: - unlink - remove a file - unlinkat - remove a file attribute - rename - rename a file - renameat rename a file attribute system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor file deletion events by users. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete -a always,exit -F arch=b32 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete \" >> /etc/audit/rules.d/50-delete.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.13"] + - cis_csc_v7: ["13"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + + # 4.1.3.14 Ensure events that modify the system's Mandatory Access Controls are collected. (Automated) + - id: 6631 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor SELinux, an implementation of mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux/ and /usr/share/selinux/ directories. Note: If a different Mandatory Access Control method is used, changes to the corresponding directories should be audited." + rationale: "Changes to files in the /etc/selinux/ and /usr/share/selinux/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's Mandatory Access Controls. Example: # printf \" -w /etc/selinux -p wa -k MAC-policy -w /usr/share/selinux -p wa -k MAC-policy \" >> /etc/audit/rules.d/50-MAC-policy.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.14"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/usr/share/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - "c:auditctl -l -> r:^-w && r:/etc/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy" + - "c:auditctl -l -> r:^-w && r:/usr/share/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy" + + # 4.1.3.15 Ensure successful and unsuccessful attempts to use the chcon command are recorded. (Automated) + - id: 6632 + title: "Ensure successful and unsuccessful attempts to use the chcon command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chcon command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chcon command. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.15"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + + # 4.1.3.16 Ensure successful and unsuccessful attempts to use the setfacl command are recorded. (Automated) + - id: 6633 + title: "Ensure successful and unsuccessful attempts to use the setfacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the setfacl command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the setfacl command. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-priv_cmd.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.16"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + + # 4.1.3.17 Ensure successful and unsuccessful attempts to use the chacl command are recorded. (Automated) + - id: 6634 + title: "Ensure successful and unsuccessful attempts to use the chacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chacl command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chacl command. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.17"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + + # 4.1.3.18 Ensure successful and unsuccessful attempts to use the usermod command are recorded. (Automated) + - id: 6635 + title: "Ensure successful and unsuccessful attempts to use the usermod command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the usermod command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the usermod command. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k usermod \" >> /etc/audit/rules.d/50-usermod.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.18"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + + # 4.1.3.19 Ensure kernel module loading unloading and modification is collected. (Automated) + - id: 6636 + title: "Ensure kernel module loading unloading and modification is collected." + description: "Monitor the loading and unloading of kernel modules. All the loading / listing / dependency checking of modules is done by kmod via symbolic links. The following system calls control loading and unloading of modules: - init_module - load a module - finit_module - load a module (used when the overhead of using cryptographically signed modules to determine the authenticity of a module can be avoided) - delete_module - delete a module - create_module - create a loadable module entry - query_module - query the kernel for various bits pertaining to modules Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of modules." + rationale: "Monitoring the use of all the various ways to manipulate kernel modules could provide system administrators with evidence that an unauthorized change was made to a kernel module, possibly compromising the security of the system." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor kernel module modification. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S init_module,finit_module,delete_module,create_module,query_module -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules -a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules \" >> /etc/audit/rules.d/50-kernel_modules.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.19"] + - cis_csc_v7: ["5.1"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l-> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - "c:ls -l /usr/sbin/lsmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/rmmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/insmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modinfo -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modprobe -> r:/bin/kmod" + - "c:ls -l /usr/sbin/depmod -> r:/bin/kmod" + + # 4.1.3.20 Ensure the audit configuration is immutable. (Automated) + - id: 6637 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: This setting will require the system to be rebooted to update the active auditd configuration settings.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the following line at the end of the file: -e 2." + compliance: + - cis: ["4.1.3.20"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sh -c "grep -iEh ''^\s*\t*-e 2\s*$'' /etc/audit/rules.d/*.rules | tail -1" -> r:^\s*\t*-e 2\s*$' + + # 4.1.3.21 Ensure the running and on disk configuration is the same. (Manual) + - id: 6638 + title: "Ensure the running and on disk configuration is the same." + description: "The Audit system have both on disk and running configuration. It is possible for these configuration settings to differ. Note: Due to the limitations of augenrules and auditctl, it is not absolutely guaranteed that loading the rule sets via augenrules --load will result in all rules being loaded or even that the user will be informed if there was a problem loading the rules." + rationale: "Configuration differences between what is currently running and what is on disk could cause unexpected problems or may give a false impression of compliance requirements." + remediation: 'If the rules are not aligned across all three () areas, run the following command to merge and load all rules: # augenrules --load Check if reboot is required. if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then echo "Reboot required to load rules"; fi.' + compliance: + - cis: ["4.1.3.21"] + - cis_csc_v8: ["8.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:augenrules --check -> r:^\s*/usr/sbin/augenrules && r:No change$' + + # 4.2.1.1 Ensure rsyslog is installed. (Automated) + - id: 6639 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is recommended in environments where journald does not meet operation requirements." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # dnf install rsyslog." + compliance: + - cis: ["4.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q rsyslog -> r:^rsyslog-" + + # 4.2.1.2 Ensure rsyslog service is enabled. (Automated) + - id: 6640 + title: "Ensure rsyslog service is enabled." + description: "Once the rsyslog package is installed, ensure that the service is enabled." + rationale: "If the rsyslog service is not enabled to start on boot, the system will not capture logging events." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:^enabled" + + # 4.2.1.3 Ensure journald is configured to send logs to rsyslog. (Manual) + - id: 6641 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the RSyslog service provides a consistent means of log collection and export." + rationale: "IF RSyslog is the preferred method for capturing logs, all logs of the system should be sent to it for further processing." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.3"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + + # 4.2.1.4 Ensure rsyslog default file permissions are configured. (Automated) + - id: 6642 + title: "Ensure rsyslog default file permissions are configured." + description: "RSyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + impact: "The systems global umask could override, but only making the file permissions stricter, what is configured in RSyslog with the FileCreateMode directive. RSyslog also has it's own $umask directive that can alter the intended file creation mode. In addition, consideration should be given to how FileCreateMode is used. Thus it is critical to ensure that the intended file creation mode is not overridden with less restrictive settings in /etc/rsyslog.conf, /etc/rsyslog.d/*conf files and that FileCreateMode is set before any file is created." + remediation: "Edit either /etc/rsyslog.conf or a dedicated .conf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640 Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.4"] + - cis_csc_v8: ["3.3", "8.2"] + - cis_csc_v7: ["5.1", "6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)", "164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\.*.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + # 4.2.1.5 Ensure logging is configured. (Manual) - Not Implemented + + # 4.2.1.6 Ensure rsyslog is configured to send logs to a remote log host. (Manual) - Not Implemented + + # 4.2.1.7 Ensure rsyslog is not configured to recieve logs from a remote client. (Automated) - Not Implemented + - id: 6643 + title: "Ensure rsyslog is not configured to recieve logs from a remote client." + description: "RSyslog supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: 'Should there be any active log server configuration found in the auditing section, modify those file and remove the specific lines highlighted by the audit. Ensure none of the following entries are present in any of /etc/rsyslog.conf or /etc/rsyslog.d/*.conf. Old format $ModLoad imtcp $InputTCPServerRun New format module(load="imtcp") input(type="imtcp" port="514") Restart the service: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.7"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not d:/etc/rsyslog.d -> r:\.+.conf$ -> r:^\s*\t*\$ModLoad imtcp|\s*\t*^\$InputTCPServerRun|^\s*\t*module load="imtcp"|^\s*\t*input type="imtcp" port="514"' + - 'not f:/etc/rsyslog.conf -> r:^\s*\t*\$ModLoad imtcp|^\s*\t*\$InputTCPServerRun|^\s*\t*module load="imtcp"|^\s*\t*input type="imtcp" port="514"' + + # 4.2.2.1 Ensure journald is configured to send logs to a remote log host 4.2.2.1.1 Ensure systemd-journal-remote is installed. (Manual) + - id: 6644 + title: "Ensure journald is configured to send logs to a remote log host 4.2.2.1.1 Ensure systemd-journal-remote is installed." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to install systemd-journal-remote: # dnf install systemd-journal-remote." + compliance: + - cis: ["4.2.2.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q systemd-journal-remote -> r:^systemd-journal-remote-" + + # 4.2.2.1.2 Ensure systemd-journal-remote is configured. (Manual) + - id: 6645 + title: "Ensure systemd-journal-remote is configured." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/systemd/journal-upload.conf file and ensure the following lines are set per your environment: URL=192.168.50.42 ServerKeyFile=/etc/ssl/private/journal-upload.pem ServerCertificateFile=/etc/ssl/certs/journal-upload.pem TrustedCertificateFile=/etc/ssl/ca/trusted.pem Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "f:/etc/systemd/journal-upload.conf -> r:URL=" + - "f:/etc/systemd/journal-upload.conf -> r:ServerKeyFile=" + - "f:/etc/systemd/journal-upload.conf -> r:ServerCertificateFile=" + - "f:/etc/systemd/journal-upload.conf -> r:TrustedCertificateFile=" + + # 4.2.2.1.3 Ensure systemd-journal-remote is enabled. (Manual) + - id: 6646 + title: "Ensure systemd-journal-remote is enabled." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to enable systemd-journal-remote: # systemctl --now enable systemd-journal-upload.service." + compliance: + - cis: ["4.2.2.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-upload.service -> r:^enabled" + + # 4.2.2.1.4 Ensure journald is not configured to recieve logs from a remote client. (Automated) + - id: 6647 + title: "Ensure journald is not configured to recieve logs from a remote client." + description: "Journald supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts. NOTE: - The same package, systemd-journal-remote, is used for both sending logs to remote hosts and receiving incoming logs. - With regards to receiving logs, there are two services; systemd-journal- remote.socket and systemd-journal-remote.service." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: "Run the following command to disable systemd-journal-remote.socket: # systemctl --now mask systemd-journal-remote.socket." + compliance: + - cis: ["4.2.2.1.4"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-remote.socket -> r:^masked" + + # 4.2.2.2 Ensure journald service is enabled. (Automated) + - id: 6648 + title: "Ensure journald service is enabled." + description: "Ensure that the systemd-journald service is enabled to allow capturing of logging events." + rationale: "If the systemd-journald service is not enabled to start on boot, the system will not capture logging events." + remediation: "By default the systemd-journald service does not have an [Install] section and thus cannot be enabled / disabled. It is meant to be referenced as Requires or Wants by other unit files. As such, if the status of systemd-journald is not static, investigate why." + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journald.service -> r:^static" + + # 4.2.2.3 Ensure journald is configured to compress large log files. (Automated) + - id: 6649 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.3", "6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - "f:/etc/systemd/journald.conf -> r:^Compress=yes" + + # 4.2.2.4 Ensure journald is configured to write logfiles to persistent disk. (Automated) + - id: 6650 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss due to a reboot." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "f:/etc/systemd/journald.conf -> r:^Storage=persistent" + + # 4.2.2.5 Ensure journald is not configured to send logs to rsyslog. (Manual) + - id: 6651 + title: "Ensure journald is not configured to send logs to rsyslog." + description: "Data from journald should be kept in the confines of the service and not forwarded on to other services." + rationale: "IF journald is the method for capturing logs, all logs of the system should be handled by journald and not forwarded to other logging mechanisms." + remediation: "Edit the /etc/systemd/journald.conf file and ensure that ForwardToSyslog=yes is removed. Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.5"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'not f:/etc/systemd/journald.conf -> !r:^# && r:ForwardToSyslog\s*=\s*yes' + + # 4.2.2.6 Ensure journald log rotation is configured per site policy. (Manual) + - id: 6652 + title: "Ensure journald log rotation is configured per site policy." + description: "Journald includes the capability of rotating log files regularly to avoid filling up the system with logs or making the logs unmanageably large. The file /etc/systemd/journald.conf is the configuration file used to specify how logs generated by Journald should be rotated." + rationale: "By keeping the log files smaller and more manageable, a system administrator can easily archive these files to another system and spend less time looking through inordinately large log files." + remediation: "Review /etc/systemd/journald.conf and verify logs are rotated according to site policy. The settings should be carefully understood as there are specific edge cases and prioritisation of parameters. The specific parameters for log rotation are: SystemMaxUse= SystemKeepFree= RuntimeMaxUse= RuntimeKeepFree= MaxFileSec=." + compliance: + - cis: ["4.2.2.6"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "f:/etc/systemd/journald.conf -> r:SystemMaxUse=" + - "f:/etc/systemd/journald.conf -> r:SystemKeepFree=" + - "f:/etc/systemd/journald.conf -> r:RuntimeMaxUse=" + - "f:/etc/systemd/journald.conf -> r:RuntimeKeepFree=" + - "f:/etc/systemd/journald.conf -> r:MaxFileSec=" + + # 4.2.2.7 Ensure journald default file permissions configured. (Manual) - Not Implemented + # 4.2.3 Ensure permissions on all logfiles are configured. (Automated) - Not Implemented + # 4.3 Ensure logrotate is configured. (Manual) - Not Implemented + + # 5.1.1 Ensure cron daemon is enabled. (Automated) + - id: 6653 + title: "Ensure cron daemon is enabled." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: # systemctl --now enable crond." + compliance: + - cis: ["5.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:systemctl is-enabled crond -> r:^enabled" + + # 5.1.2 Ensure permissions on /etc/crontab are configured. (Automated) + - id: 6654 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab." + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sh -c "stat -Lc ''%a %A %u %U %g %G'' /etc/crontab" -> r:600\s*\t*-rw------- && r:0\s*\t*root\s*\t*0\s*\t*root' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured. (Automated) + - id: 6655 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : # chown root:root /etc/cron.hourly # chmod og-rwx /etc/cron.hourly." + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/cron.hourly/ -> r:700\s*\t*drwx------\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured. (Automated) + - id: 6656 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily." + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/cron.daily/ -> r:700\s*\t*drwx------\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured. (Automated) + - id: 6657 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : # chown root:root /etc/cron.weekly # chmod og-rwx /etc/cron.weekly." + compliance: + - cis: ["5.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/cron.weekly/ -> r:700\s*\t*drwx------\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured. (Automated) + - id: 6658 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly." + compliance: + - cis: ["5.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/cron.monthly/ -> r:700\s*\t*drwx------\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured. (Automated) + - id: 6659 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab , but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d." + compliance: + - cis: ["5.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/cron.d/ -> r:700\s*\t*drwx------\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + + # 5.1.8 Ensure cron is restricted to authorized users. (Automated) + - id: 6660 + title: "Ensure cron is restricted to authorized users." + description: "If cron is installed in the system, configure /etc/cron.allow to allow specific users to use these services. If /etc/cron.allow does not exist, then /etc/cron.deny is checked. Any user not specifically defined in those files is allowed to use cron. By removing the file, only users in /etc/cron.allow are allowed to use cron. Note: Even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: 'Run the following scritp to remove /etc/cron.deny, create /etc/cron.allow, and set the file mode on /etc/cron.allow`: #!/usr/bin/env bash cron_fix() { if rpm -q cronie >/dev/null; then [ -e /etc/cron.deny ] && rm -f /etc/cron.deny [ ! -e /etc/cron.allow ] && touch /etc/cron.allow chown root:root /etc/cron.allow chmod u-x,go-rwx /etc/cron.allow else echo "cron is not installed on the system" fi } cron_fix OR Run the following command to remove cron: # dnf remove cronie.' + compliance: + - cis: ["5.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "f:/etc/cron.allow" + - "not f:/etc/cron.deny" + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/cron.allow -> r:640\s*\t*-rw-r-----\s*\t*0\s*\t*root\s*\t*0\s*\t*crontab' + + # 5.1.9 Ensure at is restricted to authorized users. (Automated) + - id: 6661 + title: "Ensure at is restricted to authorized users." + description: "If at is installed in the system, configure /etc/at.allow to allow specific users to use these services. If /etc/at.allow does not exist, then /etc/at.deny is checked. Any user not specifically defined in those files is allowed to use at. By removing the file, only users in /etc/at.allow are allowed to use at. Note: Even though a given user is not listed in at.allow, at jobs can still be run as that user. The at.allow file only controls administrative access to the at command for scheduling and modifying at jobs." + rationale: "On many systems, only the system administrator is authorized to schedule at jobs. Using the at.allow file to control who can run at jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: 'Run the following script to remove /etc/at.deny, create /etc/at.allow, and set the file mode for /etc/at.allow: #!/usr/bin/env bash at_fix() { if rpm -q at >/dev/null; then [ -e /etc/at.deny ] && rm -f /etc/at.deny [ ! -e /etc/at.allow ] && touch /etc/at.allow chown root:root /etc/at.allow chmod u-x,go-rwx /etc/at.allow else echo "at is not installed on the system" fi } at_fix OR Run the following command to remove at: # dnf remove at.' + compliance: + - cis: ["5.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "f:/etc/at.allow" + - "not f:/etc/at.deny" + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/at.allow -> r:640\s*\t*-rw-r-----\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured. (Automated) + - id: 6662 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sh -c "stat -Lc ''%a %A %u %U %g %G'' /etc/ssh/sshd_config" -> r:600\s*\t*-rw------- && r:0\s*\t*root\s*\t*0\s*\t*root' + + # 5.2.2 Ensure permissions on SSH private host key files are configured. (Automated) - Not Implemented + + # 5.2.3 Ensure permissions on SSH public host key files are configured. (Automated) - Not Implemented + + # 5.2.4 Ensure SSH access is limited. (Automated) + - id: 6663 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: o The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: o The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: o The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: o The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers OR AllowGroups OR DenyUsers OR DenyGroups ." + compliance: + - cis: ["5.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowUsers\s+\w+|^\s*AllowGroups\s+\w+|^\s*DenyUsers\s+\w+|^\s*DenyGroups\s+\w+' + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowUsers\s+\w+|^\s*AllowGroups\s+\w+|^\s*DenyUsers\s+\w+|^\s*DenyGroups\s+\w+' + + # 5.2.5 Ensure SSH LogLevel is appropriate. (Automated) + - id: 6664 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE OR LogLevel INFO." + references: + - "https://www.ssh.com/ssh/sshd_config/" + compliance: + - cis: ["5.2.5"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*LogLevel\s+INFO|^\s*LogLevel\s*VERBOSE' + - 'not f:/etc/ssh/sshd_config -> !r:^\s*LogLevel\s+INFO|^\s*LogLevel\s+VERBOSE' + - 'not d:/etc/ssh/sshd_config.d/ -> r:\.*.conf$ -> !r:^\s*LogLevel\s+INFO|^\s*LogLevel\s+VERBOSE' + + # 5.2.6 Ensure SSH PAM is enabled. (Automated) + - id: 6665 + title: "Ensure SSH PAM is enabled." + description: 'UsePAM Enables the Pluggable Authentication Module interface. If set to "yes" this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types.' + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + impact: "If UsePAM is enabled, you will not be able to run sshd(8) as a non-root user." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes." + compliance: + - cis: ["5.2.6"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*usepam\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*usepam\s+no' + + # 5.2.7 Ensure SSH root login is disabled. (Automated) + - id: 6666 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no." + compliance: + - cis: ["5.2.7"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*PermitRootLogin\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*PermitRootLogin\s+yes' + + # 5.2.8 Ensure SSH HostbasedAuthentication is disabled. (Automated) + - id: 6667 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no." + compliance: + - cis: ["5.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*HostbasedAuthentication\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*HostbasedAuthentication\s+yes' + + # 5.2.9 Ensure SSH PermitEmptyPasswords is disabled. (Automated) + - id: 6668 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no." + compliance: + - cis: ["5.2.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*PermitEmptyPasswords\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*PermitEmptyPasswords\s+yes' + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled. (Automated) + - id: 6669 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no." + compliance: + - cis: ["5.2.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*PermitUserEnvironment\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*PermitUserEnvironment\s+yes' + + # 5.2.11 Ensure SSH IgnoreRhosts is enabled. (Automated) + - id: 6670 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes." + compliance: + - cis: ["5.2.11"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*IgnoreRhosts\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*IgnoreRhosts\s+no' + + # 5.2.12 Ensure SSH X11 forwarding is disabled. (Automated) + - id: 6671 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no." + compliance: + - cis: ["5.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*X11Forwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*X11Forwarding\s+yes' + + # 5.2.13 Ensure SSH AllowTcpForwarding is disabled. (Automated) + - id: 6672 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments that employ mainframe systems as their application backends. In those environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no." + references: + - "https://www.ssh.com/ssh/tunneling/example" + compliance: + - cis: ["5.2.13"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowTcpForwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*AllowTcpForwarding\s+yes' + + # 5.2.14 Ensure system-wide crypto policy is not over-ridden. (Automated) + - id: 6673 + title: "Ensure system-wide crypto policy is not over-ridden." + description: "System-wide Crypto policy can be over-ridden or opted out of for openSSH." + rationale: "Over-riding or opting out of the system-wide crypto policy could allow for the use of less secure Ciphers, MACs, KexAlgorithms and GSSAPIKexAlgorithm." + remediation: "Run the following commands: # sed -ri \"s/^\\s*(CRYPTO_POLICY\\s*=.*)$/# \\1/\" /etc/sysconfig/sshd # systemctl reload sshd." + compliance: + - cis: ["5.2.14"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'not f:/etc/sysconfig/sshd -> ^\s*CRYPTO_POLICY=' + + # 5.2.15 Ensure SSH warning banner is configured. (Automated) + - id: 6674 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.2.15"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*banner\s*\t*/etc/issue.net' + + # 5.2.16 Ensure SSH MaxAuthTries is set to 4 or less. (Automated) + - id: 6675 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4." + compliance: + - cis: ["5.2.16"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -> n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'not f:/etc/ssh/sshd_config -> n:^MaxAuthTries\s*\t*(\d+) compare > 4' + + # 5.2.17 Ensure SSH MaxStartups is configured. (Automated) + - id: 6676 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: maxstartups 10:30:60." + compliance: + - cis: ["5.2.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*maxstartups\s+10:30:60' + - 'not f:/etc/ssh/sshd_config -> r:^\s*maxstartups\s+(((1[1-9]|[1-9][0-9][0-9]+):([0-9]+):([0-9]+))|(([0-9]+):(3[1-9]|[4-9][0-9]|[1-9][0-9][0-9]+):([0-9]+))|(([0-9]+):([0-9]+):(6[1-9]|[7-9][0-9]|[1-9][0-9][0-9]+)))' + + # 5.2.18 Ensure SSH MaxSessions is set to 10 or less. (Automated) + - id: 6677 + title: "Ensure SSH MaxSessions is set to 10 or less." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10." + compliance: + - cis: ["5.2.18"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*maxsessions\s+(\d+) compare <= 10' + - 'not f:/etc/ssh/sshd_config -> r:^\s*MaxSessions\s+(1[1-9]|[2-9][0-9]|[1-9][0-9][0-9]+)' + + # 5.2.19 Ensure SSH LoginGraceTime is set to one minute or less. (Automated) + - id: 6678 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60." + compliance: + - cis: ["5.2.19"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> n:logingracetime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + - 'not f:/etc/ssh/sshd_config -> r:\s*LoginGraceTime\s+(0|6[1-9]|[7-9][0-9]|[1-9][0-9][0-9]+|[^1]m)' + + # 5.2.20 Ensure SSH Idle Timeout Interval is configured. (Automated) + - id: 6679 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. - ClientAliveInterval sets 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 default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax sets the number of client alive messages which may be sent without sshd receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. The default value is 3. o The client alive messages are sent through the encrypted channel o Setting ClientAliveCountMax to 0 disables connection termination Example: The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value reduces this risk. - The recommended ClientAliveInterval setting is no greater than 900 seconds (15 minutes) - The recommended ClientAliveCountMax setting is 0 - At the 15 minute interval, if the ssh session is inactive, the session will be terminated." + impact: "In some cases this setting may cause termination of long-running scripts over SSH or remote automation tools which rely on SSH. In developing the local site policy, the requirements of such scripts should be considered and appropriate ServerAliveInterval and ClientAliveInterval settings should be calculated to insure operational continuity." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy. This should include ClientAliveInterval between 1 and 900 and ClientAliveCountMax of 0: ClientAliveInterval 900 ClientAliveCountMax 0." + references: + - "https://man.openbsd.org/sshd_config" + compliance: + - cis: ["5.2.20"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> n:ClientAliveInterval\s*\t*(\d+) compare > 0' + - 'c:sshd -T -> n:ClientAliveInterval\s*\t*(\d+) compare <= 900' + - 'c:sshd -T -> r:clientalivecountmax\s*\t*0' + - 'not f:/etc/ssh/sshd_config -> r:^ClientAliveInterval\s*\t*0' + - 'not f:/etc/ssh/sshd_config -> n:^ClientAliveInterval\s*\t*(\d+) > 900' + - 'not f:/etc/ssh/sshd_config -> n:^clientalivecountmax\s*\t*(\d+) > 0' + + # 5.3.1 Ensure sudo is installed. (Automated) + - id: 6680 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plug-in architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plug-ins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers and any entries in /etc/sudoers.d. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo # dnf install sudo." + compliance: + - cis: ["5.3.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - "c:dnf list sudo -> r:^sudo.x86_64" + + # 5.3.2 Ensure sudo commands use pty. (Automated) + - id: 6681 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo terminal (pseudo-pty)." + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: "Edit the file /etc/sudoers with visudo or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["5.3.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*use_pty' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*use_pty' + + # 5.3.3 Ensure sudo log file exists. (Automated) + - id: 6682 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: 'Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile="" Example Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["5.3.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*logfile=' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*logfile=' + + # 5.3.4 Ensure users must provide password for escalation. (Automated) + - id: 6683 + title: "Ensure users must provide password for escalation." + description: "The operating system must be configured so that users must provide a password for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + impact: "This will prevent automated processes from being able to elevate privileges. To include Ansible and AWS builds." + remediation: "Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any line with occurrences of NOPASSWD tags in the file." + compliance: + - cis: ["5.3.4"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - "not f:/etc/sudoers -> !r:^# && r:*NOPASSWD" + - 'not d:/etc/sudoers.d -> r:\.* -> !r:^# && r:*NOPASSWD' + + # 5.3.5 Ensure re-authentication for privilege escalation is not disabled globally. (Automated) + - id: 6684 + title: "Ensure re-authentication for privilege escalation is not disabled globally." + description: "The operating system must be configured so that users must re-authenticate for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + remediation: "Configure the operating system to require users to reauthenticate for privilege escalation. Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any occurrences of !authenticate tags in the file(s)." + compliance: + - cis: ["5.3.5"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'not f:/etc/sudoers -> !r:^# && r:*\!authenticate' + - 'not d:/etc/sudoers.d -> r:\.* -> !r:^# && r:*\!authenticate' + + # 5.3.6 Ensure sudo authentication timeout is configured correctly. (Automated) + - id: 6685 + title: "Ensure sudo authentication timeout is configured correctly." + description: "sudo caches used credentials for a default of 5 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized privileged access to another user." + remediation: "If the currently configured timeout is larger than 15 minutes, edit the file listed in the audit section with visudo -f and modify the entry timestamp_timeout= to 15 minutes or less as per your site policy. The value is in minutes. This particular entry may appear on it's own, or on the same line as env_reset. See the following two examples: Defaults env_reset, timestamp_timeout=15 Defaults timestamp_timeout=15 Defaults env_reset." + references: + - "https://www.sudo.ws/man/1.9.0/sudoers.man.html" + compliance: + - cis: ["5.3.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'f:/etc/sudoers -> n:timestamp_timeout=(\d+) compare =< 15 && n:timestamp_timeout=(\d+) compare != -1' + - 'c:sudo -V -> r:Authentication timestamp timeout:\s*\t*5.0 minutes' + + # 5.3.7 Ensure access to the su command is restricted. (Automated) + - id: 6686 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.3.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_wheel.so && r:use_uid && r:group=\w+' + + # 5.4.1 Ensure custom authselect profile is used. (Manual) - Not Implemented + + # 5.4.2 Ensure authselect includes with-faillock. (Automated) + - id: 6687 + title: "Ensure authselect includes with-faillock." + description: "The pam_faillock.so module maintains a list of failed authentication attempts per user during a specified interval and locks the account in case there were more than deny consecutive failed authentications. It stores the failure records into per-user files in the tally directory." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Run the following commands to include the with-faillock option to the current authselect profile: # authselect enable-feature with-faillock # authselect apply-changes." + compliance: + - cis: ["5.4.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:required && r:pam_faillock.so" + - "f:/etc/pam.d/system-auth -> r:required && r:pam_faillock.so" + + # 5.5.1 Ensure password creation requirements are configured. (Automated) + - id: 6688 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. - minlen=14 - password must be 14 characters or more ** Either of the following can be used to enforce complex passwords:** - minclass=4 - provide at least four classes of characters for the new password OR - dcredit=-1 - provide at least one digit - ucredit=-1 - provide at least one uppercase character - ocredit=-1 - provide at least one special character - lcredit=-1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Run the following script to update the system-auth and password-auth files #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+.*enforce_for_r oot\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 enforce_for_root/' \"$file\" fi if grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=([4- 9]|[1-9][0-9]+)\\b.*$' \"$file\"; then sed -ri '/pwquality/s/retry=\\S+/retry=3/' \"$file\" elif ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 retry=3/' \"$file\" fi done authselect apply-changes." + compliance: + - cis: ["5.5.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - "f:/etc/pam.d/system-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s+\t*=\s+\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> r:^\s*minclass|^\s*\Scredit' + + # 5.5.2 Ensure lockout for failed password attempts is configured. (Automated) - Not Implemented + + # 5.5.3 Ensure password reuse is limited. (Automated) + - id: 6689 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. - remember=<5> - Number of old passwords to remember." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note: These change only apply to accounts configured on the local system." + remediation: "Set remembered password history to conform to site policy. Run the following script to add or modify the pam_pwhistory.so and pam_unix.so lines to include the remember option: #!/usr/bin/env bash { file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/system-auth\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so\\s+([^# \\n\\r]+\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file elif grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?.*$' \"$file\"; then sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so/ s/$/ remember=5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/i password required pam_pwhistory.so remember=5 use_authtok' $file fi fi if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so\\s+([^#\\n\\r] +\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/ s/$/ remember=5/' $file fi fi authselect apply-changes }." + compliance: + - cis: ["5.5.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/system-auth -> !r:^\s*\t*# && r:password\s*\t*requisite|password\s*\t*sufficient && r:pam_pwhistory.so|pam_unix.so && n:remember\s*\t*=\s*\t*(\d+) compare => 5' + + # 5.5.4 Ensure password hashing algorithm is SHA-512. (Automated) + - id: 6690 + title: "Ensure password hashing algorithm is SHA-512." + description: "A cryptographic hash function converts an arbitrary-length input into a fixed length output. Password hashing performs a one-way transformation of a password, turning the password into another string, called the hashed password." + rationale: "The SHA-512 algorithm provides stronger hashing than other hashing algorithms used for password hashing with Linux, providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note: These changes only apply to accounts configured on the local system." + remediation: "Set password hashing algorithm to sha512. Edit /etc/libuser.conf and edit of add the following line: crypt_style = sha512 Edit /etc/login.defs and edit or add the following line: ENCRYPT_METHOD SHA512 Run the following script to configure pam_unix.so to use the sha512 hashing algorithm: #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+sha512\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+(md5|blowfish|bigcrypt|sha256)\\b.*$' \"$file\"; then sed -ri 's/(md5|blowfish|bigcrypt|sha256)/sha512/' \"$file\" else sed -ri 's/(^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix.so\\s+)(.*)$/\\1s ha512 \\3/' $file fi fi done authselect apply-changes Note: This only effects local users and passwords created after updating the files to use sha512. If it is determined that the password algorithm being used is not SHA-512, once it is changed, it is recommended that all user ID's be immediately expired and forced to change their passwords on next login." + compliance: + - cis: ["5.5.4"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> r:^\s*ENCRYPT_METHOD SHA512' + - 'f:/etc/libuser.conf -> r:^\s*crypt_style = sha512' + - 'f:/etc/pam.d/password-auth -> r:\s*password && r:requisite|required|sufficient && r:pam_unix.so && r:sha512' + - 'f:/etc/pam.d/system-auth -> r:\s*password && r:requisite|required|sufficient && r:pam_unix.so && r:sha512' + + # 5.6.1.1 Ensure password expiration is 365 days or less. (Automated) + - id: 6691 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + compliance: + - cis: ["5.6.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:\d+:(\d+): compare > 365' + + # 5.6.1.2 Ensure minimum days between password changes is 7 or more. (Automated) + - id: 6692 + title: "Ensure minimum days between password changes is 7 or more." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs : PASS_MIN_DAYS 7 Modify user parameters for all users with a password set to match: # chage --mindays 7 ." + compliance: + - cis: ["5.6.1.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:(\d+): compare < 7' + + # 5.6.1.3 Ensure password expiration warning days is 7 or more. (Automated) + - id: 6693 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs : PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["5.6.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:\d+:\d+:(\d+): compare < 7' + + # 5.6.1.4 Ensure inactive password lock is 30 days or less. (Automated) + - id: 6694 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["5.6.1.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "not c:useradd -D -> r:^INACTIVE=-1" + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - 'not f:/etc/shadow -> n:^\w+:\w+:\w+:\w+:\w+:\w+:(\d+): compare > 30' + - 'not f:/etc/shadow -> r:^\w+:\w+:\w+:\w+:\w+:\w+:-1:' + + # 5.6.1.5 Ensure all users last password change date is in the past. (Automated) - Not Implemented + # 5.6.2 Ensure system accounts are secured. (Automated) - Not Implemented + # 5.6.3 Ensure default user shell timeout is 900 seconds or less. (Automated) - Not Implemented + + # 5.6.4 Ensure default group for the root account is GID 0. (Automated) + - id: 6695 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root account belongs to. This affects permissions of files that are created by the root account." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root account default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.6.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^\s*\t*# && r:root:\w+:\w+:0:' + + # 5.6.5 Ensure default user umask is 027 or more restrictive. (Automated) - Not Implemented + + # 6.1.1 Audit system file permissions. (Manual) - Not Implemented + # 6.1.2 Ensure sticky bit is set on all world-writable directories. (Automated) - Not Implemented + + # 6.1.3 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 6696 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/passwd -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.4 Ensure permissions on /etc/shadow are configured. (Automated) + - id: 6697 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following commands to set owner, group, and permissions on /etc/shadow: # chown root:root /etc/shadow # chmod 0000 /etc/shadow." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/shadow -> r:0 root 0 root && n:shadow (\d+) compare == 0' + + # 6.1.5 Ensure permissions on /etc/group are configured. (Automated) + - id: 6698 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following commands to set owner, group, and permissions on /etc/group: # chown root:root /etc/group # chmod u-x,g-wx,o-wx /etc/group." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/group -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.6 Ensure permissions on /etc/gshadow are configured. (Automated) + - id: 6699 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run the following commands to set owner, group, and permissions on /etc/gshadow # chown root:root /etc/gshadow # chmod 0000 /etc/gshadow." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/gshadow -> r:0 root 0 root && n:gshadow (\d+) compare == 0' + + # 6.1.7 Ensure permissions on /etc/passwd- are configured. (Automated) + - id: 6700 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod chmod u-x,go-wx /etc/passwd-." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/passwd- -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.8 Ensure permissions on /etc/shadow- are configured. (Automated) + - id: 6701 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/shadow- : # chown root:root /etc/shadow- # chmod 0000 /etc/shadow-." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/shadow- -> r:0 root 0 root && n:shadow- (\d+) compare == 0' + + # 6.1.9 Ensure permissions on /etc/group- are configured. (Automated) + - id: 6702 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/group-: # chown root:root /etc/group- # chmod u-x,go-wx /etc/group-." + compliance: + - cis: ["6.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/group- -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.10 Ensure permissions on /etc/gshadow- are configured. (Automated) + - id: 6703 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chmod 0000 /etc/gshadow-." + compliance: + - cis: ["6.1.10"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/gshadow- -> r:0 root 0 root && n:gshadow- (\d+) compare == 0' + + # 6.1.11 Ensure no world writable files exist. (Automated) - Not Implemented + # 6.1.12 Ensure no unowned files or directories exist. (Automated) - Not Implemented + # 6.1.13 Ensure no ungrouped files or directories exist. (Automated) - Not Implemented + # 6.1.14 Audit SUID executables. (Manual) - Not Implemented + # 6.1.15 Audit SGID executables. (Manual) - Not Implemented + + # 6.2.1 Ensure password fields are not empty. (Automated) + - id: 6704 + title: "Ensure password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'not f:/etc/shadow -> !r:^# && r:^\w+::' + + # 6.2.2 Ensure all groups in /etc/passwd exist in /etc/group. (Automated) - Not Implemented + # 6.2.3 Ensure no duplicate UIDs exist. (Automated) - Not Implemented + # 6.2.4 Ensure no duplicate GIDs exist. (Automated) - Not Implemented + # 6.2.5 Ensure no duplicate user names exist. (Automated) - Not Implemented + # 6.2.7 Ensure root PATH Integrity. (Automated) - Not Implemented + + # 6.2.8 Ensure root is the only UID 0 account. (Automated) + - id: 6705 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: 'This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in recommendation "Ensure access to the su command is restricted".' + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'not f:/etc/passwd -> !r:^\s*\t*# && !r:^root: && r:^\w+:\w+:0:' + + # 6.2.9 Ensure all users' home directories exist. (Automated) - Not Implemented + # 6.2.10 Ensure users own their home directories. (Automated) - Not Implemented + # 6.2.11 Ensure users' home directories permissions are 750 or more restrictive. (Automated) - Not Implemented + # 6.2.12 Ensure users' dot files are not group or world writable. (Automated) - Not Implemented + # 6.2.13 Ensure users' .netrc Files are not group or world accessible. (Automated) - Not Implemented + # 6.2.14 Ensure no users have .forward files. (Automated) - Not Implemented + # 6.2.15 Ensure no users have .netrc files. (Automated) - Not Implemented + # 6.2.16 Ensure no users have .rhosts files. (Automated) - Not Implemented diff --git a/etc/ruleset/sca/darwin/15/cis_apple_macOS_10.11.yml b/etc/ruleset/sca/darwin/15/cis_apple_macOS_10.11.yml new file mode 100644 index 0000000000..dae76af524 --- /dev/null +++ b/etc/ruleset/sca/darwin/15/cis_apple_macOS_10.11.yml @@ -0,0 +1,442 @@ +# Security Configuration Assessment +# CIS Checks for macOS 10.11 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Apple OSX 10.11 Benchmark v1.1.0 - 11-04-2016 + +policy: + id: "cis_apple_macos_10_11" + file: "cis_apple_macOS_10.11.yml" + name: "CIS Apple macOS 10.11 Benchmark v1.1.0" + description: "This document, CIS Apple macOS 10.11 Benchmark, provides prescriptive guidance for establishing a secure configuration posture for Apple macOS 10.11. This guide was tested against Apple macOS 10.11." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check macOS version" + description: "Requirements for running the SCA scan against macOS 10.11 (El Capitan)." + condition: any + rules: + - 'c:sw_vers -> r:^ProductVersion:\t*\s*10\p11' + - 'c:system_profiler SPSoftwareDataType -> r:System Version:.*10\p11' + - 'c:defaults read loginwindow SystemVersionStampAsString -> r:^\s*10\p11' + +checks: + # 1.1 Verify all Apple provided software is current (Scored) + - id: 8500 + title: "Verify all Apple provided software is current" + description: "Software vendors release security patches and software updates for their products when security vulnerabilities are discovered. There is no simple way to complete this action without a network connection to an Apple software repository. Please ensure appropriate access for this control. This check is only for what Apple provides through software update." + rationale: "It is important that these updates be applied in a timely manner to prevent unauthorized persons from exploiting the identified vulnerabilities." + remediation: "1. In Terminal, run the following: softwareupdate -l 2. In Terminal, run the following for any packages that show up in step 1: sudo softwareupdate -i packagename" + compliance: + - cis: ["1.1"] + condition: all + rules: + - "c:softwareupdate -l -> r:No new software available" + + # 1.2 Enable Auto Update (Scored) + - id: 8501 + title: "Enable Auto Update" + description: 'Auto Update verifies that your system has the newest security patches and software updates. If "Automatically check for updates" is not selected background updates for new malware definition files from Apple for XProtect and Gatekeeper will not occur.' + rationale: "It is important that a system has the newest updates applied so as to prevent unauthorized persons from exploiting identified vulnerabilities." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -int 1" + compliance: + - cis: ["1.2"] + references: + - https://macops.ca/os-x-admins-your-clients-are-not-getting-background-security-updates/ + - https://derflounder.wordpress.com/2014/12/17/forcing-xprotect-blacklist-updates-on-mavericks-and-yosemite/ + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -> 1" + + # 1.3 Enable app update installs (Scored) + - id: 8502 + title: "Enable app update installs" + description: "Ensure that application updates are installed after they are available from Apple. These updates do not require reboots or admin privileges for end users." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool TRUE The remediation requires a log out and log in to show in the GUI. Please note that." + compliance: + - cis: ["1.3"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> 1" + + # 1.4 Enable system data files and security update installs (Scored) + - id: 8503 + title: "Enable system data files and security update installs" + description: "Ensure that system and security updates are installed after they are available from Apple. This setting enables definition updates for XProtect and Gatekeeper, with this setting in place new malware and adware that Apple has added to the list of malware or untrusted software will not execute. These updates do not require reboots or end user admin rights." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable install system data files and security updates: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true && sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true" + compliance: + - cis: ["1.4"] + references: + - https://www.thesafemac.com/tag/xprotect/ + - https://support.apple.com/en-us/HT202491 + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -> 1" + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -> 1" + + # 1.5 Enable OS X update installs (Scored) + - id: 8504 + title: "Enable OS X update installs" + description: "Ensure that OS X updates are installed after they are available from Apple. This setting enables OS X updates to be automatically installed. Some environments will want to approve and test updates before they are delivered. It is best practice to test first where updates can and have caused disruptions to operations. Automatic updates should be turned off where changes are tightly controlled and there are mature testing and approval processes. Automatic updates should not be turned off so the admin can call the users first to let them know it's ok to install. A dependable repeatable process involving a patch agent or remote management tool should be in place before auto-updates are turned off." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable install system data files and security updates: sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool TRUE" + compliance: + - cis: ["1.5"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -> 1" + + # 2.2.1 Enable "Set time and date automatically" (Not Scored) + - id: 8505 + title: 'Enable "Set time and date automatically"' + description: 'Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries. Apple''s automatic time update solution will enable an NTP server that is not controlled by the Application Firewall. Turning on "Set time and date automatically" allows other computers to connect to set their time and allows for exploit attempts against ntpd. It also allows for more accurate network detection and OS fingerprinting.' + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features." + remediation: "Run the following commands: sudo systemsetup -setnetworktimeserver sudo systemsetup -setusingnetworktime on" + compliance: + - cis: ["2.2.1"] + condition: all + rules: + - 'c:systemsetup -getusingnetworktime -> r:Network Time:\s*\t*On' + + # 2.2.3 Restrict NTP server to loopback interface (Scored) + - id: 8506 + title: "Restrict NTP server to loopback interface" + description: 'The Apple System Preference setting to "Set date and time automatically" enables both an NTP client that can synchronize the time from known time server(s) and an open listening NTP server that can be used by any other computer that can connect to port 123 on the time syncing computer. This open listening service can allow for both exploits of future NTP vulnerabilities and allow for open ports that can be used for fingerprinting to target exploits. Access to this port should be restricted. Editing the /etc/ntp-restrict.conf file by adding a control on the loopback interface limits external access.' + rationale: "Mobile workstations on untrusted networks should not have open listening services available to other nodes on the network." + remediation: "1. Run the following command in Terminal: sudo vim /etc/ntp-restrict.conf 2. Add the following lines to the file: restrict lo interface ignore wildcard interface listen lo" + compliance: + - cis: ["2.2.3"] + condition: all + rules: + - "f:/etc/ntp-restrict.conf -> r:restrict lo" + + # 2.4.1 Disable Remote Apple Events (Scored) + - id: 8507 + title: "Disable Remote Apple Events" + description: "Apple Events is a technology that allows one program to communicate with other programs. Remote Apple Events allows a program on one computer to communicate with a program on a different computer." + rationale: "Disabling Remote Apple Events mitigates the risk of an unauthorized program gaining access to the system." + remediation: "Run the following command in Terminal: sudo systemsetup -setremoteappleevents off" + compliance: + - cis: ["2.4.1"] + condition: all + rules: + - 'c:systemsetup -getremoteappleevents -> r:Remote Apple Events:\s*\t*Off' + + # 2.4.4 Disable Printer Sharing (Scored) + - id: 8508 + title: "Disable Printer Sharing" + description: "By enabling Printer sharing the computer is set up as a print server to accept print jobs from other computers. Dedicated print servers or direct IP printing should be used instead." + rationale: "Disabling Printer Sharing mitigates the risk of attackers attempting to exploit the print server to gain access to the system." + remediation: "Perform the following to implement the prescribed state: 1. Open System Preferences 2. Select Sharing 3. Uncheck Printer Sharing" + compliance: + - cis: ["2.4.4"] + condition: none + rules: + - 'c:system_profiler SPPrintersDataType -> r:Shared:\s*\t*Yes' + + # 2.4.5 Disable Remote Login (Scored) + - id: 8509 + title: "Disable Remote Login" + description: "Remote Login allows an interactive terminal connection to a computer." + rationale: "Disabling Remote Login mitigates the risk of an unauthorized person gaining access to the system via Secure Shell (SSH). While SSH is an industry standard to connect to posix servers, the scope of the benchmark is for Apple OSX clients, not servers." + remediation: "Run the following command in Terminal: sudo systemsetup -setremotelogin off" + compliance: + - cis: ["2.4.5"] + condition: all + rules: + - 'c:systemsetup -getremotelogin -> r:Remote Login:\s*\t*Off' + + # 2.4.8 Disable File Sharing (Scored) + - id: 8510 + title: "Disable File Sharing" + description: "Apple's File Sharing uses a combination of SMB (Windows sharing) and AFP (Mac sharing)" + rationale: "By disabling file sharing, the remote attack surface and risk of unauthorized access to files stored on the system is reduced." + remediation: "Run the following command in Terminal to turn off AFP from the command line: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist - Run the following command in Terminal to turn off SMB sharing from the CLI: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.smbd.plist" + compliance: + - cis: ["2.4.8"] + condition: none + rules: + - "c:launchctl list -> r:AppleFileServer" + - 'f:/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist -> r:\ r:womp && !r:\s0$' + - 'c:pmset -b -g -> r:womp && !r:\s0$' + + # 2.6.1 Enable FileVault (Scored) + - id: 8512 + title: "Enable FileVault" + description: "FileVault secures a system's data by automatically encrypting its boot volume and requiring a password or recovery key to access it." + rationale: "Encrypting sensitive data minimizes the likelihood of unauthorized users gaining access to it." + remediation: "Perform the following to implement the prescribed state: 1. Open System Preferences 2. Select Security & Privacy 3. Select FileVault 4. Select Turn on FileVault" + compliance: + - cis: ["2.6.1"] + condition: all + rules: + - "c:diskutil cs list -> r:^Encryption Status && r:Unlocked" + - "c:diskutil cs list -> r:^Encryption Type && r:AES-XTS" + + # 2.6.2 Enable Gatekeeper (Scored) + - id: 8513 + title: "Enable Gatekeeper" + description: "Gatekeeper is Apple's application white-listing control that restricts downloaded applications from launching. It functions as a control to limit applications from unverified sources from running without authorization." + rationale: "Disallowing unsigned software will reduce the risk of unauthorized or malicious applications from running on the system." + remediation: "Run the following command in Terminal: sudo spctl --master-enable" + compliance: + - cis: ["2.6.2"] + condition: all + rules: + - 'c:spctl --status -> r:^assessments\s*\t*enabled$' + + # 2.6.3 Enable Firewall (Scored) + - id: 8514 + title: "Enable Firewall" + description: "A firewall is a piece of software that blocks unwanted incoming connections to a system. Apple has posted general documentation about the application firewall." + rationale: "A firewall minimizes the threat of unauthorized users from gaining access to your system while connected to a network or the Internet." + remediation: "Run the following command in Terminal: defaults write /Library/Preferences/com.apple.alf globalstate - int Where is: - 1 = on for specific services - 2 = on for essential services" + compliance: + - cis: ["2.6.3"] + references: + - https://support.apple.com/en-us/HT201642 + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.alf globalstate -> r:^1$|^2$" + + # 2.6.4 Enable Firewall Stealth Mode (Scored) + - id: 8515 + title: "Enable Firewall Stealth Mode" + description: "While in Stealth mode the computer will not respond to unsolicited probes, dropping that traffic." + rationale: "Stealth mode on the firewall minimizes the threat of system discovery tools while connected to a network or the Internet." + remediation: "Run the following command in Terminal: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on" + compliance: + - cis: ["2.6.4"] + references: + - https://support.apple.com/en-us/HT201642 + condition: all + rules: + - "c:/usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode -> r:^Stealth mode enabled" + + # 2.10 Enable Secure Keyboard Entry in terminal.app (Scored) + - id: 8516 + title: "Enable Secure Keyboard Entry in terminal.app" + description: "Secure Keyboard Entry prevents other applications on the system and/or network from detecting and recording what is typed into Terminal." + rationale: "Enabling Secure Keyboard Entry minimizes the risk of a key logger from detecting what is entered in Terminal." + remediation: "Perform the following to implement the prescribed state: 1. Open Terminal 2. Select Terminal 3. Select Secure Keyboard Entry" + compliance: + - cis: ["2.10"] + condition: all + rules: + - "c:defaults read -app Terminal SecureKeyboardEntry -> 1" + + # 2.11 Java 6 is not the default Java runtime (Scored) + - id: 8517 + title: "Java 6 is not the default Java runtime" + description: "Apple had made Java part of the core Operating System for OS X. Apple is no longer providing Java updates for OS X and updated JREs and JDK are made available by Oracle. The latest version of Java 6 made available by Apple has many unpatched vulnerabilities and should not be the default runtime for Java applets that request one from the Operating System" + rationale: "Java is one of the most exploited environments and is no longer maintained by Apple, old versions may still be installed and should be removed from the computer or not be in the default path." + remediation: "Java 6 can be removed completely or, if necessary Java applications will only work with Java 6, a custom path can be used." + compliance: + - cis: ["2.11"] + condition: none + rules: + - "c:/usr/libexec/java_home -> r:1.6.0" + + # 3.2 Enable security auditing (Scored) + - id: 8518 + title: "Enable security auditing" + description: "OSX's audit facility, auditd, receives notifications from the kernel when certain system calls, such as open, fork, and exit, are made. These notifications are captured and written to an audit log." + rationale: "Logs generated by auditd may be useful when investigating a security incident as they may help reveal the vulnerable application and the actions taken by a malicious actor." + remediation: "Run the following command in Terminal: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.auditd.plist" + compliance: + - cis: ["3.2"] + condition: all + rules: + - "c:launchctl list -> r:com.apple.auditd" + + # 3.3 Configure Security Auditing Flags (Scored) + - id: 8519 + title: "Configure Security Auditing Flags" + description: "Auditing is the capture and maintenance of information about security-related events." + rationale: "Maintaining an audit trail of system activity logs can help identify configuration errors, troubleshoot service disruptions, and analyze compromises or attacks that have occurred, have begun, or are about to begin. Audit logs are necessary to provide a trail of evidence in case the system or network is compromised." + remediation: '1. Open a terminal session and edit the /etc/security/audit_control file 2. Find the line beginning with "flags" 3. Add the following flags: lo, ad, fd, fm, -all. 4. Save the file.' + compliance: + - cis: ["3.3"] + condition: all + rules: + - "f:/etc/security/audit_control -> r:^flags && r:lo && r:ad && r:fd && r:fm && r:-all" + + # 4.1 Disable Bonjour advertising service (Scored) + - id: 8520 + title: "Disable Bonjour advertising service" + description: "Bonjour is an auto-discovery mechanism for TCP/IP devices which enumerate devices and services within a local subnet. DNS on Mac OS X is integrated with Bonjour and should not be turned off, but the Bonjour advertising service can be disabled." + rationale: 'Bonjour can simplify device discovery from an internal rogue or compromised host. An attacker could use Bonjour''s multicast DNS feature to discover a vulnerable or poorly- configured service or additional information to aid a targeted attack. Implementing this control disables the continuous broadcasting of "I''m here!" messages. Typical end-user endpoints should not have to advertise services to other computers. This setting does not stop the computer from sending out service discovery messages when looking for services on an internal subnet, if the computer is looking for a printer or server and using service discovery. To block all Bonjour traffic except to approved devices the pf or other firewall would be needed.' + remediation: "Run the following command in Terminal: defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements" + compliance: + - cis: ["4.1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -> 1" + + # 4.4 Ensure http server is not running (Scored) + - id: 8521 + title: "Ensure http server is not running" + description: "Mac OS X used to have a graphical front-end to the embedded Apache web server in the Operating System. Personal web sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Personal web sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. Apache however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end user computer. Web sharing should only be done through hardened web servers and appropriate cloud services." + rationale: "Web serving should not be done from a user desktop. Dedicated webservers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." + remediation: "Ensure that the Web Server is not running and is not set to start at boot Stop the Web Server: sudo apachectl stop Ensure that the web server will not auto-start at boot: sudo defaults write /System/Library/LaunchDaemons/org.apache.httpd Disabled -bool true" + compliance: + - cis: ["4.4"] + condition: none + rules: + - "p:httpd" + - "p:/usr/sbin/httpd" + + # 4.5 Ensure ftp server is not running (Scored) + - id: 8522 + title: "Ensure ftp server is not running" + description: "Mac OS X used to have a graphical front-end to the embedded ftp server in the Operating System. Ftp sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Running an Ftp server from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. The Ftp server however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end user computer. Ftp servers meet a specialized need to distribute files without strong authentication and should only be done through hardened servers. Cloud services or other distribution methods should be considered" + rationale: "Ftp servers should not be run on an end user desktop. Dedicated servers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." + remediation: "Ensure that the FTP Server is not running and is not set to start at boot. Stop the ftp Server: sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist" + compliance: + - cis: ["4.5"] + condition: none + rules: + - "c:launchctl list -> r:com.apple.ftpd" + + # 4.6 Ensure nfs server is not running (Scored) + - id: 8523 + title: "Ensure nfs server is not running" + description: "Mac OS X can act as an NFS fileserver. NFS sharing could be enabled to allow someone on another computer to mount shares and gain access to information from the user's computer. File sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. NFSD is still part of the Operating System and can be easily turned on to export shares and provide remote connectivity to an end user computer." + rationale: "File serving should not be done from a user desktop, dedicated servers should be used. Open ports make it easier to exploit the computer." + remediation: "Stop the NFS Server: sudo nfsd disable Remove the exported Directory listing: rm /etc/export" + compliance: + - cis: ["4.6"] + condition: none + rules: + - "p:nfsd" + - "p:/sbin/nfsd" + - "f:/etc/exports" + + # 5.7 Do not enable the "root" account (Scored) + - id: 8524 + title: 'Do not enable the "root" account' + description: "The root account is a superuser account that has access privileges to perform any actions and read/write to any file on the computer. In the UNIX/Linux world, the system administrator commonly uses the root account to perform administrative functions." + rationale: "Enabling and using the root account puts the system at risk since any successful exploit or mistake while the root account is in use could have unlimited access privileges within the system. Using the sudo command allows users to perform functions as a root user while limiting and password protecting the access privileges. By default the root account is not enabled on a Mac OS X client computer. It is enabled on Mac OS X Server. An administrator can escalate privileges using the sudo command (use -s or -i to get a root shell)." + remediation: "Open System Preferences, Uses & Groups. Click the lock icon to unlock it. In the Network Account Server section, click Join or Edit. Click Open Directory Utility. Click the lock icon to unlock it. Select the Edit menu > Disable Root User." + compliance: + - cis: ["5.7"] + condition: all + rules: + - "c:dscl . -read /Users/root AuthenticationAuthority -> r:^No such key: AuthenticationAuthority" + + # 5.8 Disable automatic login (Scored) + - id: 8525 + title: "Disable automatic login" + description: "The automatic login feature saves a user's system access credentials and bypasses the login screen, instead the system automatically loads to the user's desktop screen." + rationale: "Disabling automatic login decreases the likelihood of an unauthorized person gaining access to a system." + remediation: "Run the following command in Terminal: sudo defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser" + compliance: + - cis: ["5.8"] + condition: none + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow -> r:autoLoginUser" + + # 5.9 Require a password to wake the computer from sleep or screen saver (Scored) + - id: 8526 + title: "Require a password to wake the computer from sleep or screen saver" + description: "Sleep and screensaver modes are low power modes that reduces electrical consumption while the system is not in use." + rationale: "Prompting for a password when waking from sleep or screensaver mode mitigates the threat of an unauthorized person gaining access to a system in the user's absence." + remediation: "1. Run the following command in Terminal: The current user will need to log off and on for changes to take effect. defaults write com.apple.screensaver askForPassword -int 1 2. The current user will need to log off and on for changes to take effect." + compliance: + - cis: ["5.9"] + condition: all + rules: + - "c:defaults read com.apple.screensaver askForPassword -> 1" + + # 5.11 Disable ability to login to another user's active and locked session (Scored) + - id: 8527 + title: "Disable ability to login to another user's active and locked session" + description: "OSX has a privilege that can be granted to any user that will allow that user to unlock active user's sessions." + rationale: "Disabling the admins and/or user's ability to log into another user's active and locked session prevents unauthorized persons from viewing potentially sensitive and/or personal information." + remediation: '1. Run the following command in Terminal: sudo vi /etc/pam.d/screensaver 2. Locate "account required pam_group.so no_warn group=admin,wheel fail_safe" 3. Remove "admin," 4. Save' + compliance: + - cis: ["5.11"] + condition: none + rules: + - "f:/etc/pam.d/screensaver -> r:group=admin,wheel|group=wheel,admin && r:fail_safe" + + # 5.18 System Integrity Protection status (Scored) + - id: 8528 + title: "System Integrity Protection status" + description: "System Integrity Protection is a new security feature introduced in OS X 10.11 El Capitan. System Integrity Protection restricts access to System domain locations and restricts runtime attachment to system processes. Any attempt to attempt to inspect or attach to a system process will fail. Kernel Extensions are now restricted to /Library/Extensions and are required to be signed with a Developer ID." + rationale: "Running without System Integrity Protection on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by SIP." + remediation: "Perform the following while booted in OS X Recovery Partition. 1. Select Terminal from the Utilities menu 2. Run the following command in Terminal: /usr/bin/csrutil enable 3. The output should be: Successfully enabled System Integrity Protection. Please restart the machine for the changes to take effect. 4. Reboot." + compliance: + - cis: ["5.18"] + condition: all + rules: + - "c:/usr/bin/csrutil status -> r:^System Integrity Protection status: enabled" + + # 6.1.3 Disable guest account login (Scored) + - id: 8529 + title: "Disable guest account login" + description: "The guest account allows users access to the system without having to create an account or password. Guest users are unable to make setting changes, cannot remotely login to the system and all created files, caches, and passwords are deleted upon logging out." + rationale: "Disabling the guest account mitigates the risk of an untrusted user doing basic reconnaissance and possibly using privilege escalation attacks to take control of the system." + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled - bool NO" + compliance: + - cis: ["6.1.3"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow.plist GuestEnabled -> 0" + + # 6.1.5 Remove Guest home folder (Scored) + - id: 8530 + title: "Remove Guest home folder" + description: "The guest account login should have been disabled, so there is no need for the legacy Guest home folder to remain in the file system. When normal user accounts are removed you have the option to archive it, leave it in place or delete. In the case of the guest folder the folder remains in place without a GUI option to remove it. If at some point in the future a Guest account is needed it will be re-created. The presence of the Guest home folder can cause automated audits to fail when looking for compliant settings within all User folders as well. Rather than ignoring the folders continued existence it is best removed." + rationale: "The Guest home folders are unneeded after the Guest account is disabled and could be used inappropriately." + remediation: "1. Run the following command in Terminal: rm -R /Users/Guest 2. Make sure there is no output" + compliance: + - cis: ["6.1.5"] + condition: none + rules: + - "d:/Users/Guest" + + # 6.2 Turn on filename extensions (Scored) + - id: 8531 + title: "Turn on filename extensions" + description: "A filename extension is a suffix added to a base filename that indicates the base filename's file format." + rationale: "Visible filename extensions allows the user to identify the file type and the application it is associated with which leads to quick identification of misrepresented malicious files." + remediation: "Perform the following to implement the prescribed state: 1. Select Finder 2. Select Preferences 3. Check Show all filename extensions Alternatively, use the following command: defaults write NSGlobalDomain AppleShowAllExtensions -bool true" + compliance: + - cis: ["6.2"] + condition: all + rules: + - "c:defaults read NSGlobalDomain AppleShowAllExtensions -> 1" + + # 6.3 Disable the automatic run of safe files in Safari (Scored) + - id: 8532 + title: "Disable the automatic run of safe files in Safari" + description: "Safari will automatically run or execute what it considers safe files. This can include installers and other files that execute on the operating system. Safari bases file safety by using a list of filetypes maintained by Apple. The list of files include text, image, video and archive formats that would be run in the context of the OS rather than the browser." + rationale: "Hackers have taken advantage of this setting via drive-by attacks. These attacks occur when a user visits a legitimate website that has been corrupted. The user unknowingly downloads a malicious file either by closing an infected pop-up or hovering over a malicious banner. An attacker can create a malicious file that will fall within Safari's safe file list that will download and execute without user input." + remediation: 'Perform the following to implement the prescribed state: 1. Open Safari 2. Select Safari from the menu bar 3. Select Preferences 4. Select General 5. Uncheck Open "safe" files after downloading Alternatively run the following command in Terminal: defaults write com.apple.Safari AutoOpenSafeDownloads -boolean no' + compliance: + - cis: ["6.3"] + condition: all + rules: + - "c:defaults read com.apple.Safari AutoOpenSafeDownloads -> 0" diff --git a/etc/ruleset/sca/darwin/16/cis_apple_macOS_10.12.yml b/etc/ruleset/sca/darwin/16/cis_apple_macOS_10.12.yml new file mode 100644 index 0000000000..d7a3486605 --- /dev/null +++ b/etc/ruleset/sca/darwin/16/cis_apple_macOS_10.12.yml @@ -0,0 +1,404 @@ +# Security Configuration Assessment +# CIS Checks for macOS 10.12 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Apple macOS 10.12 Benchmark v1.1.0 - 09-06-2018 + +policy: + id: "cis_apple_macos_10_12" + file: "cis_apple_macOS_10.12.yml" + name: "CIS Apple macOS 10.12 Benchmark v1.1.0" + description: "This document, CIS Apple macOS 10.12 Benchmark, provides prescriptive guidance for establishing a secure configuration posture for Apple macOS 10.12. This guide was tested against Apple macOS 10.12." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check macOS version" + description: "Requirements for running the SCA scan against macOS 10.12 (Sierra)." + condition: any + rules: + - 'c:sw_vers -> r:^ProductVersion:\t*\s*10\p12' + - 'c:system_profiler SPSoftwareDataType -> r:System Version:\.*10\p12' + - 'c:defaults read loginwindow SystemVersionStampAsString -> r:^\s*10\p12' + +checks: + # 1.1 Verify all Apple provided software is current (Scored) + - id: 9000 + title: "Verify all Apple provided software is current" + description: "Software vendors release security patches and software updates for their products when security vulnerabilities are discovered. There is no simple way to complete this action without a network connection to an Apple software repository. Please ensure appropriate access for this control. This check is only for what Apple provides through software update." + rationale: "It is important that these updates be applied in a timely manner to prevent unauthorized persons from exploiting the identified vulnerabilities." + remediation: "1. In Terminal, run the following: softwareupdate -l 2. In Terminal, run the following for any packages that show up in step 1: sudo softwareupdate -i packagename" + compliance: + - cis: ["1.1"] + condition: all + rules: + - "c:softwareupdate -l -> r:No new software available" + + # 1.2 Enable Auto Update (Scored) + - id: 9001 + title: "Enable Auto Update" + description: 'Auto Update verifies that your system has the newest security patches and software updates. If "Automatically check for updates" is not selected background updates for new malware definition files from Apple for XProtect and Gatekeeper will not occur.' + rationale: "It is important that a system has the newest updates applied so as to prevent unauthorized persons from exploiting identified vulnerabilities." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -int 1" + compliance: + - cis: ["1.2"] + references: + - https://macops.ca/os-x-admins-your-clients-are-not-getting-background-security-updates/ + - https://derflounder.wordpress.com/2014/12/17/forcing-xprotect-blacklist-updates-on-mavericks-and-yosemite/ + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -> 1" + + # 1.3 Enable app update installs (Scored) + - id: 9002 + title: "Enable app update installs" + description: "Ensure that application updates are installed after they are available from Apple. These updates do not require reboots or admin privileges for end users." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool TRUE The remediation requires a log out and log in to show in the GUI. Please note that." + compliance: + - cis: ["1.3"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> 1" + + # 1.4 Enable system data files and security update installs (Scored) + - id: 9003 + title: "Enable system data files and security update installs" + description: "Ensure that system and security updates are installed after they are available from Apple. This setting enables definition updates for XProtect and Gatekeeper, with this setting in place new malware and adware that Apple has added to the list of malware or untrusted software will not execute. These updates do not require reboots or end user admin rights." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable install system data files and security updates: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true && sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true" + compliance: + - cis: ["1.4"] + references: + - https://www.thesafemac.com/tag/xprotect/ + - https://support.apple.com/en-us/HT202491 + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -> 1" + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -> 1" + + # 1.5 Enable macOS update installs (Scored) + - id: 9004 + title: "Enable macOS update installs" + description: "Ensure that macOS updates are installed after they are available from Apple. This setting enables macOS updates to be automatically installed. Some environments will want to approve and test updates before they are delivered. It is best practice to test first where updates can and have caused disruptions to operations. Automatic updates should be turned off where changes are tightly controlled and there are mature testing and approval processes. Automatic updates should not be turned off so the admin can call the users first to let them know it's ok to install. A dependable repeatable process involving a patch agent or remote management tool should be in place before auto-updates are turned off." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable install system data files and security updates: sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool TRUE" + compliance: + - cis: ["1.5"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -> 1" + + # 2.2.1 Enable "Set time and date automatically" (Scored) + - id: 9005 + title: 'Enable "Set time and date automatically"' + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries. Note: If your organization has internal time servers, enter them here. Enterprise mobile devices may need to use a mix of internal and external time servers. If multiple servers are required use the Date & Time System Preference with each server separated by a space." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features." + remediation: "Run the following commands: sudo systemsetup -setnetworktimeserver sudo systemsetup -setusingnetworktime on" + compliance: + - cis: ["2.2.1"] + condition: all + rules: + - 'c:systemsetup -getusingnetworktime -> r:Network Time:\s*\t*On' + + # 2.4.1 Disable Remote Apple Events (Scored) + - id: 9006 + title: "Disable Remote Apple Events" + description: "Apple Events is a technology that allows one program to communicate with other programs. Remote Apple Events allows a program on one computer to communicate with a program on a different computer." + rationale: "Disabling Remote Apple Events mitigates the risk of an unauthorized program gaining access to the system." + remediation: "Run the following command in Terminal: sudo systemsetup -setremoteappleevents off" + compliance: + - cis: ["2.4.1"] + condition: all + rules: + - 'c:systemsetup -getremoteappleevents -> r:Remote Apple Events:\s*\t*Off' + + # 2.4.4 Disable Printer Sharing (Scored) + - id: 9007 + title: "Disable Printer Sharing" + description: "By enabling Printer sharing the computer is set up as a print server to accept print jobs from other computers. Dedicated print servers or direct IP printing should be used instead." + rationale: "Disabling Printer Sharing mitigates the risk of attackers attempting to exploit the print server to gain access to the system." + remediation: "Perform the following to implement the prescribed state: 1. Open System Preferences 2. Select Sharing 3. Uncheck Printer Sharing" + compliance: + - cis: ["2.4.4"] + condition: none + rules: + - 'c:system_profiler SPPrintersDataType -> r:Shared:\s*\t*Yes' + + # 2.4.5 Disable Remote Login (Scored) + - id: 9008 + title: "Disable Remote Login" + description: "Remote Login allows an interactive terminal connection to a computer." + rationale: "Disabling Remote Login mitigates the risk of an unauthorized person gaining access to the system via Secure Shell (SSH). While SSH is an industry standard to connect to posix servers, the scope of the benchmark is for Apple macOS clients, not servers." + remediation: "Run the following command in Terminal: sudo systemsetup -setremotelogin off" + compliance: + - cis: ["2.4.5"] + condition: all + rules: + - 'c:systemsetup -getremotelogin -> r:Remote Login:\s*\t*Off' + + # 2.4.8 Disable File Sharing (Scored) + - id: 9009 + title: "Disable File Sharing" + description: "Apple's File Sharing uses a combination of SMB (Windows sharing) and AFP (Mac sharing)" + rationale: "By disabling file sharing, the remote attack surface and risk of unauthorized access to files stored on the system is reduced." + remediation: "Run the following command in Terminal to turn off AFP from the command line: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist - Run the following command in Terminal to turn off SMB sharing from the CLI: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.smbd.plist" + compliance: + - cis: ["2.4.8"] + condition: none + rules: + - "c:launchctl list -> r:AppleFileServer" + - 'f:/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist -> r:\ r:womp && !r:\s0$' + + # 2.6.1.1 Enable FileVault (Scored) + - id: 9011 + title: "Enable FileVault" + description: "FileVault secures a system's data by automatically encrypting its boot volume and requiring a password or recovery key to access it." + rationale: "Encrypting sensitive data minimizes the likelihood of unauthorized users gaining access to it." + remediation: "Perform the following to implement the prescribed state: 1. Open System Preferences 2. Select Security & Privacy 3. Select FileVault 4. Select Turn on FileVault" + compliance: + - cis: ["2.6.1.1"] + condition: all + rules: + - 'c:fdesetup status -> r:^FileVault\s*\t*is\s*\t*On$' + + # 2.6.2 Enable Gatekeeper (Scored) + - id: 9012 + title: "Enable Gatekeeper" + description: "Gatekeeper is Apple's application white-listing control that restricts downloaded applications from launching. It functions as a control to limit applications from unverified sources from running without authorization." + rationale: "Disallowing unsigned software will reduce the risk of unauthorized or malicious applications from running on the system." + remediation: "Run the following command in Terminal: sudo spctl --master-enable" + compliance: + - cis: ["2.6.2"] + condition: all + rules: + - 'c:spctl --status -> r:^assessments\s*\t*enabled$' + + # 2.6.3 Enable Firewall (Scored) + - id: 9013 + title: "Enable Firewall" + description: "A firewall is a piece of software that blocks unwanted incoming connections to a system. Apple has posted general documentation about the application firewall." + rationale: "A firewall minimizes the threat of unauthorized users from gaining access to your system while connected to a network or the Internet." + remediation: "Run the following command in Terminal: defaults write /Library/Preferences/com.apple.alf globalstate - int Where is: - 1 = on for specific services - 2 = on for essential services" + compliance: + - cis: ["2.6.3"] + references: + - https://support.apple.com/en-us/HT201642 + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.alf globalstate -> r:^1$|^2$" + + # 2.6.4 Enable Firewall Stealth Mode (Scored) + - id: 9014 + title: "Enable Firewall Stealth Mode" + description: "While in Stealth mode the computer will not respond to unsolicited probes, dropping that traffic." + rationale: "Stealth mode on the firewall minimizes the threat of system discovery tools while connected to a network or the Internet." + remediation: "Run the following command in Terminal: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on" + compliance: + - cis: ["2.6.4"] + references: + - https://support.apple.com/en-us/HT201642 + condition: all + rules: + - "c:/usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode -> r:^Stealth mode enabled" + + # 2.10 Enable Secure Keyboard Entry in terminal.app (Scored) + - id: 9015 + title: "Enable Secure Keyboard Entry in terminal.app" + description: "Secure Keyboard Entry prevents other applications on the system and/or network from detecting and recording what is typed into Terminal." + rationale: "Enabling Secure Keyboard Entry minimizes the risk of a key logger from detecting what is entered in Terminal." + remediation: "Perform the following to implement the prescribed state: 1. Open Terminal 2. Select Terminal 3. Select Secure Keyboard Entry" + compliance: + - cis: ["2.10"] + condition: all + rules: + - "c:defaults read -app Terminal SecureKeyboardEntry -> 1" + + # 2.11 Java 6 is not the default Java runtime (Scored) + - id: 9016 + title: "Java 6 is not the default Java runtime" + description: "Apple had made Java part of the core Operating System for macOS. Apple is no longer providing Java updates for macOS and updated JREs and JDK are made available by Oracle. The latest version of Java 6 made available by Apple has many unpatched vulnerabilities and should not be the default runtime for Java applets that request one from the Operating System" + rationale: "Java has been one of the most exploited environments and Java 6, which was provided as an OS component by Apple, is no longer maintained by Apple or Oracle. The old versions provided by Apple are both unsupported and missing the more modern security controls that have limited current exploits. The EOL version may still be installed and should be removed from the computer or not be in the default path." + remediation: "Java 6 can be removed completely or, if required Java applications will only work with Java 6, a custom path can be used. Apple is likely to finally pull the plug on Java 6 in upcoming macOS versions so any applications that still require Java 6 will likely soon be unavailable." + compliance: + - cis: ["2.11"] + condition: none + rules: + - "c:/usr/libexec/java_home -> r:1.6.0" + + # 3.1 Enable security auditing (Scored) + - id: 9017 + title: "Enable security auditing" + description: "macOS's audit facility, auditd, receives notifications from the kernel when certain system calls, such as open, fork, and exit, are made. These notifications are captured and written to an audit log." + rationale: "Logs generated by auditd may be useful when investigating a security incident as they may help reveal the vulnerable application and the actions taken by a malicious actor." + remediation: "Run the following command in Terminal: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.auditd.plist" + compliance: + - cis: ["3.1"] + condition: all + rules: + - "c:launchctl list -> r:com.apple.auditd" + + # 3.2 Configure Security Auditing Flags (Scored) + - id: 9018 + title: "Configure Security Auditing Flags" + description: "Auditing is the capture and maintenance of information about security-related events." + rationale: "Maintaining an audit trail of system activity logs can help identify configuration errors, troubleshoot service disruptions, and analyze compromises or attacks that have occurred, have begun, or are about to begin. Audit logs are necessary to provide a trail of evidence in case the system or network is compromised." + remediation: '1. Open a terminal session and edit the /etc/security/audit_control file 2. Find the line beginning with "flags" 3. Add the following flags: lo, ad, fd, fm, -all. 4. Save the file.' + compliance: + - cis: ["3.2"] + condition: all + rules: + - "f:/etc/security/audit_control -> r:^flags && r:lo && r:ad && r:fd && r:fm && r:-all" + + # 4.1 Disable Bonjour advertising service (Scored) + - id: 9019 + title: "Disable Bonjour advertising service" + description: "Bonjour is an auto-discovery mechanism for TCP/IP devices which enumerate devices and services within a local subnet. DNS on macOS is integrated with Bonjour and should not be turned off, but the Bonjour advertising service can be disabled." + rationale: 'Bonjour can simplify device discovery from an internal rogue or compromised host. An attacker could use Bonjour''s multicast DNS feature to discover a vulnerable or poorly- configured service or additional information to aid a targeted attack. Implementing this control disables the continuous broadcasting of "I''m here!" messages. Typical end-user endpoints should not have to advertise services to other computers.' + remediation: "Run the following command in Terminal: defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements" + compliance: + - cis: ["4.1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -> 1" + + # 4.4 Ensure http server is not running (Scored) + - id: 9020 + title: "Ensure http server is not running" + description: "macOS used to have a graphical front-end to the embedded Apache web server in the Operating System. Personal web sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Personal web sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. Apache however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end user computer. Web sharing should only be done through hardened web servers and appropriate cloud services." + rationale: "Web serving should not be done from a user desktop. Dedicated webservers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." + remediation: "Stop the Web Server sudo apachectl stop Ensure that the web server will not auto-start at boot sudo defaults write /System/Library/LaunchDaemons/org.apache.httpd Disabled - bool true" + compliance: + - cis: ["4.4"] + condition: none + rules: + - "p:httpd" + - "p:/usr/sbin/httpd" + + # 4.5 Ensure FTP server is not running (Scored) + - id: 9021 + title: "Ensure FTP server is not running" + description: "macOS used to have a graphical front-end to the embedded FTP server in the Operating System. FTP sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Running an FTP server from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. The FTP server however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end user computer. FTP servers meet a specialized need to distribute files without strong authentication and should only be done through hardened servers. Cloud services or other distribution methods should be considered" + rationale: "FTP servers should not be run on an end user desktop. Dedicated servers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." + remediation: "Stop the ftp Server sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist" + compliance: + - cis: ["4.5"] + condition: none + rules: + - "c:launchctl list -> r:com.apple.ftpd" + + # 4.6 Ensure nfs server is not running (Scored) + - id: 9022 + title: "Ensure nfs server is not running" + description: "macOS can act as an NFS fileserver. NFS sharing could be enabled to allow someone on another computer to mount shares and gain access to information from the user's computer. File sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. NFSD is still part of the Operating System and can be easily turned on to export shares and provide remote connectivity to an end user computer." + rationale: "File serving should not be done from a user desktop, dedicated servers should be used. Open ports make it easier to exploit the computer." + remediation: "Stop the NFS Server sudo nfsd disable Remove the exported Directory listing rm /etc/export" + compliance: + - cis: ["4.6"] + condition: none + rules: + - "p:nfsd" + - "p:/sbin/nfsd" + - "f:/etc/exports" + + # 5.8 Do not enable the "root" account (Scored) + - id: 9023 + title: 'Do not enable the "root" account' + description: "The root account is a superuser account that has access privileges to perform any actions and read/write to any file on the computer. With some Linux distros the system administrator may commonly uses the root account to perform administrative functions." + rationale: "Enabling and using the root account puts the system at risk since any successful exploit or mistake while the root account is in use could have unlimited access privileges within the system. Using the sudo command allows users to perform functions as a root user while limiting and password protecting the access privileges. By default the root account is not enabled on a macOS computer. An administrator can escalate privileges using the sudo command (use -s or -i to get a root shell)." + remediation: "Open System Preferences, Uses & Groups. Click the lock icon to unlock it. In the Network Account Server section, click Join or Edit. Click Open Directory Utility. Click the lock icon to unlock it. Select the Edit menu > Disable Root User." + compliance: + - cis: ["5.8"] + condition: all + rules: + - "c:dscl . -read /Users/root AuthenticationAuthority -> r:^No such key: AuthenticationAuthority" + + # 5.9 Disable automatic login (Scored) + - id: 9024 + title: "Disable automatic login" + description: "The automatic login feature saves a user's system access credentials and bypasses the login screen, instead the system automatically loads to the user's desktop screen." + rationale: "Disabling automatic login decreases the likelihood of an unauthorized person gaining access to a system." + remediation: "Run the following command in Terminal: sudo defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser" + compliance: + - cis: ["5.9"] + condition: none + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow -> r:autoLoginUser" + + # 5.20 System Integrity Protection status (Scored) + - id: 9025 + title: "System Integrity Protection status" + description: "System Integrity Protection is a security feature introduced in OS X 10.11 El Capitan. System Integrity Protection restricts access to System domain locations and restricts runtime attachment to system processes. Any attempt to attempt to inspect or attach to a system process will fail. Kernel Extensions are now restricted to /Library/Extensions and are required to be signed with a Developer ID." + rationale: "Running without System Integrity Protection on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by SIP." + remediation: "Perform the following while booted in macOS Recovery Partition. 1. Select Terminal from the Utilities menu 2. Run the following command in Terminal: /usr/bin/csrutil enable 3. The output should be: Successfully enabled System Integrity Protection. Please restart the machine for the changes to take effect. 4. Reboot." + compliance: + - cis: ["5.20"] + condition: all + rules: + - "c:/usr/bin/csrutil status -> r:^System Integrity Protection status: enabled" + + # 6.1.3 Disable guest account login (Scored) + - id: 9026 + title: "Disable guest account login" + description: "The guest account allows users access to the system without having to create an account or password. Guest users are unable to make setting changes, cannot remotely login to the system and all created files, caches, and passwords are deleted upon logging out." + rationale: "Disabling the guest account mitigates the risk of an untrusted user doing basic reconnaissance and possibly using privilege escalation attacks to take control of the system." + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled - bool NO" + compliance: + - cis: ["6.1.3"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow.plist GuestEnabled -> 0" + + # 6.1.5 Remove Guest home folder (Scored) + - id: 9027 + title: "Remove Guest home folder" + description: "The guest account login should have been disabled, so there is no need for the legacy Guest home folder to remain in the file system. When normal user accounts are removed you have the option to archive it, leave it in place or delete. In the case of the guest folder the folder remains in place without a GUI option to remove it. If at some point in the future a Guest account is needed it will be re-created. The presence of the Guest home folder can cause automated audits to fail when looking for compliant settings within all User folders as well. Rather than ignoring the folders continued existence it is best removed." + rationale: "The Guest home folders are unneeded after the Guest account is disabled and could be used inappropriately." + remediation: "1. Run the following command in Terminal: rm -R /Users/Guest 2. Make sure there is no output" + compliance: + - cis: ["6.1.5"] + condition: none + rules: + - "d:/Users/Guest" + + # 6.2 Turn on filename extensions (Scored) + - id: 9028 + title: "Turn on filename extensions" + description: "A filename extension is a suffix added to a base filename that indicates the base filename's file format." + rationale: "Visible filename extensions allows the user to identify the file type and the application it is associated with which leads to quick identification of misrepresented malicious files." + remediation: "Perform the following to implement the prescribed state: 1. Select Finder 2. Select Preferences 3. Check Show all filename extensions Alternatively, use the following command: defaults write NSGlobalDomain AppleShowAllExtensions -bool true" + compliance: + - cis: ["6.2"] + condition: all + rules: + - "c:defaults read NSGlobalDomain AppleShowAllExtensions -> 1" + + # 6.3 Disable the automatic run of safe files in Safari (Scored) + - id: 9029 + title: "Disable the automatic run of safe files in Safari" + description: "Safari will automatically run or execute what it considers safe files. This can include installers and other files that execute on the operating system. Safari bases file safety by using a list of filetypes maintained by Apple. The list of files include text, image, video and archive formats that would be run in the context of the OS rather than the browser." + rationale: "Hackers have taken advantage of this setting via drive-by attacks. These attacks occur when a user visits a legitimate website that has been corrupted. The user unknowingly downloads a malicious file either by closing an infected pop-up or hovering over a malicious banner. An attacker can create a malicious file that will fall within Safari's safe file list that will download and execute without user input." + remediation: 'Perform the following to implement the prescribed state: 1. Open Safari 2. Select Safari from the menu bar 3. Select Preferences 4. Select General 5. Uncheck Open "safe" files after downloading Alternatively run the following command in Terminal: defaults write com.apple.Safari AutoOpenSafeDownloads -boolean no' + compliance: + - cis: ["6.3"] + condition: all + rules: + - "c:defaults read com.apple.Safari AutoOpenSafeDownloads -> 0" diff --git a/etc/ruleset/sca/darwin/17/cis_apple_macOS_10.13.yml b/etc/ruleset/sca/darwin/17/cis_apple_macOS_10.13.yml new file mode 100644 index 0000000000..a7413c0779 --- /dev/null +++ b/etc/ruleset/sca/darwin/17/cis_apple_macOS_10.13.yml @@ -0,0 +1,405 @@ +# Security Configuration Assessment +# CIS Checks for macOS 10.13 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Apple macOS 10.13 Benchmark v1.0.0 - 08-31-2018 + +policy: + id: "cis_apple_macos_10_13" + file: "cis_apple_macOS_10.13.yml" + name: "CIS Apple macOS 10.13 Benchmark v1.0.0" + description: "This document, CIS Apple macOS 10.13 Benchmark, provides prescriptive guidance for establishing a secure configuration posture for Apple macOS 10.13. This guide was tested against Apple macOS 10.13." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check macOS version" + description: "Requirements for running the SCA scan against macOS 10.13 (High Sierra)." + condition: any + rules: + - 'c:sw_vers -> r:^ProductVersion:\t*\s*10\p13' + - 'c:system_profiler SPSoftwareDataType -> r:System Version:\.*10\p13' + - 'c:defaults read loginwindow SystemVersionStampAsString -> r:^\t*\s*10\p13' + +checks: + # 1.1 Verify all Apple provided software is current (Scored) + - id: 9500 + title: "Verify all Apple provided software is current" + description: "Software vendors release security patches and software updates for their products when security vulnerabilities are discovered. There is no simple way to complete this action without a network connection to an Apple software repository. Please ensure appropriate access for this control. This check is only for what Apple provides through software update." + rationale: "It is important that these updates be applied in a timely manner to prevent unauthorized persons from exploiting the identified vulnerabilities." + remediation: "1. In Terminal, run the following: softwareupdate -l 2. In Terminal, run the following for any packages that show up in step 1: sudo softwareupdate -i packagename" + compliance: + - cis: ["1.1"] + condition: all + rules: + - "c:softwareupdate -l -> r:No new software available" + + # 1.2 Enable Auto Update (Scored) + - id: 9501 + title: "Enable Auto Update" + description: 'Auto Update verifies that your system has the newest security patches and software updates. If "Automatically check for updates" is not selected background updates for new malware definition files from Apple for XProtect and Gatekeeper will not occur.' + rationale: "It is important that a system has the newest updates applied so as to prevent unauthorized persons from exploiting identified vulnerabilities." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -int 1" + compliance: + - cis: ["1.2"] + references: + - https://macops.ca/os-x-admins-your-clients-are-not-getting-background-security-updates/ + - https://derflounder.wordpress.com/2014/12/17/forcing-xprotect-blacklist-updates-on-mavericks-and-yosemite/ + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -> 1" + + # 1.3 Enable app update installs (Scored) + - id: 9502 + title: "Enable app update installs" + description: "Ensure that application updates are installed after they are available from Apple. These updates do not require reboots or admin privileges for end users." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool TRUE The remediation requires a log out and log in to show in the GUI. Please note that." + compliance: + - cis: ["1.3"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> 1" + + # 1.4 Enable system data files and security update installs (Scored) + - id: 9503 + title: "Enable system data files and security update installs" + description: "Ensure that system and security updates are installed after they are available from Apple. This setting enables definition updates for XProtect and Gatekeeper, with this setting in place new malware and adware that Apple has added to the list of malware or untrusted software will not execute. These updates do not require reboots or end user admin rights." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable install system data files and security updates: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true && sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true" + compliance: + - cis: ["1.4"] + references: + - https://www.thesafemac.com/tag/xprotect/ + - https://support.apple.com/en-us/HT202491 + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -> 1" + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -> 1" + + # 1.5 Enable macOS update installs (Scored) + - id: 9504 + title: "Enable macOS update installs" + description: "Ensure that macOS updates are installed after they are available from Apple. This setting enables macOS updates to be automatically installed. Some environments will want to approve and test updates before they are delivered. It is best practice to test first where updates can and have caused disruptions to operations. Automatic updates should be turned off where changes are tightly controlled and there are mature testing and approval processes. Automatic updates should not be turned off so the admin can call the users first to let them know it's ok to install. A dependable repeatable process involving a patch agent or remote management tool should be in place before auto-updates are turned off." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable install system data files and security updates: sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -bool TRUE" + compliance: + - cis: ["1.5"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdateRestartRequired -> 1" + + # 2.2.1 Enable "Set time and date automatically" (Scored) + - id: 9505 + title: 'Enable "Set time and date automatically"' + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features." + remediation: "Run the following commands: sudo systemsetup -setnetworktimeserver sudo systemsetup -setusingnetworktime on" + compliance: + - cis: ["2.2.1"] + condition: all + rules: + - 'c:systemsetup -getusingnetworktime -> r:Network Time:\s*\t*On' + + # 2.4.1 Disable Remote Apple Events (Scored) + - id: 9506 + title: "Disable Remote Apple Events" + description: "Apple Events is a technology that allows one program to communicate with other programs. Remote Apple Events allows a program on one computer to communicate with a program on a different computer." + rationale: "Disabling Remote Apple Events mitigates the risk of an unauthorized program gaining access to the system." + remediation: "Run the following command in Terminal: sudo systemsetup -setremoteappleevents off" + compliance: + - cis: ["2.4.1"] + condition: all + rules: + - 'c:systemsetup -getremoteappleevents -> r:Remote Apple Events:\s*\t*Off' + + # 2.4.4 Disable Printer Sharing (Scored) + - id: 9507 + title: "Disable Printer Sharing" + description: "By enabling Printer sharing the computer is set up as a print server to accept print jobs from other computers. Dedicated print servers or direct IP printing should be used instead." + rationale: "Disabling Printer Sharing mitigates the risk of attackers attempting to exploit the print server to gain access to the system." + remediation: "Perform the following to implement the prescribed state: 1. Open System Preferences 2. Select Sharing 3. Uncheck Printer Sharing" + compliance: + - cis: ["2.4.4"] + condition: none + rules: + - 'c:system_profiler SPPrintersDataType -> r:Shared:\s*\t*Yes' + + # 2.4.5 Disable Remote Login (Scored) + - id: 9508 + title: "Disable Remote Login" + description: "Remote Login allows an interactive terminal connection to a computer." + rationale: "Disabling Remote Login mitigates the risk of an unauthorized person gaining access to the system via Secure Shell (SSH). While SSH is an industry standard to connect to posix servers, the scope of the benchmark is for Apple macOS clients, not servers." + remediation: "Run the following command in Terminal: sudo systemsetup -setremotelogin off" + compliance: + - cis: ["2.4.5"] + condition: all + rules: + - 'c:systemsetup -getremotelogin -> r:Remote Login:\s*\t*Off' + + # 2.4.8 Disable File Sharing (Scored) + - id: 9509 + title: "Disable File Sharing" + description: "Apple's File Sharing uses a combination of SMB (Windows sharing) and AFP (Mac sharing)" + rationale: "By disabling file sharing, the remote attack surface and risk of unauthorized access to files stored on the system is reduced." + remediation: "Run the following command in Terminal to turn off AFP from the command line: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist - Run the following command in Terminal to turn off SMB sharing from the CLI: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.smbd.plist" + compliance: + - cis: ["2.4.8"] + condition: none + rules: + - "c:launchctl list -> r:AppleFileServer" + - 'f:/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist -> r:\ r:womp && !r:\s0$' + + # 2.6.1.1 Enable FileVault (Scored) + - id: 9511 + title: "Enable FileVault" + description: "FileVault secures a system's data by automatically encrypting its boot volume and requiring a password or recovery key to access it." + rationale: "Encrypting sensitive data minimizes the likelihood of unauthorized users gaining access to it." + remediation: "1. Open System Preferences 2. Select Security & Privacy 3. Select FileVault 4. Select Turn on FileVault" + compliance: + - cis: ["2.6.1.1"] + condition: all + rules: + - 'c:fdesetup status -> r:^FileVault\s*\t*is\s*\t*On$' + + # 2.6.2 Enable Gatekeeper (Scored) + - id: 9512 + title: "Enable Gatekeeper" + description: "Gatekeeper is Apple's application white-listing control that restricts downloaded applications from launching. It functions as a control to limit applications from unverified sources from running without authorization." + rationale: "Disallowing unsigned software will reduce the risk of unauthorized or malicious applications from running on the system." + remediation: "Run the following command in Terminal: sudo spctl --master-enable" + compliance: + - cis: ["2.6.2"] + condition: all + rules: + - 'c:spctl --status -> r:^assessments\s*\t*enabled$' + + # 2.6.3 Enable Firewall (Scored) + - id: 9513 + title: "Enable Firewall" + description: "A firewall is a piece of software that blocks unwanted incoming connections to a system. Apple has posted general documentation about the application firewall." + rationale: "A firewall minimizes the threat of unauthorized users from gaining access to your system while connected to a network or the Internet." + remediation: "Run the following command in Terminal: defaults write /Library/Preferences/com.apple.alf globalstate - int Where is: - 1 = on for specific services - 2 = on for essential services " + compliance: + - cis: ["2.6.3"] + references: + - https://support.apple.com/en-us/HT201642 + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.alf globalstate -> r:^1$|^2$" + + # 2.6.4 Enable Firewall Stealth Mode (Scored) + - id: 9514 + title: "Enable Firewall Stealth Mode" + description: "While in Stealth mode the computer will not respond to unsolicited probes, dropping that traffic." + rationale: "Stealth mode on the firewall minimizes the threat of system discovery tools while connected to a network or the Internet." + remediation: "Run the following command in Terminal: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on" + compliance: + - cis: ["2.6.4"] + references: + - https://support.apple.com/en-us/HT201642 + condition: all + rules: + - "c:/usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode -> r:^Stealth mode enabled" + + # 2.10 Enable Secure Keyboard Entry in terminal.app (Scored) + - id: 9515 + title: "Enable Secure Keyboard Entry in terminal.app" + description: "Secure Keyboard Entry prevents other applications on the system and/or network from detecting and recording what is typed into Terminal." + rationale: "Enabling Secure Keyboard Entry minimizes the risk of a key logger from detecting what is entered in Terminal." + remediation: "Perform the following to implement the prescribed state: 1. Open Terminal 2. Select Terminal 3. Select Secure Keyboard Entry" + compliance: + - cis: ["2.10"] + condition: all + rules: + - "c:defaults read -app Terminal SecureKeyboardEntry -> 1" + + # 2.11 Java 6 is not the default Java runtime (Scored) + - id: 9516 + title: "Java 6 is not the default Java runtime" + description: "Apple had made Java part of the core Operating System for macOS. Apple is no longer providing Java updates for macOS and updated JREs and JDK are made available by Oracle. The latest version of Java 6 made available by Apple has many unpatched vulnerabilities and should not be the default runtime for Java applets that request one from the Operating System" + rationale: "Java has been one of the most exploited environments and Java 6, which was provided as an OS component by Apple, is no longer maintained by Apple or Oracle. The old versions provided by Apple are both unsupported and missing the more modern security controls that have limited current exploits. The EOL version may still be installed and should be removed from the computer or not be in the default path." + remediation: "Java 6 can be removed completely or, if required Java applications will only work with Java 6, a custom path can be used. Apple is likely to finally pull the plug on Java 6 in upcoming macOS versions so any applications that still require Java 6 will likely soon be unavailable." + compliance: + - cis: ["2.11"] + condition: none + rules: + - "c:/usr/libexec/java_home -> r:1.6.0" + + # 2.13 Ensure EFI version is valid and being regularly checked (Scored) + - id: 9517 + title: "Ensure EFI version is valid and being regularly checked" + description: "In order to mitigate firmware attacks Apple has created a automated Firmware check to ensure that the EFI version running is a known good version from Apple. There is also an automated process to check it every seven days." + rationale: "If the Firmware of a computer has been compromised the Operating System that the Firmware loads cannot be trusted either." + remediation: "If EFI does not pass the integrity check you may send a report to Apple. Backing up files and clean installing a known good Operating System and Firmware is recommended." + compliance: + - cis: ["2.13"] + condition: all + rules: + - "c:/usr/libexec/firmwarecheckers/eficheck/eficheck --integrity-check -> r:Primary allowlist version match found. No changes detected in primary hashes" + - 'c:launchctl list -> r:^-\s*\t*0\s*\t*com.apple.driver.eficheck$' + + # 3.1 Enable security auditing (Scored) + - id: 9518 + title: "Enable security auditing" + description: "macOS's audit facility, auditd, receives notifications from the kernel when certain system calls, such as open, fork, and exit, are made. These notifications are captured and written to an audit log." + rationale: "Logs generated by auditd may be useful when investigating a security incident as they may help reveal the vulnerable application and the actions taken by a malicious actor." + remediation: "Run the following command in Terminal: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.auditd.plist" + compliance: + - cis: ["3.1"] + condition: all + rules: + - "c:launchctl list -> r:com.apple.auditd" + + # 3.2 Configure Security Auditing Flags (Scored) + - id: 9519 + title: "Configure Security Auditing Flags" + description: "Auditing is the capture and maintenance of information about security-related events." + rationale: "Maintaining an audit trail of system activity logs can help identify configuration errors, troubleshoot service disruptions, and analyze compromises or attacks that have occurred, have begun, or are about to begin. Audit logs are necessary to provide a trail of evidence in case the system or network is compromised." + remediation: '1. Open a terminal session and edit the /etc/security/audit_control file 2. Find the line beginning with "flags" 3. Add the following flags: lo, ad, fd, fm, -all. 4. Save the file.' + compliance: + - cis: ["3.2"] + condition: all + rules: + - "f:/etc/security/audit_control -> r:^flags && r:lo && r:ad && r:fd && r:fm && r:-all" + + # 4.1 Disable Bonjour advertising service (Scored) + - id: 9520 + title: "Disable Bonjour advertising service" + description: "Bonjour is an auto-discovery mechanism for TCP/IP devices which enumerate devices and services within a local subnet. DNS on macOS is integrated with Bonjour and should not be turned off, but the Bonjour advertising service can be disabled." + rationale: 'Bonjour can simplify device discovery from an internal rogue or compromised host. An attacker could use Bonjour''s multicast DNS feature to discover a vulnerable or poorly- configured service or additional information to aid a targeted attack. Implementing this control disables the continuous broadcasting of "I''m here!" messages. Typical end-user endpoints should not have to advertise services to other computers.' + remediation: "Run the following command in Terminal: defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements" + compliance: + - cis: ["4.1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -> 1" + + # 4.4 Ensure http server is not running (Scored) + - id: 9521 + title: "Ensure http server is not running" + description: "macOS used to have a graphical front-end to the embedded Apache web server in the Operating System. Personal web sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Personal web sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. Apache however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end user computer. Web sharing should only be done through hardened web servers and appropriate cloud services." + rationale: "Web serving should not be done from a user desktop. Dedicated webservers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." + remediation: "Ensure that the Web Server is not running and is not set to start at boot Stop the Web Server: sudo apachectl stop Ensure that the web server will not auto-start at boot sudo: defaults write /System/Library/LaunchDaemons/org.apache.httpd Disabled - bool true" + compliance: + - cis: ["4.4"] + condition: none + rules: + - "p:httpd" + - "p:/usr/sbin/httpd" + + # 4.5 Ensure nfs server is not running (Scored) + - id: 9522 + title: "Ensure nfs server is not running" + description: "macOS can act as an NFS fileserver. NFS sharing could be enabled to allow someone on another computer to mount shares and gain access to information from the user's computer. File sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. NFSD is still part of the Operating System and can be easily turned on to export shares and provide remote connectivity to an end user computer." + rationale: "File serving should not be done from a user desktop, dedicated servers should be used. Open ports make it easier to exploit the computer." + remediation: "Ensure that the NFS Server is not running and is not set to start at boot Stop the NFS Server: sudo nfsd disable Remove the exported Directory listing: rm /etc/export" + compliance: + - cis: ["4.5"] + condition: none + rules: + - "p:nfsd" + - "p:/sbin/nfsd" + - "f:/etc/exports" + + # 5.11 Do not enable the "root" account (Scored) + - id: 9523 + title: 'Do not enable the "root" account' + description: "The root account is a superuser account that has access privileges to perform any actions and read/write to any file on the computer. With some Linux distros the system administrator may commonly uses the root account to perform administrative functions." + rationale: "Enabling and using the root account puts the system at risk since any successful exploit or mistake while the root account is in use could have unlimited access privileges within the system. Using the sudo command allows users to perform functions as a root user while limiting and password protecting the access privileges. By default the root account is not enabled on a macOS computer. An administrator can escalate privileges using the sudo command (use -s or -i to get a root shell)." + remediation: "Open System Preferences, Uses & Groups. Click the lock icon to unlock it. In the Network Account Server section, click Join or Edit. Click Open Directory Utility. Click the lock icon to unlock it. Select the Edit menu > Disable Root User." + compliance: + - cis: ["5.11"] + condition: all + rules: + - "c:dscl . -read /Users/root AuthenticationAuthority -> r:^No such key: AuthenticationAuthority" + + # 5.12 Disable automatic login (Scored) + - id: 9524 + title: "Disable automatic login" + description: "The automatic login feature saves a user's system access credentials and bypasses the login screen, instead the system automatically loads to the user's desktop screen." + rationale: "Disabling automatic login decreases the likelihood of an unauthorized person gaining access to a system." + remediation: "Run the following command in Terminal: sudo defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser" + compliance: + - cis: ["5.12"] + condition: none + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow -> r:autoLoginUser" + + # 5.23 System Integrity Protection status (Scored) + - id: 9525 + title: "System Integrity Protection status" + description: "System Integrity Protection is a security feature introduced in OS X 10.11 El Capitan. System Integrity Protection restricts access to System domain locations and restricts runtime attachment to system processes. Any attempt to attempt to inspect or attach to a system process will fail. Kernel Extensions are now restricted to /Library/Extensions and are required to be signed with a Developer ID." + rationale: "Running without System Integrity Protection on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by SIP." + remediation: "Perform the following while booted in macOS Recovery Partition. 1. Select Terminal from the Utilities menu 2. Run the following command in Terminal: /usr/bin/csrutil enable 3. The output should be: Successfully enabled System Integrity Protection. Please restart the machine for the changes to take effect. 4. Reboot." + compliance: + - cis: ["5.23"] + condition: all + rules: + - "c:/usr/bin/csrutil status -> r:^System Integrity Protection status: enabled" + + # 6.1.3 Disable guest account login (Scored) + - id: 9526 + title: "Disable guest account login" + description: "The guest account allows users access to the system without having to create an account or password. Guest users are unable to make setting changes, cannot remotely login to the system and all created files, caches, and passwords are deleted upon logging out." + rationale: "Disabling the guest account mitigates the risk of an untrusted user doing basic reconnaissance and possibly using privilege escalation attacks to take control of the system." + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled - bool NO" + compliance: + - cis: ["6.1.3"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow.plist GuestEnabled -> 0" + + # 6.1.5 Remove Guest home folder (Scored) + - id: 9527 + title: "Remove Guest home folder" + description: "The guest account login should have been disabled, so there is no need for the legacy Guest home folder to remain in the file system. When normal user accounts are removed you have the option to archive it, leave it in place or delete. In the case of the guest folder the folder remains in place without a GUI option to remove it. If at some point in the future a Guest account is needed it will be re-created. The presence of the Guest home folder can cause automated audits to fail when looking for compliant settings within all User folders as well. Rather than ignoring the folders continued existence it is best removed." + rationale: "The Guest home folders are unneeded after the Guest account is disabled and could be used inappropriately." + remediation: "1. Run the following command in Terminal: rm -R /Users/Guest 2. Make sure there is no output" + compliance: + - cis: ["6.1.5"] + condition: none + rules: + - "d:/Users/Guest" + + # 6.2 Turn on filename extensions (Scored) + - id: 9528 + title: "Turn on filename extensions" + description: "A filename extension is a suffix added to a base filename that indicates the base filename's file format." + rationale: "Visible filename extensions allows the user to identify the file type and the application it is associated with which leads to quick identification of misrepresented malicious files." + remediation: "Perform the following to implement the prescribed state: 1. Select Finder 2. Select Preferences 3. Check Show all filename extensions Alternatively, use the following command: defaults write NSGlobalDomain AppleShowAllExtensions -bool true" + compliance: + - cis: ["6.2"] + condition: all + rules: + - "c:defaults read NSGlobalDomain AppleShowAllExtensions -> 1" + + # 6.3 Disable the automatic run of safe files in Safari (Scored) + - id: 9529 + title: "Disable the automatic run of safe files in Safari" + description: "Safari will automatically run or execute what it considers safe files. This can include installers and other files that execute on the operating system. Safari bases file safety by using a list of filetypes maintained by Apple. The list of files include text, image, video and archive formats that would be run in the context of the OS rather than the browser." + rationale: "Hackers have taken advantage of this setting via drive-by attacks. These attacks occur when a user visits a legitimate website that has been corrupted. The user unknowingly downloads a malicious file either by closing an infected pop-up or hovering over a malicious banner. An attacker can create a malicious file that will fall within Safari's safe file list that will download and execute without user input." + remediation: 'Perform the following to implement the prescribed state: 1. Open Safari 2. Select Safari from the menu bar 3. Select Preferences 4. Select General 5. Uncheck Open "safe" files after downloading Alternatively run the following command in Terminal: defaults write com.apple.Safari AutoOpenSafeDownloads -boolean no' + compliance: + - cis: ["6.3"] + condition: all + rules: + - "c:defaults read com.apple.Safari AutoOpenSafeDownloads -> 0" diff --git a/etc/ruleset/sca/darwin/18/cis_apple_macOS_10.14.yml b/etc/ruleset/sca/darwin/18/cis_apple_macOS_10.14.yml new file mode 100644 index 0000000000..c666337300 --- /dev/null +++ b/etc/ruleset/sca/darwin/18/cis_apple_macOS_10.14.yml @@ -0,0 +1,757 @@ +# Security Configuration Assessment +# CIS Checks for macOS 10.14 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Apple macOS 10.14 Benchmark v1.0.0 - 04-06-2020 + +policy: + id: "cis_apple_macos_10_14" + file: "cis_apple_macOS_10.14.yml" + name: "CIS Apple macOS 10.14 Benchmark v1.0.0" + description: "This document, CIS Apple macOS 10.14 Benchmark, provides prescriptive guidance for establishing a secure configuration posture for Apple macOS 10.14. This guide was tested against Apple macOS 10.14." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check macOS version" + description: "Requirements for running the SCA scan against macOS 10.14 (Mojave)." + condition: any + rules: + - 'c:sw_vers -> r:^ProductVersion:\t*\s*10\p14' + - 'c:system_profiler SPSoftwareDataType -> r:System Version:\.*10\p14' + - 'c:defaults read loginwindow SystemVersionStampAsString -> r:^\t*\s*10\p14' + +checks: + # 1.1 Verify all Apple provided software is current (Automated) + - id: 17000 + title: "Verify all Apple provided software is current" + description: "Software vendors release security patches and software updates for their products when security vulnerabilities are discovered. There is no simple way to complete this action without a network connection to an Apple software repository. Please ensure appropriate access for this control. This check is only for what Apple provides through software update." + rationale: "It is important that these updates be applied in a timely manner to prevent unauthorized persons from exploiting the identified vulnerabilities." + remediation: "1. In Terminal, run the following: softwareupdate -l 2. In Terminal, run the following for any packages that show up in step 1: sudo softwareupdate -i packagename" + compliance: + - cis: ["1.1"] + condition: all + rules: + - "c:softwareupdate -l -> r:No new software available" + + # 1.2 Enable Auto Update (Automated) + - id: 17001 + title: "Enable Auto Update" + description: 'Auto Update verifies that your system has the newest security patches and software updates. If "Automatically check for updates" is not selected background updates for new malware definition files from Apple for XProtect and Gatekeeper will not occur.' + rationale: "It is important that a system has the newest updates applied so as to prevent unauthorized persons from exploiting identified vulnerabilities." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true" + compliance: + - cis: ["1.2"] + references: + - https://macops.ca/os-x-admins-your-clients-are-not-getting-background-security-updates/ + - https://derflounder.wordpress.com/2014/12/17/forcing-xprotect-blacklist-updates-on-mavericks-and-yosemite/ + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -> 1" + + # 1.3 Enable app update installs (Automated) + - id: 17002 + title: "Enable Download new updates when available" + description: 'In the GUI both "Install macOS updates" and "Install app updates from the App Store" are dependent on whether "Download new updates when available" is selected' + rationale: "It is important that a system has the newest updates downloaded so that they can be applied." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true" + compliance: + - cis: ["1.3"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -> 1" + + # 1.4 Enable app update installs (Automated) + - id: 17003 + title: "Enable app update installs" + description: "Ensure that application updates are installed after they are available from Apple. These updates do not require reboots or admin privileges for end users." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate - bool TRUE" + compliance: + - cis: ["1.4"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> 1" + + # 1.5 Enable system data files and security update installs (Automated) + - id: 17004 + title: "Enable system data files and security update installs" + description: "Ensure that system and security updates are installed after they are available from Apple. This setting enables definition updates for XProtect and Gatekeeper, with this setting in place new malware and adware that Apple has added to the list of malware or untrusted software will not execute. These updates do not require reboots or end user admin rights." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable install system data files and security updates: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true && sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true" + compliance: + - cis: ["1.5"] + references: + - https://www.thesafemac.com/tag/xprotect/ + - https://support.apple.com/en-us/HT202491 + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -> 1" + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -> 1" + + # 1.6 Enable macOS update installs (Automated) + - id: 17005 + title: "Enable macOS update installs" + description: "Ensure that macOS updates are installed after they are available from Apple. This setting enables macOS updates to be automatically installed. Some environments will want to approve and test updates before they are delivered. It is best practice to test first where updates can and have caused disruptions to operations. Automatic updates should be turned off where changes are tightly controlled and there are mature testing and approval processes. Automatic updates should not be turned off so the admin can call the users first to let them know it's ok to install. A dependable repeatable process involving a patch agent or remote management tool should be in place before auto-updates are turned off." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable install system data files and security updates: sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate - bool TRUE" + compliance: + - cis: ["1.6"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> 1" + + # 2.1.1 Turn off Bluetooth, if no paired devices exist (Automated) + - id: 17006 + title: "Turn off Bluetooth, if no paired devices exist" + description: "Bluetooth devices use a wireless communications system that replaces the cables used by other peripherals to connect to a system. It is by design a peer-to-peer network technology and typically lacks centralized administration and security enforcement infrastructure." + rationale: "Bluetooth is particularly susceptible to a diverse set of security vulnerabilities involving identity detection, location tracking, denial of service, unintended control and access of data and voice channels, and unauthorized device control and data access." + remediation: "Open a terminal session and enter the following command to disable bluetooth: sudo defaults write /Library/Preferences/com.apple.Bluetooth ControllerPowerState -int 0 && sudo killall -HUP blued" + compliance: + - cis: ["2.1.1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.Bluetooth ControllerPowerState -> 0" + - "c:system_profiler SPBluetoothDataType -> r:Connectable: Yes" + + # not implemented SCA Limit -> 2.1.2 Show Bluetooth status in menu bar (Automated) + + # 2.2.1 Enable "Set time and date automatically" (Automated) + - id: 17008 + title: 'Enable "Set time and date automatically"' + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features." + remediation: "Run the following commands: sudo systemsetup -setnetworktimeserver sudo systemsetup -setusingnetworktime on" + compliance: + - cis: ["2.2.1"] + condition: all + rules: + - 'c:systemsetup -getusingnetworktime -> r:Network Time:\s*\t*On' + + # 2.2.2 Ensure time set is within appropriate limits (Automated) + - id: 17009 + title: "Ensure time set is within appropriate limits" + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries. Ensure that time on the computer is within acceptable limits. Truly accurate time is measured within milliseconds, for this audit a drift under four and a half minutes passes the control check. Since Kerberos is one of the important features of macOS integration into Directory systems the guidance here is to warn you before there could be an impact to operations. From the perspective of accurate time this check is not strict, it may be too great for your organization, adjust to a smaller offset value as needed. Note: ntpdate has been deprecated with 10.14. sntp replaces that command." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features. Audit check is for more than 4 minutes and 30 seconds ahead or behind." + remediation: "Run the following commands to ensure your time is set within an appropriate limit: sudo systemsetup -getnetworktimeserver -> Get the time server name and then run: sudo touch /var/db/ntp-kod && sudo chown root:wheel /var/db/ntp-kod && sudo sntp -sS " + compliance: + - cis: ["2.2.2"] + condition: all + rules: + - "c:systemsetup -getnetworktimeserver -> r:Network Time Server:" + + # 2.3.1 Set an inactivity interval of 20 minutes or less for the screen saver (Automated) + - id: 17010 + title: "Set an inactivity interval of 20 minutes or less for the screen saver" + description: "A locking screensaver is one of the standard security controls to limit access to a computer and the current user's session when the computer is temporarily unused or unattended. In macOS the screensaver starts after a value selected in a drop down menu, 10 minutes and 20 minutes are both options and either is acceptable. Any value can be selected through the command line or script but a number that is not reflected in the GUI can be problematic. 20 minutes is the default for new accounts." + rationale: "Setting an inactivity interval for the screensaver prevents unauthorized persons from viewing a system left unattended for an extensive period of time." + remediation: "Run the following command to verify that the idle time of the screen saver to 20 minutes or less (≤1200): sudo defaults -currentHost write com.apple.screensaver idleTime -int 600 " + compliance: + - cis: ["2.3.1"] + condition: all + rules: + - "c:defaults -currentHost read com.apple.screensaver idleTime -> !r:does not exist" + + # 2.3.2 Secure screen saver corners (Automated) + - id: 17011 + title: "Secure screen saver corners" + description: "Hot Corners can be configured to disable the screen saver by moving the mouse cursor to a corner of the screen." + rationale: "Setting a hot corner to disable the screen saver poses a potential security risk since an unauthorized person could use this to bypass the login screen and gain access to the system." + remediation: "Run the following command to turn off Disable Screen Saver for a Hot Corner: sudo -u defaults write com.apple.dock -int 0 " + compliance: + - cis: ["2.3.2"] + condition: all + rules: + - "c:defaults read com.apple.dock wvous-tl-corner -> !r:^6$" + - "c:defaults read com.apple.dock wvous-nl-corner -> !r:^6$" + - "c:defaults read com.apple.dock wvous-tr-corner -> !r:^6$" + - "c:defaults read com.apple.dock wvous-br-corner -> !r:^6$" + + # 2.4.1 Disable Remote Apple Events (Automated) + - id: 17012 + title: "Disable Remote Apple Events" + description: "Apple Events is a technology that allows one program to communicate with other programs. Remote Apple Events allows a program on one computer to communicate with a program on a different computer." + rationale: "Disabling Remote Apple Events mitigates the risk of an unauthorized program gaining access to the system." + remediation: "Run the following command in Terminal: sudo systemsetup -setremoteappleevents off" + compliance: + - cis: ["2.4.1"] + condition: all + rules: + - 'c:systemsetup -getremoteappleevents -> r:Remote Apple Events:\s*\t*Off' + + # 2.4.2 Disable Internet Sharing (Automated) + - id: 17013 + title: "Disable Internet Sharing" + description: "Internet Sharing uses the open source natd process to share an internet connection with other computers and devices on a local network. This allows the Mac to function as a router and share the connection to other, possibly unauthorized, devices." + rationale: "Disabling Internet Sharing reduces the remote attack surface of the system." + remediation: "Run the following command to turn off Internet Sharing: sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict Enabled -int 0" + compliance: + - cis: ["2.4.2"] + condition: all + rules: + - 'c:defaults read /Library/Preferences/SystemConfiguration/com.apple.nat -> r:Enabled\s*\t*=\s*\t*1' + + # 2.4.3 Disable Screen Sharing (Automated) + - id: 17014 + title: "Disable Screen Sharing" + description: "Screen sharing allows a computer to connect to another computer on a network and display the computer’s screen. While sharing the computer’s screen, the user can control what happens on that computer, such as opening documents or applications, opening, moving, or closing windows, and even shutting down the computer." + rationale: "Disabling screen sharing mitigates the risk of remote connections being made without the user of the console knowing that they are sharing the computer." + remediation: "Run the following command to turn off Screen Sharing: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.screensharing.plist" + compliance: + - cis: ["2.4.3"] + condition: all + rules: + - "c:launchctl load /System/Library/LaunchDaemons/com.apple.screensharing.plist -> r:Service is disabled" + + # 2.4.4 Disable Printer Sharing (Automated) + - id: 17015 + title: "Disable Printer Sharing" + description: "By enabling Printer sharing the computer is set up as a print server to accept print jobs from other computers. Dedicated print servers or direct IP printing should be used instead." + rationale: "Disabling Printer Sharing mitigates the risk of attackers attempting to exploit the print server to gain access to the system." + remediation: "Run the following command in Terminal: sudo cupsctl --no-share-printers" + compliance: + - cis: ["2.4.4"] + references: + - https://support.apple.com/kb/PH11450 + condition: all + rules: + - 'c:sudo system_profiler SPPrintersDataType | grep -e Sharing -> r:System Printer Sharing:\s*\t*Yes' + + # 2.4.5 Disable Remote Login (Automated) + - id: 17016 + title: "Disable Remote Login" + description: "Remote Login allows an interactive terminal connection to a computer." + rationale: "Disabling Remote Login mitigates the risk of an unauthorized person gaining access to the system via Secure Shell (SSH). While SSH is an industry standard to connect to posix servers, the scope of the benchmark is for Apple macOS clients, not servers. macOS does have an IP based firewall available (pf, ipfw has been deprecated) that is not enabled or configured. There are more details and links in section 7.5. macOS no longer has TCP Wrappers support built-in and does not have strong Brute-Force password guessing mitigations, or frequent patching of openssh by Apple. Most macOS computers are mobile workstations, managing IP based firewall rules on mobile devices can be very resource intensive. All of these factors can be parts of running a hardened SSH server." + remediation: "Run the following command in Terminal: sudo systemsetup -setremotelogin off" + compliance: + - cis: ["2.4.5"] + condition: all + rules: + - 'c:systemsetup -getremotelogin -> r:Remote Login:\s*\t*Off' + + # 2.4.6 Disable DVD or CD Sharing (Automated) + - id: 17017 + title: "Disable DVD or CD Sharing" + description: "DVD or CD Sharing allows users to remotely access the system's optical drive." + rationale: "Disabling DVD or CD Sharing minimizes the risk of an attacker using the optical drive as a vector for attack and exposure of sensitive data." + remediation: "Run the following command to disable DVD or CD sharing: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.ODSAgent.plist" + compliance: + - cis: ["2.4.6"] + condition: all + rules: + - "c:launchctl list -> r:ODSAgent" + + # 2.4.7 Disable Bluetooth Sharing (Automated) + - id: 17018 + title: "Disable Bluetooth Sharing " + description: "Bluetooth Sharing allows files to be exchanged with Bluetooth enabled devices." + rationale: "Disabling Bluetooth Sharing minimizes the risk of an attacker using Bluetooth to remotely attack the system." + remediation: "Perform the following to disable Bluetooth Sharing: Graphical Method: 1. Open System Preferences 2. Select Sharing 3. Uncheck Bluetooth Sharing" + compliance: + - cis: ["2.4.7"] + condition: all + rules: + - 'c:system_profiler SPBluetoothDataType -> !r:State:\s*\t*Enabled' + + # 2.4.8 Disable File Sharing (Automated) + - id: 17019 + title: "Disable File Sharing" + description: "Apple's File Sharing uses a combination of SMB (Windows sharing) and AFP (Mac sharing)" + rationale: "By disabling file sharing, the remote attack surface and risk of unauthorized access to files stored on the system is reduced." + remediation: "Run the following command in Terminal to turn off AFP and SMB file sharing from the command line: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist && sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.smbd.plist" + compliance: + - cis: ["2.4.8"] + condition: none + rules: + - "c:launchctl list -> r:AppleFileServer" + - 'f:/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist -> r:\ r:\s*\t*com.apple.smbd' + + # 2.4.9 Disable Remote Management (Automated) + - id: 17020 + title: "Disable Remote Management" + description: "Remote Management is the client portion of Apple Remote Desktop (ARD). Remote Management can be used by remote administrators to view the current Screen, install software, report on, and generally manage client Macs. The screen sharing options in Remote Management are identical to those in the Screen Sharing section. In fact, only one of the two can be configured. If Remote Management is used, refer to the Screen Sharing section above on issues regard screen sharing. Remote Management should only be enabled when a Directory is in place to manage the accounts with access. Computers will be available on port 5900 on a macOS System and could accept connections from untrusted hosts depending on the configuration, definitely a concern for mobile systems." + rationale: "Remote management should only be enabled on trusted networks with strong user controls present in a Directory system. Mobile devices without strict controls are vulnerable to exploit and monitoring." + remediation: "Run the following command to disable remote management: sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources /kickstart -deactivate -stop" + compliance: + - cis: ["2.4.9"] + condition: all + rules: + - "not p:ARDAgent" + + # 2.4.10 Disable Content Caching (Automated) + - id: 17021 + title: "Disable Content Caching" + description: "Starting with 10.13 (macOS High Sierra) Apple introduced a service to make it easier deploy data from Apple, including software updates, where there are bandwidth constraints to the Internet and fewer constraints and greater bandwidth on the local subnet. This capability can be very valuable for organizations that have throttled and possibly metered Internet connections. In heterogeneous enterprise networks with multiple subnets the effectiveness of this capability would be determined on how many Macs were on each subnet at the time new large updates were made available upstream. This capability requires the use of mac OS clients as P2P nodes for updated Apple content. Unless there is a business requirement to manage operational Internet connectivity bandwidth user endpoints should not store content and act as a cluster to provision data." + rationale: "The main use case for Mac computers is as mobile user endpoints. P2P sharing services should not be enabled on laptops that are using untrusted networks. Content Caching can allow a computer to be a server for local nodes on an untrusted network. While there are certainly logical controls that could be used to mitigate risk they add to the management complexity, since the value of the service is in specific use cases organizations with the use case described above can accept risk as necessary." + remediation: "Run the following command in to disable content caching: sudo AssetCacheManagerUtil deactivate" + compliance: + - cis: ["2.4.10"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.AssetCache.plist Activated -> 0" + + # 2.5.1.1 Enable FileVault (Automated) + - id: 17022 + title: "Enable FileVault" + description: "FileVault secures a system's data by automatically encrypting its boot volume and requiring a password or recovery key to access it. Filevault may also be enabled using command line using the fdesetup command. To use this functionality, consult the Der Flounder blog for more details: https://derflounder.wordpress.com/2015/02/02/managing-yosemites-filevault-2-with-fdesetup/ https://derflounder.wordpress.com/2019/01/15/unlock-or-decrypt-your-filevault-encrypted-boot-drive-from-the-command-line-on-macos-mojave/ " + rationale: "Encrypting sensitive data minimizes the likelihood of unauthorized users gaining access to it." + remediation: "1. Open System Preferences 2. Select Security & Privacy 3. Select FileVault 4. Select Turn on FileVault" + compliance: + - cis: ["2.5.1.1"] + condition: all + rules: + - 'c:fdesetup status -> r:^FileVault\s*\t*is\s*\t*On$' + + # 2.5.2 Enable Gatekeeper (Automated) + - id: 17023 + title: "Enable Gatekeeper" + description: "Gatekeeper is Apple's application white-listing control that restricts downloaded applications from launching. It functions as a control to limit applications from unverified sources from running without authorization." + rationale: "Disallowing unsigned software will reduce the risk of unauthorized or malicious applications from running on the system." + remediation: "Run the following command in Terminal: sudo spctl --master-enable" + compliance: + - cis: ["2.5.2"] + condition: all + rules: + - 'c:spctl --status -> r:^assessments\s*\t*enabled$' + + # 2.5.3 Enable Firewall (Automated) + - id: 17024 + title: "Enable Firewall" + description: "A firewall is a piece of software that blocks unwanted incoming connections to a system. Apple has posted general documentation about the application firewall." + rationale: "A firewall minimizes the threat of unauthorized users from gaining access to your system while connected to a network or the Internet." + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.alf globalstate - int Where is: - 1 = on for specific services - 2 = on for essential services " + compliance: + - cis: ["2.5.3"] + references: + - https://support.apple.com/en-us/HT201642 + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.alf globalstate -> r:^1$|^2$" + + # 2.5.4 Enable Firewall Stealth Mode (Automated) + - id: 17025 + title: "Enable Firewall Stealth Mode" + description: "While in Stealth mode the computer will not respond to unsolicited probes, dropping that traffic." + rationale: "Stealth mode on the firewall minimizes the threat of system discovery tools while connected to a network or the Internet." + remediation: "Run the following command in Terminal: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on" + compliance: + - cis: ["2.5.4"] + references: + - https://support.apple.com/en-us/HT201642 + condition: all + rules: + - "c:/usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode -> r:^Stealth mode enabled" + + # 2.5.6 Enable Location Services (Automated) + - id: 17026 + title: "Enable Location Services" + description: "macOS uses location information gathered through local Wi-Fi networks to enable applications to supply relevant information to users. Users do not need to change the time or the time zone, the computer will do it for them. They do not need to specify their location for weather or travel times and even get alerts on travel times to meetings and appointment where location information is supplied. For the purpose of asset management and time and log management with mobile computers location services simplify some processes.There are some use cases where it is important that the computer not be able to report it's exact location. While the general use case is to enable Location Services, it should not be allowed if the physical location of the computer and the user should not be public knowledge." + rationale: "Location services are helpful in most use cases and can simplify log and time management where computers change time zones." + remediation: "Run the following command to enable location services: sudo launchctl load /System/Library/LaunchDaemons/com.apple.locationd.plist" + compliance: + - cis: ["2.5.6"] + references: + - https://support.apple.com/en-us/HT204690 + condition: all + rules: + - "c:launchctl load /System/Library/LaunchDaemons/com.apple.locationd.plist -> r:service already loaded" + + # 2.5.8 Disable sending diagnostic and usage data to Apple (Automated) 17027 + - id: 17027 + title: "Disable sending diagnostic and usage data to Apple" + description: "Apple provides a mechanism to send diagnostic and analytics data back to Apple to help them improve the platform. Information sent to Apple may contain internal organizational information that should be controlled and not available for processing by Apple. Turn off all Analytics and Improvements sharing." + rationale: "Organizations should have knowledge of what is shared with the vendor and the setting automatically forwards information to Apple." + remediation: "Run the following command in Terminal: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.auditd.plist" + compliance: + - cis: ["2.5.8"] + condition: all + rules: + - 'c:defaults read /Library/Application\ Support/CrashReporter/DiagnosticMessagesHistory.plist AutoSubmit -> 0' + + # not implemented - SCA Limit -> 2.5.9 Review Advertising settings (Manual) + + # 2.7.1 Time Machine Auto-Backup (Automated) + - id: 17028 + title: "Time Machine Auto-Backup" + description: "Backup solutions are only effective if the backups run on a regular basis. The time to check for backups is before the hard drive fails or the computer goes missing. In order to simplify the user experience so that backups are more likely to occur Time Machine should be on and set to Back Up Automatically whenever the target volume is available. Operational staff should ensure that backups complete on a regular basis and the backups are tested to ensure that file restoration from backup is possible when needed. Backup dates are available even when the target volume is not available in the Time Machine plist. When the backup volume is connected to the computer more extensive information is available through tmutil. See man tmutil" + rationale: "Backups should automatically run whenever the backup drive is available." + remediation: "Run the following enable TimeMachine: sudo sudo tmutil setdestination -a /Volumes/ && sudo tmutil enable" + compliance: + - cis: ["2.7.1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.TimeMachine.plist AutoBackup -> 1" + + # 2.8 Disable Wake for network access (Automated) + - id: 17030 + title: "Disable Wake for network access" + description: "This feature allows the computer to take action when the user is not present and the computer is in energy saving mode. These tools require FileVault to remain unlocked and fully rejoin known networks. Theie macOS feature is meant to allow the computer to resume activity as needed regardless of physical security controls. This feature allows other users to be able to access your computer’s shared resources, such as shared printers or iTunes playlists, even when your computer is in sleep mode. In a closed network when only authorized devices could wake a computer it could be valuable to wake computers in order to do management push activity. Where mobile workstations and agents exist the device will more likely check in to receive updates when already awake. Mobile devices should not be listening for signals on unmanaged network where untrusted devices could send wake signals." + rationale: "Disabling this feature mitigates the risk of an attacker remotely waking the system and gaining access." + remediation: "Run the following command to disable Wake for network access: sudo pmset -a womp 0 " + compliance: + - cis: ["2.8"] + condition: all + rules: + - 'c:pmset -g -> n:womp\s*\t*(\d) compare == 0' + + # 2.9 Disable Power Nap (Automated) + - id: 17031 + title: "Disable Power Nap" + description: "This features allows the computer to take action when the user is not present and the computer is in energy saving mode. These tools require FileVault to remain unlocked and fully rejoin known networks. This macOS features are meant to allow the computer to resume activity as needed regardless of physical security controls. Power Nap allows the system to stay in low power mode, especially while on battery power and periodically connect to previously named networks with stored credentials for user applications to phone home and get updates. This capability requires FileVault to remain unlocked and the use of previously joined networks to be risk accepted based on the SSID without user input." + rationale: "Disabling this feature mitigates the risk of an attacker remotely waking the system and gaining access." + remediation: "Run the following command to disable Power Nap: sudo pmset -a powernap 0" + compliance: + - cis: ["2.9"] + condition: all + rules: + - 'c:pmset -g -> n:pwernap\s*\t*(\d) compare == 0' + + # 2.10 Enable Secure Keyboard Entry in terminal.app (Automated) + - id: 17032 + title: "Enable Secure Keyboard Entry in terminal.app" + description: "Secure Keyboard Entry prevents other applications on the system and/or network from detecting and recording what is typed into Terminal." + rationale: "Enabling Secure Keyboard Entry minimizes the risk of a key logger from detecting what is entered in Terminal." + remediation: "Perform the following to implement the prescribed state: 1. Open Terminal 2. Select Terminal 3. Select Secure Keyboard Entry" + compliance: + - cis: ["2.10"] + condition: all + rules: + - "c:defaults read -app Terminal SecureKeyboardEntry -> 1" + # - 'c:sudo -u defaults read -app Terminal SecureKeyboardEntry -> 1' + + # 2.12 Ensure EFI version is valid and being regularly checked (Automated) + - id: 17033 + title: "Ensure EFI version is valid and being regularly checked" + description: "In order to mitigate firmware attacks Apple has created a automated Firmware check to ensure that the EFI version running is a known good version from Apple. There is also an automated process to check it every seven days." + rationale: "If the Firmware of a computer has been compromised the Operating System that the Firmware loads cannot be trusted either." + remediation: "If EFI does not pass the integrity check you may send a report to Apple. Backing up files and clean installing a known good Operating System and Firmware is recommended." + compliance: + - cis: ["2.12"] + condition: all + rules: + - "c:/usr/libexec/firmwarecheckers/eficheck/eficheck --integrity-check -> r:Primary allowlist version match found. No changes detected in primary hashes" + - 'c:launchctl list -> r:^-\s*\t*0\s*\t*com.apple.driver.eficheck$' + + # 3.1 Enable security auditing (Automated) + - id: 17034 + title: "Enable security auditing" + description: "macOS's audit facility, auditd, receives notifications from the kernel when certain system calls, such as open, fork, and exit, are made. These notifications are captured and written to an audit log." + rationale: "Logs generated by auditd may be useful when investigating a security incident as they may help reveal the vulnerable application and the actions taken by a malicious actor." + remediation: "Run the following command in Terminal: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.auditd.plist" + compliance: + - cis: ["3.1"] + condition: all + rules: + - "c:launchctl list -> r:com.apple.auditd" + + # 3.3 Retain install.log for 365 or more days with no maximum size (Automated) + - id: 17035 + title: "Retain install.log for 365 or more days with no maximum size" + description: "macOS writes information pertaining to system-related events to the file /var/log/install.log and has a configurable retention policy for this file. The default logging setting limits the file size of the logs and the maximum size for all logs. The default allows for an errant application to fill the log files and does not enforce sufficient log retention. The Benchmark recommends a value based on standard use cases. The value should align with local requirements within the organization." + rationale: "Archiving and retaining install.log for at least a year is beneficial in the event of an incident as it will allow the user to view the various changes to the system along with the date and time they occurred." + remediation: "Perform the following to ensure that install logs are retained for at least 365 days:Edit the /etc/asl/com.apple.install file and add or modify the ttl value to 365 or greater on the file line. Also, remove the all_max= setting and value from the file line." + compliance: + - cis: ["3.3"] + condition: all + rules: + - 'c:grep -i ttl /etc/asl/com.apple.install -> n:ttl\w+(\d+) compare > 365' + + # 3.5 Control access to audit records (Automated) + - id: 17037 + title: "Control access to audit records" + description: "The audit system on macOS writes important operational and security information that can be both useful for an attacker and a place for an attacker to attempt to obfuscate unwanted changes that were recorded. As part of defense-in-depth the /etc/security/audit_control configuration and the files in /var/audit should be owned only by root with group wheel with read only rights and no other access allowed. macOS ACLs should not be used for these files." + rationale: "Audit records should never be changed except by the system daemon posting events. Records may be viewed or extracts manipulated but the authoritative files should be protected from unauthorized changes." + remediation: "Run the following to commands to set the audit records to the root user and wheel group: sudo chown -R root:wheel /etc/security/audit_control && sudo chown -R root:wheel /var/audit/" + compliance: + - cis: ["3.5"] + condition: all + rules: + - 'c:ls -le /etc/security/audit_control -> r:root\s*\t*wheel|total' + - 'c:ls -le /var/audit/ -> r:root\s*\t*wheel|total' + + # 3.6 Ensure Firewall is configured to log (Automated) + - id: 17038 + title: "Ensure Firewall is configured to log" + description: "The socketfilter firewall is what is used when the firewall is turned on in the Security PreferencePane. In order to appropriately monitor what access is allowed and denied logging must be enabled." + rationale: "In order to troubleshoot the successes and failures of a firewall logging should be enabled." + remediation: "Run the following command to enable logging of the firewall: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setloggingmode on" + compliance: + - cis: ["3.6"] + condition: all + rules: + - "c:/usr/libexec/ApplicationFirewall/socketfilterfw --getloggingmode -> r:Log mode is on" + + # 4.1 Disable Bonjour advertising service (Automated) + - id: 17039 + title: "Disable Bonjour advertising service" + description: "Bonjour is an auto-discovery mechanism for TCP/IP devices which enumerate devices and services within a local subnet. DNS on macOS is integrated with Bonjour and should not be turned off, but the Bonjour advertising service can be disabled." + rationale: 'Bonjour can simplify device discovery from an internal rogue or compromised host. An attacker could use Bonjour''s multicast DNS feature to discover a vulnerable or poorly- configured service or additional information to aid a targeted attack. Implementing this control disables the continuous broadcasting of "I''m here!" messages. Typical end-user endpoints should not have to advertise services to other computers.. This setting does not stop the computer from sending out service discovery messages when looking for services on an internal subnet, if the computer is looking for a printer or server and using service discovery. To block all Bonjour traffic except to approved devices the pf or other firewall would be needed.' + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool true" + compliance: + - cis: ["4.1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -> 1" + + # 4.4 Ensure http server is not running (Automated) + - id: 17041 + title: "Ensure http server is not running" + description: "macOS used to have a graphical front-end to the embedded Apache web server in the Operating System. Personal web sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Personal web sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. Apache however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end user computer. Web sharing should only be done through hardened web servers and appropriate cloud services." + rationale: "Web serving should not be done from a user desktop. Dedicated webservers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." + remediation: "Ensure that the Web Server is not running and is not set to start at boot Stop the Web Server: sudo apachectl stop Ensure that the web server will not auto-start at boot sudo: defaults write /System/Library/LaunchDaemons/org.apache.httpd Disabled - bool true" + compliance: + - cis: ["4.4"] + condition: none + rules: + - "p:httpd" + - "p:/usr/sbin/httpd" + + # 4.5 Ensure nfs server is not running (Scored) + - id: 17042 + title: "Ensure nfs server is not running" + description: "macOS can act as an NFS fileserver. NFS sharing could be enabled to allow someone on another computer to mount shares and gain access to information from the user's computer. File sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. NFSD is still part of the Operating System and can be easily turned on to export shares and provide remote connectivity to an end user computer." + rationale: "File serving should not be done from a user desktop, dedicated servers should be used. Open ports make it easier to exploit the computer." + remediation: "Ensure that the NFS Server is not running and is not set to start at boot Stop the NFS Server: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.nfsd.plist Remove the exported Directory listing: sudo rm /etc/export" + compliance: + - cis: ["4.5"] + condition: none + rules: + - "p:nfsd" + - "p:/sbin/nfsd" + - "f:/etc/exports" + + # 5.1.2 Check System Wide Applications for appropriate permissions (Automated) + - id: 17044 + title: "Check System Wide Applications for appropriate permissions" + description: "Applications in the System Applications Directory (/Applications) should be world executable since that is their reason to be on the system. They should not be world writable and allow any process or user to alter them for other processes or users to then execute modified versions" + rationale: "Unauthorized modifications of applications could lead to the execution of malicious code." + remediation: "Run the following command to change the permissions for each application that does not meet the requirements: sudo chmod -R o-w /Applications/" + compliance: + - cis: ["5.1.2"] + condition: all + rules: + - 'c:find /Applications -iname "*.app" -type d -perm -2 -ls -> r:^$' + + # 5.1.3 Check System folder for world writable files (Automated) + - id: 17045 + title: "Check System folder for world writable files" + description: "Software sometimes insists on being installed in the /System Directory and have inappropriate world writable permissions." + rationale: 'Folders in /System should not be world writable. The audit check excludes the "Drop Box" folder that is part of Apple''s default user template.' + remediation: "Run the following command to set permissions so that folders are not world writable in the /System folder: sudo chmod -R o-w /Path/" + compliance: + - cis: ["5.1.3"] + condition: all + rules: + - "c:find /System -type d -perm -2 -ls -> r:^$|Public/Drop Box" + + # 5.1.4 Check Library folder for world writable files (Automated) + - id: 17046 + title: "Check Library folder for world writable files" + description: "Software sometimes insists on being installed in the /Library Directory and have inappropriate world writable permissions." + rationale: "Folders in /Library should not be world writable. The audit check excludes the /Library/Caches folder where the sticky bit is set." + remediation: "Run the following command to set permissions so that folders are not world writable in the /Library folder: sudo chmod -R o-w /Library/" + compliance: + - cis: ["5.1.4"] + condition: all + rules: + - "c:find /Library -type d -perm -2 -ls -> r:^$|Caches" + + # 5.3 Reduce the sudo timeout period (Automated) 17051 + - id: 17051 + title: "Reduce the sudo timeout period" + description: "The sudo command allows the user to run programs as the root user. Working as the root user allows the user an extremely high level of configurability within the system." + rationale: "The sudo command stays logged in as the root user for five minutes before timing out and re-requesting a password. This five minute window should be eliminated since it leaves the system extremely vulnerable. This is especially true if an exploit were to gain access to the system, since they would be able to make changes as a root user." + remediation: "Run the following command to edit the sudo settings: sudo visudo -> Add the line Defaults timestamp_timeout=0 in the Override built-in defaults section. " + compliance: + - cis: ["5.3"] + condition: all + rules: + - 'c:grep -e "timestamp" /etc/sudoers -> r:Defaults timestamp_timeout=0' + + # 5.5 Use a separate timestamp for each user/tty combo (Automated) + - id: 17052 + title: "Use a separate timestamp for each user/tty combo" + description: "Using tty tickets ensures that a user must enter the sudo password in each Terminal session. With sudo versions 1.8 and higher, introduced in 10.12, the default value is to have tty tickets for each interface so that root access is limited to a specific terminal. The default configuration can be overwritten or not configured correctly on earlier versions of macOS." + rationale: "In combination with removing the sudo timeout grace period a further mitigation should be in place to reduce the possibility of a background process using elevated rights when a user elevates to root in an explicit context or tty. Additional mitigation should be in place to reduce the risk of privilege escalation of background processes." + remediation: "Run the following command to edit the sudo settings: sudo visudo -> Add the line Defaults timestamp_timeout=0 in the Override built-in defaults section. " + compliance: + - cis: ["5.3"] + condition: all + rules: + - 'c:grep -E -s "!tty_tickets" /etc/sudoers /etc/sudoers.d/* -> r:^$' + - 'c:grep -E -s "timestamp_type" /etc/sudoers /etc/sudoers.d/* -> r:^$|!timestamp_type=ppid|!timestamp_type=global' + + # 5.7 Do not enable the "root" account (Automated) + - id: 17053 + title: 'Do not enable the "root" account' + description: "The root account is a superuser account that has access privileges to perform any actions and read/write to any file on the computer. With some Linux distros the system administrator may commonly uses the root account to perform administrative functions." + rationale: "Enabling and using the root account puts the system at risk since any successful exploit or mistake while the root account is in use could have unlimited access privileges within the system. Using the sudo command allows users to perform functions as a root user while limiting and password protecting the access privileges. By default the root account is not enabled on a macOS computer. An administrator can escalate privileges using the sudo command (use -s or -i to get a root shell)." + remediation: "Open System Preferences, Uses & Groups. Click the lock icon to unlock it. In the Network Account Server section, click Join or Edit. Click Open Directory Utility. Click the lock icon to unlock it. Select the Edit menu > Disable Root User." + compliance: + - cis: ["5.7"] + condition: all + rules: + - "c:dscl . -read /Users/root AuthenticationAuthority -> r:^No such key: AuthenticationAuthority" + + # 5.8 Disable automatic login (Automated) + - id: 17054 + title: "Disable automatic login" + description: "The automatic login feature saves a user's system access credentials and bypasses the login screen, instead the system automatically loads to the user's desktop screen." + rationale: "Disabling automatic login decreases the likelihood of an unauthorized person gaining access to a system." + remediation: "Run the following command in Terminal: sudo defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser" + compliance: + - cis: ["5.8"] + condition: none + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow -> r:autoLoginUser" + + # 5.13 Create a custom message for the Login Screen (Automated) 17058 + - id: 17058 + title: "Create a custom message for the Login Screen" + description: "An access warning informs the user that the system is reserved for authorized use only, and that the use of the system may be monitored." + rationale: "An access warning may reduce a casual attacker's tendency to target the system. Access warnings may also aid in the prosecution of an attacker by evincing the attacker's knowledge of the system's private status, acceptable use policy, and authorization requirements." + remediation: 'Run the following command to enable a custom login screen message: sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText ""' + compliance: + - cis: ["5.13"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow.plist LoginwindowText -> !r:does not exist" + + # 5.14 Create a Login window banner (Automated) 17059 + - id: 17059 + title: "Create a Login window banner" + description: "A Login window banner warning informs the user that the system is reserved for authorized use only. It enforces an acknowledgment by the user that they have been informed of the use policy in the banner if required. The system recognizes either the .txt and the .rtf formats." + rationale: "An access warning may reduce a casual attacker's tendency to target the system. Access warnings may also aid in the prosecution of an attacker by evincing the attacker's knowledge of the system's private status, acceptable use policy, and authorization requirements." + remediation: "Edit (or create) a PolicyBanner.txt or PolicyBanner.rtf file, in the /Library/Security/ folder, to include the required login window banner text." + compliance: + - cis: ["5.14"] + condition: all + rules: + - "d:/Library/Security -> r:^PolicyBanner" + + # not implemented - SCA Limit -> 5.15 Do not enter a password-related hint (Automated) + + # 5.16 Disable Fast User Switching (Manual) + - id: 17070 + title: "Disable Fast User Switching" + description: "Fast user switching allows a person to quickly log in to the computer with a different account. While only a minimal security risk, when a second user is logged in, that user might be able to see what processes the first user is using, or possibly gain other information about the first user. In a large directory environment where it is difficult to limit login access many valid users can login to other user's assigned computers." + rationale: "Fast user switching allows multiple users to run applications simultaneously at console. There can be information disclosed about processes running under a different user. Without a specific configuration to save data and log out users can have unsaved data running in a background session that is not obvious." + remediation: "Run the following command to turn fast user switching off: sudo defaults write /Library/Preferences/.GlobalPreferences MultipleSessionEnabled -bool false" + compliance: + - cis: ["5.16"] + condition: any + rules: + - "c:defaults read /Library/Preferences/.GlobalPreferences.plist MultipleSessionEnabled -> r:does not exist" + - "c:defaults read /Library/Preferences/.GlobalPreferences.plist MultipleSessionEnabled -> 0" + + # not implemented - process - 5.17 Secure individual keychains and items (Manual) + # not implemented - process - 5.18 Create specialized keychains for different purposes (Manual) + + # 5.19 System Integrity Protection status (Automated) + - id: 17061 + title: "System Integrity Protection status" + description: "System Integrity Protection is a security feature introduced in OS X 10.11 El Capitan. System Integrity Protection restricts access to System domain locations and restricts runtime attachment to system processes. Any attempt to attempt to inspect or attach to a system process will fail. Kernel Extensions are now restricted to /Library/Extensions and are required to be signed with a Developer ID." + rationale: "Running without System Integrity Protection on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by SIP." + remediation: "Perform the following while booted in macOS Recovery Partition. 1. Select Terminal from the Utilities menu 2. Run the following command in Terminal: /usr/bin/csrutil enable 3. The output should be: Successfully enabled System Integrity Protection. Please restart the machine for the changes to take effect. 4. Reboot." + compliance: + - cis: ["5.19"] + condition: all + rules: + - "c:/usr/bin/csrutil status -> r:^System Integrity Protection status: enabled" + + # 6.1.1 Display login window as name and password (Automated) 17062 + - id: 17062 + title: "Display login window as name and password" + description: "The login window prompts a user for his/her credentials, verifies their authorization level and then allows or denies the user access to the system." + rationale: "Prompting the user to enter both their username and password makes it twice as hard for unauthorized users to gain access to the system since they must discover two attributes." + remediation: "Run the following command to enable the login window to display name and password: sudo defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool true" + compliance: + - cis: ["6.1.1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -> 1" + + # jal + # 6.1.2 Disable "Show password hints" (Automated) 17063 + - id: 17063 + title: 'Disable "Show password hints"' + description: "Password hints are user created text displayed when an incorrect password is used for an account." + rationale: "Password hints make it easier for unauthorized persons to gain access to systems by providing information to anyone that the user provided to assist remembering the password. This info could include the password itself or other information that might be readily discerned with basic knowledge of the end user." + remediation: "Run the following command to disable password hints: sudo defaults write /Library/Preferences/com.apple.loginwindow RetriesUntilHint -int 0" + compliance: + - cis: ["6.1.2"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow RetriesUntilHint -> 0" + - "c:defaults read /Library/Preferences/com.apple.loginwindow RetriesUntilHint -> r:does not exist" + + # 6.1.3 Disable guest account login (Automated) + - id: 17064 + title: "Disable guest account login" + description: "The guest account allows users access to the system without having to create an account or password. Guest users are unable to make setting changes, cannot remotely login to the system and all created files, caches, and passwords are deleted upon logging out." + rationale: "Disabling the guest account mitigates the risk of an untrusted user doing basic reconnaissance and possibly using privilege escalation attacks to take control of the system." + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled - bool false" + compliance: + - cis: ["6.1.3"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow.plist GuestEnabled -> 0" + + # 6.1.4 Disable "Allow guests to connect to shared folders" (Automated) 17065 + - id: 17065 + title: 'Disable "Allow guests to connect to shared folders"' + description: "Allowing guests to connect to shared folders enables users to access selected shared folders and their contents from different computers on a network." + rationale: "Not allowing guests to connect to shared folders mitigates the risk of an untrusted user doing basic reconnaissance and possibly use privilege escalation attacks to take control of the system." + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled - bool false" + compliance: + - cis: ["6.1.4"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.AppleFileServer guestAccess -> 0" + - "c:defaults read /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -> 0" + - "c:defaults read /Library/Preferences/com.apple.AppleFileServer guestAccess -> r:does not exist" + - "c:defaults read /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -> r:does not exist" + + # 6.1.5 Remove Guest home folder (Automated) + - id: 17066 + title: "Remove Guest home folder" + description: "In the previous two controls the guest account login has been disabled and sharing to guests has been disabled as well. There is no need for the legacy Guest home folder to remain in the file system. When normal user accounts are removed you have the option to archive it, leave it in place or delete. In the case of the guest folder the folder remains in place without a GUI option to remove it. If at some point in the future a Guest account is needed it will be re-created. The presence of the Guest home folder can cause automated audits to fail when looking for compliant settings within all User folders as well. Rather than ignoring the folders continued existence it is best removed." + rationale: "The Guest home folders are unneeded after the Guest account is disabled and could be used inappropriately." + remediation: "1. Run the following command in Terminal: sudo rm -R /Users/Guest 2. Make sure there is no output" + compliance: + - cis: ["6.1.5"] + condition: none + rules: + - "d:/Users/Guest" + + # 6.2 Turn on filename extensions (Automated) + - id: 17067 + title: "Turn on filename extensions" + description: "A filename extension is a suffix added to a base filename that indicates the base filename's file format." + rationale: "Visible filename extensions allows the user to identify the file type and the application it is associated with which leads to quick identification of misrepresented malicious files." + remediation: "Perform the following to implement the prescribed state: 1. Select Finder 2. Select Preferences 3. Check Show all filename extensions Alternatively, use the following command: defaults write NSGlobalDomain AppleShowAllExtensions -bool true" + compliance: + - cis: ["6.2"] + condition: all + rules: + - "c:defaults read NSGlobalDomain AppleShowAllExtensions -> 1" + # - 'c:defaults read /Users//Library/Preferences/.GlobalPreferences.plist AppleShowAllExtensions -> 1' + + # 6.3 Disable the automatic run of safe files in Safari (Automated) + - id: 17068 + title: "Disable the automatic run of safe files in Safari" + description: "Safari will automatically run or execute what it considers safe files. This can include installers and other files that execute on the operating system. Safari bases file safety by using a list of filetypes maintained by Apple. The list of files include text, image, video and archive formats that would be run in the context of the OS rather than the browser." + rationale: "Hackers have taken advantage of this setting via drive-by attacks. These attacks occur when a user visits a legitimate website that has been corrupted. The user unknowingly downloads a malicious file either by closing an infected pop-up or hovering over a malicious banner. An attacker can create a malicious file that will fall within Safari's safe file list that will download and execute without user input." + remediation: 'Perform the following to implement the prescribed state: 1. Open Safari 2. Select Safari from the menu bar 3. Select Preferences 4. Select General 5. Uncheck Open "safe" files after downloading Alternatively run the following command in Terminal: defaults write com.apple.Safari AutoOpenSafeDownloads -boolean no' + compliance: + - cis: ["6.3"] + condition: all + rules: + - "c:defaults read com.apple.Safari AutoOpenSafeDownloads -> 0" diff --git a/etc/ruleset/sca/darwin/19/cis_apple_macOS_10.15.yml b/etc/ruleset/sca/darwin/19/cis_apple_macOS_10.15.yml new file mode 100644 index 0000000000..6cfa250072 --- /dev/null +++ b/etc/ruleset/sca/darwin/19/cis_apple_macOS_10.15.yml @@ -0,0 +1,821 @@ +# Security Configuration Assessment +# CIS Checks for macOS 10.15 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Apple macOS 10.15 Benchmark v1.1.0 - 11-10-2020 + +policy: + id: "cis_apple_macos_10_15" + file: "cis_apple_macOS_10.15.yml" + name: "CIS Apple macOS 10.15 Benchmark v1.1.0" + description: "This document, CIS Apple macOS 10.15 Benchmark, provides prescriptive guidance for establishing a secure configuration posture for Apple macOS 10.15. This guide was tested against Apple macOS 10.15." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check macOS version" + description: "Requirements for running the SCA scan against macOS 10.15 (Catalina)." + condition: any + rules: + - 'c:sw_vers -> r:^ProductVersion:\t*\s*10\p15' + - 'c:system_profiler SPSoftwareDataType -> r:System Version:\.*10\p15' + - 'c:defaults read loginwindow SystemVersionStampAsString -> r:^\t*\s*10\p15' + +checks: + # 1.1 Verify all Apple provided software is current (Automated) + - id: 17500 + title: "Verify all Apple provided software is current" + description: "Software vendors release security patches and software updates for their products when security vulnerabilities are discovered. There is no simple way to complete this action without a network connection to an Apple software repository. Please ensure appropriate access for this control. This check is only for what Apple provides through software update." + rationale: "It is important that these updates be applied in a timely manner to prevent unauthorized persons from exploiting the identified vulnerabilities." + remediation: "1. In Terminal, run the following: softwareupdate -l 2. In Terminal, run the following for any packages that show up in step 1: sudo softwareupdate -i packagename" + compliance: + - cis: ["1.1"] + condition: all + rules: + - "c:softwareupdate -l -> r:No new software available" + + # 1.2 Enable Auto Update (Automated) + - id: 17501 + title: "Enable Auto Update" + description: 'Auto Update verifies that your system has the newest security patches and software updates. If "Automatically check for updates" is not selected background updates for new malware definition files from Apple for XProtect and Gatekeeper will not occur.' + rationale: "It is important that a system has the newest updates applied so as to prevent unauthorized persons from exploiting identified vulnerabilities." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true" + compliance: + - cis: ["1.2"] + references: + - https://macops.ca/os-x-admins-your-clients-are-not-getting-background-security-updates/ + - https://derflounder.wordpress.com/2014/12/17/forcing-xprotect-blacklist-updates-on-mavericks-and-yosemite/ + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -> 1" + + # 1.3 Enable Download new updates when available (Automated) + - id: 17502 + title: "Enable Download new updates when available" + description: 'In the GUI both "Install macOS updates" and "Install app updates from the App Store" are dependent on whether "Download new updates when available" is selected' + rationale: "It is important that a system has the newest updates downloaded so that they can be applied." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true" + compliance: + - cis: ["1.3"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -> 1" + + # 1.4 Enable app update installs (Automated) + - id: 17503 + title: "Enable app update installs" + description: "Ensure that application updates are installed after they are available from Apple. These updates do not require reboots or admin privileges for end users." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate - bool TRUE" + compliance: + - cis: ["1.4"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> 1" + + # 1.5 Enable system data files and security update installs (Automated) + - id: 17504 + title: "Enable system data files and security update installs" + description: "Ensure that system and security updates are installed after they are available from Apple. This setting enables definition updates for XProtect and Gatekeeper, with this setting in place new malware and adware that Apple has added to the list of malware or untrusted software will not execute. These updates do not require reboots or end user admin rights." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable install system data files and security updates: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true && sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true" + compliance: + - cis: ["1.5"] + references: + - https://www.thesafemac.com/tag/xprotect/ + - https://support.apple.com/en-us/HT202491 + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -> 1" + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -> 1" + + # 1.6 Enable macOS update installs (Automated) + - id: 17505 + title: "Enable macOS update installs" + description: "Ensure that macOS updates are installed after they are available from Apple. This setting enables macOS updates to be automatically installed. Some environments will want to approve and test updates before they are delivered. It is best practice to test first where updates can and have caused disruptions to operations. Automatic updates should be turned off where changes are tightly controlled and there are mature testing and approval processes. Automatic updates should not be turned off so the admin can call the users first to let them know it's ok to install. A dependable repeatable process involving a patch agent or remote management tool should be in place before auto-updates are turned off." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable install system data files and security updates: sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate - bool TRUE" + compliance: + - cis: ["1.6"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> 1" + + # 2.1.1 Turn off Bluetooth, if no paired devices exist (Automated) + - id: 17506 + title: "Turn off Bluetooth, if no paired devices exist" + description: "Bluetooth devices use a wireless communications system that replaces the cables used by other peripherals to connect to a system. It is by design a peer-to-peer network technology and typically lacks centralized administration and security enforcement infrastructure." + rationale: "Bluetooth is particularly susceptible to a diverse set of security vulnerabilities involving identity detection, location tracking, denial of service, unintended control and access of data and voice channels, and unauthorized device control and data access." + remediation: "Open a terminal session and enter the following command to disable bluetooth: sudo defaults write /Library/Preferences/com.apple.Bluetooth ControllerPowerState -int 0 && sudo killall -HUP blued" + compliance: + - cis: ["2.1.1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.Bluetooth ControllerPowerState -> 0" + - "c:system_profiler SPBluetoothDataType -> r:Connectable: Yes" + + # not implemented - SCA Limit -> 2.1.2 Show Bluetooth status in menu bar (Automated) + + # 2.2.1 Enable "Set time and date automatically" (Automated) + - id: 17508 + title: 'Enable "Set time and date automatically"' + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features." + remediation: "Run the following commands: sudo systemsetup -setnetworktimeserver sudo systemsetup -setusingnetworktime on" + compliance: + - cis: ["2.2.1"] + condition: all + rules: + - 'c:systemsetup -getusingnetworktime -> r:Network Time:\s*\t*On' + + # 2.2.2 Ensure time set is within appropriate limits (Automated) + - id: 17509 + title: "Ensure time set is within appropriate limits" + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries. Ensure that time on the computer is within acceptable limits. Truly accurate time is measured within milliseconds, for this audit a drift under four and a half minutes passes the control check. Since Kerberos is one of the important features of macOS integration into Directory systems the guidance here is to warn you before there could be an impact to operations. From the perspective of accurate time this check is not strict, it may be too great for your organization, adjust to a smaller offset value as needed. Note: ntpdate has been deprecated with 10.14. sntp replaces that command." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features. Audit check is for more than 4 minutes and 30 seconds ahead or behind." + remediation: "Run the following commands to ensure your time is set within an appropriate limit: sudo systemsetup -getnetworktimeserver -> Get the time server name and then run: sudo touch /var/db/ntp-kod && sudo chown root:wheel /var/db/ntp-kod && sudo sntp -sS " + compliance: + - cis: ["2.2.2"] + condition: all + rules: + - "c:systemsetup -getnetworktimeserver -> r:Network Time Server:" + #- Pending check offset is in the 270.x seconds + + # 2.3.1 Set an inactivity interval of 20 minutes or less for the screen saver (Automated) + - id: 17510 + title: "Set an inactivity interval of 20 minutes or less for the screen saver" + description: "A locking screensaver is one of the standard security controls to limit access to a computer and the current user's session when the computer is temporarily unused or unattended. In macOS the screensaver starts after a value selected in a drop down menu, 10 minutes and 20 minutes are both options and either is acceptable. Any value can be selected through the command line or script but a number that is not reflected in the GUI can be problematic. 20 minutes is the default for new accounts." + rationale: "Setting an inactivity interval for the screensaver prevents unauthorized persons from viewing a system left unattended for an extensive period of time." + remediation: "Run the following command to verify that the idle time of the screen saver to 20 minutes or less (≤1200): sudo defaults -currentHost write com.apple.screensaver idleTime -int 600 " + compliance: + - cis: ["2.3.1"] + condition: all + rules: + - "c:defaults -currentHost read com.apple.screensaver idleTime -> !r:does not exist" + + # 2.3.2 Secure screen saver corners (Automated) + - id: 17511 + title: "Secure screen saver corners" + description: "Hot Corners can be configured to disable the screen saver by moving the mouse cursor to a corner of the screen." + rationale: "Setting a hot corner to disable the screen saver poses a potential security risk since an unauthorized person could use this to bypass the login screen and gain access to the system." + remediation: "Run the following command to turn off Disable Screen Saver for a Hot Corner: sudo -u defaults write com.apple.dock -int 0 " + compliance: + - cis: ["2.3.2"] + condition: all + rules: + - "c:defaults read com.apple.dock wvous-tl-corner -> !r:^6$" + - "c:defaults read com.apple.dock wvous-nl-corner -> !r:^6$" + - "c:defaults read com.apple.dock wvous-tr-corner -> !r:^6$" + - "c:defaults read com.apple.dock wvous-br-corner -> !r:^6$" + + # not implemented - process -> 2.3.3 Familiarize users with screen lock tools or corner to Start Screen Saver (Manual) + + # 2.4.1 Disable Remote Apple Events (Automated) + - id: 17512 + title: "Disable Remote Apple Events" + description: "Apple Events is a technology that allows one program to communicate with other programs. Remote Apple Events allows a program on one computer to communicate with a program on a different computer." + rationale: "Disabling Remote Apple Events mitigates the risk of an unauthorized program gaining access to the system." + remediation: "Run the following command in Terminal: sudo systemsetup -setremoteappleevents off" + compliance: + - cis: ["2.4.1"] + condition: all + rules: + - 'c:systemsetup -getremoteappleevents -> r:Remote Apple Events:\s*\t*Off' + + # 2.4.2 Disable Internet Sharing (Automated) + - id: 17513 + title: "Disable Internet Sharing" + description: "Internet Sharing uses the open source natd process to share an internet connection with other computers and devices on a local network. This allows the Mac to function as a router and share the connection to other, possibly unauthorized, devices." + rationale: "Disabling Internet Sharing reduces the remote attack surface of the system." + remediation: "Run the following command to turn off Internet Sharing: sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict Enabled -int 0" + compliance: + - cis: ["2.4.2"] + condition: all + rules: + - 'c:defaults read /Library/Preferences/SystemConfiguration/com.apple.nat -> r:Enabled\s*\t*=\s*\t*1' + + # 2.4.3 Disable Screen Sharing (Automated) + - id: 17514 + title: "Disable Screen Sharing" + description: "Screen sharing allows a computer to connect to another computer on a network and display the computer’s screen. While sharing the computer’s screen, the user can control what happens on that computer, such as opening documents or applications, opening, moving, or closing windows, and even shutting down the computer." + rationale: "Disabling screen sharing mitigates the risk of remote connections being made without the user of the console knowing that they are sharing the computer." + remediation: "Run the following command to turn off Screen Sharing: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.screensharing.plist" + compliance: + - cis: ["2.4.3"] + condition: all + rules: + - "c:launchctl load /System/Library/LaunchDaemons/com.apple.screensharing.plist -> r:Service is disabled" + + # 2.4.4 Disable Printer Sharing (Automated) + - id: 17515 + title: "Disable Printer Sharing" + description: "By enabling Printer sharing the computer is set up as a print server to accept print jobs from other computers. Dedicated print servers or direct IP printing should be used instead." + rationale: "Disabling Printer Sharing mitigates the risk of attackers attempting to exploit the print server to gain access to the system." + remediation: "Run the following command in Terminal: sudo cupsctl --no-share-printers" + compliance: + - cis: ["2.4.4"] + references: + - https://support.apple.com/kb/PH11450 + condition: all + rules: + - 'c:system_profiler SPPrintersDataType | grep -e Sharing -> r:System Printer Sharing:\s*\t*Yes' + + # 2.4.5 Disable Remote Login (Automated) + - id: 17516 + title: "Disable Remote Login" + description: "Remote Login allows an interactive terminal connection to a computer." + rationale: "Disabling Remote Login mitigates the risk of an unauthorized person gaining access to the system via Secure Shell (SSH). While SSH is an industry standard to connect to posix servers, the scope of the benchmark is for Apple macOS clients, not servers. macOS does have an IP based firewall available (pf, ipfw has been deprecated) that is not enabled or configured. There are more details and links in section 7.5. macOS no longer has TCP Wrappers support built-in and does not have strong Brute-Force password guessing mitigations, or frequent patching of openssh by Apple. Most macOS computers are mobile workstations, managing IP based firewall rules on mobile devices can be very resource intensive. All of these factors can be parts of running a hardened SSH server." + remediation: "Run the following command in Terminal: sudo systemsetup -setremotelogin off" + compliance: + - cis: ["2.4.5"] + condition: all + rules: + - 'c:systemsetup -getremotelogin -> r:Remote Login:\s*\t*Off' + + # 2.4.6 Disable DVD or CD Sharing (Automated) + - id: 17517 + title: "Disable DVD or CD Sharing" + description: "DVD or CD Sharing allows users to remotely access the system's optical drive." + rationale: "Disabling DVD or CD Sharing minimizes the risk of an attacker using the optical drive as a vector for attack and exposure of sensitive data." + remediation: "Run the following command to disable DVD or CD sharing: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.ODSAgent.plist" + compliance: + - cis: ["2.4.6"] + condition: all + rules: + - "c:launchctl list -> r:ODSAgent" + + # 2.4.7 Disable Bluetooth Sharing (Automated) + - id: 17518 + title: "Disable Bluetooth Sharing " + description: "Bluetooth Sharing allows files to be exchanged with Bluetooth enabled devices." + rationale: "Disabling Bluetooth Sharing minimizes the risk of an attacker using Bluetooth to remotely attack the system." + remediation: "Perform the following to disable Bluetooth Sharing: Graphical Method: 1. Open System Preferences 2. Select Sharing 3. Uncheck Bluetooth Sharing" + compliance: + - cis: ["2.4.7"] + condition: all + rules: + - 'c:system_profiler SPBluetoothDataType -> !r:State:\s*\t*Enabled' + + # 2.4.8 Disable File Sharing (Automated) + - id: 17519 + title: "Disable File Sharing" + description: "Apple's File Sharing uses a combination of SMB (Windows sharing) and AFP (Mac sharing)" + rationale: "By disabling file sharing, the remote attack surface and risk of unauthorized access to files stored on the system is reduced." + remediation: "Run the following command in Terminal to turn off AFP and SMB file sharing from the command line: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist && sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.smbd.plist" + compliance: + - cis: ["2.4.8"] + condition: none + rules: + - "c:launchctl list -> r:AppleFileServer" + - 'f:/Library/Preferences/SystemConfiguration/com.apple.smb.server.plist -> r:\ r:\s*\t*com.apple.smbd' + + # 2.4.9 Disable Remote Management (Automated) + - id: 17520 + title: "Disable Remote Management" + description: "Remote Management is the client portion of Apple Remote Desktop (ARD). Remote Management can be used by remote administrators to view the current Screen, install software, report on, and generally manage client Macs. The screen sharing options in Remote Management are identical to those in the Screen Sharing section. In fact, only one of the two can be configured. If Remote Management is used, refer to the Screen Sharing section above on issues regard screen sharing. Remote Management should only be enabled when a Directory is in place to manage the accounts with access. Computers will be available on port 5900 on a macOS System and could accept connections from untrusted hosts depending on the configuration, definitely a concern for mobile systems." + rationale: "Remote management should only be enabled on trusted networks with strong user controls present in a Directory system. Mobile devices without strict controls are vulnerable to exploit and monitoring." + remediation: "Run the following command to disable remote management: sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources /kickstart -deactivate -stop" + compliance: + - cis: ["2.4.9"] + condition: all + rules: + - "not p:ARDAgent" + + # 2.4.10 Disable Content Caching (Automated) + - id: 17521 + title: "Disable Content Caching" + description: "Starting with 10.13 (macOS High Sierra) Apple introduced a service to make it easier deploy data from Apple, including software updates, where there are bandwidth constraints to the Internet and fewer constraints and greater bandwidth on the local subnet. This capability can be very valuable for organizations that have throttled and possibly metered Internet connections. In heterogeneous enterprise networks with multiple subnets the effectiveness of this capability would be determined on how many Macs were on each subnet at the time new large updates were made available upstream. This capability requires the use of mac OS clients as P2P nodes for updated Apple content. Unless there is a business requirement to manage operational Internet connectivity bandwidth user endpoints should not store content and act as a cluster to provision data." + rationale: "The main use case for Mac computers is as mobile user endpoints. P2P sharing services should not be enabled on laptops that are using untrusted networks. Content Caching can allow a computer to be a server for local nodes on an untrusted network. While there are certainly logical controls that could be used to mitigate risk they add to the management complexity, since the value of the service is in specific use cases organizations with the use case described above can accept risk as necessary." + remediation: "Run the following command in to disable content caching: sudo AssetCacheManagerUtil deactivate" + compliance: + - cis: ["2.4.10"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.AssetCache.plist Activated -> 0" + + # 2.4.11 Disable Media Sharing (Automated) + - id: 17522 + title: "Disable Media Sharing" + description: "Starting with macOS 10.15 Apple has provided a control to allow a user to share Apple downloaded content on all Apple devices that are signed in with the same Apple ID. This allows a user to share downloaded Movies, Music or TV shows with other controlled macOS, iOS and iPadOS devices as well as photos with Apple TVs. With this capability guest users can also use media downloaded on the computer. Best practice is not to use the computer as a server but to utilize Apple's cloud storage to download and use content stored there if content stored with Apple is used on multiple devices." + rationale: "Disabling Media Sharing reduces the remote attack surface of the system." + remediation: "Run the following command in to disable content caching: sudo AssetCacheManagerUtil deactivate" + compliance: + - cis: ["2.4.11"] + references: + - https://support.apple.com/guide/mac-help/set-up-media-sharing-on-mac-mchlp13371337/mac + condition: all + rules: + - "c:defaults read com.apple.amp.mediasharingd home-sharing-enabled -> 0" + + # 2.5.1.1 Enable FileVault (Automated) + - id: 17523 + title: "Enable FileVault" + description: "FileVault secures a system's data by automatically encrypting its boot volume and requiring a password or recovery key to access it. Filevault may also be enabled using command line using the fdesetup command. To use this functionality, consult the Der Flounder blog for more details: " + rationale: "Encrypting sensitive data minimizes the likelihood of unauthorized users gaining access to it." + remediation: "1. Open System Preferences 2. Select Security & Privacy 3. Select FileVault 4. Select Turn on FileVault" + compliance: + - cis: ["2.5.1.1"] + references: + - https://derflounder.wordpress.com/2015/02/02/managing-yosemites-filevault-2-with-fdesetup/ + - https://derflounder.wordpress.com/2019/01/15/unlock-or-decrypt-your-filevault-encrypted-boot-drive-from-the-command-line-on-macos-mojave/ + condition: all + rules: + - 'c:fdesetup status -> r:^FileVault\s*\t*is\s*\t*On$' + + # not implemented - SCA Limit -> 2.5.1.2 Ensure all user storage APFS volumes are encrypted (Manual) + # not implemented - SCA Limit -> 2.5.1.3 Ensure all user storage CoreStorage volumes are encrypted (Manual) + + # 2.5.2 Enable Gatekeeper (Automated) + - id: 17524 + title: "Enable Gatekeeper" + description: "Gatekeeper is Apple's application white-listing control that restricts downloaded applications from launching. It functions as a control to limit applications from unverified sources from running without authorization." + rationale: "Disallowing unsigned software will reduce the risk of unauthorized or malicious applications from running on the system." + remediation: "Run the following command in Terminal: sudo spctl --master-enable" + compliance: + - cis: ["2.5.2"] + condition: all + rules: + - 'c:spctl --status -> r:^assessments\s*\t*enabled$' + + # 2.5.3 Enable Firewall (Automated) + - id: 17525 + title: "Enable Firewall" + description: "A firewall is a piece of software that blocks unwanted incoming connections to a system. Apple has posted general documentation about the application firewall." + rationale: "A firewall minimizes the threat of unauthorized users from gaining access to your system while connected to a network or the Internet." + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.alf globalstate - int Where is: - 1 = on for specific services - 2 = on for essential services " + compliance: + - cis: ["2.5.3"] + references: + - https://support.apple.com/en-us/HT201642 + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.alf globalstate -> r:^1$|^2$" + + # + # 2.5.4 Enable Firewall Stealth Mode (Automated) + - id: 17526 + title: "Enable Firewall Stealth Mode" + description: "While in Stealth mode the computer will not respond to unsolicited probes, dropping that traffic." + rationale: "Stealth mode on the firewall minimizes the threat of system discovery tools while connected to a network or the Internet." + remediation: "Run the following command in Terminal: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on" + compliance: + - cis: ["2.5.4"] + references: + - https://support.apple.com/en-us/HT201642 + condition: all + rules: + - "c:/usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode -> r:^Stealth mode enabled" + + # not implemented - process -> 2.5.5 Review Application Firewall Rules (Manual) + + # + # 2.5.6 Enable Location Services (Automated) + - id: 17527 + title: "Enable Location Services" + description: "macOS uses location information gathered through local Wi-Fi networks to enable applications to supply relevant information to users. Users do not need to change the time or the time zone, the computer will do it for them. They do not need to specify their location for weather or travel times and even get alerts on travel times to meetings and appointment where location information is supplied. For the purpose of asset management and time and log management with mobile computers location services simplify some processes.There are some use cases where it is important that the computer not be able to report it's exact location. While the general use case is to enable Location Services, it should not be allowed if the physical location of the computer and the user should not be public knowledge." + rationale: "Location services are helpful in most use cases and can simplify log and time management where computers change time zones." + remediation: "Run the following command to enable location services: sudo launchctl load /System/Library/LaunchDaemons/com.apple.locationd.plist" + compliance: + - cis: ["2.5.6"] + references: + - https://support.apple.com/en-us/HT204690 + condition: all + rules: + - "c:launchctl load /System/Library/LaunchDaemons/com.apple.locationd.plist -> r:service already loaded" + + # not implemented - process -> 2.5.7 Monitor Location Services Access (Manual) + + # 2.5.8 Disable sending diagnostic and usage data to Apple (Automated) + - id: 17528 + title: "Disable sending diagnostic and usage data to Apple" + description: "Apple provides a mechanism to send diagnostic and analytics data back to Apple to help them improve the platform. Information sent to Apple may contain internal organizational information that should be controlled and not available for processing by Apple. Turn off all Analytics and Improvements sharing." + rationale: "Organizations should have knowledge of what is shared with the vendor and the setting automatically forwards information to Apple." + remediation: "Run the following command in Terminal: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.auditd.plist" + compliance: + - cis: ["2.5.8"] + condition: all + rules: + - 'c:defaults read /Library/Application\ Support/CrashReporter/DiagnosticMessagesHistory.plist AutoSubmit -> 0' + + # not implemented - SCA Limit -> 2.5.9 Review Advertising settings (Manual) + # not implemented - process -> 2.6.1 iCloud configuration (Manual) + # not implemented - process -> 2.6.2 iCloud keychain (Manual) + # not implemented - process -> 2.6.3 iCloud Drive (Manual) + # not implemented - process -> 2.6.4 iCloud Drive Document and Desktop sync (Manual) + + # 2.7.1 Time Machine Auto-Backup (Automated) + - id: 17530 + title: "Time Machine Auto-Backup" + description: "Backup solutions are only effective if the backups run on a regular basis. The time to check for backups is before the hard drive fails or the computer goes missing. In order to simplify the user experience so that backups are more likely to occur Time Machine should be on and set to Back Up Automatically whenever the target volume is available. Operational staff should ensure that backups complete on a regular basis and the backups are tested to ensure that file restoration from backup is possible when needed. Backup dates are available even when the target volume is not available in the Time Machine plist. When the backup volume is connected to the computer more extensive information is available through tmutil. See man tmutil" + rationale: "Backups should automatically run whenever the backup drive is available." + remediation: "Run the following enable TimeMachine: sudo sudo tmutil setdestination -a /Volumes/ && sudo tmutil enable" + compliance: + - cis: ["2.7.1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.TimeMachine.plist AutoBackup -> 1" + + # not implemented - SCA Limit -> 2.7.2 Time Machine Volumes Are Encrypted (Automated) + + # 2.8 Disable Wake for network access (Automated) + - id: 17531 + title: "Disable Wake for network access" + description: "This feature allows the computer to take action when the user is not present and the computer is in energy saving mode. These tools require FileVault to remain unlocked and fully rejoin known networks. Theie macOS feature is meant to allow the computer to resume activity as needed regardless of physical security controls. This feature allows other users to be able to access your computer’s shared resources, such as shared printers or iTunes playlists, even when your computer is in sleep mode. In a closed network when only authorized devices could wake a computer it could be valuable to wake computers in order to do management push activity. Where mobile workstations and agents exist the device will more likely check in to receive updates when already awake. Mobile devices should not be listening for signals on unmanaged network where untrusted devices could send wake signals." + rationale: "Disabling this feature mitigates the risk of an attacker remotely waking the system and gaining access." + remediation: "Run the following command to disable Wake for network access: sudo pmset -a womp 0 " + compliance: + - cis: ["2.8"] + condition: all + rules: + - 'c:pmset -g -> n:womp\s*\t*(\d) compare == 0' + + # 2.9 Disable Power Nap (Automated) + - id: 17532 + title: "Disable Power Nap" + description: "This features allows the computer to take action when the user is not present and the computer is in energy saving mode. These tools require FileVault to remain unlocked and fully rejoin known networks. This macOS features are meant to allow the computer to resume activity as needed regardless of physical security controls. Power Nap allows the system to stay in low power mode, especially while on battery power and periodically connect to previously named networks with stored credentials for user applications to phone home and get updates. This capability requires FileVault to remain unlocked and the use of previously joined networks to be risk accepted based on the SSID without user input." + rationale: "Disabling this feature mitigates the risk of an attacker remotely waking the system and gaining access." + remediation: "Run the following command to disable Power Nap: sudo pmset -a powernap 0" + compliance: + - cis: ["2.9"] + condition: all + rules: + - 'c:pmset -g -> n:pwernap\s*\t*(\d) compare == 0' + + # 2.10 Enable Secure Keyboard Entry in terminal.app (Automated) + - id: 17533 + title: "Enable Secure Keyboard Entry in terminal.app" + description: "Secure Keyboard Entry prevents other applications on the system and/or network from detecting and recording what is typed into Terminal." + rationale: "Enabling Secure Keyboard Entry minimizes the risk of a key logger from detecting what is entered in Terminal." + remediation: "Perform the following to implement the prescribed state: 1. Open Terminal 2. Select Terminal 3. Select Secure Keyboard Entry" + compliance: + - cis: ["2.10"] + condition: all + rules: + - "c:defaults read -app Terminal SecureKeyboardEntry -> 1" + # - 'c:sudo -u defaults read -app Terminal SecureKeyboardEntry -> 1' + + # not implemented - process -> 2.11 Securely delete files as needed (Manual) + + # 2.12 Ensure EFI version is valid and being regularly checked (Automated) + - id: 17534 + title: "Ensure EFI version is valid and being regularly checked" + description: "In order to mitigate firmware attacks Apple has created a automated Firmware check to ensure that the EFI version running is a known good version from Apple. There is also an automated process to check it every seven days." + rationale: "If the Firmware of a computer has been compromised the Operating System that the Firmware loads cannot be trusted either." + remediation: "If EFI does not pass the integrity check you may send a report to Apple. Backing up files and clean installing a known good Operating System and Firmware is recommended." + compliance: + - cis: ["2.12"] + condition: all + rules: + - "c:/usr/libexec/firmwarecheckers/eficheck/eficheck --integrity-check -> r:Primary allowlist version match found. No changes detected in primary hashes" + - 'c:launchctl list -> r:^-\s*\t*0\s*\t*com.apple.driver.eficheck$' + + # 3.1 Enable security auditing (Automated) + - id: 17535 + title: "Enable security auditing" + description: "macOS's audit facility, auditd, receives notifications from the kernel when certain system calls, such as open, fork, and exit, are made. These notifications are captured and written to an audit log." + rationale: "Logs generated by auditd may be useful when investigating a security incident as they may help reveal the vulnerable application and the actions taken by a malicious actor." + remediation: "Run the following command in Terminal: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.auditd.plist" + compliance: + - cis: ["3.1"] + condition: all + rules: + - "c:launchctl list -> r:com.apple.auditd" + + # not implemented - process -> 3.2 Configure Security Auditing Flags per local organizational requirements (Manual) + + # 3.3 Retain install.log for 365 or more days with no maximum size (Automated) + - id: 17536 + title: "Retain install.log for 365 or more days with no maximum size" + description: "macOS writes information pertaining to system-related events to the file /var/log/install.log and has a configurable retention policy for this file. The default logging setting limits the file size of the logs and the maximum size for all logs. The default allows for an errant application to fill the log files and does not enforce sufficient log retention. The Benchmark recommends a value based on standard use cases. The value should align with local requirements within the organization." + rationale: "Archiving and retaining install.log for at least a year is beneficial in the event of an incident as it will allow the user to view the various changes to the system along with the date and time they occurred." + remediation: "Perform the following to ensure that install logs are retained for at least 365 days:Edit the /etc/asl/com.apple.install file and add or modify the ttl value to 365 or greater on the file line. Also, remove the all_max= setting and value from the file line." + compliance: + - cis: ["3.3"] + condition: all + rules: + - 'c:grep -i ttl /etc/asl/com.apple.install -> n:ttl\w+(\d+) compare > 365' + + # not implemented - SCA Limit -> 3.4 Ensure security auditing retention (Automated) + + # 3.5 Control access to audit records (Automated) + - id: 17537 + title: "Control access to audit records" + description: "The audit system on macOS writes important operational and security information that can be both useful for an attacker and a place for an attacker to attempt to obfuscate unwanted changes that were recorded. As part of defense-in-depth the /etc/security/audit_control configuration and the files in /var/audit should be owned only by root with group wheel with read only rights and no other access allowed. macOS ACLs should not be used for these files." + rationale: "Audit records should never be changed except by the system daemon posting events. Records may be viewed or extracts manipulated but the authoritative files should be protected from unauthorized changes." + remediation: "Run the following to commands to set the audit records to the root user and wheel group: sudo chown -R root:wheel /etc/security/audit_control && sudo chown -R root:wheel /var/audit/" + compliance: + - cis: ["3.5"] + condition: all + rules: + - 'c:ls -le /etc/security/audit_control -> r:root\s*\t*wheel|total' + - 'c:ls -le /var/audit/ -> r:root\s*\t*wheel|total' + + # 3.6 Ensure Firewall is configured to log (Automated) + - id: 17538 + title: "Ensure Firewall is configured to log" + description: "The socketfilter firewall is what is used when the firewall is turned on in the Security PreferencePane. In order to appropriately monitor what access is allowed and denied logging must be enabled." + rationale: "In order to troubleshoot the successes and failures of a firewall logging should be enabled." + remediation: "Run the following command to enable logging of the firewall: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setloggingmode on" + compliance: + - cis: ["3.6"] + condition: all + rules: + - "c:/usr/libexec/ApplicationFirewall/socketfilterfw --getloggingmode -> r:Log mode is on" + + # 4.1 Disable Bonjour advertising service (Automated) + - id: 17539 + title: "Disable Bonjour advertising service" + description: "Bonjour is an auto-discovery mechanism for TCP/IP devices which enumerate devices and services within a local subnet. DNS on macOS is integrated with Bonjour and should not be turned off, but the Bonjour advertising service can be disabled." + rationale: 'Bonjour can simplify device discovery from an internal rogue or compromised host. An attacker could use Bonjour''s multicast DNS feature to discover a vulnerable or poorly- configured service or additional information to aid a targeted attack. Implementing this control disables the continuous broadcasting of "I''m here!" messages. Typical end-user endpoints should not have to advertise services to other computers.. This setting does not stop the computer from sending out service discovery messages when looking for services on an internal subnet, if the computer is looking for a printer or server and using service discovery. To block all Bonjour traffic except to approved devices the pf or other firewall would be needed.' + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool true" + compliance: + - cis: ["4.1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -> 1" + + # not implemented - SCA Limit -> 4.2 Enable "Show Wi-Fi status in menu bar" (Automated) + # not implemented - process -> 4.3 Create network specific locations (Manual) + + # 4.4 Ensure http server is not running (Automated) + - id: 17541 + title: "Ensure http server is not running" + description: "macOS used to have a graphical front-end to the embedded Apache web server in the Operating System. Personal web sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Personal web sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. Apache however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end user computer. Web sharing should only be done through hardened web servers and appropriate cloud services." + rationale: "Web serving should not be done from a user desktop. Dedicated webservers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." + remediation: "Ensure that the Web Server is not running and is not set to start at boot Stop the Web Server: sudo apachectl stop Ensure that the web server will not auto-start at boot sudo: defaults write /System/Library/LaunchDaemons/org.apache.httpd Disabled - bool true" + compliance: + - cis: ["4.4"] + condition: none + rules: + - "p:httpd" + - "p:/usr/sbin/httpd" + + # 4.5 Ensure nfs server is not running (Scored) + - id: 17542 + title: "Ensure nfs server is not running" + description: "macOS can act as an NFS fileserver. NFS sharing could be enabled to allow someone on another computer to mount shares and gain access to information from the user's computer. File sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. NFSD is still part of the Operating System and can be easily turned on to export shares and provide remote connectivity to an end user computer." + rationale: "File serving should not be done from a user desktop, dedicated servers should be used. Open ports make it easier to exploit the computer." + remediation: "Ensure that the NFS Server is not running and is not set to start at boot Stop the NFS Server: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.nfsd.plist Remove the exported Directory listing: sudo rm /etc/export" + compliance: + - cis: ["4.5"] + condition: none + rules: + - "p:nfsd" + - "p:/sbin/nfsd" + - "f:/etc/exports" + + # not implemented - SCA Limit -> 5.1.1 Secure Home Folders (Automated) + + # 5.1.2 Check System Wide Applications for appropriate permissions (Automated) + - id: 17544 + title: "Check System Wide Applications for appropriate permissions" + description: "Applications in the System Applications Directory (/Applications) should be world executable since that is their reason to be on the system. They should not be world writable and allow any process or user to alter them for other processes or users to then execute modified versions" + rationale: "Unauthorized modifications of applications could lead to the execution of malicious code." + remediation: "Run the following command to change the permissions for each application that does not meet the requirements: sudo chmod -R o-w /Applications/" + compliance: + - cis: ["5.1.2"] + condition: all + rules: + - 'c:find /Applications -iname "*.app" -type d -perm -2 -ls -> r:^$' + + # 5.1.3 Check System folder for world writable files (Automated) + - id: 17545 + title: "Check System folder for world writable files" + description: "Software sometimes insists on being installed in the /System Directory and have inappropriate world writable permissions." + rationale: 'Folders in /System should not be world writable. The audit check excludes the "Drop Box" folder that is part of Apple''s default user template.' + remediation: "Run the following command to set permissions so that folders are not world writable in the /System folder: sudo chmod -R o-w /Path/" + compliance: + - cis: ["5.1.3"] + condition: all + rules: + - "c:find /System -type d -perm -2 -ls -> r:^$|Public/Drop Box" + + # 5.1.4 Check Library folder for world writable files (Automated) + - id: 17546 + title: "Check Library folder for world writable files" + description: "Software sometimes insists on being installed in the /Library Directory and have inappropriate world writable permissions." + rationale: "Folders in /Library should not be world writable. The audit check excludes the /Library/Caches folder where the sticky bit is set." + remediation: "Run the following command to set permissions so that folders are not world writable in the /Library folder: sudo chmod -R o-w /Library/" + compliance: + - cis: ["5.1.4"] + condition: all + rules: + - "c:find /Library -type d -perm -2 -ls -> r:^$|Caches" + + # not implemented - SCA Limit -> 5.2.1 Configure account lockout threshold (Automated) + # not implemented - SCA Limit -> 5.2.2 Set a minimum password length (Automated) + # not implemented - SCA Limit -> 5.2.3 Complex passwords must contain an Alphabetic Character (Manual) + # not implemented - SCA Limit -> 5.2.4 Complex passwords must contain a Numeric Character (Manual) + # not implemented - SCA Limit -> 5.2.5 Complex passwords must contain a Special Character (Manual) + # not implemented - SCA Limit -> 5.2.6 Complex passwords must uppercase and lowercase letters (Manual) + # not implemented - SCA Limit -> 5.2.7 Password Age (Automated) + # not implemented - SCA Limit -> 5.2.8 Password History (Automated) + + # 5.3 Reduce the sudo timeout period (Automated) 17551 + - id: 17551 + title: "Reduce the sudo timeout period" + description: "The sudo command allows the user to run programs as the root user. Working as the root user allows the user an extremely high level of configurability within the system." + rationale: "The sudo command stays logged in as the root user for five minutes before timing out and re-requesting a password. This five minute window should be eliminated since it leaves the system extremely vulnerable. This is especially true if an exploit were to gain access to the system, since they would be able to make changes as a root user." + remediation: "Run the following command to edit the sudo settings: sudo visudo -> Add the line Defaults timestamp_timeout=0 in the Override built-in defaults section. " + compliance: + - cis: ["5.3"] + condition: all + rules: + - 'c:grep -e "timestamp" /etc/sudoers -> r:Defaults timestamp_timeout=0' + + # not implemented - SCA Limit -> 5.4 Automatically lock the login keychain for inactivity (Manual) + + # 5.5 Use a separate timestamp for each user/tty combo (Automated) 17552 + - id: 17552 + title: "Use a separate timestamp for each user/tty combo" + description: "Using tty tickets ensures that a user must enter the sudo password in each Terminal session. With sudo versions 1.8 and higher, introduced in 10.12, the default value is to have tty tickets for each interface so that root access is limited to a specific terminal. The default configuration can be overwritten or not configured correctly on earlier versions of macOS." + rationale: "In combination with removing the sudo timeout grace period a further mitigation should be in place to reduce the possibility of a background process using elevated rights when a user elevates to root in an explicit context or tty. Additional mitigation should be in place to reduce the risk of privilege escalation of background processes." + remediation: "Run the following command to edit the sudo settings: sudo visudo -> Add the line Defaults timestamp_timeout=0 in the Override built-in defaults section. " + compliance: + - cis: ["5.3"] + condition: all + rules: + - 'c:grep -E -s "!tty_tickets" /etc/sudoers /etc/sudoers.d/* -> r:^$' + - 'c:grep -E -s "timestamp_type" /etc/sudoers /etc/sudoers.d/* -> r:^$|!timestamp_type=ppid|!timestamp_type=global' + + # not implemented - SCA Limit -> 5.6 Ensure login keychain is locked when the computer sleeps (Manual) + + # 5.7 Do not enable the "root" account (Automated) + - id: 17553 + title: 'Do not enable the "root" account' + description: "The root account is a superuser account that has access privileges to perform any actions and read/write to any file on the computer. With some Linux distros the system administrator may commonly uses the root account to perform administrative functions." + rationale: "Enabling and using the root account puts the system at risk since any successful exploit or mistake while the root account is in use could have unlimited access privileges within the system. Using the sudo command allows users to perform functions as a root user while limiting and password protecting the access privileges. By default the root account is not enabled on a macOS computer. An administrator can escalate privileges using the sudo command (use -s or -i to get a root shell)." + remediation: "Open System Preferences, Uses & Groups. Click the lock icon to unlock it. In the Network Account Server section, click Join or Edit. Click Open Directory Utility. Click the lock icon to unlock it. Select the Edit menu > Disable Root User." + compliance: + - cis: ["5.7"] + condition: all + rules: + - "c:dscl . -read /Users/root AuthenticationAuthority -> r:^No such key: AuthenticationAuthority" + + # 5.8 Disable automatic login (Automated) + - id: 17554 + title: "Disable automatic login" + description: "The automatic login feature saves a user's system access credentials and bypasses the login screen, instead the system automatically loads to the user's desktop screen." + rationale: "Disabling automatic login decreases the likelihood of an unauthorized person gaining access to a system." + remediation: "Run the following command in Terminal: sudo defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser" + compliance: + - cis: ["5.8"] + condition: none + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow -> r:autoLoginUser" + + # not implemented - process - 5.9 Require a password to wake the computer from sleep or screen saver (Manual) + # not implemented - SCA Limit -> 5.10 Ensure system is set to hibernate (Automated) + # not implemented - SCA Limit -> 5.11 Require an administrator password to access system-wide preferences (Automated) + # not implemented - SCA Limit -> 5.12 Disable ability to login to another user's active and locked session (Automated) + + # 5.13 Create a custom message for the Login Screen (Automated) + - id: 17558 + title: "Create a custom message for the Login Screen" + description: "An access warning informs the user that the system is reserved for authorized use only, and that the use of the system may be monitored." + rationale: "An access warning may reduce a casual attacker's tendency to target the system. Access warnings may also aid in the prosecution of an attacker by evincing the attacker's knowledge of the system's private status, acceptable use policy, and authorization requirements." + remediation: 'Run the following command to enable a custom login screen message: sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText ""' + compliance: + - cis: ["5.13"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow.plist LoginwindowText -> !r:does not exist" + + # 5.14 Create a Login window banner (Automated) + - id: 17559 + title: "Create a Login window banner" + description: "A Login window banner warning informs the user that the system is reserved for authorized use only. It enforces an acknowledgment by the user that they have been informed of the use policy in the banner if required. The system recognizes either the .txt and the .rtf formats." + rationale: "An access warning may reduce a casual attacker's tendency to target the system. Access warnings may also aid in the prosecution of an attacker by evincing the attacker's knowledge of the system's private status, acceptable use policy, and authorization requirements." + remediation: "Edit (or create) a PolicyBanner.txt or PolicyBanner.rtf file, in the /Library/Security/ folder, to include the required login window banner text." + compliance: + - cis: ["5.14"] + condition: all + rules: + - "d:/Library/Security -> r:^PolicyBanner" + + # not implemented - SCA Limit -> 5.15 Do not enter a password-related hint (Automated) + + # 5.16 Disable Fast User Switching (Manual) + - id: 17560 + title: "Disable Fast User Switching" + description: "Fast user switching allows a person to quickly log in to the computer with a different account. While only a minimal security risk, when a second user is logged in, that user might be able to see what processes the first user is using, or possibly gain other information about the first user. In a large directory environment where it is difficult to limit login access many valid users can login to other user's assigned computers." + rationale: "Fast user switching allows multiple users to run applications simultaneously at console. There can be information disclosed about processes running under a different user. Without a specific configuration to save data and log out users can have unsaved data running in a background session that is not obvious." + remediation: "Run the following command to turn fast user switching off: sudo defaults write /Library/Preferences/.GlobalPreferences MultipleSessionEnabled -bool false" + compliance: + - cis: ["5.16"] + condition: any + rules: + - "c:defaults read /Library/Preferences/.GlobalPreferences.plist MultipleSessionEnabled -> r:does not exist" + - "c:defaults read /Library/Preferences/.GlobalPreferences.plist MultipleSessionEnabled -> 0" + + # not implemented - process - 5.17 Secure individual keychains and items (Manual) + # not implemented - process - 5.18 Create specialized keychains for different purposes (Manual) + + # 5.19 System Integrity Protection status (Automated) + - id: 17561 + title: "System Integrity Protection status" + description: "System Integrity Protection is a security feature introduced in OS X 10.11 El Capitan. System Integrity Protection restricts access to System domain locations and restricts runtime attachment to system processes. Any attempt to attempt to inspect or attach to a system process will fail. Kernel Extensions are now restricted to /Library/Extensions and are required to be signed with a Developer ID." + rationale: "Running without System Integrity Protection on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by SIP." + remediation: "Perform the following while booted in macOS Recovery Partition. 1. Select Terminal from the Utilities menu 2. Run the following command in Terminal: /usr/bin/csrutil enable 3. The output should be: Successfully enabled System Integrity Protection. Please restart the machine for the changes to take effect. 4. Reboot." + compliance: + - cis: ["5.19"] + condition: all + rules: + - "c:/usr/bin/csrutil status -> r:^System Integrity Protection status: enabled" + + # 6.1.1 Display login window as name and password (Automated) + - id: 17562 + title: "Display login window as name and password" + description: "The login window prompts a user for his/her credentials, verifies their authorization level and then allows or denies the user access to the system." + rationale: "Prompting the user to enter both their username and password makes it twice as hard for unauthorized users to gain access to the system since they must discover two attributes." + remediation: "Run the following command to enable the login window to display name and password: sudo defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool true" + compliance: + - cis: ["6.1.1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -> 1" + + # jal + # 6.1.2 Disable "Show password hints" (Automated) + - id: 17563 + title: 'Disable "Show password hints"' + description: "Password hints are user created text displayed when an incorrect password is used for an account." + rationale: "Password hints make it easier for unauthorized persons to gain access to systems by providing information to anyone that the user provided to assist remembering the password. This info could include the password itself or other information that might be readily discerned with basic knowledge of the end user." + remediation: "Run the following command to disable password hints: sudo defaults write /Library/Preferences/com.apple.loginwindow RetriesUntilHint -int 0" + compliance: + - cis: ["6.1.2"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow RetriesUntilHint -> 0" + - "c:defaults read /Library/Preferences/com.apple.loginwindow RetriesUntilHint -> r:does not exist" + + # 6.1.3 Disable guest account login (Automated) + - id: 17564 + title: "Disable guest account login" + description: "The guest account allows users access to the system without having to create an account or password. Guest users are unable to make setting changes, cannot remotely login to the system and all created files, caches, and passwords are deleted upon logging out." + rationale: "Disabling the guest account mitigates the risk of an untrusted user doing basic reconnaissance and possibly using privilege escalation attacks to take control of the system." + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled - bool false" + compliance: + - cis: ["6.1.3"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow.plist GuestEnabled -> 0" + + # 6.1.4 Disable "Allow guests to connect to shared folders" (Automated) + - id: 17565 + title: 'Disable "Allow guests to connect to shared folders"' + description: "Allowing guests to connect to shared folders enables users to access selected shared folders and their contents from different computers on a network." + rationale: "Not allowing guests to connect to shared folders mitigates the risk of an untrusted user doing basic reconnaissance and possibly use privilege escalation attacks to take control of the system." + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled - bool false" + compliance: + - cis: ["6.1.4"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.AppleFileServer guestAccess -> 0" + - "c:defaults read /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -> 0" + - "c:defaults read /Library/Preferences/com.apple.AppleFileServer guestAccess -> r:does not exist" + - "c:defaults read /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -> r:does not exist" + + # 6.1.5 Remove Guest home folder (Automated) + - id: 17566 + title: "Remove Guest home folder" + description: "In the previous two controls the guest account login has been disabled and sharing to guests has been disabled as well. There is no need for the legacy Guest home folder to remain in the file system. When normal user accounts are removed you have the option to archive it, leave it in place or delete. In the case of the guest folder the folder remains in place without a GUI option to remove it. If at some point in the future a Guest account is needed it will be re-created. The presence of the Guest home folder can cause automated audits to fail when looking for compliant settings within all User folders as well. Rather than ignoring the folders continued existence it is best removed." + rationale: "The Guest home folders are unneeded after the Guest account is disabled and could be used inappropriately." + remediation: "1. Run the following command in Terminal: sudo rm -R /Users/Guest 2. Make sure there is no output" + compliance: + - cis: ["6.1.5"] + condition: none + rules: + - "d:/Users/Guest" + + # 6.2 Turn on filename extensions (Automated) + - id: 17567 + title: "Turn on filename extensions" + description: "A filename extension is a suffix added to a base filename that indicates the base filename's file format." + rationale: "Visible filename extensions allows the user to identify the file type and the application it is associated with which leads to quick identification of misrepresented malicious files." + remediation: "Perform the following to implement the prescribed state: 1. Select Finder 2. Select Preferences 3. Check Show all filename extensions Alternatively, use the following command: defaults write NSGlobalDomain AppleShowAllExtensions -bool true" + compliance: + - cis: ["6.2"] + condition: all + rules: + - "c:defaults read NSGlobalDomain AppleShowAllExtensions -> 1" + # - 'c:defaults read /Users//Library/Preferences/.GlobalPreferences.plist AppleShowAllExtensions -> 1' + + # 6.3 Disable the automatic run of safe files in Safari (Automated) + - id: 17568 + title: "Disable the automatic run of safe files in Safari" + description: "Safari will automatically run or execute what it considers safe files. This can include installers and other files that execute on the operating system. Safari bases file safety by using a list of filetypes maintained by Apple. The list of files include text, image, video and archive formats that would be run in the context of the OS rather than the browser." + rationale: "Hackers have taken advantage of this setting via drive-by attacks. These attacks occur when a user visits a legitimate website that has been corrupted. The user unknowingly downloads a malicious file either by closing an infected pop-up or hovering over a malicious banner. An attacker can create a malicious file that will fall within Safari's safe file list that will download and execute without user input." + remediation: 'Perform the following to implement the prescribed state: 1. Open Safari 2. Select Safari from the menu bar 3. Select Preferences 4. Select General 5. Uncheck Open "safe" files after downloading Alternatively run the following command in Terminal: defaults write com.apple.Safari AutoOpenSafeDownloads -boolean no' + compliance: + - cis: ["6.3"] + condition: all + rules: + - "c:defaults read com.apple.Safari AutoOpenSafeDownloads -> 0" diff --git a/etc/ruleset/sca/darwin/20/cis_apple_macOS_11.1.yml b/etc/ruleset/sca/darwin/20/cis_apple_macOS_11.1.yml new file mode 100644 index 0000000000..288029f982 --- /dev/null +++ b/etc/ruleset/sca/darwin/20/cis_apple_macOS_11.1.yml @@ -0,0 +1,1018 @@ +# Security Configuration Assessment +# CIS Checks for macOS 11.x +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Apple macOS 11.0 Big Sur Benchmark v2.1.0 - 07-19-2022 + +policy: + id: "cis_apple_macos_11.x" + file: "cis_apple_macOS_11.1.yml" + name: "CIS Apple macOS 11.0 Big Sur Benchmark v2.1.0" + description: "CIS Apple macOS 11.0 Big Sur Benchmark v2.1.0, provides prescriptive guidance for establishing a secure configuration posture for Apple macOS 10.15. This guide was tested against Apple macOS 10.15." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check macOS version." + description: "Requirements for running the SCA scan against macOS 11.x (Big Sur)." + condition: any + rules: + - 'c:sw_vers -> r:^ProductVersion:\t*\s*11\p' + - 'c:system_profiler SPSoftwareDataType -> r:System Version:\.*11\p' + - 'c:defaults read loginwindow SystemVersionStampAsString -> r:^\t*\s*11\p' + +checks: + ############################################################ + #1 Install Updates, Patches and Additional Security Software + ############################################################ + # 1.1 Verify all Apple provided software is current (Automated) + - id: 18000 + title: "Verify all Apple provided software is current." + description: "Software vendors release security patches and software updates for their products when security vulnerabilities are discovered. There is no simple way to complete this action without a network connection to an Apple software repository. Please ensure appropriate access for this control. This check is only for what Apple provides through software update." + rationale: "It is important that these updates be applied in a timely manner to prevent unauthorized persons from exploiting the identified vulnerabilities." + remediation: "1. In Terminal, run the following: softwareupdate -i -a 2. In Terminal, run the following for any packages that show up in step 1: sudo softwareupdate -i packagename" + compliance: + - cis: ["1.1"] + - cis_level: ["1"] + condition: all + rules: + - "c:softwareupdate -l -> r:No new software available" + + # 1.2 Enable Auto Update (Automated) + - id: 18001 + title: "Enable Auto Update." + description: 'Auto Update verifies that your system has the newest security patches and software updates. If "Automatically check for updates" is not selected background updates for new malware definition files from Apple for XProtect and Gatekeeper will not occur.' + rationale: "It is important that a system has the newest updates applied so as to prevent unauthorized persons from exploiting identified vulnerabilities." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true" + compliance: + - cis: ["1.2"] + - cis_level: ["1"] + references: + - https://macops.ca/os-x-admins-your-clients-are-not-getting-background-security-updates/ + - https://derflounder.wordpress.com/2014/12/17/forcing-xprotect-blacklist-updates-on-mavericks-and-yosemite/ + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -> 1" + + # 1.3 Enable Download new updates when available (Automated) + - id: 18002 + title: "Enable Download new updates when available." + description: 'In the GUI both "Install macOS updates" and "Install app updates from the App Store" are dependent on whether "Download new updates when available" is selected' + rationale: "It is important that a system has the newest updates downloaded so that they can be applied." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true" + compliance: + - cis: ["1.3"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -> 1" + + # 1.4 Enable app update installs (Automated) + - id: 18003 + title: "Enable app update installs." + description: "Ensure that application updates are installed after they are available from Apple. These updates do not require reboots or admin privileges for end users." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate - bool TRUE" + compliance: + - cis: ["1.4"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> 1" + + # 1.5 Enable system data files and security update installs (Automated) + - id: 18004 + title: "Enable system data files and security update installs." + description: "Ensure that system and security updates are installed after they are available from Apple. This setting enables definition updates for XProtect and Gatekeeper, with this setting in place new malware and adware that Apple has added to the list of malware or untrusted software will not execute. These updates do not require reboots or end user admin rights." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable install system data files and security updates: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true && sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true" + compliance: + - cis: ["1.5"] + - cis_level: ["1"] + references: + - https://www.thesafemac.com/tag/xprotect/ + - https://support.apple.com/en-us/HT202491 + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -> 1" + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -> 1" + + # 1.6 Enable macOS update installs (Automated) + - id: 18005 + title: "Enable macOS update installs." + description: "Ensure that macOS updates are installed after they are available from Apple. This setting enables macOS updates to be automatically installed. Some environments will want to approve and test updates before they are delivered. It is best practice to test first where updates can and have caused disruptions to operations. Automatic updates should be turned off where changes are tightly controlled and there are mature testing and approval processes. Automatic updates should not be turned off so the admin can call the users first to let them know it's ok to install. A dependable repeatable process involving a patch agent or remote management tool should be in place before auto-updates are turned off." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited" + remediation: "Open a terminal session and enter the following command to enable install system data files and security updates: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates AutoUpdate - bool TRUE" + compliance: + - cis: ["1.6"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates -> 1" + + ############################################################ + #2 System Preferences + ############################################################ + #2.1 Bluetooth + ############################################################ + + # 2.1.1 Turn off Bluetooth, if no paired devices exist (Automated) + - id: 18006 + title: "Turn off Bluetooth, if no paired devices exist." + description: "Bluetooth devices use a wireless communications system that replaces the cables used by other peripherals to connect to a system. It is by design a peer-to-peer network technology and typically lacks centralized administration and security enforcement infrastructure." + rationale: "Bluetooth is particularly susceptible to a diverse set of security vulnerabilities involving identity detection, location tracking, denial of service, unintended control and access of data and voice channels, and unauthorized device control and data access." + remediation: "Open a terminal session and enter the following command to disable bluetooth: sudo defaults write /Library/Preferences/com.apple.Bluetooth ControllerPowerState -int 0 && sudo killall -HUP blued" + compliance: + - cis: ["2.1.1"] + - cis_level: ["1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.Bluetooth ControllerPowerState -> 0" + - "c:system_profiler SPBluetoothDataType -> r:Connectable: Yes" + + # 2.1.2 Show Bluetooth status in menu bar (Automated) + - id: 18007 + title: "Show Bluetooth status in menu bar." + description: "By showing the Bluetooth status in the menu bar, a small Bluetooth icon is placed in the menu bar. This icon quickly shows the status of Bluetooth, and can allow the user to quickly turn Bluetooth on or off." + rationale: "Enabling Show Bluetooth status in menu bar is a security awareness method that helps understand the current state of Bluetooth, including whether it is enabled, discoverable, what paired devices exist, and what paired devices are currently active. " + remediation: "For each user, run the following command to enable Bluetooth status in the menu bar: sudo -u defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 18" + compliance: + - cis: ["2.1.2"] + - cis_level: ["1"] + condition: any + rules: + - "c:defaults -currentHost read com.apple.controlcenter.plist Bluetooth -> 18" + + ############################################################ + #2.2 Date & Time + ############################################################ + # 2.2.1 Enable "Set time and date automatically" (Automated) + - id: 18008 + title: "Enable Set time and date automatically." + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features." + remediation: "Run the following commands: sudo systemsetup -setnetworktimeserver sudo systemsetup -setusingnetworktime on" + compliance: + - cis: ["2.2.1"] + - cis_level: ["1"] + condition: all + rules: + - 'c:systemsetup -getusingnetworktime -> r:Network Time:\s*\t*On' + + # 2.2.2 Ensure time set is within appropriate limits (Automated) + - id: 18009 + title: "Ensure time set is within appropriate limits." + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries. Ensure that time on the computer is within acceptable limits. Truly accurate time is measured within milliseconds, for this audit a drift under four and a half minutes passes the control check. Since Kerberos is one of the important features of macOS integration into Directory systems the guidance here is to warn you before there could be an impact to operations. From the perspective of accurate time this check is not strict, it may be too great for your organization, adjust to a smaller offset value as needed. Note: ntpdate has been deprecated with 10.14. sntp replaces that command." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features. Audit check is for more than 4 minutes and 30 seconds ahead or behind." + remediation: "Run the following commands to ensure your time is set within an appropriate limit: sudo systemsetup -getnetworktimeserver -> Get the time server name and then run: sudo touch /var/db/ntp-kod && sudo chown root:wheel /var/db/ntp-kod && sudo sntp -sS " + compliance: + - cis: ["2.2.2"] + - cis_level: ["1"] + condition: all + rules: + - "c:systemsetup -getnetworktimeserver -> r:Network Time Server:" + #- Pending check offset is in the 270.x seconds + + ############################################################ + #2.3 Desktop & Screen Saver + ############################################################ + # 2.3.1 Set an inactivity interval of 20 minutes or less for the screen saver (Automated) + - id: 18010 + title: "Set an inactivity interval of 20 minutes or less for the screen saver." + description: "A locking screensaver is one of the standard security controls to limit access to a computer and the current user's session when the computer is temporarily unused or unattended. In macOS the screensaver starts after a value selected in a drop down menu, 10 minutes and 20 minutes are both options and either is acceptable. Any value can be selected through the command line or script but a number that is not reflected in the GUI can be problematic. 20 minutes is the default for new accounts." + rationale: "Setting an inactivity interval for the screensaver prevents unauthorized persons from viewing a system left unattended for an extensive period of time." + remediation: "Run the following command to verify that the idle time of the screen saver to 20 minutes or less (≤1200): sudo defaults -currentHost write com.apple.screensaver idleTime -int 600 " + compliance: + - cis: ["2.3.1"] + - cis_level: ["1"] + condition: none + rules: + - "c:defaults -currentHost read com.apple.screensaver idleTime -> r:does not exist" + + # 2.3.2 Secure screen saver corners (Automated) + - id: 18011 + title: "Secure screen saver corners." + description: "Hot Corners can be configured to disable the screen saver by moving the mouse cursor to a corner of the screen." + rationale: "Setting a hot corner to disable the screen saver poses a potential security risk since an unauthorized person could use this to bypass the login screen and gain access to the system." + remediation: "Run the following command to turn off Disable Screen Saver for a Hot Corner: sudo -u defaults write com.apple.dock -int 0 " + compliance: + - cis: ["2.3.2"] + - cis_level: ["2"] + condition: all + rules: + - "c:defaults read com.apple.dock wvous-tl-corner -> !r:^6$" + - "c:defaults read com.apple.dock wvous-bl-corner -> !r:^6$" + - "c:defaults read com.apple.dock wvous-tr-corner -> !r:^6$" + - "c:defaults read com.apple.dock wvous-br-corner -> !r:^6$" + + # not implemented - process -> 2.3.3 Familiarize users with screen lock tools or corner to Start Screen Saver (Manual) + + ############################################################ + #2.4 Sharing + ############################################################ + # 2.4.1 Disable Remote Apple Events (Automated) + - id: 18012 + title: "Disable Remote Apple Events." + description: "Apple Events is a technology that allows one program to communicate with other programs. Remote Apple Events allows a program on one computer to communicate with a program on a different computer." + rationale: "Disabling Remote Apple Events mitigates the risk of an unauthorized program gaining access to the system." + remediation: "Run the following command in Terminal: sudo systemsetup -setremoteappleevents off" + compliance: + - cis: ["2.4.1"] + - cis_level: ["1"] + condition: all + rules: + - 'c:systemsetup -getremoteappleevents -> r:Remote Apple Events:\s*\t*Off' + + # 2.4.2 Disable Internet Sharing (Automated) + - id: 18013 + title: "Disable Internet Sharing." + description: "Internet Sharing uses the open source natd process to share an internet connection with other computers and devices on a local network. This allows the Mac to function as a router and share the connection to other, possibly unauthorized, devices." + rationale: "Disabling Internet Sharing reduces the remote attack surface of the system." + remediation: "Run the following command to turn off Internet Sharing: sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict Enabled -int 0" + compliance: + - cis: ["2.4.2"] + - cis_level: ["1"] + condition: none + rules: + - 'c:defaults read /Library/Preferences/SystemConfiguration/com.apple.nat -> r:Enabled\s*\t*=\s*\t*1' + + # 2.4.3 Disable Screen Sharing (Automated) + - id: 18014 + title: "Disable Screen Sharing." + description: "Screen sharing allows a computer to connect to another computer on a network and display the computer's screen. While sharing the computer's screen, the user can control what happens on that computer, such as opening documents or applications, opening, moving, or closing windows, and even shutting down the computer." + rationale: "Disabling screen sharing mitigates the risk of remote connections being made without the user of the console knowing that they are sharing the computer." + remediation: "Run the following command to turn off Screen Sharing: sudo launchctl disable system/com.apple.screensharing" + compliance: + - cis: ["2.4.3"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "launchctl print-disabled system | grep -c ''\"com.apple.screensharing\" => true''" -> 1' + + # 2.4.4 Disable Printer Sharing (Automated) + - id: 18015 + title: "Disable Printer Sharing." + description: "By enabling Printer sharing the computer is set up as a print server to accept print jobs from other computers. Dedicated print servers or direct IP printing should be used instead." + rationale: "Disabling Printer Sharing mitigates the risk of attackers attempting to exploit the print server to gain access to the system." + remediation: "Run the following command in Terminal: sudo cupsctl --no-share-printers" + compliance: + - cis: ["2.4.4"] + - cis_level: ["1"] + references: + - https://support.apple.com/kb/PH11450 + condition: all + rules: + - 'c:sh -c "cupsctl | grep _share_printers | cut -d ''='' -f2" -> 0' + + # 2.4.5 Disable Remote Login (Automated) + - id: 18016 + title: "Disable Remote Login." + description: "Remote Login allows an interactive terminal connection to a computer." + rationale: "Disabling Remote Login mitigates the risk of an unauthorized person gaining access to the system via Secure Shell (SSH). While SSH is an industry standard to connect to posix servers, the scope of the benchmark is for Apple macOS clients, not servers. macOS does have an IP based firewall available (pf, ipfw has been deprecated) that is not enabled or configured. There are more details and links in section 7.5. macOS no longer has TCP Wrappers support built-in and does not have strong Brute-Force password guessing mitigations, or frequent patching of openssh by Apple. Most macOS computers are mobile workstations, managing IP based firewall rules on mobile devices can be very resource intensive. All of these factors can be parts of running a hardened SSH server." + remediation: "Run the following command in Terminal: sudo systemsetup -setremotelogin off" + compliance: + - cis: ["2.4.5"] + - cis_level: ["1"] + condition: all + rules: + - 'c:systemsetup -getremotelogin -> r:Remote Login:\s*\t*Off' + + # 2.4.6 Disable DVD or CD Sharing (Automated) + - id: 18017 + title: "Disable DVD or CD Sharing." + description: "DVD or CD Sharing allows users to remotely access the system's optical drive." + rationale: "Disabling DVD or CD Sharing minimizes the risk of an attacker using the optical drive as a vector for attack and exposure of sensitive data." + remediation: "Run the following command to disable DVD or CD sharing: sudo launchctl disable system/com.apple.ODSAgent " + compliance: + - cis: ["2.4.6"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "launchctl print-disabled system | grep -c ''\"com.apple.ODSAgent\" => true''" -> 1' + + # 2.4.7 Disable Bluetooth Sharing (Automated) + - id: 18018 + title: "Disable Bluetooth Sharing ." + description: "Bluetooth Sharing allows files to be exchanged with Bluetooth enabled devices." + rationale: "Disabling Bluetooth Sharing minimizes the risk of an attacker using Bluetooth to remotely attack the system." + remediation: "Perform the following to disable Bluetooth Sharing: Graphical Method: 1. Open System Preferences 2. Select Sharing 3. Uncheck Bluetooth Sharing" + compliance: + - cis: ["2.4.7"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults -currentHost read com.apple.Bluetooth PrefKeyServicesEnabled -> 0" + + # 2.4.8 Disable File Sharing (Automated) + - id: 18019 + title: "Disable File Sharing." + description: "Apple's File Sharing uses a combination of SMB (Windows sharing) and AFP (Mac sharing)" + rationale: "By disabling file sharing, the remote attack surface and risk of unauthorized access to files stored on the system is reduced." + remediation: "Run the following command in Terminal to turn off AFP and SMB file sharing from the command line: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.smbd.plist" + compliance: + - cis: ["2.4.8"] + - cis_level: ["1"] + condition: none + rules: + - 'c:sh -c "launchctl print-disabled system | grep -c ''\"com.apple.smbd\" => true''" -> 1' + + # 2.4.9 Disable Remote Management (Automated) + - id: 18020 + title: "Disable Remote Management." + description: "Remote Management is the client portion of Apple Remote Desktop (ARD). Remote Management can be used by remote administrators to view the current Screen, install software, report on, and generally manage client Macs. The screen sharing options in Remote Management are identical to those in the Screen Sharing section. In fact, only one of the two can be configured. If Remote Management is used, refer to the Screen Sharing section above on issues regard screen sharing. Remote Management should only be enabled when a Directory is in place to manage the accounts with access. Computers will be available on port 5900 on a macOS System and could accept connections from untrusted hosts depending on the configuration, definitely a concern for mobile systems." + rationale: "Remote management should only be enabled on trusted networks with strong user controls present in a Directory system. Mobile devices without strict controls are vulnerable to exploit and monitoring." + remediation: "Run the following command to disable remote management: sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources /kickstart -deactivate -stop" + compliance: + - cis: ["2.4.9"] + - cis_level: ["1"] + condition: all + rules: + - "not p:ARDAgent" + + # 2.4.10 Disable Content Caching (Automated) + - id: 18021 + title: "Disable Content Caching." + description: "Starting with 10.13 (macOS High Sierra) Apple introduced a service to make it easier deploy data from Apple, including software updates, where there are bandwidth constraints to the Internet and fewer constraints and greater bandwidth on the local subnet. This capability can be very valuable for organizations that have throttled and possibly metered Internet connections. In heterogeneous enterprise networks with multiple subnets the effectiveness of this capability would be determined on how many Macs were on each subnet at the time new large updates were made available upstream. This capability requires the use of mac OS clients as P2P nodes for updated Apple content. Unless there is a business requirement to manage operational Internet connectivity bandwidth user endpoints should not store content and act as a cluster to provision data." + rationale: "The main use case for Mac computers is as mobile user endpoints. P2P sharing services should not be enabled on laptops that are using untrusted networks. Content Caching can allow a computer to be a server for local nodes on an untrusted network. While there are certainly logical controls that could be used to mitigate risk they add to the management complexity, since the value of the service is in specific use cases organizations with the use case described above can accept risk as necessary." + remediation: "Run the following command in to disable content caching: sudo AssetCacheManagerUtil deactivate" + compliance: + - cis: ["2.4.10"] + - cis_level: ["2"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.AssetCache.plist Activated -> 0" + + # 2.4.11 Disable Media Sharing (Automated) + - id: 18022 + title: "Disable Media Sharing." + description: "Starting with macOS 10.15 Apple has provided a control to allow a user to share Apple downloaded content on all Apple devices that are signed in with the same Apple ID. This allows a user to share downloaded Movies, Music or TV shows with other controlled macOS, iOS and iPadOS devices as well as photos with Apple TVs. With this capability guest users can also use media downloaded on the computer. Best practice is not to use the computer as a server but to utilize Apple's cloud storage to download and use content stored there if content stored with Apple is used on multiple devices." + rationale: "Disabling Media Sharing reduces the remote attack surface of the system." + remediation: "Run the following command in to disable content caching: sudo AssetCacheManagerUtil deactivate" + compliance: + - cis: ["2.4.11"] + - cis_level: ["2"] + references: + - https://support.apple.com/guide/mac-help/set-up-media-sharing-on-mac-mchlp13371337/mac + condition: all + rules: + - "c:defaults read com.apple.amp.mediasharingd home-sharing-enabled -> 0" + + # 2.4.12 Ensure AirDrop Is Disabled (Automated) + - id: 18069 + title: "Ensure AirDrop Is Disabled." + description: "While there are positives to AirDrop, there are privacy concerns that could expose personal information. For that reason, AirDrop should be disabled, and should only be enabled when needed and disabled afterwards." + rationale: "AirDrop can allow malicious files to be downloaded from unknown sources. Contacts Only limits may expose personal information to devices in the same area." + remediation: "Run the following commands to disable AirDrop: sudo -u defaults write com.apple.NetworkBrowser DisableAirDrop -bool true" + references: + - https://www.techrepublic.com/article/apple-airdrop-users-reportedly-vulnerable-to-security-flaw/ + - https://www.imore.com/how-apple-keeps-your-airdrop-files-private-and-secure + compliance: + - cis: ["2.4.12"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read com.apple.NetworkBrowser DisableAirDrop -> 1" + + ############################################################ + # 2.5 Security & Privacy + ############################################################ + # 2.5.1 Encryption + ############################################################ + # 2.5.1.1 Enable FileVault (Automated) + - id: 18023 + title: "Enable FileVault." + description: "FileVault secures a system's data by automatically encrypting its boot volume and requiring a password or recovery key to access it. Filevault may also be enabled using command line using the fdesetup command. To use this functionality, consult the Der Flounder blog for more details: " + rationale: "Encrypting sensitive data minimizes the likelihood of unauthorized users gaining access to it." + remediation: "1. Open System Preferences 2. Select Security & Privacy 3. Select FileVault 4. Select Turn on FileVault" + compliance: + - cis: ["2.5.1.1"] + - cis_level: ["1"] + references: + - https://derflounder.wordpress.com/2015/02/02/managing-yosemites-filevault-2-with-fdesetup/ + - https://derflounder.wordpress.com/2019/01/15/unlock-or-decrypt-your-filevault-encrypted-boot-drive-from-the-command-line-on-macos-mojave/ + condition: all + rules: + - 'c:fdesetup status -> r:^FileVault\s*\t*is\s*\t*On$' + + # not implemented - SCA Limit -> 2.5.1.2 Ensure all user storage APFS volumes are encrypted (Manual) + # not implemented - SCA Limit -> 2.5.1.3 Ensure all user storage CoreStorage volumes are encrypted (Manual) + + ############################################################ + # 2.5.2 Firewall + ############################################################ + # 2.5.2.1 Enable Gatekeeper (Automated) + - id: 18024 + title: "Enable Gatekeeper." + description: "Gatekeeper is Apple's application white-listing control that restricts downloaded applications from launching. It functions as a control to limit applications from unverified sources from running without authorization." + rationale: "Disallowing unsigned software will reduce the risk of unauthorized or malicious applications from running on the system." + remediation: "Run the following command in Terminal: sudo spctl --master-enable" + compliance: + - cis: ["2.5.1"] + - cis_level: ["1"] + condition: all + rules: + - 'c:spctl --status -> r:^assessments\s*\t*enabled$' + + # 2.5.2.2 Enable Firewall (Automated) + - id: 18025 + title: "Enable Firewall." + description: "A firewall is a piece of software that blocks unwanted incoming connections to a system. Apple has posted general documentation about the application firewall." + rationale: "A firewall minimizes the threat of unauthorized users from gaining access to your system while connected to a network or the Internet." + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.alf globalstate - int Where is: - 1 = on for specific services - 2 = on for essential services " + compliance: + - cis: ["2.5.2"] + - cis_level: ["1"] + references: + - https://support.apple.com/en-us/HT201642 + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.alf globalstate -> r:^1$|^2$" + + # 2.5.2.3 Enable Firewall Stealth Mode (Automated) + - id: 18026 + title: "Enable Firewall Stealth Mode." + description: "While in Stealth mode the computer will not respond to unsolicited probes, dropping that traffic." + rationale: "Stealth mode on the firewall minimizes the threat of system discovery tools while connected to a network or the Internet." + remediation: "Run the following command in Terminal: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on" + compliance: + - cis: ["2.5.3"] + - cis_level: ["1"] + references: + - https://support.apple.com/en-us/HT201642 + condition: all + rules: + - "c:/usr/libexec/ApplicationFirewall/socketfilterfw --getstealthmode -> r:^Stealth mode enabled" + + # 2.5.3 Enable Location Services (Automated) + - id: 18027 + title: "Enable Location Services." + description: "macOS uses location information gathered through local Wi-Fi networks to enable applications to supply relevant information to users. Users do not need to change the time or the time zone, the computer will do it for them. They do not need to specify their location for weather or travel times and even get alerts on travel times to meetings and appointment where location information is supplied. For the purpose of asset management and time and log management with mobile computers location services simplify some processes.There are some use cases where it is important that the computer not be able to report it's exact location. While the general use case is to enable Location Services, it should not be allowed if the physical location of the computer and the user should not be public knowledge." + rationale: "Location services are helpful in most use cases and can simplify log and time management where computers change time zones." + remediation: "Run the following command to enable location services: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locationd.plist" + compliance: + - cis: ["2.5.3"] + - cis_level: ["2"] + references: + - https://support.apple.com/en-us/HT204690 + condition: all + rules: + - 'c:sh -c "launchctl list | grep -c com.apple.locationd" -> 1' + + # not implemented - process -> 2.5.4 Review Application Firewall Rules (Manual) + + # 2.5.5 Disable sending diagnostic and usage data to Apple (Automated) + - id: 18028 + title: "Disable sending diagnostic and usage data to Apple." + description: "Apple provides a mechanism to send diagnostic and analytics data back to Apple to help them improve the platform. Information sent to Apple may contain internal organizational information that should be controlled and not available for processing by Apple. Turn off all Analytics and Improvements sharing." + rationale: "Organizations should have knowledge of what is shared with the vendor and the setting automatically forwards information to Apple." + remediation: "For each needed user, run the following command to enable limited ad tracking: sudo -u defaults -currentHost write /Users//Library/Preferences/com.apple.Adlib.plist allowApplePersonalizedAdvertising -bool false" + compliance: + - cis: ["2.5.5"] + - cis_level: ["2"] + condition: all + rules: + - 'c:defaults read /Library/Application\ Support/CrashReporter/DiagnosticMessagesHistory.plist AutoSubmit -> 0' + + # 2.5.6 Limit Ad tracking and personalized Ads (Automated) + - id: 18029 + title: "Limit Ad tracking and personalized Ads." + description: "Apple provides a framework that allows advertisers to target Apple users and end-users with advertisements. While many people prefer that when they see advertising it is relevant to them and their interests, the detailed information that is data mining collected, correlated, and available to advertisers in repositories is often disconcerting. This information is valuable to both advertisers and attackers and has been used with other metadata to reveal users' identities" + rationale: "Organizations should manage user privacy settings on managed devices to align with organizational policies and user data protection requirements." + remediation: "Run the following command in Terminal: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.auditd.plist" + compliance: + - cis: ["2.5.6"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults -currentHost read /Users//Library/Preferences/com.apple.AdLib.plist allowApplePersonalizedAdvertising -> 0" + + ############################################################ + # 2.6 iCloud + ############################################################ + # not implemented - process -> 2.6.1 iCloud configuration (Manual) + # not implemented - process -> 2.6.2 iCloud keychain (Manual) + # not implemented - process -> 2.6.3 iCloud Drive (Manual) + # not implemented - process -> 2.6.4 iCloud Drive Document and Desktop sync (Manual) + + ############################################################ + # 2.7 Time Machine + ############################################################ + # 2.7.1 Time Machine Auto-Backup (Automated) + - id: 18030 + title: "Time Machine Auto-Backup." + description: "Backup solutions are only effective if the backups run on a regular basis. The time to check for backups is before the hard drive fails or the computer goes missing. In order to simplify the user experience so that backups are more likely to occur Time Machine should be on and set to Back Up Automatically whenever the target volume is available. Operational staff should ensure that backups complete on a regular basis and the backups are tested to ensure that file restoration from backup is possible when needed. Backup dates are available even when the target volume is not available in the Time Machine plist. When the backup volume is connected to the computer more extensive information is available through tmutil. See man tmutil" + rationale: "Backups should automatically run whenever the backup drive is available." + remediation: "Run the following enable TimeMachine: sudo sudo tmutil setdestination -a /Volumes/ && sudo tmutil enable" + compliance: + - cis: ["2.7.1"] + - cis_level: ["2"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.TimeMachine.plist AutoBackup -> 1" + + # not implemented - SCA Limit -> 2.7.2 Time Machine Volumes Are Encrypted (Automated) + + # 2.8 Disable Wake for network access (Automated) + - id: 18031 + title: "Disable Wake for network access." + description: "This feature allows the computer to take action when the user is not present and the computer is in energy saving mode. These tools require FileVault to remain unlocked and fully rejoin known networks. Theie macOS feature is meant to allow the computer to resume activity as needed regardless of physical security controls. This feature allows other users to be able to access your computer's shared resources, such as shared printers or iTunes playlists, even when your computer is in sleep mode. In a closed network when only authorized devices could wake a computer it could be valuable to wake computers in order to do management push activity. Where mobile workstations and agents exist the device will more likely check in to receive updates when already awake. Mobile devices should not be listening for signals on unmanaged network where untrusted devices could send wake signals." + rationale: "Disabling this feature mitigates the risk of an attacker remotely waking the system and gaining access." + remediation: "Run the following command to disable Wake for network access: sudo pmset -a womp 0 " + compliance: + - cis: ["2.8"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "pmset -g | grep -e womp" -> r:0' + + # 2.9 Disable Power Nap (Automated) + - id: 18032 + title: "Disable Power Nap." + description: "This features allows the computer to take action when the user is not present and the computer is in energy saving mode. These tools require FileVault to remain unlocked and fully rejoin known networks. This macOS features are meant to allow the computer to resume activity as needed regardless of physical security controls. Power Nap allows the system to stay in low power mode, especially while on battery power and periodically connect to previously named networks with stored credentials for user applications to phone home and get updates. This capability requires FileVault to remain unlocked and the use of previously joined networks to be risk accepted based on the SSID without user input." + rationale: "Disabling this feature mitigates the risk of an attacker remotely waking the system and gaining access." + remediation: "Run the following command to disable Power Nap: sudo pmset -a powernap 0" + compliance: + - cis: ["2.9"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "pmset -g everything | grep -e powernap" -> r:powernap\s+0' + + # 2.10 Enable Secure Keyboard Entry in terminal.app (Automated) + - id: 18033 + title: "Enable Secure Keyboard Entry in terminal.app." + description: "Secure Keyboard Entry prevents other applications on the system and/or network from detecting and recording what is typed into Terminal." + rationale: "Enabling Secure Keyboard Entry minimizes the risk of a key logger from detecting what is entered in Terminal." + remediation: "Perform the following to implement the prescribed state: 1. Open Terminal 2. Select Terminal 3. Select Secure Keyboard Entry." + compliance: + - cis: ["2.10"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read -app Terminal SecureKeyboardEntry -> 1" + + # 2.11 Ensure EFI version is valid and being regularly checked (Automated) + - id: 18034 + title: "Ensure EFI version is valid and being regularly checked." + description: "In order to mitigate firmware attacks Apple has created a automated Firmware check to ensure that the EFI version running is a known good version from Apple. There is also an automated process to check it every seven days." + rationale: "If the Firmware of a computer has been compromised the Operating System that the Firmware loads cannot be trusted either." + remediation: "If EFI does not pass the integrity check you may send a report to Apple. Backing up files and clean installing a known good Operating System and Firmware is recommended." + compliance: + - cis: ["2.11"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "system_profiler SPiBridgeDataType | grep \"T2\"" -> r:Model Name: Apple T2 Security Chip' + - 'c:sh -c "launchctl list | grep com.apple.driver.eficheck" -> r:^-\s*\t*0\s*\t*com.apple.driver.eficheck$' + + # not implemented - requires supervision -> 2.12 Automatic Actions for Optical Media (Manual) + # not implemented - requires supervision -> 2.13 Review Siri Settings (Manual) + # not implemented - requires supervision -> 2.14 Review Sidecar Settings (Manual) + + ############################################################ + # 3 Logging and Auditing + ############################################################ + # 3.1 Enable security auditing (Automated) + - id: 18035 + title: "Enable security auditing." + description: "macOS's audit facility, auditd, receives notifications from the kernel when certain system calls, such as open, fork, and exit, are made. These notifications are captured and written to an audit log." + rationale: "Logs generated by auditd may be useful when investigating a security incident as they may help reveal the vulnerable application and the actions taken by a malicious actor." + remediation: "Run the following command in Terminal: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.auditd.plist" + compliance: + - cis: ["3.1"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "launchctl list | grep -i auditd" -> r:com.apple.auditd' + + # not implemented - process -> 3.2 Configure Security Auditing Flags per local organizational requirements (Manual) + + # 3.3 Retain install.log for 365 or more days with no maximum size (Automated) + - id: 18036 + title: "Retain install.log for 365 or more days with no maximum size." + description: "macOS writes information pertaining to system-related events to the file /var/log/install.log and has a configurable retention policy for this file. The default logging setting limits the file size of the logs and the maximum size for all logs. The default allows for an errant application to fill the log files and does not enforce sufficient log retention. The Benchmark recommends a value based on standard use cases. The value should align with local requirements within the organization." + rationale: "Archiving and retaining install.log for at least a year is beneficial in the event of an incident as it will allow the user to view the various changes to the system along with the date and time they occurred." + remediation: "Perform the following to ensure that install logs are retained for at least 365 days:Edit the /etc/asl/com.apple.install file and add or modify the ttl value to 365 or greater on the file line. Also, remove the all_max= setting and value from the file line." + compliance: + - cis: ["3.3"] + - cis_level: ["1"] + condition: all + rules: + - 'c:grep -i ttl /etc/asl/com.apple.install -> n:ttl\w+(\d+) compare > 365' + - "c:grep -i all_max= /etc/asl/com.apple.install -> r:^$" + + # not implemented - SCA Limit -> 3.4 Ensure security auditing retention (Automated) + + # 3.5 Control access to audit records (Automated) + - id: 18037 + title: "Control access to audit records." + description: "The audit system on macOS writes important operational and security information that can be both useful for an attacker and a place for an attacker to attempt to obfuscate unwanted changes that were recorded. As part of defense-in-depth the /etc/security/audit_control configuration and the files in /var/audit should be owned only by root with group wheel with read only rights and no other access allowed. macOS ACLs should not be used for these files." + rationale: "Audit records should never be changed except by the system daemon posting events. Records may be viewed or extracts manipulated but the authoritative files should be protected from unauthorized changes." + remediation: "Run the following to commands to set the audit records to the root user and wheel group: sudo chown -R root:wheel /etc/security/audit_control && sudo chown -R root:wheel /var/audit/" + compliance: + - cis: ["3.5"] + - cis_level: ["1"] + condition: all + rules: + - 'c:ls -le /etc/security/audit_control -> r:root\s*\t*wheel|root' + - 'c:ls -le /var/audit/ -> r:root\s*\t*wheel|root' + + # 3.6 Ensure Firewall is configured to log (Automated) + - id: 18038 + title: "Ensure Firewall is configured to log." + description: "The socketfilter firewall is what is used when the firewall is turned on in the Security PreferencePane. In order to appropriately monitor what access is allowed and denied logging must be enabled." + rationale: "In order to troubleshoot the successes and failures of a firewall logging should be enabled." + remediation: "Run the following command to enable logging of the firewall: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setloggingmode on" + compliance: + - cis: ["3.6"] + - cis_level: ["1"] + condition: all + rules: + - "c:/usr/libexec/ApplicationFirewall/socketfilterfw --getloggingmode -> r:Log mode is on" + + # not implemented - process -> 3.7 Software Inventory Considerations (Manual) + + ############################################################ + # 4 Network Configurations + ############################################################ + # 4.1 Disable Bonjour advertising service (Automated) + - id: 18039 + title: "Disable Bonjour advertising service." + description: "Bonjour is an auto-discovery mechanism for TCP/IP devices which enumerate devices and services within a local subnet. DNS on macOS is integrated with Bonjour and should not be turned off, but the Bonjour advertising service can be disabled." + rationale: 'Bonjour can simplify device discovery from an internal rogue or compromised host. An attacker could use Bonjour''s multicast DNS feature to discover a vulnerable or poorly- configured service or additional information to aid a targeted attack. Implementing this control disables the continuous broadcasting of "I''m here!" messages. Typical end-user endpoints should not have to advertise services to other computers.. This setting does not stop the computer from sending out service discovery messages when looking for services on an internal subnet, if the computer is looking for a printer or server and using service discovery. To block all Bonjour traffic except to approved devices the pf or other firewall would be needed.' + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool true" + compliance: + - cis: ["4.1"] + - cis_level: ["2"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -> 1" + + # not implemented - SCA Limit -> 4.2 Enable "Show Wi-Fi status in menu bar" (Automated) + # not implemented - process -> 4.3 Create network specific locations (Manual) + + # 4.4 Ensure http server is not running (Automated) + - id: 18040 + title: "Ensure http server is not running." + description: "macOS used to have a graphical front-end to the embedded Apache web server in the Operating System. Personal web sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Personal web sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. Apache however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end user computer. Web sharing should only be done through hardened web servers and appropriate cloud services." + rationale: "Web serving should not be done from a user desktop. Dedicated webservers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." + remediation: "Ensure that the Web Server is not running and is not set to start at boot Stop the Web Server: sudo apachectl stop Ensure that the web server will not auto-start at boot sudo: defaults write /System/Library/LaunchDaemons/org.apache.httpd Disabled - bool true" + compliance: + - cis: ["4.4"] + - cis_level: ["1"] + condition: none + rules: + - "p:httpd" + - "p:/usr/sbin/httpd" + + # 4.5 Ensure nfs server is not running (Scored) + - id: 18041 + title: "Ensure nfs server is not running." + description: "macOS can act as an NFS fileserver. NFS sharing could be enabled to allow someone on another computer to mount shares and gain access to information from the user's computer. File sharing from a user endpoint has long been considered questionable and Apple has removed that capability from the GUI. NFSD is still part of the Operating System and can be easily turned on to export shares and provide remote connectivity to an end user computer." + rationale: "File serving should not be done from a user desktop, dedicated servers should be used. Open ports make it easier to exploit the computer." + remediation: "Ensure that the NFS Server is not running and is not set to start at boot Stop the NFS Server: sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.nfsd.plist Remove the exported Directory listing: sudo rm /etc/export" + compliance: + - cis: ["4.5"] + - cis_level: ["1"] + condition: none + rules: + - "f:/etc/exports" + - 'not c:sh -c "launchctl print-disabled system | grep -c ''\"com.apple.nfsd\" => true''" -> 1' + + # not implemented - Review -> 4.6 Review Wi-Fi Settings (Manual) + + ############################################################ + # 5 System Access, Authentication and Authorization + ############################################################ + # 5.1 File System Permissions and Access Controls + ############################################################ + # not implemented - SCA Limit -> 5.1.1 Secure Home Folders (Automated) + + # 5.1.2 Check System Wide Applications for appropriate permissions (Automated) + - id: 18042 + title: "Check System Wide Applications for appropriate permissions." + description: "Applications in the System Applications Directory (/Applications) should be world executable since that is their reason to be on the system. They should not be world writable and allow any process or user to alter them for other processes or users to then execute modified versions" + rationale: "Unauthorized modifications of applications could lead to the execution of malicious code." + remediation: "Run the following command to change the permissions for each application that does not meet the requirements: sudo chmod -R o-w /Applications/" + compliance: + - cis: ["5.1.2"] + - cis_level: ["1"] + condition: all + rules: + - 'c:find /Applications -iname "*.app" -type d -perm -2 -ls -> r:^$' + + # 5.1.3 Check System folder for world writable files (Automated) + - id: 18043 + title: "Check System folder for world writable files." + description: "Software sometimes insists on being installed in the /System Directory and have inappropriate world writable permissions." + rationale: 'Folders in /System should not be world writable. The audit check excludes the "Drop Box" folder that is part of Apple''s default user template.' + remediation: "Run the following command to set permissions so that folders are not world writable in the /System folder: sudo chmod -R o-w /Path/" + compliance: + - cis: ["5.1.3"] + - cis_level: ["1"] + condition: all + rules: + - "c:find /System -type d -perm -2 -ls -> r:^$" + + # 5.1.4 Check Library folder for world writable files (Automated) + - id: 18044 + title: "Check Library folder for world writable files." + description: "Software sometimes insists on being installed in the /Library Directory and have inappropriate world writable permissions." + rationale: "Folders in /Library should not be world writable. The audit check excludes the /Library/Caches folder where the sticky bit is set." + remediation: "Run the following command to set permissions so that folders are not world writable in the /Library folder: sudo chmod -R o-w /Library/" + compliance: + - cis: ["5.1.4"] + - cis_level: ["2"] + condition: all + rules: + - 'c:sh -c "find /System/Volumes/Data/Library -type d -perm -2 -ls | grep -v Caches | grep -v Audio" -> r:^$' + + ############################################################ + # 5.2 Password Management + ############################################################ + # not implemented - SCA Limit -> 5.2.1 Configure account lockout threshold (Automated) + # not implemented - SCA Limit -> 5.2.2 Set a minimum password length (Automated) + # not implemented - SCA Limit -> 5.2.3 Complex passwords must contain an Alphabetic Character (Manual) + # not implemented - SCA Limit -> 5.2.4 Complex passwords must contain a Numeric Character (Manual) + # not implemented - SCA Limit -> 5.2.5 Complex passwords must contain a Special Character (Manual) + # not implemented - SCA Limit -> 5.2.6 Complex passwords must uppercase and lowercase letters (Manual) + # not implemented - SCA Limit -> 5.2.7 Password Age (Automated) + # not implemented - SCA Limit -> 5.2.8 Password History (Automated) + + # 5.3 Reduce the sudo timeout period (Automated) 18051 + - id: 18045 + title: "Reduce the sudo timeout period." + description: "The sudo command allows the user to run programs as the root user. Working as the root user allows the user an extremely high level of configurability within the system." + rationale: "The sudo command stays logged in as the root user for five minutes before timing out and re-requesting a password. This five minute window should be eliminated since it leaves the system extremely vulnerable. This is especially true if an exploit were to gain access to the system, since they would be able to make changes as a root user." + remediation: "Run the following command to edit the sudo settings: sudo visudo -> Add the line Defaults timestamp_timeout=0 in the Override built-in defaults section. " + compliance: + - cis: ["5.3"] + - cis_level: ["1"] + condition: all + rules: + - 'c:grep -e "timestamp" /etc/sudoers -> r:Defaults timestamp_timeout=0' + + # not implemented - SCA Limit -> 5.4 Automatically lock the login keychain for inactivity (Manual) + + # 5.5 Use a separate timestamp for each user/tty combo (Automated) + - id: 18046 + title: "Use a separate timestamp for each user/tty combo." + description: "Using tty tickets ensures that a user must enter the sudo password in each Terminal session. With sudo versions 1.8 and higher, introduced in 10.12, the default value is to have tty tickets for each interface so that root access is limited to a specific terminal. The default configuration can be overwritten or not configured correctly on earlier versions of macOS." + rationale: "In combination with removing the sudo timeout grace period a further mitigation should be in place to reduce the possibility of a background process using elevated rights when a user elevates to root in an explicit context or tty. Additional mitigation should be in place to reduce the risk of privilege escalation of background processes." + remediation: "Run the following command to edit the sudo settings: sudo visudo -> Add the line Defaults timestamp_timeout=0 in the Override built-in defaults section. " + compliance: + - cis: ["5.3"] + - cis_level: ["1"] + condition: all + rules: + - "c:grep -E -s '!tty_tickets' /etc/sudoers /etc/sudoers.d/* -> r:^$" + - 'c:grep -E -s "timestamp_type" /etc/sudoers /etc/sudoers.d/* -> r:^$|!timestamp_type=ppid|!timestamp_type=global' + + # not implemented - SCA Limit -> 5.6 Ensure login keychain is locked when the computer sleeps (Manual) + + # 5.7 Do not enable the "root" account (Automated) + - id: 18047 + title: "Do not enable the root account" + description: "The root account is a superuser account that has access privileges to perform any actions and read/write to any file on the computer. With some Linux distros the system administrator may commonly uses the root account to perform administrative functions." + rationale: "Enabling and using the root account puts the system at risk since any successful exploit or mistake while the root account is in use could have unlimited access privileges within the system. Using the sudo command allows users to perform functions as a root user while limiting and password protecting the access privileges. By default the root account is not enabled on a macOS computer. An administrator can escalate privileges using the sudo command (use -s or -i to get a root shell)." + remediation: "Open System Preferences, Uses & Groups. Click the lock icon to unlock it. In the Network Account Server section, click Join or Edit. Click Open Directory Utility. Click the lock icon to unlock it. Select the Edit menu > Disable Root User. Terminal Method: Run the following command to disable the root user: sudo dsenableroot -d" + compliance: + - cis: ["5.7"] + - cis_level: ["1"] + condition: all + rules: + - "c:dscl . -read /Users/root AuthenticationAuthority -> r:^No such key: AuthenticationAuthority" + + # 5.8 Disable automatic login (Automated) + - id: 18048 + title: "Disable automatic login." + description: "The automatic login feature saves a user's system access credentials and bypasses the login screen, instead the system automatically loads to the user's desktop screen." + rationale: "Disabling automatic login decreases the likelihood of an unauthorized person gaining access to a system." + remediation: "Run the following command in Terminal: sudo defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser" + compliance: + - cis: ["5.8"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow autoLoginUser -> r:^$" + + # not implemented - process - 5.9 Require a password to wake the computer from sleep or screen saver (Manual) + # not implemented - SCA Limit -> 5.10 Ensure system is set to hibernate (Automated) + # 5.11 Require an administrator password to access system-wide preferences (Automated) + - id: 18049 + title: "Require an administrator password to access system-wide preferences." + description: "System Preferences controls system and user settings on a macOS Computer. System Preferences allows the user to tailor their experience on the computer as well as allowing the System Administrator to configure global security settings. Some of the settings should only be altered by the person responsible for the computer. " + rationale: "By requiring a password to unlock system-wide System Preferences the risk is mitigated of a user changing configurations that affect the entire system and requires an admin user to re-authenticate to make changes." + remediation: "Perform the following to verify that an administrator password is required to access system-wide preferences: 1. Open System Preferences 2. Select Security & Privacy 3. Select General 4. Select Advanced... 5. Set Require an administrator password to access system-wide preferences" + compliance: + - cis: ["5.11"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "security authorizationdb read system.preferences 2> /dev/null | grep -A1 shared | grep false" -> r:^' + + # 5.12 Disable ability to login to another user's active and locked session (Automated) + - id: 18050 + title: "Ensure an administrator account cannot login to another user's active and locked session." + description: "macOS has a privilege that can be granted to any user that will allow that user to unlock active user's sessions." + rationale: "Disabling the admins and/or user's ability to log into another user's active and locked session prevents unauthorized persons from viewing potentially sensitive and/or personal information." + remediation: "Run the following command to disable a user logging into another user's active and/or locked session: $ sudo security authorizationdb write system.login.screensaver use-login-window-ui" + compliance: + - cis: ["5.12"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "security authorizationdb read system.login.screensaver 2>&1 | grep -c ''use-login-window-ui''" -> 1' + + # 5.13 Create a custom message for the Login Screen (Automated) + - id: 18051 + title: "Create a custom message for the Login Screen." + description: "An access warning informs the user that the system is reserved for authorized use only, and that the use of the system may be monitored." + rationale: "An access warning may reduce a casual attacker's tendency to target the system. Access warnings may also aid in the prosecution of an attacker by evincing the attacker's knowledge of the system's private status, acceptable use policy, and authorization requirements." + remediation: 'Run the following command to enable a custom login screen message: sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText ""' + compliance: + - cis: ["5.13"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow.plist LoginwindowText -> !r:does not exist" + + # 5.14 Create a Login window banner (Automated) + - id: 18052 + title: "Create a Login window banner." + description: "A Login window banner warning informs the user that the system is reserved for authorized use only. It enforces an acknowledgment by the user that they have been informed of the use policy in the banner if required. The system recognizes either the .txt and the .rtf formats." + rationale: "An access warning may reduce a casual attacker's tendency to target the system. Access warnings may also aid in the prosecution of an attacker by evincing the attacker's knowledge of the system's private status, acceptable use policy, and authorization requirements." + remediation: "Edit (or create) a PolicyBanner.txt or PolicyBanner.rtf file, in the /Library/Security/ folder, to include the required login window banner text." + compliance: + - cis: ["5.14"] + - cis_level: ["1"] + condition: all + rules: + - "d:/Library/Security -> r:^PolicyBanner" + + # not implemented - SCA Limit -> 5.15 Do not enter a password-related hint (Automated) + + # 5.16 Disable Fast User Switching (Manual) + - id: 18053 + title: "Disable Fast User Switching." + description: "Fast user switching allows a person to quickly log in to the computer with a different account. While only a minimal security risk, when a second user is logged in, that user might be able to see what processes the first user is using, or possibly gain other information about the first user. In a large directory environment where it is difficult to limit login access many valid users can login to other user's assigned computers." + rationale: "Fast user switching allows multiple users to run applications simultaneously at console. There can be information disclosed about processes running under a different user. Without a specific configuration to save data and log out users can have unsaved data running in a background session that is not obvious." + remediation: "Run the following command to turn fast user switching off: sudo defaults write /Library/Preferences/.GlobalPreferences MultipleSessionEnabled -bool false" + compliance: + - cis: ["5.16"] + - cis_level: ["2"] + condition: any + rules: + - "c:defaults read /Library/Preferences/.GlobalPreferences.plist MultipleSessionEnabled -> r:does not exist" + - "c:defaults read /Library/Preferences/.GlobalPreferences.plist MultipleSessionEnabled -> 0" + + # not implemented - process - 5.17 Secure individual keychains and items (Manual) + + # 5.18 System Integrity Protection status (Automated) + - id: 18054 + title: "System Integrity Protection status." + description: "System Integrity Protection is a security feature introduced in OS X 10.11 El Capitan. System Integrity Protection restricts access to System domain locations and restricts runtime attachment to system processes. Any attempt to attempt to inspect or attach to a system process will fail. Kernel Extensions are now restricted to /Library/Extensions and are required to be signed with a Developer ID." + rationale: "Running without System Integrity Protection on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by SIP." + remediation: "Perform the following while booted in macOS Recovery Partition. 1. Select Terminal from the Utilities menu 2. Run the following command in Terminal: /usr/bin/csrutil enable 3. The output should be: Successfully enabled System Integrity Protection. Please restart the machine for the changes to take effect. 4. Reboot." + compliance: + - cis: ["5.18"] + - cis_level: ["1"] + condition: all + rules: + - "c:/usr/bin/csrutil status -> r:^System Integrity Protection status: enabled" + + # 5.19 Enable Sealed System Volume (SSV) (Automated) + - id: 18055 + title: "Enable Sealed System Volume (SSV)." + description: "SThe seal is verified by the boot loader at startup. macOS will not boot if system files have been tampered with. If validation fails, the user will be instructed to reinstall the operating system. During read operations for files located in the Sealed System Volume, a hash is calculated and compared to the value stored in the Merkle tree." + rationale: "Running without Sealed System Volume on a production system could run the risk of Apple software, that integrates directly with macOS, being modified. " + remediation: "Perform the following while booted in macOS Recovery Partition. 1. Select Terminal from the Utilities menu 2. Run the following command in Terminal: /usr/bin/csrutil enable authenticated-root 3. The output should be: Successfully enabled System authenticated root. Please restart the machine for the changes to take effect. 4. Reboot." + compliance: + - cis: ["5.19"] + - cis_level: ["1"] + condition: all + rules: + - "c:/usr/bin/csrutil authenticated-root status -> r:^SAuthenticated Root status: enabled" + + # 5.20 Enable Library Validation (Automated) + - id: 18056 + title: "Enable Library Validation." + description: "Library Validation is a security feature introduced in macOS 10.10 Yosemite. Library Validation protects processes from loading arbitrary libraries. This stops root from loading arbitrary libraries into any process (depending on SIP status),and keeps root from becoming more powerful. Security is strengthened, because some user processes can no longer be fooled to run additional code without root's explicit request, which may grant access to daemons that depend on LibraryValidation for secure validation of code identity." + rationale: "Running without Library Validation on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by Library Validation." + remediation: "Run the following command to set Library Validation: sudo defaults write /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation DisableLibraryValidation -bool false" + references: + - https://github.com/Automattic/wp-desktop/issues/790 + - https://www.naut.ca/blog/2020/11/13/forbidden-commands-to-liberate-macos/ + - http://www.newosxbook.com/articles/CodeSigning.pdf + compliance: + - cis: ["5.20"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation -> 0" + + ############################################################ + # 6 User Accounts and Environment + ############################################################ + # 6.1 Accounts Preferences Action Items + ############################################################ + # 6.1.1 Display login window as name and password (Automated) + - id: 18057 + title: "Display login window as name and password." + description: "The login window prompts a user for his/her credentials, verifies their authorization level and then allows or denies the user access to the system." + rationale: "Prompting the user to enter both their username and password makes it twice as hard for unauthorized users to gain access to the system since they must discover two attributes." + remediation: "Run the following command to enable the login window to display name and password: sudo defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool true" + compliance: + - cis: ["6.1.1"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -> 1" + + # 6.1.2 Disable "Show password hints" (Automated) + - id: 18058 + title: "Disable Show password hints." + description: "Password hints are user created text displayed when an incorrect password is used for an account." + rationale: "Password hints make it easier for unauthorized persons to gain access to systems by providing information to anyone that the user provided to assist remembering the password. This info could include the password itself or other information that might be readily discerned with basic knowledge of the end user." + remediation: "Run the following command to disable password hints: sudo defaults write /Library/Preferences/com.apple.loginwindow RetriesUntilHint -int 0" + compliance: + - cis: ["6.1.2"] + - cis_level: ["1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow RetriesUntilHint -> 0" + - "c:defaults read /Library/Preferences/com.apple.loginwindow RetriesUntilHint -> r:does not exist" + + # 6.1.3 Disable guest account login (Automated) + - id: 18059 + title: "Disable guest account login." + description: "The guest account allows users access to the system without having to create an account or password. Guest users are unable to make setting changes, cannot remotely login to the system and all created files, caches, and passwords are deleted upon logging out." + rationale: "Disabling the guest account mitigates the risk of an untrusted user doing basic reconnaissance and possibly using privilege escalation attacks to take control of the system." + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled - bool false" + compliance: + - cis: ["6.1.3"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow.plist GuestEnabled -> 0" + + # 6.1.4 Disable "Allow guests to connect to shared folders" (Automated) + - id: 18060 + title: "Disable Allow guests to connect to shared folders" + description: "Allowing guests to connect to shared folders enables users to access selected shared folders and their contents from different computers on a network." + rationale: "Not allowing guests to connect to shared folders mitigates the risk of an untrusted user doing basic reconnaissance and possibly use privilege escalation attacks to take control of the system." + remediation: "Run the following command in Terminal: sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled - bool false" + compliance: + - cis: ["6.1.4"] + - cis_level: ["1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.AppleFileServer guestAccess -> 0" + - "c:defaults read /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -> 0" + - "c:defaults read /Library/Preferences/com.apple.AppleFileServer guestAccess -> r:does not exist" + - "c:defaults read /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -> r:does not exist" + + # 6.1.5 Remove Guest home folder (Automated) + - id: 18061 + title: "Remove Guest home folder." + description: "In the previous two controls the guest account login has been disabled and sharing to guests has been disabled as well. There is no need for the legacy Guest home folder to remain in the file system. When normal user accounts are removed you have the option to archive it, leave it in place or delete. In the case of the guest folder the folder remains in place without a GUI option to remove it. If at some point in the future a Guest account is needed it will be re-created. The presence of the Guest home folder can cause automated audits to fail when looking for compliant settings within all User folders as well. Rather than ignoring the folders continued existence it is best removed." + rationale: "The Guest home folders are unneeded after the Guest account is disabled and could be used inappropriately." + remediation: "1. Run the following command in Terminal: sudo rm -R /Users/Guest 2. Make sure there is no output" + compliance: + - cis: ["6.1.5"] + - cis_level: ["1"] + condition: none + rules: + - "d:/Users/Guest" + + # 6.2 Turn on filename extensions (Automated) + - id: 18062 + title: "Turn on filename extensions." + description: "A filename extension is a suffix added to a base filename that indicates the base filename's file format." + rationale: "Visible filename extensions allows the user to identify the file type and the application it is associated with which leads to quick identification of misrepresented malicious files." + remediation: "Perform the following to implement the prescribed state: 1. Select Finder 2. Select Preferences 3. Check Show all filename extensions Alternatively, use the following command: defaults write NSGlobalDomain AppleShowAllExtensions -bool true" + compliance: + - cis: ["6.2"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read NSGlobalDomain AppleShowAllExtensions -> 1" + + # 6.3 Disable the automatic run of safe files in Safari (Automated) + - id: 18063 + title: "Disable the automatic run of safe files in Safari." + description: "Safari will automatically run or execute what it considers safe files. This can include installers and other files that execute on the operating system. Safari bases file safety by using a list of filetypes maintained by Apple. The list of files include text, image, video and archive formats that would be run in the context of the OS rather than the browser." + rationale: "Hackers have taken advantage of this setting via drive-by attacks. These attacks occur when a user visits a legitimate website that has been corrupted. The user unknowingly downloads a malicious file either by closing an infected pop-up or hovering over a malicious banner. An attacker can create a malicious file that will fall within Safari's safe file list that will download and execute without user input." + remediation: 'Perform the following to implement the prescribed state: 1. Open Safari 2. Select Safari from the menu bar 3. Select Preferences 4. Select General 5. Uncheck Open "safe" files after downloading Alternatively run the following command in Terminal: defaults write com.apple.Safari AutoOpenSafeDownloads -boolean no Terminal Method: Run the following command to disable safe files from not opening in Safari: sudo -u defaults write /Users//LibraryContainers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari AutoOpenSafeDownloads -bool false' + compliance: + - cis: ["6.3"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read com.apple.Safari AutoOpenSafeDownloads -> 0" diff --git a/etc/ruleset/sca/darwin/21/cis_apple_macOS_12.0.yml b/etc/ruleset/sca/darwin/21/cis_apple_macOS_12.0.yml new file mode 100644 index 0000000000..d4c96f239d --- /dev/null +++ b/etc/ruleset/sca/darwin/21/cis_apple_macOS_12.0.yml @@ -0,0 +1,1085 @@ +# Security Configuration Assessment +# CIS Checks for macOS 11.x +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Apple macOS 12.0 Monterey Benchmark v1.1.0 - 06-20-2022 +policy: + id: "cis_apple_macos_12.x" + file: "cis_apple_macOS_12.0.yml" + name: "CIS Apple macOS 12.0 Monterey Benchmark v1.1.0" + description: "This document, CIS Apple macOS 12.0 Monterey Benchmark provides prescriptive guidance for establishing a secure configuration posture for Apple macOS 12.0 Monterey. This guide was tested against Apple macOS 12.0 Monterey." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check macOS version." + description: "Requirements for running the SCA scan against macOS 12.x (Monterey)." + condition: any + rules: + - 'c:sw_vers -> r:^ProductVersion:\t*\s*12\p' + - 'c:system_profiler SPSoftwareDataType -> r:System Version:\.*12\p' + - 'c:defaults read loginwindow SystemVersionStampAsString -> r:^\t*\s*12\p' + +checks: + ############################################################ + #1 Install Updates, Patches and Additional Security Software + ############################################################ + # 1.1 Ensure All Apple-provided Software Is Current (Automated) + - id: 29000 + title: "Ensure All Apple-provided Software Is Current." + description: "Software vendors release security patches and software updates for their products when security vulnerabilities are discovered. There is no simple way to complete this action without a network connection to an Apple software repository. Please ensure appropriate access for this control. This check is only for what Apple provides through software update." + rationale: "It is important that these updates be applied in a timely manner to prevent unauthorized persons from exploiting the identified vulnerabilities." + remediation: "1. In Terminal, run the following command to verify what packages need to be installed: sudo softwareupdate -l. 2.1. In Terminal, run the following command to install all the packages that need to be updated: sudo software -i -a -R. 2.2. In Terminal, run the following for any packages that show up in step 1: sudo softwareupdate -i packagename'" + compliance: + - cis: ["1.1"] + - cis_level: ["1"] + condition: all + rules: + - "c:softwareupdate -l -> r:No new software available" + + # 1.2 Ensure Auto Update Is Enabled (Automated) + - id: 29001 + title: "Ensure Auto Update Is Enabled." + description: 'Auto Update verifies that your system has the newest security patches and software updates. If "Automatically check for updates" is not selected background updates for new malware definition files from Apple for XProtect and Gatekeeper will not occur.' + rationale: "It is important that a system has the newest updates applied so as to prevent unauthorized persons from exploiting identified vulnerabilities." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true" + compliance: + - cis: ["1.2"] + - cis_level: ["1"] + references: + - https://macops.ca/os-x-admins-your-clients-are-not-getting-background-security-updates/ + - https://derflounder.wordpress.com/2014/12/17/forcing-xprotect-blacklist-updates-on-mavericks-and-yosemite/ + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -> r:^1$" + - 'c:sh -c "profiles -P -o stdout | grep AutomaticCheckEnabled" -> r:AutomaticCheckEnabled\s*=\s*1' + + # 1.3 Ensure Download New Updates When Available is Enabled (Automated) + - id: 29002 + title: "Ensure Download New Updates When Available is Enabled." + description: 'In the GUI both "Install macOS updates" and "Install app updates from the App Store" are dependent on whether "Download new updates when available" is selected.' + rationale: "It is important that a system has the newest updates downloaded so that they can be applied." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true" + compliance: + - cis: ["1.3"] + - cis_level: ["1"] + references: + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -> r:^1$" + - 'c:sh -c "profiles -P -o stdout | grep AutomaticDownload" -> r:AutomaticDownload\s*=\s*1' + + # 1.4 Ensure Installation of App Update Is Enabled (Automated) + - id: 29003 + title: "Ensure Installation of App Update Is Enabled." + description: "Ensure that application updates are installed after they are available from Apple. These updates do not require reboots or admin privileges for end users." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited." + remediation: "Open a terminal session and enter the following command to enable the auto update feature: sudo defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool TRUE" + compliance: + - cis: ["1.4"] + - cis_level: ["1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> r:^1$" + - 'c:sh -c "profiles -P -o stdout | grep AutomaticallyInstallAppUpdates" -> r:AutomaticallyInstallAppUpdates\s*=\s*1' + + # 1.5 Ensure System Data Files and Security Updates Are Downloaded Automatically Is Enabled (Automated) + - id: 29004 + title: "Ensure System Data Files and Security Updates Are Downloaded Automatically Is Enabled." + description: "Ensure that system and security updates are installed after they are available from Apple. This setting enables definition updates for XProtect and Gatekeeper. With this setting in place new malware and adware that Apple has added to the list of malware or untrusted software will not execute. These updates do not require reboots or end user admin rights." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited." + remediation: "Open a terminal session and enter the following command to enable install system data files and security updates: sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true && sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true" + compliance: + - cis: ["1.5"] + - cis_level: ["1"] + references: + - https://www.thesafemac.com/tag/xprotect/ + - https://support.apple.com/en-us/HT202491 + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -> r:^1$" + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -> r:^1$" + + # 1.6 Ensure Install of macOS Updates Is Enabled (Automated) + - id: 29005 + title: "Ensure Install of macOS Updates Is Enabled." + description: "Ensure that macOS updates are installed after they are available from Apple. This setting enables macOS updates to be automatically installed. Some environments will want to approve and test updates before they are delivered. It is best practice to test first where updates can and have caused disruptions to operations. Automatic updates should be turned off where changes are tightly controlled and there are mature testing and approval processes. Automatic updates should not be turned off so the admin can call the users first to let them know it's ok to install. A dependable, repeatable process involving a patch agent or remote management tool should be in place before auto-updates are turned off." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited." + remediation: "Run the following command to to enable automatic checking and installing of macOS updates: sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates -bool TRUE" + compliance: + - cis: ["1.6"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates -> r:^1$" + - 'c:sh -c "profiles -P -o stdout | grep AutomaticallyInstallMacOSUpdates" -> r:AutomaticallyInstallMacOSUpdates\s*=\s*1' + + # 1.7 Audit Computer Name (Manual) - Not implemented + + ############################################################ + #2 System Preferences + ############################################################ + #2.1 Bluetooth + ############################################################ + + # 2.1.1 Ensure Bluetooth Is Disabled If No Devices Are Paired (Automated) + - id: 29006 + title: "Ensure Bluetooth Is Disabled If No Devices Are Paired." + description: "Bluetooth devices use a wireless communications system that replaces the cables used by other peripherals to connect to a system. It is by design a peer-to-peer network technology and typically lacks centralized administration and security enforcement infrastructure." + rationale: "Bluetooth is particularly susceptible to a diverse set of security vulnerabilities involving identity detection, location tracking, denial of service, unintended control and access of data and voice channels, and unauthorized device control and data access." + remediation: "Open a terminal session and enter the following command to disable bluetooth: sudo defaults write /Library/Preferences/com.apple.Bluetooth ControllerPowerState -int 0 && sudo killall -HUP bluetoothd" + compliance: + - cis: ["2.1.1"] + - cis_level: ["1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.Bluetooth ControllerPowerState -> r:^0$" + - "c:system_profiler SPBluetoothDataType -> r:Connected: Yes" + + # 2.1.2 Ensure Show Bluetooth Status in Menu Bar Is Enabled (Automated) + - id: 29007 + title: "Ensure Show Bluetooth Status in Menu Bar Is Enabled." + description: "By showing the Bluetooth status in the menu bar, a small Bluetooth icon is placed in the menu bar. This icon quickly shows the status of Bluetooth, and can allow the user to quickly turn Bluetooth on or off." + rationale: 'Enabling "Show Bluetooth status in menu bar" is a security awareness method that helps understand the current state of Bluetooth, including whether it is enabled, discoverable, what paired devices exist, and what paired devices are currently active.' + remediation: "For each user, run the following command to enable Bluetooth status in the menu bar: sudo -u defaults -currentHost write com.apple.controlcenter.plist Bluetooth -int 18" + compliance: + - cis: ["2.1.2"] + - cis_level: ["1"] + condition: any + rules: + - "c:defaults -currentHost read com.apple.controlcenter.plist Bluetooth -> r:^1$8" + - 'c:sh -c "profiles -P -o stdout | grep Bluetooth" -> r:Bluetooth\s*=\s*1' + + ############################################################ + # 2.2 Date & Time + ############################################################ + # 2.2.1 Ensure "Set time and date automatically" Is Enabled (Automated) + - id: 29008 + title: 'Ensure "Set time and date automatically" Is Enabled' + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features." + remediation: "Run the following commands: sudo systemsetup -setnetworktimeserver sudo systemsetup -setusingnetworktime on. Run the following commands if you have not set, or need to set, a new time zone: sudo /usr/sbin/systemsetup -listtimezones sudo /usr/sbin/systemsetup -settimezone " + compliance: + - cis: ["2.2.1"] + - cis_level: ["1"] + condition: any + rules: + - 'c:systemsetup -getusingnetworktime -> r:Network Time:\s*\t*On' + - 'c:sh -c "profiles -P -o stdout | grep forceAutomaticDateAndTime" -> r:forceAutomaticDateAndTime\s*=\s*1' + + # 2.2.2 Ensure time set is within appropriate limits (Automated) + - id: 29009 + title: "Ensure time set is within appropriate limits." + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries. Ensure that time on the computer is within acceptable limits. Truly accurate time is measured within milliseconds. For this audit, a drift under four and a half minutes passes the control check. Since Kerberos is one of the important features of macOS integration into Directory systems the guidance here is to warn you before there could be an impact to operations. From the perspective of accurate time, this check is not strict, so it may be too great for your organization. Your organization can adjust to a smaller offset value as needed. Note: ntpdate has been deprecated with 10.14. sntp replaces that command. NOTE: set the correct network time server in the rules." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features. Audit check is for more than 4 minutes and 30 seconds ahead or behind." + remediation: "Run the following commands to ensure your time is set within an appropriate limit: sudo systemsetup -getnetworktimeserver -> Get the time server name and then run: sudo touch /var/db/ntp-kod && sudo chown root:wheel /var/db/ntp-kod && sudo sntp -sS " + compliance: + - cis: ["2.2.2"] + - cis_level: ["1"] + condition: all + rules: + - "c:systemsetup -getnetworktimeserver -> r:Network Time Server:" + - 'c:sh -c "sntp time.apple.com | grep +/-" -> n:+(\d+)\.\d+\s+/- compare <= 270' + - 'c:sh -c "sntp time.apple.com | grep +/-" -> n:+\d+\.\d+\s+/-\s(\d+)\.\d+ compare <= 270' + + ############################################################ + # 2.3 Desktop & Screen Saver + ############################################################ + # 2.3.1 Ensure an Inactivity Interval of 20 Minutes Or Less for the Screen Saver Is Enabled (Automated) + - id: 29010 + title: "Ensure an Inactivity Interval of 20 Minutes Or Less for the Screen Saver Is Enabled." + description: "A locking screensaver is one of the standard security controls to limit access to a computer and the current user's session when the computer is temporarily unused or unattended. In macOS the screensaver starts after a value selected in a drop down menu, 10 minutes and 20 minutes are both options and either is acceptable. Any value can be selected through the command line or script but a number that is not reflected in the GUI can be problematic. 20 minutes is the default for new accounts." + rationale: "Setting an inactivity interval for the screensaver prevents unauthorized persons from viewing a system left unattended for an extensive period of time." + remediation: "Run the following command to verify that the idle time of the screen saver to 20 minutes or less (≤1200): $ sudo -u /usr/bin/defaults -currentHost write com.apple.screensaver idleTime -int . If there are multiple users out of compliance with the prescribed setting, run this command for each user to set their idle time: $ sudo -u /usr/bin/defaults -currentHost write com.apple.screensaver idleTime -int . Note: Issues arise if the command line is used to make the setting something other than what is available in the GUI Menu. Choose either 1 (60), 2 (120), 5 (300), 10 (600), or 20 (120) minutes to avoid any issues. Profile Method: 1. Create or edit a configuration profile with the PayLoadType of com.apple.screensaver.user 2. Add the key idleTime 3. Set the key to <≤1200> " + compliance: + - cis: ["2.3.1"] + - cis_level: ["1"] + condition: any + rules: + - "not c:defaults -currentHost read com.apple.screensaver idleTime -> r:does not exist" + - 'c:defaults -currentHost read com.apple.screensaver idleTime -> n:^(\d+)$ compare <= 1200' + - 'c:sh -c "profiles -P -o stdout | grep idleTime" -> n:idleTime\s*=\s*(\d+) compare <= 1200' + + # 2.3.2 Ensure Screen Saver Corners Are Secure (Automated) + - id: 29011 + title: "Ensure Screen Saver Corners Are Secure." + description: "Hot Corners can be configured to disable the screen saver by moving the mouse cursor to a corner of the screen." + rationale: "Setting a hot corner to disable the screen saver poses a potential security risk since an unauthorized person could use this to bypass the login screen and gain access to the system." + remediation: "Run the following command to turn off Disable Screen Saver for a Hot Corner: sudo -u defaults write com.apple.dock -int 0 " + compliance: + - cis: ["2.3.2"] + - cis_level: ["2"] + condition: all + rules: + - "c:defaults read com.apple.dock wvous-tl-corner -> !r:^6$" + - "c:defaults read com.apple.dock wvous-bl-corner -> !r:^6$" + - "c:defaults read com.apple.dock wvous-tr-corner -> !r:^6$" + - "c:defaults read com.apple.dock wvous-br-corner -> !r:^6$" + + # 2.3.3 Audit Lock Screen and Start Screen Saver Tools (Manual) -> Not implemented + + ############################################################ + # 2.4 Sharing + ############################################################ + # 2.4.1 Ensure Remote Apple Events Is Disabled (Automated) + - id: 29012 + title: "Ensure Remote Apple Events Is Disabled." + description: "Apple Events is a technology that allows one program to communicate with other programs. Remote Apple Events allows a program on one computer to communicate with a program on a different computer." + rationale: "Disabling Remote Apple Events mitigates the risk of an unauthorized program gaining access to the system." + remediation: "Run the following command in Terminal: sudo systemsetup -setremoteappleevents off" + compliance: + - cis: ["2.4.1"] + - cis_level: ["1"] + condition: all + rules: + - 'c:systemsetup -getremoteappleevents -> r:Remote Apple Events:\s*\t*Off' + + # 2.4.2 Ensure Internet Sharing Is Disabled (Automated) + - id: 29013 + title: "Ensure Internet Sharing Is Disabled" + description: "Internet Sharing uses the open source natd process to share an internet connection with other computers and devices on a local network. This allows the Mac to function as a router and share the connection to other, possibly unauthorized, devices." + rationale: "Disabling Internet Sharing reduces the remote attack surface of the system." + remediation: "Run the following command to turn off Internet Sharing: sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict Enabled -int 0" + compliance: + - cis: ["2.4.2"] + - cis_level: ["1"] + condition: none + rules: + - 'c:defaults read /Library/Preferences/SystemConfiguration/com.apple.nat -> r:Enabled\s*\t*=\s*\t*1' + - 'c:sh -c "profiles -P -o stdout | grep forceInternetSharingOff" -> r:forceInternetSharingOff\s*=\s*1' + + # 2.4.3 Ensure Screen Sharing Is Disabled (Automated) + - id: 29014 + title: "Ensure Screen Sharing Is Disabled." + description: "Screen Sharing allows a computer to connect to another computer on a network and display the computer’s screen. While sharing the computer’s screen, the user can control what happens on that computer, such as opening documents or applications, opening, moving, or closing windows, and even shutting down the computer." + rationale: "Disabling Screen Sharing mitigates the risk of remote connections being made without the user of the console knowing that they are sharing the computer." + remediation: "Run the following command to turn off Screen Sharing: sudo launchctl disable system/com.apple.screensharing" + compliance: + - cis: ["2.4.3"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "launchctl print-disabled system | grep -c ''\"com.apple.screensharing\" => true''" -> 1' + + # 2.4.4 Ensure Printer Sharing Is Disabled (Automated) + - id: 29015 + title: "Ensure Printer Sharing Is Disabled." + description: "By enabling Printer Sharing the computer is set up as a print server to accept print jobs from other computers. Dedicated print servers or direct IP printing should be used instead." + rationale: "Disabling Printer Sharing mitigates the risk of attackers attempting to exploit the print server to gain access to the system." + remediation: "Run the following command in Terminal: sudo cupsctl --no-share-printers" + compliance: + - cis: ["2.4.4"] + - cis_level: ["1"] + references: + - https://support.apple.com/kb/PH11450 + condition: all + rules: + - 'c:sh -c "cupsctl | grep _share_printers | cut -d ''='' -f2" -> 0' + + # 2.4.5 Ensure Remote Login Is Disabled (Automated) + - id: 29016 + title: "Ensure Remote Login Is Disabled." + description: "Remote Login allows an interactive terminal connection to a computer." + rationale: "Disabling Remote Login mitigates the risk of an unauthorized person gaining access to the system via Secure Shell (SSH). While SSH is an industry standard to connect to posix servers, the scope of the benchmark is for Apple macOS clients, not servers. macOS does have an IP based firewall available (pf, ipfw has been deprecated) that is not enabled or configured. There are more details and links in section 7.5. macOS no longer has TCP Wrappers support built-in and does not have strong Brute-Force password guessing mitigations, or frequent patching of openssh by Apple. Most macOS computers are mobile workstations, managing IP based firewall rules on mobile devices can be very resource intensive. All of these factors can be parts of running a hardened SSH server." + remediation: "Run the following command in Terminal: sudo systemsetup -setremotelogin off" + compliance: + - cis: ["2.4.5"] + - cis_level: ["1"] + condition: all + rules: + - 'c:systemsetup -getremotelogin -> r:Remote Login:\s*\t*Off' + + # 2.4.6 Ensure DVD or CD Sharing Is Disabled (Automated) + - id: 29017 + title: "Ensure DVD or CD Sharing Is Disabled." + description: "DVD or CD Sharing allows users to remotely access the system's optical drive. While Apple does not ship Macs with built-in optical drives any longer, external optical drives are still recognized when they are connected. In testing the sharing of an external optical drive persists when a drive is reconnected." + rationale: "Disabling DVD or CD Sharing minimizes the risk of an attacker using the optical drive as a vector for attack and exposure of sensitive data." + remediation: "Run the following command to disable DVD or CD sharing: sudo launchctl disable system/com.apple.ODSAgent " + compliance: + - cis: ["2.4.6"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "launchctl print-disabled system | grep -c ''\"com.apple.ODSAgent\" => true''" -> 1' + + # 2.4.7 Ensure Bluetooth Sharing Is Disabled (Automated) + - id: 29018 + title: "Ensure Bluetooth Sharing Is Disabled." + description: "Bluetooth Sharing allows files to be exchanged with Bluetooth enabled devices." + rationale: "Disabling Bluetooth Sharing minimizes the risk of an attacker using Bluetooth to remotely attack the system." + remediation: "Run the following command to disable Bluetooth Sharing is disabled: sudo -u /usr/bin/defaults -currentHost write com.apple.Bluetooth PrefKeyServicesEnabled -bool false" + compliance: + - cis: ["2.4.7"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults -currentHost read com.apple.Bluetooth PrefKeyServicesEnabled -> r:^0$" + - 'c:sh -c "profiles -P -o stdout | grep PrefKeyServicesEnabled" -> r:PrefKeyServicesEnabled\s*=\s*0|^[^\W]*$' + + # 2.4.8 Ensure File Sharing Is Disabled (Automated) + - id: 29019 + title: "Ensure File Sharing Is Disabled." + description: "Server Message Block (SMB), Common Internet File System (CIFS) When Windows (or possibly Linux) computers need to access file shared on a Mac, SMB/CIFS file sharing is commonly used. Apple warns that SMB sharing stores passwords is a less secure fashion than AFP sharing and anyone with system access can gain access to the password for that account. When sharing with SMB, each user that will access the Mac must have SMB enabled." + rationale: "By disabling file sharing, the remote attack surface and risk of unauthorized access to files stored on the system is reduced." + remediation: "Run the following command to disable SMB file sharing: sudo launchctl disable system/com.apple.smbd " + compliance: + - cis: ["2.4.8"] + - cis_level: ["1"] + condition: none + rules: + - 'c:sh -c "launchctl print-disabled system | grep -c ''\"com.apple.smbd\" => true''" -> 1' + + # 2.4.9 Ensure Remote Management Is Disabled (Automated) + - id: 29020 + title: "Ensure Remote Management Is Disabled." + description: "Remote Management is the client portion of Apple Remote Desktop (ARD). Remote Management can be used by remote administrators to view the current screen, install software, report on, and generally manage client Macs. The screen sharing options in Remote Management are identical to those in the Screen Sharing section. In fact, only one of the two can be configured. If Remote Management is used, refer to the Screen Sharing section above on issues regard screen sharing. Remote Management should only be enabled when a Directory is in place to manage the accounts with access. Computers will be available on port 5900 on a macOS System and could accept connections from untrusted hosts depending on the configuration, definitely a concern for mobile systems." + rationale: "Remote Management should only be enabled on trusted networks with strong user controls present in a Directory system. Mobile devices without strict controls are vulnerable to exploit and monitoring." + remediation: "Run the following command to disable Remote Management: sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate -stop" + compliance: + - cis: ["2.4.9"] + - cis_level: ["1"] + condition: all + rules: + - "not p:/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent" + + # 2.4.10 Ensure Content Caching Is Disabled (Automated) + - id: 29021 + title: "Ensure Content Caching Is Disabled." + description: "Starting with 10.13 (macOS High Sierra) Apple introduced a service to make it easier to deploy data from Apple, including software updates, where there are bandwidth constraints to the Internet and fewer constraints and greater bandwidth on the local subnet. This capability can be very valuable for organizations that have throttled and possibly metered Internet connections. In heterogeneous enterprise networks with multiple subnets the effectiveness of this capability would be determined on how many Macs were on each subnet at the time new large updates were made available upstream. This capability requires the use of mac OS clients as P2P nodes for updated Apple content. Unless there is a business requirement to manage operational Internet connectivity bandwidth user endpoints should not store content and act as a cluster to provision data." + rationale: "The main use case for Mac computers is as mobile user endpoints. P2P sharing services should not be enabled on laptops that are using untrusted networks. Content Caching can allow a computer to be a server for local nodes on an untrusted network. While there are certainly logical controls that could be used to mitigate risk they add to the management complexity, since the value of the service is in specific use cases organizations with the use case described above can accept risk as necessary." + remediation: "Run the following command to disable Content Caching:: sudo AssetCacheManagerUtil deactivate" + compliance: + - cis: ["2.4.10"] + - cis_level: ["2"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.AssetCache.plist Activated -> r:^0$" + - 'c:sh -c "profiles -P -o stdout | grep allowContentCaching" -> r:allowContentCaching\s*=\s*0' + + # 2.4.11 Ensure AirDrop Is Disabled (Automated) + - id: 29022 + title: "Ensure AirDrop Is Disabled." + description: "AirDrop is Apple's built-in on demand ad hoc file exchange system that is compatible with both macOS and iOS. It uses Bluetooth LE for discovery that limits connectivity to Mac or iOS users that are in close proximity. Depending on the setting it allows everyone or only Contacts to share files when they are nearby to each other. In many ways this technology is far superior to the alternatives. The file transfer is done over a TLS encrypted session, does not require any open ports that are required for file sharing, does not leave file copies on email servers or within cloud storage, and allows for the service to be mitigated so that only people already trusted and added to contacts can interact with you. While there are positives to AirDrop, there are privacy concerns that could expose personal information. For that reason, AirDrop should be disabled, and should only be enabled when needed and disabled afterwards." + rationale: "AirDrop can allow malicious files to be downloaded from unknown sources. Contacts Only limits may expose personal information to devices in the same area." + remediation: "Run the following commands to disable AirDrop: sudo -u defaults write com.apple.NetworkBrowser DisableAirDrop -bool true" + references: + - "https://www.techrepublic.com/article/apple-airdrop-users-reportedly-vulnerable-to-security-flaw/" + - "https://www.imore.com/how-apple-keeps-your-airdrop-files-private-and-secure" + - "https://en.wikipedia.org/wiki/AirDrop" + compliance: + - cis: ["2.4.11"] + - cis_level: ["1"] + condition: any + rules: + - "c:defaults read com.apple.NetworkBrowser DisableAirDrop -> r:^1$" + - 'c:sh -c "profiles -P -o stdout | grep DisableAirDrop" -> r:DisableAirDrop\s*=\s*1' + + # 2.4.12 Ensure Media Sharing Is Disabled (Automated) + - id: 29023 + title: "Ensure Media Sharing Is Disabled." + description: "Starting with macOS 10.15 Apple has provided a control to allow a user to share Apple downloaded content on all Apple devices that are signed in with the same Apple ID. This allows a user to share downloaded Movies, Music or TV shows with other controlled macOS, iOS and iPadOS devices as well as photos with Apple TVs. With this capability guest users can also use media downloaded on the computer. The recommended best practice is not to use the computer as a server but to utilize Apple's cloud storage to download and use content stored there if content stored with Apple is used on multiple devices." + rationale: "Disabling Media Sharing reduces the remote attack surface of the system." + remediation: "Run the following command to disable Media Sharing: sudo -u defaults write com.apple.amp.mediasharingd home-sharing-enabled -int 0" + compliance: + - cis: ["2.4.12"] + - cis_level: ["2"] + references: + - https://support.apple.com/guide/mac-help/set-up-media-sharing-on-mac-mchlp13371337/mac + condition: any + rules: + - "c:defaults read com.apple.amp.mediasharingd home-sharing-enabled -> r:^0$|does not exist" + - 'c:sh -c "profiles -P -o stdout | grep homeSharingUIStatus" -> r:homeSharingUIStatus\s*=\s*0' + - 'c:sh -c "profiles -P -o stdout | grep legacySharingUIStatus" -> r:legacySharingUIStatus\s*=\s*0' + - 'c:sh -c "profiles -P -o stdout | grep mediaSharingUIStatus" -> r:mediaSharingUIStatus\s*=\s*0' + + # 2.4.13 Ensure AirPlay Receiver Is Disabled (Automated) - Not implemented + + ############################################################ + # 2.5 Security & Privacy + ############################################################ + # 2.5.1 Encryption + ############################################################ + # 2.5.1.1 Ensure FileVault Is Enabled (Automated) + - id: 29024 + title: "Ensure FileVault Is Enabled." + description: "FileVault secures a system's data by automatically encrypting its boot volume and requiring a password or recovery key to access it. FileVault may also be enabled using command line using the fdesetup command. To use this functionality, consult the Der Flounder blog for more details (see references)." + rationale: "Encrypting sensitive data minimizes the likelihood of unauthorized users gaining access to it." + remediation: "Perform the following to enable FileVault: 1. Open System Preferences 2. Select Security & Privacy 3. Select FileVault 4. Select Turn on FileVault" + compliance: + - cis: ["2.5.1.1"] + - cis_level: ["1"] + references: + - https://derflounder.wordpress.com/2015/02/02/managing-yosemites-filevault-2-with-fdesetup/ + - https://derflounder.wordpress.com/2019/01/15/unlock-or-decrypt-your-filevault-encrypted-boot-drive-from-the-command-line-on-macos-mojave/ + condition: all + rules: + - "c:fdesetup status -> r:^FileVault is On" + + # 2.5.1.2 Ensure all user storage APFS volumes are encrypted (Manual) - Not implemented + # 2.5.1.3 Ensure all user storage CoreStorage volumes are encrypted (Manual) - Not implemented + + ############################################################ + # 2.5.2 Firewall + ############################################################ + # 2.5.2.1 Ensure Gatekeeper is Enabled (Automated) + - id: 29025 + title: "Ensure Gatekeeper is Enabled." + description: "Gatekeeper is Apple's application allowlisting control that restricts downloaded applications from launching. It functions as a control to limit applications from unverified sources from running without authorization." + rationale: "Disallowing unsigned software will reduce the risk of unauthorized or malicious applications from running on the system." + remediation: "Run the following command to enable Gatekeeper to allow applications from App Store and identified developers: sudo /usr/sbin/spctl --master-enable" + compliance: + - cis: ["2.5.2.1"] + - cis_level: ["1"] + condition: any + rules: + - "c:spctl --status -> r:^assessments enabled" + - 'c:sh -c "profiles -P -o stdout | grep AllowIdentifiedDevelopers" -> r:AllowIdentifiedDevelopers\s*=\s*1' + - 'c:sh -c "profiles -P -o stdout | grep EnableAssessment" -> r:EnableAssessment\s*=\s*1' + + # 2.5.2.2 Ensure Firewall Is Enabled (Automated) + - id: 29026 + title: "Ensure Firewall Is Enabled." + description: "A firewall is a piece of software that blocks unwanted incoming connections to a system. Apple has posted general documentation about the application firewall." + rationale: "A firewall minimizes the threat of unauthorized users from gaining access to your system while connected to a network or the Internet." + remediation: "Run the following command to enable the firewall: sudo /usr/bin/defaults write /Library/Preferences/com.apple.alf globalstate -int For the , use either 1, specific services, or 2, essential services only." + compliance: + - cis: ["2.5.2.2"] + - cis_level: ["1"] + references: + - "https://support.apple.com/en-us/HT201642" + - "https://support.apple.com/en-ca/guide/security/seca0e83763f/web" + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.alf globalstate -> r:^1$|^2$" + - 'c:sh -c "profiles -P -o stdout | grep EnableFirewall" -> r:EnableFirewall\s*=\s*1' + + # 2.5.2.3 Ensure Firewall Stealth Mode Is Enabled (Automated) + - id: 29027 + title: "Ensure Firewall Stealth Mode Is Enabled." + description: "While in Stealth mode the computer will not respond to unsolicited probes, dropping that traffic." + rationale: "Stealth mode on the firewall minimizes the threat of system discovery tools while connected to a network or the Internet." + remediation: "Run the following command to enable stealth mode: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on" + compliance: + - cis: ["2.5.2.3"] + - cis_level: ["1"] + references: + - https://support.apple.com/en-us/HT201642 + condition: any + rules: + - "c:/usr/sbin/system_profiler SPFirewallDataType -> r:Stealth Mode: Yes" + - 'c:sh -c "profiles -P -o stdout | grep EnableStealthMode" -> r:EnableStealthMode\s*=\s*1' + + # 2.5.3 Ensure Location Services Is Enabled (Automated) + - id: 29028 + title: "Ensure Location Services Is Enabled." + description: "macOS uses location information gathered through local Wi-Fi networks to enable applications to supply relevant information to users. With the operating system verifying the location, users do not need to change the time or the time zone. The computer will change them based on the user's location. They do not need to specify their location for weather or travel times and even get alerts on travel times to meetings and appointment where location information is supplied. Location Services simplify some processes, for the purpose of asset management and time and log management, with mobile computers. There are some use cases where it is important that the computer not be able to report its exact location. While the general use case is to enable Location Services, it should not be allowed if the physical location of the computer and the user should not be public knowledge." + rationale: "Location Services are helpful in most use cases and can simplify log and time management where computers change time zones." + remediation: "Run the following command to enable Location Services: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locationd.plist" + compliance: + - cis: ["2.5.3"] + - cis_level: ["2"] + references: + - https://support.apple.com/en-us/HT204690 + condition: all + rules: + - 'c:sh -c "launchctl list | grep -c com.apple.locationd" -> 1' + + # 2.5.4 Audit Location Services Access (Manual) - Not implemented + + # 2.5.5 Ensure Sending Diagnostic and Usage Data to Apple Is Disabled (Automated) + - id: 29029 + title: "Ensure Sending Diagnostic and Usage Data to Apple Is Disabled." + description: "Apple provides a mechanism to send diagnostic and analytics data back to Apple to help them improve the platform. Information sent to Apple may contain internal organizational information that should be controlled and not available for processing by Apple. Turn off all Analytics and Improvements sharing. Share Mac Analytics (Share with App Developers dependent on Mac Analytic sharing) - Includes diagnostics, usage and location data. Share iCloud Analytics - Includes iCloud data and usage information." + rationale: "Organizations should have knowledge of what is shared with the vendor and the setting automatically forwards information to Apple." + remediation: "Perform the following to disable diagnostic data being sent to Apple: sudo /usr/bin/defaults write /Library/Application\ Support/CrashReporter/DiagnosticMessagesHistory.plist AutoSubmit -bool false, sudo /bin/chmod 644 /Library/Application\ Support/CrashReporter/DiagnosticMessagesHistory.plist, sudo /usr/sbin/chgrp admin /Library/Application\ Support/CrashReporter/DiagnosticMessagesHistory.plist" + compliance: + - cis: ["2.5.5"] + - cis_level: ["2"] + condition: any + rules: + - 'c:defaults read /Library/Application\ Support/CrashReporter/DiagnosticMessagesHistory.plist AutoSubmit -> r:^0$' + - 'c:sh -c "profiles -P -o stdout | grep allowDiagnosticSubmission" -> r:allowDiagnosticSubmission\s*=\s*0' + + # 2.5.6 Ensure Limit Ad Tracking Is Enabled (Automated) - Not implemented + # 2.5.7 Audit Camera Privacy and Confidentiality (Manual) - Not implemented + + ############################################################ + # 2.6 Apple ID + ############################################################ + ############################################################ + # 2.6.1 iCloud + ############################################################ + # 2.6.1.1 Audit iCloud Configuration (Manual) - Not impemented + # 2.6.1.2 Audit iCloud Keychain (Manual) - Not implemented + # 2.6.1.3 Audit iCloud Drive (Manual) - Not implemented + # 2.6.1.4 Ensure iCloud Drive Document and Desktop Sync is Disabled (Automated) - Not implemented + # 2.6.2 Audit App Store Password Settings (Manual) - Not implemented + + ############################################################ + # 2.7 Time Machine + ############################################################ + # 2.7.1 Ensure Backup Up Automatically is Enabled (Automated) + - id: 29030 + title: "Ensure Backup Up Automatically is Enabled." + description: 'Backup solutions are only effective if the backups run on a regular basis. The time to check for backups is before the hard drive fails or the computer goes missing. In order to simplify the user experience so that backups are more likely to occur Time Machine should be on and set to Back Up Automatically whenever the target volume is available. Operational staff should ensure that backups complete on a regular basis and the backups are tested to ensure that file restoration from backup is possible when needed. Backup dates are available even when the target volume is not available in the Time Machine plist. SnapshotDates = ( "2012-08-20 12:10:22 +0000", "2013-02-03 23:43:22 +0000", "2014-02-19 21:37:21 +0000", "2015-02-22 13:07:25 +0000", "2016-08-20 14:07:14 +0000" When the backup volume is connected to the computer more extensive information is available through tmutil. See man tmutil' + rationale: "Backups should automatically run whenever the backup drive is available." + remediation: "Run the following command to enable automatic backups if Time Machine is enabled: sudo /usr/bin/defaults write /Library/Preferences/com.apple.TimeMachine.plist AutoBackup -bool true" + compliance: + - cis: ["2.7.1"] + - cis_level: ["2"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.TimeMachine.plist AutoBackup -> r:^1$" + - 'c:sh -c "profiles -P -o stdout | grep AutoBackup" -> r:AutoBackup\s*=\s*1' + + # 2.7.2 Ensure Time Machine Volumes Are Encrypted (Automated) - Not implemented + + # 2.8 Ensure Wake for Network Access Is Disabled (Automated) + - id: 29031 + title: "Ensure Wake for Network Access Is Disabled." + description: "This feature allows the computer to take action when the user is not present and the computer is in energy saving mode. These tools require FileVault to remain unlocked and fully rejoin known networks. This macOS feature is meant to allow the computer to resume activity as needed regardless of physical security controls. This feature allows other users to be able to access your computer’s shared resources, such as shared printers or iTunes playlists, even when your computer is in sleep mode. In a closed network when only authorized devices could wake a computer it could be valuable to wake computers in order to do management push activity. Where mobile workstations and agents exist the device will more likely check in to receive updates when already awake. Mobile devices should not be listening for signals on any unmanaged network or where untrusted devices exist that could send wake signals." + rationale: "Disabling this feature mitigates the risk of an attacker remotely waking the system and gaining access." + remediation: "Perform the following disable Wake for network access or Power Nap: Run the following command to disable Wake for network access: sudo pmset -a womp 0 " + compliance: + - cis: ["2.8"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "pmset -g | grep -e womp" -> r:0' + + # 2.9 Ensure Power Nap Is Disabled (Automated) + - id: 29032 + title: "Ensure Power Nap Is Disabled." + description: "This feature allows the computer to take action when the user is not present and the computer is in energy saving mode. These tools require FileVault to remain unlocked and fully rejoin known networks. This macOS feature is meant to allow the computer to resume activity as needed regardless of physical security controls. Power Nap allows the system to stay in low power mode, especially while on battery power and periodically connect to previously named networks with stored credentials for user applications to phone home and get updates. This capability requires FileVault to remain unlocked and the use of previously joined networks to be risk accepted based on the SSID without user input. This control has been updated to check the status on both battery and AC Power. The presence of an electrical outlet does not completely correlate with logical and physical security of the device or available networks." + rationale: "Disabling this feature mitigates the risk of an attacker remotely waking the system and gaining access. The use of Power Nap adds to the risk of compromised physical and logical security. The user should be able to decrypt FileVault and have the applications download what is required when the computer is actively used. The control to prevent computer sleep has been retired for this version of the Benchmark. Forcing the computer to stay on and use energy in case a management push is needed is contrary to most current management processes. Only keep computers unslept if after hours pushes are required on closed LANs." + remediation: "Perform the following disable Wake for network access or Power Nap: sudo pmset -a powernap 0" + compliance: + - cis: ["2.9"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "pmset -g everything | grep powernap | grep -c 1" -> r:^0$' + + # 2.10 Ensure Secure Keyboard Entry terminal.app is Enabled (Automated) + - id: 29033 + title: "Ensure Secure Keyboard Entry terminal.app is Enabled." + description: "Secure Keyboard Entry prevents other applications on the system and/or network from detecting and recording what is typed into Terminal." + rationale: "Enabling Secure Keyboard Entry minimizes the risk of a key logger from detecting what is entered in Terminal." + remediation: "Perform the following to enable secure keyboard entries in Terminal: sudo -u /usr/bin/defaults write -app Terminal SecureKeyboardEntry -bool true" + compliance: + - cis: ["2.10"] + - cis_level: ["1"] + references: + - "https://support.apple.com/en-ca/guide/terminal/trml109/2.11" + condition: all + rules: + - "c:defaults read -app Terminal SecureKeyboardEntry -> r:^1$|does not exist" + - 'c:sh -c "profiles -P -o stdout | grep SecureKeyboardEntry" -> r:SecureKeyboardEntry\s*=\s*1' + + # 2.11 Ensure EFI Version Is Valid and Checked Regularly (Automated) + - id: 29034 + title: "Ensure EFI Version Is Valid and Checked Regularly." + description: "In order to mitigate firmware attacks Apple has created an automated Firmware check to ensure that the EFI version running is a known good version from Apple. There is also an automated process to check it every seven days." + rationale: "If the Firmware of a computer has been compromised the Operating System that the Firmware loads cannot be trusted either." + remediation: "If EFI does not pass the integrity check you may send a report to Apple. Backing up files and clean installing a known good Operating System and Firmware is recommended." + compliance: + - cis: ["2.11"] + - cis_level: ["1"] + condition: any + rules: + - "c:/usr/libexec/firmwarecheckers/eficheck/eficheck --integrity-check -> No changes detected in primary hashes" + - 'c:/usr/libexec/firmwarecheckers/eficheck/eficheck --integrity-check -> MBP133\.' + - 'c:sh -c "system_profiler SPiBridgeDataType | grep \"T2\"" -> r:Model Name: Apple T2 Security Chip' + - 'c:sh -c "launchctl list | grep com.apple.driver.eficheck" -> r:com.apple.driver.eficheck' + + # 2.12 Audit Automatic Actions for Optical Media (Manual) - Not implemented + # 2.13 Audit Siri Settings (Manual) - Not implemented + # 2.14 Audit Sidecar Settings (Manual) - Not implemented + # 2.15 Audit Touch ID and Wallet & Apple Pay Settings (Manual) - Not implemented + # 2.16 Audit Notification System Preference Settings (Manual) - Not implemented + # 2.17 Audit Passwords System Preference Setting (Manual) - Not implemented + + ############################################################ + # 3 Logging and Auditing + ############################################################ + # 3.1 Ensure Security Auditing Is Enabled (Automated) + - id: 29035 + title: "Ensure Security Auditing Is Enabled." + description: "macOS's audit facility, auditd, receives notifications from the kernel when certain system calls, such as open, fork, and exit, are made. These notifications are captured and written to an audit log." + rationale: "Logs generated by auditd may be useful when investigating a security incident as they may help reveal the vulnerable application and the actions taken by a malicious actor." + remediation: "Run the following command to load auditd: sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.auditd.plist" + compliance: + - cis: ["3.1"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "launchctl list | grep -i auditd" -> r:com.apple.auditd' + + # 3.2 Ensure Security Auditing Flags Are Configured Per Local Organizational Requirements (Automated) - Not implemented + + # 3.3 Ensure install.log Is Retained for 365 or More Days and No Maximum Size (Automated) + - id: 29036 + title: "Ensure install.log Is Retained for 365 or More Days and No Maximum Size." + description: 'macOS writes information pertaining to system-related events to the file /var/log/install.log and has a configurable retention policy for this file. The default logging setting limits the file size of the logs and the maximum size for all logs. The default allows for an errant application to fill the log files and does not enforce sufficient log retention. The Benchmark recommends a value based on standard use cases. The value should align with local requirements within the organization. The default value has an "all_max" file limitation, no reference to a minimum retention and a less precise rotation argument. The all_max flag control will remove old log entries based only on the size of the log files. Log size can vary widely depending on how verbose installing applications are in their log entries. The decision here is to ensure that logs go back a year and depending on the applications a size restriction could compromise the ability to store a full year. While this Benchmark is not scoring for a rotation flag the default rotation is sequential rather than using a timestamp. Auditors may prefer timestamps in order to simply review specific dates where event information is desired. Please review the File Rotation section in the man page for more information. man asl.conf - The maximum file size limitation string should be removed "all_max=" - An organization appropriate retention should be added "ttl=" - The rotation should be set with timestamps "rotate=utc" or "rotate=local"' + rationale: "Archiving and retaining install.log for at least a year is beneficial in the event of an incident as it will allow the user to view the various changes to the system along with the date and time they occurred." + remediation: "Perform the following to ensure that install logs are retained for at least 365 days: Edit the /etc/asl/com.apple.install file and add or modify the ttl value to 365 or greater on the file line. Also, remove the all_max= setting and value from the file line." + compliance: + - cis: ["3.3"] + - cis_level: ["1"] + condition: all + rules: + - 'c:grep -i ttl /etc/asl/com.apple.install -> n:ttl=(\d+) compare > 364' + - "not c:grep -i all_max= /etc/asl/com.apple.install -> r:all_max=" + + # 3.4 Ensure Security Auditing Retention Is Enabled (Automated) - Not implemented + + # 3.5 Ensure Access to Audit Records Is Controlled (Automated) + - id: 29037 + title: "Ensure Access to Audit Records Is Controlled." + description: "The audit system on macOS writes important operational and security information that can be both useful for an attacker and a place for an attacker to attempt to obfuscate unwanted changes that were recorded. As part of defense-in-depth the /etc/security/audit_control configuration and the files in /var/audit should be owned only by root with group wheel with read-only rights and no other access allowed. macOS ACLs should not be used for these files." + rationale: "Audit records should never be changed except by the system daemon posting events. Records may be viewed or extracts manipulated, but the authoritative files should be protected from unauthorized changes." + remediation: "Run the following to commands to set the audit records to the root user and wheel group: sudo chown -R root:wheel /etc/security/audit_control, sudo chmod -R o-rw /etc/security/audit_control, sudo chown -R root:wheel /var/audit/, sudo chmod -R o-rw /var/audit/ Note: It is recommended to do a thorough verification process on why the audit logs have been changed before following the remediation steps. If the system has different access controls on the audit logs, and the changes cannot be traced, a new install may be prudent. Check for signs of file tampering as well as unapproved OS changes." + compliance: + - cis: ["3.5"] + - cis_level: ["1"] + condition: all + rules: + - 'c:ls -le /etc/security/audit_control -> r:root\s*\t*wheel|root' + - "not c:ls -le /etc/security/audit_control -> r:[-r]{7}r-|[-r]{7}-w|[-r]{7}rw" + - 'c:ls -le /var/audit/ -> r:root\s*\t*wheel|root' + - "not c:ls -le /var/audit -> r:[-r]{7}r-|[-r]{7}-w|[-r]{7}rw" + + # 3.6 Ensure Firewall Logging Is Enabled and Configured (Automated) + - id: 29038 + title: "Ensure Firewall Logging Is Enabled and Configured." + description: 'The socketfilter firewall is what is used when the firewall is turned on in the Security Preference Pane. In order to appropriately monitor what access is allowed and denied logging must be enabled. The logging level must be set to "detailed" to be useful in monitoring connection attempts that the firewall detects. Throttled login is not sufficient for examine firewall connection attempts.' + rationale: "In order to troubleshoot the successes and failures of a firewall, detailed logging should be enabled." + remediation: "Run the following command to enable logging of the firewall: sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setloggingmode on. sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setloggingopt detail." + compliance: + - cis: ["3.6"] + - cis_level: ["1"] + condition: any + rules: + - 'c:sh -c "system_profiler SPFirewallDataType | /usr/bin/grep Logging" -> r:Firewall Logging: Yes' + - "c:defaults read read /Library/Preferences/com.apple.alf.plist loggingoption -> r:^2$" + - 'c:sh -c "profiles -P -o stdout | grep EnableLogging" -> r:EnableLogging\s*=\s*1' + - 'c:sh -c "profiles -P -o stdout | grep LoggingOption" -> r:LoggingOption\s*=\s*detail' + + # 3.7 Audit Software Inventory (Manual) - Not implemented + + ############################################################ + # 4 Network Configurations + ############################################################ + # 4.1 Ensure Bonjour Advertising Services Is Disabled (Automated) + - id: 29039 + title: "Ensure Bonjour Advertising Services Is Disabled." + description: "Bonjour is an auto-discovery mechanism for TCP/IP devices which enumerate devices and services within a local subnet. DNS on macOS is integrated with Bonjour and should not be turned off, but the Bonjour advertising service can be disabled." + rationale: 'Bonjour can simplify device discovery from an internal rogue or compromised host. An attacker could use Bonjour''s multicast DNS feature to discover a vulnerable or poorly- configured service or additional information to aid a targeted attack. Implementing this control disables the continuous broadcasting of "I''m here!" messages. Typical end-user endpoints should not have to advertise services to other computers. This setting does not stop the computer from sending out service discovery messages when looking for services on an internal subnet, if the computer is looking for a printer or server and using service discovery. To block all Bonjour traffic except to approved devices the pf or other firewall would be needed.' + remediation: "Run the following command to disable Bonjour Advertising services: sudo /usr/bin/defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool true" + compliance: + - cis: ["4.1"] + - cis_level: ["2"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -> r:^1$" + - 'c:sh -c "profiles -P -o stdout | grep NoMulticastAdvertisements" -> r:NoMulticastAdvertisements\s*=\s*1' + + # 4.2 Ensure Show Wi-Fi status in Menu Bar Is Enabled (Automated) - Not implemented + # 4.3 Audit Network Specific Locations (Manual) - Not implemented + + # 4.4 Ensure HTTP Server Is Disabled (Automated) + - id: 29040 + title: "Ensure HTTP Server Is Disabled." + description: "macOS used to have a graphical front-end to the embedded Apache web server in the Operating System. Personal web sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Personal web sharing from a user endpoint has long been considered questionable, and Apple has removed that capability from the GUI. Apache however is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end-user computer. Web sharing should only be done through hardened web servers and appropriate cloud services." + rationale: "Web serving should not be done from a user desktop. Dedicated webservers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." + remediation: "Run the following command to disable the http server services: sudo launchctl disable system/org.apache.httpd" + compliance: + - cis: ["4.4"] + - cis_level: ["1"] + condition: any + rules: + - 'c:sh -c "launchctl print-disabled system | grep -c ''\"org.apache.httpd\" => true''" -> 1' + + # 4.5 Ensure NFS Server Is Disabled (Automated) + - id: 29041 + title: "Ensure NFS Server Is Disabled." + description: "macOS can act as an NFS fileserver. NFS sharing could be enabled to allow someone on another computer to mount shares and gain access to information from the user's computer. File sharing from a user endpoint has long been considered questionable, and Apple has removed that capability from the GUI. NFSD is still part of the Operating System and can be easily turned on to export shares and provide remote connectivity to an end-user computer." + rationale: "File serving should not be done from a user desktop. Dedicated servers should be used. Open ports make it easier to exploit the computer." + remediation: "Run the following command to disable the nfsd fileserver services: sudo launchctl disable system/com.apple.nfsd. Remove the exported Directory listing: sudo rm /etc/exports" + compliance: + - cis: ["4.5"] + - cis_level: ["1"] + condition: none + rules: + - "f:/etc/exports" + - 'c:sh -c "launchctl print-disabled system | grep -c ''\"com.apple.nfsd\" => true''" -> 1' + + # 4.6 Audit Wi-Fi Settings (Manual) - Not implemented + + ############################################################ + # 5 System Access, Authentication and Authorization + ############################################################ + # 5.1 File System Permissions and Access Controls + ############################################################ + # 5.1.1 Ensure Home Folders Are Secure (Automated) - Not implemented + + # 5.1.2 Ensure System Integrity Protection Status (SIPS) Is Enabled (Automated) + - id: 29042 + title: "Ensure System Integrity Protection Status (SIPS) Is Enabled." + description: "System Integrity Protection is a security feature introduced in OS X 10.11 El Capitan. System Integrity Protection restricts access to System domain locations and restricts runtime attachment to system processes. Any attempt to inspect or attach to a system process will fail. Kernel Extensions are now restricted to /Library/Extensions and are required to be signed with a Developer ID." + rationale: "Running without System Integrity Protection on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by SIP." + remediation: "Perform the following to enable System Integrity Protection: 1. Reboot into the Recovery Partition (reboot and hold down Command (⌘) + R) 2. Select Utilities 3. Select Terminal 4. Run the following command: sudo /usr/bin/csrutil enable Successfully enabled System Integrity Protection. Please restart the machine for the changes to take effect. 5. Reboot the computer" + compliance: + - cis: ["5.1.2"] + - cis_level: ["1"] + condition: all + rules: + - "c:csrutil status -> r:^System Integrity Protection status: enabled." + + # 5.1.3 Ensure Apple Mobile File Integrity Is Enabled (Automated) + - id: 29043 + title: "Ensure Apple Mobile File Integrity Is Enabled." + description: "Apple Mobile File Integrity was first released in macOS 10.12, the daemon and service block attempts to run unsigned code. AMFI uses lanchd, code signatures, certificates, entitlements, and provisioning profiles to create a filtered entitlement dictionary for an app. AMFI is the macOS kernel module that enforces code-signing and library validation." + rationale: "Apple Mobile File Integrity (AMFI) validates that application code is validated." + remediation: 'Run the following command to enable the Apple Mobile File Integrity service: sudo /usr/sbin/nvram boot-args=""' + compliance: + - cis: ["5.1.3"] + - cis_level: ["1"] + references: + - "https://eclecticlight.co/2018/12/29/amfi-checking-file-integrity-on-your-mac/" + - "https://github.com/usnistgov/macos_security/issues/39" + - "https://github.com/usnistgov/macos_security/issues/40" + - "https://www.naut.ca/blog/2020/11/13/forbidden-commands-to-liberate-macos/" + condition: all + rules: + - 'c:sh -c "nvram -p | grep -c \"amfi_get_out_of_my_way=1\"" -> 0' + + # 5.1.4 Ensure Library Validation Is Enabled (Automated) + - id: 29044 + title: "Ensure Library Validation Is Enabled." + description: "Library Validation is a security feature introduced in macOS 10.10 Yosemite. Library Validation protects processes from loading arbitrary libraries. This stops root from loading arbitrary libraries into any process (depending on SIP status),and keeps root from becoming more powerful. Security is strengthened, because some user processes can no longer be fooled to run additional code without root's explicit request, which may grant access to daemons that depend on Library Validation for secure validation of code identity." + rationale: "Running without Library Validation on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by Library Validation." + remediation: "Run the following command to set library validation: sudo /usr/bin/defaults write /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation -bool false" + compliance: + - cis: ["5.1.4"] + - cis_level: ["1"] + references: + - "https://github.com/Automattic/wp-desktop/issues/790" + - "https://www.naut.ca/blog/2020/11/13/forbidden-commands-to-liberate-macos/" + - "http://www.newosxbook.com/articles/CodeSigning.pdf" + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.security.libraryvalidation.plist DisableLibraryValidation -> r:^0$" + - 'c:sh -c "profiles -P -o stdout | grep DisableLibraryValidation" -> r:DisableLibraryValidation\s*=\s*0' + + # 5.1.5 Ensure Sealed System Volume (SSV) Is Enabled (Automated) + - id: 29045 + title: "Ensure Sealed System Volume (SSV) Is Enabled." + description: "Sealed System Volume is a security feature introduced in macOS 11.0 Big Sur. During system installation, a SHA-256 cryptographic hash is calculated for all immutable system files and stored in a Merkle tree which itself is hashed as the Seal. Both are stored in the metadata of the snapshot created of the System volume. The seal is verified by the boot loader at startup. macOS will not boot if system files have been tampered with. If validation fails, the user will be instructed to reinstall the operating system. During read operations for files located in the Sealed System Volume, a hash is calculated and compared to the value stored in the Merkle tree." + rationale: "Running without Sealed System Volume on a production system could run the risk of Apple software, that integrates directly with macOS, being modified." + remediation: "Perform the following to enable System Integrity Protection: 1. Reboot into the Recovery Partition (reboot and hold down Command (⌘) + R) 2. Select an administrator's account and enter that account's password 3. Select Utilities 4. Select Terminal 5. Run the following command: sudo /usr/bin/csrutil enable authenticated-root 6. Reboot the computer." + compliance: + - cis: ["5.1.5"] + - cis_level: ["1"] + references: + - "https://developer.apple.com/news/?id=3xpv8r2m" + - "https://eclecticlight.co/2020/11/30/is-big-surs-system-volume-sealed/" + - "https://eclecticlight.co/2020/06/25/big-surs-signed-system-volume-added-security-protection/" + condition: all + rules: + - "c:csrutil authenticated-root status -> r:^Authenticated Root status: enabled" + + # 5.1.6 Ensure Appropriate Permissions Are Enabled for System Wide Applications (Automated) + - id: 29046 + title: "Ensure Appropriate Permissions Are Enabled for System Wide Applications." + description: "Applications in the System Applications Directory (/Applications) should be world executable since that is their reason to be on the system. They should not be world-writable and allow any process or user to alter them for other processes or users to then execute modified versions." + rationale: "Unauthorized modifications of applications could lead to the execution of malicious code." + remediation: "Run the following command to change the permissions for each application that does not meet the requirements: sudo chmod -R o-w /Applications/" + compliance: + - cis: ["5.1.6"] + - cis_level: ["1"] + condition: all + rules: + - 'not c:find /Applications -iname "*.app" -type d -perm -2 -ls -> r:/Applications/' + + # 5.1.7 Ensure No World Writable Files Exist in the System Folder (Automated) + - id: 29047 + title: "Ensure No World Writable Files Exist in the System Folder." + description: "Software sometimes insists on being installed in the /System/Volumes/Data/SystemDirectory and have inappropriate world-writable permissions." + rationale: 'Folders in /System/Volumes/Data/System should not be world-writable. The audit check excludes the "Drop Box" folder that is part of Apple''s default user template.' + remediation: "Run the following command to set permissions so that folders are not world writable in the /System folder: sudo chmod -R o-w /Path/" + compliance: + - cis: ["5.1.7"] + - cis_level: ["1"] + condition: all + rules: + - 'not c:find /System/Volumes/Data/System -type d -perm -2 -ls -> r:\d+\s+/System/Volumes/Data/System' + + # 5.1.8 Ensure No World Writable Files Exist in the Library Folder (Automated) + - id: 29048 + title: "Ensure No World Writable Files Exist in the Library Folder." + description: "Software sometimes insists on being installed in the /Library Directory and have inappropriate world-writable permissions." + rationale: "Folders in /System/Volumes/Data/Library should not be world-writable. The audit check excludes the /System/Volumes/Data/Library/Caches and /System/Volumes/Data/Library/Preferences/Audio/Data folders where the sticky bit is set." + remediation: "Run the following command to set permissions so that folders are not world writable in the /System/Volumes/Data/Library folder: sudo /bin/chmod -R o-w /System/Volumes/Data/Library/" + compliance: + - cis: ["5.1.8"] + - cis_level: ["2"] + condition: all + rules: + - 'not c:sh -c "find /System/Volumes/Data/Library -type d -perm -2 -ls | grep -v ''Caches|Audio''" -> r:\d+\s+/System/Volumes/Data/Library' + + ############################################################ + # 5.2 Password Management + ############################################################ + # 5.2.1 Ensure Password Account Lockout Threshold Is Configured (Automated) - Not implemented + # 5.2.2 Ensure Password Minimum Length Is Configured (Automated) - Not implemented + # 5.2.3 Ensure Complex Password Must Contain Alphabetic Characters Is Configured (Manual) - Not implemented + # 5.2.4 Ensure Complex Password Must Contain Numeric Character Is Configured (Manual) - Not implemented + # 5.2.5 Ensure Complex Password Must Contain Special Character Is Configured (Manual) - Not implemented + # 5.2.6 Ensure Complex Password Must Contain Uppercase and Lowercase Characters Is Configured (Manual) - Not implemented + # 5.2.7 Ensure Password Age Is Configured (Automated) - Not implemented + # 5.2.8 Ensure Password History Is Configured (Automated) - Not implemented + + # 5.3 Ensure the Sudo Timeout Period Is Set to Zero (Automated) + - id: 29049 + title: "Ensure the Sudo Timeout Period Is Set to Zero." + description: "The sudo command allows the user to run programs as the root user. Working as the root user allows the user an extremely high level of configurability within the system. This control along with the control to use a separate timestamp for each tty limits the window where an unauthorized user, process or attacker could utilize legitimate credentials that are valid for longer than required." + rationale: "The sudo command stays logged in as the root user for five minutes before timing out and re-requesting a password. This five-minute window should be eliminated since it leaves the system extremely vulnerable. This is especially true if an exploit were to gain access to the system, since they would be able to make changes as a root user." + remediation: "Run the following command to edit the sudo settings: sudo visudo. Add the line 'Defaults timestamp_timeout=0' in the Override built-in defaults section. " + compliance: + - cis: ["5.3"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*timestamp_timeout=0' + + # 5.4 Ensure a Separate Timestamp Is Enabled for Each User/tty Combo (Automated) + - id: 29050 + title: "Ensure a Separate Timestamp Is Enabled for Each User/tty Combo." + description: "Using tty tickets ensures that a user must enter the sudo password in each Terminal session. With sudo versions 1.8 and higher, introduced in 10.12, the default value is to have tty tickets for each interface so that root access is limited to a specific terminal. The default configuration can be overwritten or not configured correctly on earlier versions of macOS." + rationale: "In combination with removing the sudo timeout grace period, a further mitigation should be in place to reduce the possibility of a background process using elevated rights when a user elevates to root in an explicit context or tty. Additional mitigation should be in place to reduce the risk of privilege escalation of background processes." + remediation: "Edit the /etc/sudoers file with visudo and remove !tty_tickets from any Defaults line. If there is a Default line of timestamp_type= with a value other than tty, change the value to tty If there is a file in the /etc/sudoers.d/ folder that contains Defaults !tty_tickets, edit the file and remove !tty_tickets from any Defaults line. If there is a file /etc/sudoers.d/ folder that contains a Default line of timestamp_type= with a value other than tty, change the value to tty." + compliance: + - cis: ["5.4"] + - cis_level: ["1"] + condition: all + rules: + - "not f:/etc/sudoers -> r:!tty_tickets" + - 'not d:/etc/sudoers.d -> r:\.* -> r:!tty_tickets' + - "not f:/etc/sudoers -> r:timestamp_type=ppid" + - 'not d:/etc/sudoers.d -> r:\.* -> r:timestamp_type=ppid' + - "not f:/etc/sudoers -> r:timestamp_type=global" + - 'not d:/etc/sudoers.d -> r:\.* -> r:timestamp_type=global' + + # 5.5 Ensure login keychain is locked when the computer sleeps (Manual) - Not implemented + + # 5.6 Ensure the "root" Account Is Disabled (Automated) + - id: 29051 + title: 'Ensure the "root" Account Is Disabled' + description: "The root account is a superuser account that has access privileges to perform any actions and read/write to any file on the computer. With some Linux distros the system administrator may commonly use the root account to perform administrative functions." + rationale: "Enabling and using the root account puts the system at risk since any successful exploit or mistake while the root account is in use could have unlimited access privileges within the system. Using the sudo command allows users to perform functions as a root user while limiting and password protecting the access privileges. By default the root account is not enabled on a macOS computer. An administrator can escalate privileges using the sudo command (use -s or -i to get a root shell)." + remediation: "Run the following command to disable the root user: sudo /usr/sbin/dsenableroot -d" + compliance: + - cis: ["5.6"] + - cis_level: ["1"] + condition: all + rules: + - "c:dscl . -read /Users/root AuthenticationAuthority -> r:^No such key: AuthenticationAuthority" + + # 5.7 Ensure Automatic Login Is Disabled (Automated) + - id: 29052 + title: "Ensure Automatic Login Is Disabled." + description: "The automatic login feature saves a user's system access credentials and bypasses the login screen. Instead, the system automatically loads to the user's desktop screen." + rationale: "Disabling automatic login decreases the likelihood of an unauthorized person gaining access to a system." + remediation: "Run the following command to disable automatic login: sudo defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser" + compliance: + - cis: ["5.7"] + - cis_level: ["1"] + condition: any + rules: + - 'not c:defaults read /Library/Preferences/com.apple.loginwindow autoLoginUser -> r:^\w' + - "c:defaults read /Library/Preferences/com.apple.loginwindow autoLoginUser -> r:does not exist" + - 'c:sh -c "profiles -P -o stdout | grep com.apple.login.mcx.DisableAutoLoginClient" -> r:com.apple.login.mcx.DisableAutoLoginClient\s*=\s*1' + + # 5.8 Ensure a Password is Required to Wake the Computer From Sleep or Screen Saver Is Enabled (Automated) - Not implemented + # 5.9 Ensure system is set to hibernate (Automated) - Not implemented + + # 5.10 Require an administrator password to access system-wide preferences (Automated) + - id: 29053 + title: "Require an administrator password to access system-wide preferences." + description: "System Preferences controls system and user settings on a macOS Computer. System Preferences allows the user to tailor their experience on the computer as well as allowing the System Administrator to configure global security settings. Some of the settings should only be altered by the person responsible for the computer." + rationale: "By requiring a password to unlock system-wide System Preferences the risk is mitigated of a user changing configurations that affect the entire system and requires an admin user to re-authenticate to make changes." + remediation: "The authorizationdb settings cannot be written to directly, so the plist must be exported out to temporary file. Changes can be made to the temporary plist, then imported back into the authorizationdb settings. Run the following commands to enable that an administrator password is required to access system-wide preferences: $ sudo security authorizationdb read system.preferences > /tmp/system.preferences.plist $ sudo defaults write /tmp/system.preferences.plist shared -bool false $ sudo security authorizationdb write system.preferences < /tmp/system.preferences.plist" + compliance: + - cis: ["5.10"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "security authorizationdb read system.preferences | grep -A1 shared | grep false" -> r:' + + # 5.11 Ensure an administrator account cannot login to another user's active and locked session (Automated) + - id: 29054 + title: "Ensure an administrator account cannot login to another user's active and locked session." + description: "macOS has a privilege that can be granted to any user that will allow that user to unlock active user's sessions." + rationale: "Disabling the admins and/or user's ability to log into another user's active and locked session prevents unauthorized persons from viewing potentially sensitive and/or personal information." + remediation: "Run the following command to disable a user logging into another user's active and/or locked session: sudo security authorizationdb write system.login.screensaver use-login-window-ui" + compliance: + - cis: ["5.11"] + - cis_level: ["1"] + references: + - "https://derflounder.wordpress.com/2014/02/16/managing-the-authorization- database-in-os-x-mavericks/" + - "https://www.jamf.com/jamf-nation/discussions/18195/system-login-screensaver" + condition: all + rules: + - 'c:sh -c "security authorizationdb read system.login.screensaver | grep -c ''use-login-window-ui''" -> 1' + + # 5.12 Ensure a Custom Message for the Login Screen Is Enabled (Automated) + - id: 29055 + title: "Ensure a Custom Message for the Login Screen Is Enabled." + description: "An access warning informs the user that the system is reserved for authorized use only, and that the use of the system may be monitored." + rationale: "An access warning may reduce a casual attacker's tendency to target the system. Access warnings may also aid in the prosecution of an attacker by evincing the attacker's knowledge of the system's private status, acceptable use policy, and authorization requirements." + remediation: 'Run the following command to enable a custom login screen message: sudo defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText ""' + compliance: + - cis: ["5.12"] + - cis_level: ["1"] + condition: any + rules: + - "not c:defaults read /Library/Preferences/com.apple.loginwindow.plist LoginwindowText -> r:does not exist" + - 'c:sh -c "profiles -P -o stdout | grep LoginwindowText" -> r:LoginwindowText\s*=\s*"\w+' + + # 5.13 Ensure a Login Window Banner Exists (Automated) + - id: 29056 + title: "Ensure a Login Window Banner Exists." + description: "A Login window banner warning informs the user that the system is reserved for authorized use only. It enforces an acknowledgment by the user that they have been informed of the use policy in the banner if required. The system recognizes either the .txt and the .rtf formats." + rationale: "An access warning may reduce a casual attacker's tendency to target the system. Access warnings may also aid in the prosecution of an attacker by evincing the attacker's knowledge of the system's private status, acceptable use policy, and authorization requirements." + remediation: "Edit (or create) a PolicyBanner.txt or PolicyBanner.rtf file, in the /Library/Security/ folder, to include the required login window banner text." + compliance: + - cis: ["5.13"] + - cis_level: ["2"] + condition: all + rules: + - "d:/Library/Security -> r:^PolicyBanner" + + # 5.14 Ensure Users' Accounts Do Not Have a Password Hint (Automated) - Not implemented + + # 5.15 Ensure Fast User Switching Is Disabled (Manual) + - id: 29057 + title: "Ensure Fast User Switching Is Disabled." + description: "Fast user switching allows a person to quickly log in to the computer with a different account. While only a minimal security risk, when a second user is logged in, that user might be able to see what processes the first user is using, or possibly gain other information about the first user. In a large directory environment where it is difficult to limit log in access many valid users can login to other user's assigned computers." + rationale: "Fast user switching allows multiple users to run applications simultaneously at console. There can be information disclosed about processes running under a different user. Without a specific configuration to save data and log out users can have unsaved data running in a background session that is not obvious." + remediation: "Run the following command to turn fast user switching off: sudo /usr/bin/defaults write /Library/Preferences/.GlobalPreferences MultipleSessionEnabled -bool false" + compliance: + - cis: ["5.15"] + - cis_level: ["2"] + condition: any + rules: + - "c:defaults read /Library/Preferences/.GlobalPreferences.plist MultipleSessionEnabled -> r:^0$|does not exist" + - 'c:sh -c "profiles -P -o stdout | grep MultipleSessionEnabled" -> r:MultipleSessionEnabled\s*=\s*0' + + ############################################################ + # 6 User Accounts and Environment + ############################################################ + # 6.1 Accounts Preferences Action Items + ############################################################ + # 6.1.1 Ensure Login Window Displays as Name and Password Is Enabled (Automated) + - id: 29058 + title: "Ensure Login Window Displays as Name and Password Is Enabled." + description: "The login window prompts a user for his/her credentials, verifies their authorization level and then allows or denies the user access to the system." + rationale: "Prompting the user to enter both their username and password makes it twice as hard for unauthorized users to gain access to the system since they must discover two attributes." + remediation: "Run the following command to enable the login window to display name and password: sudo defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool true" + compliance: + - cis: ["6.1.1"] + - cis_level: ["1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -> r:^1$" + - 'c:sh -c "profiles -P -o stdout | grep SHOWFULLNAME" -> r:SHOWFULLNAME\s*=\s*1' + + # 6.1.2 Ensure Show Password Hints Is Disabled (Automated) + - id: 29059 + title: "Ensure Show Password Hints Is Disabled." + description: "Password hints are user-created text displayed when an incorrect password is used for an account." + rationale: "Password hints make it easier for unauthorized persons to gain access to systems by providing information to anyone that the user provided to assist in remembering the password. This info could include the password itself or other information that might be readily discerned with basic knowledge of the end user." + remediation: "Run the following command to disable password hints: sudo defaults write /Library/Preferences/com.apple.loginwindow RetriesUntilHint -int 0" + compliance: + - cis: ["6.1.2"] + - cis_level: ["1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow RetriesUntilHint -> r:^0$|does not exist" + - 'c:sh -c "profiles -P -o stdout | grep RetriesUntilHint" -> r:RetriesUntilHint\s*=\s*0' + + # 6.1.3 Ensure Guest Account Is Disabled (Automated) + - id: 29060 + title: "Ensure Guest Account Is Disabled." + description: "The guest account allows users access to the system without having to create an account or password. Guest users are unable to make setting changes cannot remotely login to the system. All files, caches, and passwords created by the guest user are deleted upon logging out." + rationale: "Disabling the guest account mitigates the risk of an untrusted user doing basic reconnaissance and possibly using privilege escalation attacks to take control of the system." + remediation: "Run the following command to disable the guest account: sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled -bool false" + compliance: + - cis: ["6.1.3"] + - cis_level: ["1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.loginwindow.plist GuestEnabled -> r:^0$" + - 'c:sh -c "profiles -P -o stdout | grep DisableGuestAccount" -> r:DisableGuestAccount\s*=\s*1' + - 'c:sh -c "profiles -P -o stdout | grep EnableGuestAccount" -> r:EnableGuestAccount\s*=\s*0' + + # 6.1.4 Ensure Guest Access to Shared Folders Is Disabled (Automated) + - id: 29061 + title: "Ensure Guest Access to Shared Folders Is Disabled." + description: "Allowing guests to connect to shared folders enables users to access selected shared folders and their contents from different computers on a network." + rationale: "Not allowing guests to connect to shared folders mitigates the risk of an untrusted user doing basic reconnaissance and possibly use privilege escalation attacks to take control of the system." + remediation: "Run the following commands to verify that shared folders are not accessible to guest users: sudo /usr/bin/defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -bool false" + compliance: + - cis: ["6.1.4"] + - cis_level: ["1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/SystemConfiguration/com.apple.smb.server AllowGuestAccess -> r:^0$|does not exist" + - 'c:sh -c "profiles -P -o stdout | grep AllowGuestAccess" -> r:AllowGuestAccess\s*=\s*0' + + # 6.1.5 Ensure the Guest Home Folder Does Not Exist (Automated) + - id: 29062 + title: "Ensure the Guest Home Folder Does Not Exist." + description: "In the previous two controls the guest account login has been disabled and sharing to guests has been disabled as well. There is no need for the legacy Guest home folder to remain in the file system. When normal user accounts are removed you have the option to archive it, leave it in place or delete. In the case of the guest folder the folder remains in place without a GUI option to remove it. If at some point in the future a Guest account is needed it will be re-created. The presence of the Guest home folder can cause automated audits to fail when looking for compliant settings within all User folders as well. Rather than ignoring the folder's continued existence, it is best removed." + rationale: "The Guest home folders are unneeded after the Guest account is disabled and could be used inappropriately." + remediation: "Run the following command to remove the Guest user home folder: sudo /bin/rm -R /Users/Guest" + compliance: + - cis: ["6.1.5"] + - cis_level: ["1"] + condition: none + rules: + - "d:/Users/Guest" + + # 6.2 Ensure Show All Filename Extensions Setting is Enabled (Automated) + - id: 29063 + title: "Ensure Show All Filename Extensions Setting is Enabled." + description: "A filename extension is a suffix added to a base filename that indicates the base filename's file format." + rationale: "Visible filename extensions allow the user to identify the file type and the application it is associated with which leads to quick identification of misrepresented malicious files." + remediation: "Run the following command to enable displaying of file extensions: sudo -u /usr/bin/defaults write /Users//Library/Preferences/.GlobalPreferences.plist AppleShowAllExtensions -bool true" + compliance: + - cis: ["6.2"] + - cis_level: ["1"] + condition: all + rules: + - "c:defaults read NSGlobalDomain AppleShowAllExtensions -> r:^1$" + + # 6.3 Ensure Automatic Opening of Safe Files in Safari Is Disabled (Automated) + - id: 29064 + title: "Ensure Automatic Opening of Safe Files in Safari Is Disabled." + description: "Safari will automatically run or execute what it considers safe files. This can include installers and other files that execute on the operating system. Safari bases file safety by using a list of filetypes maintained by Apple. The list of files include text, image, video and archive formats that would be run in the context of the OS rather than the browser." + rationale: "Hackers have taken advantage of this setting via drive-by attacks. These attacks occur when a user visits a legitimate website that has been corrupted. The user unknowingly downloads a malicious file either by closing an infected pop-up or hovering over a malicious banner. An attacker can create a malicious file that will fall within Safari's safe file list that will download and execute without user input." + remediation: "Run the following command to disable safe files from not opening in Safari: sudo -u /usr/bin/defaults write /Users//Library/Containers/com.apple.Safari/Data/Library/Preferences/com.apple.Safari AutoOpenSafeDownloads -bool false" + compliance: + - cis: ["6.3"] + - cis_level: ["1"] + condition: any + rules: + - "c:defaults read com.apple.Safari AutoOpenSafeDownloads -> r:^0$" + - 'c:sh -c "profiles -P -o stdout | grep AutoOpenSafeDownloads" -> r:AutoOpenSafeDownloads\s*=\s*0' diff --git a/etc/ruleset/sca/darwin/22/cis_apple_macOS_13.x.yml b/etc/ruleset/sca/darwin/22/cis_apple_macOS_13.x.yml new file mode 100644 index 0000000000..88ab674e97 --- /dev/null +++ b/etc/ruleset/sca/darwin/22/cis_apple_macOS_13.x.yml @@ -0,0 +1,1537 @@ +# Security Configuration Assessment +# CIS Checks for Apple macOS 13.x Ventura +# Copyright (C) 2023, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# SCA policy for Apple macOS 13.x Ventura based on Center for Internet Security Apple macOS 13.x Ventura Benchmark v1.0.0 - 11-14-2022 + +policy: + id: "cis_macOS_13" + file: "cis_apple_macOS_13.x.yml" + name: "CIS Apple macOS 13.0 Ventura Benchmark v1.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Apple macOS 13.x. This guide was tested against Apple macOS 13.x." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Apple macOS version." + description: "Requirements for running the SCA scan against Apple macOS 13.x Ventura." + condition: any + rules: + - 'c:sw_vers -> r:^ProductVersion:\t*\s*13\p' + - 'c:system_profiler SPSoftwareDataType -> r:System Version:.*13\p' + - 'c:defaults read loginwindow SystemVersionStampAsString -> r:^\s*13\p' + +checks: + ########################################################################## + # 1 Install Updates, Patches and Additional Security Software + ########################################################################## + + # 1.1 Ensure All Apple-provided Software Is Current. (Automated) + - id: 31000 + title: "Ensure All Apple-provided Software Is Current." + description: 'Software vendors release security patches and software updates for their products when security vulnerabilities are discovered. There is no simple way to complete this action without a network connection to an Apple software repository. Please ensure appropriate access for this control. This check is only for what Apple provides through software update. Software updates should be run at minimum every 30 days. Run the following command to verify when software update was previously run: $ /usr/bin/sudo defaults read /Library/Preferences/com.apple.SoftwareUpdate | grep -e LastFullSuccessfulDate. The response should be in the last 30 days (Example): LastFullSuccessfulDate = "2020-07-30 12:45:25 +0000";.' + rationale: "It is important that these updates be applied in a timely manner to prevent unauthorized persons from exploiting the identified vulnerabilities." + impact: "Missing patches can lead to more exploit opportunities." + remediation: "Graphical Method: Perform the following to install all available software updates: 1. Open System Settings 2. Select General 3. Select Software Update 4. Select Update All Terminal Method: Run the following command to verify what packages need to be installed: $ /usr/bin/sudo /usr/sbin/softwareupdate -l The output will include the following: Software Update found the following new or updated software: Run the following command to install all the packages that need to be updated: $ /usr/bin/sudo /usr/sbin/softwareupdate -i -a -R Or run the following command to install individual packages: $ /usr/bin/sudo /usr/sbin/softwareupdate -i '' example: $ /usr/bin/sudo /usr/sbin/softwareupdate -l Software Update Tool Finding available software Software Update found the following new or updated software: * iTunesX-12.8.2 iTunes (12.8.2), 273614K [recommended] $ /usr/bin/sudo /usr/sbin/softwareupdate -i 'iTunesX-12.8.2' Software Update Tool Downloaded iTunes Installing iTunes Done with iTunes Done." + compliance: + - cis: ["1.1"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - mitre_techniques: ["T1017", "T1019", "T1031", "T1034", "T1038", "T1044", "T1053", "T1068", "T1072", "T1073", "T1075", "T1076", "T1078", "T1081", "T1088", "T1100", "T1103", "T1114", "T1137", "T1138", "T1145", "T1161", "T1176", "T1189", "T1190", "T1195", "T1210", "T1211", "T1212", "T1213", "T1214", "T1482", "T1484", "T1495", "T1505", "T1525", "T1527", "T1528", "T1530"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - "c:softwareupdate -l -> r:No new software available." + + # 1.2 Ensure Auto Update Is Enabled. (Automated) + - id: 31001 + title: "Ensure Auto Update Is Enabled." + description: 'Auto Update verifies that your system has the newest security patches and software updates. If "Automatically check for updates" is not selected, background updates for new malware definition files from Apple for XProtect and Gatekeeper will not occur. http://macops.ca/os-x-admins-your-clients-are-not-getting-background-security-updates/ https://derflounder.wordpress.com/2014/12/17/forcing-xprotect-blacklist-updates-on-mavericks-and-yosemite/.' + rationale: "It is important that a system has the newest updates applied so as to prevent unauthorized persons from exploiting identified vulnerabilities." + impact: "Without automatic update, updates may not be made in a timely manner and the system will be exposed to additional risk." + remediation: "Graphical Method: Perform the steps following to enable the system to automatically check for updates: 1. Open System Settings 2. Select General 3. Select Software Update 4. Select the i 5. Set Check for updates to enabled 6. Select Done Terminal Method: Run the following command to enable auto update: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.SoftwareUpdate 2. The key to include is AutomaticCheckEnabled 3. The key must be set to ." + compliance: + - cis: ["1.2"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + - mitre_techniques: ["T1103", "T1017", "T1138", "T1189", "T1190", "T1212", "T1211", "T1068", "T1210", "T1495", "T1137", "T1075", "T1195", "T1019", "T1072", "T1100", "T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''AutomaticCheckEnabled'')" -> r:^1$' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''AutomaticCheckEnabled'')" -> r:\.+' + + # 1.3 Ensure Download New Updates When Available Is Enabled. (Automated) + - id: 31002 + title: "Ensure Download New Updates When Available Is Enabled." + description: 'In the GUI, both "Install macOS updates" and "Install app updates from the App Store" are dependent on whether "Download new updates when available" is selected.' + rationale: "It is important that a system has the newest updates downloaded so that they can be applied." + impact: 'If "Download new updates when available" is not selected, updates may not be made in a timely manner and the system will be exposed to additional risk.' + remediation: "Perform the following to enable the system to automatically check for updates: Graphical Method: 1. Open System Settings 2. Select General 3. Select Software Update 4. Select the i 5. Set Download new updates when available to enabled 6. Select Done Terminal Method: Run the following command to enable auto update: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.SoftwareUpdate 2. The key to include is AutomaticDownload 3. The key must be set to ." + compliance: + - cis: ["1.3"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + - mitre_techniques: ["T1103", "T1017", "T1138", "T1189", "T1190", "T1212", "T1211", "T1068", "T1210", "T1495", "T1137", "T1075", "T1195", "T1019", "T1072", "T1100", "T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''AutomaticDownload'')" -> r:^1$' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''AutomaticDownload'')" -> r:\.+' + + # 1.4 Ensure Install of macOS Updates Is Enabled. (Automated) + - id: 31003 + title: "Ensure Install of macOS Updates Is Enabled." + description: "Ensure that macOS updates are installed after they are available from Apple. This setting enables macOS updates to be automatically installed. Some environments will want to approve and test updates before they are delivered. It is best practice to test first where updates can and have caused disruptions to operations. Automatic updates should be turned off where changes are tightly controlled and there are mature testing and approval processes. Automatic updates should not be turned off simply to allow the administrator to contact users in order to verify installation. A dependable, repeatable process involving a patch agent or remote management tool should be in place before auto-updates are turned off." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited." + impact: "Unpatched software may be exploited." + remediation: "Graphical Method: Perform the following steps to enable macOS updates to run automatically: 1. Open System Settings 2. Select General 3. Select Software Update 4. Select the i 5. Set Install macOS updates to enabled 6. Select Done Terminal Method: Run the following command to to enable automatic checking and installing of macOS updates: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates -bool TRUE Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.SoftwareUpdate 2. The key to include is AutomaticallyInstallMacOSUpdates 3. The key must be set to ." + compliance: + - cis: ["1.4"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + - mitre_techniques: ["T1103", "T1017", "T1138", "T1189", "T1190", "T1212", "T1211", "T1068", "T1210", "T1495", "T1137", "T1075", "T1195", "T1019", "T1072", "T1100", "T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''AutomaticallyInstallMacOSUpdates'')" -> r:^1$' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''AutomaticallyInstallMacOSUpdates'')" -> r:\.+' + + # 1.5 Ensure Install Application Updates from the App Store Is Enabled. (Automated) + - id: 31004 + title: "Ensure Install Application Updates from the App Store Is Enabled." + description: "Ensure that application updates are installed after they are available from Apple. These updates do not require reboots or administrator privileges for end users." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited." + impact: "Unpatched software may be exploited." + remediation: "Graphical Method: Perform the following steps to enable App Store updates to install automatically: 1. Open System Settings 2. Select General 3. Select Software Update 4. Select the i 5. Set Install application updates from the App Store to enabled 6. Select Done Terminal Method: Run the following command to turn on App Store auto updating: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool TRUE Note: This remediation requires a log out and log in to show in the GUI. Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.SoftwareUpdate 2. The key to include is AutomaticallyInstallAppUpdates 3. The key must be set to ." + compliance: + - cis: ["1.5"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + - mitre_techniques: ["T1103", "T1017", "T1138", "T1189", "T1190", "T1212", "T1211", "T1068", "T1210", "T1495", "T1137", "T1075", "T1195", "T1019", "T1072", "T1100", "T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> r:^1$" + + # 1.6 Ensure Install Security Responses and System Files Is Enabled. (Automated) + - id: 31005 + title: "Ensure Install Security Responses and System Files Is Enabled." + description: "Ensure that system and security updates are installed after they are available from Apple. This setting enables definition updates for XProtect and Gatekeeper. With this setting in place, new malware and adware that Apple has added to the list of malware or untrusted software will not execute. These updates do not require reboots or end user admin rights." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited." + impact: "Unpatched software may be exploited." + remediation: "Graphical Method: Perform the following steps to enable system data files and security updates to install automatically: 1. Open System Settings 2. Select General 3. Select Software Update 4. Select the i 5. Set Install Security Responses and System files to enabled 6. Select Done Terminal Method: Run the following commands to enable automatic checking of system data files and security updates: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.SoftwareUpdate 2. The key to include is ConfigDataInstall 3. The key must be set to 4. The key to also include is CriticalUpdateInstall 5. The key must be set to ." + references: + - https://eclecticlight.co/2021/10/27/silently-updated-security-data-files-in-monterey/ + - https://support.apple.com/en-us/HT202491 + - https://support.apple.com/guide/security/protecting-against-malware-sec469d47bd8/web + - https://support.apple.com/guide/deployment/rapid-security-responses-dep93ff7ea78/1/web/1.0 + compliance: + - cis: ["1.6"] + - cis_csc_v8: ["7.3", "7.4", "7.7"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["CA.L2-3.12.2", "RA.L2-3.11.3", "SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - pci_dss_v4.0: ["11.3.1", "11.3.2", "11.3.2.1"] + - soc_2: ["CC7.1"] + - mitre_techniques: ["T1103", "T1017", "T1138", "T1189", "T1190", "T1212", "T1211", "T1068", "T1210", "T1495", "T1137", "T1075", "T1195", "T1019", "T1072", "T1100", "T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''ConfigDataInstall'')" && c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''CriticalUpdateInstall'')" -> r:^1$' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''ConfigDataInstall'')" && c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''CriticalUpdateInstall'')" -> r:\.+' + + # 1.7 Ensure Software Update Deferment Is Less Than or Equal to 30 Days. (Automated) + - id: 31006 + title: "Ensure Software Update Deferment Is Less Than or Equal to 30 Days." + description: "Apple provides the capability to manage software updates on Apple devices through mobile device management. Part of those capabilities permit organizations to defer software updates and allow for testing. Many organizations have specialized software and configurations that may be negatively impacted by Apple updates. If software updates are deferred, they should not be deferred for more than 30 days. This control only verifies that deferred software updates are not deferred for more than 30 days." + rationale: "Apple software updates almost always include security updates. Attackers evaluate updates to create exploit code in order to attack unpatched systems. The longer a system remains unpatched, the greater an exploit possibility exists in which there are publicly reported vulnerabilities." + impact: "Some organizations may need more than 30 days to evaluate the impact of software updates." + remediation: "Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.applicationaccess 2. The key to include is enforcedSoftwareUpdateDelay 3. The key must be set to <1-30>." + references: + - https://support.apple.com/guide/deployment/manage-software-updates-depc4c80847a/web + compliance: + - cis: ["1.7"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + - mitre_techniques: ["T1103", "T1017", "T1138", "T1189", "T1190", "T1212", "T1211", "T1068", "T1210", "T1495", "T1137", "T1075", "T1195", "T1019", "T1072", "T1100", "T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.applicationaccess'').objectForKey(''enforcedSoftwareUpdateDelay'')" -> n:^(\d+)$ compare <= 30' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.applicationaccess'').objectForKey(''enforcedSoftwareUpdateDelay'')" -> r:\.+' + + ############################################################ + # 2 System Settings + ############################################################ + + # 2.1 Apple ID + # 2.1.1 iCloud + # 2.1.1.1 Audit iCloud Keychain (Manual) - Not implemented + # 2.1.1.2 Audit iCloud Drive (Manual) - Not implemented + # 2.1.1.3 Ensure iCloud Drive Document and Desktop Sync Is Disabled (Automated) - Not Implemented + # 2.1.2 Audit App Store Password Settings (Manual) - Not implemented + # 2.2 Network + + # 2.2.1 Ensure Firewall Is Enabled. (Automated) + - id: 31007 + title: "Ensure Firewall Is Enabled." + description: "A firewall is a piece of software that blocks unwanted incoming connections to a system. Apple has posted general documentation about the application firewall:." + rationale: "A firewall minimizes the threat of unauthorized users gaining access to your system while connected to a network or the Internet." + impact: "The firewall may block legitimate traffic. Applications that are unsigned will require special handling." + remediation: "Graphical Method: Perform the following steps to turn the firewall on: 1. Open System Settings 2. Select Network 3. Select Firewall 4. Set Firewall to enabled Terminal Method: Run the following command to enable the firewall: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.alf globalstate -int For the , use either 1, specific services, or 2, essential services only. Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.security.firewall 2. The key to include is EnableFirewall 3. The key must be set to ." + references: + - "https://support.apple.com/en-us/guide/security/seca0e83763f/web" + - "http://support.apple.com/en-us/HT201642" + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.1", "4.5", "13.1"] + - cis_csc_v7: ["5.1", "9.4", "9.5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L1-3.1.20", "AU.L2-3.3.5", "AU.L2-3.3.6", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6", "SI.L2-3.14.3", "SI.L2-3.14.7"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.13.1.1", "A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["AU-6(1)", "AU-7", "CM-7(1)", "CM-9", "IR-4(1)", "SA-10", "SC-7(5)", "SI-4(2)", "SI-4(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.5.3", "10.6.1", "11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "10.7", "10.7.1", "10.7.2", "10.7.3", "11.5", "2.1.1", "2.2.1"] + - soc_2: ["CC6.6", "CC7.1", "CC7.2", "CC8.1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.alf globalstate -> r:^1$|^2$" + - "c:defaults read /Library/Preferences/com.apple.security.firewall EnableFirewall -> r:^1$|^2$|^true$" + + # 2.2.2 Ensure Firewall Stealth Mode Is Enabled. (Automated) + - id: 31008 + title: "Ensure Firewall Stealth Mode Is Enabled." + description: "While in Stealth mode, the computer will not respond to unsolicited probes, dropping that traffic." + rationale: "Stealth mode on the firewall minimizes the threat of system discovery tools while connected to a network or the Internet." + impact: "Traditional network discovery tools like ping will not succeed. Other network tools that measure activity and approved applications will work as expected. This control aligns with the primary macOS use case of a laptop that is often connected to untrusted networks where host segregation may be non-existent. In that use case, hiding from the other inmates is likely more than desirable. In use cases where use is only on trusted LANs with static IP addresses, stealth mode may not be desirable." + remediation: "Graphical Method: Perform the following steps to enable firewall stealth mode: 1. Open System Settings 2. Select Network 3. Select Firewall 4. Select Options... 5. Set Enabled stealth mode to enabled Terminal Method: Run the following command to enable stealth mode: $ /usr/bin/sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on Stealth mode enabled Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.security.firewall 2. The key to include is EnableStealthMode 3. The key must be set to Note: This key must be set in the same configuration profile with EnableFirewall set to . If it is set in its own configuration profile, it will fail." + references: + - "http://support.apple.com/en-us/HT201642" + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.1", "4.5", "4.8"] + - cis_csc_v7: ["5.1", "9.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L1-3.1.20", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1", "A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.4", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.alf stealthenabled -> r:^1$|^2$" + - "c:defaults read /Library/Preferences/com.apple.security.firewall EnableStealthMode -> r:^1$|^2$|^true$" + + # 2.3 General + # 2.3.1 AirDrop & Handoff + # 2.3.1.1 Ensure AirDrop Is Disabled (Automated) - Not Implemented + # 2.3.1.2 Ensure AirPlay Receiver Is Disabled (Automated) - Not Implemented + # 2.3.2 Date & Time + + # 2.3.2.1 Ensure Set Time and Date Automatically Is Enabled. (Automated) + - id: 31009 + title: "Ensure Set Time and Date Automatically Is Enabled." + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates, and log entries. Note: If your organization has internal time servers, enter them here. Enterprise mobile devices may need to use a mix of internal and external time servers. If multiple servers are required, use the Date & Time System Preference with each server separated by a space. Additional Note: The default Apple time server is time.apple.com. Variations include time.euro.apple.com. While it is certainly more efficient to use internal time servers, there is no reason to block access to global Apple time servers or to add a time.apple.com alias to internal DNS records. There are no reports that Apple gathers any information from NTP synchronization, as the computers already phone home to Apple for Apple services including iCloud use and software updates. Best practice is to allow DNS resolution to an authoritative time service for time.apple.com, preferably to connect to Apple servers, but local servers are acceptable as well." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features." + impact: "The timed service will periodically synchronize with named time servers and will make the computer time more accurate." + remediation: "Graphical Method: Perform the following to enable the date and time to be set automatically: 1. Open System Settings 2. Select General 3. Select Date & Time 4. Set Set time and date automatically to enabled Note: By default, the operating system will use time.apple.com as the time server. You can change to any time server that meets your organization's requirements. Terminal Method: Run the following commands to enable the date and time setting automatically: $ /usr/bin/sudo /usr/sbin/systemsetup -setnetworktimeserver setNetworkTimeServer: $ /usr/bin/sudo /usr/sbin/systemsetup -setusingnetworktime on setUsingNetworkTime: On example: $ /usr/bin/sudo /usr/sbin/systemsetup -setnetworktimeserver time.apple.com setNetworkTimeServer: time.apple.com $ /usr/bin/sudo /usr/sbin/systemsetup -setusingnetworktime on setUsingNetworkTime: On Run the following commands if you have not set, or need to set, a new time zone: $ /usr/bin/sudo /usr/sbin/systemsetup -listtimezones $ /usr/bin/sudo /usr/sbin/systemsetup -settimezone example: $ /usr/bin/sudo /usr/sbin/systemsetup -listtimezones Time Zones: Africa/Abidjan Africa/Accra Africa/Addis_Ababa ... $ /usr/bin/sudo /usr/sbin/systemsetup -settimezone America/New_York Set TimeZone: America/New_York." + compliance: + - cis: ["2.3.2.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - 'c:/usr/sbin/systemsetup -getusingnetworktime -> r:Network Time:\s*\t*On' + + # 2.3.2.2 Ensure Time Is Set Within Appropriate Limits. (Automated) + - id: 31010 + title: "Ensure Time Is Set Within Appropriate Limits." + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries. Ensure that time on the computer is within acceptable limits. Truly accurate time is measured within milliseconds. For this audit, a drift under four and a half minutes passes the control check. Since Kerberos is one of the important features of macOS integration into Directory systems, the guidance here is to warn you before there could be an impact to operations. From the perspective of accurate time, this check is not strict, so it may be too great for your organization. Your organization can adjust to a smaller offset value as needed. If there are consistent drift issues on the OS, some of the most common drift issues should be investigated: - The chosen time server is not reachable based on network firewall rules on the current network - The computer is offline often and the battery drains, and the network is not immediately available - The chosen time server is a special internal or non-public time server that does not provide a reliable time source Note: ntpdate has been deprecated with 10.14. sntp replaces that command." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features. Audit check is for more than 4 minutes and 30 seconds ahead or behind." + impact: "Accurate time is required for many computer functions." + remediation: "Terminal Method: Run the following commands to ensure your time is set within an appropriate limit: $ /usr/bin/sudo /usr/sbin/systemsetup -getnetworktimeserver The output will include Network Time Server: and the name of your time server example: Network Time Server: time.apple.com. $ /usr/bin/sudo /usr/bin/sntp -sS example: $ /usr/bin/sudo /usr/sbin/systemsetup -getnetworktimeserver Network Time Server: time.apple.com $ /usr/bin/sudo /usr/bin/sntp -sS time.apple.com." + compliance: + - cis: ["2.3.2.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:systemsetup -getnetworktimeserver -> r:Network Time Server:" + + # 2.3.3 Sharing + + # 2.3.3.1 Ensure DVD or CD Sharing Is Disabled. (Automated) + - id: 31011 + title: "Ensure DVD or CD Sharing Is Disabled." + description: "DVD or CD Sharing allows users to remotely access the system's optical drive. While Apple does not ship Macs with built-in optical drives any longer, external optical drives are still recognized when they are connected. In testing, the sharing of an external optical drive persists when a drive is reconnected." + rationale: "Disabling DVD or CD Sharing minimizes the risk of an attacker using the optical drive as a vector for attack and exposure of sensitive data." + impact: "Many Apple devices are now sold without optical drives, however drive sharing may be needed for legacy optical media. The media should be explicitly re-shared as needed rather than using a persistent share. Optical drives should not be used for long-term storage. To store necessary data from an optical drive it should be copied to another form of external storage. Optionally, an image can be made of the optical drive so that it is stored in its original form on another form of external storage." + remediation: "Graphical Method: Perform the following steps to disable DVD or CD Sharing: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set DVD or CD sharing to disabled Terminal Method: Run the following command to disable DVD or CD Sharing: $ /usr/bin/sudo /bin/launchctl disable system/com.apple.ODSAgent Note: If using the Terminal method, the GUI will still show the service checked until after a reboot." + compliance: + - cis: ["2.3.3.1"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sh -c "launchctl list | grep -c com.apple.ODSAgent" -> r:^0$' + + # 2.3.3.2 Ensure Screen Sharing Is Disabled. (Automated) + - id: 31012 + title: "Ensure Screen Sharing Is Disabled." + description: "Screen Sharing allows a computer to connect to another computer on a network and display the computer's screen. While sharing the computer's screen, the user can control what happens on that computer, such as opening documents or applications, opening, moving, or closing windows, and even shutting down the computer. While mature administration and management does not use graphical connections for standard maintenance, most help desks have capabilities to assist users in performing their work when they have technical issues and need support. Help desks use graphical remote tools to understand what the user sees and assist them so they can get back to work. For MacOS, some of these remote capabilities can use Apple's OS tools. Control is therefore not meant to prohibit the use of a just-in-time graphical view from authorized personnel with authentication controls. Sharing should not be enabled except in narrow windows when help desk support is required." + rationale: "Disabling Screen Sharing mitigates the risk of remote connections being made without the user of the console knowing that they are sharing the computer." + impact: "Help desks may require the periodic use of a graphical connection mechanism to assist users. Any support that relies on native MacOS components will not work unless a scripted solution to enable and disable sharing as neccessary." + remediation: "Graphical Method: Perform the following steps to disable Screen Sharing: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Screen Sharing to disabled Terminal Method: Run the following command to turn off Screen Sharing: $ /usr/bin/sudo /bin/launchctl disable system/com.apple.screensharing." + references: + - https://support.apple.com/guide/mac-help/turn-screen-sharing-on-or-off-mh11848/mac + compliance: + - cis: ["2.3.3.2"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sh -c "launchctl list | grep -c com.apple.screensharing" -> r:^0$' + + # 2.3.3.3 Ensure File Sharing Is Disabled. (Automated) + - id: 31013 + title: "Ensure File Sharing Is Disabled." + description: "File sharing from a user workstation creates additional risks, such as: - Open ports are created that can be probed and attacked - Passwords are attached to user accounts for access that may be exposed and endanger other parts of the organizational environment, including directory accounts Increased complexity makes security more difficult and may expose additional attack vectors - Apple's File Sharing uses the Server Message Block (SMB) protocol to share to other computers that can mount SMB shares. This includes other macOS computers. Apple warns that SMB sharing stored passwords is less secure, and anyone with system access can gain access to the password for that account. When sharing with SMB, each user accessing the Mac must have SMB enabled. Storing passwords, especially copies of valid directory passwords, decrease security for the directory account and should not be used." + rationale: "By disabling File Sharing, the remote attack surface and risk of unauthorized access to files stored on the system is reduced." + impact: "File Sharing can be used to share documents with other users, but hardened servers should be used rather than user endpoints. Turning on File Sharing increases the visibility and attack surface of a system unnecessarily." + remediation: "Graphical Method: Perform the following steps to disable File Sharing: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set File Sharing to disabled Terminal Method: Run the following command to disable File Sharing: $ /usr/bin/sudo /bin/launchctl disable system/com.apple.smbd." + compliance: + - cis: ["2.3.3.3"] + - cis_csc_v8: ["4.1", "4.8", "5.4"] + - cis_csc_v7: ["4.3", "5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.3", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3", "A.9.2.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.1", "CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sh -c "launchctl list | grep -c com.apple.smbd" -> r:^0$' + + # 2.3.3.4 Ensure Printer Sharing Is Disabled. (Automated) + - id: 31014 + title: "Ensure Printer Sharing Is Disabled." + description: "By enabling Printer Sharing, the computer is set up as a print server to accept print jobs from other computers. Dedicated print servers or direct IP printing should be used instead." + rationale: "Disabling Printer Sharing mitigates the risk of attackers attempting to exploit the print server to gain access to the system." + remediation: "Graphical Method: Perform the following steps to disable Printer Sharing: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Printer Sharing to disabled Terminal Method: Run the following command to disable Printer Sharing: $ /usr/bin/sudo /usr/sbin/cupsctl --no-share-printers." + compliance: + - cis: ["2.3.3.4"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sh -c "cupsctl | grep _share_printers | cut -d ''='' -f2" -> r:^0$' + + # 2.3.3.5 Ensure Remote Login Is Disabled. (Automated) + - id: 31015 + title: "Ensure Remote Login Is Disabled." + description: "Remote Login allows an interactive terminal connection to a computer." + rationale: "Disabling Remote Login mitigates the risk of an unauthorized person gaining access to the system via Secure Shell (SSH). While SSH is an industry standard to connect to posix servers, the scope of the benchmark is for Apple macOS clients, not servers. macOS does have an IP-based firewall available (pf, ipfw has been deprecated) that is not enabled or configured. There are more details and links in the Network sub-section. macOS no longer has TCP Wrappers support built in and does not have strong Brute-Force password guessing mitigations, or frequent patching of openssh by Apple. Since most macOS computers are mobile workstations, managing IP-based firewall rules on mobile devices can be very resource intensive. All of these factors can be parts of running a hardened SSH server." + impact: "The SSH server built into macOS should not be enabled on a standard user computer, particularly one that changes locations and IP addresses. A standard user that runs local applications, including email, web browser, and productivity tools, should not use the same device as a server. There are Enterprise management toolsets that do utilize SSH. If they are in use, the computer should be locked down to only respond to known, trusted IP addresses and appropriate administrator service accounts. For macOS computers that are being used for specialized functions, there are several options to harden the SSH server to protect against unauthorized access including brute force attacks. There are some basic criteria that need to be considered: - Do not open an SSH server to the internet without controls in place to mitigate SSH brute force attacks. This is particularly important for systems bound to Directory environments. It is great to have controls in place to protect the system, but if they trigger after the user is already locked out of their account, they are not optimal. If authorization happens after authentication, directory accounts for users that don't even use the system can be locked out. - Do not use SSH key pairs when there is no insight to the security on the client system that will authenticate into the server with a private key. If an attacker gets access to the remote system and can find the key, they may not need a password or a key logger to access the SSH server. - Detailed instructions on hardening an SSH server, if needed, are available in the CIS Linux Benchmarks, but it is beyond the scope of this benchmark." + remediation: "Perform the following to disable Remote Login: Graphical Method: Perform the following steps to disable Remote Login: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Remote Login to disabled Terminal Method: Run the following command to disable Remote Login: $ /usr/bin/sudo /usr/sbin/systemsetup -setremotelogin off Do you really want to turn remote login off? If you do, you will lose this connection and can only turn it back on locally at the server (yes/no)? Entering yes will disable remote login." + compliance: + - cis: ["2.3.3.5"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:systemsetup -getremotelogin -> r:Remote Login:\s*\t*Off' + + # 2.3.3.6 Ensure Remote Management Is Disabled. (Automated) + - id: 31016 + title: "Ensure Remote Management Is Disabled." + description: "Remote Management is the client portion of Apple Remote Desktop (ARD). Remote Management can be used by remote administrators to view the current screen, install software, report on, and generally manage client Macs. The screen sharing options in Remote Management are identical to those in the Screen Sharing section. In fact, only one of the two can be configured. If Remote Management is used, refer to the Screen Sharing section above on issues regard screen sharing. Remote Management should only be enabled when a Directory is in place to manage the accounts with access. Computers will be available on port 5900 on a macOS System and could accept connections from untrusted hosts depending on the configuration, which is a major concern for mobile systems. As with other sharing options, an open port even for authorized management functions can be attacked, and both unauthorized access and Denial-of-Service vulnerabilities could be exploited. If remote management is required, the pf firewall should restrict access only to known, trusted management consoles. Remote management should not be used across the Internet without the use of a VPN tunnel." + rationale: "Remote Management should only be enabled on trusted networks with strong user controls present in a Directory system. Mobile devices without strict controls are vulnerable to exploit and monitoring." + impact: "Many organizations utilize ARD for client management." + remediation: "Graphical Method: Perform the following steps to disable Remote Management: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Remote Management to disabled Terminal Method: Run the following command to disable Remote Management: $ /usr/bin/sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources /kickstart -deactivate -stop Starting... Removed preference to start ARD after reboot. Done." + compliance: + - cis: ["2.3.3.6"] + - cis_csc_v8: ["4.1", "4.8", "5.4"] + - cis_csc_v7: ["4.3", "9.2", "14.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.3", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1", "A.13.1.3", "A.9.2.3"] + - mitre_techniques: ["T1003", "T1015", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1133", "T1134", "T1136", "T1169", "T1175", "T1176", "T1184", "T1190", "T1200", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.1", "CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - "not p:/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent" + + # 2.3.3.7 Ensure Remote Apple Events Is Disabled. (Automated) + - id: 31017 + title: "Ensure Remote Apple Events Is Disabled." + description: "Apple Events is a technology that allows one program to communicate with other programs. Remote Apple Events allows a program on one computer to communicate with a program on a different computer." + rationale: "Disabling Remote Apple Events mitigates the risk of an unauthorized program gaining access to the system." + impact: "With remote Apple events turned on, an AppleScript program running on another Mac can interact with the local computer." + remediation: "Graphical Method: Perform the following steps to disable Remote Apple Events: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Remote Apple Events to disabled Terminal Method: Run the following commands to set Remote Apple Events to Off: $ /usr/bin/sudo /usr/sbin/systemsetup -setremoteappleevents off setremoteappleevents: Off." + compliance: + - cis: ["2.3.3.7"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:systemsetup -getremoteappleevents -> r:Remote Apple Events:\s*\t*Off' + + # 2.3.3.8 Ensure Internet Sharing Is Disabled. (Automated) + - id: 31018 + title: "Ensure Internet Sharing Is Disabled." + description: "Internet Sharing uses the open source natd process to share an internet connection with other computers and devices on a local network. This allows the Mac to function as a router and share the connection to other, possibly unauthorized, devices." + rationale: "Disabling Internet Sharing reduces the remote attack surface of the system." + impact: "Internet Sharing allows the computer to function as a router and other computers to use it for access. This can expose both the computer itself and the networks it is accessing to unacceptable access from unapproved devices." + remediation: "Graphical Method: Perform the following steps to disable Internet Sharing: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Internet Sharing to disabled Terminal Method: Run the following command to turn off Internet Sharing: $ usr/bin/sudo /usr/bin/defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict Enabled -int 0 Note: Using the Terminal Method will not be reflected in the GUI, but will disable the underlying service. Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.MCX 2. The key to include is forceInternetSharingOff 3. The key must be set to ." + compliance: + - cis: ["2.3.3.8"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: any + rules: + - 'not c:defaults read /Library/Preferences/SystemConfiguration/com.apple.nat -> r:Enabled\s*\t*=\s*\t*1' + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.MCX'').objectForKey(''forceInternetSharingOff'')" -> r:^true$' + + # 2.3.3.9 Ensure Content Caching Is Disabled. (Automated) + - id: 31019 + title: "Ensure Content Caching Is Disabled." + description: "Starting with 10.13 (macOS High Sierra), Apple introduced a service to make it easier to deploy data from Apple, including software updates, where there are bandwidth constraints to the Internet and fewer constraints or greater bandwidth exist on the local subnet. This capability can be very valuable for organizations that have throttled and possibly metered Internet connections. In heterogeneous enterprise networks with multiple subnets, the effectiveness of this capability would be determined by how many Macs were on each subnet at the time new, large updates were made available upstream. This capability requires the use of mac OS clients as P2P nodes for updated Apple content. Unless there is a business requirement to manage operational Internet connectivity and bandwidth user endpoints should not store content and act as a cluster to provision data. Content types supported by Content Caching in macOS." + rationale: "The main use case for Mac computers is as mobile user endpoints. P2P sharing services should not be enabled on laptops that are using untrusted networks. Content Caching can allow a computer to be a server for local nodes on an untrusted network. While there are certainly logical controls that could be used to mitigate risk, they add to the management complexity. Since the value of the service is in specific use cases organizations with the use case described above can accept risk as necessary." + impact: "This setting will adversely affect bandwidth usage between local subnets and the Internet." + remediation: "Graphical Method: Perform the following steps to disable Content Caching: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Content Caching to disabled Terminal Method: Run the following command to disable Content Caching: $ /usr/bin/sudo /usr/bin/AssetCacheManagerUtil deactivate The output will include Content caching deactivated Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.applicationaccess 2. The key to include is allowContentCaching 3. The key must be set to ." + references: + - https://support.apple.com/guide/mac-help/about-content-caching-mchl9388ba1b/ + - https://support.apple.com/guide/mac-help/set-up-content-caching-on-mac-mchl3b6c3720/ + compliance: + - cis: ["2.3.3.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.AssetCache'').objectForKey(''Activated'')" -> r:^0$' + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.applicationaccess'').objectForKey(''allowContentCaching'')" -> r:^0$|^true$' + + # 2.3.3.10 Ensure Media Sharing Is Disabled (Automated) - Not implemented + # 2.3.3.11 Ensure Bluetooth Sharing Is Disabled (Automated) - Not implemented + # 2.3.3.12 Ensure Computer Name Does Not Contain PII or Protected Organizational Information (Manual) - Not implemented + # 2.3.4 Time Machine + + # 2.3.4.1 Ensure Backup Automatically is Enabled If Time Machine Is Enabled. (Automated) + - id: 31020 + title: "Ensure Backup Automatically is Enabled If Time Machine Is Enabled." + description: 'Backup solutions are only effective if the backups run on a regular basis. The time to check for backups is before the hard drive fails or the computer goes missing. In order to simplify the user experience so that backups are more likely to occur, Time Machine should be on and set to Back Up Automatically whenever the target volume is available. Operational staff should ensure that backups complete on a regular basis and the backups are tested to ensure that file restoration from backup is possible when needed. Backup dates are available even when the target volume is not available in the Time Machine plist. SnapshotDates = ( "2012-08-20 12:10:22 +0000", "2013-02-03 23:43:22 +0000", "2014-02-19 21:37:21 +0000", "2015-02-22 13:07:25 +0000", "2016-08-20 14:07:14 +0000" When the backup volume is connected to the computer more extensive information is available through tmutil. See man tmutil.' + rationale: "Backups should automatically run whenever the backup drive is available." + impact: "The backup will run periodically in the background and could have user impact while running." + remediation: "Graphical Method: Perform the following steps to enable Time Machine automatic backup: 1. Open System Settings 2. Select General 3. Select Time Machine 4. Select Options... 5. Set Back up frequency to Automatically Terminal Method: Run the following command to enable automatic backups if Time Machine is enabled: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.TimeMachine.plist AutoBackup -bool true Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.TimeMachine 2. The key to include is Forced 3. The key must be set to: mcx_preference_settings AutoBackup ." + compliance: + - cis: ["2.3.4.1"] + - cis_csc_v8: ["11.2"] + - cis_csc_v7: ["10.1"] + - hipaa: ["164.308(a)(7)(ii)(A)"] + - iso_27001-2013: ["A.12.3.1"] + - mitre_techniques: ["T1485", "T1486", "T1487", "T1488", "T1490", "T1491"] + - pci_dss_v3.2.1: ["12.10.1"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.TimeMachine'').objectForKey(''AutoBackup'')" -> r:^1$' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.TimeMachine'').objectForKey(''LastDestinationID'')" -> r:^\.+$' + + # 2.3.4.2 Ensure Time Machine Volumes Are Encrypted If Time Machine Is Enabled. (Automated) + - id: 31021 + title: "Ensure Time Machine Volumes Are Encrypted If Time Machine Is Enabled." + description: "One of the most important security tools for data protection on macOS is FileVault. With encryption in place it makes it difficult for an outside party to access your data if they get physical possession of the computer. One very large weakness in data protection with FileVault is the level of protection on backup volumes. If the internal drive is encrypted but the external backup volume that goes home in the same laptop bag is not it is self-defeating. Apple tries to make this mistake easily avoided by providing a checkbox to enable encryption when setting-up a Time Machine backup. Using this option does require some password management, particularly if a large drive is used with multiple computers. A unique complex password to unlock the drive can be stored in keychains on multiple systems for ease of use. While some portable drives may contain non-sensitive data and encryption may make interoperability with other systems difficult backup volumes should be protected just like boot volumes." + rationale: "Backup volumes need to be encrypted." + remediation: "Graphical Method: Perform the following steps to enable encryption on the Time Machine drive: 1. Open System Settings 2. Select General 3. Select Time Machine 4. Select the unencrypted drive 5. Select - to forget that drive as a destination 6. Select + to add a different drive as the destination 7. Select Set Up Disk... 8. Set Encrypt Backup to enabled 9. Enter a password in the New Password and the same password in the Re-enter Password fields 10. A password hint is required, but it is recommended that you do not use any identifying information for the password Note: In macOS 12.0 Monterey and previous, the existing Time Machine drive could have encryption added without formatting it. This is no longer possible in macOS 13.0 Ventura. If you with to keep previous backups from the unencrypted volume, you will need to manually move those files over to the new encrypted drive." + compliance: + - cis: ["2.3.4.2"] + - cis_csc_v8: ["3.6", "3.11", "11.3"] + - cis_csc_v7: ["10.4", "13.6", "14.8"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "MP.L2-3.8.9", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.12.3.1", "A.6.2.1"] + - mitre_techniques: ["T1040", "T1070", "T1072", "T1114", "T1119", "T1145", "T1208", "T1485", "T1486", "T1487", "T1488", "T1490", "T1491", "T1492", "T1493", "T1527", "T1530"] + - nist_sp_800-53: ["CP-9(8)", "SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1", "9.5", "9.5.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["A1.2", "CC6.1", "CC6.4", "CC6.7"] + condition: all + rules: + - 'c: sh -c "defaults read /Library/Preferences/com.apple.TimeMachine.plist | grep -c NotEncrypted" -> r:^0$' + + # 2.4 Control Center + # 2.4.1 Ensure Show Wi-Fi status in Menu Bar Is Enabled (Automated) - Not implemented + # 2.4.2 Ensure Show Bluetooth Status in Menu Bar Is Enabled (Automated) - Not implemented + # 2.5 Siri & Spotlight + # 2.5.1 Audit Siri Settings (Manual) - Not Implemented + # 2.6 Privacy & Security + # 2.6.1 Location Services + + # 2.6.1.1 Ensure Location Services Is Enabled. (Automated) + - id: 31022 + title: "Ensure Location Services Is Enabled." + description: "macOS uses location information gathered through local Wi-Fi networks to enable applications to supply relevant information to users. With the operating system verifying the location, users do not need to change the time or the time zone. The computer will change them based on the user's location. They do not need to specify their location for weather or travel times, and they will receive alerts on travel times to meetings and appointment where location information is supplied. Location Services simplify some processes with mobile computers, such as asset management and time or log management. There are some use cases where it is important that the computer not be able to report its exact location. While the general use case is to enable Location Services, it should not be allowed if the physical location of the computer and the user should not be public knowledge." + rationale: "Location Services are helpful in most use cases and can simplify log and time management where computers change time zones." + remediation: "Graphical Method: Perform the following steps to enable Location Services: 1. Open System Settings 2. Select Privacy & Security 3. Select Location Services 4. Set Location Services to enabled Terminal Method: Run the following command to enable Location Services: $ /usr/bin/sudo /bin/launchctl load -w /System/Library/LaunchDaemons/com.apple.locationd.plist If the com.apple.locationd.plist outputs 0, run the following command to also ensure Location Services is running: $ /usr/bin/sudo /usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd LocationServicesEnabled -bool false $ /usr/bin/sudo /bin/launchctl kickstart -k system/com.apple.locationd Note: In some use cases, organizations may not want Location Services running. To disable Location Services, System Integrity Protection must be disabled." + references: + - "https://support.apple.com/en-us/HT204690" + compliance: + - cis: ["2.6.1.1"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sh -c "launchctl list | grep -c com.apple.locationd" -> r:^1$' + - 'c:sudo -u _locationd /usr/bin/osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.locationd'').objectForKey(''LocationServicesEnabled'')" -> r:^1$' + + # 2.6.1.2 Ensure Location Services Is in the Menu Bar. (Automated) + - id: 31023 + title: "Ensure Location Services Is in the Menu Bar." + description: "This setting provides the user to understand the current status of Location Services and which applications are using it." + rationale: 'Apple has fully integrated location services into macOS. Where the computer is currently located is used for Timezones, weather, travel times, geolocation, "Find my Mac" and advertising services. This benchmark recommends that location services are enabled for most users. Many users may have occasions when they do not want to share their current locations, some users may need to rarely share their locations. The immediate availability of Location Services in the menu bar provides easy access to the current status, which applications are using the service and a quick shortcut to making changes. This setting provides better user control in managing user privacy.' + impact: "Users may be provided visibility to a setting they cannot control if organizations control Location Services globally by policy." + remediation: "Graphical Method: Perform the following steps to set whether the location services icon is in the menu bar: 1. Open System Settings 2. Select Privacy & Security 3. Select Location Services 4. Select Details... 5. Set Show location icon in menu bar when System Services request your location to your organization's parameters Terminal Method: Run the following commands to set the option of the location services icon being in the menu bar: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.locationmenu.plist ShowSystemServices -bool ." + compliance: + - cis: ["2.6.1.2"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.locationmenu.plist ShowSystemServices -> r:^1$|^true$" + + # 2.6.1.3 Audit Location Services Access (Manual) - Not Implemented + # 2.6.2 Ensure Sending Diagnostic and Usage Data to Apple Is Disabled (Automated) - Not implemented + # 2.6.3 Ensure Limit Ad Tracking Is Enabled (Automated) - Not implemented + + # 2.6.4 Ensure Gatekeeper Is Enabled. (Automated) + - id: 31024 + title: "Ensure Gatekeeper Is Enabled." + description: "Gatekeeper is Apple's application that utilizes allowlisting to restrict downloaded applications from launching. It functions as a control to limit applications from unverified sources from running without authorization. In an update to Gatekeeper in macOS 13 Ventura, Gatekeeper checks every application on every launch, not just quarantined apps." + rationale: "Disallowing unsigned software will reduce the risk of unauthorized or malicious applications from running on the system." + remediation: "Graphical Method: Perform the following steps to enable Gatekeeper: 1. Open System Settings 2. Select Privacy & Security 3. Set 'Allow apps downloaded from' to 'App Store and identified developers' Terminal Method: Run the following command to enable Gatekeeper to allow applications from App Store and identified developers: $ /usr/bin/sudo /usr/sbin/spctl --master-enable Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.systempolicy.control 2. The key to include is AllowIdentifiedDevelopers 3. The key must be set to 4. The key to also include is EnableAssessment 5. The key must be set to ." + compliance: + - cis: ["2.6.4"] + - cis_csc_v8: ["10.1", "10.2", "10.5"] + - cis_csc_v7: ["8.2", "8.4"] + - cmmc_v2.0: ["SI.L1-3.14.2", "SI.L1-3.14.4"] + - hipaa: ["164.308(a)(5)(ii)(B)"] + - iso_27001-2013: ["A.12.2.1"] + - mitre_techniques: ["T1017", "T1019", "T1027", "T1045", "T1068", "T1072", "T1073", "T1075", "T1091", "T1100", "T1103", "T1137", "T1138", "T1189", "T1190", "T1193", "T1194", "T1195", "T1200", "T1210", "T1211", "T1212", "T1215", "T1221", "T1495"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4", "11.4", "5.1", "5.1.1", "5.2"] + - pci_dss_v4.0: ["5.1.1", "5.2.1", "5.2.2", "5.3.1", "5.3.2"] + - soc_2: ["CC6.8"] + condition: all + rules: + - "c:spctl --status -> r:^assessments enabled" + + # 2.6.5 Ensure FileVault Is Enabled. (Automated) + - id: 31025 + title: "Ensure FileVault Is Enabled." + description: "FileVault secures a system's data by automatically encrypting its boot volume and requiring a password or recovery key to access it. FileVault should be used with a saved escrow key to ensure that the owner can decrypt their data if the password is lost. FileVault may also be enabled using command line using the fdesetup command. To use this functionality, consult the Der Flounder blog for more details (see link below under References)." + rationale: "Encrypting sensitive data minimizes the likelihood of unauthorized users gaining access to it." + impact: "Mounting a FileVault encrypted volume from an alternate boot source will require a valid password to decrypt it." + remediation: "Graphical Method: Perform the following steps to enable FileVault: 1. Open System Settings 2. Select Security & Privacy 3. Select Turn On... Note: This will allow you to create a recovery key for FileVault. Keep the key saved securely in case it is needed at a later date. Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.MCX 2. The key to include is dontAllowFDEDisable 3. The key must be set to Note: This profile is required to pass the audit." + references: + - https://derflounder.wordpress.com/2015/02/02/managing-yosemites-filevault-2-with-fdesetup/ + - https://derflounder.wordpress.com/2019/01/15/unlock-or-decrypt-your-filevault-encrypted-boot-drive-from-the-command-line-on-macos-mojave/ + - https://derflounder.wordpress.com/2021/10/29/use-of-filevault-institutional-recovery-keys-no-longer-recommended-by-apple/ + compliance: + - cis: ["2.6.5"] + - cis_csc_v8: ["3.6", "3.11"] + - cis_csc_v7: ["13.6", "14.8"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.6.2.1"] + - mitre_techniques: ["T1040", "T1070", "T1072", "T1114", "T1119", "T1145", "T1208", "T1492", "T1493", "T1527", "T1530"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:fdesetup status -> r:^FileVault is On" + - 'c:osascript -l JavaScript -e "osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.MCX'').objectForKey(''dontAllowFDEDisable'')" -> r:^0$' + + # 2.6.6 Audit Lockdown Mode (Manual) - Not Implemented + # 2.6.7 Ensure an Administrator Password Is Required to Access System-Wide Preferences. (Manual) + - id: 31026 + title: "Ensure an Administrator Password Is Required to Access System-Wide Preferences." + description: "System Preferences controls system and user settings on a macOS Computer. System Preferences allows the user to tailor their experience on the computer as well as allowing the System Administrator to configure global security settings. Some of the settings should only be altered by the person responsible for the computer." + rationale: "By requiring a password to unlock system-wide System Preferences, the risk is mitigated of a user changing configurations that affect the entire system and requires an admin user to re-authenticate to make changes." + impact: "Users will need to enter their password to unlock some additional preference panes that are unlocked by default like Network, Startup and Printers & Scanners." + remediation: "Graphical Method: Perform the following steps to verify that an administrator password is required to access system-wide preferences: 1. Open System Settings 2. Select Privacy & Security 3. Select Advanced 4. Set Require an administrator password to access system-wide settings to enabled. Terminal Method: The authorizationdb settings cannot be written to directly, so the plist must be exported out to temporary file. Changes can be made to the temporary plist, then imported back into the authorizationdb settings. Run the following commands to enable that an administrator password is required to access system-wide preferences: $ /usr/bin/sudo /usr/bin/security authorizationdb read system.preferences > /tmp/system.preferences.plist YES (0) $ /usr/bin/sudo /usr/bin/defaults write /tmp/system.preferences.plist shared -bool false $ /usr/bin/sudo /usr/bin/security authorizationdb write system.preferences < /tmp/system.preferences.plist YES (0)." + compliance: + - cis: ["2.6.7"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:security authorizationdb read system.preferences | grep -A1 shared -> r:>false<" + + # 2.7 Desktop & Dock + # 2.7.1 Ensure Screen Saver Corners Are Secure (Automated) - Not implemented + # 2.8 Displays + # 2.8.1 Audit Universal Control Settings (Manual) - Not Implemented + # 2.9 Battery (Energy Saver) + + # 2.9.1 Ensure Power Nap Is Disabled for Intel Macs. (Automated) + - id: 31027 + title: "Ensure Power Nap Is Disabled for Intel Macs." + description: "Power Nap allows the system to stay in low power mode, especially while on battery power, and periodically connect to previously known networks with stored credentials for user applications to phone home and get updates. This capability requires FileVault to remain unlocked and the use of previously joined networks to be risk accepted based on the SSID without user input. This control has been updated to check the status on both battery and AC Power. The presence of an electrical outlet does not completely correlate with logical and physical security of the device or available networks." + rationale: "Disabling this feature mitigates the risk of an attacker remotely waking the system and gaining access. The use of Power Nap adds to the risk of compromised physical and logical security. The user should be able to decrypt FileVault and have the applications download what is required when the computer is actively used. The control to prevent computer sleep has been retired for this version of the Benchmark. Forcing the computer to stay on and use energy in case a management push is needed is contrary to most current management processes. Only keep computers unslept if after hours pushes are required on closed LANs." + impact: "Power Nap exists for unattended user application updates like email and social media clients. With Power Nap disabled, the computer will not wake and reconnect to known wireless SSIDs intermittently when slept." + remediation: "Graphical Method: Perform the following steps to disable Power Nap: Desktop Instructions: 1. Open System Settings 2. Select Energy Saver 3. Set Power Nap to disabled 4. Select UPS (if applicable) 5. Set Power Nap to disabled Laptop Instructions: 1. Open System Settings 2. Select Battery 3. Select Power Adapter (for laptops only) 4. Set Power Nap to disabled 5. Select Battery 6. Set Power Nap to disabled 7. Select UPS (if applicable) 8. Set Power Nap to disabled Terminal Method: Run the following command to disable Power Nap: $ /usr/bin/sudo /usr/bin/pmset -a powernap 0." + compliance: + - cis: ["2.9.1"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'not c:sh -c "pmset -g custom" -> r:powernap\s*\t*1' + + # 2.9.2 Ensure Wake for Network Access Is Disabled. (Automated) + - id: 31028 + title: "Ensure Wake for Network Access Is Disabled." + description: "This feature allows the computer to take action when the user is not present and the computer is in energy saving mode. These tools require FileVault to remain unlocked and fully rejoin known networks. This macOS feature is meant to allow the computer to resume activity as needed regardless of physical security controls. This feature allows other users to be able to access your computer's shared resources, such as shared printers or Apple Music playlists, even when your computer is in sleep mode. In a closed network when only authorized devices could wake a computer, it could be valuable to wake computers in order to do management push activity. Where mobile workstations and agents exist, the device will more likely check in to receive updates when already awake. Mobile devices should not be listening for signals on any unmanaged network or where untrusted devices exist that could send wake signals." + rationale: "Disabling this feature mitigates the risk of an attacker remotely waking the system and gaining access." + impact: "Management programs like Apple Remote Desktop Administrator use wake-on-LAN to connect with computers. If turned off, such management programs will not be able to wake a computer over the LAN. If the wake-on-LAN feature is needed, do not turn off this feature. The control to prevent computer sleep has been retired for this version of the Benchmark. Forcing the computer to stay on and use energy in case a management push is needed is contrary to most current management processes. Only keep computers unslept if after hours pushes are required on closed LANs." + remediation: "Graphical Method: Perform the following steps to disable Wake for network access: Desktop Instructions: 1. Open System Settings 2. Select Energy Saver 3. Set Wake for network access to disabled Laptop Instructions: 1. Open System Settings 2. Select Battery 3. Select Options... 4. Set Wake for network access to Never Terminal Method: Run the following command to disable Wake for network access: $ /usr/bin/sudo /usr/bin/pmset -a womp 0 Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.MCX 2. The key to include is com.apple.EnergySaver.desktop.ACPower 3. The key must be set to: Wake On LAN 0 Wake On Modem Ring 0 4. The key to also include is com.apple.EnergySaver.portable.ACPower 5. The key must be set to: Wake On LAN 0 Wake On Modem Ring 0 6. The key to also include is com.apple.EnergySaver.portable.BatteryPower 7. The key must be set to: Wake On LAN 0 Wake On Modem Ring 0 Note: Both Wake on LAN and Wake on Modem Ring need to be set. Only setting Wake On LAN will allow the profile to install but not set any settings. This profile will only apply the setting at installation and is not sticky." + compliance: + - cis: ["2.9.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1051", "T1076", "T1133", "T1200"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'c:sh -c "pmset -g | grep -e womp" -> r:0' + - 'not c:sh -c "profiles -P -o stdout | grep ''Wake On LAN''" -> n:=\s*(\d) compare != 0' + - 'not c:sh -c "profiles -P -o stdout | grep ''Wake On Modem Ring''" -> n:=\s*(\d) compare != 0' + + # 2.9.3 Ensure the OS is not Activate When Resuming from Sleep (Automated) - Not Implemented + # 2.10 Lock Screen + # 2.10.1 Ensure an Inactivity Interval of 20 Minutes Or Less for the Screen Saver Is Enabled (Automated) - Not implemented + # 2.10.2 Ensure a Password is Required to Wake the Computer From Sleep or Screen Saver Is Enabled. (Automated) + - id: 31029 + title: "Ensure a Password is Required to Wake the Computer From Sleep or Screen Saver Is Enabled." + description: "Sleep and screen saver modes are low power modes that reduce electrical consumption while the system is not in use." + rationale: "Prompting for a password when waking from sleep or screen saver mode mitigates the threat of an unauthorized person gaining access to a system in the user's absence." + impact: "Without a screenlock in place anyone with physical access to the computer would be logged in and able to use the active user's session." + remediation: "Graphical Method: Perform the following steps to enable a password for unlock after a screen saver begins or after sleep: 1. Open System Settings 2. Select Lock Screen 3. Set Require password after screensaver begins or display is turned off to either After 0 seconds or After 5 seconds Terminal Method: Run the following command to require a password to unlock the computer after the screen saver engages or the computer sleeps: $ /usr/bin/sudo /usr/sbin/sysadminctl -screenLock immediate -password or $ /usr/bin/sudo /usr/sbin/sysadminctl -screenLock 5 seconds -password Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.screensaver 2. The key to include is askForPassword 3. The key must be set to 4. The key to also include is askForPasswordDelay 5. The key must be set to <0,5>." + references: + - "https://blog.kolide.com/screensaver-security-on-macos-10-13-is-broken-a385726e2ae2" + - "https://github.com/rtrouton/profiles/blob/master/SetDefaultScreensaver/SetDefaultScreensaver.mobileconfig" + compliance: + - cis: ["2.10.2"] + - cis_csc_v8: ["4.7"] + - cis_csc_v7: ["4.2"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - pci_dss_v3.2.1: ["2.1", "2.1.1"] + - pci_dss_v4.0: ["2.2.2", "2.3.1"] + - soc_2: ["CC6.3"] + condition: all + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.screensaver'').objectForKey(''askForPassword'')" -> n:^(\d+)$ compare == 1' + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.screensaver'').objectForKey(''askForPasswordDelay'')" -> n:^(\d+)$ compare <= 5' + + # 2.10.3 Ensure a Custom Message for the Login Screen Is Enabled. (Automated) + - id: 31030 + title: "Ensure a Custom Message for the Login Screen Is Enabled." + description: "An access warning informs the user that the system is reserved for authorized use only, and that the use of the system may be monitored." + rationale: "An access warning may reduce a casual attacker's tendency to target the system. Access warnings may also aid in the prosecution of an attacker by evincing the attacker's knowledge of the system's private status, acceptable use policy, and authorization requirements." + impact: "If users are not informed of their responsibilities, unapproved activities may occur. Users that are not approved for access may take the lack of a warning banner as implied consent to access." + remediation: 'Graphical Method: Perform the following steps to enable a login banner set to your organization''s required text: 1. Open System Settings 2. Select Lock Screen 3. Set Show message when locked to enabled 4. Select Set 5. Insert text in the Set a message to appear on the lock screen that matches your organization''s required text 6. Select Done Terminal Method: Run the following command to enable a custom login screen message: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "" example: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "Center for Internet Security Test Message" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.loginwindow 2. The key to include is LoginwindowText 3. The key must be set to .' + compliance: + - cis: ["2.10.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''LoginwindowText'')" -> r:^\.+$' + + # 2.10.4 Ensure Login Window Displays as Name and Password Is Enabled. (Automated) + - id: 31031 + title: "Ensure Login Window Displays as Name and Password Is Enabled." + description: "The login window prompts a user for his/her credentials, verifies their authorization level, and then allows or denies the user access to the system." + rationale: "Prompting the user to enter both their username and password makes it twice as hard for unauthorized users to gain access to the system since they must discover two attributes." + remediation: "Graphical Method: Perform the following steps to ensure the login window display name and password: 1. Open System Settings 2. Select Lock Screen 3. Set 'Login window showstoName and Password` Terminal Method: Run the following command to enable the login window to display name and password: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool true Note: The GUI will not display the updated setting until the current user(s) logs out. Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.loginwindow 2. The key to include is SHOWFULLNAME 3. The key must be set to ." + compliance: + - cis: ["2.10.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''SHOWFULLNAME'')" -> r:^1$|^true$' + + # 2.10.5 Ensure Show Password Hints Is Disabled. (Automated) + - id: 31032 + title: "Ensure Show Password Hints Is Disabled." + description: "Password hints are user-created text displayed when an incorrect password is used for an account." + rationale: "Password hints make it easier for unauthorized persons to gain access to systems by displaying information provided by the user to assist in remembering the password. This info could include the password itself or other information that might be readily discerned with basic knowledge of the end user." + impact: "The user can set the hint to any value, including the password itself or clues that allow trivial social engineering attacks." + remediation: "Graphical Method: Perform the following steps to disable password hints from being shown: 1. Open System Settings 2. Select Lock Screen 3. Set 'Show password hints` to disabled Terminal Method: Run the following command to disable password hints: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow RetriesUntilHint -int 0 Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.loginwindow 2. The key to include is RetriesUntilHint 3. The key must be set to 0." + compliance: + - cis: ["2.10.5"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''RetriesUntilHint'')" -> r:^0$' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''RetriesUntilHint'')" -> r:\w+' + + # 2.11 Touch ID & Password (Login Password) + # 2.11.1 Ensure Users' Accounts Do Not Have a Password Hint. (Automated) + - id: 31033 + title: "Ensure Users' Accounts Do Not Have a Password Hint." + description: "Password hints help the user recall their passwords for various systems and/or accounts. In most cases, password hints are simple and closely related to the user's password." + rationale: "Password hints that are closely related to the user's password are a security vulnerability, especially in the social media age. Unauthorized users are more likely to guess a user's password if there is a password hint. The password hint is very susceptible to social engineering attacks and information exposure on social media networks." + remediation: "Graphical Method: Perform the following steps to remove a user's password hint: 1. Open System Settings 2. Select Touch ID & Passwords (or Login Password on non-Touch ID Macs) 3. Select Change... 4. Change the password and ensure that no text is entered in the Password hint box Note: This will only change the currently logged-in user's password, and not any others that are not compliant on the Mac. Use the terminal method if multiple users are not in compliance. Terminal Method: Run the following command to remove a user's password hint: $ /usr/bin/sudo /usr/bin/dscl . -list /Users hint . -delete /Users/ hint example: $ /usr/bin/sudo /usr/bin/dscl . -list /Users hint . -delete /Users/firstuser hint $ /usr/bin/sudo /usr/bin/dscl . -list /Users hint . -delete /Users/seconduser hint." + compliance: + - cis: ["2.11.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'not c:dscl . -list /Users hint -> r:^\w*$' + + # 2.11.2 Audit Touch ID and Wallet & Apple Pay Settings (Manual) - Not Implemented + # 2.12 Users & Groups + + # 2.12.1 Ensure Guest Account Is Disabled. (Automated) + - id: 31034 + title: "Ensure Guest Account Is Disabled." + description: "The guest account allows users access to the system without having to create an account or password. Guest users are unable to make setting changes and cannot remotely login to the system. All files, caches, and passwords created by the guest user are deleted upon logging out." + rationale: "Disabling the guest account mitigates the risk of an untrusted user doing basic reconnaissance and possibly using privilege escalation attacks to take control of the system." + impact: "A guest user can use that access to find out additional information about the system and might be able to use privilege escalation vulnerabilities to establish greater access." + remediation: "Graphical Method: Perform the following steps to disable guest account availability: 1. Open System Settings 2. Select Users & Groups 3. Select the i next to the Guest User 4. Set Allow guests to log in to this computer to disabled Terminal Method: Run the following command to disable the guest account: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled -bool false Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.MCX 2. The key to include is DisableGuestAccount 3. The key must be set to ." + compliance: + - cis: ["2.12.1"] + - cis_csc_v8: ["5.2", "6.2", "6.8"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.4", "AC.L2-3.1.5", "IA.L2-3.5.7", "SC.L2-3.13.3"] + - hipaa: ["164.308(a)(3)(ii)(B)", "164.308(a)(3)(ii)(C)", "164.308(a)(4)(i)", "164.308(a)(4)(ii)(C)"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - nist_sp_800-53: ["AC-2(1)", "AC-5", "AC-6", "AC-6(1)", "AC-6(7)", "AU-9(4)"] + - pci_dss_v3.2.1: ["8.1.3"] + - pci_dss_v4.0: ["10.3.1", "2.2.2", "7.1", "7.1.1", "7.2", "7.2.1", "7.2.2", "7.2.4", "7.2.6", "7.3", "7.3.1", "7.3.2", "8.2.4", "8.2.5", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC5.2", "CC6.1", "CC6.2", "CC6.3"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.MCX'').objectForKey(''DisableGuestAccount'')" -> r:^1$' + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''GuestEnabled'')" -> r:^0$' + + # 2.12.2 Ensure Guest Access to Shared Folders Is Disabled. (Automated) + - id: 31035 + title: "Ensure Guest Access to Shared Folders Is Disabled." + description: "Allowing guests to connect to shared folders enables users to access selected shared folders and their contents from different computers on a network." + rationale: "Not allowing guests to connect to shared folders mitigates the risk of an untrusted user doing basic reconnaissance and possibly use privilege escalation attacks to take control of the system." + impact: "Unauthorized users could access shared files on the system." + remediation: "Graphical Method: Perform the following steps to no longer allow guest user access to shared folders: 1. Open System Settings 2. Select Users & Groups 3. Select the i next to the Guest User 4. Set Allow guests to connect to shared folders to disabled Terminal Method: Run the following commands to verify that shared folders are not accessible to guest users: $ /usr/bin/sudo /usr/sbin/sysadminctl -smbGuestAccess off." + compliance: + - cis: ["2.12.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - "c:sysadminctl -smbGuestAccess status -> r:SMB guest access disabled" + + # 2.12.3 Ensure Automatic Login Is Disabled. (Automated) + - id: 31036 + title: "Ensure Automatic Login Is Disabled." + description: "The automatic login feature saves a user's system access credentials and bypasses the login screen. Instead, the system automatically loads to the user's desktop screen." + rationale: "Disabling automatic login decreases the likelihood of an unauthorized person gaining access to a system." + impact: "If automatic login is not disabled, an unauthorized user could gain access to the system without supplying any credentials." + remediation: "Graphical Method: Perform the following steps to set automatic login to off: 1. Open System Settings 2. Select Users & Groups 3. Set Automatic login in as... to Off Terminal Method: Run the following command to disable automatic login: $ /usr/bin/sudo /usr/bin/defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.loginwindow 2. The key to include is com.apple.login.mcx.DisableAutoLoginClient 3. The key must be set to Note: If both the profile is enabled and a user is set to autologin, the profile will take precedent. In this case, the graphical or terminal remediation method should also be applied in case the profile is ever removed." + compliance: + - cis: ["2.12.3"] + - cis_csc_v8: ["4.7"] + - cis_csc_v7: ["4.2"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - pci_dss_v3.2.1: ["2.1", "2.1.1"] + - pci_dss_v4.0: ["2.2.2", "2.3.1"] + - soc_2: ["CC6.3"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''com.apple.login.mcx.DisableAutoLoginClient'')" -> r:^1$' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''autoLoginUser'')" -> r:^\.+$' + + # 2.13 Passwords + # 2.13.1 Audit Passwords System Preference Setting (Manual) - Not implemented + # 2.14 Notifications + # 2.14.1 Audit Notification & Focus Settings (Manual) - Not implemented + ########################################################################## + # 3 Logging and Auditing + ########################################################################## + + # 3.1 Ensure Security Auditing Is Enabled. (Automated) + - id: 31037 + title: "Ensure Security Auditing Is Enabled." + description: "macOS's audit facility, auditd, receives notifications from the kernel when certain system calls, such as open, fork, and exit, are made. These notifications are captured and written to an audit log." + rationale: "Logs generated by auditd may be useful when investigating a security incident as they may help reveal the vulnerable application and the actions taken by a malicious actor." + remediation: "Terminal Method: Perform the following to enable security auditing: Run the following command to load auditd: $ /usr/bin/sudo /bin/launchctl load -w /System/Library/LaunchDaemons/com.apple.auditd.plist." + compliance: + - cis: ["3.1"] + - cis_csc_v8: ["8.2", "8.5"] + - cis_csc_v7: ["4.9", "6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1110", "T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209"] + condition: all + rules: + - "c:launchctl list -> r:com.apple.auditd" + + # 3.2 Ensure Security Auditing Flags For User-Attributable Events Are Configured Per Local Organizational Requirements. (Automated) + - id: 31038 + title: "Ensure Security Auditing Flags For User-Attributable Events Are Configured Per Local Organizational Requirements." + description: "Auditing is the capture and maintenance of information about security-related events. Auditable events often depend on differing organizational requirements." + rationale: "Maintaining an audit trail of system activity logs can help identify configuration errors, troubleshoot service disruptions, and analyze compromises or attacks that have occurred, have begun, or are about to begin. Audit logs are necessary to provide a trail of evidence in case the system or network is compromised. Depending on the governing authority, organizations can have vastly different auditing requirements. In this control we have selected a minimal set of audit flags that should be a part of any organizational requirements. The flags selected below may not adequately meet organizational requirements for users of this benchmark. The auditing checks for the flags proposed here will not impact additional flags that are selected." + remediation: "Terminal Method: Perform the following to set the required Security Auditing Flags: Edit the /etc/security/audit_control file and add -fm, ad, -ex, aa, -fr, lo, and -fw to flags. You can also substitute -all for -fm, -ex, -fr, and -fw." + references: + - https://derflounder.wordpress.com/2012/01/30/openbsm-auditing-on-mac-os-x/ + - https://csrc.nist.gov/CSRC/media/Publications/sp/800-179/rev-1/draft/documents/sp800-179r1-draft.pdf + - https://www.scip.ch/en/?labs.20150108 + - https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-171r2.pdf + - https://www.whitehouse.gov/wp-content/uploads/2021/08/M-21-31-Improving-the-Federal-Governments-Investigative-and-Remediation-Capabilities-Related-to-Cybersecurity-Incidents.pdf + compliance: + - cis: ["3.2"] + - cis_csc_v8: ["3.14", "8.2", "8.5"] + - cis_csc_v7: ["6.2", "14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7", "AU.L2-3.3.1"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.1", "A.12.4.3"] + - nist_sp_800-53: ["AC-6(9)", "AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2", "10.2.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "11.5"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + condition: any + rules: + - "f:/etc/security/audit_control -> r:^flags && r:-fm && r:-ex && r:ad && r:aa && r:lo && r:-fr && r:-fw" + - "f:/etc/security/audit_control -> r:^flags && r:-all && r:ad && r:aa && r:lo" + + # 3.3 Ensure install.log Is Retained for 365 or More Days and No Maximum Size. (Automated) + - id: 31039 + title: "Ensure install.log Is Retained for 365 or More Days and No Maximum Size." + description: 'macOS writes information pertaining to system-related events to the file /var/log/install.log and has a configurable retention policy for this file. The default logging setting limits the file size of the logs and the maximum size for all logs. The default allows for an errant application to fill the log files and does not enforce sufficient log retention. The Benchmark recommends a value based on standard use cases. The value should align with local requirements within the organization. The default value has an "all_max" file limitation, no reference to a minimum retention, and a less precise rotation argument. The all_max flag control will remove old log entries based only on the size of the log files. Log size can vary widely depending on how verbose installing applications are in their log entries. The decision here is to ensure that logs go back a year, and depending on the applications a size restriction could compromise the ability to store a full year. While this Benchmark is not scoring for a rotation flag, the default rotation is sequential rather than using a timestamp. Auditors may prefer timestamps in order to simply review specific dates where event information is desired. Please review the File Rotation section in the man page for more information. man asl.conf - The maximum file size limitation string should be removed "all_max=" - An organization appropriate retention should be added "ttl=" - The rotation should be set with timestamps "rotate=utc" or "rotate=local".' + rationale: "Archiving and retaining install.log for at least a year is beneficial in the event of an incident as it will allow the user to view the various changes to the system along with the date and time they occurred." + impact: "Without log files system maintenance and security forensics cannot be properly performed." + remediation: "Terminal Method: Perform the following to ensure that install logs are retained for at least 365 days: Edit the /etc/asl/com.apple.install file and add or modify the ttl value to 365 or greater on the file line. Also, remove the all_max= setting and value from the file line." + compliance: + - cis: ["3.3"] + - cis_csc_v8: ["8.1", "8.3"] + - cis_csc_v7: ["6.4", "6.7"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.12.4.3"] + - pci_dss_v3.2.1: ["10.7"] + - pci_dss_v4.0: ["10.1", "10.1.1"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/asl/com.apple.install -> n:^\s*ttl=(\d+) compare > 364' + - 'not f:/etc/asl/com.apple.install -> r:^\s*all_max=' + + # 3.4 Ensure Security Auditing Retention Is Enabled. (Automated) + - id: 31040 + title: "Ensure Security Auditing Retention Is Enabled." + description: "The macOS audit capability contains important information to investigate security or operational issues. This resource is only completely useful if it is retained long enough to allow technical staff to find the root cause of anomalies in the records. Retention can be set to respect both size and longevity. To retain as much as possible under a certain size, the recommendation is to use the following: expire-after:60d OR 5G This recomendation is based on minimum storage for review and investigation. When a third party tool is in use to allow remote logging or the store and forwarding of logs, this local storage requirement is not required." + rationale: "The audit records need to be retained long enough to be reviewed as necessary." + impact: "The recommendation is that at least 60 days or 5 gigabytes of audit records are retained. Systems that have very little remaining disk space may have issues retaining sufficient data." + remediation: "Terminal Method: Perform the following to set the audit retention length: Edit the /etc/security/audit_control file so that expire-after: is at least 60d OR 5G." + compliance: + - cis: ["3.4"] + - cis_csc_v8: ["8.1", "8.3"] + - cis_csc_v7: ["6.4", "6.7"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.12.4.3"] + - pci_dss_v3.2.1: ["10.7"] + - pci_dss_v4.0: ["10.1", "10.1.1"] + - soc_2: ["A1.1"] + condition: any + rules: + - 'f:/etc/security/audit_control -> n:^expire-after:\s*(\d+)s OR \d+\w compare => 5184000' + - 'f:/etc/security/audit_control -> n:^expire-after:\s*(\d+)h OR \d+\w compare => 1440' + - 'f:/etc/security/audit_control -> n:^expire-after:\s*(\d+)d OR \d+\w compare => 60' + - 'f:/etc/security/audit_control -> n:^expire-after:\s*(\d+)y OR \d+\w compare => 1' + - 'f:/etc/security/audit_control -> n:^expire-after:\s*\d+\w OR (\d+)b compare => 5368709120' + - 'f:/etc/security/audit_control -> n:^expire-after:\s*\d+\w OR (\d+)k compare => 5242880' + - 'f:/etc/security/audit_control -> n:^expire-after:\s*\d+\w OR (\d+)m compare => 5120' + - 'f:/etc/security/audit_control -> n:^expire-after:\s*\d+\w OR (\d+)g compare => 5' + + # 3.5 Ensure Access to Audit Records Is Controlled (Automated) - Not implemented + # 3.6 Ensure Firewall Logging Is Enabled and Configured (Automated) - Not implemented + # 3.7 Audit Software Inventory (Manual) - Not Implemented + + ########################################################################## + # 4 Network Configurations + ########################################################################## + + # 4.1 Ensure Bonjour Advertising Services Is Disabled. (Automated) + - id: 31041 + title: "Ensure Bonjour Advertising Services Is Disabled." + description: "Bonjour is an auto-discovery mechanism for TCP/IP devices which enumerate devices and services within a local subnet. DNS on macOS is integrated with Bonjour and should not be turned off, but the Bonjour advertising service can be disabled." + rationale: 'Bonjour can simplify device discovery from an internal rogue or compromised host. An attacker could use Bonjour''s multicast DNS feature to discover a vulnerable or poorly-configured service or additional information to aid a targeted attack. Implementing this control disables the continuous broadcasting of "I''m here!" messages. Typical end-user endpoints should not have to advertise services to other computers. This setting does not stop the computer from sending out service discovery messages when looking for services on an internal subnet, if the computer is looking for a printer or server and using service discovery. To block all Bonjour traffic except to approved devices, the pf or other firewall would be needed.' + impact: "Some applications, like Final Cut Studio and AirPort Base Station management, may not operate properly if the mDNSResponder is turned off." + remediation: "Terminal Method: Run the following command to disable Bonjour Advertising services: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool true Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mDNSResponder 2. The key to include is NoMulticastAdvertisements." + compliance: + - cis: ["4.1"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.mDNSResponder'').objectForKey(''NoMulticastAdvertisements'')" -> r:^1$' + + # 4.2 Ensure HTTP Server Is Disabled. (Automated) + - id: 31042 + title: "Ensure HTTP Server Is Disabled." + description: "macOS used to have a graphical front-end to the embedded Apache web server in the Operating System. Personal web sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Personal web sharing from a user endpoint has long been considered questionable, and Apple has removed that capability from the GUI. Apache, however, is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end-user computer. Web sharing should only be done through hardened web servers and appropriate cloud services." + rationale: "Web serving should not be done from a user desktop. Dedicated webservers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." + impact: "The web server is both a point of attack for the system and a means for unauthorized file transfers." + remediation: "Terminal Method: Run the following command to disable the HTTP server services: $ sudo /usr/bin/sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist." + references: + - https://www.stigviewer.com/stig/apple_macos_11_big_sur/2021-06-16/finding/V-230793 + compliance: + - cis: ["4.2"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - "not c:launchctl list -> r:org.apache.httpd" + + # 4.3 Ensure NFS Server Is Disabled. (Automated) + - id: 31043 + title: "Ensure NFS Server Is Disabled." + description: "macOS can act as an NFS fileserver. NFS sharing could be enabled to allow someone on another computer to mount shares and gain access to information from the user's computer. File sharing from a user endpoint has long been considered questionable, and Apple has removed that capability from the GUI. NFSD is still part of the Operating System and can be easily turned on to export shares and provide remote connectivity to an end-user computer. The etc/exports file contains the list of NFS shared directories. If the file exists, it is likely that NFS sharing has been enabled in the past or may be available periodically. As an additional check, the audit verifies that there is no /etc/exports file." + rationale: "File serving should not be done from a user desktop. Dedicated servers should be used. Open ports make it easier to exploit the computer." + impact: "The nfs server is both a point of attack for the system and a means for unauthorized file transfers." + remediation: "Terminal Method: Run the following command to disable the nfsd fileserver services: $ /usr/bin/sudo /bin/launchctl disable system/com.apple.nfsd Remove the exported Directory listing. $ /usr/bin/sudo /bin/rm /etc/exports." + compliance: + - cis: ["4.3"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - mitre_techniques: ["T1003", "T1011", "T1015", "T1017", "T1019", "T1028", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1051", "T1053", "T1054", "T1055", "T1058", "T1067", "T1070", "T1072", "T1073", "T1075", "T1076", "T1077", "T1078", "T1080", "T1081", "T1084", "T1086", "T1087", "T1088", "T1089", "T1092", "T1096", "T1097", "T1098", "T1100", "T1110", "T1112", "T1130", "T1133", "T1134", "T1136", "T1137", "T1138", "T1139", "T1142", "T1145", "T1146", "T1147", "T1148", "T1150", "T1156", "T1157", "T1165", "T1166", "T1169", "T1173", "T1174", "T1175", "T1176", "T1177", "T1178", "T1184", "T1187", "T1190", "T1196", "T1197", "T1198", "T1199", "T1200", "T1201", "T1206", "T1208", "T1209", "T1210", "T1214", "T1215", "T1218", "T1485", "T1486", "T1487", "T1488", "T1489", "T1490", "T1491", "T1492", "T1494", "T1495", "T1501", "T1503", "T1504", "T1505", "T1506", "T1525", "T1530", "T1535", "T1537", "T1539"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - "not c:launchctl list -> r:com.apple.nfsd" + - "not f:/etc/exports" + + ########################################################################## + # 5 System Access, Authentication and Authorization + ########################################################################## + + # 5.1 File System Permissions and Access Controls + - id: 31044 + title: "Ensure Home Folders Are Secure." + description: 'By default, macOS allows all valid users into the top level of every other user''s home folder and restricts access to the Apple default folders within. Another user on the same system can see you have a "Documents" folder but cannot see inside it. This configuration does work for personal file sharing but can expose user files to standard accounts on the system. The best parallel for Enterprise environments is that everyone who has a Dropbox account can see everything that is at the top level but can''t see your pictures. Similarly with macOS, users can see into every new Directory that is created because of the default permissions. Home folders should be restricted to access only by the user. Sharing should be used on dedicated servers or cloud instances that are managing access controls. Some environments may encounter problems if execute rights are removed as well as read and write. Either no access or execute only for group or others is acceptable.' + rationale: "Allowing all users to view the top level of all networked users' home folder may not be desirable since it may lead to the revelation of sensitive information." + impact: 'If implemented, users will not be able to use the "Public" folders in other users'' home folders. "Public" folders with appropriate permissions would need to be set up in the /Shared folder.' + remediation: "Terminal Method: For each user, run the following command to secure all home folders: $ /usr/bin/sudo /bin/chmod -R og-rwx /Users/ Alternately, run the following command if there needs to be executable access for a home folder: $ /usr/bin/sudo /bin/chmod -R og-rw /Users/ example: $ /usr/bin/sudo /bin/chmod -R og-rw /Users/thirduser/ $ /usr/bin/sudo /bin/chmod -R og-rwx /Users/fourthuser/ # /bin/ls -l /Users/ total 0 drwxr-xr-x+ 12 Guest _guest 384 24 Jul 13:42 Guest drwxrwxrwt 4 root wheel 128 22 Jul 11:00 Shared drwx--x--x+ 18 firstuser staff 576 10 Aug 14:36 firstuser drwx--x--x+ 15 seconduser staff 480 10 Aug 09:16 seconduser drwx--x--x+ 11 thirduser staff 352 10 Aug 14:53 thirduser drwx------+ 11 fourthuser staff 352 10 Aug 14:53 fourthuser." + compliance: + - cis: ["5.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1004", "T1015", "T1021", "T1023", "T1031", "T1034", "T1035", "T1036", "T1037", "T1044", "T1047", "T1050", "T1051", "T1053", "T1054", "T1070", "T1072", "T1073", "T1075", "T1076", "T1078", "T1080", "T1081", "T1084", "T1089", "T1096", "T1097", "T1133", "T1134", "T1145", "T1146", "T1150", "T1152", "T1156", "T1157", "T1159", "T1160", "T1162", "T1163", "T1165", "T1168", "T1169", "T1184", "T1185", "T1196", "T1197", "T1198", "T1200", "T1209", "T1213", "T1484", "T1489", "T1492", "T1494", "T1501", "T1504", "T1528", "T1530", "T1537", "T1538"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'not c:sh -c "ls -l /Users | grep -v total" -> !r:^drwx------ && !r:^drwx--x--x' + + # 5.1.1 Ensure Home Folders Are Secure. (Automated) - Not Implemented + + # 5.1.2 Ensure System Integrity Protection Status (SIP) Is Enabled. (Automated) + - id: 31045 + title: "Ensure System Integrity Protection Status (SIP) Is Enabled." + description: "System Integrity Protection is a security feature introduced in OS X 10.11 El Capitan. System Integrity Protection restricts access to System domain locations and restricts runtime attachment to system processes. Any attempt to inspect or attach to a system process will fail. Kernel Extensions are now restricted to /Library/Extensions and are required to be signed with a Developer ID." + rationale: "Running without System Integrity Protection on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by SIP." + impact: "System binaries and processes could become compromised." + remediation: "Terminal Method: Perform the following steps to enable System Integrity Protection: 1. Reboot into the Recovery Partition (reboot and hold down Command + R) 2. Select Utilities 3. Select Terminal 4. Run the following command: $ /usr/bin/sudo /usr/bin/csrutil enable Successfully enabled System Integrity Protection. Please restart the machine for the changes to take effect. 5. Reboot the computer Note: You should research why the system had SIP disabled. It might be a better option to erase the Mac and reinstall the operating system. That is at your discretion. Note: You cannot enable System Integrity Protection from the booted operating system. If the remediation is attempted in the booted OS and not the Recovery Partition the output will give the error csrutil: failed to modify system integrity configuration. This tool needs to be executed from the Recovery OS." + references: + - https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection + - https://support.apple.com/en-us/HT204899 + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["2.3", "2.6", "10.5"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.9"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-10", "CM-7(1)", "CM-7(2)", "CM-8(3)", "SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - pci_dss_v4.0: ["1.2.5", "12.3.4", "2.2.4"] + - soc_2: ["CC5.2", "CC6.8", "CC7.1"] + - mitre_techniques: ["T1191", "T1092", "T1175", "T1173", "T1519", "T1052", "T1210", "T1133", "T1118", "T1171", "T1170", "T1046", "T1137", "T1086", "T1164", "T1121", "T1076", "T1091", "T1180", "T1064", "T1184", "T1221", "T1127", "T1028"] + condition: all + rules: + - "c:csrutil status -> r:^System Integrity Protection status: enabled." + + # 5.1.3 Ensure Apple Mobile File Integrity (AMFI) Is Enabled. (Automated) + - id: 31046 + title: "Ensure Apple Mobile File Integrity (AMFI) Is Enabled." + description: "Apple Mobile File Integrity (AMFI) was first released in macOS 10.12. The daemon and service block attempts to run unsigned code. AMFI uses lanchd, code signatures, certificates, entitlements, and provisioning profiles to create a filtered entitlement dictionary for an app. AMFI is the macOS kernel module that enforces code-signing and library validation." + rationale: "Apple Mobile File Integrity validates that application code is validated." + impact: "Applications could be compromised with malicious code." + remediation: 'Terminal Method: Run the following command to enable the Apple Mobile File Integrity service: $ /usr/bin/sudo /usr/sbin/nvram boot-args="".' + references: + - https://eclecticlight.co/2018/12/29/amfi-checking-file-integrity-on-your-mac/ + - https://github.com/usnistgov/macos_security/issues/39 + - https://github.com/usnistgov/macos_security/issues/40 + - https://www.naut.ca/blog/2020/11/13/forbidden-commands-to-liberate-macos/ + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["2.3", "2.6"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.9"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-10", "CM-7(1)", "CM-7(2)", "CM-8(3)"] + - pci_dss_v4.0: ["1.2.5", "12.3.4", "2.2.4"] + - soc_2: ["CC5.2", "CC7.1"] + - mitre_techniques: ["T1191", "T1092", "T1175", "T1173", "T1519", "T1052", "T1210", "T1133", "T1118", "T1171", "T1170", "T1046", "T1137", "T1086", "T1164", "T1121", "T1076", "T1091", "T1180", "T1064", "T1184", "T1221", "T1127", "T1028"] + condition: all + rules: + - "not c:nvram -p -> r:amfi_get_out_of_my_way=1" + + # 5.1.4 Ensure Sealed System Volume (SSV) Is Enabled. (Automated) + - id: 31047 + title: "Ensure Sealed System Volume (SSV) Is Enabled." + description: "Sealed System Volume is a security feature introduced in macOS 11.0 Big Sur. During system installation, a SHA-256 cryptographic hash is calculated for all immutable system files and stored in a Merkle tree which itself is hashed as the Seal. Both are stored in the metadata of the snapshot created of the System volume. The seal is verified by the boot loader at startup. macOS will not boot if system files have been tampered with. If validation fails, the user will be instructed to reinstall the operating system. During read operations for files located in the Sealed System Volume, a hash is calculated and compared to the value stored in the Merkle tree." + rationale: "Running without Sealed System Volume on a production system could run the risk of Apple software that integrates directly with macOS being modified." + impact: "Apple Software that integrates with the operating system could become compromised." + remediation: "If SSV has been disabled, assume that the operating system has been compromised. Back up any files, and do a clean install to a known good Operating System." + references: + - https://developer.apple.com/news/?id=3xpv8r2m + - https://eclecticlight.co/2020/11/30/is-big-surs-system-volume-sealed/ + - https://eclecticlight.co/2020/06/25/big-surs-signed-system-volume-added-security-protection/ + - https://support.apple.com/guide/security/signed-system-volume-security-secd698747c9/web + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.6", "3.11"] + - cis_csc_v7: ["13.6", "14.8"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.6.2.1"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + - mitre_techniques: ["T1527", "T1119", "T1530", "T1114", "T1070", "T1208", "T1040", "T1145", "T1492", "T1493", "T1072"] + condition: all + rules: + - "c:csrutil authenticated-root status -> r:^Authenticated Root status: enabled" + + # 5.1.5 Ensure Appropriate Permissions Are Enabled for System Wide Applications (Automated) - Not implemented + # 5.1.6 Ensure No World Writable Files Exist in the System Folder (Automated) - Not implemented + # 5.1.7 Ensure No World Writable Files Exist in the Library Folder (Automated) - Not implemented + + # 5.2 Password Management + + # 5.2.1 Ensure Password Account Lockout Threshold Is Configured. (Automated) + - id: 31048 + title: "Ensure Password Account Lockout Threshold Is Configured." + description: "The account lockout threshold specifies the amount of times a user can enter an incorrect password before a lockout will occur. Ensure that a lockout threshold is part of the password policy on the computer." + rationale: "The account lockout feature mitigates brute-force password attacks on the system." + impact: "The number of incorrect log on attempts should be reasonably small to minimize the possibility of a successful password attack, while allowing for honest errors made during a normal user log on. The locked account will auto-unlock after a few minutes when bad password attempts stop. The computer will accept the still-valid password if remembered or recovered." + remediation: 'Terminal Method: Run the following command to set the maximum number of failed login attempts to less than or equal to 5: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy \"maxFailedLoginAttempts=\" Note: When the account lockout threshold is set with pwpolicy, it will also set a reset value to policyAttributeMinutesUntilFailedAuthenticationReset that defaults to 1 minute. You can change this value with the command: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy \"policyAttributeMinutesUntilFailedAuthenticationReset=\" example: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy \"maxFailedLoginAttempts=5\" /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy \"policyAttributeMinutesUntilFailedAuthenticationReset=10\" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mobiledevice.passwordpolicy 2. The key to include is maxFailedAttempts 3. The key must be set to Note: When setting the lockout threshold with a mobile configuration profile there is no default reset to the lockout. To set the reset value use the key autoEnableInSeconds and set the key to . Note: The profile method is the preferred method for setting password policy since - setglobalpolicy in pwpolicy is deprecated and will likely be removed in a future macOS release.' + references: + - CIS Password Policy - https://workbench.cisecurity.org/communities/113 + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["6.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1"] + - hipaa: ["164.308(a)(3)(ii)(C)"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["AC-2(1)"] + - pci_dss_v3.2.1: ["8.1.3"] + - pci_dss_v4.0: ["8.2.4", "8.2.5"] + - soc_2: ["CC6.2", "CC6.3"] + - mitre_techniques: ["T1134", "T1197", "T1538", "T1530", "T1213", "T1089", "T1157", "T1044", "T1484", "T1054", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1034", "T1163", "T1076", "T1021", "T1053", "T1489", "T1051", "T1023", "T1165", "T1528", "T1501", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + condition: all + rules: + - 'c:pwpolicy -n /Local/Default -getglobalpolicy -> n:maxFailedLoginAttempts=(\d+) compare < 6' + + # 5.2.2 Ensure Password Minimum Length Is Configured. (Automated) + - id: 31049 + title: "Ensure Password Minimum Length Is Configured." + description: "A minimum password length is the fewest number of characters a password can contain to meet a system's requirements. Ensure that a minimum of a 15-character password is part of the password policy on the computer. Where the confidentiality of encrypted information in FileVault is more of a concern, requiring a longer password or passphrase may be sufficient rather than imposing additional complexity requirements that may be self-defeating." + rationale: "Information systems that are not protected with strong password schemes including passwords of minimum length provide a greater opportunity for attackers to crack the password and gain access to the system." + impact: "Short passwords can be easily attacked." + remediation: 'Terminal Method: Run the following command to set the password length to greater than or equal to 15: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy \"minChars==15>\" example: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy \"minChars=15\" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mobiledevice.passwordpolicy 2. The key to include is minLength 3. The key must be set to =15> Note: The profile method is the preferred method for setting password policy since - setglobalpolicy in pwpolicy is deprecated and will likely be removed in a future macOS release.' + compliance: + - cis: ["5.2.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - mitre_techniques: ["T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + condition: all + rules: + - 'c:pwpolicy -n /Local/Default -getglobalpolicy -> n:minChars=(\d+) compare > 14' + + # 5.2.3 Ensure Complex Password Must Contain Alphabetic Characters Is Configured. (Manual) + - id: 31050 + title: "Ensure Complex Password Must Contain Alphabetic Characters Is Configured." + description: "Complex passwords contain one character from each of the following classes: English uppercase letters, English lowercase letters, Westernized Arabic numerals, and non-alphanumeric characters. Ensure that an Alphabetic character is part of the password policy on the computer." + rationale: "The more complex a password, the more resistant it will be against persons seeking unauthorized access to a system." + impact: "Password policy should be in effect to reduce the risk of exposed services being compromised easily through dictionary attacks or other social engineering attempts." + remediation: 'Terminal Method: Run the following command to set the that passwords must contain at least one letter: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy - setaccountpolicies "requiresAlpha==1>" example: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "requiresAlpha=1" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mobiledevice.passwordpolicy 2. The key to include is requireAlphanumeric 3. The key must be set to Note: This profile sets a requirement of both an alphabetical and a numeric character. Note: The profile method is the preferred method for setting password policy since - setglobalpolicy in pwpolicy is deprecated and will likely be removed in a future macOS release.' + compliance: + - cis: ["5.2.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: any + rules: + - "c:pwpolicy -getaccountpolicies -> r:Contain at least one number and one alphabetic character." + - 'c:sh -c "pwpolicy -getaccountpolicies | grep -A1 minimumLetters " -> n:>(\d+)< compare >= 1' + + # 5.2.4 Ensure Complex Password Must Contain Numeric Character Is Configured. (Manual) + - id: 31051 + title: "Ensure Complex Password Must Contain Numeric Character Is Configured." + description: "Complex passwords contain one character from each of the following classes: English uppercase letters, English lowercase letters, Westernized Arabic numerals, and non-alphanumeric characters. Ensure that a number or numeric value is part of the password policy on the computer." + rationale: "The more complex a password, the more resistant it will be against persons seeking unauthorized access to a system." + impact: "Password policy should be in effect to reduce the risk of exposed services being compromised easily through dictionary attacks or other social engineering attempts." + remediation: 'Terminal Method: Run the following command to set passwords to require at least one number: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy - setaccountpolicies "requiresNumeric==1>" example: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "requiresNumeric=2" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mobiledevice.passwordpolicy 2. The key to include is requireAlphanumeric 3. The key must be set to Note: This profile sets a requirement of both an alphabetical and a numeric character. Note: The profile method is the preferred method for setting password policy since - setglobalpolicy in pwpolicy is deprecated and will likely be removed in a future macOS release.' + compliance: + - cis: ["5.2.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: any + rules: + - "c:pwpolicy -getaccountpolicies -> r:Contain at least one number and one alphabetic character." + - 'c:sh -c "pwpolicy -getaccountpolicies | grep -A1 minimumNumericCharacters " -> n:>(\d+)< compare >= 1' + + # 5.2.5 Ensure Complex Password Must Contain Special Character Is Configured (Manual) - Not Implemented + + # 5.2.6 Ensure Complex Password Must Contain Uppercase and Lowercase Characters Is Configured (Manual) + - id: 31052 + title: "Ensure Complex Password Must Contain Uppercase and Lowercase Characters Is Configured." + description: "Complex passwords contain one character from each of the following classes: English uppercase letters, English lowercase letters, Westernized Arabic numerals, and non-alphanumeric characters. Ensure that both uppercase and lowercase letters are part of the password policy on the computer." + rationale: "The more complex a password, the more resistant it will be against persons seeking unauthorized access to a system." + impact: "Password policy should be in effect to reduce the risk of exposed services being compromised easily through dictionary attacks or other social engineering attempts." + remediation: 'Terminal Method: Run the following command to set passwords to require at upper and lower case letter: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "requiresMixedCase==1>" example: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "requiresMixedCase=1".' + compliance: + - cis: ["5.2.6"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1003", "T1017", "T1019", "T1028", "T1035", "T1047", "T1051", "T1053", "T1055", "T1067", "T1072", "T1075", "T1076", "T1077", "T1078", "T1084", "T1086", "T1088", "T1097", "T1098", "T1100", "T1134", "T1136", "T1169", "T1175", "T1184", "T1190", "T1206", "T1208", "T1210", "T1214", "T1215", "T1218", "T1495", "T1501", "T1505", "T1525"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: any + rules: + - 'c:sh -c "pwpolicy -getaccountpolicies | grep -A1 minimumMixedCaseCharacters " -> n:>(\d+)< compare >= 1' + + # 5.2.7 Ensure Password Age Is Configured. (Automated) + - id: 31053 + title: "Ensure Password Age Is Configured." + description: "Over time, passwords can be captured by third parties through mistakes, phishing attacks, third-party breaches, or merely brute-force attacks. To reduce the risk of exposure and to decrease the incentives of password reuse (passwords that are not forced to be changed periodically generally are not ever changed), users should reset passwords periodically. This control uses 365 days as the acceptable value. Some organizations may be more or less restrictive. This control mainly exists to mitigate against password reuse of the macOS account password in other realms that may be more prone to compromise. Attackers take advantage of exposed information to attack other accounts." + rationale: "Passwords should be changed periodically to reduce exposure." + impact: "Required password changes will lead to some locked computers requiring admin assistance." + remediation: 'Terminal Method: Run the following command to require that passwords expire after at most 365 days: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "maxMinutesUntilChangePassword=" example: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "maxMinutesUntilChangePassword=43200" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mobiledevice.passwordpolicy 2. The key to include is maxPINAgeInDays 3. The key must be set to =365> Note: The profile method is the preferred method for setting password policy since - setglobalpolicy in pwpolicy is deprecated and will likely be removed in a future macOS release.' + compliance: + - cis: ["5.2.7"] + - cis_csc_v8: ["5.3"] + - cis_csc_v7: ["16.9"] + - cmmc_v2.0: ["IA.L2-3.5.6"] + - nist_sp_800-53: ["AC-2(3)"] + - pci_dss_v3.2.1: ["8.1.4"] + - pci_dss_v4.0: ["8.3.7"] + - mitre_techniques: ["T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078", "T1134", "T1197", "T1538", "T1089", "T1157", "T1054", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1050", "T1075", "T1097", "T1163", "T1021", "T1489", "T1051", "T1023", "T1165", "T1501", "T1072", "T1537", "T1047", "T1084", "T1004"] + condition: all + rules: + - 'c:pwpolicy -n /Local/Default -getglobalpolicy -> n:maxMinutesUntilChangePassword=(\d+) compare < 525601' + + # 5.2.8 Ensure Password History Is Configured. (Automated) + - id: 31054 + title: "Ensure Password History Is Configured." + description: "Over time, passwords can be captured by third parties through mistakes, phishing attacks, third-party breaches, or merely brute-force attacks. To reduce the risk of exposure and to decrease the incentives of password reuse (passwords that are not forced to be changed periodically generally are not ever changed), users must reset passwords periodically. This control ensures that previous passwords are not reused immediately by keeping a history of previous password hashes. Ensure that password history checks are part of the password policy on the computer. This control checks whether a new password is different than the previous 15. The latest NIST guidance based on exploit research referenced in this section details how one of the greatest risks is password exposure rather than password cracking. Passwords should be changed to a new unique value whenever a password might have been exposed to anyone other than the account holder. Attackers have maintained persistent control based on predictable password change patterns and substantially different patterns should be used in case of a leak." + rationale: "Old passwords should not be reused." + impact: "Required password changes will lead to some locked computers requiring admin assistance." + remediation: 'Terminal Method: Run the following command to require that the password must to be different from at least the last 15 passwords: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "usingHistory==15>" example: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "usingHistory=15" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mobiledevice.passwordpolicy 2. The key to include is pinHistory 3. The key must be set to =15> Note: The profile method is the preferred method for setting password policy since - setglobalpolicy in pwpolicy is deprecated and will likely be removed in a future macOS release.' + compliance: + - cis: ["5.2.8"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - mitre_techniques: ["T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + condition: all + rules: + - 'c:pwpolicy -n /Local/Default -getglobalpolicy -> n:usingHistory=(\d+) compare > 14' + + # 5.3 Encryption + + # 5.3.1 Ensure all user storage APFS volumes are encrypted (Manual) - Not Implemented + # 5.3.2 Ensure all user storage CoreStorage volumes are encrypted (Manual) - Not Implemented + + # 5.4 Ensure the Sudo Timeout Period Is Set to Zero. (Automated) + - id: 31055 + title: "Ensure the Sudo Timeout Period Is Set to Zero." + description: "The sudo command allows the user to run programs as the root user. Working as the root user allows the user an extremely high level of configurability within the system. This control, along with the control to use a separate timestamp for each tty, limits the window where an unauthorized user, process, or attacker could utilize legitimate credentials that are valid for longer than required." + rationale: "The sudo command stays logged in as the root user for five minutes before timing out and re-requesting a password. This five-minute window should be eliminated since it leaves the system extremely vulnerable. This is especially true if an exploit were to gain access to the system, since they would be able to make changes as a root user." + impact: "This control has a serious impact where users often have to use sudo. It is even more of an impact where users have to use sudo multiple times in quick succession as part of normal work processes. Organizations with that common use case will likely find this control too onerous and are better to accept the risk of not requiring a 0 grace period. In some ways the use of sudo -s, which is undesirable, is better than a long grace period since that use does change the hash to show that it is a root shell rather than a normal shell where sudo commands will be implemented without a password." + remediation: "Terminal Method: Run the following command to edit the sudo settings: $ /usr/bin/sudo /usr/sbin/visudo -f /etc/sudoers.d/ example: $ /usr/bin/sudo /usr/sbin/visudo -f /etc/sudoers.d/10_cissudoconfiguration Note: Unlike other Unix and/or Linux distros, macOS will ignore configuration files in the sudoers.d folder that contain a . so do not add a file extension to the configuration file. Add the line Defaults timestamp_timeout=0 to the configuration file. If /etc/sudoers.d/ is not owned by root or in the wheel group, run the following to change ownership and group: $ /usr/bin/sudo /usr/sbin/chown -R root:wheel /etc/security/sudoers.d/." + compliance: + - cis: ["5.4"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - iso_27001-2013: ["A.8.1.3"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + - mitre_techniques: ["T1110", "T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + condition: all + rules: + - "c:sudo -V -> r:Authentication timestamp timeout: 0.0 minutes" + - "c:stat /etc/sudoers.d -> r:root wheel" + + # 5.5 Ensure a Separate Timestamp Is Enabled for Each User/tty Combo. (Automated) + - id: 31056 + title: "Ensure a Separate Timestamp Is Enabled for Each User/tty Combo." + description: "Using tty tickets ensures that a user must enter the sudo password in each Terminal session. With sudo versions 1.8 and higher, introduced in 10.12, the default value is to have tty tickets for each interface so that root access is limited to a specific terminal. The default configuration can be overwritten or not configured correctly on earlier versions of macOS." + rationale: "In combination with removing the sudo timeout grace period, a further mitigation should be in place to reduce the possibility of a background process using elevated rights when a user elevates to root in an explicit context or tty. Additional mitigation should be in place to reduce the risk of privilege escalation of background processes." + impact: "This control should have no user impact. Developers or installers may have issues if background processes are spawned with different interfaces than where sudo was executed." + remediation: "Terminal Method: Run the following command to edit the sudo settings: $ /usr/bin/sudo /usr/sbin/visudo -f /etc/sudoers.d/ example: $ /usr/bin/sudo /usr/sbin/visudo -f /etc/sudoers.d/10_cissudoconfiguration Note: Unlike other Unix and/or Linux distros, macOS will ignore configuration files in the sudoers.d folder that contain a . so do not add a file extension to the configuration file. Add the line Defaults timestamp_type=tty to the configuration file. Note: The Defaults timestamp_type=tty line can be added to an existing configuration file or a new one. That will depend on your organization's preference and works either way." + references: + - https://github.com/jorangreef/sudo-prompt/issues/33 + compliance: + - cis: ["5.5"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - iso_27001-2013: ["A.8.1.3"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + - mitre_techniques: ["T1110", "T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + condition: all + rules: + - "c:sudo -V -> r:Type of authentication timestamp record: tty" + + # 5.6 Ensure the "root" Account Is Disabled. (Automated) + - id: 31057 + title: 'Ensure the "root" Account Is Disabled.' + description: "The root account is a superuser account that has access privileges to perform any actions and read/write to any file on the computer. With some versions of Linux, the system administrator may commonly use the root account to perform administrative functions." + rationale: "Enabling and using the root account puts the system at risk since any successful exploit or mistake while the root account is in use could have unlimited access privileges within the system. Using the sudo command allows users to perform functions as a root user while limiting and password protecting the access privileges. By default the root account is not enabled on a macOS computer. An administrator can escalate privileges using the sudo command (use -s or -i to get a root shell)." + impact: "Some legacy POSIX software might expect an available root account." + remediation: "Graphical Method: Perform the following steps to ensure that the root user is disabled: 1. Open /System/Library/CoreServices/Applications/Directory Utility 2. Click the lock icon to unlock the service 3. Click Edit in the menu bar 4. Click Disable Root User Terminal Method: Run the following command to disable the root user: $ /usr/bin/sudo /usr/sbin/dsenableroot -d username = root user password:." + compliance: + - cis: ["5.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + - mitre_techniques: ["T1176", "T1501", "T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + condition: all + rules: + - "c:dscl . -read /Users/root AuthenticationAuthority -> r:^No such key: AuthenticationAuthority" + + # 5.7 Ensure an Administrator Account Cannot Login to Another User's Active and Locked Session. (Automated) + - id: 31058 + title: "Ensure an Administrator Account Cannot Login to Another User's Active and Locked Session." + description: "macOS has a privilege that can be granted to any user that will allow that user to unlock active user's sessions." + rationale: "Disabling the administrator's and/or user's ability to log into another user's active and locked session prevents unauthorized persons from viewing potentially sensitive and/or personal information." + impact: "While Fast user switching is a workaround for some lab environments, especially where there is even less of an expectation of privacy, this setting change may impact some maintenance workflows." + remediation: "Terminal Method: Run the following command to disable a user logging into another user's active and/or locked session: $ /usr/bin/sudo /usr/bin/security authorizationdb write system.login.screensaver use-login-window-ui YES (0)." + references: + - https://derflounder.wordpress.com/2014/02/16/managing-the-authorization-database-in-os-x-mavericks/ + - https://www.jamf.com/jamf-nation/discussions/18195/system-login-screensaver + compliance: + - cis: ["5.7"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - iso_27001-2013: ["A.8.1.3"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + - mitre_techniques: ["T1110", "T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + condition: all + rules: + - "c:security authorizationdb read system.login.screensaver -> r:use-login-window-ui" + + # 5.8 Ensure a Login Window Banner Exists. (Automated) + - id: 31059 + title: "Ensure a Login Window Banner Exists." + description: "A Login window banner warning informs the user that the system is reserved for authorized use only. It enforces an acknowledgment by the user that they have been informed of the use policy in the banner if required. The system recognizes either the .txt and the .rtf formats." + rationale: "An access warning may reduce a casual attacker's tendency to target the system. Access warnings may also aid in the prosecution of an attacker by evincing the attacker's knowledge of the system's private status, acceptable use policy, and authorization requirements." + impact: "Users will have to click on the window with the Login text before logging into the computer." + remediation: "Terminal Method: Run the following commands to create or edit the login window text and set the proper permissions: Edit (or create) a PolicyBanner.txt or PolicyBanner.rtf file, in the /Library/Security/ folder, to include the required login window banner text. Perform the following to set permissions on the policy banner file: $ /usr/bin/sudo /usr/sbin/chown o+r /Library/Security/PolicyBanner.txt $ /usr/bin/sudo /usr/sbin/chown o+r /Library/Security/PolicyBanner.rtf Note: If your organization uses an .rtfd file to set the policy banner, run $ /usr/bin/sudo /usr/sbin/chown -R o+rx /Library/Security/PolicyBanner.rtfd to update the permissions." + references: + - https://support.apple.com/en-au/HT202277 + compliance: + - cis: ["5.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + condition: all + rules: + - "d:/Library/Security -> r:^PolicyBanner" + - 'c:stat -f %A /Library/Security/PolicyBanner.* -> r:\d\d4' + + # 5.9 Ensure Legacy EFI Is Valid and Updating (Automated) - Not implemented + + # 5.10 Ensure the Guest Home Folder Does Not Exist. (Automated) + - id: 31060 + title: "Ensure the Guest Home Folder Does Not Exist." + description: "In the previous two controls, the guest account login has been disabled and sharing to guests has been disabled, as well. There is no need for the legacy Guest home folder to remain in the file system. When normal user accounts are removed, you have the option to archive it, leave it in place, or delete. In the case of the guest folder, the folder remains in place without a GUI option to remove it. If at some point in the future a Guest account is needed, it will be re-created. The presence of the Guest home folder can cause automated audits to fail when looking for compliant settings within all User folders, as well. Rather than ignoring the folder's continued existence, it is best removed." + rationale: "The Guest home folders are unneeded after the Guest account is disabled and could be used inappropriately." + impact: "The Guest account should not be necessary after it is disabled, and it will be automatically re-created if the Guest account is re-enabled." + remediation: "Terminal Method: Run the following command to remove the Guest user home folder: $ /usr/bin/sudo /bin/rm -R /Users/Guest." + compliance: + - cis: ["5.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + condition: all + rules: + - "not d:/Users/Guest" + + ########################################################################## + # 6 Applications + ########################################################################## + + # 6.1 Finder + + # 6.1.1 Ensure Show All Filename Extensions Setting is Enabled (Automated) - Not implemented + + # 6.2 Mail + + # 6.2.1 Ensure Protect Mail Activity in Mail Is Enabled (Manual) - Not Implemented + + # 6.3 Safari + + # 6.3.1 Ensure Automatic Opening of Safe Files in Safari Is Disabled (Automated) - Not implemented + # 6.3.2 Audit History and Remove History Items (Manual) - Not implemented + # 6.3.3 Ensure Warn When Visiting A Fraudulent Website in Safari Is Enabled (Automated) - Not implemented + # 6.3.4 Ensure Prevent Cross-site Tracking in Safari Is Enabled (Automated) - Not implemented + # 6.3.5 Audit Hide IP Address in Safari Setting (Manual) - Not implemented + # 6.3.6 Ensure Advertising Privacy Protection in Safari Is Enabled (Automated) - Not implemented + # 6.3.7 Ensure Show Full Website Address in Safari Is Enabled (Automated) - Not implemented + + # 6.4 Terminal + + # 6.4.1 Ensure Secure Keyboard Entry Terminal.app Is Enabled (Automated) - Not implemented diff --git a/etc/ruleset/sca/darwin/23/cis_apple_macOS_14.x.yml b/etc/ruleset/sca/darwin/23/cis_apple_macOS_14.x.yml new file mode 100644 index 0000000000..7269a85f08 --- /dev/null +++ b/etc/ruleset/sca/darwin/23/cis_apple_macOS_14.x.yml @@ -0,0 +1,1452 @@ +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Mac0S 14 Sonoma Benchmark v1.0.0 - 10-16-2023 + +policy: + id: "cis_macOS_14.0_Sonoma.yml" + file: "cis_macOS_14.0_Sonoma.yml" + name: "CIS_Apple_macOS_14.0_Sonoma_Benchmark_v1.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for MacOS 14 Sonoma systems." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check MacOS 14 Sonoma platform." + description: "Requirements for running the policy against MacOS 14 Sonoma." + condition: any + rules: + - 'c:sw_vers -> r:^ProductVersion:\t*\s*14\p' + - 'c:system_profiler SPSoftwareDataType -> r:System Version:.*14\p' + - 'c:defaults read loginwindow SystemVersionStampAsString -> r:^\s*14\p' + +checks: + # 1.1 Ensure All Apple-provided Software Is Current. (Automated) + - id: 34000 + title: "Ensure All Apple-provided Software Is Current." + description: 'Software vendors release security patches and software updates for their products when security vulnerabilities are discovered. There is no simple way to complete this action without a network connection to an Apple software repository. Please ensure appropriate access for this control. This check is only for what Apple provides through software update. Software updates should be run at minimum every 30 days. Run the following command to verify when software update was previously run: $ /usr/bin/sudo defaults read /Library/Preferences/com.apple.SoftwareUpdate | grep -e LastFullSuccessfulDate. The response should be in the last 30 days (Example): LastFullSuccessfulDate = "2020-07-30 12:45:25 +0000";.' + rationale: "It is important that these updates be applied in a timely manner to prevent unauthorized persons from exploiting the identified vulnerabilities." + impact: "Installation of updates can be disruptive to the users especially if an restart is required. Major updates need to be applied after creating an organizational patch policy. It is also advised to run updates and forced restarts during system downtime and not while in active use." + remediation: 'Graphical Method: Perform the following to install all available software updates: 1. Open System Settings 2. Select General 3. Select Software Update 4. Select Update All Terminal Method: Run the following command to verify what packages need to be installed: $ /usr/bin/sudo /usr/sbin/softwareupdate -l The output will include the following: Software Update found the following new or updated software: Run the following command to install all the packages that need to be updated: To install all updates run the command: $ /usr/bin/sudo /usr/sbin/softwareupdate -i -a Or run the following command to install individual packages: $ /usr/bin/sudo /usr/sbin/softwareupdate -i '''' Note: If one of the software updates listed includes Action: restart, then you must attach the -R flag to force a system restart. If the system update is complete but no restart occurs, then the system is in an unknown state that requires a future restart. It is advised to run updates and forced restarts during system downtime and not while in active use. example: $ /usr/bin/sudo /usr/sbin/softwareupdate -l Software Update Tool Finding available software Software Update found the following new or updated software: * Label: ProVideoFormats-2.2.7 Title: Pro Video Formats, Version: 2.2.7, Size: 9693KiB, Recommended: YES, * Label: Command Line Tools for Xcode-15.0 Title: Command Line Tools for Xcode, Version: 15.0, Size: 721962KiB, Recommended: YES, $ /usr/bin/sudo /usr/sbin/softwareupdate -i ''ProVideoFormats-2.2.7'' Software Update Tool Finding available software Attempting to quit apps: ( "com.apple.Compressor" ) Waiting for user to quit any relevant apps Successfully quit all apps Downloaded Pro Video Formats Installing Pro Video Formats Done with Pro Video Formats Done. In the above example, if a restart was required, the command to remediate would be /usr/bin/sudo /usr/sbin/softwareupdate -i ''ProVideoFormats-2.2.7'' -R.' + references: + - "https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-40r4.pdf" + compliance: + - cis: ["1.1"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - "c:softwareupdate -l -> r:No new software available." + + # 1.2 Ensure Auto Update Is Enabled. (Automated) + - id: 34001 + title: "Ensure Auto Update Is Enabled." + description: 'Auto Update verifies that your system has the newest security patches and software updates. If "Automatically check for updates" is not selected, background updates for new malware definition files from Apple for XProtect and Gatekeeper will not occur. http://macops.ca/os-x-admins-your-clients-are-not-getting-background-security-updates/ https://derflounder.wordpress.com/2014/12/17/forcing-xprotect-blacklist-updates-on-mavericks-and-yosemite/.' + rationale: "It is important that a system has the newest updates applied so as to prevent unauthorized persons from exploiting identified vulnerabilities." + impact: "Without automatic update, updates may not be made in a timely manner and the system will be exposed to additional risk." + remediation: "Graphical Method: Perform the following steps to enable the system to automatically check for updates: 1. Open System Settings 2. Select General 3. Select Software Update 4. Select the i 5. Set Check for updates to enabled 6. Select Done Terminal Method: Run the following command to enable auto update: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.SoftwareUpdate 2. The key to include is AutomaticCheckEnabled 3. The key must be set to ." + compliance: + - cis: ["1.2"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''AutomaticCheckEnabled'')" -> r:^1$' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''AutomaticCheckEnabled'')" -> r:\.+' + + # 1.3 Ensure Download New Updates When Available Is Enabled. (Automated) + - id: 34002 + title: "Ensure Download New Updates When Available Is Enabled." + description: 'In the GUI, both "Install macOS updates" and "Install app updates from the App Store" are dependent on whether "Download new updates when available" is selected.' + rationale: "It is important that a system has the newest updates downloaded so that they can be applied." + impact: 'If "Download new updates when available" is not selected, updates may not be made in a timely manner and the system will be exposed to additional risk.' + remediation: "Perform the following to enable the system to automatically check for updates: Graphical Method: 1. Open System Settings 2. Select General 3. Select Software Update 4. Select the i 5. Set Download new updates when available to enabled 6. Select Done Terminal Method: Run the following command to enable auto update: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticDownload -bool true Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.SoftwareUpdate 2. The key to include is AutomaticDownload 3. The key must be set to ." + compliance: + - cis: ["1.3"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''AutomaticDownload'')" -> r:^1$' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''AutomaticDownload'')" -> r:\.+' + + # 1.4 Ensure Install of macOS Updates Is Enabled. (Automated) + - id: 34003 + title: "Ensure Install of macOS Updates Is Enabled." + description: "Ensure that macOS updates are installed after they are available from Apple. This setting enables macOS updates to be automatically installed. Some environments will want to approve and test updates before they are delivered. It is best practice to test first where updates can and have caused disruptions to operations. Automatic updates should be turned off where changes are tightly controlled and there are mature testing and approval processes. Automatic updates should not be turned off simply to allow the administrator to contact users in order to verify installation. A dependable, repeatable process involving a patch agent or remote management tool should be in place before auto-updates are turned off." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited." + impact: "Unpatched software may be exploited." + remediation: "Graphical Method: Perform the following steps to enable macOS updates to run automatically: 1. Open System Settings 2. Select General 3. Select Software Update 4. Select the i 5. Set Install macOS updates to enabled 6. Select Done Terminal Method: Run the following command to to enable automatic checking and installing of macOS updates: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate AutomaticallyInstallMacOSUpdates -bool TRUE Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.SoftwareUpdate 2. The key to include is AutomaticallyInstallMacOSUpdates 3. The key must be set to ." + compliance: + - cis: ["1.4"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''AutomaticallyInstallMacOSUpdates'')" -> r:^1$' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''AutomaticallyInstallMacOSUpdates'')" -> r:\.+' + + # 1.5 Ensure Install Application Updates from the App Store Is Enabled. (Automated) + - id: 34004 + title: "Ensure Install Application Updates from the App Store Is Enabled." + description: "Ensure that application updates are installed after they are available from Apple. These updates do not require reboots or administrator privileges for end users." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited." + impact: "Unpatched software may be exploited." + remediation: "Graphical Method: Perform the following steps to enable App Store updates to install automatically: 1. Open System Settings 2. Select General 3. Select Software Update 4. Select the i 5. Set Install application updates from the App Store to enabled 6. Select Done Terminal Method: Run the following command to turn on App Store auto updating: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.commerce AutoUpdate -bool TRUE Note: This remediation requires a log out and log in to show in the GUI. Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.SoftwareUpdate 2. The key to include is AutomaticallyInstallAppUpdates 3. The key must be set to ." + compliance: + - cis: ["1.5"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.commerce AutoUpdate -> r:^1$" + + # 1.6 Ensure Install Security Responses and System Files Is Enabled. (Automated) + - id: 34005 + title: "Ensure Install Security Responses and System Files Is Enabled." + description: "Ensure that system and security updates are installed after they are available from Apple. This setting enables definition updates for XProtect and Gatekeeper. With this setting in place, new malware and adware that Apple has added to the list of malware or untrusted software will not execute. These updates do not require reboots or end user admin rights. Apple has introduced a security feature that allows for smaller downloads and the installation of security updates when a reboot is not required. This feature is only available when the last regular update has already been applied. This feature emphasizes that a Mac must be up-to-date on patches so that Apple's security tools can be used to quickly patch when a rapid response is necessary." + rationale: "Patches need to be applied in a timely manner to reduce the risk of vulnerabilities being exploited." + impact: "Unpatched software may be exploited." + remediation: "Graphical Method: Perform the following steps to enable system data files and security updates to install automatically: 1. Open System Settings 2. Select General 3. Select Software Update 4. Select the i 5. Set Install Security Responses and System files to enabled 6. Select Done Terminal Method: Run the following commands to enable automatic checking of system data files and security updates: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate ConfigDataInstall -bool true $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.SoftwareUpdate CriticalUpdateInstall -bool true Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.SoftwareUpdate 2. The key to include is ConfigDataInstall 3. The key must be set to 4. The key to also include is CriticalUpdateInstall 5. The key must be set to ." + references: + - "https://eclecticlight.co/2021/10/27/silently-updated-security-data-files-in-monterey/" + - "https://support.apple.com/en-us/HT202491" + - "https://support.apple.com/guide/security/protecting-against-malware-sec469d47bd8/web" + - "https://support.apple.com/guide/deployment/rapid-security-responses-dep93ff7ea78/1/web/1.0" + compliance: + - cis: ["1.6"] + - cis_csc_v8: ["7.3", "7.4", "7.7"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["CA.L2-3.12.2", "RA.L2-3.11.3", "SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - pci_dss_v4.0: ["11.3.1", "11.3.2", "11.3.2.1"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''ConfigDataInstall'')" -> r:^1$' + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.SoftwareUpdate'').objectForKey(''CriticalUpdateInstall'')" -> r:^1$' + + # 1.7 Ensure Software Update Deferment Is Less Than or Equal to 30 Days. (Automated) + - id: 34006 + title: "Ensure Software Update Deferment Is Less Than or Equal to 30 Days." + description: "Apple provides the capability to manage software updates on Apple devices through mobile device management. Part of those capabilities permit organizations to defer software updates and allow for testing. Many organizations have specialized software and configurations that may be negatively impacted by Apple updates. If software updates are deferred, they should not be deferred for more than 30 days. This control only verifies that deferred software updates are not deferred for more than 30 days." + rationale: "Apple software updates almost always include security updates. Attackers evaluate updates to create exploit code in order to attack unpatched systems. The longer a system remains unpatched, the greater an exploit possibility exists in which there are publicly reported vulnerabilities." + impact: "Some organizations may need more than 30 days to evaluate the impact of software updates." + remediation: "Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.applicationaccess 2. The key to include is enforcedSoftwareUpdateDelay 3. The key must be set to <1-30>." + references: + - "https://support.apple.com/guide/deployment/manage-software-updates-depc4c80847a/web" + compliance: + - cis: ["1.7"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.applicationaccess'').objectForKey(''enforcedSoftwareUpdateDelay'')" -> n:^(\d+)$ compare <= 30' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.applicationaccess'').objectForKey(''enforcedSoftwareUpdateDelay'')" -> r:\.+' + + # 1.8 Ensure the System is Managed by a Mobile Device Management (MDM) Software. (Manual) - Not Implemented + + # 2.1.1.1 Audit iCloud Keychain. (Manual) - Not Implemented + # 2.1.1.2 Audit iCloud Drive. (Manual) - Not Implemented + # 2.1.1.3 Ensure iCloud Drive Document and Desktop Sync Is Disabled. (Automated) - Not Implemented + # 2.1.1.4 Audit Security Keys Used With AppleIDs. (Manual) - Not Implemented + # 2.1.1.5 Audit Freeform Sync to iCloud. (Manual) - Not Implemented + # 2.1.2 Audit App Store Password Settings. (Manual) - Not Implemented + + # 2.2.1 Ensure Firewall Is Enabled. (Automated) + - id: 34007 + title: "Ensure Firewall Is Enabled." + description: "A firewall is a piece of software that blocks unwanted incoming connections to a system. Apple has posted general documentation about the application firewall:." + rationale: "A firewall minimizes the threat of unauthorized users gaining access to your system while connected to a network or the Internet." + impact: "The firewall may block legitimate traffic. Applications that are unsigned will require special handling." + remediation: "Graphical Method: Perform the following steps to turn the firewall on: 1. Open System Settings 2. Select Network 3. Select Firewall 4. Set Firewall to enabled Terminal Method: Run the following command to enable the firewall: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.alf globalstate -int For the , use either 1, specific services, or 2, essential services only. Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.security.firewall 2. The key to include is EnableFirewall 3. The key must be set to ." + references: + - "https://support.apple.com/en-us/guide/security/seca0e83763f/web" + - "http://support.apple.com/en-us/HT201642" + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.1", "4.5", "13.1"] + - cis_csc_v7: ["5.1", "9.4", "9.5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L1-3.1.20", "AU.L2-3.3.5", "AU.L2-3.3.6", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6", "SI.L2-3.14.3", "SI.L2-3.14.7"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.13.1.1", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AU-6(1)", "AU-7", "CM-7(1)", "CM-9", "IR-4(1)", "SA-10", "SC-7(5)", "SI-4(2)", "SI-4(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.5.3", "10.6.1", "11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "10.7", "10.7.1", "10.7.2", "10.7.3", "11.5", "2.1.1", "2.2.1"] + - soc_2: ["CC6.6", "CC7.1", "CC7.2", "CC8.1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.alf globalstate -> r:^1$|^2$" + - "c:defaults read /Library/Preferences/com.apple.security.firewall EnableFirewall -> r:^1$|^2$|^true$" + + # 2.2.2 Ensure Firewall Stealth Mode Is Enabled. (Automated) + - id: 34008 + title: "Ensure Firewall Stealth Mode Is Enabled." + description: "While in Stealth mode, the computer will not respond to unsolicited probes, dropping that traffic." + rationale: "Stealth mode on the firewall minimizes the threat of system discovery tools while connected to a network or the Internet." + impact: "Traditional network discovery tools like ping will not succeed. Other network tools that measure activity and approved applications will work as expected. This control aligns with the primary macOS use case of a laptop that is often connected to untrusted networks where host segregation may be non-existent. In that use case, hiding from the other inmates is likely more than desirable. In use cases where use is only on trusted LANs with static IP addresses, stealth mode may not be desirable." + remediation: "Graphical Method: Perform the following steps to enable firewall stealth mode: 1. Open System Settings 2. Select Network 3. Select Firewall 4. Select Options... 5. Set Enabled stealth mode to enabled Terminal Method: Run the following command to enable stealth mode: $ /usr/bin/sudo /usr/libexec/ApplicationFirewall/socketfilterfw -- setstealthmode on Stealth mode enabled Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.security.firewall 2. The key to include is EnableStealthMode 3. The key must be set to Note: This key must be set in the same configuration profile with EnableFirewall set to . If it is set in its own configuration profile, it will fail." + references: + - "http://support.apple.com/en-us/HT201642" + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.1", "4.5", "4.8"] + - cis_csc_v7: ["5.1", "9.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L1-3.1.20", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.4", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: any + rules: + - "c:defaults read /Library/Preferences/com.apple.alf stealthenabled -> r:^1$|^2$" + - "c:defaults read /Library/Preferences/com.apple.security.firewall EnableStealthMode -> r:^1$|^2$|^true$" + + # 2.3.1.1 Ensure AirDrop Is Disabled When Not Actively Transferring Files. (Automated) - Not Implemented + # 2.3.1.2 Ensure AirPlay Receiver Is Disabled. (Automated) - Not Implemented + + # 2.3.2.1 Ensure Set Time and Date Automatically Is Enabled. (Automated) + - id: 34009 + title: "Ensure Set Time and Date Automatically Is Enabled." + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates, and log entries. Note: If your organization has internal time servers, enter them here. Enterprise mobile devices may need to use a mix of internal and external time servers. If multiple servers are required, use the Date & Time System Preference with each server separated by a space. Additional Note: The default Apple time server is time.apple.com. Variations include time.euro.apple.com. While it is certainly more efficient to use internal time servers, there is no reason to block access to global Apple time servers or to add a time.apple.com alias to internal DNS records. There are no reports that Apple gathers any information from NTP synchronization, as the computers already phone home to Apple for Apple services including iCloud use and software updates. Best practice is to allow DNS resolution to an authoritative time service for time.apple.com, preferably to connect to Apple servers, but local servers are acceptable as well." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features." + impact: "The timed service will periodically synchronize with named time servers and will make the computer time more accurate." + remediation: "Graphical Method: Perform the following to enable the date and time to be set automatically: 1. Open System Settings 2. Select General 3. Select Date & Time 4. Set Set time and date automatically to enabled Note: By default, the operating system will use time.apple.com as the time server. You can change to any time server that meets your organization's requirements. Terminal Method: Run the following commands to enable the date and time setting automatically: $ /usr/bin/sudo /usr/sbin/systemsetup -setnetworktimeserver setNetworkTimeServer: $ /usr/bin/sudo /usr/sbin/systemsetup -setusingnetworktime on setUsingNetworkTime: On example: $ /usr/bin/sudo /usr/sbin/systemsetup -setnetworktimeserver time.apple.com setNetworkTimeServer: time.apple.com $ /usr/bin/sudo /usr/sbin/systemsetup -setusingnetworktime on setUsingNetworkTime: On Run the following commands if you have not set, or need to set, a new time zone: $ /usr/bin/sudo /usr/sbin/systemsetup -listtimezones $ /usr/bin/sudo /usr/sbin/systemsetup -settimezone example: $ /usr/bin/sudo /usr/sbin/systemsetup -listtimezones Time Zones: Africa/Abidjan Africa/Accra Africa/Addis_Ababa ... $ /usr/bin/sudo /usr/sbin/systemsetup -settimezone America/New_York Set TimeZone: America/New_York." + compliance: + - cis: ["2.3.2.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - 'c:/usr/sbin/systemsetup -getusingnetworktime -> r:Network Time:\s*\t*On' + + # 2.3.2.2 Ensure Time Is Set Within Appropriate Limits. (Automated) + - id: 34010 + title: "Ensure Time Is Set Within Appropriate Limits." + description: "Correct date and time settings are required for authentication protocols, file creation, modification dates and log entries. Ensure that time on the computer is within acceptable limits. Truly accurate time is measured within milliseconds. For this audit, a drift under four and a half minutes passes the control check. Since Kerberos is one of the important features of macOS integration into Directory systems, the guidance here is to warn you before there could be an impact to operations. From the perspective of accurate time, this check is not strict, so it may be too great for your organization. Your organization can adjust to a smaller offset value as needed. If there are consistent drift issues on the OS, some of the most common drift issues should be investigated: - The chosen time server is not reachable based on network firewall rules on the current network - The computer is offline often and the battery drains, and the network is not immediately available - The chosen time server is a special internal or non-public time server that does not provide a reliable time source Note: ntpdate has been deprecated with 10.14. sntp replaces that command." + rationale: "Kerberos may not operate correctly if the time on the Mac is off by more than 5 minutes. This in turn can affect Apple's single sign-on feature, Active Directory logons, and other features. Audit check is for more than 4 minutes and 30 seconds ahead or behind." + impact: "Accurate time is required for many computer functions." + remediation: "Terminal Method: Run the following commands to ensure your time is set within an appropriate limit: $ /usr/bin/sudo /usr/sbin/systemsetup -getnetworktimeserver The output will include Network Time Server: and the name of your time server example: Network Time Server: time.apple.com. $ /usr/bin/sudo /usr/bin/sntp -sS example: $ /usr/bin/sudo /usr/sbin/systemsetup -getnetworktimeserver Network Time Server: time.apple.com $ /usr/bin/sudo /usr/bin/sntp -sS time.apple.com." + compliance: + - cis: ["2.3.2.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:systemsetup -getnetworktimeserver -> r:Network Time Server:" + + # 2.3.3.1 Ensure DVD or CD Sharing Is Disabled. (Automated) + - id: 34011 + title: "Ensure DVD or CD Sharing Is Disabled." + description: "DVD or CD Sharing allows users to remotely access the system's optical drive. While Apple does not ship Macs with built-in optical drives any longer, external optical drives are still recognized when they are connected. In testing, the sharing of an external optical drive persists when a drive is reconnected." + rationale: "Disabling DVD or CD Sharing minimizes the risk of an attacker using the optical drive as a vector for attack and exposure of sensitive data." + impact: "Many Apple devices are now sold without optical drives, however drive sharing may be needed for legacy optical media. The media should be explicitly re-shared as needed rather than using a persistent share. Optical drives should not be used for long-term storage. To store necessary data from an optical drive it should be copied to another form of external storage. Optionally, an image can be made of the optical drive so that it is stored in its original form on another form of external storage." + remediation: "Graphical Method: Perform the following steps to disable DVD or CD Sharing: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set DVD or CD sharing to disabled Terminal Method: Run the following command to disable DVD or CD Sharing: $ /usr/bin/sudo /bin/launchctl disable system/com.apple.ODSAgent Note: If using the Terminal method, the GUI will still show the service checked until after a reboot." + compliance: + - cis: ["2.3.3.1"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sh -c "launchctl list | grep -c com.apple.ODSAgent" -> r:^0$' + + # 2.3.3.2 Ensure Screen Sharing Is Disabled. (Automated) + - id: 34012 + title: "Ensure Screen Sharing Is Disabled." + description: "Screen Sharing allows a computer to connect to another computer on a network and display the computer's screen. While sharing the computer's screen, the user can control what happens on that computer, such as opening documents or applications, opening, moving, or closing windows, and even shutting down the computer. While mature administration and management does not use graphical connections for standard maintenance, most help desks have capabilities to assist users in performing their work when they have technical issues and need support. Help desks use graphical remote tools to understand what the user sees and assist them so they can get back to work. For MacOS, some of these remote capabilities can use Apple's OS tools. Control is therefore not meant to prohibit the use of a just-in-time graphical view from authorized personnel with authentication controls. Sharing should not be enabled except in narrow windows when help desk support is required. Screen Sharing on macOS can allow the use of the insecure VNC protocol. VNC is a clear text protocol that should not be used on macOS." + rationale: "Disabling Screen Sharing mitigates the risk of remote connections being made without the user of the console knowing that they are sharing the computer." + impact: "Help desks may require the periodic use of a graphical connection mechanism to assist users. Any support that relies on native MacOS components will not work unless a scripted solution to enable and disable sharing as neccessary." + remediation: "Graphical Method: Perform the following steps to disable Screen Sharing: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Screen Sharing to disabled Terminal Method: Run the following command to turn off Screen Sharing: $ /usr/bin/sudo /bin/launchctl disable system/com.apple.screensharing." + references: + - "https://support.apple.com/guide/mac-help/turn-screen-sharing-on-or-off-mh11848/mac" + compliance: + - cis: ["2.3.3.2"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sh -c "launchctl list | grep -c com.apple.screensharing" -> r:^0$' + + # 2.3.3.3 Ensure File Sharing Is Disabled. (Automated) + - id: 34013 + title: "Ensure File Sharing Is Disabled." + description: "File sharing from a user workstation creates additional risks, such as: - Open ports are created that can be probed and attacked - Passwords are attached to user accounts for access that may be exposed and endanger other parts of the organizational environment, including directory accounts Increased complexity makes security more difficult and may expose additional attack vectors - Apple's File Sharing uses the Server Message Block (SMB) protocol to share to other computers that can mount SMB shares. This includes other macOS computers. Apple warns that SMB sharing stored passwords is less secure, and anyone with system access can gain access to the password for that account. When sharing with SMB, each user accessing the Mac must have SMB enabled. Storing passwords, especially copies of valid directory passwords, decreases security for the directory account and should not be used." + rationale: "By disabling File Sharing, the remote attack surface and risk of unauthorized access to files stored on the system is reduced." + impact: "File Sharing can be used to share documents with other users, but hardened servers should be used rather than user endpoints. Turning on File Sharing increases the visibility and attack surface of a system unnecessarily." + remediation: "Graphical Method: Perform the following steps to disable File Sharing: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set File Sharing to disabled Terminal Method: Run the following command to disable File Sharing: $ /usr/bin/sudo /bin/launchctl disable system/com.apple.smbd." + compliance: + - cis: ["2.3.3.3"] + - cis_csc_v8: ["4.1", "4.8", "5.4"] + - cis_csc_v7: ["4.3", "5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.3", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3", "A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.1", "CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sh -c "launchctl list | grep -c com.apple.smbd" -> r:^0$' + + # 2.3.3.4 Ensure Printer Sharing Is Disabled. (Automated) + - id: 34014 + title: "Ensure Printer Sharing Is Disabled." + description: "By enabling Printer Sharing, the computer is set up as a print server to accept print jobs from other computers. Dedicated print servers or direct IP printing should be used instead." + rationale: "Disabling Printer Sharing mitigates the risk of attackers attempting to exploit the print server to gain access to the system." + remediation: "Graphical Method: Perform the following steps to disable Printer Sharing: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Printer Sharing to disabled Terminal Method: Run the following command to disable Printer Sharing: $ /usr/bin/sudo /usr/sbin/cupsctl --no-share-printers." + compliance: + - cis: ["2.3.3.4"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sh -c "cupsctl | grep _share_printers | cut -d ''='' -f2" -> r:^0$' + + # 2.3.3.5 Ensure Remote Login Is Disabled. (Automated) + - id: 34015 + title: "Ensure Remote Login Is Disabled." + description: "Remote Login allows an interactive terminal connection to a computer." + rationale: "Disabling Remote Login mitigates the risk of an unauthorized person gaining access to the system via Secure Shell (SSH). While SSH is an industry standard to connect to posix servers, the scope of the benchmark is for Apple macOS clients, not servers. macOS does have an IP-based firewall available (pf, ipfw has been deprecated) that is not enabled or configured. There are more details and links in the Network sub-section. macOS no longer has TCP Wrappers support built in and does not have strong Brute-Force password guessing mitigations, or frequent patching of openssh by Apple. Since most macOS computers are mobile workstations, managing IP-based firewall rules on mobile devices can be very resource intensive. All of these factors can be parts of running a hardened SSH server." + impact: "The SSH server built into macOS should not be enabled on a standard user computer, particularly one that changes locations and IP addresses. A standard user that runs local applications, including email, web browser, and productivity tools, should not use the same device as a server. There are Enterprise management toolsets that do utilize SSH. If they are in use, the computer should be locked down to only respond to known, trusted IP addresses and appropriate administrator service accounts. For macOS computers that are being used for specialized functions, there are several options to harden the SSH server to protect against unauthorized access, including brute force attacks. There are some basic criteria that need to be considered: - Do not open an SSH server to the internet without controls in place to mitigate SSH brute force attacks. This is particularly important for systems bound to Directory environments. It is great to have controls in place to protect the system, but if they trigger after the user is already locked out of their account, they are not optimal. If authorization happens after authentication, directory accounts for users that don't even use the system can be locked out. - Do not use SSH key pairs when there is no insight to the security on the client system that will authenticate into the server with a private key. If an attacker gets access to the remote system and can find the key, they may not need a password or a key logger to access the SSH server. - Detailed instructions on hardening an SSH server, if needed, are available in the CIS Linux Benchmarks, but it is beyond the scope of this benchmark." + remediation: "Perform the following to disable Remote Login: Graphical Method: Perform the following steps to disable Remote Login: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Remote Login to disabled Terminal Method: Run the following command to disable Remote Login: $ /usr/bin/sudo /usr/sbin/systemsetup -setremotelogin off Do you really want to turn remote login off? If you do, you will lose this connection and can only turn it back on locally at the server (yes/no)? Entering yes will disable remote login." + compliance: + - cis: ["2.3.3.5"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:systemsetup -getremotelogin -> r:Remote Login:\s*\t*Off' + + # 2.3.3.6 Ensure Remote Management Is Disabled. (Automated) + - id: 34016 + title: "Ensure Remote Management Is Disabled." + description: "Remote Management is the client portion of Apple Remote Desktop (ARD). Remote Management can be used by remote administrators to view the current screen, install software, report on, and generally manage client Macs. The screen sharing options in Remote Management are identical to those in the Screen Sharing section. In fact, only one of the two can be configured. If Remote Management is used, refer to the Screen Sharing section above on issues regard screen sharing. Remote Management should only be enabled when a Directory is in place to manage the accounts with access. Computers will be available on port 5900 on a macOS System and could accept connections from untrusted hosts depending on the configuration, which is a major concern for mobile systems. As with other sharing options, an open port even for authorized management functions can be attacked, and both unauthorized access and Denial-of-Service vulnerabilities could be exploited. If remote management is required, the pf firewall should restrict access only to known, trusted management consoles. Remote management should not be used across the Internet without the use of a VPN tunnel." + rationale: "Remote Management should only be enabled on trusted networks with strong user controls present in a Directory system. Mobile devices without strict controls are vulnerable to exploit and monitoring." + impact: "Many organizations utilize ARD for client management." + remediation: "Graphical Method: Perform the following steps to disable Remote Management: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Remote Management to disabled Terminal Method: Run the following command to disable Remote Management: $ /usr/bin/sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources /kickstart -deactivate -stop Starting... Removed preference to start ARD after reboot. Done." + compliance: + - cis: ["2.3.3.6"] + - cis_csc_v8: ["4.1", "4.8", "5.4"] + - cis_csc_v7: ["4.3", "9.2", "14.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.3", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1", "A.13.1.3", "A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.1", "CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - "not p:/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ARDAgent" + + # 2.3.3.7 Ensure Remote Apple Events Is Disabled. (Automated) + - id: 34017 + title: "Ensure Remote Apple Events Is Disabled." + description: "Apple Events is a technology that allows one program to communicate with other programs. Remote Apple Events allows a program on one computer to communicate with a program on a different computer." + rationale: "Disabling Remote Apple Events mitigates the risk of an unauthorized program gaining access to the system." + impact: "With remote Apple events turned on, an AppleScript program running on another Mac can interact with the local computer." + remediation: "Graphical Method: Perform the following steps to disable Remote Apple Events: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Remote Apple Events to disabled Terminal Method: Run the following commands to set Remote Apple Events to Off: $ /usr/bin/sudo /usr/sbin/systemsetup -setremoteappleevents off setremoteappleevents: Off." + compliance: + - cis: ["2.3.3.7"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:systemsetup -getremoteappleevents -> r:Remote Apple Events:\s*\t*Off' + + # 2.3.3.8 Ensure Internet Sharing Is Disabled. (Automated) + - id: 34018 + title: "Ensure Internet Sharing Is Disabled." + description: "Internet Sharing uses the open source natd process to share an internet connection with other computers and devices on a local network. This allows the Mac to function as a router and share the connection to other, possibly unauthorized, devices." + rationale: "Disabling Internet Sharing reduces the remote attack surface of the system." + impact: "Internet Sharing allows the computer to function as a router and other computers to use it for access. This can expose both the computer itself and the networks it is accessing to unacceptable access from unapproved devices." + remediation: "Graphical Method: Perform the following steps to disable Internet Sharing: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Internet Sharing to disabled Terminal Method: Run the following command to turn off Internet Sharing: $ usr/bin/sudo /usr/bin/defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict Enabled -int 0 Note: Using the Terminal Method will not be reflected in the GUI, but will disable the underlying service. Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.MCX 2. The key to include is forceInternetSharingOff 3. The key must be set to ." + compliance: + - cis: ["2.3.3.8"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: any + rules: + - 'not c:defaults read /Library/Preferences/SystemConfiguration/com.apple.nat -> r:Enabled\s*\t*=\s*\t*1' + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.MCX'').objectForKey(''forceInternetSharingOff'')" -> r:^true$' + + # 2.3.3.9 Ensure Content Caching Is Disabled. (Automated) + - id: 34019 + title: "Ensure Content Caching Is Disabled." + description: "Starting with 10.13 (macOS High Sierra), Apple introduced a service to make it easier to deploy data from Apple, including software updates, where there are bandwidth constraints to the Internet and fewer constraints or greater bandwidth exist on the local subnet. This capability can be very valuable for organizations that have throttled and possibly metered Internet connections. In heterogeneous enterprise networks with multiple subnets, the effectiveness of this capability would be determined by how many Macs were on each subnet at the time new, large updates were made available upstream. This capability requires the use of mac OS clients as P2P nodes for updated Apple content. Unless there is a business requirement to manage operational Internet connectivity and bandwidth, user endpoints should not store content and act as a cluster to provision data. Content types supported by Content Caching in macOS." + rationale: "The main use case for Mac computers is as mobile user endpoints. P2P sharing services should not be enabled on laptops that are using untrusted networks. Content Caching can allow a computer to be a server for local nodes on an untrusted network. While there are certainly logical controls that could be used to mitigate risk, they add to the management complexity. Since the value of the service is in specific use cases, organizations with the use case described above can accept risk as necessary." + impact: "This setting will adversely affect bandwidth usage between local subnets and the Internet." + remediation: "Graphical Method: Perform the following steps to disable Content Caching: 1. Open System Settings 2. Select General 3. Select Sharing 4. Set Content Caching to disabled Terminal Method: Run the following command to disable Content Caching: $ /usr/bin/sudo /usr/bin/AssetCacheManagerUtil deactivate The output will include Content caching deactivated Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.applicationaccess 2. The key to include is allowContentCaching 3. The key must be set to ." + references: + - "https://support.apple.com/guide/mac-help/about-content-caching-mchl9388ba1b/" + - "https://support.apple.com/guide/mac-help/set-up-content-caching-on-mac-mchl3b6c3720/" + compliance: + - cis: ["2.3.3.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.AssetCache'').objectForKey(''Activated'')" -> r:^0$' + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.applicationaccess'').objectForKey(''allowContentCaching'')" -> r:^0$|^true$' + + # 2.3.3.10 Ensure Media Sharing Is Disabled. (Automated) - Not Implemented + # 2.3.3.11 Ensure Bluetooth Sharing Is Disabled. (Automated) - Not Implemented + # 2.3.3.12 Ensure Computer Name Does Not Contain PII or Protected Organizational Information. (Manual) - Not Implemented + + # 2.3.4.1 Ensure Backup Automatically is Enabled If Time Machine Is Enabled. (Automated) + - id: 34020 + title: "Ensure Backup Automatically is Enabled If Time Machine Is Enabled." + description: 'Backup solutions are only effective if the backups run on a regular basis. The time to check for backups is before the hard drive fails or the computer goes missing. In order to simplify the user experience so that backups are more likely to occur, Time Machine should be on and set to Back Up Automatically whenever the target volume is available. Operational staff should ensure that backups complete on a regular basis and the backups are tested to ensure that file restoration from backup is possible when needed. Backup dates are available even when the target volume is not available in the Time Machine plist. SnapshotDates = ( "2012-08-20 12:10:22 +0000", "2013-02-03 23:43:22 +0000", "2014-02-19 21:37:21 +0000", "2015-02-22 13:07:25 +0000", "2016-08-20 14:07:14 +0000" When the backup volume is connected to the computer, more extensive information is available through tmutil. See man tmutil.' + rationale: "Backups should automatically run whenever the backup drive is available." + impact: "The backup will run periodically in the background and could have user impact while running." + remediation: "Graphical Method: Perform the following steps to enable Time Machine automatic backup: 1. Open System Settings 2. Select General 3. Select Time Machine 4. Select Options... 5. Set Back up frequency to Automatically Terminal Method: Run the following command to enable automatic backups if Time Machine is enabled: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.TimeMachine.plist AutoBackup -bool true Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.MCX.TimeMachine 2. The key to include is AutoBackup 3. The key must be set to." + compliance: + - cis: ["2.3.4.1"] + - cis_csc_v8: ["11.2"] + - cis_csc_v7: ["10.1"] + - hipaa: ["164.308(a)(7)(ii)(A)"] + - iso_27001-2013: ["A.12.3.1"] + - pci_dss_v3.2.1: ["12.10.1"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.TimeMachine'').objectForKey(''AutoBackup'')" -> r:^1$' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.TimeMachine'').objectForKey(''LastDestinationID'')" -> r:^\.+$' + + # 2.3.4.2 Ensure Time Machine Volumes Are Encrypted If Time Machine Is Enabled. (Automated) + - id: 34021 + title: "Ensure Time Machine Volumes Are Encrypted If Time Machine Is Enabled." + description: "One of the most important security tools for data protection on macOS is FileVault. With encryption in place, it makes it difficult for an outside party to access your data if they get physical possession of the computer. One very large weakness in data protection with FileVault is the level of protection on backup volumes. If the internal drive is encrypted but the external backup volume that goes home in the same laptop bag is not, it is self-defeating. Apple tries to make this mistake easily avoided by providing a checkbox to enable encryption when setting up a Time Machine backup. Using this option does require some password management, particularly if a large drive is used with multiple computers. A unique, complex password to unlock the drive can be stored in keychains on multiple systems for ease of use. While some portable drives may contain non-sensitive data and encryption may make interoperability with other systems difficult, backup volumes should be protected just like boot volumes." + rationale: "Backup volumes need to be encrypted." + remediation: "Graphical Method: Perform the following steps to enable encryption on the Time Machine drive: 1. Open System Settings 2. Select General 3. Select Time Machine 4. Select the unencrypted drive 5. Select - to forget that drive as a destination 6. Select + to add a different drive as the destination 7. Select Set Up Disk... 8. Set Encrypt Backup to enabled 9. Enter a password in the New Password and the same password in the Re-enter Password fields 10. A password hint is required, but it is recommended that you do not use any identifying information for the password Note: In macOS 12.0 Monterey and previous, the existing Time Machine drive could have encryption added without formatting it. This is no longer possible in macOS 13.0 Ventura. If you wish to keep previous backups from the unencrypted volume, you will need to manually move those files over to the new encrypted drive." + compliance: + - cis: ["2.3.4.2"] + - cis_csc_v8: ["3.6", "3.11", "11.3"] + - cis_csc_v7: ["10.4", "13.6", "14.8"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "MP.L2-3.8.9", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.12.3.1", "A.6.2.1"] + - nist_sp_800-53: ["CP-9(8)", "SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1", "9.5", "9.5.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["A1.2", "CC6.1", "CC6.4", "CC6.7"] + condition: all + rules: + - 'c: sh -c "defaults read /Library/Preferences/com.apple.TimeMachine.plist | grep -c NotEncrypted" -> r:^0$' + + # 2.4.1 Ensure Show Wi-Fi status in Menu Bar Is Enabled. (Automated) - Not Implemented + # 2.4.2 Ensure Show Bluetooth Status in Menu Bar Is Enabled. (Automated) - Not Implemented + # 2.5.1 Audit Siri Settings. (Manual) - Not Implemented + # 2.5.2 Ensure Listen for "Hey Siri" Is Disabled. (Manual) - Not Implemented + + # 2.6.1.1 Ensure Location Services Is Enabled. (Automated) + - id: 34022 + title: "Ensure Location Services Is Enabled." + description: "macOS uses location information gathered through local Wi-Fi networks to enable applications to supply relevant information to users. With the operating system verifying the location, users do not need to change the time or the time zone. The computer will change them based on the user's location. They do not need to specify their location for weather or travel times, and they will receive alerts on travel times to meetings and appointments where location information is supplied. Location Services simplify some processes with mobile computers, such as asset management and time or log management. There are some use cases where it is important that the computer not be able to report its exact location. While the general use case is to enable Location Services, it should not be allowed if the physical location of the computer and the user should not be public knowledge." + rationale: "Location Services are helpful in most use cases and can simplify log and time management where computers change time zones." + remediation: "Graphical Method: Perform the following steps to enable Location Services: 1. Open System Settings 2. Select Privacy & Security 3. Select Location Services 4. Set Location Services to enabled Terminal Method: Run the following command to enable Location Services: $ /usr/bin/sudo /bin/launchctl load -w /System/Library/LaunchDaemons/com.apple.locationd.plist If the com.apple.locationd.plist outputs 0, run the following command to also ensure Location Services is running: $ /usr/bin/sudo /usr/bin/defaults write /var/db/locationd/Library/Preferences/ByHost/com.apple.locationd LocationServicesEnabled -bool false $ /usr/bin/sudo /bin/launchctl kickstart -k system/com.apple.locationd Note: In some use cases, organizations may not want Location Services running. To disable Location Services, System Integrity Protection must be disabled." + references: + - "https://support.apple.com/en-us/HT204690" + compliance: + - cis: ["2.6.1.1"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sh -c "launchctl list | grep -c com.apple.locationd" -> r:^1$' + - 'c:sudo -u _locationd /usr/bin/osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.locationd'').objectForKey(''LocationServicesEnabled'')" -> r:^1$' + + # 2.6.1.2 Ensure Location Services Is in the Menu Bar. (Automated) + - id: 34023 + title: "Ensure Location Services Is in the Menu Bar." + description: "This setting provides the user an understanding of the current status of Location Services and which applications are using it." + rationale: 'Apple has fully integrated location services into macOS. Where the computer is currently located is used for Timezones, weather, travel times, geolocation, "Find my Mac," and advertising services. This benchmark recommends that location services are enabled for most users. Many users may have occasions when they do not want to share their current locations, and some users may need to rarely share their locations. The immediate availability of Location Services in the menu bar provides easy access to the current status, which applications are using the service, and a quick shortcut to making changes. This setting provides better user control in managing user privacy.' + impact: "Users may be provided visibility to a setting they cannot control if organizations control Location Services globally by policy." + remediation: "Graphical Method: Perform the following steps to set whether the location services icon is in the menu bar: 1. Open System Settings 2. Select Privacy & Security 3. Select Location Services 4. Select Details... 5. Set Show location icon in menu bar when System Services request your location to enabled Terminal Method: Run the following commands to set the option of the location services icon being in the menu bar: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.locationmenu.plist ShowSystemServices -bool true." + compliance: + - cis: ["2.6.1.2"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - "c:defaults read /Library/Preferences/com.apple.locationmenu.plist ShowSystemServices -> r:^1$|^true$" + + # 2.6.1.3 Audit Location Services Access. (Manual) - Not Implemented + # 2.6.2.1 Audit Full Disk Access for Applications. (Manual) - Not Implemented + # 2.6.3 Ensure Sending Diagnostic and Usage Data to Apple Is Disabled. (Automated) - Not Implemented + # 2.6.4 Ensure Limit Ad Tracking Is Enabled. (Automated) - Not Implemented + + # 2.6.5 Ensure Gatekeeper Is Enabled. (Automated) + - id: 34024 + title: "Ensure Gatekeeper Is Enabled." + description: "Gatekeeper is Apple's application that utilizes allowlisting to restrict downloaded applications from launching. It functions as a control to limit applications from unverified sources from running without authorization. In an update to Gatekeeper in macOS 13 Ventura, Gatekeeper checks every application on every launch, not just quarantined apps." + rationale: "Disallowing unsigned software will reduce the risk of unauthorized or malicious applications from running on the system." + remediation: "Graphical Method: Perform the following steps to enable Gatekeeper: 1. Open System Settings 2. Select Privacy & Security 3. Set 'Allow apps downloaded from' to 'App Store and identified developers' Terminal Method: Run the following command to enable Gatekeeper to allow applications from App Store and identified developers: $ /usr/bin/sudo /usr/sbin/spctl --master-enable Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.systempolicy.control 2. The key to include is AllowIdentifiedDevelopers 3. The key must be set to 4. The key to also include is EnableAssessment 5. The key must be set to ." + compliance: + - cis: ["2.6.5"] + - cis_csc_v8: ["10.1", "10.2", "10.5"] + - cis_csc_v7: ["8.2", "8.4"] + - cmmc_v2.0: ["SI.L1-3.14.2", "SI.L1-3.14.4"] + - hipaa: ["164.308(a)(5)(ii)(B)"] + - iso_27001-2013: ["A.12.2.1"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4", "11.4", "5.1", "5.1.1", "5.2"] + - pci_dss_v4.0: ["5.1.1", "5.2.1", "5.2.2", "5.3.1", "5.3.2"] + - soc_2: ["CC6.8"] + condition: all + rules: + - "c:spctl --status -> r:^assessments enabled" + + # 2.6.6 Ensure FileVault Is Enabled. (Automated) + - id: 34025 + title: "Ensure FileVault Is Enabled." + description: "FileVault secures a system's data by automatically encrypting its boot volume and requiring a password or recovery key to access it. FileVault should be used with a saved escrow key to ensure that the owner can decrypt their data if the password is lost. FileVault may also be enabled using command line using the fdesetup command. To use this functionality, consult the Der Flounder blog for more details (see link below under References)." + rationale: "Encrypting sensitive data minimizes the likelihood of unauthorized users gaining access to it." + impact: "Mounting a FileVault encrypted volume from an alternate boot source will require a valid password to decrypt it." + remediation: "Graphical Method: Perform the following steps to enable FileVault: 1. Open System Settings 2. Select Security & Privacy 3. Select Turn On... Note: This will allow you to create a recovery key for FileVault. Keep the key saved securely in case it is needed at a later date. Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.MCX 2. The key to include is dontAllowFDEDisable 3. The key must be set to Note: This profile is required to pass the audit." + references: + - "https://derflounder.wordpress.com/2015/02/02/managing-yosemites-filevault-2-with-fdesetup/" + - "https://derflounder.wordpress.com/2019/01/15/unlock-or-decrypt-your-filevault-encrypted-boot-drive-from-the-command-line-on-macos-mojave/" + - "https://derflounder.wordpress.com/2021/10/29/use-of-filevault-institutional-recovery-keys-no-longer-recommended-by-apple/" + - "https://support.apple.com/guide/security/passcodes-and-passwords-sec20230a10d/1/web/1" + compliance: + - cis: ["2.6.6"] + - cis_csc_v8: ["3.6", "3.11"] + - cis_csc_v7: ["13.6", "14.8"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.6.2.1"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:fdesetup status -> r:^FileVault is On" + - 'c:osascript -l JavaScript -e "osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.MCX'').objectForKey(''dontAllowFDEDisable'')" -> r:^0$' + + # 2.6.7 Audit Lockdown Mode. (Manual) - Not Implemented + + # 2.6.8 Ensure an Administrator Password Is Required to Access System-Wide Preferences. (Automated) + - id: 34026 + title: "Ensure an Administrator Password Is Required to Access System-Wide Preferences." + description: "System Preferences controls system and user settings on a macOS Computer. System Preferences allows the user to tailor their experience on the computer as well as allowing the System Administrator to configure global security settings. Some of the settings should only be altered by the person responsible for the computer." + rationale: "By requiring a password to unlock system-wide System Preferences, the risk of a user changing configurations that affect the entire system is mitigated and requires an admin user to re-authenticate to make changes." + remediation: "Graphical Method: Perform the following steps to verify that an administrator password is required to access system-wide preferences: 1. Open System Settings 2. Select Privacy & Security 3. Select Advanced 4. Set Require an administrator password to access system-wide settings to enabled. Terminal Method: The authorizationdb settings cannot be written to directly, so the plist must be exported out to temporary file. Changes can be made to the temporary plist, then imported back into the authorizationdb settings. Run the following commands to enable that an administrator password is required to access system-wide preferences: $ /usr/bin/sudo /usr/bin/security authorizationdb read system.preferences > /tmp/system.preferences.plist YES (0) $ /usr/bin/sudo /usr/bin/defaults write /tmp/system.preferences.plist shared -bool false $ /usr/bin/sudo /usr/bin/security authorizationdb write system.preferences < /tmp/system.preferences.plist YES (0)." + impact: "Users will need to enter their password to unlock some additional preference panes that are unlocked by default like Network, Startup and Printers & Scanners." + compliance: + - cis: ["2.6.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:security authorizationdb read system.preferences | grep -A1 shared -> r:>false<" + + # 2.7.1 Ensure Screen Saver Corners Are Secure. (Automated) - Not Implemented + # 2.8.1 Audit Universal Control Settings. (Manual) - Not Implemented + # 2.9.1.1 Ensure the OS Is Not Active When Resuming from Standby (Intel). (Automated) - Not Implemented + # 2.9.1.2 Ensure the OS Is Not Active When Resuming from Sleep and Display Sleep (Apple Silicon). (Automated) - Not Implemented + + # 2.9.1.3 Ensure FileVault is Locked on Sleep. (Automated) + - id: 34027 + title: "Ensure FileVault is Locked on Sleep." + description: "Full Disk Encryption (FDE) is a Data-at-Rest (DAR) solution. It ensures that when the data on the drive is not in use it is full encrypted, but it can be decrypted (unlocked) as needed. When a Mac sleeps, the encryption keys remain in memory so that the drive is encrypted but unlocked. There are attacks available to interact with the OS and data on the unlocked drive. FileVault volumes should be locked when not in use to resist attack." + rationale: "The purpose of DAR is to ensure data is encrypted while at rest. If the volume is always unlocked it is not sufficient." + impact: "The laptop will require a user to log in with their username and password, not TouchID, into the OS after the FileVault key is destroyed." + remediation: "Terminal Method: Run the following command to ensure FileVault keys are set to be destroyed on standby: $ /usr/bin/sudo /usr/bin/pmset -a destroyfvkeyonstandby 1." + compliance: + - cis: ["2.9.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:pmset -b -g -> r:^\s*\t*DestroyFVKeyOnStandby\s*\t*1' + + # 2.9.2 Ensure Power Nap Is Disabled for Intel Macs. (Automated) + - id: 34028 + title: "Ensure Power Nap Is Disabled for Intel Macs." + description: "Power Nap allows the system to stay in low power mode, especially while on battery power, and periodically connect to previously known networks with stored credentials for user applications to phone home and get updates. This capability requires FileVault to remain unlocked and the use of previously joined networks to be risk accepted based on the SSID without user input. This control has been updated to check the status on both battery and AC Power. The presence of an electrical outlet does not completely correlate with logical and physical security of the device or available networks." + rationale: "Disabling this feature mitigates the risk of an attacker remotely waking the system and gaining access. The use of Power Nap adds to the risk of compromised physical and logical security. The user should be able to decrypt FileVault and have the applications download what is required when the computer is actively used. The control to prevent computer sleep has been retired for this version of the Benchmark. Forcing the computer to stay on and use energy in case a management push is needed is contrary to most current management processes. Only keep computers unslept if after hours pushes are required on closed LANs." + impact: "Power Nap exists for unattended user application updates like email and social media clients. With Power Nap disabled, the computer will not wake and reconnect to known wireless SSIDs intermittently when slept." + remediation: "Graphical Method: Perform the following steps to disable Power Nap: Desktop Instructions: 1. Open System Settings 2. Select Energy Saver 3. Set Power Nap to disabled 4. Select UPS (if applicable) 5. Set Power Nap to disabled Laptop Instructions: 1. Open System Settings 2. Select Battery 3. Select Power Adapter (for laptops only) 4. Set Power Nap to disabled 5. Select Battery 6. Set Power Nap to disabled 7. Select UPS (if applicable) 8. Set Power Nap to disabled Terminal Method: Run the following command to disable Power Nap: $ /usr/bin/sudo /usr/bin/pmset -a powernap 0." + compliance: + - cis: ["2.9.2"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'not c:sh -c "pmset -g custom" -> r:^\s*\t*powernap\s*\t*1' + + # 2.9.3 Ensure Wake for Network Access Is Disabled. (Automated) + - id: 34029 + title: "Ensure Wake for Network Access Is Disabled." + description: "This feature allows the computer to take action when the user is not present and the computer is in energy saving mode. These tools require FileVault to remain unlocked and fully rejoin known networks. This macOS feature is meant to allow the computer to resume activity as needed regardless of physical security controls. This feature allows other users to be able to access your computer's shared resources, such as shared printers or Apple Music playlists, even when your computer is in sleep mode. In a closed network when only authorized devices could wake a computer, it could be valuable to wake computers in order to do management push activity. Where mobile workstations and agents exist, the device will more likely check in to receive updates when already awake. Mobile devices should not be listening for signals on any unmanaged network or where untrusted devices exist that could send wake signals." + rationale: "Disabling this feature mitigates the risk of an attacker remotely waking the system and gaining access." + impact: "Management programs like Apple Remote Desktop Administrator use wake-on-LAN to connect with computers. If turned off, such management programs will not be able to wake a computer over the LAN. If the wake-on-LAN feature is needed, do not turn off this feature. The control to prevent computer sleep has been retired for this version of the Benchmark. Forcing the computer to stay on and use energy in case a management push is needed is contrary to most current management processes. Only keep computers unslept if after hours pushes are required on closed LANs." + remediation: "Graphical Method: Perform the following steps to disable Wake for network access: Desktop Instructions: 1. Open System Settings 2. Select Energy Saver 3. Set Wake for network access to disabled Laptop Instructions: 1. Open System Settings 2. Select Battery 3. Select Options... 4. Set Wake for network access to Never Terminal Method: Run the following command to disable Wake for network access: $ /usr/bin/sudo /usr/bin/pmset -a womp 0 Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.MCX 2. The key to include is com.apple.EnergySaver.desktop.ACPower 3. The key must be set to: Wake On LAN 0 Wake On Modem Ring 0 4. The key to also include is com.apple.EnergySaver.portable.ACPower 5. The key must be set to: Wake On LAN 0 Wake On Modem Ring 0 6. The key to also include is com.apple.EnergySaver.portable.BatteryPower 7. The key must be set to: Wake On LAN 0 Wake On Modem Ring 0 Note: Both Wake on LAN and Wake on Modem Ring need to be set. Only setting Wake On LAN will allow the profile to install but not set any settings. This profile will only apply the setting at installation and is not sticky." + compliance: + - cis: ["2.9.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'not c:sh -c "pmset -g custom" -> r:^\s*\t*womp\s*\t*1' + - 'not c:sh -c "profiles -P -o stdout | grep ''Wake On LAN''" -> n:=\s*(\d) compare != 0' + - 'not c:sh -c "profiles -P -o stdout | grep ''Wake On Modem Ring''" -> n:=\s*(\d) compare != 0' + + # 2.10.1 Ensure an Inactivity Interval of 20 Minutes Or Less for the Screen Saver Is Enabled. (Automated) - Not Implemented + + # 2.10.2 Ensure Require Password After Screen Saver Begins or Display Is Turned Off Is Enabled for 5 Seconds or Immediately. (Automated) + - id: 34030 + title: "Ensure Require Password After Screen Saver Begins or Display Is Turned Off Is Enabled for 5 Seconds or Immediately." + description: "Sleep and screen saver modes are low power modes that reduce electrical consumption while the system is not in use." + rationale: "Prompting for a password when waking from sleep or screen saver mode mitigates the threat of an unauthorized person gaining access to a system in the user's absence." + impact: "Without a screenlock in place, anyone with physical access to the computer would be logged in and able to use the active user's session." + remediation: "Graphical Method: Perform the following steps to enable a password for unlock after a screen saver begins or after sleep: 1. Open System Settings 2. Select Lock Screen 3. Set Require password after screensaver begins or display is turned off to either After 0 seconds or After 5 seconds Terminal Method: Run the following command to require a password to unlock the computer after the screen saver engages or the computer sleeps: $ /usr/bin/sudo /usr/sbin/sysadminctl -screenLock immediate -password or $ /usr/bin/sudo /usr/sbin/sysadminctl -screenLock 5 seconds -password Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.screensaver 2. The key to include is askForPassword 3. The key must be set to 4. The key to also include is askForPasswordDelay 5. The key must be set to <0,5>." + references: + - "https://blog.kolide.com/screensaver-security-on-macos-10-13-is-broken-a385726e2ae2" + - "https://github.com/rtrouton/profiles/blob/master/SetDefaultScreensaver/SetDefaultScreensaver.mobileconfig" + compliance: + - cis: ["2.10.2"] + - cis_csc_v8: ["4.7"] + - cis_csc_v7: ["4.2"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v3.2.1: ["2.1", "2.1.1"] + - pci_dss_v4.0: ["2.2.2", "2.3.1"] + - soc_2: ["CC6.3"] + condition: all + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.screensaver'').objectForKey(''askForPassword'')" -> n:^(\d+)$ compare == 1' + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.screensaver'').objectForKey(''askForPasswordDelay'')" -> n:^(\d+)$ compare <= 5' + + # 2.10.3 Ensure a Custom Message for the Login Screen Is Enabled. (Automated) + - id: 34031 + title: "Ensure a Custom Message for the Login Screen Is Enabled." + description: "An access warning informs the user that the system is reserved for authorized use only, and that the use of the system may be monitored." + rationale: "An access warning may reduce a casual attacker's tendency to target the system. Access warnings may also aid in the prosecution of an attacker by evincing the attacker's knowledge of the system's private status, acceptable use policy, and authorization requirements." + impact: "If users are not informed of their responsibilities, unapproved activities may occur. Users that are not approved for access may take the lack of a warning banner as implied consent to access." + remediation: 'Graphical Method: Perform the following steps to enable a login banner set to your organization''s required text: 1. Open System Settings 2. Select Lock Screen 3. Set Show message when locked to enabled 4. Select Set 5. Insert text in the Set a message to appear on the lock screen that matches your organization''s required text 6. Select Done Terminal Method: Run the following command to enable a custom login screen message: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "" example: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow LoginwindowText "Center for Internet Security Test Message" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.loginwindow 2. The key to include is LoginwindowText 3. The key must be set to .' + compliance: + - cis: ["2.10.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''LoginwindowText'')" -> r:^\.+$' + + # 2.10.4 Ensure Login Window Displays as Name and Password Is Enabled. (Automated) + - id: 34032 + title: "Ensure Login Window Displays as Name and Password Is Enabled." + description: "The login window prompts a user for his/her credentials, verifies their authorization level, and then allows or denies the user access to the system." + rationale: "Prompting the user to enter both their username and password makes it twice as hard for unauthorized users to gain access to the system since they must discover two attributes." + remediation: "Graphical Method: Perform the following steps to ensure the login window display name and password: 1. Open System Settings 2. Select Lock Screen 3. Set 'Login window showstoName and Password` Terminal Method: Run the following command to enable the login window to display name and password: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow SHOWFULLNAME -bool true Note: The GUI will not display the updated setting until the current user(s) logs out. Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.loginwindow 2. The key to include is SHOWFULLNAME 3. The key must be set to ." + compliance: + - cis: ["2.10.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''SHOWFULLNAME'')" -> r:^1$|^true$' + + # 2.10.5 Ensure Show Password Hints Is Disabled. (Automated) + - id: 34033 + title: "Ensure Show Password Hints Is Disabled." + description: "Password hints are user-created text displayed when an incorrect password is used for an account." + rationale: "Password hints make it easier for unauthorized persons to gain access to systems by displaying information provided by the user to assist in remembering the password. This info could include the password itself or other information that might be readily discerned with basic knowledge of the end user." + impact: "The user can set the hint to any value, including the password itself or clues that allow trivial social engineering attacks." + remediation: "Graphical Method: Perform the following steps to disable password hints from being shown: 1. Open System Settings 2. Select Lock Screen 3. Set 'Show password hints` to disabled Terminal Method: Run the following command to disable password hints: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow RetriesUntilHint -int 0 Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.loginwindow 2. The key to include is RetriesUntilHint 3. The key must be set to 0." + compliance: + - cis: ["2.10.5"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''RetriesUntilHint'')" -> r:^0$' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''RetriesUntilHint'')" -> r:\w+' + + # 2.11.1 Ensure Users' Accounts Do Not Have a Password Hint. (Automated) + - id: 34034 + title: "Ensure Users' Accounts Do Not Have a Password Hint." + description: "Password hints help the user recall their passwords for various systems and/or accounts. In most cases, password hints are simple and closely related to the user's password." + rationale: "Password hints that are closely related to the user's password are a security vulnerability, especially in the social media age. Unauthorized users are more likely to guess a user's password if there is a password hint. The password hint is very susceptible to social engineering attacks and information exposure on social media networks." + remediation: "Graphical Method: Perform the following steps to remove a user's password hint: 1. Open System Settings 2. Select Touch ID & Passwords (or Login Password on non-Touch ID Macs) 3. Select Change... 4. Change the password and ensure that no text is entered in the Password hint box Note: This will only change the currently logged-in user's password, and not any others that are not compliant on the Mac. Use the terminal method if multiple users are not in compliance. Terminal Method: Run the following command to remove a user's password hint: $ /usr/bin/sudo /usr/bin/dscl . -list /Users hint . -delete /Users/ hint example: $ /usr/bin/sudo /usr/bin/dscl . -list /Users hint . -delete /Users/firstuser hint $ /usr/bin/sudo /usr/bin/dscl . -list /Users hint . -delete /Users/seconduser hint." + compliance: + - cis: ["2.11.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'not c:dscl . -list /Users hint -> r:^\w*$' + + # 2.11.2 Audit Touch ID. (Manual) - Not Implemented + + # 2.12.1 Ensure Guest Account Is Disabled. (Automated) + - id: 34035 + title: "Ensure Guest Account Is Disabled." + description: "The guest account allows users access to the system without having to create an account or password. Guest users are unable to make setting changes and cannot remotely login to the system. All files, caches, and passwords created by the guest user are deleted upon logging out." + rationale: "Disabling the guest account mitigates the risk of an untrusted user doing basic reconnaissance and possibly using privilege escalation attacks to take control of the system." + impact: "A guest user can use that access to find out additional information about the system and might be able to use privilege escalation vulnerabilities to establish greater access." + remediation: "Graphical Method: Perform the following steps to disable guest account availability: 1. Open System Settings 2. Select Users & Groups 3. Select the i next to the Guest User 4. Set Allow guests to log in to this computer to disabled Terminal Method: Run the following command to disable the guest account: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled -bool false Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.MCX 2. The key to include is DisableGuestAccount 3. The key must be set to 4. The key to include is EnableGuestAccount 5. The key must be set to ." + compliance: + - cis: ["2.12.1"] + - cis_csc_v8: ["5.2", "6.2", "6.8"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.4", "AC.L2-3.1.5", "IA.L2-3.5.7", "SC.L2-3.13.3"] + - hipaa: ["164.308(a)(3)(ii)(B)", "164.308(a)(3)(ii)(C)", "164.308(a)(4)(i)", "164.308(a)(4)(ii)(C)"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["AC-2(1)", "AC-5", "AC-6", "AC-6(1)", "AC-6(7)", "AU-9(4)"] + - pci_dss_v3.2.1: ["8.1.3"] + - pci_dss_v4.0: ["10.3.1", "2.2.2", "7.1", "7.1.1", "7.2", "7.2.1", "7.2.2", "7.2.4", "7.2.6", "7.3", "7.3.1", "7.3.2", "8.2.4", "8.2.5", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC5.2", "CC6.1", "CC6.2", "CC6.3"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.MCX'').objectForKey(''DisableGuestAccount'')" -> r:^1$' + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''GuestEnabled'')" -> r:^0$' + + # 2.12.2 Ensure Guest Access to Shared Folders Is Disabled. (Automated) + - id: 34036 + title: "Ensure Guest Access to Shared Folders Is Disabled." + description: "Allowing guests to connect to shared folders enables users to access selected shared folders and their contents from different computers on a network." + rationale: "Not allowing guests to connect to shared folders mitigates the risk of an untrusted user doing basic reconnaissance and possibly using privilege escalation attacks to take control of the system." + impact: "Unauthorized users could access shared files on the system." + remediation: "Graphical Method: Perform the following steps to no longer allow guest user access to shared folders: 1. Open System Settings 2. Select Users & Groups 3. Select the i next to the Guest User 4. Set Allow guests to connect to shared folders to disabled Terminal Method: Run the following commands to verify that shared folders are not accessible to guest users: $ /usr/bin/sudo /usr/sbin/sysadminctl -smbGuestAccess off." + compliance: + - cis: ["2.12.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:sysadminctl -smbGuestAccess status -> r:SMB guest access disabled" + + # 2.12.3 Ensure Automatic Login Is Disabled. (Automated) + - id: 34037 + title: "Ensure Automatic Login Is Disabled." + description: "The automatic login feature saves a user's system access credentials and bypasses the login screen. Instead, the system automatically loads to the user's desktop screen." + rationale: "Disabling automatic login decreases the likelihood of an unauthorized person gaining access to a system." + impact: "If automatic login is not disabled, an unauthorized user could gain access to the system without supplying any credentials." + remediation: "Graphical Method: Perform the following steps to set automatic login to off: 1. Open System Settings 2. Select Users & Groups 3. Set Automatic login in as... to Off Terminal Method: Run the following command to disable automatic login: $ /usr/bin/sudo /usr/bin/defaults delete /Library/Preferences/com.apple.loginwindow autoLoginUser Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.loginwindow 2. The key to include is com.apple.login.mcx.DisableAutoLoginClient 3. The key must be set to Note: If both the profile is enabled and a user is set to autologin, the profile will take precedent. In this case, the graphical or terminal remediation method should also be applied in case the profile is ever removed." + compliance: + - cis: ["2.12.3"] + - cis_csc_v8: ["4.7"] + - cis_csc_v7: ["4.2"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v3.2.1: ["2.1", "2.1.1"] + - pci_dss_v4.0: ["2.2.2", "2.3.1"] + - soc_2: ["CC6.3"] + condition: any + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''com.apple.login.mcx.DisableAutoLoginClient'')" -> r:^1$' + - 'not c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.loginwindow'').objectForKey(''autoLoginUser'')" -> r:^\.+$' + + # 2.13.1 Audit Passwords System Preference Setting. (Manual) - Not Implemented + # 2.14.1 Audit Game Center Settings. (Manual) - Not Implemented + # 2.15.1 Audit Notification & Focus Settings. (Manual) - Not Implemented + # 2.16.1 Audit Wallet & Apple Pay Settings. (Manual) - Not Implemented + # 2.17.1 Audit Internet Accounts for Authorized Use. (Manual) - Not Implemented + + # 2.18.1 Ensure On-Device Dictation Is Enabled. (Automated) - Not Implemented + + # 3.1 Ensure Security Auditing Is Enabled. (Automated) + - id: 34038 + title: "Ensure Security Auditing Is Enabled." + description: "macOS's audit facility, auditd, receives notifications from the kernel when certain system calls, such as open, fork, and exit, are made. These notifications are captured and written to an audit log." + rationale: "Logs generated by auditd may be useful when investigating a security incident as they may help reveal the vulnerable application and the actions taken by a malicious actor." + remediation: "Terminal Method: Perform the following to enable security auditing: Run the following command to load auditd: $ /usr/bin/sudo /bin/launchctl load -w /System/Library/LaunchDaemons/com.apple.auditd.plist." + compliance: + - cis: ["3.1"] + - cis_csc_v8: ["8.2", "8.5"] + - cis_csc_v7: ["4.9", "6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:launchctl list -> r:com.apple.auditd" + + # 3.2 Ensure Security Auditing Flags For User-Attributable Events Are Configured Per Local Organizational Requirements. (Automated) + - id: 34039 + title: "Ensure Security Auditing Flags For User-Attributable Events Are Configured Per Local Organizational Requirements." + description: "Auditing is the capture and maintenance of information about security-related events. Auditable events often depend on differing organizational requirements." + rationale: "Maintaining an audit trail of system activity logs can help identify configuration errors, troubleshoot service disruptions, and analyze compromises or attacks that have occurred, have begun, or are about to begin. Audit logs are necessary to provide a trail of evidence in case the system or network is compromised. Depending on the governing authority, organizations can have vastly different auditing requirements. In this control we have selected a minimal set of audit flags that should be a part of any organizational requirements. The flags selected below may not adequately meet organizational requirements for users of this benchmark. The auditing checks for the flags proposed here will not impact additional flags that are selected." + remediation: "Terminal Method: Perform the following to set the required Security Auditing Flags: Edit the /etc/security/audit_control file and add -fm, ad, -ex, aa, -fr, lo, and -fw to flags. You can also substitute -all for -fm, -ex, -fr, and -fw." + references: + - "https://derflounder.wordpress.com/2012/01/30/openbsm-auditing-on-mac-os-x/" + - "https://csrc.nist.gov/CSRC/media/Publications/sp/800-179/rev-1/draft/documents/sp800-179r1-draft.pdf" + - "https://www.scip.ch/en/?labs.20150108" + - "https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-171r2.pdf" + - "https://www.whitehouse.gov/wp-content/uploads/2021/08/M-21-31-Improving-the-Federal-Governments-Investigative-and-Remediation-Capabilities-Related-to-Cybersecurity-Incidents.pdf" + compliance: + - cis: ["3.2"] + - cis_csc_v8: ["3.14", "8.2", "8.5"] + - cis_csc_v7: ["6.2", "14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7", "AU.L2-3.3.1"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.1", "A.12.4.3"] + - nist_sp_800-53: ["AC-6(9)", "AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2", "10.2.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "11.5"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + condition: any + rules: + - "f:/etc/security/audit_control -> r:^flags && r:-fm && r:-ex && r:ad && r:aa && r:lo && r:-fr && r:-fw" + - "f:/etc/security/audit_control -> r:^flags && r:-all && r:ad && r:aa && r:lo" + + # 3.3 Ensure install.log Is Retained for 365 or More Days and No Maximum Size. (Automated) + - id: 34040 + title: "Ensure install.log Is Retained for 365 or More Days and No Maximum Size." + description: 'macOS writes information pertaining to system-related events to the file /var/log/install.log and has a configurable retention policy for this file. The default logging setting limits the file size of the logs and the maximum size for all logs. The default allows for an errant application to fill the log files and does not enforce sufficient log retention. The Benchmark recommends a value based on standard use cases. The value should align with local requirements within the organization. The default value has an "all_max" file limitation, no reference to a minimum retention, and a less precise rotation argument. The all_max flag control will remove old log entries based only on the size of the log files. Log size can vary widely depending on how verbose installing applications are in their log entries. The decision here is to ensure that logs go back a year, and depending on the applications a size restriction could compromise the ability to store a full year. While this Benchmark is not scoring for a rotation flag, the default rotation is sequential rather than using a timestamp. Auditors may prefer timestamps in order to simply review specific dates where event information is desired. Please review the File Rotation section in the man page for more information. man asl.conf - The maximum file size limitation string should be removed "all_max=" - An organization appropriate retention should be added "ttl=" - The rotation should be set with timestamps "rotate=utc" or "rotate=local".' + rationale: "Archiving and retaining install.log for at least a year is beneficial in the event of an incident as it will allow the user to view the various changes to the system along with the date and time they occurred." + impact: "Without log files system maintenance and security forensics cannot be properly performed." + remediation: "Terminal Method: Perform the following to ensure that install logs are retained for at least 365 days: Edit the /etc/asl/com.apple.install file and add or modify the ttl value to 365 or greater on the file line. Also, remove the all_max= setting and value from the file line." + compliance: + - cis: ["3.3"] + - cis_csc_v8: ["8.1", "8.3"] + - cis_csc_v7: ["6.4", "6.7"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.12.4.3"] + - pci_dss_v3.2.1: ["10.7"] + - pci_dss_v4.0: ["10.1", "10.1.1"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/asl/com.apple.install -> !r:^\s*# && n:ttl=(\d+) compare >= 365' + - 'not f:/etc/asl/com.apple.install -> !r:^\s*# && r:all_max=' + + # 3.4 Ensure Security Auditing Retention Is Enabled. (Automated) + - id: 34041 + title: "Ensure Security Auditing Retention Is Enabled." + description: "The macOS audit capability contains important information to investigate security or operational issues. This resource is only completely useful if it is retained long enough to allow technical staff to find the root cause of anomalies in the records. Retention can be set to respect both size and longevity. To retain as much as possible under a certain size, the recommendation is to use the following: expire-after:60d OR 5G This recomendation is based on minimum storage for review and investigation. When a third party tool is in use to allow remote logging or the store and forwarding of logs, this local storage requirement is not required." + rationale: "The audit records need to be retained long enough to be reviewed as necessary." + impact: "The recommendation is that at least 60 days or 5 gigabytes of audit records are retained. Systems that have very little remaining disk space may have issues retaining sufficient data." + remediation: "Terminal Method: Perform the following to set the audit retention length: Edit the /etc/security/audit_control file so that expire-after: is at least 60d OR 5G." + compliance: + - cis: ["3.4"] + - cis_csc_v8: ["8.1", "8.3"] + - cis_csc_v7: ["6.4", "6.7"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.12.4.3"] + - pci_dss_v3.2.1: ["10.7"] + - pci_dss_v4.0: ["10.1", "10.1.1"] + - soc_2: ["A1.1"] + condition: any + rules: + - 'f:/etc/security/audit_control -> n:^\s*expire-after\p\w*(\d+)s compare >= 5184000' + - 'f:/etc/security/audit_control -> n:^\s*expire-after\p\w*(\d+)h compare >= 1440' + - 'f:/etc/security/audit_control -> n:^\s*expire-after\p\w*(\d+)d compare >= 60' + - 'f:/etc/security/audit_control -> n:^\s*expire-after\p\w*(\d+)y compare >= 1' + - 'f:/etc/security/audit_control -> n:^\s*expire-after\p\w*(\d+)b compare >= 5368709120' + - 'f:/etc/security/audit_control -> n:^\s*expire-after\p\w*(\d+)k compare >= 5242880' + - 'f:/etc/security/audit_control -> n:^\s*expire-after\p\w*(\d+)m compare >= 5120' + - 'f:/etc/security/audit_control -> n:^\s*expire-after\p\w*(\d+)g compare >= 5' + + # 3.5 Ensure Access to Audit Records Is Controlled. (Automated) - Not Implemented + # 3.6 Ensure Firewall Logging Is Enabled and Configured. (Automated) - Not Implemented + # 3.7 Audit Software Inventory. (Manual) - Not Implemented + + # 4.1 Ensure Bonjour Advertising Services Is Disabled. (Automated) + - id: 34042 + title: "Ensure Bonjour Advertising Services Is Disabled." + description: "Bonjour is an auto-discovery mechanism for TCP/IP devices which enumerate devices and services within a local subnet. DNS on macOS is integrated with Bonjour and should not be turned off, but the Bonjour advertising service can be disabled." + rationale: 'Bonjour can simplify device discovery from an internal rogue or compromised host. An attacker could use Bonjour''s multicast DNS feature to discover a vulnerable or poorly-configured service or additional information to aid a targeted attack. Implementing this control disables the continuous broadcasting of "I''m here!" messages. Typical end-user endpoints should not have to advertise services to other computers. This setting does not stop the computer from sending out service discovery messages when looking for services on an internal subnet, if the computer is looking for a printer or server and using service discovery. To block all Bonjour traffic except to approved devices, the pf or other firewall would be needed.' + impact: "Some applications, like Final Cut Studio and AirPort Base Station management, may not operate properly if the mDNSResponder is turned off." + remediation: "Terminal Method: Run the following command to disable Bonjour Advertising services: $ /usr/bin/sudo /usr/bin/defaults write /Library/Preferences/com.apple.mDNSResponder.plist NoMulticastAdvertisements -bool true Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mDNSResponder 2. The key to include is NoMulticastAdvertisements." + compliance: + - cis: ["4.1"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:osascript -l JavaScript -e "$.NSUserDefaults.alloc.initWithSuiteName(''com.apple.mDNSResponder'').objectForKey(''NoMulticastAdvertisements'')" -> r:^1$' + + # 4.2 Ensure HTTP Server Is Disabled. (Automated) + - id: 34043 + title: "Ensure HTTP Server Is Disabled." + description: "macOS used to have a graphical front-end to the embedded Apache web server in the Operating System. Personal web sharing could be enabled to allow someone on another computer to download files or information from the user's computer. Personal web sharing from a user endpoint has long been considered questionable, and Apple has removed that capability from the GUI. Apache, however, is still part of the Operating System and can be easily turned on to share files and provide remote connectivity to an end-user computer. Web sharing should only be done through hardened web servers and appropriate cloud services." + rationale: "Web serving should not be done from a user desktop. Dedicated webservers or appropriate cloud storage should be used. Open ports make it easier to exploit the computer." + impact: "The web server is both a point of attack for the system and a means for unauthorized file transfers." + remediation: "Terminal Method: Run the following command to disable the HTTP server services: $ /usr/bin/sudo /usr/sbin/apachectl stop $ /usr/bin/sudo /bin/launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist." + references: + - "https://www.stigviewer.com/stig/apple_macos_11_big_sur/2021-06-16/finding/V-230793" + - "https://httpd.apache.org/security/vulnerabilities_24.html" + compliance: + - cis: ["4.2"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - "not c:launchctl list -> r:org.apache.httpd" + + # 4.3 Ensure NFS Server Is Disabled. (Automated) + - id: 34044 + title: "Ensure NFS Server Is Disabled." + description: "macOS can act as an NFS fileserver. NFS sharing could be enabled to allow someone on another computer to mount shares and gain access to information from the user's computer. File sharing from a user endpoint has long been considered questionable, and Apple has removed that capability from the GUI. NFSD is still part of the Operating System and can be easily turned on to export shares and provide remote connectivity to an end-user computer. The etc/exports file contains the list of NFS shared directories. If the file exists, it is likely that NFS sharing has been enabled in the past or may be available periodically. As an additional check, the audit verifies that there is no /etc/exports file." + rationale: "File serving should not be done from a user desktop. Dedicated servers should be used. Open ports make it easier to exploit the computer." + impact: "The nfs server is both a point of attack for the system and a means for unauthorized file transfers." + remediation: "Terminal Method: Run the following command to disable the nfsd fileserver services: $ /usr/bin/sudo /sbin/nfsd stop $ /usr/bin/sudo /bin/launchctl disable system/com.apple.nfsd Remove the exported Directory listing. $ /usr/bin/sudo /bin/rm /etc/exports." + compliance: + - cis: ["4.3"] + - cis_csc_v8: ["4.1", "4.8"] + - cis_csc_v7: ["5.1", "9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "11.5", "2.2", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.5", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6", "CC7.1", "CC8.1"] + condition: all + rules: + - "not c:launchctl list -> r:com.apple.nfsd" + - "not f:/etc/exports" + + # 5.1.1 Ensure Home Folders Are Secure. (Automated) - Not Implemented + + # 5.1.2 Ensure System Integrity Protection Status (SIP) Is Enabled. (Automated) + - id: 34045 + title: "Ensure System Integrity Protection Status (SIP) Is Enabled." + description: "System Integrity Protection is a security feature introduced in OS X 10.11 El Capitan. System Integrity Protection restricts access to System domain locations and restricts runtime attachment to system processes. Any attempt to inspect or attach to a system process will fail. Kernel Extensions are now restricted to /Library/Extensions and are required to be signed with a Developer ID." + rationale: "Running without System Integrity Protection on a production system runs the risk of the modification of system binaries or code injection of system processes that would otherwise be protected by SIP." + impact: "System binaries and processes could become compromised." + remediation: "Terminal Method: Perform the following steps to enable System Integrity Protection: 1. Reboot into the Recovery Partition (reboot and hold down Command () + R) 2. Select Utilities 3. Select Terminal 4. Run the following command: $ /usr/bin/sudo /usr/bin/csrutil enable Successfully enabled System Integrity Protection. Please restart the machine for the changes to take effect. 5. Reboot the computer Note: You should research why the system had SIP disabled. It might be a better option to erase the Mac and reinstall the operating system. That is at your discretion. Note: You cannot enable System Integrity Protection from the booted operating system. If the remediation is attempted in the booted OS and not the Recovery Partition the output will give the error csrutil: failed to modify system integrity configuration. This tool needs to be executed from the Recovery OS." + references: + - "https://developer.apple.com/documentation/security/disabling_and_enabling_system_integrity_protection" + - "https://support.apple.com/en-us/HT204899" + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["2.3", "2.6", "10.5"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.9"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-10", "CM-7(1)", "CM-7(2)", "CM-8(3)", "SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - pci_dss_v4.0: ["1.2.5", "12.3.4", "2.2.4"] + - soc_2: ["CC5.2", "CC6.8", "CC7.1"] + condition: all + rules: + - "c:csrutil status -> r:^System Integrity Protection status: enabled." + + # 5.1.3 Ensure Apple Mobile File Integrity (AMFI) Is Enabled. (Automated) + - id: 34046 + title: "Ensure Apple Mobile File Integrity (AMFI) Is Enabled." + description: "Apple Mobile File Integrity (AMFI) was first released in macOS 10.12. The daemon and service block attempts to run unsigned code. AMFI uses lanchd, code signatures, certificates, entitlements, and provisioning profiles to create a filtered entitlement dictionary for an app. AMFI is the macOS kernel module that enforces code-signing and library validation." + rationale: "Apple Mobile File Integrity validates that application code is validated." + impact: "Applications could be compromised with malicious code." + remediation: 'Terminal Method: Run the following command to enable the Apple Mobile File Integrity service: $ /usr/bin/sudo /usr/sbin/nvram boot-args="".' + references: + - "https://eclecticlight.co/2018/12/29/amfi-checking-file-integrity-on-your-mac/" + - "https://github.com/usnistgov/macos_security/issues/39" + - "https://github.com/usnistgov/macos_security/issues/40" + - "https://www.naut.ca/blog/2020/11/13/forbidden-commands-to-liberate-macos/" + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["2.3", "2.6"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.9"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-10", "CM-7(1)", "CM-7(2)", "CM-8(3)"] + - pci_dss_v4.0: ["1.2.5", "12.3.4", "2.2.4"] + - soc_2: ["CC5.2", "CC7.1"] + condition: all + rules: + - "not c:nvram -p -> r:amfi_get_out_of_my_way=1" + + # 5.1.4 Ensure Sealed System Volume (SSV) Is Enabled. (Automated) + - id: 34047 + title: "Ensure Sealed System Volume (SSV) Is Enabled." + description: "Sealed System Volume is a security feature introduced in macOS 11.0 Big Sur. During system installation, a SHA-256 cryptographic hash is calculated for all immutable system files and stored in a Merkle tree which itself is hashed as the Seal. Both are stored in the metadata of the snapshot created of the System volume. The seal is verified by the boot loader at startup. macOS will not boot if system files have been tampered with. If validation fails, the user will be instructed to reinstall the operating system. During read operations for files located in the Sealed System Volume, a hash is calculated and compared to the value stored in the Merkle tree." + rationale: "Running without Sealed System Volume on a production system could run the risk of Apple software that integrates directly with macOS being modified." + impact: "Apple Software that integrates with the operating system could become compromised." + remediation: "If SSV has been disabled, assume that the operating system has been compromised. Back up any files, and do a clean install to a known good Operating System." + references: + - "https://developer.apple.com/news/?id=3xpv8r2m" + - "https://eclecticlight.co/2020/11/30/is-big-surs-system-volume-sealed/" + - "https://eclecticlight.co/2020/06/25/big-surs-signed-system-volume-added-security-protection/" + - "https://support.apple.com/guide/security/signed-system-volume-security-secd698747c9/web" + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.6", "3.11"] + - cis_csc_v7: ["13.6", "14.8"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.6.2.1"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:csrutil authenticated-root status -> r:^Authenticated Root status: enabled" + + # 5.1.5 Ensure Appropriate Permissions Are Enabled for System Wide Applications. (Automated) - Not Implemented + # 5.1.6 Ensure No World Writable Folders Exist in the System Folder. (Automated) - Not Implemented + # 5.1.7 Ensure No World Writable Folders Exist in the Library Folder. (Automated) - Not Implemented + + # 5.2.1 Ensure Password Account Lockout Threshold Is Configured. (Automated) + - id: 34048 + title: "Ensure Password Account Lockout Threshold Is Configured." + description: "The account lockout threshold specifies the amount of times a user can enter an incorrect password before a lockout will occur. Ensure that a lockout threshold is part of the password policy on the computer." + rationale: "The account lockout feature mitigates brute-force password attacks on the system." + impact: "The number of incorrect log on attempts should be reasonably small to minimize the possibility of a successful password attack, while allowing for honest errors made during a normal user log on. The locked account will auto-unlock after a few minutes when bad password attempts stop. The computer will accept the still-valid password if remembered or recovered." + remediation: 'Terminal Method: Run the following command to set the maximum number of failed login attempts to less than or equal to 5: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "maxFailedLoginAttempts=" $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "policyAttributeMinutesUntilFailedAuthenticationReset=" example: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "maxFailedLoginAttempts=5" /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "policyAttributeMinutesUntilFailedAuthenticationReset=15" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mobiledevice.passwordpolicy 2. The key to include is maxFailedAttempts 3. The key must be set to 4. The key to include is minutesUntilFailedLoginReset 5. The key must be set to Note: The profile method is the preferred method for setting password policy since - setglobalpolicy in pwpolicy is deprecated and will likely be removed in a future macOS release.' + references: + - "https://workbench.cisecurity.org/communities/113" + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["6.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1"] + - hipaa: ["164.308(a)(3)(ii)(C)"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["AC-2(1)"] + - pci_dss_v3.2.1: ["8.1.3"] + - pci_dss_v4.0: ["8.2.4", "8.2.5"] + - soc_2: ["CC6.2", "CC6.3"] + condition: all + rules: + - 'c:pwpolicy -n /Local/Default -getglobalpolicy -> n:maxFailedLoginAttempts=(\d+) compare <= 5' + - 'c:pwpolicy -n /Local/Default -getglobalpolicy -> n:policyAttributeMinutesUntilFailedAuthenticationReset=(\d+) compare >= 15' + + # 5.2.2 Ensure Password Minimum Length Is Configured. (Automated) + - id: 34049 + title: "Ensure Password Minimum Length Is Configured." + description: "A minimum password length is the fewest number of characters a password can contain to meet a system's requirements. Ensure that a minimum of a 15-character password is part of the password policy on the computer. Where the confidentiality of encrypted information in FileVault is more of a concern, requiring a longer password or passphrase may be sufficient rather than imposing additional complexity requirements that may be self-defeating." + rationale: "Information systems that are not protected with strong password schemes including passwords of minimum length provide a greater opportunity for attackers to crack the password and gain access to the system." + impact: "Short passwords can be easily attacked." + remediation: 'Terminal Method: Run the following command to set the password length to greater than or equal to 15: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "minChars=15>" example: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "minChars=15" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mobiledevice.passwordpolicy 2. The key to include is minLength 3. The key must be set to 15> Note: The profile method is the preferred method for setting password policy since - setglobalpolicy in pwpolicy is deprecated and will likely be removed in a future macOS release.' + compliance: + - cis: ["5.2.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:pwpolicy -n /Local/Default -getglobalpolicy -> n:minChars=(\d+) compare >= 15' + + # 5.2.3 Ensure Complex Password Must Contain Alphabetic Characters Is Configured. (Manual) + - id: 34050 + title: "Ensure Complex Password Must Contain Alphabetic Characters Is Configured." + description: "Complex passwords contain one character from each of the following classes: English uppercase letters, English lowercase letters, Westernized Arabic numerals, and non-alphanumeric characters. Ensure that an Alphabetic character is part of the password policy on the computer." + rationale: "The more complex a password, the more resistant it will be against persons seeking unauthorized access to a system." + impact: "Password policy should be in effect to reduce the risk of exposed services being compromised easily through dictionary attacks or other social engineering attempts." + remediation: 'Terminal Method: Run the following command to set the that passwords must contain at least one letter: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy - setaccountpolicies "requiresAlpha=1>" example: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "requiresAlpha=1" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mobiledevice.passwordpolicy 2. The key to include is requireAlphanumeric 3. The key must be set to Note: This profile sets a requirement of both an alphabetical and a numeric character. Note: The profile method is the preferred method for setting password policy since - setglobalpolicy in pwpolicy is deprecated and will likely be removed in a future macOS release.' + compliance: + - cis: ["5.2.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:pwpolicy -getaccountpolicies -> r:Contain at least one number and one alphabetic character." + - 'c:sh -c "pwpolicy -getaccountpolicies | grep -A1 minimumLetters " -> n:>(\d+)< compare >= 1' + + # 5.2.4 Ensure Complex Password Must Contain Numeric Character Is Configured. (Manual) + - id: 34051 + title: "Ensure Complex Password Must Contain Numeric Character Is Configured." + description: "Complex passwords contain one character from each of the following classes: English uppercase letters, English lowercase letters, Westernized Arabic numerals, and non-alphanumeric characters. Ensure that a number or numeric value is part of the password policy on the computer." + rationale: "The more complex a password, the more resistant it will be against persons seeking unauthorized access to a system." + impact: "Password policy should be in effect to reduce the risk of exposed services being compromised easily through dictionary attacks or other social engineering attempts." + remediation: 'Terminal Method: Run the following command to set passwords to require at least one number: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy - setaccountpolicies "requiresNumeric=1>" example: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "requiresNumeric=2" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mobiledevice.passwordpolicy 2. The key to include is requireAlphanumeric 3. The key must be set to Note: This profile sets a requirement of both an alphabetical and a numeric character. Note: The profile method is the preferred method for setting password policy since - setglobalpolicy in pwpolicy is deprecated and will likely be removed in a future macOS release.' + compliance: + - cis: ["5.2.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:pwpolicy -getaccountpolicies -> r:Contain at least one number and one alphabetic character." + - 'c:sh -c "pwpolicy -getaccountpolicies | grep -A1 minimumNumericCharacters " -> n:>(\d+)< compare >= 1' + + # 5.2.5 Ensure Complex Password Must Contain Special Character Is Configured. (Manual) - Not Implemented + + # 5.2.6 Ensure Complex Password Must Contain Uppercase and Lowercase Characters Is Configured. (Manual) + - id: 34052 + title: "Ensure Complex Password Must Contain Uppercase and Lowercase Characters Is Configured." + description: "Complex passwords contain one character from each of the following classes: English uppercase letters, English lowercase letters, Westernized Arabic numerals, and non-alphanumeric characters. Ensure that both uppercase and lowercase letters are part of the password policy on the computer." + rationale: "The more complex a password, the more resistant it will be against persons seeking unauthorized access to a system." + impact: "Password policy should be in effect to reduce the risk of exposed services being compromised easily through dictionary attacks or other social engineering attempts." + remediation: 'Terminal Method: Run the following command to set passwords to require at upper and lower case letter: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "requiresMixedCase=1>" example: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "requiresMixedCase=1".' + compliance: + - cis: ["5.2.6"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:sh -c "pwpolicy -getaccountpolicies | grep -A1 minimumMixedCaseCharacters " -> n:>(\d+)< compare >= 1' + + # 5.2.7 Ensure Password Age Is Configured. (Automated) + - id: 34053 + title: "Ensure Password Age Is Configured." + description: "Over time, passwords can be captured by third parties through mistakes, phishing attacks, third-party breaches, or merely brute-force attacks. To reduce the risk of exposure and to decrease the incentives of password reuse (passwords that are not forced to be changed periodically generally are not ever changed), users should reset passwords periodically. This control uses 365 days as the acceptable value. Some organizations may be more or less restrictive. This control mainly exists to mitigate against password reuse of the macOS account password in other realms that may be more prone to compromise. Attackers take advantage of exposed information to attack other accounts." + rationale: "Passwords should be changed periodically to reduce exposure." + impact: "Required password changes will lead to some locked computers requiring admin assistance." + remediation: 'Terminal Method: Run the following command to require that passwords expire after at most 365 days: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "maxMinutesUntilChangePassword=" example: $ /usr/bin/sudo /usr/bin/pwpolicy -n /Local/Default -setglobalpolicy "maxMinutesUntilChangePassword=43200" Profile Method: Create or edit a configuration profile with the following information: 1. The PayloadType string is com.apple.mobiledevice.passwordpolicy 2. The key to include is maxPINAgeInDays 3. The key must be set to 365> Note: The profile method is the preferred method for setting password policy since - setglobalpolicy in pwpolicy is deprecated and will likely be removed in a future macOS release.' + compliance: + - cis: ["5.2.7"] + - cis_csc_v8: ["5.3"] + - cis_csc_v7: ["16.9"] + - cmmc_v2.0: ["IA.L2-3.5.6"] + - nist_sp_800-53: ["AC-2(3)"] + - pci_dss_v3.2.1: ["8.1.4"] + - pci_dss_v4.0: ["8.3.7"] + condition: all + rules: + - 'c:pwpolicy -n /Local/Default -getglobalpolicy -> n:maxMinutesUntilChangePassword=(\d+) compare <= 525601' + + # 5.2.8 Ensure Password History Is Configured. (Automated) - Not Implemented + # 5.3.1 Ensure all user storage APFS volumes are encrypted. (Manual) - Not Implemented + # 5.3.2 Ensure all user storage CoreStorage volumes are encrypted. (Manual) - Not Implemented + + # 5.4 Ensure the Sudo Timeout Period Is Set to Zero. (Automated) + - id: 34054 + title: "Ensure the Sudo Timeout Period Is Set to Zero." + description: "The sudo command allows the user to run programs as the root user. Working as the root user allows the user an extremely high level of configurability within the system. This control, along with the control to use a separate timestamp for each tty, limits the window where an unauthorized user, process, or attacker could utilize legitimate credentials that are valid for longer than required." + rationale: "The sudo command stays logged in as the root user for five minutes before timing out and re-requesting a password. This five-minute window should be eliminated since it leaves the system extremely vulnerable. This is especially true if an exploit were to gain access to the system, since they would be able to make changes as a root user." + impact: "This control has a serious impact where users often have to use sudo. It is even more of an impact where users have to use sudo multiple times in quick succession as part of normal work processes. Organizations with that common use case will likely find this control too onerous and are better to accept the risk of not requiring a 0 grace period. In some ways the use of sudo -s, which is undesirable, is better than a long grace period since that use does change the hash to show that it is a root shell rather than a normal shell where sudo commands will be implemented without a password." + remediation: "Terminal Method: Run the following command to edit the sudo settings: $ /usr/bin/sudo /usr/sbin/visudo -f /etc/sudoers.d/ example: $ /usr/bin/sudo /usr/sbin/visudo -f /etc/sudoers.d/10_cissudoconfiguration Note: Unlike other Unix and/or Linux distros, macOS will ignore configuration files in the sudoers.d folder that contain a . so do not add a file extension to the configuration file. Add the line Defaults timestamp_timeout=0 to the configuration file. If /etc/sudoers.d/ is not owned by root or in the wheel group, run the following to change ownership and group: $ /usr/bin/sudo /usr/sbin/chown -R root:wheel /etc/security/sudoers.d/." + compliance: + - cis: ["5.4"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - "c:sudo -V -> r:Authentication timestamp timeout: 0.0 minutes" + - "c:stat /etc/sudoers.d -> r:root wheel" + + # 5.5 Ensure a Separate Timestamp Is Enabled for Each User/tty Combo. (Automated) + - id: 34055 + title: "Ensure a Separate Timestamp Is Enabled for Each User/tty Combo." + description: "Using tty tickets ensures that a user must enter the sudo password in each Terminal session. With sudo versions 1.8 and higher, introduced in 10.12, the default value is to have tty tickets for each interface so that root access is limited to a specific terminal. The default configuration can be overwritten or not configured correctly on earlier versions of macOS." + rationale: "In combination with removing the sudo timeout grace period, a further mitigation should be in place to reduce the possibility of a background process using elevated rights when a user elevates to root in an explicit context or tty. Additional mitigation should be in place to reduce the risk of privilege escalation of background processes." + impact: "This control should have no user impact. Developers or installers may have issues if background processes are spawned with different interfaces than where sudo was executed." + remediation: "Terminal Method: Run the following command to edit the sudo settings: $ /usr/bin/sudo /usr/sbin/visudo -f /etc/sudoers.d/ example: $ /usr/bin/sudo /usr/sbin/visudo -f /etc/sudoers.d/10_cissudoconfiguration Note: Unlike other Unix and/or Linux distros, macOS will ignore configuration files in the sudoers.d folder that contain a . so do not add a file extension to the configuration file. Add the line Defaults timestamp_type=tty to the configuration file. Note: The Defaults timestamp_type=tty line can be added to an existing configuration file or a new one. That will depend on your organization's preference and works either way." + references: + - "https://github.com/jorangreef/sudo-prompt/issues/33" + compliance: + - cis: ["5.5"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - "c:sudo -V -> r:Type of authentication timestamp record: tty" + + # 5.6 Ensure the "root" Account Is Disabled. (Automated) + - id: 34056 + title: "Ensure the 'root' Account Is Disabled." + description: "The root account is a superuser account that has access privileges to perform any actions and read/write to any file on the computer. With some versions of Linux, the system administrator may commonly use the root account to perform administrative functions." + rationale: "Enabling and using the root account puts the system at risk since any successful exploit or mistake while the root account is in use could have unlimited access privileges within the system. Using the sudo command allows users to perform functions as a root user while limiting and password protecting the access privileges. By default the root account is not enabled on a macOS computer. An administrator can escalate privileges using the sudo command (use -s or -i to get a root shell)." + impact: "Some legacy POSIX software might expect an available root account." + remediation: "Graphical Method: Perform the following steps to ensure that the root user is disabled: 1. Open /System/Library/CoreServices/Applications/Directory Utility 2. Click the lock icon to unlock the service 3. Click Edit in the menu bar 4. Click Disable Root User Terminal Method: Run the following command to disable the root user: $ /usr/bin/sudo /usr/sbin/dsenableroot -d username = root user password:." + compliance: + - cis: ["5.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - "c:dscl . -read /Users/root AuthenticationAuthority -> r:^No such key: AuthenticationAuthority" + + # 5.7 Ensure an Administrator Account Cannot Login to Another User's Active and Locked Session. (Automated) + - id: 34057 + title: "Ensure an Administrator Account Cannot Login to Another User's Active and Locked Session." + description: "macOS has a privilege that can be granted to any user that will allow that user to unlock active user's sessions." + rationale: "Disabling the administrator's and/or user's ability to log into another user's active and locked session prevents unauthorized persons from viewing potentially sensitive and/or personal information." + impact: "While Fast user switching is a workaround for some lab environments, especially where there is even less of an expectation of privacy, this setting change may impact some maintenance workflows." + remediation: "Terminal Method: Run the following command to disable a user logging into another user's active and/or locked session: $ /usr/bin/sudo /usr/bin/security authorizationdb write system.login.screensaver use-login-window-ui YES (0)." + references: + - "https://derflounder.wordpress.com/2014/02/16/managing-the-authorization-database-in-os-x-mavericks/" + - "https://www.jamf.com/jamf-nation/discussions/18195/system-login-screensaver" + compliance: + - cis: ["5.7"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - "c:security authorizationdb read system.login.screensaver -> r:use-login-window-ui" + + # 5.8 Ensure a Login Window Banner Exists. (Automated) + - id: 34058 + title: "Ensure a Login Window Banner Exists." + description: "A Login window banner warning informs the user that the system is reserved for authorized use only. It enforces an acknowledgment by the user that they have been informed of the use policy in the banner if required. The system recognizes either the .txt and the .rtf formats." + rationale: "An access warning may reduce a casual attacker's tendency to target the system. Access warnings may also aid in the prosecution of an attacker by evincing the attacker's knowledge of the system's private status, acceptable use policy, and authorization requirements." + impact: "Users will have to click on the window with the Login text before logging into the computer." + remediation: "Terminal Method: Run the following commands to create or edit the login window text and set the proper permissions: Edit (or create) a PolicyBanner.txt or PolicyBanner.rtf file, in the /Library/Security/ folder, to include the required login window banner text. Perform the following to set permissions on the policy banner file: $ /usr/bin/sudo /usr/sbin/chown o+r /Library/Security/PolicyBanner.txt $ /usr/bin/sudo /usr/sbin/chown o+r /Library/Security/PolicyBanner.rtf Note: If your organization uses an .rtfd file to set the policy banner, run $ /usr/bin/sudo /usr/sbin/chown -R o+rx /Library/Security/PolicyBanner.rtfd to update the permissions." + references: + - "https://support.apple.com/en-au/HT202277" + compliance: + - cis: ["5.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "d:/Library/Security -> r:^PolicyBanner" + - 'c:stat -f %A /Library/Security/PolicyBanner.* -> r:\d\d4' + + # 5.9 Ensure the Guest Home Folder Does Not Exist. (Automated) + - id: 34059 + title: "Ensure the Guest Home Folder Does Not Exist." + description: "In the previous two controls, the guest account login has been disabled and sharing to guests has been disabled, as well. There is no need for the legacy Guest home folder to remain in the file system. When normal user accounts are removed, you have the option to archive it, leave it in place, or delete. In the case of the guest folder, the folder remains in place without a GUI option to remove it. If at some point in the future a Guest account is needed, it will be re-created. The presence of the Guest home folder can cause automated audits to fail when looking for compliant settings within all User folders, as well. Rather than ignoring the folder's continued existence, it is best removed." + rationale: "The Guest home folders are unneeded after the Guest account is disabled and could be used inappropriately." + impact: "The Guest account should not be necessary after it is disabled, and it will be automatically re-created if the Guest account is re-enabled." + remediation: "Terminal Method: Run the following command to remove the Guest user home folder: $ /usr/bin/sudo /bin/rm -R /Users/Guest." + compliance: + - cis: ["5.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "not d:/Users/Guest" + + # 5.10 Ensure XProtect Is Running and Updated. (Automated) + - id: 34060 + title: "Ensure XProtect Is Running and Updated." + description: "XProtect is Apple's native signature-based antivirus technology. XProtect both finds and blocks the execution of known malware. There are many AV and Endpoint Threat Detection and Response (ETDR) tools available for Mac OS. The native Apple provisioned tool looks for specific known malware is completely integrated into the OS. No matter what other tools are being used XProtect should have the latest signatures available." + rationale: "Apple creates signatures for known malware that actually effects Macs and that knowledge should be leveraged." + impact: "Some organizations may have effective Mac OS anti-malware tools that XProtect conflicts with." + remediation: "Terminal Method: Run the following command to enable and update XProtect: $ sudo /bin/launchctl load -w /Library/Apple/System/Library/LaunchDaemons/com.apple.XProtect.daemon.scan.pl ist $ sudo /bin/launchctl load -w /Library/Apple/System/Library/LaunchDaemons/com.apple.XprotectFramework.Plugi nService.plist $ sudo /usr/sbin/softwareupdate -l --background-critical softwareupdate[97180]: Triggering a background check with forced scan (critical and config-data updates only) ... Note: Xprotect can only be enabled/disabled if SIP (System Integrity Protection) is disabled. If Xprotect is disabled, the system might be compromised and needs to be investigated." + references: + - "https://eclecticlight.co/2021/10/27/silently-updated-security-data-files-in-monterey/" + - "https://eclecticlight.co/2020/12/14/silently-updated-security-data-files-in-big-sur/" + - "https://eclecticlight.co/2019/10/17/security-data-files-how-theyve-changed-in-catalina/" + - "https://eclecticlight.co/2022/05/12/apple-has-pushed-an-update-to-xprotect-21/" + - "https://support.apple.com/guide/security/protecting-against-malware-sec469d47bd8/web" + - "https://eclecticlight.co/2023/06/12/malware-detection-and-remediation-by-xprotect-remediator/" + compliance: + - cis: ["5.10"] + - cis_csc_v8: ["10.1", "10.2", "10.5"] + - cis_csc_v7: ["8.2", "8.4"] + - cmmc_v2.0: ["SI.L1-3.14.2", "SI.L1-3.14.4"] + - hipaa: ["164.308(a)(5)(ii)(B)"] + - iso_27001-2013: ["A.12.2.1"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4", "11.4", "5.1", "5.1.1", "5.2"] + - pci_dss_v4.0: ["5.1.1", "5.2.1", "5.2.2", "5.3.1", "5.3.2"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'c:sh -c "launchctl list | grep -c com.apple.XProtect.daemon.scan" -> r:^1$' + - 'c:sh -c "launchctl list | grep -c com.apple.XProtect.daemon.scan.startup" -> r:^1$' + + # 6.1.1 Ensure Show All Filename Extensions Setting is Enabled. (Automated) - Not Implemented + # 6.2.1 Ensure Protect Mail Activity in Mail Is Enabled. (Manual) - Not Implemented + # 6.3.1 Ensure Automatic Opening of Safe Files in Safari Is Disabled. (Automated) - Not Implemented + # 6.3.2 Audit History and Remove History Items. (Manual) - Not Implemented + # 6.3.3 Ensure Warn When Visiting A Fraudulent Website in Safari Is Enabled. (Automated) + # 6.3.4 Ensure Prevent Cross-site Tracking in Safari Is Enabled. (Automated) - Not Implemented + # 6.3.5 Audit Hide IP Address in Safari Setting. (Manual) - Not Implemented + # 6.3.6 Ensure Advertising Privacy Protection in Safari Is Enabled. (Automated) - Not Implemented + # 6.3.7 Ensure Show Full Website Address in Safari Is Enabled. (Automated) - Not Implemented + # 6.3.8 Audit Autofill. (Manual) - Not Implemented + # 6.3.9 Ensure Pop-up Windows Are Blocked. (Automated) - Not Implemented + # 6.3.10 Ensure Javascript Is Enabled. (Manual) - Not Implemented + # 6.3.11 Ensure Show Status Bar Is Enabled. (Automated) - Not Implemented + # 6.4.1 Ensure Secure Keyboard Entry Terminal.app Is Enabled. (Automated) - Not Implemented diff --git a/etc/ruleset/sca/debian/cis_debian10.yml b/etc/ruleset/sca/debian/cis_debian10.yml new file mode 100644 index 0000000000..6d3e3473ab --- /dev/null +++ b/etc/ruleset/sca/debian/cis_debian10.yml @@ -0,0 +1,3397 @@ +# Security Configuration Assessment +# CIS Checks for Debian Linux 10 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Debian Linux 10 Benchmark v1.0.0 - 02-13-2020 + +policy: + id: "cis_debian10" + file: "cis_debian10.yml" + name: "CIS Debian Linux 10 Benchmark v1.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 10." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Debian version" + description: "Requirements for running the SCA scan against Debian/Ubuntu." + condition: all + rules: + - "f:/etc/debian_version" + - "f:/proc/sys/kernel/ostype -> Linux" + +checks: + ############################################################ + # 1 Initial Setup + ############################################################ + + # 1.1 Filesystem configuration + - id: 2500 + title: "Ensure mounting of freevxfs filesystems is disabled" + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/freevxfs.conf and add the following line: install freevxfs /bin/true Run the following command to unload the freevxfs module: # rmmod freevxfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:/sbin/modprobe -n -v freevxfs -> r:^install /bin/true" + - "not c:lsmod -> r:freevxfs" + + - id: 2501 + title: "Ensure mounting of jffs2 filesystems is disabled" + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/jffs2.conf and add the following line: install jffs2 /bin/true Run the following command to unload the jffs2 module: # rmmod jffs2" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:/sbin/modprobe -n -v jffs2 -> r:^install /bin/true" + - "not c:lsmod -> r:jffs2" + + - id: 2502 + title: "Ensure mounting of hfs filesystems is disabled" + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/hfs.conf and add the following line: install hfs /bin/true Run the following command to unload the hfs module: # rmmod hfs" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:/sbin/modprobe -n -v hfs -> r:^install /bin/true" + - "not c:lsmod -> r:hfs" + + - id: 2503 + title: "Ensure mounting of hfsplus filesystems is disabled" + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .confExample: vi /etc/modprobe.d/hfsplus.conf and add the following line: install hfsplus /bin/true Run the following command to unload the hfsplus module: # rmmod hfsplus" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:/sbin/modprobe -n -v hfsplus -> r:^install /bin/true" + - "not c:lsmod -> r:hfsplus" + + - id: 2504 + title: "Ensure mounting of squashfs filesystems is disabled" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/squashfs.confand add the following line: install squashfs /bin/true Run the following command to unload the squashfsmodule: # rmmod squashfs" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + + - id: 2505 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/udf.conf and add the following line: install udf /bin/true Run the following command to unload the udf module: # rmmod udf" + compliance: + - cis: ["1.1.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:/sbin/modprobe -n -v udf -> r:^install /bin/true" + - "not c:lsmod -> r:udf" + + - id: 2506 + title: "Ensure mounting of FAT filesystems is disabled" + description: "The FAT filesystem format is primarily used on older windows systems and portable USB drives or flash modules. It comes in three types FAT12 , FAT16 , and FAT32 all of which are supported by the vfat kernel module." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/vfat.conf: install vfat /bin/true. Run the following command to unload the vfat module: rmmod vfat" + compliance: + - cis: ["1.1.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v vfat -> r:install /bin/true|Module vfat not found" + - "not c:lsmod -> r:vfat" + + # 1.1.x Filesystem Configuration + - id: 2507 + title: "Ensure /tmp is configured" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + remediation: "Configure /etc/fstab as appropriate. Example: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 or Run the following commands to enable systemd /tmp mounting: systemctl unmask tmp.mount systemctl enable tmp.mount Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount: [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,noexec,nodev,nosuid" + compliance: + - cis: ["1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + - id: 2508 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nodev /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodevto the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp: # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + - id: 2509 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nosuid /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuidto the /tmp mount options:[Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp:# mount -o remount,nosuid /tmp" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + - id: 2510 + title: "Ensure noexec option set on /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit the /etc/fstab file and add noexecto the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,noexec /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexecto the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp: # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + - id: 2511 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + - id: 2512 + title: "Ensure separate partition exists for /var/tmp" + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + - id: 2513 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,nodev /var/tmp" + compliance: + - cis: ["1.1.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + + - id: 2514 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" + compliance: + - cis: ["1.1.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + - id: 2515 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" + compliance: + - cis: ["1.1.10"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + - id: 2516 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + - id: 2517 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + - id: 2518 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + - id: 2519 + title: "Ensure nodev option set on /home partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. See the fstab(5) manual page for more information. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + - id: 2520 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.15"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://manpages.debian.org/buster/initscripts/tmpfs.5.en.html + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + - id: 2521 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.16"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + - id: 2522 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.17"] + - cis_csc: ["2.6", "8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + - id: 2523 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run one of the following commands: Run the following command to disable autofs: # systemctl --now disable autofs OR Run the following command to remove autofs: # apt purge autofs" + compliance: + - cis: ["1.1.22"] + - cis_csc: ["8.4", "8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled autofs -> enabled" + + - id: 2524 + title: "Disable USB Storage" + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/usb_storage.conf and add the following line: # install usb-storage /bin/true . Run the following command to unload the usb-storage module: # rmmod usb-storage" + compliance: + - cis: ["1.1.23"] + - cis_csc: ["8.4", "8.5"] + - pci_dss: ["2.2.5"] + - nist_800_53: ["CM.1"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:/sbin/modprobe -n -v usb-storage -> r:install /bin/true" + - "not c:lsmod -> r:usb-storage" + + # 1.3 Configure Sudo + + - id: 2525 + title: "Ensure sudo is installed" + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Install sudo using the following command. # apt install sudo OR # apt install sudo-ldap" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["4.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://www.sudo.ws/ + condition: any + rules: + - "c:dpkg -s sudo -> r:install ok installed" + - "c:dpkg -s sudo-ldap -> r:install ok installed" + + - id: 2526 + title: "Ensure sudo commands use pty" + description: "sudo can be configured to run only froma pseudo-pty" + rationale: "Attackers can run a malicious program using sudo, which would again fork a background process that remains even when the main program has finished executing." + remediation: "edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty" + compliance: + - cis: ["1.3.2"] + - cis_csc: ["4.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*use_pty' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*use_pty' + + - id: 2527 + title: "Ensure sudo log file exists" + description: "sudo can use a custom log file" + rationale: "A sudo log file simplifies auditing of sudo commands" + remediation: 'edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults logfile="" Example Defaults logfile="/var/log/sudo.log"' + compliance: + - cis: ["1.3.3"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*logfile=' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*logfile=' + + # 1.4 Filesystem Integrity Checking + - id: 2528 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Install AIDE: # apt install aide aide-common. Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: # aideinit . Notes: The prelinking feature can interfere with AIDE because it alters binaries to speed up their start up times. Run prelink -ua to restore the binaries to their prelinked state, thus avoiding false positives from AIDE." + compliance: + - cis: ["1.4.1"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:dpkg -s aide -> r:install ok installed" + + - id: 2529 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check, run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/bin/aide.wrapper --config /etc/aide/aide.conf --check" + compliance: + - cis: ["1.4.2"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: + - https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service + - https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer + condition: all + rules: + - 'c:grep -Rh aide /etc/cron.d /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly /etc/crontab -> r:\.+' + - "c:crontab -u root -l -> r:aide" + + # 1.5 Secure Boot Settings + - id: 2530 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually grub.cfg stored in /boot/grub." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: chown root:root /boot/grub/grub.cfg, chmod og-rwx /boot/grub/grub.cfg" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /boot/grub/grub.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2531 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: 'Create an encrypted password with grub-mkpasswd-pbkdf2 : # grub-mkpasswd-pbkdf2 Enter password: Reenter password: PBKDF2 hash of your password is Add the following into a custom /etc/grub.d configuration file: cat < EOF The superuser/user information and password should not be contained in the /etc/grub.d/00_header file as this file could be overwritten in a package update. If there is a requirement to be able to boot/reboot without entering the password, edit /etc/grub.d/10_linux and add --unrestricted to the line CLASS= Example: CLASS="--class gnu-linux --class gnu --class os --unrestricted" Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["1.5.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + - id: 2532 + title: "Ensure authentication required for single user mode" + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/shadow -> r:^root:*:|^root:!:" + + # 1.6 Additional Process Hardening + + - id: 2533 + title: "Ensure XD/NX support is enabled" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.6.1"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sh -c "journalctl | grep \"protection: active\"" -> r:NX \(Execute Disable\) protection: active' + + - id: 2534 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.6.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:\s*\t*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' + + - id: 2535 + title: "Ensure prelink is disabled" + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following command to restore binaries to normal: # prelink -ua Uninstall prelink using the appropriate package manager or manual installation: # apt purge prelink" + compliance: + - cis: ["1.6.3"] + - cis_csc: ["14.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s prelink -> r:install ok installed" + + - id: 2536 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.6.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl fs.suid_dumpable -> r:=\s*\t*0$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> !r:^# && r:=\s*\t*0$' + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + + # 1.7 Mandatory Access Control + + - id: 2537 + title: "Ensure AppArmor is installed" + description: "AppArmor provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Install Apparmor. # apt install apparmor # apt install apparmor-utils" + compliance: + - cis: ["1.7.1.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - "c:dpkg -s apparmor-utils -> r:install ok installed" + - "c:dpkg -s apparmor -> r:install ok installed" + + - id: 2538 + title: "Ensure AppArmor is enabled in the bootloader configuration" + description: "Configure AppArmor to be enabled at boot time and verify that it has not been overwrittenby the bootloader boot parameters." + rationale: "AppArmor must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/grub and add the apparmor=1 and security=apparmor parameters to the GRUB_CMDLINE_LINUX= line GRUB_CMDLINE_LINUX="apparmor=1 security=apparmor" Run the following command to update the grub2 configuration # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings.' + compliance: + - cis: ["1.7.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*linux && !r:apparmor=1' + - 'f:/boot/grub/grub.cfg -> r:^\s*linux && !r:security=apparmor' + + - id: 2539 + title: "Ensure all AppArmor Profiles are in enforce or complain mode" + description: "AppArmor profiles define what resources applicatons are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* OR Run the following command to set all profiles to complain mode: # aa-complain /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.7.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:apparmor_status -> r:0 processes are unconfined" + + - id: 2540 + title: "Ensure all AppArmor Profiles are enforcing" + description: "AppArmor profiles define what resources applicatons are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:apparmor_status -> n:^(\d+)\s*profiles are loaded compare > 0' + - 'c:apparmor_status -> r:^0\s*profiles are in complain mode' + - 'c:apparmor_status -> r:^0\s*processes are unconfined' + + # 1.8 Warning Banners + - id: 2541 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd" + compliance: + - cis: ["1.8.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not f:/etc/motd -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + - "not f:/etc/motd" + + - id: 2542 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v , or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.8.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + - id: 2543 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v or references to the OS platform: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.8.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + - id: 2544 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd" + compliance: + - cis: ["1.8.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2545 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue" + compliance: + - cis: ["1.8.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2546 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net" + compliance: + - cis: ["1.8.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2547 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add: [org/gnome/login-screen], banner-message-enable=true, banner-message-text='Authorized uses only. All activity may be monitored and reported.'" + compliance: + - cis: ["1.8.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/gdm3/greeter.dconf-defaults -> r:^[org/gnome/login-screen]" + - "f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-enable=true" + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-text=\.+' + + - id: 2548 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. Notes: Site policy may mandate a testing period before install onto production systems for available updates." + compliance: + - cis: ["1.9"] + - cis_csc: ["3.4", "3.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6", "SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: none + rules: + - "c:apt -s upgrade -> r:^The following packages will be upgraded" + + ############################################################ + # 2 Services + ############################################################ + + - id: 2549 + title: "Ensure xinetd is not installed" + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetddaemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed." + remediation: "Run the following command to remove xinetd: # apt purge xinetd" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s xinetd -> r:install ok installed" + + - id: 2550 + title: "Ensure openbsd-inetd is not installed" + description: "The inetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no inetd services required, it is recommended that the daemon be removed." + remediation: "Run the following command to uninstall openbsd-inetd: apt purge openbsd-inetd" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s openbsd-inetd -> r:install ok installed" + + - id: 2551 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: 'On systems where host based time synchronization is not available, configure systemd-timesyncd. If "full featured" and/or encrypted time synchronization is required, install chrony or NTP. To install chrony: # apt install chrony To install ntp: # apt install ntp On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization.' + compliance: + - cis: ["2.2.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "c:dpkg -s ntp -> r:install ok installed" + - "c:dpkg -s chrony -> r:install ok installed" + - "c:systemctl is-enabled systemd-timesyncd -> enabled" + + - id: 2552 + title: "Ensure systemd-timesyncd is configured" + description: 'systemd-timesyncd is a daemon that has been added for synchronizing the system clock across the network. It implements an SNTP client. In contrast to NTP implementations such as chrony or the NTP reference server this only implements a client side, and does not bother with the full NTP complexity, focusing only on querying time from one remote server and synchronizing the local clock to it. The daemon runs with minimal privileges, and has been hooked up with networkd to only operate when network connectivity is available. The daemon saves the current clock to disk every time a new NTP sync has been acquired, and uses this to possibly correct the system clock early at bootup, in order to accommodate for systems that lack an RTC such as the Raspberry Pi and embedded devices, and make sure that time monotonically progresses on these systems, even if it is not always correct. To make use of this daemon a new system user and group "systemd- timesync" needs to be created on installation of systemd. Note: The systemd-timesyncd service specifically implements only SNTP. This minimalistic service will set the system clock for large offsets or slowly adjust it for smaller deltas. More complex use cases are not covered by systemd-timesyncd. This recommendation only applies if timesyncd is in use on the system.' + rationale: "Proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if timesyncd is in use on the system." + remediation: "Run the following command to enable systemd-timesyncd # systemctl enable systemd-timesyncd.service || Edit the file /etc/systemd/timesyncd.conf and add/modify the following lines: NTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org FallbackNTP=2.debian.pool.ntp.org 3.debian.pool.ntp.org RootDistanceMax=1 || Run the following commands to start systemd-timesyncd.service # systemctl start systemd-timesyncd.service # timedatectl set-ntp true || Notes: Servers listed and RootDistanceMax should be In Accordance With Local Policy some versions of systemd have been compiled without systemd-timesycnd. On these distributions, chrony or NTP should be used instead of systemd-timesycnd. Not all options are available on all versions of systemd-timesyncd" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-timesyncd.service -> enabled" + + - id: 2553 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system." + remediation: "Add or edit server or pool lines to /etc/chrony/chrony.conf as appropriate: server Configure chrony to run as the chrony user by configuring the appropriate startup script for your distribution. Startup scripts are typically stored in /etc/init.d or /etc/systemd ." + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony/chrony.conf -> r:^server\.+|^pool\.+' + + - id: 2554 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file: RUNASUSER=ntp" + compliance: + - cis: ["2.2.1.4"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://www.ntp.org/ + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/init.d/ntp -> r:^RUNASUSER\s*\t*=\s*\t*ntp' + + # 2.2.2 Ensure the X Window system is not installed (Scored) + - id: 2555 + title: "Ensure the X Window system is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Remove the X Windows System packages: apt purge xserver-xorg*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:dpkg -l xserver-xorg-core* -> r:^\wi\s*xserver-xorg' + + - id: 2556 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attach surface." + remediation: "Run the following command to disable avahi-daemon: # systemctl --now disable avahi-daemon" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled avahi-daemon -> enabled" + + - id: 2557 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups: # systemctl --now disable cups" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.cups.org + condition: none + rules: + - "c:systemctl is-enabled cups -> enabled" + + - id: 2558 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following commands to disable dhcpd: # systemctl --now disable isc-dhcp-server # systemctl --now disable isc-dhcp-server6" + references: + - https://www.isc.org/dhcp/ + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled isc-dhcp-server -> enabled" + - "c:systemctl is-enabled isc-dhcp-server6 -> enabled" + + - id: 2559 + title: "Ensure LDAP server is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # systemctl --now disable slapd" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.openldap.org + condition: none + rules: + - "c:systemctl is-enabled slapd -> enabled" + + - id: 2560 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs and rpcbind: # systemctl --now disable nfs-server # systemctl --now disable rpcbind" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled nfs-server -> enabled" + - "c:systemctl is-enabled rpcbind -> enabled" + + - id: 2561 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable named: # systemctl --now disable bind9" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled bind9 -> enabled" + + - id: 2562 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # systemctl --now disable vsftpd" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled vsftpd -> enabled" + + - id: 2563 + title: "Ensure HTTP Server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable apache2: # systemctl --now disable apache2" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled apache2 -> enabled" + + - id: 2564 + title: "Ensure email services are not enabled" + description: "dovecot is an open source mail submission and transport server for Linux based systems." + rationale: "Unless mail transport services are to be provided by this system, it is recommended that the service be disabled or deleted to reduce the potential attack surface." + remediation: "Run one of the following commands to disable dovecot : # systemctl --now disable dovecot" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled dovecot -> enabled" + + - id: 2565 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable smbd: # systemctl --now disable smbd" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled smbd -> enabled" + + - id: 2566 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # systemctl --now disable squid" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled squid -> enabled" + + - id: 2567 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # systemctl --now disable snmpd" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled snmpd -> enabled" + + - id: 2568 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Edit /etc/exim4/update-exim4.conf.conf and and or modify following lines to look like the lines below: dc_eximconfig_configtype='local' dc_local_interfaces='127.0.0.1 ; ::1' dc_readhost='' dc_relay_domains='' dc_minimaldns='false' dc_relay_nets='' dc_smarthost='' dc_use_split_config='false' dc_hide_mailname='' dc_mailname_in_oh='true' dc_localdelivery='mail_spool' Restart exim4: # systemctl restart exim4" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - tsc: ["CC5.2", "CC6.4", "CC6.6", "CC6.7"] + condition: none + rules: + - 'c:ss -lntu -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.*LISTEN' + + - id: 2569 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # systemctl --now disable rsync" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled rsync -> enabled" + + - id: 2570 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable nis: # systemctl --now disable nis" + compliance: + - cis: ["2.2.17"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled nis -> enabled" + + - id: 2571 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Uninstall nis : apt purge nis" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s nis -> r:install ok installed" + + - id: 2572 + title: "Ensure rsh client is not installed" + description: "The rsh-client package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin ." + remediation: "Uninstall rsh : apt purge rsh-client" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s rsh-client -> r:install ok installed" + + - id: 2573 + title: "Ensure talk client is not installed" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talkclient, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Uninstall talk : apt purge talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s talk -> r:install ok installed" + + - id: 2574 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Uninstall telnet : # apt purge telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s telnet -> r:install ok installed" + + - id: 2575 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Uninstall ldap-utils : # apt purge ldap-utils" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s ldap-utils -> r:install ok installed" + + ############################################################ + # 3 Network Configuration + ############################################################ + ############################################################ + # 3.1 Disable unused network protocols and devices + ############################################################ + + # 3.1.1 Disable IPv6 (Not Scored) + - id: 2576 + title: "Disable IPv6" + description: "Although IPv6 has many advantages over IPv4, not all organizations have IPv6 or dual stack configurations implemented." + rationale: "If IPv6 or dual stack is not to be used, it is recommended that IPv6 be disabled to reduce the attack surface of the system." + remediation: 'Edit /etc/default/grub and add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX="ipv6.disable=1" Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["3.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.6", "CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:ipv6.disable=1' + + # 3.1.2 Ensure wireless interfaces are disabled (Scored) + - id: 2577 + title: "Ensure wireless interfaces are disabled" + description: "Wireless networking is used when wired networks are unavailable. Debian contains a wireless tool kit to allow system administrators to configure and use wireless networks." + rationale: "If wireless is not to be used, wireless devices can be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable any wireless interfaces: # nmcli radio all off" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["15.4", "15.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.6"] + references: + - nmcli(1) - Linux man page + condition: all + rules: + - "c:nmcli radio wifi -> r:^disabled" + - "c:nmcli radio wwan -> r:^disabled" + ########################################################## + # 3.2 Network Parameters + ########################################################## + # 3.2.1 Ensure packet redirect sending is disabled + - id: 2578 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + # 3.2.2 Ensure IP forwarding is disabled + - id: 2579 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not." + rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Run the following command to restore the default parameter and set the active kernel parameter: # grep -Els \"^\\s*net\\.ipv4\\.ip_forward\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv4\\.ip_forward\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv4.ip_forward=0; sysctl -w net.ipv4.route.flush=1 IF IPv6 is enabled: Run the following command to restore the default parameter and set the active kernel parameter: # grep -Els \"^\\s*net\\.ipv6\\.conf\\.all\\.forwarding\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv6\\.conf\\.all\\.forwarding\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv6.conf.all.forwarding=0; sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.forwarding /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' + + ############################################################# + # 3.3 Network Parameters + ############################################################# + # 3.3.1 Ensure source routed packets are not accepted + - id: 2580 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1 IF IPv6 is enabled: Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_source_route=0 # sysctl -w net.ipv6.conf.default.accept_source_route=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0$' + + # 3.3.2 Ensure ICMP redirects are not accepted + - id: 2581 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1 IF IPv6 is enabled: Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + + # 3.3.3 Ensure secure ICMP redirects are not accepted + - id: 2582 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + # 3.3.4 Ensure suspicious packets are logged (Scored) + - id: 2583 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.4"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + # 3.3.5 Ensure broadcast ICMP requests are ignored + - id: 2584 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + # 3.3.6 Ensure bogus ICMP responses are ignored (Scored) + - id: 2585 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + # 3.3.7 Ensure Reverse Path Filtering is enabled (Scored) + - id: 2586 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + # 3.3.8 Ensure TCP SYN Cookies is enabled (Scored) + - id: 2587 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.3.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + # 3.3.9 Ensure IPv6 router advertisements are not accepted (Scored) + - id: 2588 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the systems ability to accept router advertisements" + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + + ##################################################################### + # 3.4 Uncommon Network Protocols + ##################################################################### + # 3.4.1 Ensure DCCP is disabled (Scored) + - id: 2589 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in- sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/dccp.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v dccp -> r:install /bin/true" + - "c:lsmod -> r:dccp" + + # 3.4.2 Ensure SCTP is disabled (Scored) + - id: 2590 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/sctp.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.4.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v sctp -> r:install /bin/true" + - "c:lsmod -> r:sctp" + + # 3.4.3 Ensure RDS is disabled (Scored) + - id: 2591 + title: "Ensure RDS is disabled" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/rds.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v rds -> r:install /bin/true" + - "c:lsmod -> r:rds" + + # 3.4.4 Ensure TIPC is disabled (Scored) + - id: 2592 + title: "Ensure TIPC is disabled" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/tipc.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v tipc -> r:install /bin/true" + - "c:lsmod -> r:tipc" + + ################################################################# + # 3.5 Firewall configuration + ################################################################# + ################################################################# + # 3.5.1 Ensure Firewall software is installed + ################################################################# + # 3.5.1.1 Ensure a Firewall package is installed (Scored) + - id: 2593 + title: "Ensure a Firewall package is installed" + description: "A Firewall package should be selected. Most firewall configuration utilities operate as a front end to nftables or iptables." + rationale: "A Firewall package is required for firewall management and configuration." + remediation: "Run one of the following commands to install the Firewall package that follows local site policy: To install UFW , run the following command: # apt install ufw To install nftables , run the following command: # apt install nftables To install iptables , run the following command: # apt install iptables" + compliance: + - cis: ["3.5.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC6.6"] + condition: any + rules: + - "c:dpkg -s ufw -> r:Status: install ok installed" + - "c:dpkg -s nftables -> r:Status: install ok installed" + - "c:dpkg -s iptables -> r:Status: install ok installed" + ################################################################# + # 3.5.2 Configure UncomplicatedFirewall + ################################################################# + # 3.5.2.1 Ensure ufw service is enabled (Scored) + - id: 2594 + title: "Ensure ufw service is enabled" + description: "UncomplicatedFirewall (ufw) is a frontend for iptables. ufw provides a framework for managing netfilter, as well as a command-line and available graphical user interface for manipulating the firewall. Ensure that the ufw service is enabled to protect your system." + rationale: "The ufw service must be enabled and running in order for ufw to protect the system" + remediation: "Run the following command to enable ufw: # ufw enable" + compliance: + - cis: ["3.5.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + reference: + - "http://manpages.ubuntu.com/manpages/precise/en/man8/ufw.8.html" + condition: all + rules: + - "c:systemctl is-enabled ufw -> enabled" + - "c:ufw status -> Status: active" + + # 3.5.2.2 Ensure default deny firewall policy (Scored) + - id: 2595 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default deny policy: # ufw default deny incoming # ufw default deny outgoing # ufw default deny routed" + compliance: + - cis: ["3.5.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ufw status verbose -> r:^Default && r:deny\W+(incoming)|reject\W+(incoming)' + - 'c:ufw status verbose -> r:^Default && r:deny\W+(outgoing)|reject\W+(outgoing)' + - 'c:ufw status verbose -> r:^Default && r:deny\W+(routed)|reject\W+(routed)' + + # 3.5.2.3 Ensure loopback traffic is configured (Scored) + - id: 2596 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8 for IPv4 and ::1/128 for IPv6)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ufw allow in on lo # ufw allow out on lo # sudo ufw deny in from 127.0.0.0/8 # sudo ufw deny in from ::1" + compliance: + - cis: ["3.5.2.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ufw status verbose -> r:Anywhere on lo\s*\t*ALLOW IN\s*\t*Anywhere' + - 'c:ufw status verbose -> r:Anywhere\s*\t*DENY IN\s*\t*127.0.0.0/8' + - 'c:ufw status verbose -> r:Anywhere \(v6\) on lo\s*\t*ALLOW IN\s*\t*Anywhere \(v6\)' + - 'c:ufw status verbose -> r:Anywhere \(v6\)\s*\t*DENY IN\s*\t*::1' + - 'c:ufw status verbose -> r:Anywhere\s*\t*ALLOW OUT\s*\t*Anywhere on lo' + - 'c:ufw status verbose -> r:Anywhere \(v6\)\s*\t*ALLOW OUT\s*\t*Anywhere \(v6\) on lo' + + ###################################################################### + # 3.5.3 Configure nftables + ###################################################################### + + # 3.5.3.2 Ensure a table exists (Scored) + - id: 2597 + title: "Ensure a table exists" + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + remediation: "Run the following command to create a table in nftables: # nft create table inet
.Example: # nft create table inet filter" + compliance: + - cis: ["3.5.3.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:nft list tables -> r:\w+' + + # 3.5.3.3 Ensure base chains exist (Scored) + - id: 2598 + title: "Ensure base chains exist" + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } . Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0\\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }" + compliance: + - cis: ["3.5.3.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input" + - "c:nft list ruleset -> r:hook forward" + - "c:nft list ruleset -> r:hook output" + + # 3.5.3.6 Ensure default deny firewall policy (Scored) + - id: 2599 + title: "Ensure default deny firewall policy" + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept , the firewall will accept any packet that is not configured to be denied and the packet will continue transversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } . Example: # nft chain inet filter input { policy drop \\; } ; # nft chain inet filter forward { policy drop \\; } and # nft chain inet filter output { policy drop \\; }" + compliance: + - cis: ["3.5.3.6"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input && r:policy drop" + - "c:nft list ruleset -> r:hook forward && r:policy drop" + - "c:nft list ruleset -> r:hook output && r:policy drop" + + # 3.5.3.7 Ensure nftables service is enabled (Scored) + - id: 2600 + title: "Ensure nftables service is enabled" + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting of the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables" + compliance: + - cis: ["3.5.3.7"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled nftables -> enabled" + + ####################################################################### + # 3.5.4 Configure iptables + ####################################################################### + ####################################################################### + # 3.5.4.1 Configure IPv4 iptables + ####################################################################### + # 3.5.4.1.1 Ensure default deny firewall policy (Scored) + - id: 2601 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP; # iptables -P OUTPUT DROP; # iptables -P FORWARD DROP" + compliance: + - cis: ["3.5.4.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)|Chain INPUT \(policy REJECT\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)|Chain FORWARD \(policy REJECT\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)|Chain OUTPUT \(policy REJECT\)' + + # 3.5.4.1.2 Ensure loopback traffic is configured (Scored) + - id: 2602 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.5.4.1.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + ######################################################################### + # 3.5.4.2 Configure IPv6 ip6tables + ######################################################################### + # 3.5.4.2.1 Ensure IPv6 default deny firewall policy (Scored) + - id: 2603 + title: "Ensure IPv6 default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + compliance: + - cis: ["3.5.4.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:ip6tables -L -> r:^Chain INPUT && r:policy DROP" + - "c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP" + + # 3.5.4.2.2 Ensure IPv6 loopback traffic is configured (Scored) + - id: 2604 + title: "Ensure IPv6 loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP" + compliance: + - cis: ["3.5.4.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + ############################################################ + # 4 Logging and Auditing + ############################################################ + + - id: 2605 + title: "Ensure auditd is installed" + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk" + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # apt install auditd audispd-plugins" + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["AU.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:dpkg -s auditd -> r:install ok installed" + - "c:dpkg -s audispd-plugins -> r:install ok installed" + + - id: 2606 + title: "Ensure auditd service is enabled" + description: "Enable and start the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1", "10.7"] + - nist_800_53: ["AU.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> enabled" + + - id: 2607 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: 'Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX="audit=1" Run the following command to update the grub2 configuration: # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings.' + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.2.6", "10.7"] + - nist_800_53: ["AU.2"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d", "32.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:audit=1' + + - id: 2608 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = Notes: The max_log_file parameter is measured in megabytes." + compliance: + - cis: ["4.1.2.1"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["AU.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' + + - id: 2609 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.2.2"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' + + - id: 2610 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.2.3"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*\t*=\s*\t*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*\t*=\s*\t*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*\t*=\s*\t*halt' + + - id: 2611 + title: "Ensure events that modify date and time information are collected" + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier "time-change"' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time- change | -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change. For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change | -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change | -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.3"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change' + + - id: 2612 + title: "Ensure events that modify user/group information are collected" + description: 'Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /etc/group -p wa -k identity | -w /etc/passwd -p wa -k identity | -w /etc/gshadow -p wa -k identity | -w /etc/shadow -p wa -k identity | -w /etc/security/opasswd -p wa -k identity Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.4"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/group && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity' + + - id: 2613 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre- login), /etc/hosts (file containing host names and associated IP addresses) and /etc/sysconfig/network (directory containing network interface scripts and configurations) files." + rationale: 'Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier "system-locale."' + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/system-locale.rules and add the following lines: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale-w /etc/network -p wa -k system-locale For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/system-locale.rules and add the following lines: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/network -p wa -k system-locale" + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/network && r:-p wa && r:-k system-locale' + + - id: 2614 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor AppArmor mandatory access control. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/apparmor and /etc/apparmor.d directories." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "On systems using AppArmor add the following line to the /etc/audit/audit.rules file: -w /etc/apparmor/ -p wa -k MAC-policy | -w /etc/apparmor.d/ -p wa -k MAC-policy. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.6"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor/ && r:-p wa && r:-k MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor.d/ && r:-p wa && r:-k MAC-policy' + + - id: 2615 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /var/log/faillog -p wa -k logins | -w /var/log/lastlog -p wa -k logins | -w /var/log/tallylog -p wa -k logins. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.7"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/faillog && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/tallylog && r:-p wa && r:-k logins' + + - id: 2616 + title: "Ensure session initiation information is collected" + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier "session." The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier "logins."' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /var/run/utmp -p wa -k session | -w /var/log/wtmp -p wa -k logins | -w /var/log/btmp -p wa -k logins. Notes: The last command can be used to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.8"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k logins' + + - id: 2617 + title: "Ensure discretionary access control permission modification events are collected" + description: 'Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier "perm_mod."' + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.9"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + + - id: 2618 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: 'Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier "access."' + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/directory ending in .rules Example: vi /etc/audit/rules.d/audit.rules and add the following lines: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access For 64 bit systems Edit or create a file in the /etc/audit/rules.d/directory ending in .rules Example: vi /etc/audit/rules.d/access.rules and add the following lines: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access Notes: Reloading the auditd config toset active settings requires the auditd service to be restarted, and may require a system reboot." + compliance: + - cis: ["4.1.10"] + - cis_csc: ["14.9"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + + - id: 2619 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts | -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.12"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' + + - id: 2620 + title: "Ensure file deletion events by users are collected" + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete | -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["6.2", "13"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["PI1.4", "PI1.5", "CC7.1", "CC7.2", "CC7.3", "CC8.1"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' + + - id: 2621 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: 'Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier "scope."' + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope | -w /etc/sudoers.d/ -p wa -k scope. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.14"] + - cis_csc: ["4.8"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["PI1.4", "PI1.5", "CC7.1", "CC7.2", "CC7.3", "CC8.1"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers.d/ && r:-p wa && r:-k scope' + + - id: 2622 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w -p wa -k actions. Notes: The system must be configured with sudisabled (See Item 5.6 Ensure access to the su command is restricted) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.15"] + - cis_csc: ["4.9"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14", "AC.6", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w \.+ && r:-p wa && r:-k actions' + + - id: 2623 + title: "Ensure kernel module loading and unloading is collected" + description: 'Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of "modules".' + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b32 -S init_module -S delete_module -k modules. For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b64 -S init_module -S delete_module -k modules. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.16"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/sbin/insmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/sbin/rmmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/sbin/modprobe && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S init_module && r:-S delete_module && r:-k modules' + + - id: 2624 + title: "Ensure the audit configuration is immutable" + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line: -e 2. Notes: This setting will ensure reloading the auditd config to set active settings requires a system reboot." + compliance: + - cis: ["4.1.17"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.5"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "d:/etc/audit/rules.d -> r:^99-finalize.rules$" + - 'd:/etc/audit/rules.d -> r:^99-finalize.rules$ -> r:^\s*\t*-e 2$' + + # 4.2,1 Configure rsyslog + - id: 2625 + title: "Ensure rsyslog is installed" + description: "The rsyslog software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslogsuch as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog: # apt install rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: any + rules: + - "c:dpkg -s rsyslog -> r:install ok installed" + - id: 2626 + title: "Ensure rsyslog Service is enabled" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system will not have a syslog service running." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog" + compliance: + - cis: ["4.2.1.2"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> enabled" + + - id: 2627 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1", "10.5.2"] + - nist_800_53: ["CM.1", "AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\. -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + - id: 2628 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add one of the following lines: Newer syntax: action(type="omfwd" target="" port="" protocol="tcp" ction.resumeRetryCount="" queue.type="linkList" queue.size=") Example: *.* action(type="omfwd" target="192.168.2.100" port"514" protocol="tcp" action.resumeRetryCount="100" queue.type="linkList" queue.size="1000") Older syntax: *.* @@' + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - rsyslog.conf(5) man page + condition: all + rules: + - 'c:grep -Rh ^*.* /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^*.* action\.+target=' + + - id: 2629 + title: "Ensure remote rsyslog messages are only accepted on designated log hosts" + description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." + rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." + remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines: $ModLoad imtcp $InputTCPServerRun 514. For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.6"] + - cis_csc: ["9.2"] + - pci_dss: ["10.5.1"] + references: + - rsyslog.conf(8) man page + condition: all + rules: + - 'c:grep -Rh ^\$ModLoad[[:space:]]*imtcp /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$ModLoad\s*\t*imtcp' + - 'c:grep -Rh ^\$InputTCPServerRun /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$InputTCPServerRun\s*\t*514' + + # 4.2.2.1 Ensure journald is configured to send logs to rsyslog (Scored) + - id: 2630 + title: "Ensure journald is configured to send logs to rsyslog" + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the rsyslog service provides a consistent means of log collection and export." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.5"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1", "AU.9", "AU.4"] + - tsc: ["CC5.2", "CC7.2"] + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf" + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + + # 4.2.2.2 Ensure journald is configured to compress large log files (Scored) + - id: 2631 + title: "Ensure journald is configured to compress large log files" + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes" + compliance: + - cis: ["4.2.2.2"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf" + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Compress\s*=\s*yes' + + # 4.2.2.3 Ensure journald is configured to write logfiles to persistent disk (Scored) + - id: 2632 + title: "Ensure journald is configured to write logfiles to persistent disk" + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf" + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Storage\s*=\s*persistent' + + # 4.2.3 Ensure permissions on all logfiles are configured (Scored) + - id: 2633 + title: "Ensure permissions on all logfiles are configured" + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitivebdata is archived and protected." + remediation: 'Run the following command to set permissions on all existing log files: find /var/log -type f -exec chmod g-wx,o-rwx "{}" + -o -type d -exec chmod g-w,o-rwx "{}" +' + compliance: + - cis: ["4.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1", "10.5.2"] + - nist_800_53: ["CM.1", "AU.9"] + - tsc: ["CC5.2", "CC7.2"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + + - id: 2634 + title: "Ensure logrotate assigns appropriate permissions" + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit /etc/logrotate.conf and update the create line to read 0640 or more restrictive, following local site policy Example: create 0640 root utmp" + compliance: + - cis: ["4.4"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'f:/etc/logrotate.conf -> r:^\s*\t*create\s*\t*0\d40|^\s*\t*create\s*\t*0\d00 && r:^\s*\t*create\s*\t*06\d0|^\s*\t*create\s*\t*04\d0|^\s*\t*create\s*\t*02\d0|^\s*\t*create\s*\t*00\d0' + + ############################################################ + # 5 Access, Authentication and Authorization + ############################################################ + ############################################################ + # 5.1 Configure cron + ############################################################ + - id: 2635 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: systemctl --now enable cron" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled cron -> enabled" + + # 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 2636 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 2637 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 2638 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 2639 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 2640 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 2641 + title: "Ensure permissions on /etc/cron.d are configured" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.8 Ensure at/cron is restricted to authorized users (Scored) + - id: 2642 + title: "Ensure at/cron is restricted to authorized users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/cron.allow" + - "f:/etc/at.allow" + - "not f:/etc/cron.deny" + - "not f:/etc/at.deny" + - 'c:stat -L /etc/cron.allow -> r:^Access: \(0\d\d0/\w\w\w\w\w-----\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat -L /etc/at.allow -> r:^Access: \(0\d\d0/\w\w\w\w\w-----\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + ###################################################### + # 5.2 SSH Server Configuration + ###################################################### + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured + - id: 2643 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non- privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2.2 Ensure permissions on SSH private host key files are configured (Scored) + - id: 2644 + title: "Ensure permissions on SSH private host key files are configured" + description: "An SSH private key is one of two files used in SSH public key authentication. In this authentication method, The possession of the private key is proof of identity. Only a private key that corresponds to a public key will be able to authenticate successfully. The private keys need to be stored and handled carefully, and no copies of the private key should be distributed." + rationale: "If an unauthorized user obtains the private SSH host key file, the host could be impersonated" + remediation: "Run the following commands to set ownership and permissions on the private SSH host key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chown root:root {} \\; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chmod 0600 {} \\;" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/ssh/ssh_host_rsa_key -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat -L /etc/ssh/ssh_host_ecdsa_key -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat -L /etc/ssh/ssh_host_ed25519_key -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2.3 Ensure permissions on SSH public host key files are configured (Scored) + - id: 2645 + title: "Ensure permissions on SSH public host key files are configured" + description: "An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully." + rationale: "If a public host key file is modified by an unauthorized user, the SSH service may be compromised." + remediation: "Run the following commands to set permissions and ownership on the SSH host public key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chmod 0644 {} \\; #find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chown root:root {} \\;" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/ssh/ssh_host_rsa_key.pub -> r:^Access: \(0\d\d\d/-\w\w\w\w--\w--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat -L /etc/ssh/ssh_host_ecdsa_key.pub -> r:^Access: \(0\d\d\d/-\w\w\w\w--\w--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat -L /etc/ssh/ssh_host_ed25519_key.pub -> r:^Access: \(0\d\d\d/-\w\w\w\w--\w--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2.4 Ensure SSH Protocol is not set to 1 (Scored) + - id: 2646 + title: "Ensure SSH Protocol is not set to 1" + description: "Older versions of SSH support two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2. Notes: This command not longer exists in newer versions of SSH. This check is still being included for systems that may be running an older version of SSH. As of openSSH version 7.4 this parameter will not cause an issue when included." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.4"] + - cis_csc: ["4.5", "14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: none + rules: + - 'c:sshd -T -> r:Protocol\s*\t*1' + + # 5.2.5 Ensure SSH LogLevel is appropriate (Scored) + - id: 2647 + title: "Ensure SSH LogLevel is appropriate" + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE or LogLevel INFO" + references: + - https://www.ssh.com/ssh/sshd_config/ + compliance: + - cis: ["5.2.5"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:LogLevel\s+INFO|LogLevel\s+VERBOSE' + + # 5.2.6 Ensure SSH X11 forwarding is disabled (Scored) + - id: 2648 + title: "Ensure SSH X11 forwarding is disabled" + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_configfile to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:sshd -T -> r:X11Forwarding\s+no' + + # 5.2.7 Ensure SSH MaxAuthTries is set to 4 or less (Scored) + - id: 2649 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.2.8 Ensure SSH IgnoreRhosts is enabled (Scored) + - id: 2650 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhostsand .shostsfiles will not be used in RhostsRSAAuthenticationor HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:IgnoreRhosts\s+yes' + + # 5.2.9 Ensure SSH HostbasedAuthentication is disabled (Scored) + - id: 2651 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:HostbasedAuthentication\s+no' + + # 5.2.10 Ensure SSH root login is disabled (Scored) + - id: 2652 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["4.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitRootLogin\s+no' + + # 5.2.11 Ensure SSH PermitEmptyPasswords is disabled (Scored) + - id: 2653 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitEmptyPasswords\s+no' + + # 5.2.12 Ensure SSH PermitUserEnvironment is disabled (Scored) + - id: 2654 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["14.6"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -> r:PermitUserEnvironment\s+no' + + # 5.2.13 Ensure only strong Ciphers are used (Scored) + - id: 2655 + title: "Ensure only strong ciphers are used" + description: "This variable limits the ciphers that SSH can use during communication." + rationale: 'Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a "Sweet32" attack The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involving LSB values, aka the "Bar Mitzvah" issue The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher is used, does not properly initialize memory for a MAC context data structure, which allows remote authenticated users to bypass intended ForceCommand and login-shell restrictions via packet data that provides a crafted callback address' + remediation: "Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers Example: Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - "https://nvd.nist.gov/vuln/detail/CVE-2016-2183" + - "https://nvd.nist.gov/vuln/detail/CVE-2015-2808" + - "https://www.kb.cert.org/vuls/id/565052" + - "https://www.openssh.com/txt/cbc.adv" + - "https://nvd.nist.gov/vuln/detail/CVE-2008-5161" + - "https://nvd.nist.gov/vuln/detail/CVE-2013-4548" + - "https://www.kb.cert.org/vuls/id/565052" + - "https://www.openssh.com/txt/cbc.adv" + condition: none + rules: + - "c:sshd -T -> r:ciphers && r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc|arcfour|arcfour128|arcfour256|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se" + + # 5.2.14 Ensure only strong MAC algorithms are used (Scored) + - id: 2656 + title: "Ensure only strong MAC algorithms are used" + description: "This variable limits the types of MAC algorithms that SSH can use during communication." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information" + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256" + compliance: + - cis: ["5.2.14"] + - cis_csc: ["14.4", "16.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - "http://www.mitls.org/pages/attacks/SLOTH" + condition: none + rules: + - "c:sshd -T -> r:MACs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com" + + # 5.2.15 Ensure only strong Key Exchange algorithms are used (Scored) + - id: 2657 + title: "Ensure only strong Key Exchange algorithms are used" + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received" + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks" + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms Example: KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: none + rules: + - "c:sshd -T -> r:kexalgorithms && r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1" + + # 5.2.16 Ensure SSH Idle Timeout Interval is configured (Scored) + - id: 2658 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 ClientAliveCountMax 0" + compliance: + - cis: ["5.2.16"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'c:sshd -T -> n:ClientAliveInterval\s*\t*(\d+) compare <= 300 && n:ClientAliveInterval\s*\t*(\d+) compare != 0' + - 'c:sshd -T -> n:ClientAliveCountMax\s*\t*(\d+) compare <= 3' + + # 5.2.17 Ensure SSH LoginGraceTime is set to one minute or less (Scored) + - id: 2659 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.17"] + - cis_csc: ["5.1"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:sshd -T -> n:LoginGraceTime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + + # 5.2.18 Ensure SSH access is limited (Scored) + - id: 2660 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " + compliance: + - cis: ["5.2.18"] + - cis_csc: ["4.3"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:sshd -T -> r:AllowUsers\s+\w+|AllowGroups\s+\w+|DenyUsers\s+\w+|DenyGroups\s+\w+' + + # 5.2.19 Ensure SSH warning banner is configured (Scored) + - id: 2661 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:Banner\s*\t*/etc/issue.net' + + # 5.2.20 Ensure SSH PAM is enabled (Scored) + - id: 2662 + title: "Ensure SSH PAM is enabled" + description: "UsePAM Enables the Pluggable Authentication Module interface. If set to “yes” this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types." + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes" + compliance: + - cis: ["5.2.20"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*usepam\s+yes' + + # 5.2.21 Ensure SSH AllowTcpForwarding is disabled (Scored) + - id: 2663 + title: "Ensure SSH AllowTcpForwarding is disabled" + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no" + compliance: + - cis: ["5.2.21"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - https://www.ssh.com/ssh/tunneling/example + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowTcpForwarding\s+no' + + - id: 2664 + title: "Ensure SSH MaxStartups is configured" + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: maxstartups 10:30:60" + compliance: + - cis: ["5.2.22"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*maxstartups\s+10:30:60' + + # 5.2.23 Ensure SSH MaxSessions is limited (Scored) + - id: 2665 + title: "Ensure SSH MaxSessions is limited" + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> n:^MaxSessions\s+(\d+) compare <= 10' + + ###################################################### + # 5.3 Configure PAM + ###################################################### + # 5.3.1 Ensure password creation requirements are configured (Scored) + - id: 2666 + title: "Ensure password creation requirements are configured" + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options: - retry=3 (Allow 3 tries before sending back a failure). The following options are set in the /etc/security/pwquality.conf file: - minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 (The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies.)" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "1) Run the following command to install the pam_pwquality module: apt install libpam-pwquality 2) Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so retry=3 3) Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1. Notes: Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more. Settings in /etc/security/pwquality.conf must use spaces around the = symbol." + compliance: + - cis: ["5.3.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/security/pwquality.conf -> !r:^# && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'f:/etc/pam.d/common-password -> !r:^# && n:password\s*\t*requisite\s*\t*pam_pwquality.so\s*\t*retry=(\d+) compare <=3' + + # 5.3.2 Ensure lockout for failed password attempts is configured (Scored) + - id: 2667 + title: "Ensure lockout for failed password attempts is configured" + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: 'Edit the /etc/pam.d/common-auth file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900. Edit the /etc/pam.d/common-account file and add the account lines below: account requisite pam_deny.so account required pam_tally2.so. Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user. Notes:BUG In pam_tally2.so To work around this issue the addition of pam_tally2.so in the accounts section of the /etc/pam.d/common-account file has been added to the audit and remediation sections. pam_tally2 line must be added for the counter to reset to 0 when using sudo. Use of the "audit" keyword may log credentials in the case of user error during authentication. This risk should be evaluated in the context of the site policies of your organization.' + compliance: + - cis: ["5.3.2"] + - cis_csc: ["16.7"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d+ && r:unlock_time\s*=\s*\d+' + - 'f:/etc/pam.d/common-account -> !r:^# && r:account\s*\t*requisite\s*\t*pam_deny.so' + - 'f:/etc/pam.d/common-account -> !r:^# && r:account\s*\t*required\s*\t*pam_tally2.so' + + # 5.3.3 Ensure password reuse is limited (Scored) + - id: 2668 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown: password required pam_pwhistory.so remember=5. Notes: Additional module options may be set, recommendation only covers those listed here." + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare < 5' + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && !r:remember' + + # 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 2669 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the sha512 option for pam_unix.so as shown: password [success=1 default=ignore] pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.14"] + - pci_dss: ["3.6.1", "8.2.1"] + - tsc: ["CC6.1", "CC6.7"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> r:^password\.+pam_unix.so && !r:sha512' + + #################################################### + # 5.4 User Accounts and Environment + #################################################### + #################################################### + # 5.4.1 Set Shadow Password Suite Parameters + #################################################### + # 5.4.1.1 Ensure password expiration is 365 days or less (Scored) + - id: 2670 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs: PASS_MAX_DAYS 90. Modify user parameters for all users with a password set to match: # chage --maxdays 90 . Notes: You can also check this setting in /etc/shadow directly. The 5th field should be 365 or less for all users with a password. A value of -1 will disable password expiration. Additionally the password expiration must be greater than the minimum days between password changes or users will be unable to change their password." + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare < 0' + + # 5.4.1.2 Ensure minimum days between password changes is configured + - id: 2671 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7. Modify user parameters for all users with a password set to match: # chage --mindays 7 . Notes: You can also check this setting in /etc/shadow directly. The 4th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 1' + + # 5.4.1.3 Ensure password expiration warning days is 7 or more (Scored) + - id: 2672 + title: "Ensure password expiration warning days is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7. Modify user parameters for all users with a password set to match: # chage --warndays 7 . Notes: You can also check this setting in /etc/shadow directly. The 6th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + # 5.4.1.4 Ensure inactive password lock is 30 days or less (Scored) + - id: 2673 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30. Modify user parameters for all users with a password set to match: # chage --inactive 30 . Notes: You can also check this setting in /etc/shadow directly. The 7th field should be 30 or less for all users with a password. A value of -1 would disable this setting." + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - 'not c:useradd -D -> n:^INACTIVE=(\d+) compare < 0' + + # 5.4.3 Ensure default group for the root account is GID 0 (Scored) + - id: 2674 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: # usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["14.6"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' + + # 5.4.4 Ensure default user umask is 027 or more restrictive (Scored) + - id: 2675 + title: "Ensure default user umask is 027 or more restrictive" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bash.bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["14.6"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + # 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 2676 + title: "Ensure default user shell timeout is 900 seconds or less" + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bash.bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: readonly TMOUT=900 ; export TMOUT . Note that setting the value to readonly prevents unwanted modification during runtime." + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not d:/etc/profile.d -> .sh -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/bash.bashrc -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'd:/etc/profile.d -> .sh -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/bash.bashrc -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + # 5.6 Ensure access to the su command is restricted (Scored) + - id: 2677 + title: "Ensure access to the su command is restricted" + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the sudo group to execute su." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup" + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^# && r:auth\s*\t*required\s*\t*pam_wheel.so && r:use_uid && r:group=' + + ############################################################ + # 6 System Maintenance + ############################################################ + + ############################################################ + # 6.1 System File Permissions + ############################################################ + # 6.1.2 Ensure permissions on /etc/passwd are configured (Scored) + - id: 2678 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.3 Ensure permissions on /etc/gshadow- are configured (Scored) + - id: 2679 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chown root:shadow /etc/gshadow- # chmod o-rwx,g-wx /etc/gshadow-" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/gshadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.4 Ensure permissions on /etc/shadow are configured (Scored) + - id: 2680 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the one following commands to set permissions on /etc/shadow : # chown root:shadow /etc/shadow # chmod o-rwx,g-wx /etc/shadow" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/shadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + # 6.1.5 Ensure permissions on /etc/group are configured (Scored) + - id: 2681 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.6 Ensure permissions on /etc/passwd- are configured (Scored) + - id: 2682 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod u-x,go-rwx /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/passwd- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.7 Ensure permissions on /etc/shadow- are configured (Scored) + - id: 2683 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/shadow- : # chown root:shadow /etc/shadow- # chmod u-x,go-rwx /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/shadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.8 Ensure permissions on /etc/group- are configured (Scored) + - id: 2684 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod u-x,go-rwx /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/group- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.9 Ensure permissions on /etc/gshadow are configured (Scored) + - id: 2685 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following commands to set permissions on /etc/gshadow : # chown root:shadow /etc/gshadow # chmod o-rwx,g-rw /etc/gshadow" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/gshadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + #################################################### + # 6.2 User and Group Settings + #################################################### + + # 6.2.1 Ensure password fields are not empty (Scored) + - id: 2686 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + # 6.2.2 Ensure no legacy "+" entries exist in /etc/passwd (Scored) + - id: 2687 + title: 'Ensure no legacy "+" entries exist in /etc/passwd' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/passwd -> !r:^# && r:^+:" + + # 6.2.4 Ensure no legacy "+" entries exist in /etc/shadow (Scored) + - id: 2688 + title: 'Ensure no legacy "+" entries exist in /etc/shadow' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/shadow -> !r:^# && r:^+:" + + # 6.2.5 Ensure no legacy "+" entries exist in /etc/group (Scored) + - id: 2689 + title: 'Ensure no legacy "+" entries exist in /etc/group' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/group if they exist." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/group -> !r:^# && r:^+:" + + # 6.2.6 Ensure root is the only UID 0 account (Scored) + - id: 2690 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:' + + # 6.2.20 Ensure shadow group is empty (Scored) + - id: 2691 + title: "Ensure shadow group is empty" + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." + compliance: + - cis: ["6.2.20"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/etc/ruleset/sca/debian/cis_debian11.yml b/etc/ruleset/sca/debian/cis_debian11.yml new file mode 100644 index 0000000000..1593fa727e --- /dev/null +++ b/etc/ruleset/sca/debian/cis_debian11.yml @@ -0,0 +1,5033 @@ +# Security Configuration Assessment +# CIS Checks for Debian Linux 11 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Debian Linux 11 Benchmark v1.0.0 - 09-22-2022 + +policy: + id: "cis_debian11" + file: "cis_debian11.yml" + name: "CIS Debian Linux 11 Benchmark v1.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 11." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Debian version." + description: "Requirements for running the SCA scan against Debian Linux 11." + condition: all + rules: + - "f:/etc/debian_version -> r:11." + - "f:/proc/sys/kernel/ostype -> r:Linux" + - "f:/etc/os-release -> r:NAME= && r:Debian" + - "f:/etc/os-release -> r:VERSION= && r:11" + +checks: + ############################################################ + # 1 Initial Setup + ############################################################ + + ############################################################ + # 1.1 Filesystem configuration + ############################################################ + # 1.1.1.1 Ensure mounting of cramfs filesystems is disabled (Automated) - Not implemented + # 1.1.1.2 Ensure mounting of squashfs filesystems is disabled (Automated) - Not implemented + # 1.1.1.3 Ensure mounting of udf filesystems is disabled (Automated) - Not implemented + + ############################################################ + # 1.1.2 Configure /tmp + ############################################################ + + # 1.1.2.1 Ensure /tmp is a separate partition (Automated) + - id: 29500 + title: "Ensure /tmp is a separate partition." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a configuration where /tmp is not a separate file system it will essentially have the whole disk available, as the default installation only creates a single / partition. On the other hand, a RAM-based /tmp (as with tmpfs) will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily. Another alternative is to create a dedicated partition for /tmp from a separate volume or disk. One of the downsides of a disk-based dedicated partition is that it will be slower than tmpfs which is RAM-based. /tmp utilizing tmpfs can be resized using the size={size} parameter in the relevant entry in /etc/fstab." + remediation: "First ensure that systemd is correctly configured to ensure that /tmp will be mounted at boot time. # systemctl unmask tmp.mount. For specific configuration requirements of the /tmp mount for your environment, modify /etc/fstab or tmp.mount. Example of /etc/fstab configured tmpfs file system with specific mount options: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 0. Example of tmp.mount configured tmpfs file system with specific mount options: [Unit] Description=Temporary Directory /tmp ConditionPathIsSymbolicLink=!/tmp DefaultDependencies=no Conflicts=umount.target Before=local-fs.target umount.target After=swap.target [Mount] What=tmpfs Where=/tmp Type=tmpfs." + references: + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + - https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html + compliance: + - cis: ["1.1.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s+' + - "c:systemctl is-enabled tmp.mount -> r:enabled|generated" + + # 1.1.2.2 Ensure nodev option set on /tmp partition (Automated) + - id: 29501 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0. Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s+ && r:nodev' + + # 1.1.2.3 Ensure noexec option set on /tmp partition (Automated) + - id: 29502 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0. Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s+ && r:noexec' + + # 1.1.2.4 Ensure nosuid option set on /tmp partition (Automated) + - id: 29503 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0. Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s+ && r:nosuid' + + ############################################################ + # 1.1.3 Configure /var + ############################################################ + + # 1.1.3.1 Ensure separate partition exists for /var (Automated) + - id: 29504 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "The reasoning for mounting /var on a separate partition is as follow. - Protection from resource exhaustion: The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. - Fine grained control over the mount: Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behaviour. See man mount for exact details regarding filesystem-independent and filesystem-specific options. - Protection from exploitation: An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + compliance: + - cis: ["1.1.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0006"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s+' + + # 1.1.3.2 Ensure nodev option set on /var partition (Automated) + - id: 29505 + title: "Ensure nodev option set on /var partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "IF the /var partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,relatime 0 0 . Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1038"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s+ && r:nodev' + + # 1.1.3.3 Ensure nosuid option set on /var partition (Automated) + - id: 29506 + title: "Ensure nosuid option set on /var partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var." + remediation: "IF the /var partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,relatime 0 0 . Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1038"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s+ && r:nosuid' + + ############################################################ + # 1.1.4 Configure /var/tmp + ############################################################ + + # 1.1.4.1 Ensure separate partition exists for /var/tmp (Automated) + - id: 29507 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications. Temporary files residing in /var/tmp are to be preserved between reboots." + rationale: "The reasoning for mounting /var/tmp on a separate partition is as follows. - Protection from resource exhaustion: The default installation only creates a single / partition. Since the /var/tmp directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/tmp and cause the potential disruption to daemons as the disk is full. - Fine grained control over the mount: Configuring /var/tmp as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. - Protection from exploitation: An example of exploiting /var/tmp may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + compliance: + - cis: ["1.1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s+' + + # 1.1.4.2 Ensure noexec option set on /var/tmp partition (Automated) + - id: 29508 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "IF the /var/tmp partition exists, edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 . Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s+ && r:noexec' + + # 1.1.4.3 Ensure nosuid option set on /var/tmp partition (Automated) + - id: 29509 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "IF the /var/tmp partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 . Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s+ && r:nosuid' + + # 1.1.4.4 Ensure nodev option set on /var/tmp partition (Automated) + - id: 29510 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/tmp." + remediation: "IF the /var/tmp partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 . Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s+ && r:nodev' + + ############################################################ + # 1.1.5 Configure /var/log + ############################################################ + # 1.1.5.1 Ensure separate partition exists for /var/log (Automated) + - id: 29511 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "The reasoning for mounting /var/log on a separate partition is as follows. - Protection from resource exhaustion: The default installation only creates a single / partition. Since the /var/log directory contains log files which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. - Fine grained control over the mount: Configuring /var/log as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. - Protection of log data: As /var/log contains log files, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + compliance: + - cis: ["1.1.5.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - pci_dss_3.2.1: ["10.7"] + - soc_2: ["A1.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s+' + + # 1.1.5.2 Ensure nodev option set on /var/log partition (Automated) + - id: 29512 + title: "Ensure nodev option set on /var/log partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log." + remediation: "IF the /var/log partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 . Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s+ && r:nodev' + + # 1.1.5.3 Ensure noexec option set on /var/log partition (Automated) + - id: 29513 + title: "Ensure noexec option set on /var/log partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot run executable binaries from /var/log." + remediation: "IF the /var/log partition exists, edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 . Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s+ && r:noexec' + + # 1.1.5.4 Ensure nosuid option set on /var/log partition (Automated) + - id: 29514 + title: "Ensure nosuid option set on /var/log partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot create setuid files in /var/log." + remediation: "IF the /var/log partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 . Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s+ && r:nosuid' + + ############################################################ + # 1.1.6 Configure /var/log/audit + ############################################################ + + # 1.1.6.1 Ensure separate partition exists for /var/log/audit (Automated) + - id: 29515 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "The reasoning for mounting /var/log/audit on a separate partition is as follows. - Protection from resource exhaustion: The default installation only creates a single / partition. Since the /var/log/audit directory contains the audit.log file which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/log/audit and cause auditd to trigger it's space_left_action as the disk is full. See man auditd.conf for details. - Fine grained control over the mount: Configuring /var/log/audit as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. - Protection of audit data: As /var/log/audit contains audit logs, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + compliance: + - cis: ["1.1.6.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - pci_dss_3.2.1: ["10.7"] + - soc_2: ["A1.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s+' + + # 1.1.6.2 Ensure noexec option set on /var/log/audit partition (Automated) + - id: 29516 + title: "Ensure noexec option set on /var/log/audit partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log/audit filesystem is only intended for audit logs, set this option to ensure that users cannot run executable binaries from /var/log/audit." + remediation: "IF the /var/log/audit partition exists, edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 . Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:^/var/log/audit && r:noexec" + + # 1.1.6.3 Ensure nodev option set on /var/log/audit partition (Automated) + - id: 29517 + title: "Ensure nodev option set on /var/log/audit partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log/audit filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log/audit." + remediation: "IF the /var/log/audit partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 . Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:^/var/log/audit && r:nodev" + + # 1.1.6.4 Ensure nosuid option set on /var/log/audit partition (Automated) + - id: 29518 + title: "Ensure nosuid option set on /var/log/audit partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log/audit filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var/log/audit." + remediation: "IF the /var/log/audit partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 . Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:^/var/log/audit && r:nosuid" + + ############################################################ + # 1.1.7 Configure /home + ############################################################ + + # 1.1.7.1 Ensure separate partition exists for /home (Automated) + - id: 29519 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "The reasoning for mounting /home on a separate partition is as follows. - Protection from resource exhaustion: The default installation only creates a single / partition. Since the /home directory contains user generated data, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /home and impact all local users. - Fine grained control over the mount: Configuring /home as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. In the case of /home options such as usrquota/grpquota may be considered to limit the impact that users can have on each other with regards to disk resource exhaustion. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. - Protection of user data: As /home contains user data, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + compliance: + - cis: ["1.1.7.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1038"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s+' + + # 1.1.7.2 Ensure nodev option set on /home partition (Automated) + - id: 29520 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /home filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /home." + remediation: "IF the /home partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,relatime 0 0. Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s+ && r:nodev' + + # 1.1.7.3 Ensure nosuid option set on /home partition (Automated) + - id: 29521 + title: "Ensure nosuid option set on /home partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /home filesystem is only intended for user file storage, set this option to ensure that users cannot create setuid files in /home." + remediation: "IF the /home partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,relatime 0 0. Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s+ && r:nosuid' + + ############################################################ + # 1.1.8 Configure /dev/shm + ############################################################ + + # 1.1.8.1 Ensure nodev option set on /dev/shm partition (Automated) + - id: 29522 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1038"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s+ && r:nodev' + + # 1.1.8.2 Ensure noexec option set on /dev/shm partition (Automated) + - id: 29523 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Example: /dev/shm defaults,rw,nosuid,nodev,noexec,relatime 0 0. Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm. NOTE It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /dev/shm -> r:^/dev/shm && r:noexec" + + # 1.1.8.3 Ensure nosuid option set on /dev/shm partition (Automated) + - id: 29524 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1038"] + condition: all + rules: + - "c:findmnt --kernel /dev/shm -> r:^/dev/shm && r:nosuid" + + # 1.1.9 Disable Automounting (Automated) + - id: 29525 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "If there are no other packages that depends on autofs, remove the package with: # apt purge autofs OR if there are dependencies on the autofs package: Run the following commands to mask autofs: # systemctl stop autofs # systemctl mask autofs." + compliance: + - cis: ["1.1.9"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + - mitre_techniques: ["T1068", "T1203", "T1211", "T1212"] + condition: any + rules: + - "c:systemctl is-enabled autofs -> r:Failed to get unit file state for autofs.service: No such file or directory" + - "c:systemctl is-enabled autofs -> r:disabled" + + # 1.1.10 Disable USB Storage (Automated) - Not implemented + + ############################################################ + # 1.2 Configure Software Updates + ############################################################ + + # 1.2.1 Ensure package manager repositories are configured (Manual)" + + # 1.2.2 Ensure GPG keys are configured (Manual) + + ############################################################ + # 1.3 Filesystem Integrity Checking + ############################################################ + + # 1.3.1 Ensure AIDE is installed (Automated) + - id: 29526 + title: "Ensure AIDE is installed." + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Install AIDE using the appropriate package manager or manual installation: # apt install aide aide-common Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Run the following commands to initialize AIDE: # aideinit # mv /var/lib/aide/aide.db.new /var/lib/aide/aide.db." + compliance: + - cis: ["1.3.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - pci_dss_3.2.1: ["10.2.1", "11.5"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1"] + - nist_sp_800-53: ["AC-6(9)"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_techniques: ["T1036", "T1036.002", "T1036.003", "T1036.004", "T1036.005", "T1565", "T1565.001"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' aide -> r:install ok installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' aide-common -> r:install ok installed" + + # 1.3.2 Ensure filesystem integrity is regularly checked (Automated) + - id: 29527 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check: Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/bin/aide.wrapper --config /etc/aide/aide.conf --check OR If aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/bin/aide.wrapper --config /etc/aide/aide.conf --check [Install] WantedBy=multi-user.target. Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target. Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + references: + - https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service + - https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer + compliance: + - cis: ["1.3.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_techniques: ["T1036", "T1036.002", "T1036.003", "T1036.004", "T1036.005", "T1565", "T1565.001"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:systemctl is-enabled aidecheck.service -> r:enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:enabled" + - "c:systemctl status aidecheck.timer -> r:active" + + ############################################################ + # 1.4 Secure Boot Settings + ############################################################ + + # 1.4.1 Ensure bootloader password is set (Automated) + - id: 29528 + title: "Ensure bootloader password is set." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off AppArmor at boot time)." + impact: "If password protection is enabled, only the designated superuser can edit a Grub 2 menu item by pressing 'e' or access the GRUB 2 command line by pressing 'c' If GRUB 2 is set up to boot automatically to a password-protected menu entry the user has no option to back out of the password prompt to select another menu entry. Holding the SHIFT key will not display the menu in this case. The user must enter the correct username and password. If unable, the configuration files will have to be edited via the LiveCD or other means to fix the problem You can add --unrestricted to the menu entries to allow the system to boot without entering a password. Password will still be required to edit menu items. More Information: https://help.ubuntu.com/community/Grub2/Passwords." + remediation: 'Create an encrypted password with grub-mkpasswd-pbkdf2: # grub-mkpasswd-pbkdf2 Enter password: Reenter password: PBKDF2 hash of your password is . Add the following into a custom /etc/grub.d configuration file: cat < EOF. The superuser/user information and password should not be contained in the /etc/grub.d/00_header file as this file could be overwritten in a package update. If there is a requirement to be able to boot/reboot without entering the password, edit /etc/grub.d/10_linux and add --unrestricted to the line CLASS= Example: CLASS="--class gnu-linux --class gnu --class os --unrestricted". Run the following command to update the grub2 configuration: # update-grub.' + references: + - https://help.ubuntu.com/community/Grub2/Passwords + compliance: + - cis: ["1.4.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1542"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1046"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + # 1.4.2 Ensure permissions on bootloader config are configured (Automated) + - id: 29529 + title: "Ensure permissions on bootloader config are configured." + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub/grub.cfg # chmod u-wx,go-rwx /boot/grub/grub.cfg." + compliance: + - cis: ["1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1542"] + - mitre_tactics: ["TA0005", "TA0007"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -L /boot/grub/grub.cfg -> r:Access:\s*\(0400/-r--------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.4.3 Ensure authentication required for single user mode (Automated) + - id: 29530 + title: "Ensure authentication required for single user mode." + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root." + compliance: + - cis: ["1.4.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1548"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'f:/etc/shadow -> r:^root:\$\w' + + ############################################################ + # 1.5 Additional Process Hardening + ############################################################ + + # 1.5.1 Ensure address space layout randomization (ASLR) is enabled (Automated) - Not Implemented + + # 1.5.2 Ensure prelink is not installed (Automated) + - id: 29531 + title: "Ensure prelink is not installed." + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following command to restore binaries to normal: # prelink -ua . Uninstall prelink using the appropriate package manager or manual installation: # apt purge prelink." + compliance: + - cis: ["1.5.2"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - pci_dss_3.2.1: ["10.2.1", "11.5"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1"] + - nist_sp_800-53: ["AC-6(9)"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_techniques: ["T1055", "T1055.009", "T1065", "T1065.001"] + - mitre_tactics: ["TA0002"] + - mitre_mitigations: ["M1050"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' prelink -> r:dpkg-query: no packages found matching prelink" + + # 1.5.3 Ensure Automatic Error Reporting is not enabled (Automated) + - id: 29532 + title: "Ensure Automatic Error Reporting is not enabled." + description: "The Apport Error Reporting Service automatically generates crash reports for debugging." + rationale: "Apport collects potentially sensitive data, such as core dumps, stack traces, and log files. They can contain passwords, credit card numbers, serial numbers, and other private material." + remediation: "Edit /etc/default/apport and add or edit the enabled parameter to equal 0: enabled=0 Run the following commands to stop and disable the apport service # systemctl stop apport.service # systemctl --now disable apport.service -- OR -- Run the following command to remove the apport package: # apt purge apport." + compliance: + - cis: ["1.5.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + condition: all + rules: + - "c:systemctl is-active apport.service -> r:inactive" + + # 1.5.4 Ensure core dumps are restricted (Automated) + - id: 29533 + title: "Ensure core dumps are restricted." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0. Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0. IF systemd-coredump is installed: edit /etc/systemd/coredump.conf and add/modify the following lines: Storage=none ProcessSizeMax=0. Run the command: systemctl daemon-reload." + compliance: + - cis: ["1.5.4"] + - mitre_techniques: ["T1005"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - "c:sysctl fs.suid_dumpable -> r:^fs.suid_dumpable = 0" + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^fs.suid_dumpable = 0' + - "c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:^* hard core 0" + + ############################################################ + # 1.6 Mandatory Access Control + ############################################################ + + # 1.6.1.1 Ensure AppArmor is installed (Automated) + - id: 29534 + title: "Ensure AppArmor is installed." + description: "AppArmor provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Install AppArmor. # apt install apparmor apparmor-utils." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' apparmor -> r:install ok installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' apparmor-utils -> r:install ok installed" + + # 1.6.1.2 Ensure AppArmor is enabled in the bootloader configuration (Automated) + - id: 29535 + title: "Ensure AppArmor is enabled in the bootloader configuration." + description: "Configure AppArmor to be enabled at boot time and verify that it has not been overwritten by the bootloader boot parameters. Note: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + rationale: "AppArmor must be enabled at boot time in your bootloader configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/grub and add the apparmor=1 and security=apparmor parameters to the GRUB_CMDLINE_LINUX= line GRUB_CMDLINE_LINUX="apparmor=1 security=apparmor". Run the following command to update the grub2 configuration: # update-grub.' + compliance: + - cis: ["1.6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1026"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:apparmor=1' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:security=apparmor' + + # 1.6.1.3 Ensure all AppArmor Profiles are in enforce or complain mode (Automated) + - id: 29536 + title: "Ensure all AppArmor Profiles are in enforce or complain mode." + description: "AppArmor profiles define what resources applications are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* OR Run the following command to set all profiles to complain mode: # aa-complain /etc/apparmor.d/* Note: Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:apparmor_status -> r:^0\s*processes are unconfined' + + # 1.6.1.4 Ensure all AppArmor Profiles are enforcing (Automated) + - id: 29537 + title: "Ensure all AppArmor Profiles are enforcing." + description: "AppArmor profiles define what resources applications are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Note: Any unconfined processes may need to have a profile created or activated for them and then be restarted." + references: + - AppArmor Documentation: http://wiki.apparmor.net/index.php/Documentation + - Ubuntu AppArmor Documentation: https://help.ubuntu.com/community/AppArmor + - SUSE AppArmor Documentation: https://www.suse.com/documentation/apparmor/ + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:apparmor_status -> n:^(\d+)\s*profiles are loaded compare > 0' + - 'c:apparmor_status -> r:^0\s*profiles are in complain mode' + - 'c:apparmor_status -> r:^0\s*processes are unconfined' + + ############################################################ + # 1.7 Command Line Warning Banners + ############################################################ + + # 1.7.1 Ensure message of the day is configured properly (Automated) + - id: 29538 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a ." command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + - mitre_tactics: ["TA0007"] + condition: any + rules: + - "not f:/etc/motd" + - 'not f:/etc/motd -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + # 1.7.2 Ensure local login warning banner is configured properly (Automated) + - id: 29539 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a ." command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v , or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.7.2"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + - mitre_tactics: ["TA0007"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + # 1.7.3 Ensure remote login warning banner is configured properly (Automated) + - id: 29540 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the "uname -a" command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v or references to the OS platform: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + - mitre_techniques: ["T1018", "T1082", "T1592", "T1592.004"] + - mitre_tactics: ["TA0007"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + # 1.7.4 Ensure permissions on /etc/motd are configured (Automated) + - id: 29541 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root $(readlink -e /etc/motd) # chmod u-x,go-wx $(readlink -e /etc/motd) OR run the following command to remove the /etc/motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: any + rules: + - "not f:/etc/motd" + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.5 Ensure permissions on /etc/issue are configured (Automated) + - id: 29542 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue : # chown root:root $(readlink -e /etc/issue) # chmod u-x,go-wx $(readlink -e /etc/issue)." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured (Automated) + - id: 29543 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root $(readlink -e /etc/issue.net) # chmod u-x,go-wx $(readlink -e /etc/issue.net)." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + ############################################################ + # 1.8 GNOME Display Manager + ############################################################ + + # 1.8.1 Ensure GNOME Display Manager is removed (Automated) + - id: 29544 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + remediation: "Run the following command to uninstall gdm3: # apt purge gdm3." + impact: "Removing the GNOME Display manager will remove the Graphical User Interface (GUI) from the system." + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1543", "T1543.002"] + - mitre_tactics: ["TA0002"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' gdm3 -> r:unknown ok not-installed|dpkg-query: no packages found matching gdm3" + + # 1.8.2 Ensure GDM login banner is configured (Automated) - Not implemented + # 1.8.3 Ensure GDM disable-user-list option is enabled (Automated) - Not implemented + # 1.8.4 Ensure GDM screen locks when the user is idle (Automated) - Not implemented + # 1.8.5 Ensure GDM screen locks cannot be overridden (Automated) - Not implemented + # 1.8.6 Ensure GDM automatic mounting of removable media is disabled (Automated) - Not implemented + # 1.8.7 Ensure GDM disabling automatic mounting of removable media is not overridden - Not implemented + # 1.8.8 Ensure GDM autorun-never is enabled (Automated) - Not implemented + # 1.8.9 Ensure GDM autorun-never is not overridden (Automated) - Not implemented + + # 1.8.10 Ensure XDCMP is not enabled (Automated) + - id: 29545 + title: "Ensure XDCMP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server." + remediation: "Edit the file /etc/gdm3/custom.conf and remove the line: Enable=true." + compliance: + - cis: ["1.8.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1040", "T1056", "T1056.001", "T1557"] + - mitre_tactics: ["TA0002"] + - mitre_mitigations: ["M1050"] + condition: any + rules: + - "not f:/etc/gdm3/custom.conf" + - 'not f:/etc/gdm3/custom.conf -> r:^\s*Enable\s*=\s*true' + + # 1.9 Ensure updates, patches, and additional security software are installed (Automated) + - id: 29546 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Run the following command to update all packages following local site policy guidance on applying updates and patches: # apt upgrade OR # apt dist-upgrade." + compliance: + - cis: ["1.9"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - pci_dss_3.2.1: ["6.2"] + - nist_sp_800-53: ["SI-2(2)"] + - soc_2: ["CC7.1"] + condition: none + rules: + - "c:apt -s upgrade -> r:^The following packages will be upgraded" + + ############################################################ + # 2 Services + ############################################################ + + ############################################################ + # 2.1 Configure Time Synchronization + # 2.1.1 Ensure time synchronization is in use + ############################################################ + + # 2.1.1.1 Ensure a single time synchronization daemon is in use (Automated) - Not implemented + + ############################################################ + # 2.1.2 Configure chrony + ############################################################ + + # 2.1.2.1 Ensure chrony is configured with authorized timeserver (Manual) - Not Implemented + + # 2.1.2.2 Ensure chrony is running as user _chrony (Automated) + - id: 29547 + title: "Ensure chrony is running as user _chrony." + description: "The chrony package is installed with a dedicated user account _chrony. This account is granted the access required by the chronyd service." + rationale: "The chronyd service should run with only the required privileges." + remediation: "Add or edit the user line to /etc/chrony/chrony.conf or a file ending in .conf in /etc/chrony/conf.d/: user _chrony OR If another time synchronization service is in use on the system, run the following command to remove chrony from the system: # apt purge chrony." + compliance: + - cis: ["2.1.2.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - pci_dss_3.2.1: ["10.4"] + - pci_dss_4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - nist_sp_800-53: ["AU-7"] + - soc_2: ["CC4.1", "CC5.2"] + - iso_27001-2013: ["A.12.4.4"] + condition: all + rules: + - 'c:sh -c "ps -ef | grep chronyd | grep -v grep " -> r:chronyd\s' + - 'not c:sh -c "ps -ef |grep chronyd | grep -v grep " -> !r:^_chrony && r:chronyd\s' + + # 2.1.2.3 Ensure chrony is enabled and running (Automated) + - id: 29548 + title: "Ensure chrony is enabled and running." + description: "chrony is a daemon for synchronizing the system clock across the network." + rationale: "chrony needs to be enabled and running in order to synchronize the system to a timeserver. Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: "IF chrony is in use on the system, run the following commands: Run the following command to unmask chrony.service: # systemctl unmask chrony.service. Run the following command to enable and start chrony.service: # systemctl --now enable chrony.service OR If another time synchronization service is in use on the system, run the following command to remove chrony: # apt purge chrony." + compliance: + - cis: ["2.1.2.3"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - pci_dss_3.2.1: ["10.4"] + - pci_dss_4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - nist_sp_800-53: ["AU-7"] + - soc_2: ["CC4.1", "CC5.2"] + - iso_27001-2013: ["A.12.4.4"] + condition: all + rules: + - "c:systemctl is-enabled chrony.service -> r:^enabled" + - "c:systemctl is-active chrony.service -> r:^active" + + ############################################################ + # 2.1.3 Configure systemd-timesyncd + ############################################################ + + # 2.1.3.1 Ensure systemd-timesyncd configured with authorized timeserver (Manual) + - id: 29549 + title: "Ensure systemd-timesyncd configured with authorized timeserver." + description: "- NTP= > A space-separated list of NTP server host names or IP addresses. During runtime this list is combined with any per-interface NTP servers acquired from systemd-networkd.service(8). systemd-timesyncd will contact all configured system or per-interface servers in turn, until one responds. When the empty string is assigned, the list of NTP servers is reset, and all prior assignments will have no effect. This setting defaults to an empty list. - FallbackNTP= > A space-separated list of NTP server host names or IP addresses to be used as the fallback NTP servers. Any per-interface NTP servers obtained from systemd-networkd.service(8) take precedence over this setting, as do any servers set via NTP= above. This setting is hence only relevant if no other NTP server information is known. When the empty string is assigned, the list of NTP servers is reset, and all prior assignments will have no effect. If this option is not given, a compiled-in list of NTP servers is used." + rationale: "Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: 'Edit or create a file in /etc/systemd/timesyncd.conf.d ending in .conf and add the NTP= and/or FallbackNTP= lines to the [Time] section: Example: [Time] NTP=time.nist.gov # Uses the generic name for NIST''s time servers -AND/OR- FallbackNTP=time-a-g.nist.gov time-b-g.nist.gov time-c-g.nist.gov # Space separated list of NIST time servers Note: Servers added to these line(s) should follow local site policy. NIST servers are for example. The timesyncd.conf.d directory may need to be created. Example script: The following example script will create the systemd-timesyncd drop-in configuration snippet: #!/usr/bin/env bash ntp_ts="time.nist.gov" ntp_fb="time-a-g.nist.gov time-b-g.nist.gov time-c-g.nist.gov" disfile="/etc/systemd/timesyncd.conf.d/50-timesyncd.conf" if ! find /etc/systemd -type f -name ''*.conf'' -exec grep -Ph ''^\h*NTP=\H+'' {} +; then [ ! -d /etc/systemd/timesyncd.conf.d ] && mkdir /etc/systemd/timesyncd.conf.d ! grep -Pqs ''^\h*\[Time\]'' "$disfile" && echo "[Time]" >> "$disfile" echo "NTP=$ntp_ts" >> "$disfile" fi if ! find /etc/systemd -type f -name ''*.conf'' -exec grep -Ph ''^\h*FallbackNTP=\H+'' {} +; then [ ! -d /etc/systemd/timesyncd.conf.d ] && mkdir /etc/systemd/timesyncd.conf.d ! grep -Pqs ''^\h*\[Time\]'' "$disfile" && echo "[Time]" >> "$disfile" echo "FallbackNTP=$ntp_fb" >> "$disfile" fi Run the following command to reload the systemd-timesyncd configuration: # systemctl try-reload-or-restart systemd-timesyncd OR If another time synchronization service is in use on the system, run the following command to stop and mask systemd-timesyncd: # systemctl --now mask systemd-timesyncd.' + references: + - https://www.freedesktop.org/software/systemd/man/timesyncd.conf.html + - https://tf.nist.gov/tf-cgi/servers.cgi + compliance: + - cis: ["2.1.3.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - pci_dss_3.2.1: ["10.4"] + - pci_dss_4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - nist_sp_800-53: ["AU-7"] + - soc_2: ["CC4.1", "CC5.2"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - mitre_tactics: ["TA0002"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "d:/etc/systemd" + - 'd:/etc/systemd -> r:\.+.conf$' + - 'd:/etc/systemd -> r:\.+.conf$ -> r:^\s*\t*NTP=\w|^\s*\t*FallbackNTP=\w' + + # 2.1.3.2 Ensure systemd-timesyncd is enabled and running (Automated) + - id: 29550 + title: "Ensure systemd-timesyncd is enabled and running." + description: "systemd-timesyncd is a daemon that has been added for synchronizing the system clock across the network." + rationale: "systemd-timesyncd needs to be enabled and running in order to synchronize the system to a timeserver. Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: "IF systemd-timesyncd is in use on the system, run the following commands: Run the following command to unmask systemd-timesyncd.service: # systemctl unmask systemd-timesyncd.service. Run the following command to enable and start systemd-timesyncd.service: # systemctl --now enable systemd-timesyncd.service OR If another time synchronization service is in use on the system, run the following command to stop and mask systemd-timesyncd: # systemctl --now mask systemd-timesyncd.service." + compliance: + - cis: ["2.1.3.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - pci_dss_3.2.1: ["10.4"] + - pci_dss_4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - nist_sp_800-53: ["AU-7"] + - soc_2: ["CC4.1", "CC5.2"] + - iso_27001-2013: ["A.12.4.4"] + condition: all + rules: + - "c:systemctl is-enabled systemd-timesyncd.service -> r:^enabled" + - "c:systemctl is-active systemd-timesyncd.service -> r:^active" + + ############################################################ + # 2.1.4 Configure ntp + ############################################################ + + # 2.1.4.1 Ensure ntp access control is configured (Automated) + - id: 29551 + title: "Ensure ntp access control is configured." + description: 'ntp Access Control Commands: restrict address [mask mask] [ippeerlimit int] [flag ...]. The address argument expressed in dotted-quad form is the address of a host or network. Alternatively, the address argument can be a valid host DNS name. The mask argument expressed in dotted-quad form defaults to 255.255.255.255, meaning that the address is treated as the address of an individual host. A default entry (address 0.0.0.0, mask 0.0.0.0) is always included and is always the first entry in the list. Note: the text string default, with no mask option, may be used to indicate the default entry. The ippeerlimit directive limits the number of peer requests for each IP to int, where a value of -1 means "unlimited", the current default. A value of 0 means "none". There would usually be at most 1 peering request per IP, but if the remote peering requests are behind a proxy there could well be more than 1 per IP. In the current implementation, flag always restricts access, i.e., an entry with no flags indicates that free access to the server is to be given. The flags are not orthogonal, in that more restrictive flags will often make less restrictive ones redundant. The flags can generally be classed into two categories, those which restrict time service and those which restrict informational queries and attempts to do run-time reconfiguration of the server. One or more of the following flags may be specified: - kod - If this flag is set when an access violation occurs, a kiss-of-death (KoD) packet is sent. KoD packets are rate limited to no more than one per second. If another KoD packet occurs within one second after the last one, the packet is dropped. - limited - Deny service if the packet spacing violates the lower limits specified in the discard command. A history of clients is kept using the monitoring capability of ntpd. Thus, monitoring is always active as long as there is a restriction entry with the limited flag. - lowpriotrap - Declare traps set by matching hosts to be low priority. The number of traps a server can maintain is limited (the current limit is 3). Traps are usually assigned on a first come, first served basis, with later trap requestors being denied service. This flag modifies the assignment algorithm by allowing low priority traps to be overridden by later requests for normal priority traps. - noepeer - Deny ephemeral peer requests, even if they come from an authenticated source. Note that the ability to use a symmetric key for authentication may be restricted to one or more IPs or subnets via the third field of the ntp.keys file. This restriction is not enabled by default, to maintain backward compatibility. Expect noepeer to become the default in ntp-4.4. - nomodify - Deny ntpq and ntpdc queries which attempt to modify the state of the server (i.e., run time reconfiguration). Queries which return information are permitted. - noquery - Deny ntpq and ntpdc queries. Time service is not affected. - nopeer - Deny unauthenticated packets which would result in mobilizing a new association. This includes broadcast and symmetric active packets when a configured association does not exist. It also includes pool associations, so if you want to use servers from a pool directive and also want to use nopeer by default, you''ll want a restrict source ... line as well that does not include the nopeer directive. - noserve - Deny all packets except ntpq and ntpdc queries. - notrap - Decline to provide mode 6 control message trap service to matching hosts. The trap service is a subsystem of the ntpq control message protocol which is intended for use by remote event logging programs. - notrust - Deny service unless the packet is cryptographically authenticated. - ntpport - This is actually a match algorithm modifier, rather than a restriction flag. Its presence causes the restriction entry to be matched only if the source port in the packet is the standard NTP UDP port (123). Both ntpport and non-ntpport may be specified. The ntpport is considered more specific and is sorted later in the list.' + rationale: "If ntp is in use on the system, proper configuration is vital to ensuring time synchronization is accurate." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery OR If another time synchronization service is in use on the system, run the following command to remove ntp from the system: # apt purge ntp." + references: + - http://www.ntp.org/ + compliance: + - cis: ["2.1.4.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - pci_dss_3.2.1: ["10.4"] + - pci_dss_4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - nist_sp_800-53: ["AU-7"] + - soc_2: ["CC4.1", "CC5.2"] + - iso_27001-2013: ["A.12.4.4"] + condition: all + rules: + - "f:/etc/ntp.conf" + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod && r:\s+nomodify && r:\s+notrap && r:\s+nopeer && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod && r:\s+nomodify && r:\s+notrap && r:\s+nopeer && r:\s+noquery' + + # 2.1.4.2 Ensure ntp is configured with authorized timeserver (Manual) + - id: 29552 + title: "Ensure ntp is configured with authorized timeserver." + description: 'The various modes are determined by the command keyword and the type of the required IP address. Addresses are classed by type as (s) a remote server or peer (IPv4 class A, B and C), (b) the broadcast address of a local interface, (m) a multicast address (IPv4 class D), or (r) a reference clock address (127.127.x.x). Note: That only those options applicable to each command are listed below. Use of options not listed may not be caught as an error, but may result in some weird and even destructive behavior. If the Basic Socket Interface Extensions for IPv6 (RFC-2553) is detected, support for the IPv6 address family is generated in addition to the default support of the IPv4 address family. In a few cases, including the reslist billboard generated by ntpq or ntpdc, IPv6 addresses are automatically generated. IPv6 addresses can be identified by the presence of colons ":" in the address field. IPv6 addresses can be used almost everywhere where IPv4 addresses can be used, with the exception of reference clock addresses, which are always IPv4. Note: In contexts where a host name is expected, a -4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a -6 qualifier forces DNS resolution to the IPv6 namespace. See IPv6 references for the equivalent classes for that address family. - pool - For type s addresses, this command mobilizes a persistent client mode association with a number of remote servers. In this mode the local clock can synchronized to the remote server, but the remote server can never be synchronized to the local clock. - server - For type s and r addresses, this command mobilizes a persistent client mode association with the specified remote server or local radio clock. In this mode the local clock can synchronized to the remote server, but the remote server can never be synchronized to the local clock. This command should not be used for type b or m addresses.' + rationale: "Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: "Edit /etc/ntp.conf and add or edit server or pool lines as appropriate according to local site policy: <[server|pool]> <[remote-server|remote-pool]> Examples: pool mode: pool time.nist.gov iburst. server mode: server time-a-g.nist.gov iburst server 132.163.97.3 iburst server time-d-b.nist.gov iburst Run the following command to load the updated time sources into ntp running config: # systemctl restart ntp OR If another time synchronization service is in use on the system, run the following command to remove ntp from the system: # apt purge ntp." + references: + - http://www.ntp.org/ + - https://tf.nist.gov/tf-cgi/servers.cgi + compliance: + - cis: ["2.1.4.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - pci_dss_3.2.1: ["10.4"] + - pci_dss_4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - nist_sp_800-53: ["AU-7"] + - soc_2: ["CC4.1", "CC5.2"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_techniques: ["T1070", "T1070.002", "T1498", "T1498.002", "T1562", "T1562.001"] + - mitre_tactics: ["TA0002"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "f:/etc/ntp.conf" + - 'f:/etc/ntp.conf -> r:^\s*\t*pool' + + # 2.1.4.3 Ensure ntp is running as user ntp (Automated) + - id: 29553 + title: "Ensure ntp is running as user ntp." + description: "The ntp package is installed with a dedicated user account ntp. This account is granted the access required by the ntpd daemon. Note: - If chrony or systemd-timesyncd are used, ntp should be removed and this section skipped. - This recommendation only applies if ntp is in use on the system. - Only one time synchronization method should be in use on the system." + rationale: "The ntpd daemon should run with only the required privilege." + remediation: "Add or edit the following line in /etc/init.d/ntp: RUNASUSER=ntp. Run the following command to restart ntp.service: # systemctl restart ntp.service OR If another time synchronization service is in use on the system, run the following command to remove ntp from the system: # apt purge ntp." + references: + - http://www.ntp.org/ + compliance: + - cis: ["2.1.4.3"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - pci_dss_3.2.1: ["10.4"] + - pci_dss_4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - nist_sp_800-53: ["AU-7"] + - soc_2: ["CC4.1", "CC5.2"] + - iso_27001-2013: ["A.12.4.4"] + condition: all + rules: + - 'f:/etc/init.d/ntp -> r:^\s*\t*RUNASUSER\s*\t*=\s*\t*ntp$' + - 'c:sh -c "ps -ef | grep ntpd | grep -v grep " -> r:ntpd\s' + - 'not c:sh -c "ps -ef |grep ntpd | grep -v grep " -> !r:^ntp && r:ntpd\s' + + # 2.1.4.4 Ensure ntp is enabled and running (Automated) + - id: 29554 + title: "Ensure ntp is enabled and running." + description: "ntp is a daemon for synchronizing the system clock across the network." + rationale: "ntp needs to be enabled and running in order to synchronize the system to a timeserver. Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: "IF ntp is in use on the system, run the following commands: Run the following command to unmask ntp.service: # systemctl unmask ntp.service Run the following command to enable and start ntp.service: # systemctl --now enable ntp.service OR If another time synchronization service is in use on the system, run the following command to remove ntp: # apt purge ntp." + compliance: + - cis: ["2.1.4.4"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - pci_dss_3.2.1: ["10.4"] + - pci_dss_4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - nist_sp_800-53: ["AU-7"] + - soc_2: ["CC4.1", "CC5.2"] + - iso_27001-2013: ["A.12.4.4"] + condition: all + rules: + - "c:systemctl is-enabled ntp.service -> r:^enabled" + - "c:systemctl is-active ntp.service -> r:^active" + + ############################################################ + # 2.2 Special Purpose Services + ############################################################ + + # 2.2.1 Ensure X Window System is not installed (Automated) + - id: 29555 + title: "Ensure X Window System is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: 'Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime, if provided by your distribution.' + remediation: "Remove the X Windows System packages: apt purge xserver-xorg*." + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' xserver-xorg -> r:unknown ok not-installed|dpkg-query: no packages found matching xserver-xorg" + + # 2.2.2 Ensure Avahi Server is not installed (Automated) + - id: 29556 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to remove avahi-daemon: # systemctl stop avahi-daaemon.service # systemctl stop avahi-daemon.socket # apt purge avahi-daemon." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' avahi-daemon -> r:unknown ok not-installed|dpkg-query: no packages found matching avahi-daemon" + + # 2.2.3 Ensure CUPS is not installed (Automated) + - id: 29557 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface." + impact: "Removing CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run one of the following commands to remove cups: # apt purge cups." + references: + - http://www.cups.org + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' cups -> r:unknown ok not-installed|dpkg-query: no packages found matching cups" + + # 2.2.4 Ensure DHCP Server is not installed (Automated) + - id: 29558 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove isc-dhcp-server: # apt purge isc-dhcp-server." + references: + - http://www.isc.org/software/dhcp + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' isc-dhcp-server -> r:unknown ok not-installed|dpkg-query: no packages found matching isc-dhcp-server" + + # 2.2.5 Ensure LDAP server is not installed (Automated) + - id: 29559 + title: "Ensure LDAP server is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run one of the following commands to remove slapd: # apt purge slapd." + references: + - http://www.openldap.org + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' slapd -> r:unknown ok not-installed|dpkg-query: no packages found matching slapd" + + # 2.2.6 Ensure NFS is not installed (Automated) + - id: 29560 + title: "Ensure NFS is not installed." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares, it is recommended that the nfs-kernel-server package be removed to reduce the remote attack surface." + remediation: "Run the following command to remove nfs: # apt purge nfs-kernel-server." + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nfs-kernel-server -> r:unknown ok not-installed|dpkg-query: no packages found matching nfs-kernel-server" + + # 2.2.7 Ensure DNS Server is not installed (Automated) + - id: 29561 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following commands to disable DNS server: # apt purge bind9." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' bind9 -> r:unknown ok not-installed|dpkg-query: no packages found matching bind9" + + # 2.2.8 Ensure FTP Server is not installed (Automated) + - id: 29562 + title: "Ensure FTP Server is not installed." + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # apt purge vsftpd." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' vsftpd -> r:unknown ok not-installed|dpkg-query: no packages found matching vsftpd" + + # 2.2.9 Ensure HTTP server is not installed (Automated) + - id: 29563 + title: "Ensure HTTP server is not installed." + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove apache: # apt purge apache2." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' apache2 -> r:unknown ok not-installed|dpkg-query: no packages found matching apache2" + + # 2.2.10 Ensure IMAP and POP3 server are not installed(Automated) + - id: 29564 + title: "Ensure IMAP and POP3 server are not installed." + description: "dovecot-imapd and dovecot-pop3d are an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run one of the following commands to remove dovecot-imapd and dovecot-pop3d: # apt purge dovecot-imapd dovecot-pop3d." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' dovecot-imapd -> r:unknown ok not-installed|dpkg-query: no packages found matching dovecot-imapd" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' dovecot-pop3d -> r:unknown ok not-installed|dpkg-query: no packages found matching dovecot-pop3d" + + # 2.2.11 Ensure Samba is not installed (Automated) + - id: 29565 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service should be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # apt purge samba." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1005", "T1039", "T1083", "T1135", "T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' samba -> r:unknown ok not-installed|dpkg-query: no packages found matching samba" + + # 2.2.12 Ensure HTTP Proxy Server is not installed (Automated) + - id: 29566 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove squid: # apt purge squid." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' squid -> r:unknown ok not-installed|dpkg-query: no packages found matching squid" + + # 2.2.13 Ensure SNMP Server is not installed (Automated) + - id: 29567 + title: "Ensure SNMP Server is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. - If SNMP v2 is absolutely necessary, modify the community strings' values." + remediation: "Run the following command to remove snmp: # apt purge snmp." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' snmp -> r:unknown ok not-installed|dpkg-query: no packages found matching snmp" + + # 2.2.14 Ensure NIS Server is not installed (Automated) + - id: 29568 + title: "Ensure NIS Server is not installed." + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed and other, more secure services be used." + remediation: "Run the following command to remove nis: # apt purge nis." + compliance: + - cis: ["2.2.14"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nis -> r:unknown ok not-installed|dpkg-query: no packages found matching nis" + + # 2.2.15 Ensure mail transfer agent is configured for local-only mode (Automated) + - id: 29569 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Note: This recommendation is designed around the postfix mail server. Depending on your environment you may have an alternative MTA installed such as exim4. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only. Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1018", "T1210"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: none + rules: + - 'c:ss -lntu -> r:\.*:25 && r:\.*LISTEN && !r:127.0.0.1:25|[::1]:25' + + # 2.2.16 Ensure rsync service is either not installed or masked (Automated) + - id: 29570 + title: "Ensure rsync service is either not installed or masked." + description: "The rsync service can be used to synchronize files between systems over network links." + rationale: "The rsync service presents a security risk as it uses unencrypted protocols for communication. The rsync package should be removed to reduce the attack area of the system." + remediation: "Run the following command to remove rsync: # apt purge rsync OR Run the following commands to stop and mask rsync: # systemctl stop rsync # systemctl mask rsync." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1105", "T1203", "T1210", "T1543", "T1543.002", "T1570"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' rsync -> r:unknown ok not-installed|dpkg-query: no packages found matching rsync" + - "c:systemctl is-active rsync -> r:^inactive" + - "c:systemctl is-enabled rsync -> r:^masked" + + ############################################################ + # 2.3 Service Clients + ############################################################ + # 2.3.1 Ensure NIS Client is not installed (Automated) + - id: 29571 + title: "Ensure NIS Client is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall nis: # apt purge nis." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nis -> r:unknown ok not-installed|dpkg-query: no packages found matching nis" + + # 2.3.2 Ensure rsh client is not installed (Automated) + - id: 29572 + title: "Ensure rsh client is not installed." + description: "The rsh-client package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh, rcp and rlogin." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall rsh: # apt purge rsh-client." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1040", "T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1041", "M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' rsh-client -> r:unknown ok not-installed|dpkg-query: no packages found matching rsh-client" + + # 2.3.3 Ensure talk client is not installed (Automated) + - id: 29573 + title: "Ensure talk client is not installed." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall talk: # apt purge talk." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0006", "TA0008"] + - mitre_mitigations: ["M1041", "M1042"] + condition: all + rules: + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' talk -> r:install ok installed|dpkg-query: no packages found matching talk" + + # 2.3.4 Ensure telnet client is not installed (Automated) + - id: 29574 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall telnet: # apt purge telnet." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1040", "T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0006", "TA0008"] + - mitre_mitigations: ["M1041", "M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' telnet -> r:unknown ok not-installed|dpkg-query: no packages found matching telnet" + + # 2.3.5 Ensure LDAP client is not installed (Automated) + - id: 29575 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Uninstall ldap-utils: # apt purge ldap-utils." + compliance: + - cis: ["2.3.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' ldap-utils -> r:unknown ok not-installed|dpkg-query: no packages found matching ldap-utils" + + # 2.3.6 Ensure RPC is not installed (Automated) + - id: 29576 + title: "Ensure RPC is not installed." + description: "Remote Procedure Call (RPC) is a method for creating low level client server applications across different system architectures. It requires an RPC compliant client listening on a network port. The supporting package is rpcbind." + rationale: "If RPC is not required, it is recommended that this services be removed to reduce the remote attack surface." + remediation: "Run the following command to remove rpcbind: # apt purge rpcbind." + compliance: + - cis: ["2.3.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' rpcbind -> r:unknown ok not-installed|dpkg-query: no packages found matching rpcbind" + + # 2.4 Ensure nonessential services are removed or masked (Manual) - Not Implemented + + ############################################################ + # 3 Network Configuration + ############################################################ + + ############################################################ + # 3.1 Disable unused network protocols and devices + ############################################################ + + # 3.1.1 Ensure system is checked to determine if IPv6 is enabled (Manual) - Not Implemented + # 3.1.2 Ensure wireless interfaces are disabled (Automated) - Not Implemented + # 3.1.3 Ensure DCCP is disabled (Automated) - Not Implemented + # 3.1.4 Ensure SCTP is disabled (Automated) - Not Implemented + # 3.1.5 Ensure RDS is disabled (Automated) - Not Implemented + # 3.1.6 Ensure TIPC is disabled (Automated) - Not Implemented + + ############################################################ + # 3.2 Network Parameters (Host Only) + ############################################################ + + # 3.2.1 Ensure packet redirect sending is disabled (Automated) - Not Implemented + # 3.2.2 Ensure IP forwarding is disabled (Automated) - Not Implemented + # 3.3.1 Ensure source routed packets are not accepted (Automated) - Not Implemented + # 3.3.2 Ensure ICMP redirects are not accepted (Automated) - Not Implemented + # 3.3.3 Ensure secure ICMP redirects are not accepted (Automated) - Not Implemented + # 3.3.4 Ensure suspicious packets are logged (Automated) - Not Implemented + # 3.3.5 Ensure broadcast ICMP requests are ignored (Automated) - Not Implemented + # 3.3.6 Ensure bogus ICMP responses are ignored (Automated) - Not Implemented + # 3.3.7 Ensure Reverse Path Filtering is enabled (Automated) - Not Implemented + # 3.3.8 Ensure TCP SYN Cookies is enabled (Automated) - Not Implemented + # 3.3.9 Ensure IPv6 router advertisements are not accepted (Automated) - Not Implemented + + ############################################################ + # 3.5 Firewall Configuration + ############################################################ + + ############################################################ + # 3.5.1 Configure UncomplicatedFirewall + ############################################################ + + # 3.5.1.1.Ensure ufw is installed (Automated) + - id: 29577 + title: "Ensure ufw is installed." + description: "The Uncomplicated Firewall (ufw) is a frontend for iptables and is particularly well-suited for host-based firewalls. ufw provides a framework for managing netfilter, as well as a command-line interface for manipulating the firewall." + rationale: "A firewall utility is required to configure the Linux kernel's netfilter framework via the iptables or nftables back-end. The Linux kernel's netfilter framework host-based firewall can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host. Note: Only one firewall utility should be installed and configured. UFW is dependent on the iptables package." + remediation: "Run the following command to install Uncomplicated Firewall (UFW): # apt install ufw." + compliance: + - cis: ["3.5.1.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' ufw -> r:install ok installed" + + # 3.5.1.2 Ensure iptables-persistent is not installed with ufw (Automated) + - id: 29578 + title: "Ensure iptables-persistent is not installed with ufw." + description: "The iptables-persistent is a boot-time loader for netfilter rules, iptables plugin." + rationale: "Running both ufw and the services included in the iptables-persistent package may lead to conflict." + remediation: "Run the following command to remove the iptables-persistent package: # apt purge iptables-persistent." + compliance: + - cis: ["3.5.1.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' ufw -> r:install ok installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' iptables-persistent -> r:unknown ok not-installed|dpkg-query: no packages found matching iptables-persistent" + + # 3.5.1.3 Ensure ufw service is enabled (Automated) + - id: 29579 + title: "Ensure ufw service is enabled." + description: "UncomplicatedFirewall (ufw) is a frontend for iptables. ufw provides a framework for managing netfilter, as well as a command-line and available graphical user interface for manipulating the firewall. Notes: - When running ufw enable or starting ufw via its initscript, ufw will flush its chains. This is required so ufw can maintain a consistent state, but it may drop existing connections (eg ssh). ufw does support adding rules before enabling the firewall. - Run the following command before running ufw enable. # ufw allow proto tcp from any to any port 22. - The rules will still be flushed, but the ssh port will be open after enabling the firewall. Please note that once ufw is 'enabled', ufw will not flush the chains when adding or removing rules (but will when modifying a rule or changing the default policy). - By default, ufw will prompt when enabling the firewall while running under ssh. This can be disabled by using ufw --force enable." + rationale: "The ufw service must be enabled and running in order for ufw to protect the system." + impact: "Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following command to unmask the ufw daemon: # systemctl unmask ufw.service. Run the following command to enable and start the ufw daemon: # systemctl --now enable ufw.service active Run the following command to enable ufw: # ufw enable." + referencces: + - http://manpages.ubuntu.com/manpages/precise/en/man8/ufw.8.html + compliance: + - cis: ["3.5.1.3"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:systemctl is-enabled ufw.service -> r:^enabled" + - "c:systemctl is-active ufw -> r:^active" + - 'c:ufw status -> r:\sactive' + + # 3.5.1.4 Ensure ufw loopback traffic is configured (Automated) + - id: 29580 + title: "Ensure ufw loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8 for IPv4 and ::1/128 for IPv6)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8 for IPv4 and ::1/128 for IPv6) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ufw allow in on lo # ufw allow out on lo # ufw deny in from 127.0.0.0/8 # ufw deny in from ::1." + compliance: + - cis: ["3.5.1.4"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - 'c:ufw status verbose -> r:Anywhere on lo\s*\t*ALLOW IN\s*\t*Anywhere' + - 'c:ufw status verbose -> r:Anywhere\s*\t*DENY IN\s*\t*127.0.0.0/8' + - 'c:ufw status verbose -> r:Anywhere \(v6\) on lo\s*\t*ALLOW IN\s*\t*Anywhere \(v6\)' + - 'c:ufw status verbose -> r:Anywhere \(v6\)\s*\t*DENY IN\s*\t*::1' + - 'c:ufw status verbose -> r:Anywhere\s*\t*ALLOW OUT\s*\t*Anywhere on lo' + - 'c:ufw status verbose -> r:Anywhere \(v6\)\s*\t*ALLOW OUT\s*\t*Anywhere \(v6\) on lo' + - "c:systemctl is-enabled ufw.service -> r:^enabled" + + # 3.5.1.5 Ensure ufw outbound connections are configured (Manual) - Not Implemented + # 3.5.1.6 Ensure ufw firewall rules exist for all open ports (Automated) - Not Implemented + + # 3.5.1.7 Ensure ufw default deny firewall policy (Automated) + - id: 29581 + title: "Ensure ufw default deny firewall policy." + description: "A default deny policy on connections ensures that any unconfigured network usage will be rejected. Note: Any port or protocol without a explicit allow before the default deny will be blocked." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + impact: "Any port and protocol not explicitly allowed will be blocked. The following rules should be considered before applying the default deny. ufw allow git, ufw allow in http, ufw allow out http <- required for apt to connect to repository, ufw allow in https, ufw allow out https, ufw allow out 53, ufw logging on." + remediation: "Run the following commands to implement a default deny policy: # ufw default deny incoming # ufw default deny outgoing # ufw default deny routed." + compliance: + - cis: ["3.5.1.7"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - 'c:ufw status verbose -> r:^Default && r:deny\s+\(incoming\)|reject\s+\(incoming\)|disabled\s+\(incoming\) && r:deny\s+\(outgoing\)|reject\s+\(outgoing\)|disabled\s+\(outgoing\) && r:deny\s+\(routed\)|reject\s+\(routed\)|disabled\s+\(routed\)' + - "c:systemctl is-enabled ufw.service -> r:^enabled" + - 'c:ufw status -> r:\sactive' + + ############################################################ + # 3.5.2 Configure nftables + ############################################################ + + # 3.5.2.1 Ensure nftables is installed (Automated) + - id: 29582 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem. Notes: - nftables is available in Linux kernel 3.13 and newer. - Only one firewall utility should be installed and configured. - Changing firewall settings while connected over the network can result in being locked out of the system." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + remediation: "Run the following command to install nftables: # apt install nftables." + compliance: + - cis: ["3.5.2.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nftables -> r:install ok installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' ufw -> r:unknown ok not-installed|dpkg-query: no packages found matching ufw|deinstall ok config-files" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' iptables -> r:unknown ok not-installed|dpkg-query: no packages found matching iptables|deinstall ok config-files" + + # 3.5.2.2 Ensure ufw is uninstalled or disabled with nftables (Automated) + - id: 29583 + title: "Ensure ufw is uninstalled or disabled with nftables." + description: "Uncomplicated Firewall (UFW) is a program for managing a netfilter firewall designed to be easy to use." + rationale: "Running both the nftables service and ufw may lead to conflict and unexpected results." + remediation: "Run one of the following commands to either remove ufw or disable ufw. Run the following command to remove ufw: # apt purge ufw. Run the following command to disable ufw: # ufw disable." + compliance: + - cis: ["3.5.2.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nftables -> r:install ok installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' ufw -> r:unknown ok not-installed|dpkg-query: no packages found matching ufw|deinstall ok config-files" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' iptables -> r:unknown ok not-installed|dpkg-query: no packages found matching iptables|deinstall ok config-files" + + # 3.5.2.3 Ensure iptables are flushed with nftables (Manual) - Not Implemented + - id: 29584 + title: "Ensure iptables are flushed with nftables." + description: "nftables is a replacement for iptables, ip6tables, ebtables and arptables." + rationale: "It is possible to mix iptables and nftables. However, this increases complexity and also the chance to introduce errors. For simplicity flush out all iptables rules, and ensure it is not loaded." + remediation: "Run the following commands to flush iptables: For iptables: # iptables -F For ip6tables: # ip6tables -F." + compliance: + - cis: ["3.5.2.3"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nftables -> r:install ok installed" + - 'not c:sh -c "iptables -L | grep -Evi ''^chain|^target''" -> r:^\w+' + - 'not c:sh -c "ip6tables -L | grep -Evi ''^chain|^target''" -> r:^\w+' + + # 3.5.2.4 Ensure a nftables table exists (Automated) + - id: 29585 + title: "Ensure a nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + impact: "Adding rules to a running nftables can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables: # nft create table inet
Example: # nft create table inet filter." + compliance: + - cis: ["3.5.2.4"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - 'c:nft list tables -> r:^table\s' + + # 3.5.2.5 Ensure nftables base chains exist (Automated) + - id: 29586 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; }. Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.5.2.5"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input" + - "c:nft list ruleset -> r:hook forward" + - "c:nft list ruleset -> r:hook output" + + # 3.5.2.6 Ensure nftables loopback traffic is configured (Automated) + - id: 29587 + title: "Ensure nftables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # nft add rule inet filter input iif lo accept # nft create rule inet filter input ip saddr 127.0.0.0/8 counter drop. IF IPv6 is enabled on the system: Run the following command to implement the IPv6 loopback rule: # nft add rule inet filter input ip6 saddr ::1 counter drop." + compliance: + - cis: ["3.5.2.6"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:sh -c "nft list ruleset | awk ''/hook input/,/}/''" -> r:iif "lo" accept' + - 'c:sh -c "nft list ruleset | awk ''/hook input/,/}/''" -> r:ip saddr 127.0.0.0/8' + - 'c:sh -c "nft list ruleset | awk ''/hook input/,/}/''" -> r:ip6 saddr ::1' + + # 3.5.2.7 Ensure nftables outbound and established connections are configured (Manual) - Not Implemented" + + # 3.5.2.8 Ensure nftables default deny firewall policy (Automated) + - id: 29588 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue transversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; }. Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; } # nft chain inet filter output { policy drop \\; }." + compliance: + - cis: ["3.5.2.8"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - "not c:nft list ruleset -> r:hook input && !r:policy drop" + - "not c:nft list ruleset -> r:hook forward && !r:policy drop" + - "not c:nft list ruleset -> r:hook output && !r:policy drop" + + # 3.5.2.9 Ensure nftables service is enabled (Automated) + - id: 29589 + title: "Ensure nftables service is enabled." + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables." + compliance: + - cis: ["3.5.2.9"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - "c:systemctl is-enabled nftables -> r:enabled" + + # 3.5.2.10 Ensure nftables rules are permanent (Automated) - Not implemented + + ############################################################ + # 3.5.3 Configure iptables + ############################################################ + + ############################################################ + # 3.5.3.1 Configure iptables software + ############################################################ + + # 3.5.3.1.1 Ensure iptables packages are installed (Automated) + - id: 29590 + title: "Ensure iptables packages are installed." + description: "iptables is a utility program that allows a system administrator to configure the tables provided by the Linux kernel firewall, implemented as different Netfilter modules, and the chains and rules it stores. Different kernel modules and programs are used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames." + rationale: "A method of configuring and maintaining firewall rules is necessary to configure a Host Based Firewall." + remediation: "Run the following command to install iptables and iptables-persistent # apt install iptables iptables-persistent." + compliance: + - cis: ["3.5.3.1.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - "c:apt list iptables -> r:installed" + - "c:apt list iptables-persistent -> r:installed" + + # 3.5.3.1.2 Ensure nftables is not installed with iptables (Automated) + - id: 29591 + title: "Ensure nftables is not installed with iptables." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables." + rationale: "Running both iptables and nftables may lead to conflict." + remediation: "Run the following command to remove nftables: # apt purge nftables." + compliance: + - cis: ["3.5.3.1.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + condition: all + rules: + - "c:apt list iptables -> r:installed" + - "c:apt list iptables-persistent -> r:installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nftables -> r:unknown ok not-installed|dpkg-query: no packages found matching nftables|deinstall ok config-files" + + # 3.5.3.1.3 Ensure ufw is uninstalled or disabled with iptables (Automated) + - id: 29592 + title: "Ensure ufw is uninstalled or disabled with iptables." + description: "Uncomplicated Firewall (UFW) is a program for managing a netfilter firewall designed to be easy to use. - Uses a command-line interface consisting of a small number of simple commands. - Uses iptables for configuration." + rationale: "Running iptables.persistent with ufw enabled may lead to conflict and unexpected results." + remediation: "Run one of the following commands to either remove ufw or stop and mask ufw Run the following command to remove ufw: # apt purge ufw OR Run the following commands to disable ufw: # ufw disable # systemctl stop ufw # systemctl mask ufw." + compliance: + - cis: ["3.5.3.1.3"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' ufw -> r:unknown ok not-installed|dpkg-query: no packages found matching ufw|deinstall ok config-files" + - "c:ufw status -> r:inactive" + - "c:systemctl is-enabled ufw -> r:masked" + + ############################################################ + # 3.5.3.2 Configure IPv4 iptables + ############################################################ + + # 3.5.3.2.1 Ensure iptables default deny firewall policy (Automated) + - id: 29593 + title: "Ensure iptables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected. Notes: - Changing firewall settings while connected over network can result in being locked out of the system. - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP." + compliance: + - cis: ["3.5.3.2.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)|Chain INPUT \(policy REJECT\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)|Chain FORWARD \(policy REJECT\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)|Chain OUTPUT \(policy REJECT\)' + + # 3.5.3.2.2 Ensure iptables loopback traffic is configured (Automated) + - id: 29594 + title: "Ensure iptables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8). Notes: - Changing firewall settings while connected over network can result in being locked out of the system. - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP." + compliance: + - cis: ["3.5.3.2.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + # 3.5.3.2.3 Ensure iptables outbound and established connections are configured (Manual) - Not Implemented + # 3.5.3.2.4 Ensure iptables firewall rules exist for all open ports (Automated) - Not Implemented + + ############################################################ + # 3.5.3.3 Configure IPv6 ip6tables + ############################################################ + + # 3.5.3.3.1 Ensure ip6tables default deny firewall policy (Automated) + - id: 29595 + title: "Ensure ip6tables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected. Note: - Changing firewall settings while connected over network can result in being locked out of the system. - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP." + compliance: + - cis: ["3.5.3.3.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - "c:ip6tables -L -> r:^Chain INPUT && r:policy DROP" + - "c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP" + + # 3.5.3.3.2 Ensure ip6tables loopback traffic is configured (Automated) + - id: 29596 + title: "Ensure ip6tables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1). Note: - Changing firewall settings while connected over network can result in being locked out of the system. - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP." + compliance: + - cis: ["3.5.3.3.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - nist_sp_800-53: ["SC-7(5)"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + # 3.5.3.3.3 Ensure ip6tables outbound and established connections are configured (Manual) + # 3.5.3.3.4 Ensure ip6tables firewall rules exist for all open ports (Automated) - Not Implemented + + ############################################################ + # 4 Logging and Auditing + ############################################################ + + ############################################################ + # 4.1 Configure System Accounting (auditd) + # 4.1.1 Ensure auditing is enabled + ############################################################ + + # 4.1.1.1 Ensure auditd is installed (Automated) + - id: 29597 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd: # apt install auditd audispd-plugins." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' auditd -> r:install ok installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' audispd-plugins -> r:install ok installed" + + # 4.1.1.2 Ensure auditd service is enabled and active (Automated) + - id: 29598 + title: "Ensure auditd service is enabled and active." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable and start auditd: # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:^enabled" + - "c:systemctl is-active auditd -> r:^active" + + # 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled (Automated) + - id: 29599 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd , so that potential malicious activity cannot go undetected." + remediation: 'Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: Example: GRUB_CMDLINE_LINUX="audit=1". Run the following command to update the grub2 configuration: # update-grub.' + compliance: + - cis: ["4.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'not f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !n:audit=(\d+) compare == 1' + + # 4.1.1.4 Ensure audit_backlog_limit is sufficient (Automated) + - id: 29600 + title: "Ensure audit_backlog_limit is sufficient." + description: "In the kernel-level audit subsystem, a socket buffer queue is used to hold audit events. Whenever a new audit event is received, it is logged and prepared to be added to this queue. The kernel boot parameter audit_backlog_limit=N, with N representing the amount of messages, will ensure that a queue cannot grow beyond a certain size. If an audit event is logged which would grow the queue beyond this limit, then a failure occurs and is handled according to the system configuration." + rationale: "If an audit event is logged which would grow the queue beyond the audit_backlog_limit, then a failure occurs, auditd records will be lost, and potential malicious activity could go undetected." + remediation: 'Edit /etc/default/grub and add audit_backlog_limit=N to GRUB_CMDLINE_LINUX. The recommended size for N is 8192 or larger. Example: GRUB_CMDLINE_LINUX="audit_backlog_limit=8192". Run the following command to update the grub2 configuration: # update-grub.' + compliance: + - cis: ["4.1.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'not f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !n:audit_backlog_limit=(\d+) compare >= 8192' + + ############################################################ + # 4.1.2 Configure Data Retention + ############################################################ + + # 4.1.2.1 Ensure audit log storage size is configured (Automated) + - id: 29601 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - pci_dss_3.2.1: ["10.7"] + - soc_2: ["A1.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1053"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' + + # 4.1.2.2 Ensure audit logs are not automatically deleted (Automated) + - id: 29602 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - pci_dss_3.2.1: ["10.7"] + - soc_2: ["A1.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1053"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full (Automated) + - id: 29603 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full. The admin_space_left_action parameter tells the system what action to take when the system has detected that it is low on disk space. Valid values are ignore, syslog, suspend, single, and halt. - ignore, the audit daemon does nothing. - Syslog, the audit daemon will issue a warning to syslog. - Suspend, the audit daemon will stop writing records to the disk. - single, the audit daemon will put the computer system in single user mode. - halt, the audit daemon will shutdown the system." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + impact: "If the admin_space_left_action parameter is set to halt the audit daemon will shutdown the system when the disk partition containing the audit logs becomes full." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root set admin_space_left_action to either halt or single in /etc/audit/auditd.conf. Example: admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - soc_2: ["A1.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*\t*=\s*\t*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*\t*=\s*\t*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*\t*=\s*\t*halt|^\s*\t*admin_space_left_action\s*\t*=\s*\t*single' + + ############################################################ + # 4.1.3 Configure auditd rules + ############################################################ + + # 4.1.3.1 Ensure changes to system administration scope (sudoers) is collected (Automated) + - id: 29604 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers, or files in /etc/sudoers.d, will be written to when the file(s) or related attributes have changed. The audit records will be tagged with the identifier "scope".' + rationale: "Changes in the /etc/sudoers and /etc/sudoers.d files can indicate that an unauthorized change has been made to the scope of system administrator activity." + remediation: 'Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor scope changes for system administrators. Example: # printf " -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d -p wa -k scope " >> /etc/audit/rules.d/50-scope.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n";fi.' + compliance: + - cis: ["4.1.3.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1047"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=scope' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=scope' + - "c:auditctl -l -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=scope" + - "c:auditctl -l -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=scope" + + # 4.1.3.2 Ensure actions as another user are always logged (Automated) + - id: 29605 + title: "Ensure actions as another user are always logged." + description: "sudo provides users with temporary elevated privileges to perform operations, either as the superuser or another user." + rationale: "Creating an audit log of users with temporary elevated privileges and the operation(s) they performed is essential to reporting. Administrators will want to correlate the events written to the audit trail with the records written to sudo's logfile to verify if unauthorized commands have been executed." + remediation: 'Create audit rules: Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor elevated privileges. - 64 Bit systems Example: # printf " -a always,exit -F arch=b64 -C euid!=uid -F auid!=unset -S execve -k user_emulation -a always,exit -F arch=b32 -C euid!=uid -F auid!=unset -S execve -k user_emulation " >> /etc/audit/rules.d/50-user_emulation.rules - Load audit rules: Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi - 32 Bit systems: Follow the same procedures as for 64 bit systems and ignore any entries with b64.' + compliance: + - cis: ["4.1.3.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1047"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + + # 4.1.3.3 Ensure events that modify the sudo log file are collected (Automated) - Not Implemented + + # 4.1.3.4 Ensure events that modify date and time information are collected (Automated) + - id: 29606 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the; - adjtimex: tune kernel clock. - settimeofday: set time using timeval and timezone structures. - stime: using seconds since 1/1/1970. - clock_settime: allows for the setting of several internal clocks and timers system calls have been executed. Further, ensure to write an audit record to the configured audit log file upon exit, tagging the records with a unique identifier such as "time-change".' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: 'Create audit rules: Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify date and time information. - 64 Bit systems Example: # printf " -a always,exit -F arch=b64 -S adjtimex,settimeofday,clock_settime -k time-change -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime -k time-change -w /etc/localtime -p wa -k time-change " >> /etc/audit/rules.d/50-time-change.rules - Load audit rules: Merge and load the rules into active configuration: # augenrules --load .Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi 32 Bit systems: Follow the same procedures as for 64 bit systems and ignore any entries with b64. In addition, add stime to the system call audit. Example: -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime,stime -k time-change.' + compliance: + - cis: ["4.1.3.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change' + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change" + + # 4.1.3.5 Ensure events that modify the system's network environment are collected (Automated) + - id: 29607 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitors the following system calls, and write an audit event on system call exit: - sethostname: set the systems host name. - setdomainname: set the systems domain name. The files being monitored are: > /etc/issue and /etc/issue.net - messages displayed pre-login. > /etc/hosts - file containing host names and associated IP addresses. > /etc/networks - symbolic names for networks. > /etc/network/ - directory containing network interface scripts and configurations files." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records should have a relevant tag associated with them." + remediation: 'Create audit rules: Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system''s network environment. - 64 Bit systems: Example: # printf " -a always,exit -F arch=b64 -S sethostname,setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname,setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/networks -p wa -k system-locale -w /etc/network/ -p wa -k system-locale " >> /etc/audit/rules.d/50-system_local.rules - Load audit rules: Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi - 32 Bit systems: Follow the same procedures as for 64 bit systems and ignore any entries with b64.' + compliance: + - cis: ["4.1.3.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1047"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/networks && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/network/|/etc/network/\s && r:-p wa && r:-k system-locale|key=system-locale' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/networks && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/network/|/etc/network/\\s && r:-p wa && r:-k system-locale|key=system-locale" + + # 4.1.3.6 Ensure use of privileged commands are collected (Automated) - Not Implemented + + # 4.1.3.7 Ensure unsuccessful file access attempts are collected (Automated) + - id: 29608 + title: "Ensure unsuccessful file access attempts are collected." + description: "Monitor for unsuccessful attempts to access files. The following parameters are associated with system calls that control files: - creation - creat. - opening - open, openat. - truncation - truncate, ftruncate. An audit log record will only be written if all of the following criteria is met for the user when trying to access a file: - a non-privileged user (auid>=UID_MIN). - is not a Daemon event (auid=4294967295/unset/-1). - if the system call returned EACCES (permission denied) or EPERM (some other permanent error associated with the specific system call)." + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: 'Create audit rules: Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor unsuccessful file access attempts. 64 Bit systems Example: #{ UID_MIN=$(awk ''/^\s*UID_MIN/{print $2}'' /etc/login.defs) [ -n "${UID_MIN}" ] && printf " -a always,exit -F arch=b64 -S creat,open,openat,truncate,ftruncate -F exit=-EACCES -F auid>=${UID_MIN} -F auid!=unset -k access -a always,exit -F arch=b64 -S creat,open,openat,truncate,ftruncate -F exit=-EPERM -F auid>=${UID_MIN} -F auid!=unset -k access -a always,exit -F arch=b32 -S creat,open,openat,truncate,ftruncate -F exit=-EACCES -F auid>=${UID_MIN} -F auid!=unset -k access -a always,exit -F arch=b32 -S creat,open,openat,truncate,ftruncate -F exit=-EPERM -F auid>=${UID_MIN} -F auid!=unset -k access " >> /etc/audit/rules.d/50-access.rules || printf "ERROR: Variable ''UID_MIN'' is unset.\n" } Load audit rules: Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi. 32 Bit systems: Follow the same procedures as for 64 bit systems and ignore any entries with b64.' + compliance: + - cis: ["4.1.3.7"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EACCES && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EACCES && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EPERM && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EPERM && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EACCES && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EACCES && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EPERM && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EPERM && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + + # 4.1.3.8 Ensure events that modify user/group information are collected (Automated) + - id: 29609 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the modification of user or group information, including that of passwords and old passwords if in use. - /etc/group: system groups. - /etc/passwd: system users. - /etc/gshadow: encrypted password for each group. - /etc/shadow: system user passwords. - /etc/security/opasswd: storage of old passwords if the relevant PAM module is in use. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: 'Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify user/group information. Example: # printf " -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity " >> /etc/audit/rules.d/50-identity.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi.' + compliance: + - cis: ["4.1.3.8"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1047"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity' + - "c:auditctl -l -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity" + + # 4.1.3.9 Ensure discretionary access control permission modification events are collected (Automated) - Not Implemented + - id: 29610 + title: "Ensure discretionary access control permission modification events are collected." + description: 'Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The following commands and system calls effect the permissions, ownership and various attributes of files: chmod, fchmod, fchmodat, chown, fchown, fchownat, lchown, setxattr, lsetxattr, fsetxattr, removexattr, lremovexattr, fremovexattr. In all cases, an audit record will only be written for non-system user ids and will ignore Daemon events. All audit records will be tagged with the identifier "perm_mod".' + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: 'Create audit rules: Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor discretionary access control permission modification events. 64 Bit systems: Example: #{ UID_MIN=$(awk ''/^\s*UID_MIN/{print $2}'' /etc/login.defs) [ -n "${UID_MIN}" ] && printf " -a always,exit -F arch=b64 -S chmod,fchmod,fchmodat -F auid>=${UID_MIN} -F auid!=unset -F key=perm_mod -a always,exit -F arch=b64 -S chown,fchown,lchown,fchownat -F auid>=${UID_MIN} -F auid!=unset -F key=perm_mod -a always,exit -F arch=b32 -S chmod,fchmod,fchmodat -F auid>=${UID_MIN} -F auid!=unset -F key=perm_mod -a always,exit -F arch=b32 -S lchown,fchown,chown,fchownat -F auid>=${UID_MIN} -F auid!=unset -F key=perm_mod -a always,exit -F arch=b64 -S setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr -F auid>=${UID_MIN} -F auid!=unset -F key=perm_mod -a always,exit -F arch=b32 -S setxattr,lsetxattr,fsetxattr,removexattr,lremovexattr,fremovexattr -F auid>=${UID_MIN} -F auid!=unset -F key=perm_mod " >> /etc/audit/rules.d/50-perm_mod.rules || printf "ERROR: Variable ''UID_MIN'' is unset.\n" } Load audit rules: Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi. 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64.' + compliance: + - cis: ["4.1.3.9"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a always,exit && r:-F arch=b64 && r:-S && r:chmod && r:fchmod && r:fchmodat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a always,exit && r:-F arch=b64 && r:-S && r:chown && r:fchown && r:lchown && r:fchownat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a always,exit && r:-F arch=b32 && r:-S && r:chmod && r:fchmod && r:fchmodat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a always,exit && r:-F arch=b32 && r:-S && r:chown && r:fchown && r:lchown && r:fchownat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a always,exit && r:-F arch=b64 && r:-S && r:setxattr && r:lsetxattr && r:fsetxattr && r:removexattr && r:lremovexattr && r:fremovexattr && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a always,exit && r:-F arch=b32 && r:-S && r:setxattr && r:lsetxattr && r:fsetxattr && r:removexattr && r:lremovexattr && r:fremovexattr && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'c:auditctl -l -> r:^-a always,exit && r:-F arch=b64 && r:-S && r:chmod && r:fchmod && r:fchmodat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'c:auditctl -l -> r:^-a always,exit && r:-F arch=b64 && r:-S && r:chown && r:fchown && r:lchown && r:fchownat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'c:auditctl -l -> r:^-a always,exit && r:-F arch=b32 && r:-S && r:chmod && r:fchmod && r:fchmodat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'c:auditctl -l -> r:^-a always,exit && r:-F arch=b32 && r:-S && r:chown && r:fchown && r:lchown && r:fchownat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'c:auditctl -l -> r:^-a always,exit && r:-F arch=b64 && r:-S && r:setxattr && r:lsetxattr && r:fsetxattr && r:removexattr && r:lremovexattr && r:fremovexattr && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'c:auditctl -l -> r:^-a always,exit && r:-F arch=b32 && r:-S && r:setxattr && r:lsetxattr && r:fsetxattr && r:removexattr && r:lremovexattr && r:fremovexattr && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + + # 4.1.3.10 Ensure successful file system mounts are collected (Automated) + - id: 29611 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: 'Create audit rules: Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful file system mounts. - 64 Bit systems Example: # { UID_MIN=$(awk ''/^\s*UID_MIN/{print $2}'' /etc/login.defs) [ -n "${UID_MIN}" ] && printf " -a always,exit -F arch=b32 -S mount -F auid>=$UID_MIN -F auid!=unset -k mounts -a always,exit -F arch=b64 -S mount -F auid>=$UID_MIN -F auid!=unset -k mounts " >> /etc/audit/rules.d/50-mounts.rules || printf "ERROR: Variable ''UID_MIN'' is unset.\n"} - Load audit rules: Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi - 32 Bit systems: Follow the same procedures as for 64 bit systems and ignore any entries with b64.' + compliance: + - cis: ["4.1.3.10"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["CM-6"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0010"] + - mitre_mitigations: ["M1034"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + + # 4.1.3.11 Ensure session initiation information is collected (Automated) + - id: 29612 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. - /var/run/utmp: tracks all currently logged in users. - /var/log/wtmp: file tracks logins, logouts, shutdown, and reboot events. - /var/log/btmp: keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier "session".' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: 'Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor session initiation information. Example: # printf " -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k session -w /var/log/btmp -p wa -k session " >> /etc/audit/rules.d/50-session.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi.' + compliance: + - cis: ["4.1.3.11"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0001"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session' + - "c:auditctl -l -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session" + + # 4.1.3.12 Ensure login and logout events are collected (Automated) + - id: 29613 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. - /var/log/lastlog: maintain records of the last time a user successfully logged in. - /var/run/faillock: directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: 'Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor login and logout events. Example: # printf " -w /var/log/lastlog -p wa -k logins -w /var/run/faillock -p wa -k logins " >> /etc/audit/rules.d/50-login.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi.' + compliance: + - cis: ["4.1.3.12"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.9.4.2", "A.8.1.3"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0001"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins' + - "c:auditctl -l -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins" + - "c:auditctl -l -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins" + + # 4.1.3.13 Ensure file deletion events by users are collected (Automated) + - id: 29614 + title: "Ensure file deletion events by users are collected." + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for: - unlink: remove a file. - unlinkat: remove a file attribute. - rename: rename a file. - renameat: rename a file attribute system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: 'Create audit rules: Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor file deletion events by users. - 64 Bit systems: Example: # { UID_MIN=$(awk ''/^\s*UID_MIN/{print $2}'' /etc/login.defs) [ -n "${UID_MIN}" ] && printf " -a always,exit -F arch=b64 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete -a always,exit -F arch=b32 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete " >> /etc/audit/rules.d/50-delete.rules || printf "ERROR: Variable ''UID_MIN'' is unset.\n" } - Load audit rules: Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi - 32 Bit systems: Follow the same procedures as for 64 bit systems and ignore any entries with b64.' + compliance: + - cis: ["4.1.3.13"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + + # 4.1.3.14 Ensure events that modify the system's Mandatory Access Controls are collected (Automated) + - id: 29615 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor AppArmor, an implementation of mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/apparmor/ and /etc/apparmor.d/ directories. Note: If a different Mandatory Access Control method is used, changes to the corresponding directories should be audited." + rationale: "Changes to files in the /etc/apparmor/ and /etc/apparmor.d/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: 'Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the systems Mandatory Access Controls. Example: # printf " -w /etc/apparmor/ -p wa -k MAC-policy -w /etc/apparmor.d/ -p wa -k MAC-policy " >> /etc/audit/rules.d/50-MAC-policy.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi.' + compliance: + - cis: ["4.1.3.14"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor/|/etc/apparmor\s+ && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor.d/|/etc/apparmor.d\s+ && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - 'c:auditctl -l -> r:^-w && r:/etc/apparmor/|/etc/apparmor\\s+ && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - 'c:auditctl -l -> r:^-w && r:/etc/apparmor.d/|/etc/apparmor.d\\s+ && r:-p wa && r:-k MAC-policy|key=MAC-policy' + + # 4.1.3.15 Ensure successful and unsuccessful attempts to use the chcon command are recorded (Automated) + - id: 29616 + title: "Ensure successful and unsuccessful attempts to use the chcon command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chcon command." + rationale: "The chcon command is used to change file security context. 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)." + remediation: 'Create audit rules: Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chcon command. - 64 Bit systems: Example: # { UID_MIN=$(awk ''/^\s*UID_MIN/{print $2}'' /etc/login.defs) [ -n "${UID_MIN}" ] && printf " -a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng " >> /etc/audit/rules.d/50-perm_chng.rules || printf "ERROR:Variable ''UID_MIN'' is unset.\n" } - Load audit rules: Merge and load the rules into active configuration: # augenrules --load .Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi - 32 Bit systems: Follow the same procedures as for 64 bit systems and ignore any entries with b64.' + compliance: + - cis: ["4.1.3.15"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + + # 4.1.3.16 Ensure successful and unsuccessful attempts to use the setfacl command are recorded (Automated) + - id: 29617 + title: "Ensure successful and unsuccessful attempts to use the setfacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the setfacl command." + rationale: "This utility sets Access Control Lists (ACLs) of files and directories. 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)." + remediation: 'Create audit rules: Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the setfacl command. - 64 Bit systems Example: # { UID_MIN=$(awk ''/^\s*UID_MIN/{print $2}'' /etc/login.defs) [ -n "${UID_MIN}" ] && printf " -a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng " >> /etc/audit/rules.d/50-perm_chng.rules || printf "ERROR:Variable ''UID_MIN'' is unset.\n" } Load audit rules: Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi - 32 Bit systems: Follow the same procedures as for 64 bit systems and ignore any entries with b64.' + compliance: + - cis: ["4.1.3.16"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + + # 4.1.3.17 Ensure successful and unsuccessful attempts to use the chacl command are recorded (Automated) + - id: 29618 + title: "Ensure successful and unsuccessful attempts to use the chacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chacl command. chacl is an IRIX-compatibility command, and is maintained for those users who are familiar with its use from either XFS or IRIX." + rationale: "chacl changes the ACL(s) for a file or directory. 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)." + remediation: 'Create audit rules: Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chacl command. - 64 Bit systems: Example: # { UID_MIN=$(awk ''/^\s*UID_MIN/{print $2}'' /etc/login.defs) [ -n "${UID_MIN}" ] && printf " -a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng " >> /etc/audit/rules.d/50-perm_chng.rules || printf "ERROR:Variable ''UID_MIN'' is unset.\n" } Load audit rules: Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi - 32 Bit systems: Follow the same procedures as for 64 bit systems and ignore any entries with b64.' + compliance: + - cis: ["4.1.3.17"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k priv_cmd|-F key=priv_cmd' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k priv_cmd|-F key=priv_cmd' + + # 4.1.3.18 Ensure successful and unsuccessful attempts to use the usermod command are recorded (Automated) + - id: 29619 + title: "Ensure successful and unsuccessful attempts to use the usermod command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the usermod command." + rationale: "The usermod command modifies the system account files to reflect the changes that are specified on the command line. 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)." + remediation: 'Create audit rules: Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the usermod command. - 64 Bit systems Example: # { UID_MIN=$(awk ''/^\s*UID_MIN/{print $2}'' /etc/login.defs) [ -n "${UID_MIN}" ] && printf " -a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k usermod " >> /etc/audit/rules.d/50-usermod.rules || printf "ERROR:Variable ''UID_MIN'' is unset.\n" } Load audit rules: Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi - 32 Bit systems: Follow the same procedures as for 64 bit systems and ignore any entries with b64.' + compliance: + - cis: ["4.1.3.18"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + + # 4.1.3.19 Ensure kernel module loading unloading and modification is collected (Automated) + - id: 29620 + title: "Ensure kernel module loading unloading and modification is collected." + description: "Monitor the loading and unloading of kernel modules. All the loading / listing / dependency checking of modules is done by kmod via symbolic links. The following system calls control loading and unloading of modules: - init_module - load a module. - finit_module - load a module (used when the overhead of using cryptographically signed modules to determine the authenticity of a module can be avoided). - delete_module - delete a module. - create_module - create a loadable module entry. - query_module - query the kernel for various bits pertaining to modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of modules." + rationale: "Monitoring the use of all the various ways to manipulate kernel modules could provide system administrators with evidence that an unauthorized change was made to a kernel module, possibly compromising the security of the system." + remediation: 'Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor kernel module modification. 64 Bit systems Example: # { UID_MIN=$(awk ''/^\s*UID_MIN/{print $2}'' /etc/login.defs) [ -n "${UID_MIN}" ] && printf " -a always,exit -F arch=b64 -S init_module,finit_module,delete_module,create_module,query_module -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules -a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules " >> /etc/audit/rules.d/50-kernel_modules.rules || printf "ERROR: Variable ''UID_MIN'' is unset.\n" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi.' + compliance: + - cis: ["4.1.3.19"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1047"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l-> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - "c:ls -l /usr/sbin/lsmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/rmmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/insmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modinfo -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modprobe -> r:/bin/kmod" + - "c:ls -l /usr/sbin/depmod -> r:/bin/kmod" + + # 4.1.3.20 Ensure the audit configuration is immutable (Automated) + - id: 29621 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: This setting will require the system to be rebooted to update the active auditd configuration settings.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: 'Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line -e 2 at the end of the file: Example: # printf -- "-e 2" >> /etc/audit/rules.d/99-finalize.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi.' + compliance: + - cis: ["4.1.3.20"] + - cis_csc_v8: ["3.3", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1", "9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AC-3", "AU-3", "AU-3(1)", "MP-2"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:sh -c "grep -iEh ''^\s*\t*-e 2\s*$'' /etc/audit/rules.d/*.rules | tail -1" -> r:^\s*\t*-e 2\s*$' + + # 4.1.3.21 Ensure the running and on disk configuration is the same (Manual) + - id: 29622 + title: "Ensure the running and on disk configuration is the same." + description: "The Audit system have both on disk and running configuration. It is possible for these configuration settings to differ. Note: Due to the limitations of augenrules and auditctl, it is not absolutely guaranteed that loading the rule sets via augenrules --load will result in all rules being loaded or even that the user will be informed if there was a problem loading the rules." + rationale: "Configuration differences between what is currently running and what is on disk could cause unexpected problems or may give a false impression of compliance requirements." + remediation: 'If the rules are not aligned across all three () areas, run the following command to merge and load all rules: # augenrules --load Check if reboot is required. if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then echo "Reboot required to load rules"; fi.' + compliance: + - cis: ["4.1.3.21"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.4.1"] + condition: all + rules: + - "c:augenrules --check -> r:/usr/sbin/augenrules && r:No change" + + ############################################################ + # 4.1.4 Configure auditd file access + ############################################################ + + # 4.1.4.1 Ensure audit log files are mode 0640 or less permissive (Automated) - Not Implemented + # 4.1.4.2 Ensure only authorized users own audit log files (Automated) - Not Implemented + + # 4.1.4.3 Ensure only authorized groups are assigned ownership of audit log files (Automated) + - id: 29623 + title: "Ensure only authorized groups are assigned ownership of audit log files." + description: "Audit log files contain information about the system and system activity." + rationale: "Access to audit records can reveal system and configuration data to attackers, potentially compromising its confidentiality." + remediation: "Run the following command to configure the audit log files to be owned by adm group: # find $(dirname $(awk -F\"=\" '/^\\s*log_file/ {print $2}' /etc/audit/auditd.conf | xargs)) -type f \\( ! -group adm -a ! -group root \\) -exec chgrp adm {} + Run the following command to configure the audit log files to be owned by the adm group: # chgrp adm /var/log/audit/ Run the following command to set the log_group parameter in the audit configuration file to log_group = adm: # sed -ri 's/^\\s*#?\\s*log_group\\s*=\\s*\\S+(\\s*#.*)?.*$/log_group = adm\\1/' /etc/audit/auditd.conf Run the following command to restart the audit daemon to reload the configuration file: # systemctl restart auditd." + compliance: + - cis: ["4.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*log_group\s*\t*=\s*\t*adm|^\s*\t*log_group\s*\t*=\s*\t*root' + - 'c:sh -c "DIR_NAME=$(awk -F\"=\" ''/^\s*\t*log_file\s*\t*/ {print $2}'' /etc/audit/auditd.conf); stat -c \"%G\" $DIR_NAME" -> r:adm|root' + + # 4.1.4.4 Ensure the audit log directory is 0750 or more restrictive (Automated) - Not implemented + + # 4.1.4.5 Ensure audit configuration files are 640 or more restrictive (Automated) + - id: 29624 + title: "Ensure audit configuration files are 640 or more restrictive." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to remove more permissive mode than 0640 from the audit configuration files: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) -exec chmod u-x,g-wx,o-rwx {} +." + compliance: + - cis: ["4.1.4.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:sh -c "stat -Lc \"%n %#a\" /etc/audit/*.rules" -> r:^/etc/audit && !r:640|600|400' + - 'not c:sh -c "stat -Lc \"%n %#a\" /etc/audit/*.conf" -> r:^/etc/audit && !r:640|600|400' + - 'not c:sh -c "stat -Lc \"%n %u %U %g %G\" /etc/audit/*.rules" -> r:^/etc/audit && !r:\s*0 root 0 root' + - 'not c:sh -c "stat -Lc \"%n %u %U %g %G\" /etc/audit/*.conf" -> r:^/etc/audit && !r:\s*0 root 0 root' + + # 4.1.4.6 Ensure audit configuration files are owned by root (Automated) + - id: 29625 + title: "Ensure audit configuration files are owned by root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change ownership to root user: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -user root -exec chown root {} +." + compliance: + - cis: ["4.1.4.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:sh -c "stat -Lc \"%n %U\" /etc/audit/*.rules" -> r:^/etc/audit && !r:root' + - 'not c:sh -c "stat -Lc \"%n %U\" /etc/audit/*.conf" -> r:^/etc/audit && !r:root' + + # 4.1.4.7 Ensure audit configuration files belong to group root (Automated) + - id: 29626 + title: "Ensure audit configuration files belong to group root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change group to root: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -group root -exec chgrp root {} +." + compliance: + - cis: ["4.1.4.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:sh -c "stat -Lc \"%n %G\" /etc/audit/*.rules" -> r:^/etc/audit && !r:root' + - 'not c:sh -c "stat -Lc \"%n %G\" /etc/audit/*.conf" -> r:^/etc/audit && !r:root' + + # 4.1.4.8 Ensure audit tools are 755 or more restrictive (Automated) + - id: 29627 + title: "Ensure audit tools are 755 or more restrictive." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %u %U %g %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:0 root 0 root' + + # 4.1.4.9 Ensure audit tools are owned by root (Automated) + - id: 29628 + title: "Ensure audit tools are owned by root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to change the owner of the audit tools to the root user: # chown root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %u %U %g %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:0 root 0 root' + + # 4.1.4.10 Ensure audit tools belong to group root (Automated) + - id: 29629 + title: "Ensure audit tools belong to group root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules Run the following command to change owner and group of the audit tools to root user and group: # chown root:root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.10"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %u %U %g %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:0 root 0 root' + + # 4.1.4.11 Ensure cryptographic mechanisms are used to protect the integrity of audit tools (Automated) - Not Implemented + + ############################################################ + # 4.2 Configure Logging + ############################################################ + + ############################################################ + # 4.2.1 Configure journald + ############################################################ + # 4.2.1.1 Ensure journald is configured to send logs to a remote log host + + # 4.2.1.1.1 Ensure systemd-journal-remote is installed (Automated) + - id: 29630 + title: "Ensure systemd-journal-remote is installed." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to install systemd-journal-remote: # apt install systemd-journal-remote." + compliance: + - cis: ["4.2.1.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' systemd-journal-remote -> r:install ok installed" + + # 4.2.1.1.2 Ensure systemd-journal-remote is configured (Manual) - Not Implemented + + # 4.2.1.1.3 Ensure systemd-journal-remote is enabled (Manual) + - id: 29631 + title: "Ensure systemd-journal-remote is enabled." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to enable systemd-journal-remote: # systemctl --now enable systemd-journal-upload.service." + compliance: + - cis: ["4.2.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - 'c:systemctl is-enabled systemd-journal-upload.service -> r:^\s*\t*enabled$' + + # 4.2.1.1.4 Ensure journald is not configured to recieve logs from a remote client (Automated) + - id: 29632 + title: "Ensure journald is not configured to recieve logs from a remote client." + description: "Journald supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts. NOTE: - The same package, systemd-journal-remote, is used for both sending logs to remote hosts and receiving incoming logs. - With regards to receiving logs, there are two services; systemd-journal-remote.socket and systemd-journal-remote.service." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: "Run the following command to disable systemd-journal-remote.socket: # systemctl --now disable systemd-journal-remote.socket." + compliance: + - cis: ["4.2.1.1.4"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5", "10.2", "10.3"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3", "A.12.4.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-remote.socket -> r:disabled" + + # 4.2.1.2 Ensure journald service is enabled (Automated) + - id: 29633 + title: "Ensure journald service is enabled." + description: "Ensure that the systemd-journald service is enabled to allow capturing of logging events." + rationale: "If the systemd-journald service is not enabled to start on boot, the system will not capture logging events." + remediation: "By default the systemd-journald service does not have an [Install] section and thus cannot be enabled / disabled. It is meant to be referenced as Requires or Wants by other unit files. As such, if the status of systemd-journald is not static, investigate why." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journald.service -> r:static" + + # 4.2.1.3 Ensure journald is configured to compress large log files (Automated) + - id: 29634 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes Restart the service: # systemctl restart systemd-journald." + compliance: + - cis: ["4.2.1.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.3", "6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - soc_2: ["A1.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.002"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1053"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Compress\s*\t*=\s*\t*yes' + + # 4.2.1.4 Ensure journald is configured to write logfiles to persistent disk (Automated) + - id: 29635 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss due to a reboot." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent Restart the service: # systemctl restart systemd-journald." + compliance: + - cis: ["4.2.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Storage\s*\t*=\s*\t*persistent' + + # 4.2.1.5 Ensure journald is not configured to send logs to rsyslog (Manual) + - id: 29636 + title: "Ensure journald is not configured to send logs to rsyslog." + description: "Data from journald should be kept in the confines of the service and not forwarded on to other services." + rationale: "IF journald is the method for capturing logs, all logs of the system should be handled by journald and not forwarded to other logging mechanisms." + remediation: "Edit the /etc/systemd/journald.conf file and ensure that ForwardToSyslog=yes is removed. Restart the service: # systemctl restart systemd-journald." + compliance: + - cis: ["4.2.1.5"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3"] + - nist_sp_800-53: ["AU-7", "AU-6(3)"] + - soc_2: ["PL1.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - 'not f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*\t*=\s*\t*yes' + + # 4.2.1.6 Ensure journald log rotation is configured per site policy (Manual) - Not Implemented + # 4.2.1.7 Ensure journald default file permissions configured (Manual) - Not Implemented + + ############################################################ + # 4.2.2 Configure rsyslog + ############################################################ + + # 4.2.2.1 Ensure rsyslog is installed (Automated) + - id: 29637 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is recommended in environments where journald does not meet operation requirements." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # apt install rsyslog." + compliance: + - cis: ["4.2.2.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1005", "T1070", "T1070.002"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' rsyslog -> r:install ok installed" + + # 4.2.2.2 Ensure rsyslog service is enabled (Automated) + - id: 29638 + title: "Ensure rsyslog service is enabled." + description: "Once the rsyslog package is installed, ensure that the service is enabled." + rationale: "If the rsyslog service is not enabled to start on boot, the system will not capture logging events." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:enabled" + + # 4.2.2.3 Ensure journald is configured to send logs to rsyslog (Manual) + - id: 29639 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the RSyslog service provides a consistent means of log collection and export." + rationale: "IF RSyslog is the preferred method for capturing logs, all logs of the system should be sent to it for further processing." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3"] + - nist_sp_800-53: ["AU-7", "AU-6(3)"] + - soc_2: ["PL1.4"] + - iso_27001-2013: ["A.12.4.1"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*\t*=\s*\t*yes' + - 'not f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*\t*=\s*\t*no' + + # 4.2.2.4 Ensure rsyslog default file permissions are configured (Automated) + - id: 29640 + title: "Ensure rsyslog default file permissions are configured." + description: "RSyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + impact: "The systems global umask could override, but only making the file permissions stricter, what is configured in RSyslog with the FileCreateMode directive. RSyslog also has it's own $umask directive that can alter the intended file creation mode. In addition, consideration should be given to how FileCreateMode is used. Thus it is critical to ensure that the intended file creation mode is not overridden with less restrictive settings in /etc/rsyslog.conf, /etc/rsyslog.d/*conf files and that FileCreateMode is set before any file is created." + remediation: "Edit either /etc/rsyslog.conf or a dedicated .conf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640 Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.2.4"] + - cis_csc_v8: ["3.3", "8.2"] + - cis_csc_v7: ["5.1", "6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2", "AU.L2-3.3.1"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)", "164.312(b)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3", "10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-7"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5", "A.12.4.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not f:/etc/rsyslog.conf -> r:^\s*\t*\$FileCreateMode && !r:0640|0600|0400' + - 'not d:/etc/rsyslog.d/ -> r:\.+.conf -> r:^\s*\t*\$FileCreateMode && !r:0640|0600|0400' + + # 4.2.2.5 Ensure logging is configured (Manual) - Not Implemented + # 4.2.2.6 Ensure rsyslog is configured to send logs to a remote log host (Manual) - Not Implemented + + # 4.2.2.7 Ensure rsyslog is not configured to receive logs from a remote client (Automated) + - id: 29641 + title: "Ensure rsyslog is not configured to receive logs from a remote client." + description: "RSyslog supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: 'Should there be any active log server configuration found in the auditing section, modify those file and remove the specific lines highlighted by the audit. Ensure none of the following entries are present in any of /etc/rsyslog.conf or /etc/rsyslog.d/*.conf. Old format $ModLoad imtcp $InputTCPServerRun New format module(load="imtcp") input(type="imtcp" port="514") Restart the service: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.2.7"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3", "1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'not d:/etc/rsyslog.d -> r:\.+.conf$ -> r:^\s*\t*\$ModLoad imtcp|^\s*\t*module\(load="imtcp"\)|^\s*\t*input\(type="imtcp" port="514"\)|^\s*\t*\$InputTCPServerRun' + - 'not f:/etc/rsyslog.conf -> r:^\s*\t*\$ModLoad imtcp|^\s*\t*module\(load="imtcp"\)|^\s*\t*input\(type="imtcp" port="514"\)|^\s*\t*\$InputTCPServerRun' + + # 4.2.3 Ensure all logfiles have appropriate permissions and ownership (Automated) - Not Implemented + + ############################################################ + # 5 Access, Authentication and Authorization + ############################################################ + + ############################################################ + # 5.1 Configure time-based job schedulers + ############################################################ + + # 5.1.1 Ensure cron daemon is enabled and running (Automated) + - id: 29642 + title: "Ensure cron daemon is enabled and running." + description: "The cron daemon is used to execute batch jobs on the system. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable and start cron: # systemctl --now enable cron." + compliance: + - cis: ["5.1.1"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - "c:systemctl is-enabled cron -> r:enabled" + - 'c:systemctl status cron -> r:Active: active \(running\)' + + # 5.1.2 Ensure permissions on /etc/crontab are configured (Automated) + - id: 29643 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab." + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access: \(0600/-rw-------\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Automated) + - id: 29644 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.hourly directory: # chown root:root /etc/cron.hourly/ # chmod og-rwx /etc/cron.hourly/." + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured (Automated) + - id: 29645 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.daily directory: # chown root:root /etc/cron.daily/ # chmod og-rwx /etc/cron.daily/." + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Automated) + - id: 29646 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.weekly directory: # chown root:root /etc/cron.weekly/ # chmod og-rwx /etc/cron.weekly/." + compliance: + - cis: ["5.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Automated) + - id: 29647 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.monthly directory: # chown root:root /etc/cron.monthly/ # chmod og-rwx /etc/cron.monthly/." + compliance: + - cis: ["5.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured (Automated) + - id: 29648 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab, but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.d directory: # chown root:root /etc/cron.d/ # chmod og-rwx /etc/cron.d/." + compliance: + - cis: ["5.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.8 Ensure cron is restricted to authorized users (Automated) + - id: 29649 + title: "Ensure cron is restricted to authorized users." + description: "Configure /etc/cron.allow to allow specific users to use this service. If /etc/cron.allow does not exist, then /etc/cron.deny is checked. Any user not specifically defined in this file is allowed to use cron. By removing the file, only users in /etc/cron.allow are allowed to use cron. Notes: - Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy. - Even though a given user is not listed in cron.allow, cron jobs can still be run as that user. - The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny: # rm /etc/cron.deny Run the following command to create /etc/cron.allow # touch /etc/cron.allow Run the following commands to set permissions and ownership for /etc/cron.allow: # chmod g-wx,o-rwx /etc/cron.allow # chown root:root /etc/cron.allow." + compliance: + - cis: ["5.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - "f:/etc/cron.allow" + - "not f:/etc/cron.deny" + - 'c:stat -Lc "%n %#a %u %U %g %G" /etc/cron.allow -> r:/etc/cron.allow 0640 0 root 0 root' + + # 5.1.9 Ensure at is restricted to authorized users (Automated) + - id: 29650 + title: "Ensure at is restricted to authorized users." + description: "Configure /etc/at.allow to allow specific users to use this service. If /etc/at.allow does not exist, then /etc/at.deny is checked. Any user not specifically defined in this file is allowed to use at. By removing the file, only users in /etc/at.allow are allowed to use at. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, at should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "On many systems, only the system administrator is authorized to schedule at jobs. Using the at.allow file to control who can run at jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/at.deny: # rm /etc/at.deny Run the following command to create /etc/at.allow # touch /etc/at.allow Run the following commands to set permissions and ownership for /etc/at.allow: # chmod g-wx,o-rwx /etc/at.allow # chown root:root /etc/at.allow." + compliance: + - cis: ["5.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - "f:/etc/at.allow" + - "not f:/etc/at.deny" + - 'c:stat -Lc "%n %#a %u %U %g %G" /etc/at.allow -> r:/etc/at.allow 0640 0 root 0 root' + + ############################################################ + # 5.2 Configure SSH Server + ############################################################ + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured (Automated) + - id: 29651 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1098", "T1098.004", "T1543", "T1543.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.2.2 Ensure permissions on SSH private host key files are configured (Automated) - Not Implemented + # 5.2.3 Ensure permissions on SSH public host key files are configured (Automated) - Not implemented + + # 5.2.4 Ensure SSH access is limited (Automated) + - id: 29652 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: > The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: > The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: > The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: > The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers OR AllowGroups OR DenyUsers OR DenyGroups ." + compliance: + - cis: ["5.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1021", "T1021.004"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:sshd -T -> r:^AllowUsers\s+\w+|^AllowGroups\s+\w+|^DenyUsers\s+\w+|^DenyGroups\s+\w+' + - 'f:/etc/ssh/sshd_config -> r:^\s*\t*AllowUsers\s+\w+|^\s*\t*AllowGroups\s+\w+|^\s*\t*DenyUsers\s+\w+|^\s*\t*DenyGroups\s+\w+' + + # 5.2.5 Ensure SSH LogLevel is appropriate (Automated) + - id: 29653 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE OR LogLevel INFO." + references: + - https://www.ssh.com/ssh/sshd_config/ + compliance: + - cis: ["5.2.5"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:sshd -T -> r:^LogLevel\s+INFO|^LogLevel\s+VERBOSE' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*LogLevel\s*\t* && !r:INFO|VERBOSE' + + # 5.2.6 Ensure SSH PAM is enabled (Automated) + - id: 29654 + title: "Ensure SSH PAM is enabled." + description: "The UsePAM directive enables the Pluggable Authentication Module (PAM) interface. If set to yes this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication directives in addition to PAM account and session module processing for all authentication types." + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes." + compliance: + - cis: ["5.2.6"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1021", "T1021.004"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1035"] + condition: all + rules: + - 'c:sshd -T -> r:^usepam\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*usepam\s*\t*no' + + # 5.2.7 Ensure SSH root login is disabled (Automated) + - id: 29655 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using SSH. The default is prohibit-password." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root. This limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no." + compliance: + - cis: ["5.2.7"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - soc_2: ["CC6.1", "CC6.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1021"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -> r:^PermitRootLogin\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*PermitRootLogin\s*\t*yes' + + # 5.2.8 Ensure SSH HostbasedAuthentication is disabled (Automated) + - id: 29656 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no." + compliance: + - cis: ["5.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -> r:^HostbasedAuthentication\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*HostbasedAuthentication\s*\t*yes' + + # 5.2.9 Ensure SSH PermitEmptyPasswords is disabled (Automated) + - id: 29657 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no." + compliance: + - cis: ["5.2.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1021"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -> r:^PermitEmptyPasswords\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*PermitEmptyPasswords\s*\t*yes' + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled (Automated) + - id: 29658 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the SSH daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has SSH executing trojan'd programs)." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no." + compliance: + - cis: ["5.2.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1021"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -> r:^PermitUserEnvironment\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*PermitUserEnvironment\s*\t*yes' + + # 5.2.11 Ensure SSH IgnoreRhosts is enabled (Automated) + - id: 29659 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with SSH." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes." + compliance: + - cis: ["5.2.11"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'c:sshd -T -> r:^IgnoreRhosts\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*IgnoreRhosts\s*\t*no' + + # 5.2.12 Ensure SSH X11 forwarding is disabled (Automated) + - id: 29660 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no." + compliance: + - cis: ["5.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1210"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -> r:^X11Forwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*X11Forwarding\s*\t*yes' + + # 5.2.13 Ensure only strong Ciphers are used (Automated) + - id: 29661 + title: "Ensure only strong Ciphers are used." + description: 'This variable limits the ciphers that SSH can use during communication. Note: - Some organizations may have stricter requirements for approved ciphers. - Ensure that ciphers used are in compliance with site policy. - The only "strong" ciphers currently FIPS 140-2 compliant are: aes256-ctr, aes192-ctr, aes128-ctr. - Supported ciphers in openSSH 8.2: 3des-cbc, aes128-cbc, aes192-cbc, aes256-cbc, aes128-ctr, aes192-ctr, aes256-ctr, aes128-gcm@openssh.com, aes256-gcm@openssh.com, chacha20-poly1305@openssh.com.' + rationale: 'Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised. - The Triple DES ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain clear text data via a birthday attack against a long-duration encrypted session, aka a "Sweet32" attack. - Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plain text data from an arbitrary block of cipher text in an SSH session via unknown vectors.' + remediation: "Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers. Example: Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr." + references: + - https://nvd.nist.gov/vuln/detail/CVE-2016-2183 + - https://www.openssh.com/txt/cbc.adv + - https://nvd.nist.gov/vuln/detail/CVE-2008-5161 + compliance: + - cis: ["5.2.13"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.17", "AC.L2-3.1.13", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.8", "SC.L2-3.13.15"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - pci_dss_3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - mitre_techniques: ["T1040", "T1557"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1041"] + condition: none + rules: + - "c:sshd -T -> r:^ciphers && r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc" + + # 5.2.14 Ensure only strong MAC algorithms are used (Automated) + - id: 29662 + title: "Ensure only strong MAC algorithms are used." + description: 'This variable limits the types of MAC algorithms that SSH can use during communication. Notes: - Some organizations may have stricter requirements for approved MACs. - Ensure that MACs used are in compliance with site policy. - The only "strong" MACs currently FIPS 140-2 approved are: hmac-sha2-256, hmac-sha2-512. - The Supported MACs are: hmac-md5, hmac-md5-96, hmac-sha1, hmac-sha1-96, hmac-sha2-256, hmac-sha2-512, umac-64@openssh.co, umac-128@openssh.com, hmac-md5-etm@openssh.com, hmac-md5-96-etm@openssh.com, hmac-sha1-etm@openssh.com, hmac-sha1-96-etm@openssh.com, hmac-sha2-256-etm@openss.com, hmac-sha2-512-etm@openssh.com, umac-64-etm@openssh.com, umac-128-etm@openssh.com.' + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information." + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs.Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256." + references: + - More information on SSH downgrade attacks can be found here: http://www.mitls.org/pages/attacks/SLOTH + compliance: + - cis: ["5.2.14"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4", "16.5"] + - cmmc_v2.0: ["AC.L2-3.1.17", "AC.L2-3.1.13", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.8", "SC.L2-3.13.15"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - pci_dss_3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - mitre_techniques: ["T1040", "T1557"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1041"] + condition: none + rules: + - "c:sshd -T -> r:^MACs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com" + + # 5.2.15 Ensure only strong Key Exchange algorithms are used (Automated) + - id: 29663 + title: "Ensure only strong Key Exchange algorithms are used." + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received. Notes: - Kex algorithms have a higher preference the earlier they appear in the list. - Some organizations may have stricter requirements for approved Key exchange algorithms. - Ensure that Key exchange algorithms used are in compliance with site policy. - The only Key Exchange Algorithms currently FIPS 140-2 approved are: ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, diffie-hellman-group-exchange-sha256, diffie-hellman-group16-sha512, diffie-hellman-group18-sha512, diffie-hellman-group14-sha256. - The Key Exchange algorithms supported by OpenSSH 8.2 are: curve25519-sha256, curve25519-sha256@libssh.org, diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, diffie-hellman-group14-sha256, diffie-hellman-group16-sha512, diffie-hellman-group18-sha512, diffie-hellman-group-exchange-sha1, diffie-hellman-group-exchange-sha256, ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521, sntrup4591761x25519-sha512@tinyssh.org." + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks." + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms Example: KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256." + compliance: + - cis: ["5.2.15"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.17", "AC.L2-3.1.13", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.8", "SC.L2-3.13.15"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - pci_dss_3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - mitre_techniques: ["T1040", "T1557"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1041"] + condition: none + rules: + - "c:sshd -T -> r:^kexalgorithms && r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1" + + # 5.2.16 Ensure SSH AllowTcpForwarding is disabled (Automated) + - id: 29664 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and backdoors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments. In some environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no." + references: + - https://www.ssh.com/ssh/tunneling/example + compliance: + - cis: ["5.2.16"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1048", "T1048.002", "T1572"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -> r:^AllowTcpForwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*\t*AllowTcpForwarding\s*\t*yes' + + # 5.2.17 Ensure SSH warning banner is configured (Automated) + - id: 29665 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.2.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_tactics: ["TA0001", "TA0007"] + - mitre_mitigations: ["M1035"] + condition: all + rules: + - 'c:sshd -T -> r:^banner\s/' + - 'f:/etc/ssh/sshd_config -> r:^\s*\t*banner\s*\t*/' + + # 5.2.18 Ensure SSH MaxAuthTries is set to 4 or less (Automated) + - id: 29666 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4." + compliance: + - cis: ["5.2.18"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1036"] + condition: all + rules: + - 'c:sshd -T -> n:^MaxAuthTries\s(\d+) compare <= 4' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxAuthTries\s*\t*(\d+) compare > 4' + + # 5.2.19 Ensure SSH MaxStartups is configured (Automated) + - id: 29667 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxStartups 10:30:60." + compliance: + - cis: ["5.2.19"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1499", "T1499.002"] + - mitre_tactics: ["TA0040"] + condition: all + rules: + - 'c:sshd -T -> n:^maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'c:sshd -T -> n:^maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'c:sshd -T -> n:^maxstartups\s+\d+:\d+:(\d+) compare <= 60' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s*\t*(\d+):\d+:\d+ compare > 10' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s*\t*\d+:(\d+):\d+ compare > 30' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s*\t*\d+:\d+:(\d+) compare > 60' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s*\t*(\d+):\d+:\d+ compare <= 10' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s*\t*\d+:(\d+):\d+ compare <= 30' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*maxstartups\s*\t*\d+:\d+:(\d+) compare <= 60' + + # 5.2.20 Ensure SSH MaxSessions is set to 10 or less (Automated) + - id: 29668 + title: "Ensure SSH MaxSessions is set to 10 or less." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10." + compliance: + - cis: ["5.2.20"] + - mitre_techniques: ["T1499", "T1499.002"] + - mitre_tactics: ["TA0040"] + condition: all + rules: + - 'c:sshd -T -> n:^maxsessions\s+(\d+) compare <= 10' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*maxsessions\s*\t*(\d+) compare > 10' + + # 5.2.21 Ensure SSH LoginGraceTime is set to one minute or less (Automated) + - id: 29669 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections. While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60." + compliance: + - cis: ["5.2.21"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003", "T1110.004", "T1499", "T1499.002"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1036"] + condition: all + rules: + - 'c:sshd -T -> n:^logingracetime\s(\d+) compare <= 60 && n:LoginGraceTime\s(\d+) compare != 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*logingracetime\s*\t*(\d+) compare <= 60 && n:^\s*\t*LoginGraceTime\s*\t*(\d+) compare != 0' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*logingracetime\s*\t*(\d+) compare > 60' + + # 5.2.22 Ensure SSH Idle Timeout Interval is configured (Automated) + - id: 29670 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "NOTE: To clarify, the two settings described below is only meant for idle connections from a protocol perspective and not meant to check if the user is active or not. An idle user does not mean an idle connection. SSH does not and never had, intentionally, the capability to drop idle users. In SSH versions before 8.2p1 there was a bug that caused these values to behave in such a manner that they where abused to disconnect idle users. This bug has been resolved in 8.2p1 and thus it can no longer be abused disconnect idle users. The two options ClientAliveInterval and ClientAliveCountMax control the timeout of SSH sessions. Taken directly from man 5 sshd_config: - ClientAliveInterval Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax Sets the number of client alive messages which may be sent without sshd(8) receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. It is important to note that the use of client alive messages is very different from TCPKeepAlive. The client alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option en-abled by TCPKeepAlive is spoofable. The client alive mechanism is valuable when the client or server depend on knowing when a connection has become unresponsive. The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds. Setting a zero ClientAliveCountMax disables connection termination." + rationale: "In order to prevent resource exhaustion, appropriate values should be set for both ClientAliveInterval and ClientAliveCountMax. Specifically, looking at the source code, ClientAliveCountMax must be greater than zero in order to utilize the ability of SSH to drop idle connections. If connections are allowed to stay open indefinately, this can potentially be used as a DDOS attack or simple resource exhaustion could occur over unreliable networks. The example set here is a 45 second timeout. Consult your site policy for network timeouts and apply as appropriate." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy. Example: ClientAliveInterval 15 ClientAliveCountMax 3." + references: + - https://man.openbsd.org/sshd_config + compliance: + - cis: ["5.2.22"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - 'c:sshd -T -> n:^clientaliveinterval\s*\t*(\d+) compare > 0' + - 'c:sshd -T -> n:^clientalivecountmax\s*\t*(\d+) compare > 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*clientaliveinterval\s*\t*(\d+) compare > 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*\t*clientalivecountmax\s*\t*(\d+) compare > 0' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*clientaliveinterval\s*\t*(\d+) compare == 0' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*clientalivecountmax\s*\t*(\d+) compare == 0' + + ############################################################ + # 5.3 Configure privilege escalation + ############################################################ + + # 5.3.1 Ensure sudo is installed (Automated) + - id: 29671 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plug-in architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plug-ins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers and any entries in /etc/sudoers.d. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "First determine is LDAP functionality is required. If so, then install sudo-ldap, else install sudo. Example: # apt install sudo." + compliance: + - cis: ["5.3.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - soc_2: ["CC6.1", "CC6.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1078", "T1078.003"] + - mitre_tactics: ["TA0001"] + condition: any + rules: + - "c: dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' sudo -> r:install ok installed" + - "c: dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' sudo-ldap -> r:install ok installed" + + # 5.3.2 Ensure sudo commands use pty (Automated) + - id: 29672 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo terminal (pseudo-pty)." + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: "Edit the file /etc/sudoers with visudo or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["5.3.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - soc_2: ["CC6.1", "CC6.3"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1548", "T1548.003"] + - mitre_tactics: ["TA0003"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*use_pty' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*use_pty' + + # 5.3.3 Ensure sudo log file exists (Automated) + - id: 29673 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: 'Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Example: Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["5.3.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0004"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*logfile=' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*logfile=' + + # 5.3.4 Ensure users must provide password for privilege escalation (Automated) + - id: 29674 + title: "Ensure users must provide password for privilege escalation." + description: "The operating system must be configured so that users must provide a password for privilege escalation." + rationale: "Without (re-)authentication, 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 (re-)authenticate." + impact: "This will prevent automated processes from being able to elevate privileges." + remediation: "Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any line with occurrences of NOPASSWD tags in the file." + compliance: + - cis: ["5.3.4"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - soc_2: ["CC6.1", "CC6.3"] + - iso_27001-2013: ["A.9.2.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*\t*# && r:NOPASSWD' + - 'd:/etc/sudoers.d -> r:\.* -> !r:^\s*\t*# && r:NOPASSWD' + + # 5.3.5 Ensure re-authentication for privilege escalation is not disabled globally (Automated) + - id: 29675 + title: "Ensure re-authentication for privilege escalation is not disabled globally." + description: "The operating system must be configured so that users must re-authenticate for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + remediation: "Configure the operating system to require users to reauthenticate for privilege escalation. Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any occurrences of !authenticate tags in the file(s)." + compliance: + - cis: ["5.3.5"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - soc_2: ["CC6.1", "CC6.3"] + - iso_27001-2013: ["A.9.2.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*\t*# && r:!authenticate' + - 'd:/etc/sudoers.d -> r:\.* -> !r:^\s*\t*# && r:!authenticate' + + # 5.3.6 Ensure sudo authentication timeout is configured correctly (Automated) + - id: 29676 + title: "Ensure sudo authentication timeout is configured correctly." + description: "sudo caches used credentials for a default of 15 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies. This default is distribution specific. See audit section for further information." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized privileged access to another user." + remediation: "If the currently configured timeout is larger than 15 minutes, edit the file listed in the audit section with visudo -f and modify the entry timestamp_timeout= to 15 minutes or less as per your site policy. The value is in minutes. This particular entry may appear on it's own, or on the same line as env_reset. See the following two examples: Defaults Defaults Defaults env_reset, timestamp_timeout=15 timestamp_timeout=15 env_reset." + references: + - https://www.sudo.ws/man/1.9.0/sudoers.man.html + compliance: + - cis: ["5.3.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - soc_2: ["CC6.1", "CC6.3"] + - iso_27001-2013: ["A.9.2.3"] + condition: all + rules: + - 'not f:/etc/sudoers -> !r:^\s*\t*# && r:timestamp_timeout\s*\t*=\s*\t*-1' + - 'not d:/etc/sudoers.d -> r:\.+ -> !r:^\s*\t*# && r:timestamp_timeout\s*\t*=\s*\t*-1' + - 'not f:/etc/sudoers -> !r:^\s*\t*# && n:timestamp_timeout\s*\t*=\s*\t*(\d+) compare > 15' + - 'not d:/etc/sudoers.d -> r:\.+ -> !r:^\s*\t*# && n:timestamp_timeout\s*\t*=\s*\t*(\d+) compare > 15' + + # 5.3.7 Ensure access to the su command is restricted (Automated) + - id: 29677 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.3.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1548"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_wheel.so && r:use_uid && r:group=\w+' + + ############################################################ + # 5.4 Configure PAM + ############################################################ + + # 5.4.1 Ensure password creation requirements are configured (Automated) + - id: 29678 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following options are set in the /etc/security/pwquality.conf file: - Password Length: > minlen = 14 - password must be 14 characters or more. - Password complexity: > minclass = 4 - The minimum number of required classes of characters for the new password (digits, uppercase, lowercase, others) OR > dcredit = -1 - provide at least one digit. > ucredit = -1 - provide at least one uppercase character. > ocredit = -1 - provide at least one special character. > lcredit = -1 - provide at least one lowercase character." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "The following setting is a recommend example policy. Alter these values to conform to your own organization's password policies. Run the following command to install the pam_pwquality module: # apt install libpam-pwquality Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy: minlen = 14 .Edit the file /etc/security/pwquality.conf and add or modify the following line for .password complexity to conform to site policy: Option 1 minclass = 4 Option 2 dcredit = -1, ucredit = -1, ocredit = -1, lcredit = -1." + compliance: + - cis: ["5.4.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.001", "T1110.002", "T1110.003"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'f:/etc/security/pwquality.conf -> !r:^\s*\t*# && n:\s*\t*minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> !r:^\s*\t*# && n:\s*\t*minclass\s*\t*=\s*\t*(\d+) compare >= 4' + - 'not f:/etc/security/pwquality.conf -> !r:^\s*\t*# && n:\s*\t*minlen\s*\t*=\s*\t*(\d+) compare < 14' + - 'not f:/etc/security/pwquality.conf -> !r:^\s*\t*# && n:\s*\t*minclass\s*\t*=\s*\t*(\d+) compare < 4' + + # 5.4.2 Ensure lockout for failed password attempts is configured (Automated) + - id: 29679 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the common PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. All configuration of faillock is located in /etc/security/faillock.conf and well commented. - deny > Deny access if the number of consecutive authentication failures for this user during the recent interval exceeds n tries. - fail_interval > The length of the interval, in seconds, during which the consecutive authentication failures must happen for the user account to be locked out. - unlock_time > The access will be re-enabled after n seconds after the lock out. The value 0 has the same meaning as value never - the access will not be re-enabled without resetting the faillock entries by the faillock command. Set the lockout number and unlock time in accordance with local site policy." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + impact: "It is critical to test and validate any PAM changes before deploying. Any misconfiguration could cause the system to be inaccessible." + remediation: 'NOTE: Pay special attention to the configuration. Incorrect configuration can cause system lock outs. This is example configuration. You configuration may differ based on previous changes to the files. Common auth: Edit /etc/pam.d/common-auth and ensure that faillock is configured. Note: It is critical to understand each line and the relevant arguments for successful implementation. The order of these entries is very specific. The pam_faillock.so lines surround the pam_unix.so line. The comment "Added to enable faillock" is shown to highlight the additional lines and their order in the file. # here are the per-package modules (the "Primary" block) auth required pam_faillock.so preauth # Added to enable faillock auth [success=1 default=ignore] pam_unix.so nullok auth [default=die] pam_faillock.so authfail # Added to enable faillock auth sufficient pam_faillock.so authsucc # Added to enable faillock # here''s the fallback if no module succeeds auth requisite pam_deny.so # prime the stack with a positive return value if there isn''t one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around auth required pam_permit.so # and here are more per-package modules (the "Additional" block) auth optional pam_cap.so # end of pam-auth-update config Common account: Edit /etc/pam.d/common-account and ensure that the following stanza is at the end of the file. > account > required > pam_faillock.so. Fail lock configuration: Edit /etc/security/faillock.conf and configure it per your site policy. Example: deny = 4 > fail_interval = 900 > unlock time = 600.' + compliance: + - cis: ["5.4.2"] + - cis_csc_v8: ["6.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1"] + - hipaa: ["164.308(a)(3)(ii)(C)"] + - pci_dss_3.2.1: ["8.1.3"] + - pci_dss_4.0: ["8.2.4", "8.2.5"] + - nist_sp_800-53: ["AC-2(1)"] + - soc_2: ["CC6.2", "CC6.3"] + - iso_27001-2013: ["A.9.2.6"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_faillock.so\s*\t*preauth' + - 'f:/etc/pam.d/common-auth -> !r:^\s*\t*# && r:auth && r:default=die && r:\s*\t*pam_faillock.so && r:\s*\t*authfail' + - 'f:/etc/pam.d/common-auth -> !r:^\s*\t*# && r:auth\s*\t*sufficient\s*\t*pam_faillock.so\s*\t*authsucc' + - 'f:/etc/pam.d/common-account -> !r:^\s*\t*# && r:account\s*\t*required\s*\t*pam_faillock.so' + - 'f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:deny\s*\t*=\s*\t*(\d+) compare <= 4' + - 'f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:fail_interval\s*\t*=\s*\t*(\d+) compare <= 900' + - 'not f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:unlock_time\s*\t*=\s*\t*(\d+) compare > 0 && n:unlock_time\s*\t*=\s*\t*(\d+) compare < 600' + + # 5.4.3 Ensure password reuse is limited (Automated) + - id: 29680 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password." + remediation: "NOTE: Pay special attention to the configuration. Incorrect configuration can cause system lock outs. This is example configuration. You configuration may differ based on previous changes to the files. Edit the /etc/pam.d/common-password file to include the remember= option of 5 or more. If this line doesn't exist, add the line directly above the line: password [success=1 default=ignore] pam_unix.so obscure yescrypt: Example: password required pam_pwhistory.so use_authtok remember=5." + compliance: + - cis: ["5.4.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.004"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> !r:^\s*\t*# && r:\s*\t*password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare < 5' + - 'f:/etc/pam.d/common-password -> !r:^\s*\t*# && r:password\s*\t*required\s*\t*pam_pwhistory.so && !r:remember' + + # 5.4.4 Ensure password hashing algorithm is up to date with the latest standards (Automated) + - id: 29681 + title: "Ensure password hashing algorithm is up to date with the latest standards." + description: "The commands below change password encryption to yescrypt. All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The yescrypt algorithm provides much stronger hashing than previous available algorithms, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note: these change only apply to accounts configured on the local system." + remediation: "NOTE: Pay special attention to the configuration. Incorrect configuration can cause system lock outs. This is example configuration. You configuration may differ based on previous changes to the files. PAM Edit the /etc/pam.d/common-password file and ensure that no hashing algorithm option for pam_unix.so is set: password [success=1 default=ignore] try_first_pass remember=5 pam_unix.so obscure use_authtok - Login definitions: Edit /etc/login.defs and ensure that ENCRYPT_METHOD is set to yescrypt." + compliance: + - cis: ["5.4.4"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - pci_dss_3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1110", "T1110.002"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1041"] + condition: all + rules: + - 'not f:/etc/pam.d/common-password -> !r:^\s*\t*# && r:yescrypt|md5|bigcrypt|sha256|sha512|blowfish' + - 'f:/etc/login.defs -> r:^\s*\t*ENCRYPT_METHOD\s*\t*yescrypt' + + # 5.4.5 Ensure all current passwords uses the configured hashing algorithm (Manual) - Not Implemented + + ############################################################ + # 5.5 User Accounts and Environment + ############################################################ + + ############################################################ + # 5.5.1 Set Shadow Password Suite Parameters + ############################################################ + + # 5.5.1.1 Ensure minimum days between password changes is configured (Automated) + - id: 29682 + title: "Ensure minimum days between password changes is configured." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 1 in /etc/login.defs : PASS_MIN_DAYS 1 Modify user parameters for all users with a password set to match: # chage --mindays 1 ." + compliance: + - cis: ["5.5.1.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.004"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 1' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:(\d+): compare == 0' + + # 5.5.1.2 Ensure password expiration is 365 days or less (Automated) + - id: 29683 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity. It is recommended that the PASS_MAX_DAYS parameter does not exceed 365 days and is greater than the value of PASS_MIN_DAYS." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + references: + - https://www.cisecurity.org/white-papers/cis-password-policy-guide/ + compliance: + - cis: ["5.5.1.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.001", "T1110.002", "T1110.003", "T1110.004"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:(\d+):\S*:\S*:\S*:\S* compare > 365' + + # 5.5.1.3 Ensure password expiration warning days is 7 or more (Automated) + - id: 29684 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs :PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["5.5.1.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + - 'f:/etc/shadow -> n:^\w+:\S*:\S*:\S*:\S*:(\d+):\S*:\S*:\S* compare >= 7' + - 'not f:/etc/shadow -> r:^\w+:\S*:\S*:\S*:\S*::\S*:\S*:\S*' + + # 5.5.1.4 Ensure inactive password lock is 30 days or less (Automated) + - id: 29685 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["5.5.1.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.002", "T1078.003"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - "not c:useradd -D -> r:^INACTIVE=-1" + - 'f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:\S*:\S*:(\d+):\S*:\S* compare <= 30' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && r:^\w+:\S*:\S*:\S*:\S*:\S*::\S*:\S*' + + # 5.5.1.5 Ensure all users last password change date is in the past (Automated) - Not Implemented + # 5.5.2 Ensure system accounts are secured (Automated) - Not Implemented + + # 5.5.3 Ensure default group for the root account is GID 0 (Automated) + - id: 29686 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1548"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - "f:/etc/passwd -> r:^root:x:0:0" + + # 5.5.4 Ensure default user umask is 027 or more restrictive (Automated) - Not Implemented + # 5.5.5 Ensure default user umask is 027 or more restrictive (Automated) - Not Implemented + + ############################################################ + # 6 System Maintenance + ############################################################ + + ############################################################ + # 6.1 System File Permissions + ############################################################ + + # 6.1.1 Ensure permissions on /etc/passwd are configured (Automated) + - id: 29687 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd: # chmod u-x,go-wx /etc/passwd # chown root:root /etc/passwd." + compliance: + - cis: ["6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: any + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/passwd -> r:0/root 0/root && r:644|640|604|600' + + # 6.1.2 Ensure permissions on /etc/passwd- are configured (Automated) + - id: 29688 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd-: # chmod u-x,go-wx /etc/passwd- # chown root:root /etc/passwd-." + compliance: + - cis: ["6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: any + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/passwd- -> r:0/root 0/root && r:644|640|604|600' + + # 6.1.3 Ensure permissions on /etc/group are configured (Automated) + - id: 29689 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group: # chmod u-x,go-wx /etc/group # chown root:root /etc/group." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/group -> r:0/root 0/root && r:644|640|604|600' + + # 6.1.4 Ensure permissions on /etc/group- are configured (Automated) + - id: 29690 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group-: # chmod u-x,go-wx /etc/group- # chown root:root /etc/group-." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/group- -> r:0/root 0/root && r:644|640|604|600' + + # 6.1.5 Ensure permissions on /etc/shadow are configured (Automated) + - id: 29691 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run one of the following commands to set ownership of /etc/shadow to root and group to either root or shadow: # chown root:shadow /etc/shadow -OR- # chown root:root /etc/shadow Run the following command to remove excess permissions form /etc/shadow: # chmod u-x,g-wx,o-rwx /etc/shadow." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/shadow -> r:\s0 root 0 root && r:640|600|400|500' + + # 6.1.6 Ensure permissions on /etc/shadow- are configured (Automated) + - id: 29692 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run one of the following commands to set ownership of /etc/shadow- to root and group to either root or shadow: # chown root:shadow /etc/shadow- -OR- # chown root:root /etc/shadow- Run the following command to remove excess permissions form /etc/shadow-: # chmod u-x,g-wx,o-rwx /etc/shadow-." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/shadow- -> r:\s0 root 0 root && r:640|600|400|500' + + # 6.1.7 Ensure permissions on /etc/gshadow are configured (Automated) + - id: 29693 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run one of the following commands to set ownership of /etc/gshadow to root and group to either root or shadow: # chown root:shadow /etc/gshadow -OR- # chown root:root /etc/gshadow Run the following command to remove excess permissions form /etc/gshadow: # chmod u-x,g-wx,o-rwx /etc/gshadow." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/gshadow -> r:\s0 root 0 root && r:640|600|400|500' + + # 6.1.8 Ensure permissions on /etc/gshadow- are configured (Automated) + - id: 29694 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run one of the following commands to set ownership of /etc/gshadow- to root and group to either root or shadow: # chown root:shadow /etc/gshadow- -OR- # chown root:root /etc/gshadow- Run the following command to remove excess permissions form /etc/gshadow-: # chmod u-x,g-wx,o-rwx /etc/gshadow-." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/gshadow- -> r:\s0 root 0 root && r:640|600|400|500' + + # 6.1.9 Ensure no world writable files exist (Automated) - Not implemented + # 6.1.10 Ensure no unowned files or directories exist (Automated) - Not implemented + # 6.1.11 Ensure no ungrouped files or directories exist (Automated) - Not implemented + # 6.1.12 Audit SUID executables (Manual) - Not Implemented + # 6.1.13 Audit SGID executables (Manual) - Not Implemented + + ############################################################ + # 6.2 Local User and Group Settings + ############################################################ + + # 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords (Automated) + - id: 29695 + title: "Ensure accounts in /etc/passwd use shadowed passwords." + description: "Local accounts can uses shadowed passwords. With shadowed passwords, The passwords are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. Accounts with a shadowed password have an x in the second field in /etc/passwd." + rationale: "The /etc/passwd file also contains information like user ID's and group ID's that are used by many system programs. Therefore, the /etc/passwd file must remain world readable. In spite of encoding the password with a randomly-generated one-way hash function, an attacker could still break the system if they got access to the /etc/passwd file. This can be mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. This helps mitigate the risk of an attacker gaining access to the encoded passwords with which to perform a dictionary attack. Note: - All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user. - A user account with an empty second field in /etc/passwd allows the account to be logged into by providing only the username." + remediation: "Run the following command to set accounts to use shadowed passwords: # sed -e 's/^\\([a-zA-Z0-9_]*\\):[^:]*:/\\1:x:/' -i /etc/passwd Investigate to determine if the account is logged in and what it is being used for, to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - pci_dss_3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_techniques: ["T1003", "T1003.008"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'not f:/etc/passwd -> r:^\w+:x:' + + # 6.2.2 Ensure /etc/shadow password fields are not empty (Automated) + - id: 29696 + title: "Ensure /etc/shadow password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'not f:/etc/shadow -> r:^\w+::' + + # 6.2.3 Ensure all groups in /etc/passwd exist in /etc/group (Automated) - Not Implemented + + # 6.2.4 Ensure shadow group is empty (Automated) - Not Implemented + # 6.2.5 Ensure no duplicate UIDs exist (Automated)" - Not Implemented + # 6.2.6 Ensure no duplicate GIDs exist (Automated)" - Not Implemented + # 6.2.7 Ensure no duplicate user names exist (Automated) - Not Implemented + # 6.2.8 Ensure no duplicate group names exist (Automated) - Not Implemented + # 6.2.9 Ensure root PATH Integrity (Automated) - Not Implemented + + # 6.2.10 Ensure root is the only UID 0 account (Automated) + - id: 29697 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.10"] + - mitre_techniques: ["T1548"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - 'not f:/etc/passwd -> !r:^\s*\t*# && !r:^root: && r:^\w+:\w+:0:' + + # 6.2.11 Ensure local interactive user home directories exist (Automated) - Not Implemented + # 6.2.12 Ensure local interactive users own their home directories (Automated) - Not Implemented + # 6.2.13 Ensure local interactive user home directories are mode 750 or more restrictive (Automated) - Not Implemented + # 6.2.14 Ensure no local interactive user has .netrc files (Automated) - Not Implemented + # 6.2.15 Ensure no local interactive user has .forward files (Automated) - Not Implemented + # 6.2.16 Ensure no local interactive user has .rhosts files (Automated) - Not Implemented + # 6.2.17 Ensure local interactive user dot files are not group or world writable (Automated) - Not Implemented diff --git a/etc/ruleset/sca/debian/cis_debian12.yml b/etc/ruleset/sca/debian/cis_debian12.yml new file mode 100644 index 0000000000..f09ec028d3 --- /dev/null +++ b/etc/ruleset/sca/debian/cis_debian12.yml @@ -0,0 +1,3586 @@ +# Security Configuration Assessment +# CIS Checks for Debian Linux 12 +# Copyright (C) 2023, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Debian Family Linux Benchmark v1.0.0 - 09-03-2020 + +policy: + id: "cis_debian12" + file: "cis_debian12.yml" + name: "Center for Internet Security Debian Family Linux Benchmark v1.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 12." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Debian version." + description: "Requirements for running the SCA scan against Debian Linux 12." + condition: all + rules: + - "f:/etc/debian_version -> r:12." + - "f:/proc/sys/kernel/ostype -> r:Linux" + - "f:/etc/os-release -> r:NAME= && r:Debian" + - "f:/etc/os-release -> r:VERSION= && r:12" + +checks: + ############################################################ + # 1 Initial Setup + ############################################################ + # 1.1 Filesystem configuration + ############################################################ + # 1.1.1 Disable unused filesystems + ############################################################ + + # 1.1.1.1 Ensure mounting of cramfs filesystems is disabled (Automated) + - id: 33000 + title: "Ensure mounting of cramfs filesystems is disabled." + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/cramfs.conf and add the following line: install cramfs /bin/true Run the following command to unload the cramfs module: # rmmod cramfs." + compliance: + - cis: ["1.1.1.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:install /bin/true" + - "not c:lsmod -> r:cramfs" + + # 1.1.1.2 Ensure mounting of freevxfs filesystems is disabled (Automated) + - id: 33001 + title: "Ensure mounting of freevxfs filesystems is disabled." + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/freevxfs.conf and add the following line: install freevxfs /bin/true Run the following command to unload the freevxfs module: rmmod freevxfs." + compliance: + - cis: ["1.1.1.2"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - "c:modprobe -n -v freevxfs -> r: install /bin/true" + - "not c:lsmod -> r:freevxfs" + + # 1.1.1.3 Ensure mounting of jffs2 filesystems is disabled (Automated) + - id: 33002 + title: "Ensure mounting of jffs2 filesystems is disabled." + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/jffs2.conf and add the following line: install jffs2 /bin/true Run the following command to unload the jffs2 module: # rmmod jffs2." + compliance: + - cis: ["1.1.1.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - "c:modprobe -n -v jffs2 -> r:install /bin/true" + - "not c:lsmod -> r:jffs2" + + # 1.1.1.4 Ensure mounting of hfs filesystems is disabled (Automated) + - id: 33003 + title: "Ensure mounting of hfs filesystems is disabled." + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/hfs.conf and add the following line: install hfs /bin/true Run the following command to unload the hfs module: # rmmod hfs." + compliance: + - cis: ["1.1.1.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - "c:modprobe -n -v hfs -> r:install /bin/true" + - "not c:lsmod -> r:hfs" + + # 1.1.1.5 Ensure mounting of hfsplus filesystems is disabled (Automated) + - id: 33004 + title: "Ensure mounting of hfsplus filesystems is disabled." + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/hfsplus.conf and add the following line: install hfsplus /bin/true Run the following command to unload the hfsplus module: # rmmod hfsplus." + compliance: + - cis: ["1.1.1.5"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - "c:modprobe -n -v hfsplus -> r:install /bin/true" + - "not c:lsmod -> r:hfsplus" + + # 1.1.1.6 Ensure mounting of squashfs filesystems is disabled (Manual) + - id: 33005 + title: "Ensure mounting of squashfs filesystems is disabled." + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: "Disabling squashfs will prevent the use of snap. Snap is a package manager for Linux for installing Snap packages. 'Snap' application packages of software are self-contained and work across a range of Linux distributions. This is unlike traditional Linux package management approaches, like APT or RPM, which require specifically adapted packages per Linux distribution on an application update and delay therefore application deployment from developers to their software's end-user. Snaps themselves have no dependency on any external store ('App store'), can be obtained from any source and can be therefore used for upstream software deployment. When snaps are deployed on versions of Linux, the Ubuntu app store is used as default back-end, but other stores can be enabled as well." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/squashfs.conf Add the following line: install squashfs /bin/true Run the following command to unload the squashfs module: # rmmod squashfs." + compliance: + - cis: ["1.1.1.6"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/true" + - "not c:lsmod -> r:squashfs" + + # 1.1.1.7 Ensure mounting of udf filesystems is disabled (Automated) + - id: 33006 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/udf.conf and add the following line: install udf /bin/true Run the following command to unload the udf module: # rmmod udf." + compliance: + - cis: ["1.1.1.7"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - "c:modprobe -n -v udf -> r:install /bin/true" + - "not c:lsmod -> r:udf" + + # 1.1.2 Ensure /tmp is configured (Automated) + - id: 33007 + title: "Ensure /tmp is configured." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications. Notes: - If an entry for /tmp exists in /etc/fstab it will take precedence over entries in the tmp.mount file. - tmpfs can be resized using the size={size} parameter in /etc/fstab or on the Options line in the tmp.mount file. If we don't specify the size, it will be half the RAM. Resize tmpfs examples: - /etc/fstab tmpfs /tmp tmpfs rw,noexec,nodev,nosuid,size=2G 0 0 - tmp.mount [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,size=2G,noexec,nodev,nosuid." + rationale: "Making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a default installation a disk-based /tmp will essentially have the whole disk available, as it only creates a single / partition. On the other hand, a RAM-based /tmp as with tmpfs will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily. /tmp utilizing tmpfs can be resized using the size={size} parameter on the Options line on the tmp.mount file." + remediation: "Configure /etc/fstab as appropriate. Example: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 OR Run the following commands to enable systemd /tmp mounting: Run the following command to create the tmp.mount file is the correct location: # cp -v /usr/share/systemd/tmp.mount /etc/systemd/system/ Edit /etc/systemd/system/tmp.mount to configure the /tmp mount: [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,nosuid,nodev,noexec Run the following command to reload the systemd daemon with the unpdated tmp.mount unit file: # systemctl daemon-reload Run the following command to enable and start tmp.mount # systemctl --now enable tmp.mount." + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + compliance: + - cis: ["1.1.2"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: any + rules: + - "c:mount -> r:tmpfs on /tmp type tmpfs" + - 'f:/etc/fstab -> !r:^\s*\t*# && r:tmpfs /tmp tmpfs' + - "c:systemctl is-enabled tmp.mount -> r:^enabled" + + # 1.1.3 Ensure nodev option set on /tmp partition (Automated) + - id: 33008 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file OR the /etc/systemd/system/local-fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nodev /tmp OR IF systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options: [Mount] Options=mode=1777,strictatime noexec,nodev,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount." + compliance: + - cis: ["1.1.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'not c:mount -> r:\s*/tmp\s && !r:nodev' + + # 1.1.4 Ensure nosuid option set on /tmp partition (Automated) + - id: 33009 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,nosuid /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuid to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp : # mount -o remount,nosuid /tmp." + compliance: + - cis: ["1.1.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'not c:mount -> r:\s*/tmp\s && !r:nosuid' + + # 1.1.5 Ensure noexec option set on /tmp partition (Automated) + - id: 33010 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,noexec /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp : # mount -o remount,noexec /tmp." + compliance: + - cis: ["1.1.5"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.2.063", "CM.3.069", "CM.4.073"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1191", "T1092", "T1175", "T1173", "T1519", "T1052", "T1210", "T1133", "T1118", "T1171", "T1170", "T1046", "T1137", "T1086", "T1164", "T1121", "T1076", "T1091", "T1180", "T1064", "T1184", "T1221", "T1127", "T1028"] + - nist_sp_800-53: ["CM-11"] + condition: all + rules: + - 'not c:mount -> r:\s*/tmp\s && !r:noexec' + + # 1.1.6 Ensure separate partition exists for /var (Automated) + - id: 33011 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable. Note: When modifying /var it is advisable to bring the system to emergency mode (so auditd is not running), rename the existing directory, mount the new file system, and migrate the data over before returning to multiuser mode." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + compliance: + - cis: ["1.1.6"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'c:mount -> r:\S+ on /var type ext4' + + # 1.1.7 Ensure separate partition exists for /var/tmp (Automated) + - id: 33012 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.7"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'c:mount -> r:\S+ on /var/tmp type ext4' + + # 1.1.8 Ensure nodev option set on /var/tmp partition (Automated) + - id: 33013 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,nodev /var/tmp." + compliance: + - cis: ["1.1.8"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'not c:mount -> r:\s*/var/tmp\s && !r:nodev' + + # 1.1.9 Ensure nosuid option set on /var/tmp partition (Automated) + - id: 33014 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,nosuid /var/tmp." + compliance: + - cis: ["1.1.9"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'c:mount -> r:\S+ on /var/tmp type ext4 && r:nosuid' + + # 1.1.10 Ensure noexec option set on /var/tmp partition (Automated) + - id: 33015 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp." + compliance: + - cis: ["1.1.10"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.2.063", "CM.3.069", "CM.4.073"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1191", "T1092", "T1175", "T1173", "T1519", "T1052", "T1210", "T1133", "T1118", "T1171", "T1170", "T1046", "T1137", "T1086", "T1164", "T1121", "T1076", "T1091", "T1180", "T1064", "T1184", "T1221", "T1127", "T1028"] + - nist_sp_800-53: ["CM-11"] + condition: all + rules: + - 'not c:mount -> r:\s*/var/tmp\s && !r:noexec' + + # 1.1.11 Ensure separate partition exists for /var/log (Automated) + - id: 33016 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data. Note: When modifying /var/log it is advisable to bring the system to emergency mode (so auditd is not running), rename the existing directory, mount the new file system, and migrate the data over before returning to multiuser mode." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + compliance: + - cis: ["1.1.11"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-4"] + - pci_dss_v3.2.1: ["10.7"] + condition: all + rules: + - 'c:mount -> r:\S+ on /var/log type ext4' + + # 1.1.12 Ensure separate partition exists for /var/log/audit (Automated) + - id: 33017 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory. Note: When modifying /var/log/audit it is advisable to bring the system to emergency mode (so auditd is not running), rename the existing directory, mount the new file system, and migrate the data over before returning to multiuser mode." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog ) consume space in the same partition as auditd , it may not perform as desired." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + compliance: + - cis: ["1.1.12"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-4"] + - pci_dss_v3.2.1: ["10.7"] + condition: all + rules: + - 'c:mount -> r:\S+ on /var/log/audit type ext4' + + # 1.1.13 Ensure separate partition exists for /home (Automated) + - id: 33018 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + compliance: + - cis: ["1.1.13"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - "c:mount -> r:/dev/xvdf1 on /home type ext4" + + # 1.1.14 Ensure nodev option set on /home partition (Automated) + - id: 33019 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. See the fstab(5) manual page for more information. # mount -o remount,nodev /home." + compliance: + - cis: ["1.1.14"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'not c:mount -> r:\s*/var/tmp\s && !r:nodev' + + # 1.1.15 Ensure nodev option set on /dev/shm partition (Automated) + - id: 33020 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm : # mount -o remount,nodev /dev/shm." + compliance: + - cis: ["1.1.15"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'not c:mount -> r:\s*/dev/shm\s && !r:nodev' + + # 1.1.16 Ensure nosuid option set on /dev/shm partition (Automated) + - id: 33021 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm : # mount -o remount,nosuid /dev/shm." + compliance: + - cis: ["1.1.16"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'not c:mount -> r:\s*/dev/shm\s && !r:nosuid' + + # 1.1.17 Ensure noexec option set on /dev/shm partition (Automated) + - id: 33022 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm." + compliance: + - cis: ["1.1.16"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.2.063", "CM.3.069", "CM.4.073"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1191", "T1092", "T1175", "T1173", "T1519", "T1052", "T1210", "T1133", "T1118", "T1171", "T1170", "T1046", "T1137", "T1086", "T1164", "T1121", "T1076", "T1091", "T1180", "T1064", "T1184", "T1221", "T1127", "T1028"] + - nist_sp_800-53: ["CM-11"] + condition: all + rules: + - 'not c:mount -> r:\s*/dev/shm\s && !r:noexec' + + # 1.1.18 Ensure nodev option set on removable media partitions (Manual) - Not Implemented + # 1.1.19 Ensure nosuid option set on removable media partitions (Manual) - Not Implemented + # 1.1.20 Ensure noexec option set on removable media partitions (Manual) - Not Implemented + # 1.1.21 Ensure sticky bit is set on all world-writable directories (Automated) - Not Implemented + + # 1.1.22 Disable Automounting (Automated) + - id: 33023 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives. Note: This control should align with the tolerance of the use of portable drives and optical media in the organization. On a server requiring an admin to manually mount media can be part of defense-in-depth to reduce the risk of unapproved software or information being introduced or proprietary software or information being exfiltrated. If admins commonly use flash drives and Server access has sufficient physical controls, requiring manual mounting may not increase security." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "Run one of the following commands: Run the following command to disable autofs : # systemctl --now disable autofs OR Run the following command to remove autofs # apt purge autofs." + compliance: + - cis: ["1.1.22"] + - cis_csc_v7: ["8.4", "8.5"] + - cmmc_v2.0: ["SI.1.213"] + - iso_27001-2013: ["A.12.2.1"] + - mitre_techniques: ["T1215", "T1027", "T1045", "T1193", "T1194", "T1221", "T1200", "T1091"] + - nist_sp_800-53: ["SI-3"] + condition: any + rules: + - "c:systemctl is-enabled autofs -> r:disabled" + - "c:dpkg -s autofs -> r:package 'autofs' is not installed" + + # 1.1.23 Disable USB Storage (Automated) + - id: 33024 + title: "Disable USB Storage." + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment. Note: An alternative solution to disabling the usb-storage module may be found in USBGuard. Use of USBGuard and construction of USB device policies should be done in alignment with site policy." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/usb_storage.conf and add the following line: install usb-storage /bin/true Run the following command to unload the usb-storage module: rmmod usb-storage." + compliance: + - cis: ["1.1.23"] + - cis_csc_v7: ["8.4", "8.5"] + - cmmc_v2.0: ["SI.1.213"] + - iso_27001-2013: ["A.12.2.1"] + - mitre_techniques: ["T1215", "T1027", "T1045", "T1193", "T1194", "T1221", "T1200", "T1091"] + - nist_sp_800-53: ["SI-3"] + condition: all + rules: + - "c:modprobe -n -v usb-storage -> r:install /bin/true" + - "not c:lsmod -> r:usb-storage" + + ################################################## + # 1.2 Configure Software Updates + ################################################## + # 1.2.1 Ensure package manager repositories are configured (Manual) - Not Implemented + # 1.2.2 Ensure GPG keys are configured (Manual) - Not Implemented + + ################################################## + # 1.3 Configure sudo + ################################################## + + # 1.3.1 Ensure sudo is installed (Automated) + - id: 33025 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy. Note: Use the sudo-ldap package if you need LDAP support for sudoers." + rationale: "sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Install sudo using the following command. # apt install sudo OR # apt install sudo-ldap." + compliance: + - cis: ["1.3.1"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.2.008", "IA.1.076", "IA.1.077", "SC.3.181"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1176", "T1501", "T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: any + rules: + - "c:dpkg -s sudo -> r:install ok installed" + - "c:dpkg -s sudo-ldap -> r:install ok installed" + + # 1.3.2 Ensure sudo commands use pty (Automated) + - id: 33026 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo-pty Note: visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks or parse errors. If the sudoers file is currently being edited you will receive a message to try again later." + rationale: "Attackers can run a malicious program using sudo, which would again fork a background process that remains even when the main program has finished executing." + remediation: "Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["1.3.2"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.2.008", "IA.1.076", "IA.1.077", "SC.3.181"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1176", "T1501", "T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: any + rules: + - 'f:/etc/sudoers -> r:Defaults\s*\t*use_pty' + - 'd:/etc/sudoers.d/ -> r: \.* -> r:Defaults\s*\t*use_pty' + + # 1.3.3 Ensure sudo log file exists (Automated) + - id: 33027 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file. Note: visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks or parse errors. If the sudoers file is currently being edited you will receive a message to try again later." + rationale: "A sudo log file simplifies auditing of sudo commands." + remediation: 'Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo -f and add the following line: and add the following line: Defaults logfile="" Example: Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["1.3.3"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["CM.2.065"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12"] + - pci_dss_v3.2.1: ["10.1", "10.3"] + condition: any + rules: + - 'f:/etc/sudoers -> r:Defaults\s*\t*logfile=\S+' + - 'd:/etc/sudoers.d/ -> r: \.* -> r:Defaults\s*\t*logfile=\S+' + + ############################################### + # 1.4 Filesystem Integrity Checking + ############################################### + + # 1.4.1 Ensure AIDE is installed (Automated) + - id: 33028 + title: "Ensure AIDE is installed." + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system. Note: The prelinking feature can interfere with AIDE because it alters binaries to speed up their start up times. Run prelink -ua to restore the binaries to their prelinked state, thus avoiding false positives from AIDE." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Install AIDE using the appropriate package manager or manual installation: # apt install aide aide-common Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: Run the following commands: # aideinit # mv /var/lib/aide aide.db.new /var/lib/aide/aide.db." + compliance: + - cis: ["1.4.1"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AU.3.050"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-3"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + condition: all + rules: + - "c:dpkg -s aide -> r:Status: install ok installed" + - "c:dpkg -s aide-common -> r:Status: install ok installed" + + # 1.4.2 Ensure filesystem integrity is regularly checked (Automated) + - id: 33029 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem. Notes: - The checking in this recommendation occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy - systemd timers, timer file aidecheck.timer and service file aidecheck.service, have been included as an optional alternative to using cron - Ubuntu advises using /usr/bin/aide.wrapper rather than calling /usr/bin/aide directly in order to protect the database and prevent conflicts." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check: Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/bin/aide.wrapper --config /etc/aide/aide.conf --check OR If aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/bin/aide.wrapper --config /etc/aide/aide.conf --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + reference: + - https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service + - https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer + compliance: + - cis: ["1.4.2"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AU.3.050"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-3"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + condition: all + rules: + - "c:systemctl is-enabled aidecheck.service -> r:enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:enabled" + - 'c:systemctl status aidecheck.timer -> r:active\s*\(running\)' + + ######################################### + # 1.5 Secure Boot Settings + ######################################### + + # 1.5.1 Ensure permissions on bootloader config are configured (Automated) + - id: 33030 + title: "Ensure permissions on bootloader config are configured." + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. Notes: - This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings. - Replace /boot/grub/grub.cfg with the appropriate grub configuration file for your environment." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub/grub.cfg # chmod og-rwx /boot/grub/grub.cfg." + compliance: + - cis: ["1.5.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'c:stat /boot/grub/grub.cfg -> r:Access:\s*\(0400/-r--------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.5.2 Ensure bootloader password is set (Automated) + - id: 33031 + title: "Ensure bootloader password is set." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters. Notes: - This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings. - Replace /boot/grub/grub.cfg with the appropriate grub configuration file for your environment." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off AppArmor at boot time)." + impact: "If password protection is enabled, only the designated superuser can edit a Grub 2 menu item by pressing 'e' or access the GRUB 2 command line by pressing 'c' If GRUB 2 is set up to boot automatically to a password-protected menu entry the user has no option to back out of the password prompt to select another menu entry. Holding the SHIFT key will not display the menu in this case. The user must enter the correct username and password. If unable, the configuration files will have to be edited via the LiveCD or other means to fix the problem You can add --unrestricted to the menu entries to allow the system to boot without entering a password. Password will still be required to edit menu items. More Information: https://help.ubuntu.com/community/Grub2/Passwords." + remediation: 'Create an encrypted password with grub-mkpasswd-pbkdf2: # grub-mkpasswd-pbkdf2 Enter password: Reenter password: PBKDF2 hash of your password is . Add the following into a custom /etc/grub.d configuration file: cat < EOF. The superuser/user information and password should not be contained in the /etc/grub.d/00_header file as this file could be overwritten in a package update. If there is a requirement to be able to boot/reboot without entering the password, edit /etc/grub.d/10_linux and add --unrestricted to the line CLASS= Example: CLASS="--class gnu-linux --class gnu --class os --unrestricted". Run the following command to update the grub2 configuration: # update-grub.' + references: + - https://help.ubuntu.com/community/Grub2/Passwords + compliance: + - cis: ["1.5.2"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + # 1.5.3 Ensure authentication required for single user mode (Automated) + - id: 33032 + title: "Ensure authentication required for single user mode." + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root." + compliance: + - cis: ["1.5.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'f:/etc/shadow -> r:^root:\$\w' + + ############################################# + # 1.6 Additional Process Hardening + ############################################# + + # 1.6.1 Ensure XD/NX support is enabled (Automated) + - id: 33033 + title: "Ensure XD/NX support is enabled." + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature. Note: Ensure your system supports the XD or NX bit and has PAE support before implementing this recommendation as this may prevent it from booting if these are not supported by your hardware." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.6.1"] + - cis_csc_v7: ["8.3"] + - mitre_techniques: ["T1189", "T1190", "T1203", "T1212", "T1211", "T1068", "T1210", "T1117", "T1085", "T1080", "T1131", "T1003", "T1101"] + - nist_sp_800-53: ["SC-39", "SI-16"] + condition: all + rules: + - 'c:journalctl -> r:protection: active' + + # 1.6.2 Ensure address space layout randomization (ASLR) is enabled (Automated) + - id: 33034 + title: "Ensure address space layout randomization (ASLR) is enabled." + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2." + compliance: + - cis: ["1.6.2"] + - cis_csc_v7: ["8.3"] + - mitre_techniques: ["T1189", "T1190", "T1203", "T1212", "T1211", "T1068", "T1210", "T1117", "T1085", "T1080", "T1131", "T1003", "T1101"] + - nist_sp_800-53: ["SC-39", "SI-16"] + condition: any + rules: + - 'c:sysctl kernel.randomize_va_space -> r:kernel.randomize_va_space = 2' + - 'f:/etc/sysctl.conf -> r:kernel.randomize_va_space = 2' + - 'd:/etc/sysctl.d/ -> r:\.* -> r:kernel.randomize_va_space = 2' + + # 1.6.3 Ensure prelink is disabled (Automated) + - id: 33035 + title: "Ensure prelink is disabled." + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following command to restore binaries to normal: # prelink -ua Uninstall prelink using the appropriate package manager or manual installation: # apt purge prelink." + compliance: + - cis: ["1.6.3"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AU.3.050"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-3"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + condition: all + rules: + - "c:dpkg -s prelink -> r:package 'prelink' is not installed" + + # 1.6.4 Ensure core dumps are restricted (Automated) + - id: 33036 + title: "Ensure prelink is disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0 If systemd-coredump is installed: edit /etc/systemd/coredump.conf and add/modify the following lines: Storage=none ProcessSizeMax=0 Run the command: systemctl daemon-reload." + compliance: + - cis: ["1.6.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: any + rules: + - "f:/etc/security/limits.conf -> r:* hard core 0" + - 'd:/etc/security/limits.d -> r:\.*. -> r:* hard core 0' + - 'c:sysctl fs.suid_dumpable -> r:fs.suid_dumpable = 0' + - 'f:/etc/sysctl.conf -> r:fs.suid_dumpable = 0' + - 'd:/etc/sysctl.d/* -> r:\.* -> r:fs.suid_dumpable = 0' + - 'c:systemctl is-enabled coredump.service -> r:enabled|masked|disabled' + + ############################################## + # 1.7 Mandatory Access Control + ############################################## + # 1.7.1 Configure AppArmor + ############################################## + + # 1.7.1.1 Ensure AppArmor is installed (Automated) + - id: 33037 + title: "Ensure AppArmor is installed." + description: "AppArmor provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0 If systemd-coredump is installed: edit /etc/systemd/coredump.conf and add/modify the following lines: Storage=none ProcessSizeMax=0 Run the command: systemctl daemon-reload." + compliance: + - cis: ["1.7.1.1"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:dpkg -s apparmor -> r:install ok installed' + + # 1.7.1.2 Ensure AppArmor is enabled in the bootloader configuration (Automated) + - id: 33038 + title: "Ensure AppArmor is enabled in the bootloader configuration." + description: "Configure AppArmor to be enabled at boot time and verify that it has not been overwritten by the bootloader boot parameters. Note: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + rationale: "AppArmor must be enabled at boot time in your bootloader configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /etc/default/grub and add the apparmor=1 and security=apparmor parameters to the GRUB_CMDLINE_LINUX= line GRUB_CMDLINE_LINUX=\"apparmor=1 security=apparmor\" Run the following command to update the grub2 configuration: # update-grub." + compliance: + - cis: ["1.7.1.2"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'not f:/boot/grub/grub.cfg -> r:\s*linux && !r:apparmor=1' + - 'not f:/boot/grub/grub.cfg -> r:\s*linux && !r:security=apparmor' + + # 1.7.1.3 Ensure all AppArmor Profiles are in enforce or complain mode (Automated) + - id: 33039 + title: "Ensure all AppArmor Profiles are in enforce or complain mode." + description: "AppArmor profiles define what resources applications are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* OR Run the following command to set all profiles to complain mode: # aa-complain /etc/apparmor.d/* Note: Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.7.1.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:apparmor_status -> r:\d+ profiles are loaded || \d+ profiles are in enforce mode || \d+ profiles are in complain mode' + - 'c:apparmor_status -> r:^0\s*processes are unconfined' + + # 1.7.1.4 Ensure all AppArmor Profiles are enforcing (Automated) + - id: 33040 + title: "Ensure all AppArmor Profiles are enforcing." + description: "AppArmor profiles define what resources applications are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Note: Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.7.1.4"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:apparmor_status -> n:^(\d+)\s*profiles are loaded compare > 0' + - 'c:apparmor_status -> r:^0\s*profiles are in complain mode' + - 'c:apparmor_status -> r:^0\s*processes are unconfined' + + ######################################## + # 1.8 Warning Banners + ######################################## + + # 1.8.1 Ensure message of the day is configured properly (Automated) + - id: 33041 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.8.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: any + rules: + - "not f:/etc/motd" + - 'not f:/etc/motd -> r:\\v|\\r|\\m|\\s|Debian' + + # 1.8.2 Ensure permissions on /etc/issue.net are configured (Automated) + - id: 33042 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net." + compliance: + - cis: ["1.8.2"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.8.3 Ensure permissions on /etc/issue are configured (Automated) + - id: 33043 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue : # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue." + compliance: + - cis: ["1.8.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.8.4 Ensure permissions on /etc/motd are configured (Automated) + - id: 33044 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Note: If Message of the day is not needing, this file can be removed." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd : # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd OR Run the following command to remove the /etc/motd file: # rm /etc/motd." + compliance: + - cis: ["1.8.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: any + rules: + - "not f:/etc/motd" + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.8.5 Ensure remote login warning banner is configured properly (Automated) + - id: 33045 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.8.5"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|Debian' + + # 1.8.6 Ensure local login warning banner is configured properly (Automated) + - id: 33046 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the \" uname -a \" command once they have logged in." + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.8.6"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Debian' + + # 1.9 Ensure GDM is removed or login is configured (Automated) + - id: 33047 + title: "Ensure GDM is removed or login is configured." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "If a graphical login is not required, it should be removed to reduce the attack surface of the system. If a graphical login is required, last logged in user display should be disabled, and a warning banner should be configured. displaying the last logged in user eliminates half of the Userid/Password equation that an unauthorized person would need to log on. Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Note: If a different GUI login service is in use and required on the system, consult your documentation to disable displaying the last logged on user and apply an equivalent banner." + remediation: "Edit or create the file /etc/gdm3/greeter.dconf-defaults and edit or add the following: [org/gnome/login-screen] banner-message-enable=true banner-message-text='' disable-user-list=true Example banner message: Authorized uses only. All activity may be monitored and reported. Run the following command to re-load GDM on the next login or reboot: # dpkg-reconfigure gdm3." + compliance: + - cis: ["1.9"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'c:dpkg -s GDM -> r:install ok installed' + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:banner-message-enable=true' + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:banner-message-text=\S+' + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:disable-user-list=true' + + # 1.10 Ensure updates, patches, and additional security software are installed (Manual) + - id: 33048 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality. Notes: - Site policy may mandate a testing period before install onto production systems for available updates. - upgrade - is used to install the newest versions of all packages currently installed on the system from the sources enumerated in /etc/apt/sources.list. Packages currently installed with new versions available are retrieved and upgraded; under no circumstances are currently installed packages removed, or packages not already installed retrieved and installed. New versions of currently installed packages that cannot be upgraded without changing the install status of another package will be left at their current version. An update must be performed first so that apt knows that new versions of packages are available. - dist-upgrade - in addition to performing the function of upgrade, also intelligently handles changing dependencies with new versions of packages; apt has a \"smart\" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. So, dist-upgrade command may remove some packages. The /etc/apt/sources.list file contains a list of locations from which to retrieve desired package files. See also apt_preferences(5) for a mechanism for overriding the general settings for individual packages." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Run the following command to update all packages following local site policy guidance on applying updates and patches: # apt upgrade OR # apt dist-upgrade." + compliance: + - cis: ["1.10"] + - cis_csc_v7: ["3.4","3.5"] + - cmmc_v2.0: ["MA.2.111"] + - mitre_techniques: ["T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078", "T1103", "T1017", "T1138", "T1189", "T1190", "T1212", "T1211", "T1068", "T1210", "T1495", "T1137", "T1075", "T1195", "T1019", "T1072", "T1100"] + condition: none + rules: + - "c:apt -s upgrade -> r:^The following packages will be upgraded" + + ################################### + # 2 Services + ################################### + # 2.1 Special Purpose Services + ################################### + # 2.1.1 Time Synchronization + ################################### + + # 2.1.1.1 Ensure time synchronization is in use (Automated) + - id: 33049 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them. Notes: - If access to a physical host's clock is available and configured according to site policy, this section can be skipped - Only one time synchronization method should be in use on the system - If access to a physical host's clock is available and configured according to site policy, systemd-timesyncd should be stopped and masked." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On systems where host based time synchronization is not available, configure systemd-timesyncd. If \"full featured\" and/or encrypted time synchronization is required, install chrony or NTP. To install chrony: # apt install chrony To install ntp: # apt install ntp On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization." + compliance: + - cis: ["2.1.1.1"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.2.043"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.4"] + condition: any + rules: + - "c:systemctl is-enabled systemd-timesyncd -> r:enabled" + - "c:dpkg -s chrony -> r:install ok installed" + - "c:dpkg -s ntp -> r:install ok installed" + + # 2.1.1.2 Ensure systemd-timesyncd is configured (Manual) + - id: 33050 + title: "Ensure systemd-timesyncd is configured." + description: "systemd-timesyncd is a daemon that has been added for synchronizing the system clock across the network. It implements an SNTP client. In contrast to NTP implementations such as chrony or the NTP reference server this only implements a client side, and does not bother with the full NTP complexity, focusing only on querying time from one remote server and synchronizing the local clock to it. The daemon runs with minimal privileges, and has been hooked up with networkd to only operate when network connectivity is available. The daemon saves the current clock to disk every time a new NTP sync has been acquired, and uses this to possibly correct the system clock early at bootup, in order to accommodate for systems that lack an RTC such as the Raspberry Pi and embedded devices, and make sure that time monotonically progresses on these systems, even if it is not always correct. To make use of this daemon a new system user and group \"systemd-timesync\" needs to be created on installation of systemd. Notes: - The systemd-timesyncd service specifically implements only SNTP. This minimalistic service will set the system clock for large offsets or slowly adjust it for smaller deltas. More complex use cases are not covered by systemd-timesyncd - If chrony or ntp are used, systemd-timesyncd should be stopped and masked, and this section skipped - This recommendation only applies if timesyncd is in use on the system - Only one time synchronization method should be in use on the system." + rationale: "Proper configuration is vital to ensuring time synchronization is working properly." + remediation: "- Remove additional time synchronization methods: Run the following commands to remove ntp and chrony: # apt purge ntp # apt purge chrony - Configure systemd-timesyncd: Run the following command to enable systemd-timesyncd # systemctl enable systemd-timesyncd.service edit the file /etc/systemd/timesyncd.conf and add/modify the following lines: NTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org #Servers listed should be In Accordence With Local Policy FallbackNTP=2.debian.pool.ntp.org 3.debian.pool.ntp.org #Servers listed should be In Accordence With Local Policy RootDistanceMax=1 #should be In Accordence With Local Policy Run the following commands to start systemd-timesyncd.service # systemctl start systemd-timesyncd.service # timedatectl set-ntp true." + compliance: + - cis: ["2.1.1.2"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.2.043"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.4"] + condition: all + rules: + - "c:dpkg -s ntp -> r:package 'ntp' is not installed" + - "c:dpkg -s chrony -> r:package 'chrony' is not installed" + - "c:systemctl is-enabled systemd-timesyncd.service -> r:enabled" + - "c:timedatectl status -> r:NTP enabled: yes | NTP synchronized: yes" + + # 2.1.1.3 Ensure chrony is configured (Automated) + - id: 33051 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at: http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server. Notes: - If ntp or systemd-timesyncd are used, chrony should be removed and this section skipped - This recommendation only applies if chrony is in use on the system - Only one time synchronization method should be in use on the system." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Remove and/or disable additional time synchronization methods: Run the following command to remove ntp: # apt purge ntp Run the following command to stop and mask systemd-timesyncd: # systemctl --now mask systemd-timesyncd Configure chrony: Add or edit server or pool lines to /etc/chrony/chrony.conf as appropriate: server Add or edit the user line to /etc/chrony/chrony.conf: user _chrony." + compliance: + - cis: ["2.1.1.3"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.2.043"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.4"] + condition: all + rules: + - "c:dpkg -s ntp -> r:package 'ntp' is not installed" + - "c:systemctl is-enabled systemd-timesyncd -> r:masked" + - 'f:/etc/chrony/chrony.conf -> r:server\s*\S+' + - 'c:ps -ef -> r:_chrony' + + # 2.1.1.4 Ensure ntp is configured (Automated) + - id: 33052 + title: "Ensure ntp is configured." + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. Notes: - If chrony or systemd-timesyncd are used, ntp should be removed and this section skipped - This recommendation only applies if ntp is in use on the system - Only one time synchronization method should be in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "- Remove and/or disable additional time synchronization methods: Run the following command to remove chrony: apt purge chrony Run the following command to stop and mask systemd-timesyncd: # systemctl --now mask systemd-timesyncd - Configure ntp: Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file: RUNASUSER=ntp." + compliance: + - cis: ["2.1.1.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.2.043"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.4"] + condition: all + rules: + - "c:dpkg -s chrony -> r:package 'ntp' is not installed" + - "c:systemctl is-enabled systemd-timesyncd -> r:masked" + - 'f:/etc/ntp.conf -> r:restrict -(d+) && r:default && r:kod && r:nomodify && r:notrap && r:nopeer && r:noquery' + - 'f:/etc/ntp.conf -> r:restrict -6 && r:default && r:kod && r:nomodify && r:notrap && r:nopeer && r:noquery' + - 'f:/etc/ntp.conf -> r:server\s*\S+' + - 'f:/etc/init.d/ntp -> r:RUNASUSER=ntp' + + # 2.1.2 Ensure X Window System is not installed (Automated) + - id: 33053 + title: "Ensure X Window System is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: "Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the \"headless\" Java packages for your specific Java runtime, if provided by your distribution." + remediation: "Remove the X Windows System packages: apt purge xserver-xorg*." + compliance: + - cis: ["2.1.2"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.2.063", "CM.3.069", "CM.4.073"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1191", "T1092", "T1175", "T1173", "T1519", "T1052", "T1210", "T1133", "T1118", "T1171", "T1170", "T1046", "T1137", "T1086", "T1164", "T1121", "T1076", "T1091", "T1180", "T1064", "T1184", "T1221", "T1127", "T1028"] + - nist_sp_800-53: ["CM-11"] + condition: none + rules: + - 'c:dpkg -l xserver-xorg* -> r:^\w\s*xserver-xorg' + + # 2.1.3 Ensure Avahi Server is not installed (Automated) + - id: 33054 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to remove avahi-daemon: # systemctl stop avahi-daaemon.service # systemctl stop avahi-daemon.socket # apt purge avahi-daemon." + compliance: + - cis: ["2.1.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s avahi-daemon -> r:package 'avahi-daemon' is not installed" + + # 2.1.4 Ensure CUPS is not installed (Automated) + - id: 33055 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface." + impact: "Removing CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run one of the following commands to remove cups : # apt purge cups." + references: + - http://www.cups.org + compliance: + - cis: ["2.1.4"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s cups -> r:package 'cups' is not installed" + + # 2.1.5 Ensure DHCP Server is not installed (Automated) + - id: 33056 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove isc-dhcp-server: # apt purge isc-dhcp-server." + references: + - http://www.isc.org/software/dhcp. + compliance: + - cis: ["2.1.5"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s isc-dhcp-server -> r:package 'isc-dhcp-server' is not installed" + + # 2.1.6 Ensure LDAP server is not installed (Automated) + - id: 33057 + title: "Ensure LDAP server is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run one of the following commands to remove slapd: # apt purge slapd." + references: + - http://www.openldap.org. + compliance: + - cis: ["2.1.6"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s slapd -> r:package 'slapd' is not installed" + + # 2.1.7 Ensure NFS is not installed (Automated) + - id: 33058 + title: "Ensure NFS is not installed." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be removed to reduce the remote attack surface." + remediation: "Run the following command to remove nfs: # apt purge nfs-kernel-server." + compliance: + - cis: ["2.1.7"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s nfs-kernel-server -> r:package 'nfs-kernel-server' is not installed" + + # 2.1.8 Ensure DNS Server is not installed (Automated) + - id: 33059 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following commands to disable DNS server: # apt purge bind9." + compliance: + - cis: ["2.1.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s bind9 -> r:package 'bind9' is not installed" + + # 2.1.9 Ensure FTP Server is not installed (Automated) + - id: 33060 + title: "Ensure FTP Server is not installed." + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files. Note: Additional FTP servers also exist and should be audited." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # apt purge vsftpd." + compliance: + - cis: ["2.1.9"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s vsftpd -> r:package 'vsftpd' is not installed" + + # 2.1.10 Ensure HTTP server is not installed (Automated) + - id: 33061 + title: "Ensure HTTP server is not installed." + description: "HTTP or web servers provide the ability to host web site content. Note: Several httpd servers exist and can use other service names. apache2 and nginx are example services that provide an HTTP server. These and other services should also be audited." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove apache: # apt purge apache2." + compliance: + - cis: ["2.1.10"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s apache2 -> r:package 'apache2' is not installed" + + # 2.1.11 Ensure IMAP and POP3 server are not installed (Automated) + - id: 33062 + title: "Ensure IMAP and POP3 server are not installed." + description: "dovecot-imapd and dovecot-pop3d are an open source IMAP and POP3 server for Linux based systems. Note: Several IMAP/POP3 servers exist and can use other service names. courier-imap and cyrus-imap are example services that provide a mail server. These and other services should also be audited." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run one of the following commands to remove dovecot-imapd and dovecot-pop3d: # apt purge dovecot-imapd dovecot-pop3d." + compliance: + - cis: ["2.1.11"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s dovecot-imapd -> r:package 'dovecot-imapd' is not installed" + - "c:dpkg -s dovecot-pop3d -> r:package 'dovecot-pop3d' is not installed" + + # 2.1.12 Ensure Samba is not installed (Automated) + - id: 33063 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service should be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # apt purge samba." + compliance: + - cis: ["2.1.12"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s samba -> r:package 'samba' is not installed" + + # 2.1.13 Ensure HTTP Proxy Server is not installed (Automated) + - id: 33064 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments. Note: Several HTTP proxy servers exist. These and other services should be checked." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove squid: # apt purge squid." + compliance: + - cis: ["2.1.13"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s squid -> r:package 'squid' is not installed" + + # 2.1.14 Ensure SNMP Server is not installed (Automated) + - id: 33065 + title: "Ensure SNMP Server is not installed." + description: "Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. \"SNMPv2 historic\" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. - If SNMP v2 is absolutely necessary, modify the community strings' values." + remediation: "Run the following command to remove snmpd: # apt purge snmpd." + compliance: + - cis: ["2.1.14"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s snmpd -> r:package 'snmpd' is not installed" + + # 2.1.15 Ensure mail transfer agent is configured for local-only mode (Automated) + - id: 33066 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Note: This recommendation is designed around the exim4 mail server, depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/exim4/update-exim4.conf.conf and and or modify following lines to look like the lines below: dc_eximconfig_configtype='local' dc_local_interfaces='127.0.0.1 ; ::1' dc_readhost='' dc_relay_domains='' dc_minimaldns='false' dc_relay_nets='' dc_smarthost='' dc_use_split_config='false' dc_hide_mailname='' dc_mailname_in_oh='true' dc_localdelivery='mail_spool' Restart exim4: # systemctl restart exim4." + compliance: + - cis: ["2.1.15"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: none + rules: + - 'c:ss -lntu -> r:\.*:25 && r:\.*LISTEN && !r:127.0.0.1:25|[::1]:25' + + # 2.1.16 Ensure rsync service is not installed (Automated) + - id: 33067 + title: "Ensure rsync service is not installed." + description: "The rsync service can be used to synchronize files between systems over network links." + rationale: "The rsync service presents a security risk as it uses unencrypted protocols for communication. The rsync package should be removed to reduce the attack area of the system." + remediation: "Run the following command to remove rsync: # apt purge rsync." + compliance: + - cis: ["2.1.16"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s rsync -> r:package 'rsync' is not installed" + + # 2.1.17 Ensure NIS Server is not installed (Automated) + - id: 33068 + title: "Ensure NIS Server is not installed." + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed and other, more secure services be used." + remediation: "Run the following command to remove nis: # apt purge nis." + compliance: + - cis: ["2.1.17"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s nis -> r:package 'nis' is not installed" + + ##################################### + # 2.2 Service Clients + ##################################### + + # 2.2.1 Ensure NIS Client is not installed (Automated) + - id: 33069 + title: "Ensure NIS Server is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall nis: apt purge nis." + compliance: + - cis: ["2.2.1"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.2.063", "CM.3.069", "CM.4.073"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1191", "T1092", "T1175", "T1173", "T1519", "T1052", "T1210", "T1133", "T1118", "T1171", "T1170", "T1046", "T1137", "T1086", "T1164", "T1121", "T1076", "T1091", "T1180", "T1064", "T1184", "T1221", "T1127", "T1028"] + - nist_sp_800-53: ["CM-11"] + condition: all + rules: + - "c:dpkg -s nis -> r:package 'nis' is not installed" + + # 2.2.2 Ensure rsh client is not installed (Automated) + - id: 33070 + title: "Ensure rsh client is not installed." + description: "The rsh-client package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall rsh: apt purge rsh-client." + compliance: + - cis: ["2.2.2"] + - cis_csc_v7: ["4.5"] + - cmmc_v2.0: ["IA.3.083"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1176", "T1501", "T1098", "T1017", "T1110", "T1136", "T1530", "T1114", "T1133", "T1040", "T1076", "T1021", "T1539", "T1072", "T1078", "T1134", "T1067", "T1088", "T1175", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1100", "T1077", "T1047", "T1084", "T1028"] + - pci_dss_v3.2.1: ["2.3", "8.3", "8.3.1", "8.3.2"] + condition: all + rules: + - "c:dpkg -s rsh-client -> r:package 'rsh-client' is not installed" + + # 2.2.3 Ensure talk client is not installed (Automated) + - id: 33071 + title: "Ensure talk client is not installed." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall talk: apt purge talk." + compliance: + - cis: ["2.2.3"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.2.063", "CM.3.069", "CM.4.073"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1191", "T1092", "T1175", "T1173", "T1519", "T1052", "T1210", "T1133", "T1118", "T1171", "T1170", "T1046", "T1137", "T1086", "T1164", "T1121", "T1076", "T1091", "T1180", "T1064", "T1184", "T1221", "T1127", "T1028"] + - nist_sp_800-53: ["CM-11"] + condition: all + rules: + - "c:dpkg -s talk -> r:package 'talk' is not installed" + + # 2.2.4 Ensure telnet client is not installed (Automated) + - id: 33072 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall telnet: # apt purge telnet." + compliance: + - cis: ["2.2.4"] + - cis_csc_v7: ["4.5"] + - cmmc_v2.0: ["IA.3.083"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1176", "T1501", "T1098", "T1017", "T1110", "T1136", "T1530", "T1114", "T1133", "T1040", "T1076", "T1021", "T1539", "T1072", "T1078", "T1134", "T1067", "T1088", "T1175", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1100", "T1077", "T1047", "T1084", "T1028"] + - pci_dss_v3.2.1: ["2.3", "8.3", "8.3.1", "8.3.2"] + condition: all + rules: + - "c:dpkg -s telnet -> r:package 'telnet' is not installed" + + # 2.2.5 Ensure LDAP client is not installed (Automated) + - id: 33073 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Uninstall ldap-utils: # apt purge ldap-utils." + compliance: + - cis: ["2.2.5"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.2.063", "CM.3.069", "CM.4.073"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1191", "T1092", "T1175", "T1173", "T1519", "T1052", "T1210", "T1133", "T1118", "T1171", "T1170", "T1046", "T1137", "T1086", "T1164", "T1121", "T1076", "T1091", "T1180", "T1064", "T1184", "T1221", "T1127", "T1028"] + - nist_sp_800-53: ["CM-11"] + condition: all + rules: + - "c:dpkg -s ldap-utils -> r:package 'ldap-utils' is not installed" + + # 2.2.6 Ensure RPC is not installed (Automated) + - id: 33074 + title: "Ensure RPC is not installed." + description: "Remote Procedure Call (RPC) is a method for creating low level client server applications across different system architectures. It requires an RPC compliant client listening on a network port. The supporting package is rpcbind." + rationale: "If RPC is not required, it is recommended that this services be removed to reduce the remote attack surface." + remediation: "Run the following command to remove rpcbind: # apt purge rpcbind." + compliance: + - cis: ["2.2.5"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - "c:dpkg -s rpcbind -> r:package 'rpcbind' is not installed" + + # 2.3 Ensure nonessential services are removed or masked (Manual) - Not Implemented + ################################################### + # 3 Network Configuration + ################################################### + # 3.1 Disable unused network protocols and devices + ################################################### + + # 3.1.1 Disable IPv6. (Manual) - Not Implemented + # 3.1.2 Ensure wireless interfaces are disabled. (Automated) - Not Implemented + ################################################### + # 3.2 Network Parameters (Host Only) + ################################################### + # 3.2.1 Ensure packet redirect sending is disabled. (Automated) - Not Implemented + # 3.2.2 Ensure IP forwarding is disabled. (Automated) - Not Implemented + ##################################################### + # 3.3 Network Parameters (Host and Router) + ##################################################### + # 3.3.1 Ensure source routed packets are not accepted. (Automated) - Not Implemented + # 3.3.2 Ensure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.3 Ensure secure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.4 Ensure suspicious packets are logged. (Automated) - Not Implemented + + # 3.3.5 Ensure broadcast ICMP requests are ignored. (Automated) + - id: 33075 + title: "Ensure broadcast ICMP requests are ignored." + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.5"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: any + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:net.ipv4.icmp_echo_ignore_broadcasts = 1' + - 'f:/etc/sysctl.conf -> r:net.ipv4.icmp_echo_ignore_broadcasts = 1' + - 'd:/etc/sysctl.d -> r:\. -> r:net.ipv4.icmp_echo_ignore_broadcasts = 1' + + # 3.3.6 Ensure bogus ICMP responses are ignored. (Automated) + - id: 33076 + title: "Ensure bogus ICMP responses are ignored." + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.6"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: any + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:net.ipv4.icmp_ignore_bogus_error_responses = 1' + - 'f:/etc/sysctl.conf -> r:net.ipv4.icmp_ignore_bogus_error_responses = 1' + - 'd:/etc/sysctl.d -> r:\. -> r:net.ipv4.icmp_ignore_bogus_error_responses = 1' + + # 3.3.7 Ensure Reverse Path Filtering is enabled. (Automated) - Not Implemented + + # 3.3.8 Ensure TCP SYN Cookies is enabled. (Automated) + - id: 33077 + title: "Ensure TCP SYN Cookies is enabled." + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.8"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: any + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:net.ipv4.tcp_syncookies = 1' + - 'f:/etc/sysctl.conf -> r:net.ipv4.tcp_syncookies = 1' + - 'd:/etc/sysctl.d -> r:\. -> r:net.ipv4.tcp_syncookies = 1' + + # 3.3.9 Ensure IPv6 router advertisements are not accepted. (Automated) - Not Implemented + ################################################### + # 3.5 Uncommon Network Protocols + ################################################### + + # 3.5.1 Ensure DCCP is disabled. (Automated) + - id: 33078 + title: "Ensure DCCP is disabled." + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/dccp.conf Add the following line: install dccp /bin/true." + compliance: + - cis: ["3.5.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - 'c:modprobe -n -v dccp -> r:install /bin/true' + - 'not c:lsmod -> r:dccp' + + # 3.5.2 Ensure SCTP is disabled. (Automated) + - id: 33079 + title: "Ensure SCTP is disabled." + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/sctp.conf and add the following line: install sctp /bin/true." + compliance: + - cis: ["3.5.2"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - 'c:modprobe -n -v sctp -> r:install /bin/true' + - 'not c:lsmod -> r:sctp' + + # 3.5.3 Ensure RDS is disabled. (Automated) + - id: 33080 + title: "Ensure RDS is disabled." + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/rds.conf and add the following line: install rds /bin/true." + compliance: + - cis: ["3.5.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - 'c:modprobe -n -v rds -> r:install /bin/true' + - 'not c:lsmod -> r:rds' + + # 3.5.4 Ensure TIPC is disabled. (Automated) + - id: 33081 + title: "Ensure TIPC is disabled." + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/tipc.conf and add the following line: install tipc /bin/true." + compliance: + - cis: ["3.5.4"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - 'c:modprobe -n -v tipc -> r:install /bin/true' + - 'not c:lsmod -> r:tipc' + + ######################################## + # 3.6 Firewall Configuration + ######################################## + # 3.6.1 Configure UncomplicatedFirewall + ######################################## + + # 3.6.1.1 Ensure Uncomplicated Firewall is installed. (Automated) + - id: 33082 + title: "Ensure Uncomplicated Firewall is installed." + description: "The Uncomplicated Firewall (ufw) is a frontend for iptables and is particularly well-suited for host-based firewalls. ufw provides a framework for managing netfilter, as well as a command-line interface for manipulating the firewall." + rationale: "A firewall utility is required to configure the Linux kernel's netfilter framework via the iptables or nftables back-end. The Linux kernel's netfilter framework host-based firewall can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host. Note: Only one firewall utility should be installed and configured. UFW is dependent on the iptables package." + remediation: "Run the following command to install Uncomplicated Firewall (UFW): apt install ufw." + compliance: + - cis: ["3.6.1.1"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - 'c:dpkg -s ufw -> r:install ok installed' + + # 3.6.1.2 Ensure iptables-persistent is not installed. (Automated) + - id: 33083 + title: "Ensure iptables-persistent is not installed." + description: "The iptables-persistent is a boot-time loader for netfilter rules, iptables plugin." + rationale: "Running both ufw and the services included in the iptables-persistent package may lead to conflict." + remediation: "Run the following command to remove the iptables-persistent package: # apt purge iptables-persistent." + compliance: + - cis: ["3.6.1.2"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - "c:dpkg-query -s iptables-persistent -> r:package 'iptables-persistent' is not installed" + + # 3.6.1.3 Ensure ufw service is enabled. (Automated) + - id: 33084 + title: "Ensure ufw service is enabled." + description: "UncomplicatedFirewall (ufw) is a frontend for iptables. ufw provides a framework for managing netfilter, as well as a command-line and available graphical user interface for manipulating the firewall. Notes: - When running ufw enable or starting ufw via its initscript, ufw will flush its chains. This is required so ufw can maintain a consistent state, but it may drop existing connections (eg ssh). ufw does support adding rules before enabling the firewall. - Run the following command before running ufw enable. # ufw allow proto tcp from any to any port 22 - The rules will still be flushed, but the ssh port will be open after enabling the firewall. Please note that once ufw is 'enabled', ufw will not flush the chains when adding or removing rules (but will when modifying a rule or changing the default policy) - By default, ufw will prompt when enabling the firewall while running under ssh. This can be disabled by using ufw --force enable." + rationale: "The ufw service must be enabled and running in order for ufw to protect the system." + impact: "Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following command to enable ufw: # ufw enable." + references: + - 'http://manpages.ubuntu.com/manpages/precise/en/man8/ufw.8.html' + compliance: + - cis: ["3.6.1.3"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - 'c:systemctl is-enabled ufw -> r:enabled' + - 'c:ufw status -> r:Status: active' + + # 3.6.1.4 Ensure loopback traffic is configured. (Automated) - Not Implemented + # 3.6.1.5 Ensure outbound connections are configured. (Manual) - Not Implemented + # 3.6.1.6 Ensure firewall rules exist for all open ports. (Manual) - Not Implemented + + # 3.6.1.7 Ensure default deny firewall policy. (Automated) + - id: 33085 + title: "Ensure default deny firewall policy." + description: "A default deny policy on connections ensures that any unconfigured network usage will be rejected. Note: Any port or protocol without a explicit allow before the default deny will be blocked." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + impact: "Any port and protocol not explicitly allowed will be blocked. The following rules should be considered before applying the default deny. ufw allow git ufw allow in http ufw allow in https ufw allow out 53 ufw logging on." + remediation: "Run the following commands to implement a default deny policy: # ufw default deny incoming # ufw default deny outgoing # ufw default deny routed." + compliance: + - cis: ["3.6.1.7"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - 'c:ufw status verbose -> r:^Default && r:deny\W+\(incoming\)|reject\W+\(incoming\)' + - 'c:ufw status verbose -> r:^Default && r:deny\W+\(outgoing\)|reject\W+\(outgoing\)' + - 'c:ufw status verbose -> r:^Default && r:deny\W+\(routed\)|reject\W+\(routed\)' + + ############################################# + # 3.6.2 Configure nftables + ############################################# + + # 3.6.2.1 Ensure nftables is installed. (Automated) + - id: 33086 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem. Notes: - nftables is available in Linux kernel 3.13 and newer - Only one firewall utility should be installed and configured - Changing firewall settings while connected over the network can result in being locked out of the system." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + remediation: "Run the following command to install nftables: # apt install nftables." + compliance: + - cis: ["3.6.2.1"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - 'c:dpkg-query -s nftables -> r:install ok installed' + + # 3.6.2.2 Ensure Uncomplicated Firewall is not installed or disabled. (Automated) + - id: 33087 + title: "Ensure Uncomplicated Firewall is not installed or disabled." + description: "Uncomplicated Firewall (UFW) is a program for managing a netfilter firewall designed to be easy to use." + rationale: "Running both the nftables service and ufw may lead to conflict and unexpected results." + remediation: "Run one of the following commands to either remove ufw or disable ufw Run the following command to remove ufw: # apt purge ufw Run the following command to disable ufw: # ufw disable." + compliance: + - cis: ["3.6.2.2"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: any + rules: + - "c:dpkg-query -s ufw -> r:package 'ufw' is not installed" + - 'c:ufw status -> r:inactive' + + # 3.6.2.3 Ensure iptables are flushed. (Manual) + - id: 33088 + title: "Ensure iptables are flushed." + description: "nftables is a replacement for iptables, ip6tables, ebtables and arptables." + rationale: "It is possible to mix iptables and nftables. However, this increases complexity and also the chance to introduce errors. For simplicity flush out all iptables rules, and ensure it is not loaded." + remediation: "Run the following commands to flush iptables: For iptables: # iptables -F For ip6tables: # ip6tables -F." + compliance: + - cis: ["3.6.2.3"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: none + rules: + - 'c:iptables -L -> r:Chain INPUT' + - 'c:ip6tables -L -> r:Chain INPUT' + + # 3.6.2.4 Ensure a table exists. (Automated) + - id: 33089 + title: "Ensure a table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + impact: "Adding rules to a running nftables can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example: # nft create table inet filter." + compliance: + - cis: ["3.6.2.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - 'c:nft list tables -> r:table inet' + + # 3.6.2.5 Ensure base chains exist. (Automated) + - id: 33090 + title: "Ensure base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.6.2.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - 'c:nft list ruleset -> r:type filter hook input priority 0' + - 'c:nft list ruleset -> r:type filter hook forward priority 0' + - 'c:nft list ruleset -> r:type filter hook output priority 0' + + # 3.6.2.6 Ensure loopback traffic is configured. (Automated) + - id: 33091 + title: "Ensure loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # nft add rule inet filter input iif lo accept # nft create rule inet filter input ip saddr 127.0.0.0/8 counter drop IF IPv6 is enabled on the system: Run the following command to implement the IPv6 loopback rule: # nft add rule inet filter input ip6 saddr ::1 counter drop." + compliance: + - cis: ["3.6.2.6"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - 'c:sh -c "nft list ruleset | awk ''/hook input/,/}/''" -> r:iif "lo" accept' + - 'c:sh -c "nft list ruleset | awk ''/hook input/,/}/''" -> r:ip saddr|ip6 saddr' + + # 3.6.2.7 Ensure outbound and established connections are configured. (Manual) - Not Implemented + + # 3.6.2.8 Ensure default deny firewall policy. (Automated) + - id: 33092 + title: "Ensure default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue transversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; } # nft chain inet filter output { policy drop \\; }." + compliance: + - cis: ["3.6.2.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - "not c:nft list ruleset -> r:hook input && !r:policy drop" + - "not c:nft list ruleset -> r:hook forward && !r:policy drop" + - "not c:nft list ruleset -> r:hook output && !r:policy drop" + + # 3.6.2.9 Ensure nftables service is enabled. (Automated) + - id: 33093 + title: "Ensure nftables service is enabled." + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables." + compliance: + - cis: ["3.6.2.9"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - "c:systemctl is-enabled nftables -> r:enabled" + + # 3.6.2.10 Ensure nftables rules are permanent. (Automated) - Not Implemented + ######################################## + # 3.6.3 Configure iptables + ######################################## + # 3.6.3.1 Configure software + ######################################## + + # 3.6.3.1.1 Ensure iptables packages are installed. (Automated) + - id: 33094 + title: "Ensure iptables packages are installed." + description: "iptables is a utility program that allows a system administrator to configure the tables provided by the Linux kernel firewall, implemented as different Netfilter modules, and the chains and rules it stores. Different kernel modules and programs are used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames." + rationale: "A method of configuring and maintaining firewall rules is necessary to configure a Host Based Firewall." + remediation: "Run the following command to install iptables and iptables-persistent # apt install iptables iptables-persistent." + compliance: + - cis: ["3.6.3.1.1"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - "c:apt list iptables -> r:installed" + - "c:apt list iptables-persistent -> r:installed" + + # 3.6.3.1.2 Ensure nftables is not installed. (Automated) + - id: 33095 + title: "Ensure nftables is not installed." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables." + rationale: "Running both iptables and nftables may lead to conflict." + remediation: "Run the following command to remove nftables: # apt purge nftables." + compliance: + - cis: ["3.6.3.1.2"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - "c:dpkg -s nftables -> r:package 'nftables' is not installed" + + # 3.6.3.1.3 Ensure Uncomplicated Firewall is not installed or disabled. (Automated) + - id: 33096 + title: "Ensure Uncomplicated Firewall is not installed or disabled." + description: "Uncomplicated Firewall (UFW) is a program for managing a netfilter firewall designed to be easy to use. - Uses a command-line interface consisting of a small number of simple commands - Uses iptables for configuration." + rationale: "Running iptables.persistent with ufw enabled may lead to conflict and unexpected results." + remediation: "Run one of the following commands to either remove ufw or stop and mask ufw Run the following command to remove ufw: # apt purge ufw OR Run the following commands to disable ufw: # ufw disable." + compliance: + - cis: ["3.6.3.1.3"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: any + rules: + - "c:dpkg-query -s ufw -> r:package 'ufw' is not installed" + - 'c:ufw status -> r:inactive' + - 'c:systemctl is-enabled ufw -> r:masked' + + ############################################ + # 3.6.3.2 Configure IPv4 iptables + ############################################ + # 3.6.3.2.1 Ensure default deny firewall policy. (Automated) + - id: 33097 + title: "Ensure default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected. Notes: - Changing firewall settings while connected over network can result in being locked out of the system - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP." + compliance: + - cis: ["3.6.3.2.1"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)|Chain INPUT \(policy REJECT\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)|Chain FORWARD \(policy REJECT\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)|Chain OUTPUT \(policy REJECT\)' + + # 3.6.3.2.2 Ensure loopback traffic is configured. (Automated) + - id: 33098 + title: "Ensure loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8). Notes: - Changing firewall settings while connected over network can result in being locked out of the system - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP." + compliance: + - cis: ["3.6.3.2.2"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + # 3.6.3.2.3 Ensure outbound and established connections are configured. (Manual) - Not Implemented + # 3.6.3.2.4 Ensure firewall rules exist for all open ports. (Automated) - Not Implemented + ###################################### + # 3.6.3.3 Configure IPv6 ip6tables + ###################################### + + # 3.6.3.3.1 Ensure IPv6 default deny firewall policy. (Automated) + - id: 33099 + title: "Ensure IPv6 default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected. Notes: - Changing firewall settings while connected over network can result in being locked out of the system - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP." + compliance: + - cis: ["3.6.3.3.1"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - "c:ip6tables -L -> r:^Chain INPUT && r:policy DROP" + - "c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP" + + # 3.6.3.3.2 Ensure IPv6 loopback traffic is configured. (Automated) + - id: 33100 + title: "Ensure IPv6 loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1). Notes: - Changing firewall settings while connected over network can result in being locked out of the system - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP." + compliance: + - cis: ["3.6.3.3.2"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.3.068"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.4"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + # 3.6.3.3.3 Ensure IPv6 outbound and established connections are configured. (Manual) - Not Implemented + # 3.6.3.3.4 Ensure IPv6 firewall rules exist for all open ports. (Manual) - Not Implemented + + ############################################## + # 4 Logging and Auditing + ############################################## + # 4.1 Configure System Accounting (auditd) + ############################################## + # 4.1.1 Ensure auditing is enabled + ############################################## + + # 4.1.1.1 Ensure auditd is installed. (Automated) + - id: 33101 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # apt install auditd audispd-plugins." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v7: ["6.2","6.3"] + - cmmc_v2.0: ["AU.2.042", "AU.5.055", "CM.2.065"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + condition: all + rules: + - 'c:dpkg -s auditd -> r:install ok installed' + - 'c:dpkg -s audispd-plugins -> r:install ok installed' + + # 4.1.1.2 Ensure auditd service is enabled. (Automated) + - id: 33102 + title: "Ensure auditd service is enabled." + description: "Enable and start the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd : # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v7: ["6.2","6.3"] + - cmmc_v2.0: ["AU.2.042", "AU.5.055", "CM.2.065"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + condition: all + rules: + - 'c:systemctl is-enabled auditd -> r:enabled' + + # 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled. (Automated) + - id: 33103 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub so that processes that are capable of being audited can be audited even if they start up prior to auditd startup. Note: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings. Replace /boot/grub/grub.cfg with the appropriate grub configuration file for your environment." + rationale: "Audit events need to be captured on processes that start up prior to auditd , so that potential malicious activity cannot go undetected." + remediation: "Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX=\"audit=1\" Run the following command to update the grub2 configuration: # update-grub." + compliance: + - cis: ["4.1.1.3"] + - cis_csc_v7: ["6.2","6.3"] + - cmmc_v2.0: ["AU.2.042", "AU.5.055", "CM.2.065"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + condition: all + rules: + - 'not f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !n:audit=(\d+) compare == 1' + + # 4.1.1.4 Ensure audit_backlog_limit is sufficient. (Automated) + - id: 33104 + title: "Ensure audit_backlog_limit is sufficient." + description: "The backlog limit has a default setting of 64." + rationale: "during boot if audit=1, then the backlog will hold 64 records. If more that 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected." + remediation: "Edit /etc/default/grub and add audit_backlog_limit= to GRUB_CMDLINE_LINUX: Example: GRUB_CMDLINE_LINUX=\"audit_backlog_limit=8192\" Run the following command to update the grub2 configuration: # update-grub." + compliance: + - cis: ["4.1.1.4"] + - cis_csc_v7: ["6.2","6.3"] + - cmmc_v2.0: ["AU.2.042", "AU.5.055", "CM.2.065"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + condition: all + rules: + - 'not f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !n:audit_backlog_limit=(\d+) compare >= 8192' + + ####################################### + # 4.1.2 Configure Data Retention + ####################################### + + # 4.1.2.1 Ensure audit log storage size is configured. (Automated) + - id: 33105 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started. Notes: - The max_log_file parameter is measured in megabytes - Other methods of log rotation may be appropriate based on site policy. One example is time-based rotation strategies which don't have native support in auditd configurations - Manual audit of custom configurations should be evaluated for effectiveness and completeness." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-4"] + - pci_dss_v3.2.1: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' + + # 4.1.2.2 Ensure audit logs are not automatically deleted. (Automated) + - id: 33106 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-4"] + - pci_dss_v3.2.1: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full. (Automated) + - id: 33107 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-4"] + - pci_dss_v3.2.1: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*\t*=\s*\t*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*\t*=\s*\t*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*\t*=\s*\t*halt|^\s*\t*admin_space_left_action\s*\t*=\s*\t*single' + + # 4.1.3 Ensure events that modify date and time information are collected. (Automated) + - id: 33108 + title: "Ensure events that modify date and time information are collected." + description: "Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier \"time-change\" Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/time-change.rules Add the following lines: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/time-change.rules Add the following lines: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change." + compliance: + - cis: ["4.1.3"] + - cis_csc_v7: ["5.5"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_techniques: ["T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + - nist_sp_800-53: ["CM-6"] + - pci_dss_v3.2.1: ["11.5"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:adjtimex && r:settimeofday|stime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32|-F arch=b64 && r:-S && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change' + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:adjtimex && r:settimeofday|stime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32|-F arch=b64 && r:-S && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change" + + # 4.1.4 Ensure events that modify user/group information are collected. (Automated) + - id: 33109 + title: "Ensure events that modify user/group information are collected." + description: "Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier \"identity\" in the audit log file. Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules: Example: vi /etc/audit/rules.d/identity.rules Add the following lines: -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity." + compliance: + - cis: ["4.1.4"] + - cis_csc_v7: ["4.8"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_techniques: ["T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209"] + - nist_sp_800-53: ["AU-3"] + - pci_dss_v3.2.1: ["10.2.5"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity' + - "c:auditctl -l -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity" + + # 4.1.5 Ensure events that modify the system's network environment are collected. (Automated) + - id: 33110 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre-login), /etc/hosts (file containing host names and associated IP addresses) and /etc/network (directory containing network interface scripts and configurations) files. Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier \"system-locale.\"." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/system-locale.rules Add the following lines: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/network -p wa -k system-locale For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/system-locale.rules Add the following lines: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/network -p wa -k system-locale." + compliance: + - cis: ["4.1.5"] + - cis_csc_v7: ["5.5"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_techniques: ["T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + - nist_sp_800-53: ["CM-6"] + - pci_dss_v3.2.1: ["11.5"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32|-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/network && r:-p wa && r:-k system-locale|key=system-locale' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32|-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/network && r:-p wa && r:-k system-locale|key=system-locale" + + # 4.1.6 Ensure events that modify the system's Mandatory Access Controls are collected. (Automated) + - id: 33111 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor AppArmor mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to /etc/apparmor and /etc/apparmor.d directories. Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/MAC-policy.rules Add the following lines: -w /etc/apparmor/ -p wa -k MAC-policy -w /etc/apparmor.d/ -p wa -k MAC-policy." + compliance: + - cis: ["4.1.6"] + - cis_csc_v7: ["5.5"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_techniques: ["T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + - nist_sp_800-53: ["CM-6"] + - pci_dss_v3.2.1: ["11.5"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor/|/etc/apparmor\s+ && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor.d/|/etc/apparmor.d\s+ && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - 'c:auditctl -l -> r:^-w && r:/etc/apparmor/|/etc/apparmor\\s+ && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - 'c:auditctl -l -> r:^-w && r:/etc/apparmor.d/|/etc/apparmor.d\\s+ && r:-p wa && r:-k MAC-policy|key=MAC-policy' + + # 4.1.7 Ensure login and logout events are collected. (Automated) + - id: 33112 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules: Example: vi /etc/audit/rules.d/logins.rules Add the following lines: -w /var/log/faillog -p wa -k logins -w /var/log/lastlog -p wa -k logins -w /var/log/tallylog -p wa -k logins." + compliance: + - cis: ["4.1.7"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ['AC.2.010', 'SI.5.223', 'AC.4.032', 'IA.3.086', 'AC.3.019'] + - iso_27001-2013: ['A.8.1.3', 'A.9.4.2'] + - mitre_techniques: ["T1134", "T1197", "T1538", "T1530", "T1213", "T1089", "T1157", "T1044", "T1484", "T1054", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1034", "T1163", "T1076", "T1021", "T1053", "T1489", "T1051", "T1023", "T1165", "T1528", "T1501", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ['AU-3'] + - pci_dss_v3.2.1: ['10.2.4', '8.1.8', '10.2.5'] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/faillog && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/tallylog && r:-p wa && r:-k logins' + - "c:auditctl -l -> r:^-w && r:/var/log/faillog && r:-p wa && r:-k logins" + - "c:auditctl -l -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins" + - "c:auditctl -l -> r:^-w && r:/var/log/tallylog && r:-p wa && r:-k logins" + + # 4.1.8 Ensure session initiation information is collected. (Automated) + - id: 33113 + title: "Ensure session initiation information is collected." + description: "Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp tracks all currently logged in users. All audit records will be tagged with the identifier \"session.\" The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier \"logins.\" Notes: - The last command can be used to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp) - Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules: Example: vi /etc/audit/rules.d/session.rules Add the following lines: -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k logins -w /var/log/btmp -p wa -k logins." + compliance: + - cis: ["4.1.8"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ['AC.2.010', 'SI.5.223', 'AC.4.032', 'IA.3.086', 'AC.3.019'] + - iso_27001-2013: ['A.8.1.3', 'A.9.4.2'] + - mitre_techniques: ["T1134", "T1197", "T1538", "T1530", "T1213", "T1089", "T1157", "T1044", "T1484", "T1054", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1034", "T1163", "T1076", "T1021", "T1053", "T1489", "T1051", "T1023", "T1165", "T1528", "T1501", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ['AU-3'] + - pci_dss_v3.2.1: ['10.2.4', '8.1.8', '10.2.5'] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session' + - "c:auditctl -l -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session" + + # 4.1.9 Ensure discretionary access control permission modification events are collected. (Automated) + - id: 33114 + title: "Ensure discretionary access control permission modification events are collected." + description: "Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier \"perm_mod.\" Notes: - Systems may have been customized to change the default UID_MIN. To confirm the UID_MIN for your system, run the following command: awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs - If your systems' UID_MIN is not 1000, replace audit>=1000 with audit>= in the Audit and Remediation procedures. - Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules: Example: vi /etc/audit/rules.d/perm_mod.rules Add the following lines: -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/perm_mod.rules Add the following lines: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod." + compliance: + - cis: ["4.1.9"] + - cis_csc_v7: ["5.5"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_techniques: ["T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + - nist_sp_800-53: ["CM-6"] + - pci_dss_v3.2.1: ["11.5"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a always,exit && r:-F arch=b64|-F arch=b32 && r:-S && r:chmod && r:fchmod && r:fchmodat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a always,exit && r:-F arch=b64|-F arch=b32 && r:-S && r:chown && r:fchown && r:lchown && r:fchownat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a always,exit && r:-F arch=b64|-F arch=b32 && r:-S && r:setxattr && r:lsetxattr && r:fsetxattr && r:removexattr && r:lremovexattr && r:fremovexattr && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'c:auditctl -l -> r:^-a always,exit && r:-F arch=b64|-F arch=b32 && r:-S && r:chmod && r:fchmod && r:fchmodat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'c:auditctl -l -> r:^-a always,exit && r:-F arch=b64|-F arch=b32 && r:-S && r:chown && r:fchown && r:lchown && r:fchownat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + - 'c:auditctl -l -> r:^-a always,exit && r:-F arch=b64|-F arch=b32 && r:-S && r:setxattr && r:lsetxattr && r:fsetxattr && r:removexattr && r:lremovexattr && r:fremovexattr && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_mod|key=perm_mod' + + # 4.1.10 Ensure unsuccessful unauthorized file access attempts are collected. (Automated) + - id: 33115 + title: "Ensure unsuccessful unauthorized file access attempts are collected." + description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation (creat), opening (open , openat) and truncation ( truncate , ftruncate) of files. An audit log record will only be written if the user is a non-privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\" Notes: - Systems may have been customized to change the default UID_MIN. To confirm the UID_MIN for your system, run the following command:_ # awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs - If your systems' UID_MIN is not 1000, replace audit>=1000 with audit>= in the Audit and Remediation procedures. - Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/audit.rules Add the following lines: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/access.rules Add the following lines: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access." + compliance: + - cis: ["4.1.10"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AU.3.050"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-3"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EACCES && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EPERM && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EACCES && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EPERM && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + + # 4.1.11 Ensure use of privileged commands is collected. (Automated) - Not Implemented + + # 4.1.12 Ensure successful file system mounts are collected. (Automated) + - id: 33116 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user Notes: - Systems may have been customized to change the default UID_MIN. To confirm the UID_MIN for your system, run the following command:_ # awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs - If your systems' UID_MIN is not 1000, replace audit>=1000 with audit>= in the Audit and Remediation procedures. - This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). - Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/audit.rules Add the following lines: -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/mounts.rules Add the following lines: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts." + compliance: + - cis: ["4.1.12"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + + # 4.1.13 Ensure file deletion events by users are collected. (Automated) + - id: 33117 + title: "Ensure file deletion events by users are collected." + description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier \"delete\". Notes: - Systems may have been customized to change the default UID_MIN. To confirm the UID_MIN for your system, run the following command:_ # awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs - If your systems' UID_MIN is not 1000, replace audit>=1000 with audit>= in the Audit and Remediation procedures. - At a minimum, configure the audit system to collect file deletion events for all users and root. - Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/audit.rules Add the following lines: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/delete.rules Add the following lines: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete." + compliance: + - cis: ["4.1.13"] + - cis_csc_v7: ["13"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + + # 4.1.14 Ensure changes to system administration scope (sudoers) is collected. (Automated) + - id: 33118 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: "Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier \"scope.\"." + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/scope.rules Add the following lines: -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d/ -p wa -k scope." + compliance: + - cis: ["4.1.14"] + - cis_csc_v7: ["4.8"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_techniques: ["T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209"] + - nist_sp_800-53: ["AU-3"] + - pci_dss_v3.2.1: ["10.2.5"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=scope' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=scope' + - "c:auditctl -l -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=scope" + - "c:auditctl -l -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=scope" + + # 4.1.15 Ensure system administrator command executions (sudo) are collected. (Automated) + - id: 33119 + title: "Ensure system administrator command executions (sudo) are collected." + description: "sudo provides users with temporary elevated privileges to perform operations. Monitor the administrator with temporary elevated privileges and the operation(s) they performed. Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "creating an audit log of administrators with temporary elevated privileges and the operation(s) they performed is essential to reporting. Administrators will want to correlate the events written to the audit trail with the records written to sudo logfile to verify if unauthorized commands have been executed." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules: Example: `vi /etc/audit/rules.d/actions.rules Add the following line: -a exit,always -F arch=b32 -C euid!=uid -F euid=0 -Fauid>=1000 -F auid!=4294967295 -S execve -k actions For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules: Example: `vi /etc/audit/rules.d/actions.rules Add the following lines: -a always,exit -F arch=b64 -C euid!=uid -F euid=0 -Fauid>=1000 -F auid!=4294967295 -S execve -k actions -a always,exit -F arch=b32 -C euid!=uid -F euid=0 -Fauid>=1000 -F auid!=4294967295 -S execve -k actions." + compliance: + - cis: ["4.1.15"] + - cis_csc_v7: ["4.9"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_techniques: ["T1110", "T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209"] + - nist_sp_800-53: ["AU-3"] + - pci_dss_v3.2.1: ["10.2.4"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_techniques: ["T1110", "T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209"] + - nist_sp_800-53: ["AU-3"] + - pci_dss_v3.2.1: ["10.2.4"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64|-F arch=b32 && r:-C uid!=euid && r:-F euid=0|-F auid >= 1000 |-F auid!=-1 |-F auid!=4294967295 && r:-S execve && r:-k actions|key=actions' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64|-F arch=b32 && r:-C uid!=euid && r:-F euid=0|-F auid >= 1000 |-F auid!=-1 |-F auid!=4294967295 && r:-S execve && r:-k actions key=actions" + + # 4.1.16 Ensure kernel module loading and unloading is collected. (Automated) + - id: 33120 + title: "Ensure kernel module loading and unloading is collected." + description: "Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of \"modules\". Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Monitoring the use of insmod , rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/modules.rules Add the following lines: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b32 -S init_module -S delete_module -k modules For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/modules.rules Add the following lines: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b64 -S init_module -S delete_module -k modules." + compliance: + - cis: ["4.1.16"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:delete_module && r:-k modules|-F key=modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/sbin/insmod && r:-p x && r:-k modules|-F key=modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/sbin/rmmod && r:-p x && r:-k modules|-F key=modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/sbin/modprobe && r:-p x && r:-k modules|-F key=modules' + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:delete_module && r:-k modules|-F key=modules" + - "c:auditctl -l -> r:^-w && r:/sbin/insmod && r:-p x && r:-k modules|-F key=modules" + - "c:auditctl -l -> r:^-w && r:/sbin/rmmod && r:-p x && r:-k modules|-F key=modules" + - "c:auditctl -l -> r:^-w && r:/sbin/modprobe && r:-p x && r:-k modules|-F key=modules" + + # 4.1.17 Ensure the audit configuration is immutable. (Automated) + - id: 33121 + title: "Ensure the audit configuration is immutable." + description: "Set system audit so that audit rules cannot be modified with auditctl. Setting the flag \"-e 2\" forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line -e 2 at the end of the file." + compliance: + - cis: ["4.1.17"] + - cis_csc_v7: ["6.2","6.3"] + - cmmc_v2.0: ["AU.2.042", "AU.5.055"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:-e 2' + + ############################################# + # 4.2 Configure Logging + ############################################# + # 4.2.1 Configure rsyslog + ############################################# + + # 4.2.1.1 Ensure rsyslog is installed. (Automated) + - id: 33122 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is a recommended replacement to the original syslogd daemon which provide improvements over syslogd, such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog: # apt install rsyslog." + compliance: + - cis: ["4.2.1.1"] + - cis_csc_v7: ["6.2","6.3"] + - cmmc_v2.0: ["AU.2.042", "AU.5.055"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + condition: all + rules: + - "c:dpkg -s rsyslog -> r:install ok installed" + + # 4.2.1.2 Ensure rsyslog Service is enabled. (Automated) + - id: 33123 + title: "Ensure rsyslog Service is enabled." + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following commands to enable rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v7: ["6.2","6.3"] + - cmmc_v2.0: ["AU.2.042", "AU.5.055", "CM.2.065"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + condition: all + rules: + - 'c:systemctl is-enabled rsyslog -> r:enabled' + + # 4.2.1.3 Ensure logging is configured. (Manual) - Not Implemented + + # 4.2.1.4 Ensure rsyslog default file permissions configured. (Automated) + - id: 33124 + title: "Ensure rsyslog default file permissions configured." + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set every instance of $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640." + compliance: + - cis: ["4.2.1.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'not f:/etc/rsyslog.conf -> r:^\s*\t*\$FileCreateMode && !r:0640|0600|0400' + - 'not d:/etc/rsyslog.d/ -> r:\.+.conf -> r:^\s*\t*\$FileCreateMode && !r:0640|0600|0400' + + # 4.2.1.5 Ensure rsyslog is configured to send logs to a remote log host. (Automated) - Not Implemented + # 4.2.1.6 Ensure remote rsyslog messages are only accepted on designated log hosts.. (Manual) - Not Implemented + + #################################### + # 4.2.2 Configure journald + #################################### + + # 4.2.2.1 Ensure journald is configured to send logs to rsyslog. (Automated) + - id: 33125 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the rsyslog service provides a consistent means of log collection and export. Notes: - This recommendation assumes that recommendation 4.2.1.5, \"Ensure rsyslog is configured to send logs to a remote log host\" has been implemented. - As noted in the journald man pages, journald logs may be exported to rsyslog either through the process mentioned here, or through a facility like systemd-journald.service. There are trade-offs involved in each implementation, where ForwardToSyslog will immediately capture all events (and forward to an external log server, if properly configured), but may not capture all boot-up activities. Mechanisms such as systemd-journald.service, on the other hand, will record bootup events, but may delay sending the information to rsyslog, leading to the potential for log manipulation prior to export. Be aware of the limitations of all tools employed to secure a system. - The main configuration file /etc/systemd/journald.conf is read before any of the custom *.conf files. If there are custom configs present, they override the main configuration parameters." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes." + references: + - 'https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf' + compliance: + - cis: ["4.2.2.1"] + - cis_csc_v7: ["6.5"] + - cmmc_v2.0: ["AU.3.048"] + - pci_dss_v3.2.1: ["10.5.3", "10.5.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:ForwardToSyslog=yes' + + # 4.2.2.2 Ensure journald is configured to compress large log files. (Automated) + - id: 33126 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large. Note: The main configuration file /etc/systemd/journald.conf is read before any of the custom *.conf files. If there are custom configs present, they override the main configuration parameters." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes." + references: + - 'https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf' + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-4"] + - pci_dss_v3.2.1: ["10.7"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:Compress=yes' + + # 4.2.2.3 Ensure journald is configured to write logfiles to persistent disk. (Automated) + - id: 33127 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss. Note: The main configuration file /etc/systemd/journald.conf is read before any of the custom *.conf files. If there are custom configs present, they override the main configuration parameters." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent." + references: + - 'https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf' + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v7: ["6.2","6.3"] + - cmmc_v2.0: ["AU.2.042", "AU.5.055", "CM.2.065"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:Storage=persistent' + + # 4.2.3 Ensure permissions on all logfiles are configured. (Automated) - Not Implemented + # 4.3 Ensure logrotate is configured. (Manual) - Not Implemented + + # 4.4 Ensure logrotate assigns appropriate permissions. (Automated) + - id: 33128 + title: "Ensure logrotate assigns appropriate permissions." + description: "Log files contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit /etc/logrotate.conf and update the create line to read 0640 or more restrictive, following local site policy Example: create 0640 root utmp." + compliance: + - cis: ["4.4"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'f:/etc/logrotate.conf -> r:create 0640' + + ############################################## + # 5 Access, Authentication and Authorization + ############################################## + # 5.1 Configure time-based job schedulers + ############################################## + + # 5.1.1 Ensure cron daemon is enabled and running. (Automated) + - id: 33129 + title: "Ensure cron daemon is enabled and running." + description: "The cron daemon is used to execute batch jobs on the system. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable and start cron: # systemctl --now enable cron." + compliance: + - cis: ["5.1.1"] + - cis_csc_v7: ["6.0"] + condition: all + rules: + - 'c:systemctl is-enabled cron -> r:enabled' + - 'c:systemctl status cron -> r:Active: active \(running\)' + + # 5.1.2 Ensure permissions on /etc/crontab are configured. (Automated) + - id: 33130 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab." + compliance: + - cis: ["5.1.2"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0600/-rw-------\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured. (Automated) + - id: 33131 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.hourly directory: # chown root:root /etc/cron.hourly/ # chmod og-rwx /etc/cron.hourly/." + compliance: + - cis: ["5.1.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured. (Automated) + - id: 33132 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.daily directory: # chown root:root /etc/cron.daily/ # chmod og-rwx /etc/cron.daily/." + compliance: + - cis: ["5.1.4"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured. (Automated) + - id: 33133 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.weekly directory: # chown root:root /etc/cron.weekly/ # chmod og-rwx /etc/cron.weekly/." + compliance: + - cis: ["5.1.5"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured. (Automated) + - id: 33134 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.monthly directory: # chown root:root /etc/cron.monthly/ # chmod og-rwx /etc/cron.monthly/." + compliance: + - cis: ["5.1.6"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured. (Automated) + - id: 33135 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab, but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.d directory: # chown root:root /etc/cron.d/ # chmod og-rwx /etc/cron.d/." + compliance: + - cis: ["5.1.7"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.8 Ensure cron is restricted to authorized users. (Automated) + - id: 33136 + title: "Ensure cron is restricted to authorized users." + description: "Configure /etc/cron.allow to allow specific users to use this service. If /etc/cron.allow does not exist, then /etc/cron.deny is checked. Any user not specifically defined in this file is allowed to use cron. By removing the file, only users in /etc/cron.allow are allowed to use cron. Notes: - Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy - Even though a given user is not listed in cron.allow, cron jobs can still be run as that user - The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny: # rm /etc/cron.deny Run the following command to create /etc/cron.allow # touch /etc/cron.allow Run the following commands to set permissions and ownership for /etc/cron.allow: # chmod g-wx,o-rwx /etc/cron.allow # chown root:root /etc/cron.allow." + compliance: + - cis: ["5.1.8"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - "f:/etc/cron.allow" + - "not f:/etc/cron.deny" + - 'c:stat /etc/cron.allow -> r:^Access: \(0640/-rw-r-----\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.9 Ensure at is restricted to authorized users. (Automated) + - id: 33137 + title: "Ensure at is restricted to authorized users." + description: "Configure /etc/at.allow to allow specific users to use this service. If /etc/at.allow does not exist, then /etc/at.deny is checked. Any user not specifically defined in this file is allowed to use at. By removing the file, only users in /etc/at.allow are allowed to use at. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, at should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "On many systems, only the system administrator is authorized to schedule at jobs. Using the at.allow file to control who can run at jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/at.deny: # rm /etc/at.deny Run the following command to create /etc/at.allow # touch /etc/at.allow Run the following commands to set permissions and ownership for /etc/at.allow: # chmod g-wx,o-rwx /etc/at.allow # chown root:root /etc/at.allow." + compliance: + - cis: ["5.1.9"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - "f:/etc/at.allow" + - "not f:/etc/at.deny" + - 'c:stat /etc/at.allow -> r:^Access: \(0640/-rw-r-----\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + ##################################### + # 5.2 Configure SSH Server + ##################################### + + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured. (Automated) + - id: 33138 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.2.1"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.2.2 Ensure permissions on SSH private host key files are configured. (Automated) + - id: 33139 + title: "Ensure permissions on SSH private host key files are configured." + description: "An SSH private key is one of two files used in SSH public key authentication. In this authentication method, The possession of the private key is proof of identity. Only a private key that corresponds to a public key will be able to authenticate successfully. The private keys need to be stored and handled carefully, and no copies of the private key should be distributed." + rationale: "If an unauthorized user obtains the private SSH host key file, the host could be impersonated." + remediation: "Run the following commands to set ownership and permissions on the private SSH host key files # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' | xargs chown root:root # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' | xargs chmod 0600." + compliance: + - cis: ["5.2.2"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:sh -c "stat -Lc ''%a %A %u %U %g %G'' /etc/ssh/ssh_host_rsa_key" -> r:600\s*\t*-rw------- && r:0\s*\t*root\s*\t*0\s*\t*root' + - 'c:sh -c "stat -Lc ''%a %A %u %U %g %G'' /etc/ssh/ssh_host_ecdsa_key" -> r:600\s*\t*-rw------- && r:0\s*\t*root\s*\t*0\s*\t*root' + - 'c:sh -c "stat -Lc ''%a %A %u %U %g %G'' /etc/ssh/ssh_host_ed25519_key" -> r:600\s*\t*-rw------- && r:0\s*\t*root\s*\t*0\s*\t*root' + + # 5.2.3 Ensure permissions on SSH public host key files are configured. (Automated) + - id: 33140 + title: "Ensure permissions on SSH public host key files are configured." + description: "An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully." + rationale: "If a public host key file is modified by an unauthorized user, the SSH service may be compromised." + remediation: "Run the following commands to set permissions and ownership on the SSH host public key files # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' | xargs chmod go-wx # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' | xargs chown root:root." + compliance: + - cis: ["5.2.2"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:sh -c "stat -Lc ''%a %A %u %U %g %G'' /etc/ssh/ssh_host_rsa_key.pub" -> r:644\s*\t*-rw-r--r-- && r:0\s*\t*root\s*\t*0\s*\t*root' + - 'c:sh -c "stat -Lc ''%a %A %u %U %g %G'' /etc/ssh/ssh_host_ecdsa_key.pub" -> r:644\s*\t*-rw-r--r-- && r:0\s*\t*root\s*\t*0\s*\t*root' + - 'c:sh -c "stat -Lc ''%a %A %u %U %g %G'' /etc/ssh/ssh_host_ed25519_key.pub" -> r:644\s*\t*-rw-r--r-- && r:0\s*\t*root\s*\t*0\s*\t*root' + + # 5.2.4 Ensure SSH LogLevel is appropriate. (Automated) + - id: 33141 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE OR LogLevel INFO." + references: + - 'https://www.ssh.com/ssh/sshd_config/' + compliance: + - cis: ["5.2.4"] + - cis_csc_v7: ["6.2","6.3"] + - cmmc_v2.0: ["AU.2.042", "AU.5.055", "CM.2.065"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + condition: all + rules: + - 'c:sshd -T -> r:^LogLevel\s+INFO|^LogLevel\s+VERBOSE' + + # 5.2.5 Ensure SSH X11 forwarding is disabled. (Automated) + - id: 33142 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no." + compliance: + - cis: ["5.2.5"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - 'c:sshd -T -> r:^X11Forwarding\s+no' + + # 5.2.6 Ensure SSH MaxAuthTries is set to 4 or less. (Automated) + - id: 33143 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure. Note: Local site policy may be more restrictive." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4." + compliance: + - cis: ["5.2.6"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["SI.5.223", "AC.4.032"] + - mitre_techniques: ["T1134", "T1197", "T1538", "T1530", "T1213", "T1089", "T1157", "T1044", "T1484", "T1054", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1034", "T1163", "T1076", "T1021", "T1053", "T1489", "T1051", "T1023", "T1165", "T1528", "T1501", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + condition: all + rules: + - 'c:sshd -T -> n:^MaxAuthTries\s(\d+) compare <= 4' + + # 5.2.7 Ensure SSH IgnoreRhosts is enabled. (Automated) + - id: 33144 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes." + compliance: + - cis: ["5.2.7"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - 'c:sshd -T -> r:^ignorerhosts\s+yes' + + # 5.2.8 Ensure SSH HostbasedAuthentication is disabled. (Automated) + - id: 33145 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no." + compliance: + - cis: ["5.2.8"] + - cis_csc_v7: ["16.3"] + - mitre_techniques: ["T1110", "T1098", "T1017", "T1136", "T1530", "T1114", "T1133", "T1040", "T1076", "T1021", "T1539", "T1072", "T1078", "T1134", "T1197", "T1538", "T1213", "T1089", "T1157", "T1044", "T1484", "T1054", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1034", "T1163", "T1053", "T1489", "T1051", "T1023", "T1165", "T1528", "T1501", "T1537", "T1047", "T1084", "T1004"] + - pci_dss_v3.2.1: ["8.3"] + condition: all + rules: + - 'c:sshd -T -> r:^HostbasedAuthentication\s+no' + + # 5.2.9 Ensure SSH root login is disabled. (Automated) + - id: 33146 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no." + compliance: + - cis: ["5.2.9"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.2.008", "IA.1.076", "IA.1.077", "SC.3.181"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1176", "T1501", "T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:sshd -T -> r:^PermitRootLogin\s+no' + + # 5.2.10 Ensure SSH PermitEmptyPasswords is disabled. (Automated) + - id: 33147 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no." + compliance: + - cis: ["5.2.10"] + - cis_csc_v7: ["16.3"] + - mitre_techniques: ["T1110", "T1098", "T1017", "T1136", "T1530", "T1114", "T1133", "T1040", "T1076", "T1021", "T1539", "T1072", "T1078", "T1134", "T1197", "T1538", "T1213", "T1089", "T1157", "T1044", "T1484", "T1054", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1034", "T1163", "T1053", "T1489", "T1051", "T1023", "T1165", "T1528", "T1501", "T1537", "T1047", "T1084", "T1004"] + - pci_dss_v3.2.1: ["8.3"] + condition: all + rules: + - 'c:sshd -T -> r:^PermitEmptyPasswords\s+no' + + # 5.2.11 Ensure SSH PermitUserEnvironment is disabled. (Automated) + - id: 33148 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no." + compliance: + - cis: ["5.2.11"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:sshd -T -> r:^PermitUserEnvironment\s+no' + + # 5.2.12 Ensure only strong Ciphers are used. (Automated) + - id: 33149 + title: "Ensure only strong Ciphers are used." + description: "This variable limits the ciphers that SSH can use during communication. Notes: - Some organizations may have stricter requirements for approved ciphers - Ensure that ciphers used are in compliance with site policy - The only \"strong\" ciphers currently FIPS 140-2 compliant are: o aes256-ctr o aes192-ctr o aes128-ctr - Supported ciphers in openSSH 8.2: 3des-cbc aes128-cbc aes192-cbc aes256-cbc aes128-ctr aes192-ctr aes256-ctr aes128-gcm@openssh.com aes256-gcm@openssh.com chacha20-poly1305@openssh.com." + rationale: "Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised - The Triple DES ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a \"Sweet32\" attack - Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors." + remediation: "Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers Example: Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128- gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr." + references: + - https://nvd.nist.gov/vuln/detail/CVE-2016-2183 + - https://www.openssh.com/txt/cbc.adv + - https://nvd.nist.gov/vuln/detail/CVE-2008-5161 + compliance: + - cis: ["5.2.12"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["SC.3.177", "SC.3.185"] + - iso_27001-2013: ["A.13.1.1", "A.10.1.1"] + - mitre_techniques: ["T1527", "T1119", "T1530", "T1114", "T1070", "T1208", "T1040", "T1145", "T1492", "T1493"] + - pci_dss_v3.2.1: ["4.1"] + condition: none + rules: + - "c:sshd -T -> r:^ciphers && r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc" + + # 5.2.13 Ensure only strong MAC algorithms are used. (Automated) + - id: 33150 + title: "Ensure only strong MAC algorithms are used." + description: "This variable limits the types of MAC algorithms that SSH can use during communication. Notes: - Some organizations may have stricter requirements for approved MACs - Ensure that MACs used are in compliance with site policy - The only \"strong\" MACs currently FIPS 140-2 approved are: o hmac-sha2-256 o hmac-sha2-512 - The Supported MACs are: hmac-md5 hmac-md5-96 hmac-sha1 hmac-sha1-96 hmac-sha2-256 hmac-sha2-512 umac-64@openssh.com umac-128@openssh.com hmac-md5-etm@openssh.com hmac-md5-96-etm@openssh.com hmac-sha1-etm@openssh.com hmac-sha1-96-etm@openssh.com hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com umac-64-etm@openssh.com umac-128-etm@openssh.com." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information." + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2- 512,hmac-sha2-256." + references: + - 'http://www.mitls.org/pages/attacks/SLOTH' + compliance: + - cis: ["5.2.13"] + - cis_csc_v7: ["14.4","16.5"] + - cmmc_v2.0: ["SC.3.177", "SC.3.185", "IA.2.081"] + - iso_27001-2013: ["A.13.1.1", "A.10.1.1"] + - mitre_techniques: ["T1527", "T1119", "T1530", "T1114", "T1070", "T1208", "T1040", "T1145", "T1492", "T1493"] + - nist_sp_800-53: ["IA-5"] + - pci_dss_v3.2.1: ["4.1","8.2.1"] + condition: none + rules: + - "c:sshd -T -> r:^MACs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com" + + # 5.2.14 Ensure only strong Key Exchange algorithms are used. (Automated) + - id: 33151 + title: "Ensure only strong Key Exchange algorithms are used." + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received Notes: - Kex algorithms have a higher preference the earlier they appear in the list - Some organizations may have stricter requirements for approved Key exchange algorithms - Ensure that Key exchange algorithms used are in compliance with site policy - The only Key Exchange Algorithms currently FIPS 140-2 approved are: o ecdh-sha2-nistp256 o ecdh-sha2-nistp384 o ecdh-sha2-nistp521 o diffie-hellman-group-exchange-sha256 o diffie-hellman-group16-sha512 o diffie-hellman-group18-sha512 o diffie-hellman-group14-sha256 - The Key Exchange algorithms supported by OpenSSH 8.2 are: curve25519-sha256 curve25519-sha256@libssh.org diffie-hellman-group1-sha1 diffie-hellman-group14-sha1 diffie-hellman-group14-sha256 diffie-hellman-group16-sha512 diffie-hellman-group18-sha512 diffie-hellman-group-exchange-sha1 diffie-hellman-group-exchange-sha256 ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 sntrup4591761x25519-sha512@tinyssh.org." + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks." + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms Example: KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman- group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18- sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie- hellman-group-exchange-sha256." + compliance: + - cis: ["5.2.14"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["SC.3.177", "SC.3.185"] + - iso_27001-2013: ["A.13.1.1", "A.10.1.1"] + - mitre_techniques: ["T1527", "T1119", "T1530", "T1114", "T1070", "T1208", "T1040", "T1145", "T1492", "T1493"] + - pci_dss_v3.2.1: ["4.1"] + condition: none + rules: + - "c:sshd -T -> r:^kexalgorithms && r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1" + + # 5.2.15 Ensure SSH Idle Timeout Interval is configured. (Automated) + - id: 33152 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. - ClientAliveInterval sets 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 default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax sets the number of client alive messages which may be sent without sshd receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. The default value is 3. o The client alive messages are sent through the encrypted channel o Setting ClientAliveCountMax to 0 disables connection termination Example: If the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time. Note: Local site policy may be more restrictive." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value reduces this risk. - The recommended ClientAliveInterval setting is 300 seconds (5 minutes) - The recommended ClientAliveCountMax setting is 3 - The ssh session would send three keep alive messages at 5 minute intervals. If no response is received after the third keep alive message, the ssh session would be terminated after 15 minutes." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy. This should include ClientAliveInterval between 1 and 300 and ClientAliveCountMax of 3 or less: ClientAliveInterval 300 ClientAliveCountMax 3." + compliance: + - cis: ["5.2.15"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.2.010", "AC.3.019", "IA.3.086"] + - iso_27001-2013: ["A.8.1.3"] + - mitre_techniques: ["T1110", "T1527", "T1176", "T1088", "T1081", "T1214", "T1530", "T1213", "T1038", "T1073", "T1482", "T1114", "T1044", "T1484", "T1525", "T1161", "T1031", "T1034", "T1145", "T1076", "T1053", "T1505", "T1528", "T1078"] + - pci_dss_v3.2.1: ["8.1.8", "10.2.5"] + condition: all + rules: + - 'c:sshd -T -> n:clientaliveinterval\s(\d+) compare >= 1 && n:clientaliveinterval\s(\d+) compare <= 300' + - 'c:sshd -T -> n:clientalivecountmax\s(\d+) compare >= 1 && n:clientalivecountmax\s(\d+) compare <= 3' + + # 5.2.16 Ensure SSH LoginGraceTime is set to one minute or less. (Automated) + - id: 33153 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access. Note: Local site policy may be more restrictive." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60." + compliance: + - cis: ["5.2.16"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'c:sshd -T -> n:^logingracetime\s(\d+) compare <= 60 && n:LoginGraceTime\s(\d+) compare >= 1' + + # 5.2.17 Ensure SSH access is limited. (Automated) + - id: 33154 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers - Gives the system administrator the option of allowing specific users to ssh into the system o The list consists of space separated user names o Numeric user IDs are not recognized with this variable o A system administrator may restrict user access further by only allowing the allowed users to log in from a particular host by specifying the entry as < user>@ - AllowGroups - Gives the system administrator the option of allowing specific groups of users to ssh into the system o The list consists of space separated group names o Numeric group IDs are not recognized with this variable - DenyUsers - Gives the system administrator the option of denying specific users to ssh into the system o The list consists of space separated user names o Numeric user IDs are not recognized with this variable o If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host by specifying the entry as < user>@ - DenyGroups - Gives the system administrator the option of denying specific groups of users to ssh into the system o The list consists of space separated group names o Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups ." + compliance: + - cis: ["5.2.17"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.2.008", "IA.1.076", "IA.1.077", "SC.3.181"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1176", "T1501", "T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - 'c:sshd -T -> r:^AllowUsers\s+\w+|^AllowGroups\s+\w+|^DenyUsers\s+\w+|^DenyGroups\s+\w+' + + # 5.2.18 Ensure SSH warning banner is configured. (Automated) + - id: 33155 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.2.18"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'c:sshd -T -> r:^banner\s/' + + # 5.2.19 Ensure SSH PAM is enabled. (Automated) + - id: 33156 + title: "Ensure SSH PAM is enabled." + description: "UsePAM Enables the Pluggable Authentication Module interface. If set to \"yes\" this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types." + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + impact: "If UsePAM is enabled, you will not be able to run sshd(8) as a non-root user." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes." + compliance: + - cis: ["5.2.19"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'c:sshd -T -> r:^usepam\s+yes' + + # 5.2.20 Ensure SSH AllowTcpForwarding is disabled. (Automated) + - id: 33157 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments that employ mainframe systems as their application backends. In those environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no." + references: + - 'https://www.ssh.com/ssh/tunneling/example' + compliance: + - cis: ["5.2.20"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.3.068", "SC.5.230"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051"] + - nist_sp_800-53: ["SI-4"] + - pci_dss_v3.2.1: ["1.2.1", "2.2.2", "2.2.5"] + condition: all + rules: + - 'c:sshd -T -> r:^AllowTcpForwarding\s+no' + + # 5.2.21 Ensure SSH MaxStartups is configured. (Automated) + - id: 33158 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon. Note: Local site policy may be more restrictive." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows or more restrictive: maxstartups 10:30:100." + compliance: + - cis: ["5.2.21"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'c:sshd -T -> n:^maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'c:sshd -T -> n:^maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'c:sshd -T -> n:^maxstartups\s+\d+:\d+:(\d+) compare <= 60' + + # 5.2.22 Ensure SSH MaxSessions is limited. (Automated) + - id: 33159 + title: "Ensure SSH MaxSessions is limited." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection. Note: Local site policy may be more restrictive." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10." + compliance: + - cis: ["5.2.22"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'c:sshd -T -> n:maxsessions\s(\d+) compare <= 10' + + ###################################### + # 5.3 Configure PAM + ###################################### + + # 5.3.1 Ensure password creation requirements are configured. (Automated) + - id: 33160 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. The following options are set in the /etc/security/pwquality.conf file: - Password Length: o minlen = 14 - password must be 14 characters or more - Password complexity: o minclass = 4 - The minimum number of required classes of characters for the new password (digits, uppercase, lowercase, others) OR o dcredit = -1 - provide at least one digit o ucredit = -1 - provide at least one uppercase character o ocredit = -1 - provide at least one special character o lcredit = -1 - provide at least one lowercase character The following is st in the /etc/pam.d/common-password file: - retry=3 - Allow 3 tries before sending back a failure. The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Run the following command to install the pam_pwquality module: apt install libpam-pwquality Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so retry=3." + compliance: + - cis: ["5.3.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.2.078", "IA.2.079"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + - nist_sp_800-53: ["IA-5 (1)"] + condition: all + rules: + - 'f:/etc/security/pwquality.conf -> !r:^\s*\t*# && n:\s*\t*minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> !r:^\s*\t*# && n:\s*\t*minclass\s*\t*=\s*\t*(\d+) compare >= 4' + - 'f:/etc/pam.d/common-password -> !r:^# && n:password\s*\t*requisite\s*\t*pam_pwquality.so\s*\t*retry=(\d+) compare <=3' + + # 5.3.2 Ensure lockout for failed password attempts is configured. (Automated) + - id: 33161 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. - deny=n - n represents the number of failed attempts before the account is locked - unlock_time=n - n represents the number of seconds before the account is unlocked - audit - Will log the user name into the system log if the user is not found. - silent - Don't print informative messages. Set the lockout number and unlock time in accordance with local site policy. Notes: - Add pam_tally2 to the account section account required pam_tally2.so for the counter to reset to 0 when using sudo - Use of the \"audit\" keyword may log credentials in the case of user error during - authentication. This risk should be evaluated in the context of the site policies of your organization. If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Edit the /etc/pam.d/common-auth file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900 Edit the /etc/pam.d/common-account file and add the account lines bellow: account requisite pam_deny.so account required pam_tally2.so." + compliance: + - cis: ["5.3.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.4.025", "PS.2.128", "IA.3.085"] + - iso_27001-2013: ["A.9.2.6"] + - mitre_techniques: ["T1134", "T1197", "T1538", "T1530", "T1213", "T1089", "T1157", "T1044", "T1484", "T1054", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1034", "T1163", "T1076", "T1021", "T1053", "T1489", "T1051", "T1023", "T1165", "T1528", "T1501", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-2"] + - pci_dss_v3.2.1: ["8.1.3", "8.1.4"] + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d+ && r:unlock_time\s*=\s*\d+' + - 'f:/etc/pam.d/common-auth -> n:deny\s*=\s*(\d+) compare <=5' + - 'f:/etc/pam.d/common-account -> !r:^# && r:account\s*\t*requisite\s*\t*pam_deny.so' + - 'f:/etc/pam.d/common-account -> !r:^# && r:account\s*\t*required\s*\t*pam_tally2.so' + + # 5.3.3 Ensure password reuse is limited. (Automated) + - id: 33162 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. Note: Changes only apply to accounts configured on the local system." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password." + remediation: "Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown: password required pam_pwhistory.so remember=5." + compliance: + - cis: ["5.3.3"] + - cis_csc_v7: ["16"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> !r:^\s*\t*# && r:\s*\t*password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare < 5' + + # 5.3.4 Ensure password hashing algorithm is SHA-512. (Automated) + - id: 33163 + title: "Ensure password hashing algorithm is SHA-512." + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm. Notes: - Additional module options may be set, recommendation only covers those listed here. If it is determined that the password algorithm being used is not SHA-512, once it is - changed, it is recommended that all user ID's be immediately expired and forced to change their passwords on next login - The following command can be used: # awk -F: '($3 >= $(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) && $1 != \"nfsnobody\") { print $1 }' /etc/passwd | xargs -n 1 chage -d 0 - Any system accounts that need to be expired should be carefully done separately by the system administrator to prevent any potential problems." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the sha512 option for pam_unix.so as shown: password [success=1 default=ignore] pam_unix.so sha512." + compliance: + - cis: ["5.3.4"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["IA.2.081"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["IA-5", "IA-5 (1)"] + - pci_dss_v3.2.1: ["3.2", "8.2.1"] + condition: all + rules: + - "f:/etc/pam.d/common-password -> r:sha512$" + + ################################################### + # 5.4 User Accounts and Environment + ################################################### + # 5.4.1 Set Shadow Password Suite Parameters + ################################################### + + # 5.4.1.1 Ensure password expiration is 365 days or less. (Automated) + - id: 33164 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days. Notes: - A value of -1 will disable password expiration - The password expiration must be greater than the minimum days between password changes or users will be unable to change their password." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + compliance: + - cis: ["5.4.1.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.2.078", "IA.2.079"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + - nist_sp_800-53: ["IA-5 (1)"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:(\d+):\S*:\S*:\S*:\S* compare > 365' + + # 5.4.1.2 Ensure minimum days between password changes is configured. (Automated) + - id: 33165 + title: "Ensure minimum days between password changes is configured." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 1 in /etc/login.defs : PASS_MIN_DAYS 1 Modify user parameters for all users with a password set to match: # chage --mindays 1 ." + compliance: + - cis: ["5.4.1.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.2.078", "IA.2.079"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + - nist_sp_800-53: ["IA-5 (1)"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 1' + - 'not f:/etc/shadow -> n:^\w+:\$\.*:\d+:(\d+): compare == 0' + + # 5.4.1.3 Ensure password expiration warning days is 7 or more. (Automated) + - id: 33166 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs : PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["5.4.1.3"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.2.078", "IA.2.079"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + - nist_sp_800-53: ["IA-5 (1)"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + - 'f:/etc/shadow -> n:^\w+:\S*:\S*:\S*:\S*:(\d+):\S*:\S*:\S* compare >= 7' + - 'not f:/etc/shadow -> r:^\w+:\S*:\S*:\S*:\S*::\S*:\S*:\S*' + + # 5.4.1.4 Ensure inactive password lock is 30 days or less. (Automated) + - id: 33167 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled. Note: A value of -1 would disable this setting." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["5.4.1.4"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.2.078", "IA.2.079"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + - nist_sp_800-53: ["IA-5 (1)"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - "not c:useradd -D -> r:^INACTIVE=-1" + - 'f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:\S*:\S*:(\d+):\S*:\S* compare <= 30' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && r:^\w+:\S*:\S*:\S*:\S*:\S*::\S*:\S*' + + # 5.4.1.5 Ensure all users last password change date is in the past. (Automated) - Not Implemented + # 5.4.2 Ensure system accounts are secured. (Automated) - Not Implemented + + # 5.4.3 Ensure default group for the root account is GID 0. (Automated) + - id: 33168 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.4.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.2.007", "MP.2.120"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1015", "T1133", "T1200", "T1076", "T1051", "T1156", "T1146", "T1196", "T1081", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1145", "T1494", "T1035", "T1489", "T1198", "T1184", "T1165", "T1492", "T1169", "T1501", "T1080", "T1209", "T1134", "T1197", "T1538", "T1213", "T1044", "T1484", "T1159", "T1160", "T1152", "T1168", "T1162", "T1185", "T1031", "T1050", "T1075", "T1097", "T1163", "T1021", "T1053", "T1023", "T1528", "T1072", "T1537", "T1078", "T1047", "T1084", "T1004"] + - nist_sp_800-53: ["AC-3"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + condition: all + rules: + - "f:/etc/passwd -> r:^root:x:0:0" + + # 5.4.4 Ensure default user umask is 027 or more restrictive. (Automated) - Not Implemented + # 5.4.5 Ensure default user shell timeout is 900 seconds or less. (Automated) - Not Implemented + # 5.5 Ensure root login is restricted to system console. (Manual) - Not Implemented + + # 5.6 Ensure access to the su command is restricted. (Automated) + - id: 33169 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo , which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su , the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.6"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.1.002", "CM.2.061", "SC.3.180"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1110", "T1003", "T1081", "T1097", "T1178", "T1072", "T1067", "T1495", "T1019", "T1177", "T1485", "T1486", "T1491", "T1488", "T1487", "T1490", "T1146", "T1148", "T1015", "T1133", "T1200", "T1076", "T1051", "T1176", "T1501", "T1087", "T1098", "T1139", "T1197", "T1092", "T1136", "T1011", "T1147", "T1130", "T1174", "T1053", "T1166", "T1206", "T1503", "T1214", "T1187", "T1208", "T1142", "T1075", "T1201", "T1145", "T1184", "T1537", "T1078", "T1077", "T1134", "T1017", "T1088", "T1175", "T1190", "T1210", "T1525", "T1215", "T1086", "T1055", "T1505", "T1035", "T1218", "T1169", "T1100", "T1047", "T1084", "T1028", "T1156", "T1196", "T1530", "T1089", "T1073", "T1157", "T1054", "T1070", "T1037", "T1036", "T1096", "T1034", "T1150", "T1504", "T1494", "T1489", "T1198", "T1165", "T1492", "T1080", "T1209", "T1112", "T1058", "T1173", "T1137", "T1539", "T1535", "T1506", "T1138", "T1044", "T1199"] + - nist_sp_800-53: ["AU-2", "CM-1", "CM-2", "CM-6", "CM-7", "IA-5", "IA-6", "SC-20", "SC-21"] + - pci_dss_v3.2.1: ["2.2"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_wheel.so && r:use_uid && r:group=\w+' + + ################################################# + # 6 System Maintenance + ################################################# + # 6.1 System File Permissions + ################################################# + + # 6.1.1 Audit system file permissions. (Manual) - Not Implemented + + # 6.1.2 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 33170 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd." + compliance: + - cis: ["6.1.2"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["IA.2.081"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["IA-5", "IA-5 (1)"] + - pci_dss_v3.2.1: ["3.2", "8.2.1"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:^Access: \(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)$' + + # 6.1.3 Ensure permissions on /etc/passwd- are configured. (Automated) + - id: 33171 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd- : # chown root:root /etc/passwd- # chmod u-x,go-wx /etc/passwd-." + compliance: + - cis: ["6.1.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["IA.2.081"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["IA-5", "IA-5 (1)"] + - pci_dss_v3.2.1: ["3.2", "8.2.1"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:^Access: \(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)$' + + # 6.1.4 Ensure permissions on /etc/group are configured. (Automated) + - id: 33172 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group : # chown root:root /etc/group # chmod u-x,go-wx /etc/group." + compliance: + - cis: ["6.1.4"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["IA.2.081"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["IA-5", "IA-5 (1)"] + - pci_dss_v3.2.1: ["3.2", "8.2.1"] + condition: all + rules: + - 'c:stat /etc/group -> r:^Access: \(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)$' + + # 6.1.5 Ensure permissions on /etc/group- are configured. (Automated) + - id: 33173 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group- : # chown root:root /etc/group- # chmod u-x,go-wx /etc/group-." + compliance: + - cis: ["6.1.5"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["IA.2.081"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["IA-5", "IA-5 (1)"] + - pci_dss_v3.2.1: ["3.2", "8.2.1"] + condition: all + rules: + - 'c:stat /etc/group- -> r:^Access: \(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)$' + + # 6.1.6 Ensure permissions on /etc/shadow are configured. (Automated) + - id: 33174 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run one of the following commands to set ownership of /etc/shadow to root and group to either root or shadow: # chown root:root /etc/shadow # chown root:shadow /etc/shadow Run the following command to remove excess permissions form /etc/shadow: # chmod u-x,g-wx,o-rwx /etc/shadow." + compliance: + - cis: ["6.1.6"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["IA.2.081"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["IA-5", "IA-5 (1)"] + - pci_dss_v3.2.1: ["3.2", "8.2.1"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:^Access: \(0640/-rw-r-----\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)$|^Access: \(0640/-rw-r-----\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*\d+/\s*shadow\)$' + + # 6.1.7 Ensure permissions on /etc/shadow- are configured. (Automated) + - id: 33175 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run one of the following commands to set ownership of /etc/shadow- to root and group to either root or shadow: # chown root:root /etc/shadow- # chown root:shadow /etc/shadow- Run the following command to remove excess permissions form /etc/shadow-: # chmod u-x,g-wx,o-rwx /etc/shadow-." + compliance: + - cis: ["6.1.7"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["IA.2.081"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["IA-5", "IA-5 (1)"] + - pci_dss_v3.2.1: ["3.2", "8.2.1"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:^Access: \(0640/-rw-r-----\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)$|^Access: \(0640/-rw-r-----\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*\d+/\s*shadow\)$' + + # 6.1.8 Ensure permissions on /etc/gshadow are configured. (Automated) + - id: 33176 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run one of the following commands to set ownership of /etc/gshadow to root and group to either root or shadow: # chown root:root /etc/gshadow # chown root:shadow /etc/gshadow Run the following command to remove excess permissions form /etc/gshadow: # chmod u-x,g-wx,o-rwx /etc/gshadow." + compliance: + - cis: ["6.1.8"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["IA.2.081"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["IA-5", "IA-5 (1)"] + - pci_dss_v3.2.1: ["3.2", "8.2.1"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:^Access: \(0640/-rw-r-----\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)$|^Access: \(0640/-rw-r-----\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*\d+/\s*shadow\)$' + + # 6.1.9 Ensure permissions on /etc/gshadow- are configured. (Automated) + - id: 33177 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run one of the following commands to set ownership of /etc/gshadow- to root and group to either root or shadow: # chown root:root /etc/gshadow- # chown root:shadow /etc/gshadow- Run the following command to remove excess permissions form /etc/gshadow-: # chmod u-x,g-wx,o-rwx /etc/gshadow-." + compliance: + - cis: ["6.1.9"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["IA.2.081"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["IA-5", "IA-5 (1)"] + - pci_dss_v3.2.1: ["3.2", "8.2.1"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:^Access: \(0640/-rw-r-----\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)$|^Access: \(0640/-rw-r-----\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*\d+/\s*shadow\)$' + + # 6.1.10 Ensure no world writable files exist. (Automated) - Not Implemented + # 6.1.11 Ensure no unowned files or directories exist. (Automated) - Not Implemented + # 6.1.12 Ensure no ungrouped files or directories exist. (Automated) - Not Implemented + # 6.1.13 Audit SUID executables. (Manual) - Not Implemented + # 6.1.14 Audit SGID executables. (Manual) - Not Implemented + + ####################################### + # 6.2 User and Group Settings + ####################################### + + # 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords. (Automated) + - id: 33178 + title: "Ensure accounts in /etc/passwd use shadowed passwords." + description: "Local accounts can uses shadowed passwords. With shadowed passwords, The passwords are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. Accounts with a shadowed password have an x in the second field in /etc/passwd." + rationale: "The /etc/passwd file also contains information like user ID's and group ID's that are used by many system programs. Therefore, the /etc/passwd file must remain world readable. In spite of encoding the password with a randomly-generated one-way hash function, an attacker could still break the system if they got access to the /etc/passwd file. This can be mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. This helps mitigate the risk of an attacker gaining access to the encoded passwords with which to perform a dictionary attack. Notes: - All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user. - A user account with an empty second field in /etc/passwd allows the account to be logged into by providing only the username." + remediation: "Run the following command to set accounts to use shadowed passwords: # sed -e 's/^\\([a-zA-Z0-9_]*\\):[^:]*:/\\1:x:/' -i /etc/passwd Investigate to determine if the account is logged in and what it is being used for, to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.2.078", "IA.2.079"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + - nist_sp_800-53: ["IA-5 (1)"] + condition: all + rules: + - 'not f:/etc/passwd -> r:^\w+:x:' + + # 6.2.2 Ensure password fields are not empty. (Automated) + - id: 33179 + title: "Ensure password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.2.078", "IA.2.079"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1134", "T1098", "T1017", "T1067", "T1088", "T1175", "T1136", "T1003", "T1214", "T1190", "T1210", "T1495", "T1525", "T1208", "T1215", "T1075", "T1097", "T1086", "T1055", "T1076", "T1053", "T1505", "T1035", "T1051", "T1218", "T1184", "T1169", "T1206", "T1019", "T1501", "T1072", "T1078", "T1100", "T1077", "T1047", "T1084", "T1028"] + - nist_sp_800-53: ["IA-5 (1)"] + condition: all + rules: + - 'not f:/etc/shadow -> r:^\w+::' + + # 6.2.3 Ensure all users' home directories exist. (Automated) - Not Implemented + # 6.2.4 Ensure users own their home directories. (Automated) - Not Implemented + # 6.2.5 Ensure users' home directories permissions are 750 or more restrictive. (Automated) - Not Implemented + # 6.2.6 Ensure users' dot files are not group or world writable. (Automated) - Not Implemented + # 6.2.7 Ensure no users have .netrc files. (Automated) - Not Implemented + # 6.2.8 Ensure no users have .forward files. (Automated) - Not Implemented + # 6.2.9 Ensure no users have .rhosts files. (Automated) - Not Implemented + + # 6.2.10 Ensure root is the only UID 0 account. (Automated) + - id: 33180 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.10"] + - cis_csc_v7: ["4.6"] + - cmmc_v2.0: ["AC.2.008"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1019", "T1098", "T1017", "T1043", "T1175", "T1136", "T1094", "T1482", "T1048", "T1190", "T1210", "T1133", "T1046", "T1145", "T1076", "T1494", "T1489", "T1051", "T1095", "T1072", "T1199", "T1065", "T1028", "T1112", "T1058", "T1198", "T1209"] + condition: all + rules: + - 'not f:/etc/passwd -> !r:^\s*\t*# && !r:^root: && r:^\w+:\w+:0:' + + # 6.2.11 Ensure root PATH Integrity. (Automated) - Not Implemented + # 6.2.12 Ensure all groups in /etc/passwd exist in /etc/group. (Automated) - Not Implemented + # 6.2.13 Ensure no duplicate UIDs exist. (Automated) - Not Implemented + # 6.2.14 Ensure no duplicate GIDs exist. (Automated) - Not Implemented + # 6.2.15 Ensure no duplicate user names exist. (Automated) - Not Implemented + # 6.2.16 Ensure no duplicate group names exist. (Automated) - Not Implemented + # 6.2.17 Ensure shadow group is empty. (Automated) - Not Implemented diff --git a/etc/ruleset/sca/debian/cis_debian7.yml b/etc/ruleset/sca/debian/cis_debian7.yml new file mode 100644 index 0000000000..45f5520742 --- /dev/null +++ b/etc/ruleset/sca/debian/cis_debian7.yml @@ -0,0 +1,2650 @@ +# Security Configuration Assessment +# CIS Checks for Debian Linux 7 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Debian Linux 7 Benchmark v1.0.0 - 12-31-2015 + +policy: + id: "cis_debian7" + file: "cis_debian7.yml" + name: "CIS Debian Linux 7 Benchmark v1.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 7." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Debian version" + description: "Requirements for running the SCA scan against Debian/Ubuntu." + condition: all + rules: + - "f:/etc/debian_version" + - "f:/proc/sys/kernel/ostype -> Linux" + +checks: + # 2 Filesystem Configuration + + - id: 1000 + title: "Create Separate Partition for /tmp" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "Configure /etc/fstab as appropriate or Run the following commands to enable systemd /tmp mounting: systemctl umask tmp.mount; systemctl enable tmp.mount. Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount." + compliance: + - cis: ["2.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + - id: 1001 + title: "Set nodev option for /tmp Partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nodev /tmp" + compliance: + - cis: ["2.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + - id: 1002 + title: "Set nosuid option for /tmp Partition" + description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nosuid /tmp" + compliance: + - cis: ["2.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + - id: 1003 + title: "Set noexec option for /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,noexec /tmp" + compliance: + - cis: ["2.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + - id: 1004 + title: "Create Separate Partition for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["2.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + - id: 1005 + title: "Bind mount the /var/tmp directory to /tmp" + description: "The /var/tmp directory is normally a standalone directory in the /var file system. Binding /var/tmp to /tmp establishes an unbreakable link to /tmp that cannot be removed (even by the root user). It also allows /var/tmp to inherit the same mount options that /tmp owns, allowing /var/tmp to be protected in the same manner /tmp is protected. It will also prevent /var from filling up with temporary files as the contents of /var/tmp will actually reside in the file system containing /tmp." + rationale: "All programs that use /var/tmp and /tmp to read/write temporary files will always be write to tmp file system, preventing a user from running the /var file system out of space or trying to perform operations that have been blocked in the /tmp filesystem." + remediation: "# mount --bind /tmp /var/tmp and edit the /etc/fstab file to contain the following line: /tmp /var/tmp none bind 0 0" + compliance: + - cis: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:findmnt -> r:/var/tmp && r:[/tmp]" + - 'f:/etc/fstab -> r:^/tmp && r:\s*/var/tmp\s* && r:bind' + + - id: 1006 + title: "Create Separate Partition for /var/log" + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["2.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + - id: 1007 + title: "Create Separate Partition for /var/log/audit" + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["2.8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + - id: 1008 + title: "Create Separate Partition for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["2.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + - id: 1009 + title: "Add nodev Option to /home" + description: "When set on a file system, this option prevents character and block special devices from being defined, or if they exist, from being used as character and block special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nodev /home" + compliance: + - cis: ["2.10"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + - id: 1010 + title: "Add nodev Option to /run/shm Partition" + description: "The nodev mount option specifies that the /run/shm (temporary filesystem stored in memory) cannot contain block or character special devices." + rationale: "Since the /run/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /run/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options of entries that have mount points that contain /run/shm. See the fstab(5) manual page for more information. # mount -o remount,nodev /run/shm" + compliance: + - cis: ["2.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/run/shm\s && r:nodev' + + - id: 1011 + title: "Add nosuid Option to /run/shm Partition" + description: "The nosuid mount option specifies that the /run/shm (temporary filesystem stored in memory) will not execute setuid and setgid on executable programs as such, but rather execute them with the uid and gid of the user executing the program." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options). Look for entries that have mount points that contain /run/shm. See the fstab(5) manual page for more information. # mount -o remount,nosuid /run/shm" + compliance: + - cis: ["2.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/run/shm\s && r:nosuid' + + - id: 1012 + title: "Add noexec Option to /run/shm Partition" + description: "Set noexec on the shared memory partition to prevent programs from executing from there." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options). Look for entries that have mount points that contain /run/shm. See the fstab(5) manual page for more information. # mount -o remount,noexec /run/shm" + compliance: + - cis: ["2.16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/run/shm\s && r:noexec' + + - id: 1013 + title: "Disable Mounting of cramfs Filesystems" + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install cramfs /bin/true" + compliance: + - cis: ["2.18"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - "c:/sbin/modprobe -n -v cramfs -> r:^install /bin/true" + - "not c:/sbin/lsmod -> r:cramfs" + + - id: 1014 + title: "Disable Mounting of freevxfs Filesystems" + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install freevxfs /bin/true" + compliance: + - cis: ["2.19"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - "c:/sbin/modprobe -n -v freevxfs -> r:^install /bin/true" + - "not c:/sbin/lsmod -> r:freevxfs" + + - id: 1015 + title: "Disable Mounting of jffs2 Filesystems" + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install jffs2 /bin/true" + compliance: + - cis: ["2.20"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - "c:/sbin/modprobe -n -v jffs2 -> r:^install /bin/true" + - "not c:/sbin/lsmod -> r:jffs2" + + - id: 1016 + title: "Disable Mounting of hfs Filesystems" + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfs /bin/true" + compliance: + - cis: ["2.21"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - "c:/sbin/modprobe -n -v hfs -> r:^install /bin/true" + - "not c:/sbin/lsmod -> r:hfs" + + - id: 1017 + title: "Disable Mounting of hfsplus Filesystems" + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfsplus /bin/true" + compliance: + - cis: ["2.22"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - "c:/sbin/modprobe -n -v hfsplus -> r:^install /bin/true" + - "not c:/sbin/lsmod -> r:hfsplus" + + - id: 1018 + title: "Disable Mounting of squashfs Filesystems" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install squashfs /bin/true" + compliance: + - cis: ["2.23"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - "c:/sbin/modprobe -n -v squashfs -> r:^install /bin/true" + - "not c:/sbin/lsmod -> r:squashfs" + + - id: 1019 + title: "Disable Mounting of udf Filesystems" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats" + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install udf /bin/true" + compliance: + - cis: ["2.24"] + - pci_dss: ["2.2.5"] + condition: all + rules: + - "c:/sbin/modprobe -n -v udf -> r:^install /bin/true" + - "not c:/sbin/lsmod -> r:udf" + + - id: 1020 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." + remediation: "Disable autofs: # update-rc.d autofs disable" + compliance: + - cis: ["2.25"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:find /etc/ -name *autofs* -> r:/etc/rc\d+.d/S\d+autofs' + + # 3 Secure Boot Settings + + - id: 1021 + title: "Set User/Group Owner on bootloader config" + description: "Set the owner and group of your boot loaders config file to the root user. These instructions default to GRUB stored at /boot/grub/grub.cfg ." + rationale: "Setting the owner and group to root prevents non-root users from changing the file." + remediation: "Run the following to change ownership of /boot/grub/grub.cfg : # chown root:root /boot/grub/grub.cfg" + compliance: + - cis: ["3.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /boot/grub/grub.cfg -> r:Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 1022 + title: "Set Permissions on bootloader config" + description: "Set permission on the your boot loaders config file to read and write for root only." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following to set the permissions fro /boot/grub/grub.cfg : # chmod og-rwx /boot/grub/grub.cfg" + compliance: + - cis: ["3.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /boot/grub/grub.cfg -> r:^Access: \(0\d00/-\w\w\w------\)' + + - id: 1023 + title: "Set Boot Loader Password" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters" + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: 'Create an encrypted password with grub-md5-crypt: # grub-mkpasswd-pbkdf2 Enter password: Reenter password: Your PBKDF2 is Add the following into /etc/grub.d/00_header or a custom /etc/grub.d configuration file: cat < EOF Unless the --unrestricted option is added to CLASS in /etc/grub.d/10_linux a password will be required to boot in addition to editing boot parameters: CLASS="--class gnu-linux --class gnu --class os --unrestricted" Run the following to update the grub configuration: # update-grub' + compliance: + - cis: ["3.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + - id: 1024 + title: "Require authentication for Single-User mode" + description: "Setting a password for the root user will force authentication in single user mode." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" + compliance: + - cis: ["3.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/shadow -> r:^root:*:|^root:!:" + ########################################### + # 4 Additional Process Hardening + ########################################### + # 4.1 Restrict Core Dumps (Scored) + - id: 1025 + title: "Restrict Core Dumps" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5)). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to the /etc/security/limits.conf file. * hard core 0 Add the following line to the /etc/sysctl.conf file. fs.suid_dumpable = 0" + compliance: + - cis: ["4.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl fs.suid_dumpable -> r:=\s*0$' + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s0$|\t0$' + + # 4.2 Enable XD/NX Support on 32-bit x86 Systems (Not Scored) + - id: 1026 + title: "Enable XD/NX Support on 32-bit x86 Systems" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["4.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sh -c "dmesg | grep NX" -> r:NX \(Execute Disable\) protection: active' + + # 4.3 Enable Randomized Virtual Memory Region Placement (Scored) + - id: 1027 + title: "Enable Randomized Virtual Memory Region Placement" + description: "Set the system flag to force randomized virtual memory region placement." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Add the following line to the /etc/sysctl.conf file. kernel.randomize_va_space = 2" + compliance: + - cis: ["4.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' + + # 4.4 Disable prelink + - id: 1028 + title: "Disable Prelink" + description: "The prelinking feature changes binaries in an attempt to decrease their startup time." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the command: # /usr/sbin/prelink -ua to restore binaries to a normal, non-prelinked state, then remove prelink: # apt-get purge prelink" + compliance: + - cis: ["4.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s prelink -> r:install ok installed" + + - id: 1029 + title: "Activate AppArmor" + description: "AppArmor provides a Mandatory Access Control (MAC) system that greatly augments the default Discretionary Access Control (DAC) model." + rationale: "For an action to occur, both the traditional DAC permissions must be satisfied as well as the AppArmor MAC rules. The action will not be allowed if either one of these models does not permit the action. In this way, AppArmor rules can only make a system's permissions more restrictive and secure." + remediation: 'Install apparmor and apparmor-utils if missing (additional profiles can be found in the apparmor-profiles package): # apt-get install apparmor apparmor-profiles apparmor-utils Add apparmor=1 and security=apparmor to GRUB_CMDLINE_LINUX in /etc/default/grub: GRUB_CMDLINE_LINUX="apparmor=1 security=apparmor"Update grub configuration (reboot will be required to apply changes): # update-grub Set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted.' + compliance: + - cis: ["4.5"] + condition: all + rules: + - 'c:apparmor_status -> n:^(\d+)\s*profiles are loaded compare > 0' + - 'c:apparmor_status -> r:^0\s*processes are in complain mode' + - 'c:apparmor_status -> r:^0\s*processes are unconfined' + + ###################################### + # 5 OS Services + ###################################### + # 5.1.1 Ensure NIS is not installed (Scored) + - id: 1030 + title: "Ensure NIS is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Uninstall the nis package: # apt-get purge nis" + compliance: + - cis: ["5.1.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "c:dpkg -s nis -> r:install ok installed" + + # 5.1.2 Ensure rsh server is not enabled (Scored) + - id: 1031 + title: "Ensure rsh server is not enabled" + description: "The Berkeley rsh-server (rsh, rlogin, rcp) package contains legacy services that exchange credentials in clear-text." + rationale: "These legacy service contain numerous security exposures and have been replaced with the more secure SSH package." + remediation: "Remove or comment out any shell, login, or exec lines in /etc/inetd.conf: #shell stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.rshd #login stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.rlogind #exec stream tcp nowait root /usr/sbin/tcpd /usr/sbin/in.rexecd" + compliance: + - cis: ["5.1.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/inetd.conf -> !r:^# && r:^shell|^login|^exec" + + # 5.1.3 Ensure rsh client is not installed (Scored) + - id: 1032 + title: "Ensure rsh client is not installed" + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin ." + remediation: "Uninstall the rsh-client and rsh-reload-client packages: # apt-get purge rsh-client rsh-reload-client" + compliance: + - cis: ["5.1.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "c:dpkg -s rsh-client -> r:install ok installed" + - "c:dpkg -s rsh-redone-client -> r:install ok installed" + + # 5.1.4 Ensure talk server is not enabled (Scored) + - id: 1033 + title: "Ensure talk server is not enabled" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Remove or comment out any talk or ntalk lines in /etc/inetd.conf: #talk dgram udp wait nobody.tty /usr/sbin/in.talkd in.talkd #ntalk dgram udp wait nobody.tty /usr/sbin/in.ntalkd in.ntalkd" + compliance: + - cis: ["5.1.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/inetd.conf -> !r:^# && r:^talk|^ntalk" + + # 5.1.5 Ensure talk client is not installed (Scored) + - id: 1034 + title: "Ensure talk client is not installed" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Uninstall the talk package: # apt-get purge talk" + compliance: + - cis: ["2.3.3"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "c:dpkg -s talk -> r:install ok installed" + + # 5.1.6 Ensure telnet server is not enabled (Scored) + - id: 1035 + title: "Ensure telnet server is not enabled" + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Remove or comment out any telnet lines in /etc/inetd.conf: #telnet stream tcp nowait telnetd /usr/sbin/tcpd /usr/sbin/in.telnetd" + compliance: + - cis: ["5.1.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/inetd.conf -> !r:^# && r:telnet" + + # 5.1.7 Ensure tftp-server is not enabled (Scored) + - id: 1036 + title: "Ensure tftp-server is not enabled" + description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The packages tftp and atftp are both used to define and support a TFTP server." + rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." + remediation: "Remove or comment out any tftp lines in /etc/inetd.conf: #tftp stream tcp nowait root internal" + compliance: + - cis: ["5.1.7"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/inetd.conf -> !r:^# && r:tftp" + + # 5.1.8 Ensure xinetd is not enabled (Scored) + - id: 1037 + title: "Ensure xinetd is not enabled" + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests. Note: Several other services recommended to be disabled in this benchmark have xinetd versions as well, if xinetd is required in your environment ensure they are disabled in xinetd configuration as well." + rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." + remediation: "Disable xinetd: # update-rc.d xinetd disable" + compliance: + - cis: ["5.1.8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - 'c:find /etc/ -name *xinetd* -> r:/etc/rc\d+.d/S\d+xinetd' + + # 5.2 Ensure chargen is not enabled (Scored) + - id: 1038 + title: "Ensure chargen is not enabled" + description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Remove or comment out any chargen lines in /etc/inetd.conf: #chargen stream tcp nowait root internal" + compliance: + - cis: ["5.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/inetd.conf -> !r:^# && r:chargen" + + # 5.3 Ensure daytime is not enabled (Scored) + - id: 1039 + title: "Ensure daytime is not enabled" + description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Remove or comment out any daytime lines in /etc/inetd.conf: #daytime stream tcp nowait root internal" + compliance: + - cis: ["5.3"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/inetd.conf -> !r:^# && r:daytime" + + # 5.4 Ensure echo is not enabled (Scored) + - id: 1040 + title: "Ensure echo is not enabled" + description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Remove or comment out any echo lines in /etc/inetd.conf: #echo stream tcp nowait root internal" + compliance: + - cis: ["5.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/inetd.conf -> !r:^# && r:echo" + + # 5.5 Ensure discard is not enabled (Scored) + - id: 1041 + title: "Ensure discard is not enabled" + description: "discard is a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Remove or comment out any discard lines in /etc/inetd.conf: #discard stream tcp nowait root internal" + compliance: + - cis: ["5.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/inetd.conf -> !r:^# && r:discard" + + # 5.6 Ensure time is not enabled (Scored) + - id: 1042 + title: "Ensure time is not enabled" + description: "time is a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Remove or comment out any time lines in /etc/inetd.conf: #time stream tcp nowait root internal" + compliance: + - cis: ["5.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/inetd.conf -> !r:^# && r:time" + + ############################################### + # 6 Special Purpose Services + ############################################### + + # 6.1 Ensure the X Window system is not installed (Scored) + - id: 1043 + title: "Ensure the X Window system is not installed" + description: "The X Window system provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Window system is typically used on desktops where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Uninstall X Windows: # apt-get purge xserver-xorg-core*" + compliance: + - cis: ["6.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:dpkg -l xserver-xorg-core* -> r:^\wi\s*xserver-xorg' + + # 6.2 Ensure Avahi Server is not enabled (Scored) + - id: 1044 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Since servers are not normally used for printing, this service is not needed unless dependencies require it. If this is the case, disable the service to reduce the potential attack surface." + remediation: "Disable avahi-daemon: # update-rc.d avahi-daemon disable" + compliance: + - cis: ["6.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *avahi-daemon* -> r:/etc/rc\d+.d/S\d+avahi-daemon' + + # 6.3 Ensure print server is not enabled (Scored) + - id: 1045 + title: "Ensure print server is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Disable cups: # update-rc.d cups disable" + compliance: + - cis: ["6.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *cups* -> r:/etc/rc\d+.d/S\d+cups' + + # 6.4 Ensure DHCP Server is not enabled (Scored) + - id: 1046 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a server is specifically set up to act as a DHCP server, it is recommended that this service be deleted to reduce the potential attack surface." + remediation: "Disable isc-dhcp-server: # update-rc.d isc-dhcp-server disable" + references: + - "https://www.isc.org/dhcp/" + compliance: + - cis: ["6.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *isc-dhcp-server* -> r:/etc/rc\d+.d/S\d+isc-dhcp-server' + + # 6.5 Configure Network Time Protocol (Scored) + - id: 1047 + title: "Configure Network Time Protocol (NTP)" + description: "The Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. NTP can be configured to be a client and/or a server." + rationale: "It is recommended that physical systems and virtual guests lacking direct access to the physical host's clock be configured as NTP clients to synchronize their clocks (especially to support time sensitive security mechanisms like Kerberos). This also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Install ntp: # apt-get install ntp Ensure the following lines are in /etc/ntp.conf: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Also, make sure /etc/ntp.conf has at least one NTP server specified: server Note: is the IP address or hostname of a trusted time server. Configuring an NTP server is outside the scope of this benchmark." + compliance: + - cis: ["6.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + references: + - http://www.ntp.org/ + condition: all + rules: + - "c:dpkg -s ntp -> r:install ok installed" + - "f:/etc/ntp.conf -> r:^restrict -4 default && r:kod && r:nomodify && r:notrap && r:nopeer && r:noquery" + - "f:/etc/ntp.conf -> r:^restrict -6 default && r:kod && r:nomodify && r:notrap && r:nopeer && r:noquery" + - 'f:/etc/ntp.conf -> r:^server\s\.+' + - 'f:/etc/init.d/ntp -> r:^RUNASUSER\s*\t*=\s*\t*ntp' + + # 6.6 Ensure LDAP is not enabled (Scored) + - id: 1048 + title: "Ensure LDAP is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the server will not need to act as an LDAP client or server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Uninstall the slapd package: # apt-get purge slapd" + compliance: + - cis: ["6.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + references: + - http://www.openldap.org + condition: none + rules: + - "c:dpkg -s slapd -> r:install ok installed" + + # 6.7 Ensure NFS and RPC are not enabled (Scored) + - id: 1049 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the server does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Disable rpcbind: # update-rc.d rpcbind disable Disable nfs-kernel-server: # update-rc.d nfs-kernel-server disable" + compliance: + - cis: ["6.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *rpcbind* -> r:/etc/rc\d+.d/S\d+rpcbind' + - 'c:find /etc/ -name *nfs-kernel-server* -> r:/etc/rc\d+.d/S\d+nfs-kernel-server' + + # 6.8 Ensure DNS Server is not enabled (Scored) + - id: 1050 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a server is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Disable bind9: # update-rc.d bind9 disable" + compliance: + - cis: ["6.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *bind9* -> r:/etc/rc\d+.d/S\d+bind9' + + # 6.9 Ensure FTP Server is not enabled (Scored) + - id: 1051 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Disable vsftpd: # update-rc.d vsftpd disable" + compliance: + - cis: ["6.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *vsftpd* -> r:/etc/rc\d+.d/S\d+vsftp' + + # 6.10 Ensure HTTP Server is not enabled (Scored) + - id: 1052 + title: "Ensure HTTP Server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Disable apache2: # update-rc.d apache2 disable" + compliance: + - cis: ["6.10"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *apache2* -> r:/etc/rc\d+.d/S\d+apache2' + + # 6.11 Ensure IMAP and POP Server is not enabled (Scored) + - id: 1053 + title: "Ensure IMAP and POP server is not enabled" + description: "Dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided to this server, it is recommended that the service be deleted to reduce the potential attack surface." + remediation: "Disable dovecot: # update-rc.d dovecot disable" + compliance: + - cis: ["6.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *dovecot* -> r:/etc/rc\d+.d/S\d+dovecot' + + # 6.12 Ensure Samba is not enabled (Scored) + - id: 1054 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." + remediation: "Disable samba: # update-rc.d samba disable" + compliance: + - cis: ["6.12"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *samba* -> r:/etc/rc\d+.d/S\d+samba' + + # 6.13 Ensure HTTP Proxy Server is not enabled (Scored) + - id: 1055 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Disable squid3: # update-rc.d squid3 disable" + compliance: + - cis: ["6.13"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *squid3* -> r:/etc/rc\d+.d/S\d+squid3' + + # 6.14 Ensure SNMP Server is not enabled (Scored) + - id: 1056 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server communicates using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used." + remediation: "Disable snmpd: # update-rc.d snmpd disable" + compliance: + - cis: ["6.14"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:find /etc/ -name *snmpd* -> r:/etc/rc\d+.d/S\d+snmpd' + + # 6.15 Ensure Mail Transfer Agent for Local-Only Mode (Scored) + - id: 1057 + title: "Configure Mail Transfer Agent for Local-Only Mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Note: The remediation given here provides instructions for configuring the postfix mail server, depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/exim4/update-exim4.conf.conf and edit the dc_local_interfaces line to remove non loopback addresses: dc_local_interfaces='127.0.0.1 ; ::1' Run update-exim4.conf: # update-exim4.conf Reload exim4 configuration: # service exim4 reload" + compliance: + - cis: ["6.15"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - tsc: ["CC5.2", "CC6.4", "CC6.6", "CC6.7", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:netstat -an -> r:\.*25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.*LISTEN' + + # 6.16 Ensure rsync service is not enabled (Scored) + - id: 1058 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Set RSYNC_ENABLE to false in /etc/default/rsync: RSYNC_ENABLE=false" + compliance: + - cis: ["6.16"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: any + rules: + - "not c:dpkg -s rsync -> r:install ok installed" + - 'f:/etc/default/rsync -> !r:^# && r:RSYNC_ENABLE\s*\t*=\s*\t*false' + + ############################################### + # 7 Network Configuration and Firewall + ############################################### + ############################################### + # 7.1 Modify Network Parameters + ############################################### + + # 7.1.1 Disable IP Forwarding (Scored) + - id: 1059 + title: "Disable IP Forwarding" + description: "The net.ipv4.ip_forward flag is used to tell the server whether it can forward packets or not. If the server is not to be used as a router, set the flag to 0." + rationale: "Setting the flag to 0 ensures that a server with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the net.ipv4.ip_forward parameter to 0 in /etc/sysctl.conf: net.ipv4.ip_forward=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.ip_forward=0 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.1.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' + + # 7.1.2 Disable Send Packet Redirects (Scored) + - id: 1060 + title: "Disable Send Packet Redirects" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the net.ipv4.conf.all.send_redirects and net.ipv4.conf.default.send_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.send_redirects=0 net.ipv4.conf.default.send_redirects=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.send_redirects=0 # /sbin/sysctl -w net.ipv4.conf.default.send_redirects=0 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.1.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' + + ############################################### + # 7.2 Modify Network Parameters (Host and Router) + ############################################### + + # 7.2.1 Disable Source Routed Packet Acceptance (Scored) + - id: 1061 + title: "Disable Source Routed Packet Acceptance" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this server was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the server as a way to reach the private address servers. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.accept_source_route=0 net.ipv4.conf.default.accept_source_route=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.accept_source_route=0 # /sbin/sysctl -w net.ipv4.conf.default.accept_source_route=0 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' + + # 7.2.2 Disable ICMP Redirect Acceptance (Scored) + - id: 1062 + title: "Disable ICMP Redirect Acceptance" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the net.ipv4.conf.all.accept_redirects and net.ipv4.conf.default.accept_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.accept_redirects=0 net.ipv4.conf.default.accept_redirects=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.accept_redirects=0 # /sbin/sysctl -w net.ipv4.conf.default.accept_redirects=0 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' + + # 7.2.3 Disable Secure ICMP Redirect Acceptance (Scored) + - id: 1063 + title: "Disable Secure ICMP Redirect Acceptance" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the net.ipv4.conf.all.secure_redirects and net.ipv4.conf.default.secure_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.secure_redirects=0 net.ipv4.conf.default.secure_redirects=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.secure_redirects=0 # /sbin/sysctl -w net.ipv4.conf.default.secure_redirects=0 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' + + # 7.2.4 Log Suspicious Packets (Scored) + - id: 1064 + title: "Log Suspicious Packets" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." + remediation: "Set the net.ipv4.conf.all.log_martians and net.ipv4.conf.default.log_martians parameters to 1 in /etc/sysctl.conf: net.ipv4.conf.all.log_martians=1 net.ipv4.conf.default.log_martians=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.log_martians=1 # /sbin/sysctl -w net.ipv4.conf.default.log_martians=1 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.4"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' + - 'c:/sbin/sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' + + # 7.2.5 Enable Ignore Broadcast Requests (Scored) + - id: 1065 + title: "Enable Ignore Broadcast Requests" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the net.ipv4.icmp_echo_ignore_broadcasts parameter to 1 in /etc/sysctl.conf: net.ipv4.icmp_echo_ignore_broadcasts=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.5"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' + + # 7.2.6 Enable Bad Error Message Protection (Scored) + - id: 1066 + title: "Enable Bad Error Message Protection" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the net.ipv4.icmp_ignore_bogus_error_responses parameter to 1 in /etc/sysctl.conf: net.ipv4.icmp_ignore_bogus_error_responses=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.6"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' + + # 7.2.7 Enable RFC-recommended Source Route Validation (Scored) + - id: 1067 + title: "Enable RFC-recommended Source Route Validation" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your server, you will not be able to enable this feature without breaking the routing." + remediation: "Set the net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter parameters to 1 in /etc/sysctl.conf: net.ipv4.conf.all.rp_filter=1 net.ipv4.conf.default.rp_filter=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.conf.all.rp_filter=1 # /sbin/sysctl -w net.ipv4.conf.default.rp_filter=1 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.7"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' + - 'c:/sbin/sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' + + # 7.2.8 Enable TCP SYN Cookies (Scored) + - id: 1068 + title: "Enable TCP SYN Cookies" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the server to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a server by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the server to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the net.ipv4.tcp_syncookies parameter to 1 in /etc/sysctl.conf: net.ipv4.tcp_syncookies=1 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv4.tcp_syncookies=1 # /sbin/sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["7.2.8"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' + + # 7.3.1 Disable IPv6 Router Advertisements (Not Scored) + - id: 1069 + title: "Disable IPv6 Router Advertisements" + description: "This setting disables the systems ability to accept router advertisements" + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the net.ipv6.conf.all.accept_ra and net.ipv6.conf.default.accept_ra parameter to 0 in /etc/sysctl.conf: net.ipv6.conf.all.accept_ra=0 net.ipv6.conf.default.accept_ra=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv6.conf.all.accept_ra=0 # /sbin/sysctl -w net.ipv6.conf.default.accept_ra=0 # /sbin/sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["7.3.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' + - 'c:/sbin/sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' + + # 7.3.2 Disable IPv6 Redirect Acceptance (Not Scored) + - id: 1070 + title: "Disable IPv6 Redirect Acceptance" + description: "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic." + rationale: "It is recommended that systems not accept ICMP redirects as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the net.ipv6.conf.all.accept_redirects and net.ipv6.conf.default.accept_redirects parameters to 0 in /etc/sysctl.conf: net.ipv6.conf.all.accept_redirects=0 net.ipv6.conf.default.accept_redirects=0 Modify active kernel parameters to match: # /sbin/sysctl -w net.ipv6.conf.all.accept_redirects=0 # /sbin/sysctl -w net.ipv6.conf.default.accept_redirects=0 # /sbin/sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["7.3.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:/sbin/sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' + + # 7.3.3 Disable IPv6 (Not Scored) + - id: 1071 + title: "Disable IPv6" + description: "Although IPv6 has many advantages over IPv4, few organizations have implemented IPv6." + rationale: "If IPv6 is not to be used, it is recommended that it be disabled to reduce the attack surface of the system." + remediation: "Create or edit the file /etc/sysctl.conf and add the following lines: net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 net.ipv6.conf.lo.disable_ipv6=1 Run the following command or reboot to apply the changes: # sysctl -p" + compliance: + - cis: ["7.3.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "not c:ip addr -> r:inet6" + + # 7.4.1 Install TCP Wrappers (Scored) + - id: 1072 + title: "Install TCP Wrappers" + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Install tcpd : # apt-get install tcpd To verify if a service supports TCP Wrappers, run the following command: # ldd | grep libwrap.so If there is any output, then the service supports TCP Wrappers." + compliance: + - cis: ["7.4.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "c:dpkg -s tcpd -> r:install ok installed" + + # 7.4.2 Create /etc/hosts.allow (Not Scored) + - id: 1073 + title: "Create /etc/hosts.allow" + description: "The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the server." + remediation: 'Create /etc/hosts.allow: # echo "ALL: /, /, ..." >/etc/hosts.allow where each / combination (for example, "192.168.1.0/255.255.255.0") represents one network block in use by your organization that requires access to this system.' + compliance: + - cis: ["7.4.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "f:/etc/hosts.allow" + + # 7.4.3 Verify permissions on /etc/hosts.allow (Scored) + - id: 1074 + title: "Verify permissions on /etc/hosts.allow" + description: "The /etc/hosts.allow file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "If the permissions of the /etc/hosts.allow file are incorrect, run the following command to correct them: # /bin/chmod 644 /etc/hosts.allow" + compliance: + - cis: ["7.4.5"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "c:/bin/ls -l /etc/hosts.allow -> r:-rw-r--r--" + + # 7.4.4 Create /etc/hosts.deny (Not Scored) + - id: 1075 + title: "Create /etc/hosts.deny" + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the server." + remediation: 'Create /etc/hosts.deny: # echo "ALL: ALL" >> /etc/hosts.deny' + compliance: + - cis: ["7.4.4"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "f:/etc/hosts.deny" + - 'f:/etc/hosts.deny -> r:^ALL:\s*ALL' + + # 7.4.5 Verify permissions on /etc/hosts.deny (Scored) + - id: 1076 + title: "Verify permissions on /etc/hosts.deny" + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "If the permissions of the /etc/hosts.deny file are incorrect, run the following command to correct them: # /bin/chmod 644 /etc/hosts.deny" + compliance: + - cis: ["7.4.5"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "c:/bin/ls -l /etc/hosts.deny -> r:-rw-r--r--" + + # 7.5.1 Disable DCCP (Not Scored) + - id: 1077 + title: "Disable DCCP" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: '# echo "install dccp /bin/true" >> /etc/modprobe.d/CIS.conf' + compliance: + - cis: ["7.5.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "f:/etc/modprobe.d/CIS.conf" + - "f:/etc/modprobe.d/CIS.conf -> r:install dccp /bin/true" + + # 7.5.2 Disable SCTP (Not Scored) + - id: 1078 + title: "Disable SCTP" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: '# echo "install sctp /bin/true" >> /etc/modprobe.d/CIS.conf' + compliance: + - cis: ["7.5.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "f:/etc/modprobe.d/CIS.conf" + - "f:/etc/modprobe.d/CIS.conf -> r:install sctp /bin/true" + + # 7.5.3 Disable RDS (Not Scored) + - id: 1079 + title: "Disable RDS" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: '# echo "install rds /bin/true" >> /etc/modprobe.d/CIS.conf' + compliance: + - cis: ["7.5.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "f:/etc/modprobe.d/CIS.conf" + - "f:/etc/modprobe.d/CIS.conf -> r:install rds /bin/true" + + # 7.5.4 Disable TIPC (Not Scored) + - id: 1080 + title: "Disable TIPC" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: '# echo "install tipc /bin/true" >> /etc/modprobe.d/CIS.conf' + compliance: + - cis: ["7.5.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "f:/etc/modprobe.d/CIS.conf" + - "f:/etc/modprobe.d/CIS.conf -> r:install tipc /bin/true" + + # 7.6 Deactivate Wireless Interfaces (Not Scored) + - id: 1081 + title: "Deactivate Wireless Interfaces" + description: "Wireless networking is used when wired networks are unavailable. Debian provides the nmcli interface which allows system administrators to configure and use wireless networks." + rationale: "If wireless is not to be used, wireless devices can be disabled to reduce the potential attack surface." + remediation: "Use the following command to disable wireless: # nmcli nm wifi off" + compliance: + - cis: ["7.6"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.6"] + condition: all + rules: + - "c:nmcli nm wifi -> r:disabled" + + # 7.7 Ensure Firewall is active (Scored) + - id: 1082 + title: "Ensure Firewall is active" + description: "IPtables is an application that allows a system administrator to configure the IPv4 tables, chains and rules provided by the Linux kernel firewall. The iptables-persistent package in Debian provides one way to ensure iptables rules are reapplied on reboot. Note: the audit and remediation included provide instructions for using iptables-persistent to reapply iptables rules. Other methods are available which may be in use in your environment and may conflict with these steps." + rationale: "IPtables provides extra protection for the Linux system by limiting communications in and out of the box to specific IPv4 addresses and ports." + remediation: "Install the iptables and iptables-persistent packages: # apt-get install iptables iptables-persistent Enable the iptables-persistent service: # update-rc.d iptables-persistent enable" + compliance: + - cis: ["7.7"] + - cis_csc: ["9.2"] + - pci_dss: ["1.1"] + condition: all + rules: + - "c:dpkg -s iptables -> r:install ok installed" + - "c:dpkg -s iptables-persistent -> r:install ok installed" + - 'c:find /etc/rc2.d -name *iptables-persistent* -> r:/etc/rc2.d/S\d+iptables-persistent' + - 'c:find /etc/rc3.d -name *iptables-persistent* -> r:/etc/rc3.d/S\d+iptables-persistent' + - 'c:find /etc/rc4.d -name *iptables-persistent* -> r:/etc/rc4.d/S\d+iptables-persistent' + - 'c:find /etc/rc5.d -name *iptables-persistent* -> r:/etc/rc5.d/S\d+iptables-persistent' + + ############################################### + # 8 Logging and Auditing + ############################################### + + ############################################### + # 8.1 Configure System Accounting (auditd) + ############################################### + + # 8.1.1.1 Configure Audit Log Storage Size (Not Scored) + - id: 1083 + title: "Configure Audit Log Storage Size" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the max_log_file parameter in /etc/audit/auditd.conf max_log_file = Note: MB is the number of MegaBytes the file can be." + compliance: + - cis: ["8.1.1.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:max_log_file\s*=\s*\d+' + + # 8.1.1.2 Disable System on Audit Log Full (Not Scored) + - id: 1084 + title: "Disable System on Audit Log Full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Add the following lines to the /etc/audit/auditd.conf file. space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["8.1.1.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*=\s*halt' + + # 8.1.1.3 Keep All Auditing Information (Scored) + - id: 1085 + title: "Keep All Auditing Information" + description: "Normally, auditd will hold 4 logs of maximum log file size before deleting older log files." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Add the following line to the /etc/audit/auditd.conf file. max_log_file_action = keep_logs" + compliance: + - cis: ["8.1.1.3"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*=\s*keep_logs' + + # 8.1.2 Install and Enable auditd Service (Scored) + - id: 1086 + title: "Install and Enable auditd Service" + description: "Install and turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Install auditd: # apt-get install auditd If needed enable auditd in /etc/rc*.d: # update-rc.d auditd enable" + compliance: + - cis: ["8.1.2"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1", "10.7"] + - tsc: ["CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:dpkg -s auditd -> r:install ok installed" + - 'c:find /etc/rc2.d -name *auditd* -> r:/etc/rc2.d/S\d+auditd' + - 'c:find /etc/rc3.d -name *auditd* -> r:/etc/rc3.d/S\d+auditd' + - 'c:find /etc/rc4.d -name *auditd* -> r:/etc/rc4.d/S\d+auditd' + - 'c:find /etc/rc5.d -name *auditd* -> r:/etc/rc5.d/S\d+auditd' + + # 8.1.3 Enable Auditing for Processes That Start Prior to auditd (Scored) + - id: 1087 + title: "Enable Auditing for Processes That Start Prior to auditd" + description: "Configure grub or lilo so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: 'Edit /etc/default/grub to include audit=1 as part of GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX="audit=1"And run the following command to update the grub configuration: # update-grub' + compliance: + - cis: ["8.1.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.2.6", "10.7"] + - tsc: ["CC7.2", "CC6.1", "CC7.3", "CC7.4", "CC6.8"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d", "32.2"] + condition: all + rules: + - 'f:/etc/default/grub -> r:^GRUB_CMDLINE_LINUX\s*=\s*\p*audit\s*=\s*1\p*' + + # 8.1.4 Record Events That Modify Date and Time Information (Scored) + - id: 1088 + title: "Record Events That Modify Date and Time Information" + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier "time-change"' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change # Execute the following command to restart auditd # pkill -P 1-HUP auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change # Execute the following command to restart auditd # pkill -P 1-HUP auditd" + compliance: + - cis: ["8.1.4"] + - cis_csc: ["3.6"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit && r:-F arch=b32 && r:-S clock_settime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:^-w /etc/localtime && r:-p wa && r:-k time-change" + + # 8.1.5 Record Events That Modify User/Group Information (Scored) + - id: 1089 + title: "Record Events That Modify User/Group Information" + description: 'Record events affecting the group, passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity # Execute the following command to restart auditd # pkill -P 1-HUP auditd" + compliance: + - cis: ["8.1.5"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC7.3", "CC7.4", "CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w /etc/group && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w /etc/passwd && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w /etc/gshadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w /etc/shadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w /etc/security/opasswd && r:-p wa && r:-k identity" + + # 8.1.6 Record Events That Modify the System's Network Environment (Scored) + - id: 1090 + title: "Record Events That Modify the System's Network Environment" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed prelogin), /etc/hosts (file containing host names and associated IP addresses) and /etc/network (directory containing network interface scripts and configurations) files." + rationale: 'Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier "system-locale."' + remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file. -a exit,always -F arch=b64 -S sethostname -S setdomainname -k system-locale -a exit,always -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/network -p wa -k system-locale # Execute the following command to restart auditd # pkill -P 1-HUP auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a exit,always -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/network -p wa -k system-locale # Execute the following command to restart auditd # pkill -P 1-HUP auditd" + compliance: + - cis: ["8.1.6"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - tsc: ["CC7.2", "CC6.1", "CC7.3", "CC7.4", "CC6.8"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname -k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w /etc/issue && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w /etc/issue.net && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w /etc/hosts && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w /etc/network && r:-p wa && r:-k system-locale" + + # 8.1.7 Record Events That Modify the System's Mandatory Access Controls (Scored) + - id: 1091 + title: "Record Events That Modify the System's Mandatory Access Controls" + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux directory." + rationale: "Changes to files in this directory could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Add the following lines to the /etc/audit/audit.rules file. Add the following lines to /etc/audit/audit.rules -w /etc/selinux/ -p wa -k MAC-policy # Execute the following command to restart auditd # pkill -P 1-HUP auditd" + compliance: + - cis: ["8.1.7"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC7.3", "CC7.4", "CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w /etc/selinux/ && r:-p wa && r:-k MAC-policy" + + # 8.1.8 Collect Login and Logout Events (Scored) + - id: 1092 + title: "Collect Login and Logout Events" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/audit.&& r:rules file. -w /var/log/faillog -p wa -k logins -w /var/log/lastlog -p wa -k logins -w /var/log/tallylog -p wa -k logins # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" + compliance: + - cis: ["8.1.8"] + - cis_csc: ["5.5", "16.10", "16.4"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - tsc: ["CC7.2", "CC6.1", "CC7.3", "CC7.4", "CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w /var/log/faillog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w /var/log/lastlog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w /var/log/tallylog && r:-p wa && r:-k logins" + + # 8.1.9 Collect Session Initiation Information (Scored) + - id: 1093 + title: "Collect Session Initiation Information" + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. The /var/log/wtmp file tracks logins, logouts, shutdown and reboot events. All audit records will be tagged with the identifier "session." The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier "logins."' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k session -w /var/log/btmp -p wa -k session # Execute the following command to restart auditd # pkill -HUP -P 1 auditd Note: Use the last command to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp)" + compliance: + - cis: ["8.1.9"] + - cis_csc: ["5.5", "16.10", "16.4"] + - pci_dss: ["10.3"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w /var/run/utmp && r:-p wa && r:-k session" + - "f:/etc/audit/audit.rules -> r:^-w /var/log/wtmp && r:-p wa && r:-k session" + - "f:/etc/audit/audit.rules -> r:^-w /var/log/btmp && r:-p wa && r:-k session" + + # 8.1.10 Collect Discretionary Access Control Permission Modification Events (Scored) + - id: 1094 + title: "Collect Discretionary Access Control Permission Modification Events" + description: 'Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permis&& r:sions and attributes. The chmod, fchmod and fchmodat system calls affect the permissions associated with a file. The chown, fchown, fchownat and lchown system calls affect owner and group attributes on a file. The setxattr, lsetxattr, fsetxattr (set extended file attributes) and removexattr, lremovexattr, fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system userids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier "perm_mod."' + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S \\ lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S \\ lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod # Execute the following command to restart auditd # pkill -HUP -P 1 auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 \\ -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S \\ lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" + compliance: + - cis: ["8.1.10"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC7.3", "CC7.4", "CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + + # 8.1.11 Collect Unsuccessful Unauthorized Access Attempts to Files (Scored) + - id: 1095 + title: "Collect Unsuccessful Unauthorized Access Attempts to Files" + description: 'Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation (creat), opening (open, openat) and truncation (truncate, ftruncate) of files. An audit log record will only be written if the user is a nonprivileged user (auid > = 500), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier "access."' + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access # Execute the following command to restart auditd # pkill -HUP -P 1 auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate \\ -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" + compliance: + - cis: ["8.1.11"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC7.3", "CC7.4", "CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access" + + # 8.1.13 Collect Successful File System Mounts (Scored) + - id: 1096 + title: "Collect Successful File System Mounts" + description: "Monitor the use of the mount system call. The mount (and umount) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user" + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 64 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts # Execute the following command to restart auditd # pkill -HUP -P 1 auditd For 32 bit systems, add the following lines to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" + compliance: + - cis: ["8.1.13"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - tsc: ["CC7.2", "CC6.1", "CC7.3", "CC7.4", "CC6.8"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts" + + # 8.1.14 Collect File Deletion Events by User (Scored) + - id: 1097 + title: "Collect File Deletion Events by User" + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "At a minimum, configure the audit system to collect file deletion events for all users and root. For 64 bit systems, add the following to the /etc/audit/audit.rules file. -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 \\ -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 \\ -F auid!=4294967295 -k delete # Execute the following command to restart auditd # pkill -HUP -P 1 auditd For 32 bit systems, add the following to the /etc/audit/audit.rules file. -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 \\ -F auid!=4294967295 -k delete # Execute the following command to restart auditd # pkill -P 1-HUP auditd" + compliance: + - cis: ["8.1.14"] + - pci_dss: ["10.5.5"] + - tsc: ["PI1.4", "PI1.5", "CC7.1", "CC7.2", "CC7.3", "CC8.1"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete" + + # 8.1.15 Collect Changes to System Administration Scope (sudoers) (Scored) + - id: 1098 + title: "Collect Changes to System Administration Scope (sudoers)" + description: 'Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier "scope."' + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /etc/sudoers -p wa -k scope # Execute the following command to restart auditd # pkill -HUP -P 1 auditd" + compliance: + - cis: ["8.1.15"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC7.3", "CC7.4", "CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w /etc/sudoers && r:-p wa && r:-k scope" + + # 8.1.16 Collect System Administrator Actions (sudolog) (Scored) + - id: 1099 + title: "Collect System Administrator Actions (sudolog)" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log. Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /var/log/sudo.log -p wa -k actions # Execute the following command to restart auditd # pkill -HUP -P 1 auditd Note: The system must be configured with su disabled (See Item 9.5 Restrict Access to the su Command) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root" + compliance: + - cis: ["8.1.16"] + - cis_csc: ["5.1", "5.5"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14", "AC.6", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.3", "CC7.3", "CC7.4", "CC6.8"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w /var/log/sudo.log && r:-p wa && r:-k actions" + + # 8.1.17 Collect Kernel Module Loading and Unloading (Scored) + - id: 1100 + title: "Collect Kernel Module Loading and Unloading" + description: 'Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of "modules".' + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "Add the following lines to the /etc/audit/audit.rules file. -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules For 32 bit systems, add -a always,exit -F arch=b32 -S init_module -S delete_module -k modules For 64 bit systems, add -a always,exit -F arch=b64 -S init_module -S delete_module -k modules" + compliance: + - cis: ["8.1.17"] + - cis_csc: ["3"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - tsc: ["CC7.2", "CC6.1", "CC7.3", "CC7.4", "CC6.8"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w /sbin/insmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-w /sbin/rmmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-w /sbin/modprobe && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S init_module && r:-S delete_module && r:-k modules" + + # 8.1.18 Make the Audit Configuration Immutable (Scored) + - id: 1101 + title: "Make the Audit Configuration Immutable" + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following lines to the /etc/audit/audit.rules file. -e 2 Note: This must be the last line in the /etc/audit/audit.rules file" + compliance: + - cis: ["8.1.18"] + - cis_csc: ["3", "6"] + - pci_dss: ["10.5"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-e 2$" + + ############################################### + # 8.2 Configure rsyslog + ############################################### + + # 8.2.1 Install the rsyslog package (Scored) + - id: 1102 + title: "Install the rsyslog package" + description: "The rsyslog package is a third party package that provides many enhancements to syslog, such as multi-threading, TCP communication, message filtering and data base support." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install the rsyslog package: # apt-get install rsyslog" + compliance: + - cis: ["8.2.2"] + - cis_csc: ["6.2"] + condition: all + rules: + - "c:dpkg -s rsyslog -> r:install ok installed" + + # 8.2.2 Ensure the rsyslog Service is activated (Scored) + - id: 1103 + title: "Ensure the rsyslog Service is activated" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system will not have a syslog service running." + remediation: "Enable rsyslog: # update-rc.d rsyslog enable" + compliance: + - cis: ["8.2.2"] + - cis_csc: ["6.2"] + condition: all + rules: + - 'c:find /etc/rc2.d -name *rsyslog* -> r:/etc/rc2.d/S\d+rsyslog' + - 'c:find /etc/rc3.d -name *rsyslog* -> r:/etc/rc3.d/S\d+rsyslog' + - 'c:find /etc/rc4.d -name *rsyslog* -> r:/etc/rc4.d/S\d+rsyslog' + - 'c:find /etc/rc5.d -name *rsyslog* -> r:/etc/rc5.d/S\d+rsyslog' + + # 8.2.5 Configure rsyslog to send logs to a Remote Log Host (Scored) + - id: 1104 + title: "Configure rsyslog to Send Logs to a Remote Log Host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system" + remediation: 'Edit the /etc/rsyslog.conf file and add the following line (where logfile.example.com is the name of your central log host). *.* @@loghost.example.com # Execute the following command to restart rsyslogd # pkill -HUP rsyslogd Note: The double "at" sign (@@) directs rsyslog to use TCP to send log messages to the server, which is a more reliable transport mechanism than the default UDP protocol.' + compliance: + - cis: ["8.2.5"] + - cis_csc: ["6.6"] + references: + - rsyslog.conf(5) man page + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\s*\t**.* @@\.+' + + # 8.2.6 Accept remote rsyslog messages only on designated log hosts (Not Scored) + - id: 1105 + title: "Accept Remote rsyslog Messages Only on Designated Log Hosts" + description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." + rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." + remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment the following lines: $ModLoad imtcp.so $InputTCPServerRun 514 Execute the following command to restart rsyslogd: # pkill -HUP rsyslogd" + compliance: + - cis: ["8.2.6"] + - cis_csc: ["9.1"] + references: + - rsyslog.conf(8) man page + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\s*\t*\$ModLoad\s*\t*imtcp.so' + - 'f:/etc/rsyslog.conf -> r:^\s*\t*\$InputTCPServerRun\s*\t*514' + + ############################################### + # 8.3 Advanced Intrusion Detection Environment (AIDE) + ############################################### + + # 8.3.1 Install AIDE (Scored) + - id: 1106 + title: "Install AIDE" + description: "In some installations, AIDE is not installed automatically" + rationale: "Install AIDE to make use of the file integrity features to monitor critical files for changes that could affect the security of the system." + remediation: "Install AIDE: # apt-get install aide Initialize AIDE: # aideinit # cp /var/lib/aide/aide.db.new /var/lib/aide/aide.db Note: The prelinking feature can interfere with AIDE because it alters binaries to speed up their start up times. Run /usr/sbin/prelink -ua to restore the binaries to their prelinked state, thus avoiding false positives from AIDE." + compliance: + - cis: ["8.3.1"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + condition: all + rules: + - "c:dpkg -s aide -> r:install ok installed" + + # 8.3.2 Implement Periodic Execution of File Integrity (Scored) + - id: 1107 + title: "Implement Periodic Execution of File Integrity" + description: "Implement periodic file checking, in compliance with site policy" + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Execute the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check Note: The checking in this instance occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy." + compliance: + - cis: ["8.3.2"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:crontab -u root -l -> !r:^# && r:\s*\t*/usr/sbin/aide\s*\t*--check' + + ############################################### + # 9 System Access, Authentication and Authorization + ####################################################### + # 9.1.1 Enable cron Daemon (Scored) + - id: 1108 + title: "Enable cron Daemon" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run and cron is used to execute them." + remediation: "Enable cron: # update-rc.d cron enable Enable anacron: # update-rc.d anacron enable" + compliance: + - cis: ["9.1.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:find /etc/rc2.d -name *cron* -> r:/etc/rc2.d/S\d+cron' + - 'c:find /etc/rc3.d -name *cron* -> r:/etc/rc3.d/S\d+cron' + - 'c:find /etc/rc4.d -name *cron* -> r:/etc/rc4.d/S\d+cron' + - 'c:find /etc/rc5.d -name *cron* -> r:/etc/rc5.d/S\d+cron' + - 'c:find /etc/rc2.d -name *anacron* -> r:/etc/rc2.d/S\d+anacron' + - 'c:find /etc/rc3.d -name *anacron* -> r:/etc/rc3.d/S\d+anacron' + - 'c:find /etc/rc4.d -name *anacron* -> r:/etc/rc4.d/S\d+anacron' + - 'c:find /etc/rc5.d -name *anacron* -> r:/etc/rc5.d/S\d+anacron' + + # 9.1.2 Set User/Group Owner and Permission on /etc/crontab (Scored) + - id: 1109 + title: "Set User/Group Owner and Permission on /etc/crontab" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["9.1.2"] + - pci_dss: ["2.2.4"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 9.1.3 Set User/Group Owner and Permission on /etc/cron.hourly (Scored) + - id: 1110 + title: "Set User/Group Owner and Permission on /etc/cron.hourly" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["9.1.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access: \(0\d00/d\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 9.1.4 Set User/Group Owner and Permission on /etc/cron.daily (Scored) + - id: 1111 + title: "Set User/Group Owner and Permission on /etc/cron.daily" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["9.1.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access: \(0\d00/d\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 9.1.5 Set User/Group Owner and Permission on /etc/cron.weekly (Scored) + - id: 1112 + title: "Set User/Group Owner and Permission on /etc/cron.weekly" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["9.1.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access: \(0\d00/d\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 9.1.6 Set User/Group Owner and Permission on /etc/cron.monthly (Scored) + - id: 1113 + title: "Set User/Group Owner and Permission on /etc/cron.monthly" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["9.1.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access: \(0\d00/d\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 9.1.7 Set User/Group Owner and Permission on /etc/cron.d (Scored) + - id: 1114 + title: "Set User/Group Owner and Permission on /etc/cron.d" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["9.1.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0\d00/d\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 9.1.8 Restrict at/cron to Authorized Users (Scored) + - id: 1115 + title: "Restrict at/cron to Authorized Users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "# /bin/rm /etc/cron.deny # /bin/rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" + compliance: + - cis: ["9.1.8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/cron.allow" + - "f:/etc/at.allow" + - "not f:/etc/cron.deny" + - "not f:/etc/at.deny" + - "c:stat -L -c%u-%g-%a /etc/cron.allow -> r:^0-0-600" + - "c:stat -L -c%u-%g-%a /etc/at.allow -> r:^0-0-600" + + ########################################### + # 9.2 Configure PAM + ########################################### + + # 9.2.1 Set Password Creation Requirement Parameters Using pam_cracklib (Scored) + - id: 1116 + title: "Set Password Creation Requirement Parameters Using pam_cracklib" + description: "The pam_cracklib module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_cracklib.so options. # retry=3 - Allow 3 tries before sending back a failure. # minlen=14 - password must be 14 characters or more # dcredit=-1 - provide at least one digit # ucredit=-1 - provide at least one uppercase character # ocredit=-1 - provide at least one special character # lcredit=-1 - provide at least one lowercase character The setting shown above is one possible policy. Alter these values to conform to your own organization's password policies." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "1) Install the libpam-cracklib package: # apt-get install libpam-cracklib 2) Set the pam_cracklib.so parameters as follows in /etc/pam.d/common-password: password required pam_cracklib.so retry=3 minlen=14 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1" + compliance: + - cis: ["9.2.1"] + - pci_dss: ["8.2.3"] + condition: all + rules: + - "c:dpkg -s libpam-cracklib -> r:install ok installed" + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_cracklib.so && r:retry=\d && n:minlen=(\d+) compare >= 14 && r:dcredit=-\d+ && r:ucredit=-\d+ && r:ocredit=-\d+ && r:lcredit=-\d+' + + # 9.2.2 Set Lockout for Failed Password Attempts (Not Scored) + - id: 1117 + title: "Set Lockout for Failed Password Attempts" + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration file /etc/pam.d/login. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." + rationale: "Locking out userIDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Edit the /etc/pam.d/login file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900 Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user." + compliance: + - cis: ["9.2.2"] + - pci_dss: ["8.2.5"] + condition: all + rules: + - 'f:/etc/pam.d/login -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny=\d && r:unlock_time=\d\d\d+' + + # 9.2.3 Limit Password Reuse (Scored) + - id: 1118 + title: "Limit Password Reuse" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Set the pam_unix.so remember parameter to 5 in /etc/pam.d/common-password: password [success=1 default=ignore] pam_unix.so obscure sha512 remember=5 Note: The default password setting in this document is the last 5 passwords. Change this number to conform to your site's password policy." + compliance: + - cis: ["9.2.3"] + - pci_dss: ["8.2.5"] + condition: all + rules: + - 'f:/etc/pam.d/common-password -> !r:^# && r:password && r:pam_unix.so && n:remember\s*\t*=\s*\t*(\d+) compare >= 5' + + ########################################### + # 9.3 Configure SSH + ########################################### + # 9.3.1 Set SSH Protocol to 2 (Scored) + - id: 1119 + title: "Set SSH Protocol to 2" + description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["9.3.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\s*\t*2' + + # 9.3.2 Set LogLevel to INFO (Scored) + - id: 1120 + title: "Set LogLevel to INFO" + description: "The INFO parameter specifices that record login and logout activity will be logged." + rationale: "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 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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + compliance: + - cis: ["9.3.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:^\s*\t*LogLevel\s+INFO' + + # 9.3.3 Set Permissions on /etc/ssh/sshd_config (Scored) + - id: 1121 + title: "Set Permissions on /etc/ssh/sshd_config" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "If the user and group ownership of the /etc/ssh/sshd_config file are incorrect, run the following command to correct them: # chown root:root /etc/ssh/sshd_config If the permissions are incorrect, run the following command to correct them: # chmod 600 /etc/ssh/sshd_config" + compliance: + - cis: ["9.3.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access: \(0\d00/-\w\w-------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 9.3.4 Disable SSH X11 Forwarding (Scored) + - id: 1122 + title: "Disable SSH X11 Forwarding" + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["9.3.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:X11Forwarding\s+no' + + # 9.3.5 Set SSH MaxAuthTries to 4 or Less (Scored) + - id: 1123 + title: "Set SSH MaxAuthTries to 4 or Less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, it is set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["9.3.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && n:MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 9.3.6 Set SSH IgnoreRhosts to Yes (Scored) + - id: 1124 + title: "Set SSH IgnoreRhosts to Yes" + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["9.3.6"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\s+yes' + + # 9.3.7 Set SSH HostbasedAuthentication to No (Scored) + - id: 1125 + title: "Set SSH HostbasedAuthentication to No" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["9.3.7"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:HostbasedAuthentication\s+no' + + # 9.3.8 Disable SSH Root Login (Scored) + - id: 1126 + title: "Disable SSH Root Login" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["9.3.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\s+no' + + # 9.3.9 Set SSH PermitEmptyPasswords to No (Scored) + - id: 1127 + title: "Set SSH PermitEmptyPasswords to No" + description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["9.3.9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitEmptyPasswords\s+no' + + # 9.3.10 Do Not Allow Users to Set Environment Options (Scored) + - id: 1128 + title: "Do Not Allow Users to Set Environment Options" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["9.3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitUserEnvironment\s+no' + + # 9.3.11 Use Only Approved Cipher in Counter Mode (Scored) + - id: 1129 + title: "Use Only Approved Cipher in Counter Mode" + description: "This variable limits the types of ciphers that SSH can use during communication." + rationale: "Based on research conducted at various institutions, it was determined that the symmetric portion of the SSH Transport Protocol (as described in RFC 4253) has security weaknesses that allowed recovery of up to 32 bits of plaintext from a block of ciphertext that was encrypted with the Cipher Block Chaining (CBD) method. From that research, new Counter mode algorithms (as described in RFC4344) were designed that are not vulnerable to these types of attacks and these algorithms are now recommended for standard use." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Ciphers aes128-ctr,aes192-ctr,aes256-ctr" + compliance: + - cis: ["9.3.11"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Ciphers\.+aes128-ctr' + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Ciphers\.+aes192-ctr' + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Ciphers\.+aes256-ctr' + + # 9.3.12 Set Idle Timeout Interval for User Login (Scored) + - id: 1130 + title: "Set Idle Timeout Interval for User Login" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening.. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: ClientAliveInterval 300 ClientAliveCountMax 0" + compliance: + - cis: ["9.3.12"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && n:ClientAliveInterval\s*\t*(\d+) compare <= 300' + - 'f:/etc/ssh/sshd_config -> !r:^# && r:ClientAliveCountMax\s+0' + + # 9.3.13 Limit Access via SSH (Scored) + - id: 1131 + title: "Limit Access via SSH" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " + compliance: + - cis: ["9.3.13"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:AllowUsers\s+\w+' + - 'f:/etc/ssh/sshd_config -> !r:^# && r:AllowGroups\s+\w+' + - 'f:/etc/ssh/sshd_config -> !r:^# && r:DenyUsers\s+\w+' + - 'f:/etc/ssh/sshd_config -> !r:^# && r:DenyGroups\s+\w+' + + # 9.3.14 Set SSH Banner (Scored) + - id: 1132 + title: "Set SSH Banner" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Consult with your legal department for the appropriate warning banner for your site." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["9.3.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Banner\s*\t*/etc/issue.net|Banner\s\t*/etc/issue' + + # 9.5 Restrict Access to the su Command (Scored) + - id: 1133 + title: "Restrict Access to the su Command" + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the wheel group to execute su." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "1) Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid 2) Once this is done, create a comma separated list of users in the wheel statement in the /etc/group file." + compliance: + - cis: ["9.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - "f:/etc/pam.d/su -> !r:^# && r:auth && r:required && r:pam_wheel.so && r:use_uid" + - "f:/etc/group -> !r:^# && r:wheel:" + + ###################################### + # 10 User Accounts and Environment + ###################################### + # 10.1.1 Set Password Expiration Days (Scored) + - id: 1134 + title: "Set Password Expiration Days" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 90 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to 90 in /etc/login.defs: PASS_MAX_DAYS 90 Modify user parameters for all users with a password set to match: # chage --maxdays 90 " + compliance: + - cis: ["10.1.1"] + - pci_dss: ["8.2.4"] + condition: all + rules: + - 'f:/etc/login.defs -> !r:^# && n:PASS_MAX_DAYS\s*\t*(\d+) compare <= 90' + + # 10.1.2 Set Password Change Minimum Number of Days (Scored) + - id: 1135 + title: "Set Password Change Minimum Number of Days" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7 Modify user parameters for all users with a password set to match: # chage --mindays 7 " + compliance: + - cis: ["10.1.2"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> !r:^# && n:PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + + # 10.1.3 Set Password Expiring Warning Days (Scored) + - id: 1136 + title: "Set Password Expiring Warning Days" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 " + compliance: + - cis: ["10.1.3"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> !r:^# && n:PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + # 10.3 Set Default Group for root Account (Scored) + - id: 1137 + title: "Set Default Group for root Account" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." + remediation: "# usermod -g 0 root" + compliance: + - cis: ["10.3"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' + + # 10.4 Set Default umask for Users (Scored) + - id: 1138 + title: "Set Default umask for Users" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files (.profile, .bashrc, etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system. Note: The directives in this section apply to bash and shell. If other shells are supported on the system, it is recommended that their configuration files also are checked." + remediation: "Edit the /etc/bash.bashrc and /etc/profile.d/cis.sh files (and the appropriate files for any other shell supported on your system) and add the following the UMASK parameter as shown: umask 077" + compliance: + - cis: ["10.4"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'c:grep -Rh ^umask[[:space:]][[:space:]]*077 /etc/profile.d/ -> !r:^# && r:umask\s*\t*077' + - 'f:/etc/bash.bashrc -> !r:^# && r:umask\s*\t*077' + + # 10.5 Lock Inactive User Accounts (Scored) + - id: 1139 + title: "Lock Inactive User Accounts" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 35 or more days be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "# useradd -D -f 35" + compliance: + - cis: ["10.5"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 35' + + ########################################## + # 11 Warning Banners + ########################################## + # 11.1 Set Warning Banner for Standard Login Services (Scored) + - id: 1140 + title: "Set Warning Banner for Standard Login Services" + description: "The contents of the /etc/issue file are displayed prior to the login prompt on the system's console and serial devices, and also prior to logins via telnet. The contents of the /etc/motd file is generally displayed after all successful logins, no matter where the user is logging in from, but is thought to be less useful because it only provides notification to the user after the machine has been accessed." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Consult with your organization's legal counsel for the appropriate wording for your specific organization." + remediation: '# touch /etc/motd # echo "Authorized uses only. All activity may be monitored and reported." > /etc/issue # echo "Authorized uses only. All activity may be monitored and reported." > /etc/issue.net # chown root:root /etc/motd # chmod 644 /etc/motd # chown root:root /etc/issue # chmod 644 /etc/issue # chown root:root /etc/issue.net # chmod 644 /etc/issue.net' + compliance: + - cis: ["11.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - "f:/etc/motd" + - "f:/etc/issue" + - "f:/etc/issue.net" + - "c:stat -L -c%u-%g-%a /etc/motd -> 0-0-644" + - "c:stat -L -c%u-%g-%a /etc/issue -> 0-0-644" + - "c:stat -L -c%u-%g-%a /etc/issue.net -> 0-0-644" + + # 11.2 Remove OS Information from Login Warning Banners (Scored) + - id: 1141 + title: "Remove OS Information from Login Warning Banners" + description: "Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform." + rationale: 'Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the "uname -a" command once they have logged in.' + remediation: "Edit the /etc/motd, /etc/issue and /etc/issue.net files and remove any lines containing \\m, \\r, \\s or \\v." + compliance: + - cis: ["11.2"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + + # 11.3 Ensure GDM login banner is configured (Scored) + - id: 1142 + title: "Ensure GDM login banner is configured" + description: "Debian defaults to using GNOME Display Manager for graphical login session management. KDM is also available as well as lightdm. Instructions are provided for GDM only, if you are using another display manager you will need to follow different procedures to audit and remediate this setting." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Consult with your organization's legal counsel for the appropriate wording for your specific organization." + remediation: "Uncomment or add the following lines to /etc/gdm3/greeter.gsettings : banner-message-enable=true banner-message-text=''" + compliance: + - cis: ["11.3"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - "f:/etc/gdm3/greeter.gsettings -> !r:^# && r:banner-message-enable=true" + - 'f:/etc/gdm3/greeter.gsettings -> !r:^# && r:banner-message-text=\.+' + + ############################################### + # 12 Verify System File Permissions + ############################################### + + # 12.1 Verify Permissions on /etc/passwd (Scored) + - id: 1143 + title: "Verify permissions on /etc/passwd" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "If the permissions of the /etc/passwd file are incorrect, run the following command to correct them: # /bin/chmod 644 /etc/passwd" + compliance: + - cis: ["12.1"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - "c:/bin/ls -l /etc/passwd -> r:-rw-r--r--" + + # 12.2 Verify Permissions on /etc/shadow (Scored) + - id: 1144 + title: "Verify permissions on /etc/shadow" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "If the permissions of the /etc/shadow file are incorrect, run the following command to correct them: # /bin/chmod 644 /etc/shadow" + compliance: + - cis: ["12.2"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - "c:/bin/ls -l /etc/shadow -> r:-rw-r-----" + + # 12.3 Verify Permissions on /etc/group (Scored) + - id: 1145 + title: "Verify permissions on /etc/group" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "If the permissions of the /etc/group file are incorrect, run the following command to correct them: # /bin/chmod 644 /etc/group" + compliance: + - cis: ["12.3"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - "c:/bin/ls -l /etc/group -> r:-rw-r--r--" + + # 12.4 Verify User/Group Ownership on /etc/passwd + - id: 1146 + title: "Verify User/Group Ownership on /etc/passwd" + description: "The /etc/passwd file contains a list of all the valid userIDs defined in the system, but not the passwords. The command below sets the owner and group of the file to root." + rationale: "The /etc/passwd file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "If the user and group ownership of the /etc/passwd file are incorrect, run the following command to correct them: # /bin/chown root:root /etc/passwd" + compliance: + - cis: ["12.4"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:/bin/ls -l /etc/passwd -> r:root\s*\t*root' + + # 12.5 Verify User/Group Ownership on /etc/shadow (Scored) + - id: 1147 + title: "Verify User/Group Ownership on /etc/shadow" + description: "The /etc/shadow file contains the one-way cipher text passwords for each user defined in the /etc/passwd file. The command below sets the user and group ownership of the file to root." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "If the ownership of the /etc/shadow file are incorrect, run the following command to correct them: # /bin/chown root:shadow /etc/shadow" + compliance: + - cis: ["12.5"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:/bin/ls -l /etc/shadow -> r:root\s*\t*shadow|root\s*\t*root' + + # 12.6 Verify User/Group Ownership on /etc/group (Scored) + - id: 1148 + title: "Verify User/Group Ownership on /etc/group" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "If the ownership of the /etc/group file are incorrect, run the following command to correct them: # /bin/chown root:root /etc/group" + compliance: + - cis: ["12.6"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:/bin/ls -l /etc/group -> r:root\s*\t*root' + + ############################################### + # 13 Review User and Group Settings + ############################################### + + # 13.1 Ensure Password Fields are Not Empty + - id: 1149 + title: "Ensure Password Fields are Not Empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # /usr/bin/passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["13.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + # 13.2 Verify No Legacy "+" Entries Exist in /etc/passwd File + - id: 1150 + title: 'Verify No Legacy "+" Entries Exist in /etc/passwd File' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Delete these entries if they exist." + compliance: + - cis: ["13.2"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/passwd -> !r:^# && r:^+:" + + # 13.3 Verify No Legacy "+" Entries Exist in /etc/shadow File + - id: 1151 + title: 'Verify No Legacy "+" Entries Exist in /etc/shadow File' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Delete these entries if they exist." + compliance: + - cis: ["13.3"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/shadow -> !r:^# && r:^+:" + + # 13.4 Verify No Legacy "+" Entries Exist in /etc/group File + - id: 1152 + title: 'Verify No Legacy "+" Entries Exist in /etc/group File' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Delete these entries if they exist." + compliance: + - cis: ["13.4"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/group -> !r:^# && r:^+:" + + # 13.5 Verify No UID 0 Accounts Exist Other Than root + - id: 1153 + title: "Verify No UID 0 Accounts Exist Other Than root" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 9.4 Restrict root Login to System Console." + remediation: "Delete any other entries that are displayed." + compliance: + - cis: ["13.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4", "CC8.1"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' + + # 13.20 Ensure shadow group is empty + - id: 1154 + title: "Ensure shadow group is empty" + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." + compliance: + - cis: ["13.20"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/etc/ruleset/sca/debian/cis_debian8.yml b/etc/ruleset/sca/debian/cis_debian8.yml new file mode 100644 index 0000000000..a7e35e054b --- /dev/null +++ b/etc/ruleset/sca/debian/cis_debian8.yml @@ -0,0 +1,2997 @@ +# Security Configuration Assessment +# CIS Checks for Debian Linux 8 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Debian Linux 8 Benchmark v2.0.0 - 12-28-2018 + +policy: + id: "cis_debian8" + file: "cis_debian8.yml" + name: "CIS Debian Linux 8 Benchmark v2.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 8." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Debian version" + description: "Requirements for running the SCA scan against Debian/Ubuntu." + condition: all + rules: + - "f:/etc/debian_version" + - "f:/proc/sys/kernel/ostype -> Linux" + +checks: + # 1.1.1 Disable unused filesystems + - id: 1500 + title: "Ensure mounting of cramfs filesystems is disabled" + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install cramfs /bin/true. 2) Run the following command to unload the cramfs module: # rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:^install /bin/true" + - "not c:lsmod -> r:cramfs" + + - id: 1501 + title: "Ensure mounting of freevxfs filesystems is disabled" + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install freevxfs /bin/true. 2) Run the following command to unload the freevxfs module: # rmmod freevxfs" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v freevxfs -> r:^install /bin/true" + - "not c:lsmod -> r:freevxfs" + + - id: 1502 + title: "Ensure mounting of jffs2 filesystems is disabled" + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install jffs2 /bin/true. 2) Run the following command to unload the jffs2 module: # rmmod jffs2" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v jffs2 -> r:^install /bin/true" + - "not c:lsmod -> r:jffs2" + + - id: 1503 + title: "Ensure mounting of hfs filesystems is disabled" + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install hfs /bin/true. 2) Run the following command to unload the hfs module: # rmmod hfs" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v hfs -> r:^install /bin/true" + - "not c:lsmod -> r:hfs" + + - id: 1504 + title: "Ensure mounting of hfsplus filesystems is disabled" + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install hfsplus /bin/true. 2) Run the following command to unload the hfsplus module: # rmmod hfsplus" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v hfsplus -> r:^install /bin/true" + - "not c:lsmod -> r:hfsplus" + + - id: 1505 + title: "Ensure mounting of squashfs filesystems is disabled" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install squashfs /bin/true. 2) Run the following command to unload the squashfs module: # rmmod squashfs" + compliance: + - cis: ["1.1.1.6"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:^install /bin/true" + - "not c:lsmod -> r:squashfs" + + - id: 1506 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install udf /bin/true. 2) Run the following command to unload the udf module: # rmmod udf" + compliance: + - cis: ["1.1.1.7"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v udf -> r:^install /bin/true" + - "not c:lsmod -> r:udf" + + # 1.1.2 Filesystem Configuration + - id: 1507 + title: "Ensure /tmp is configured" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "Configure /etc/fstab as appropriate or Run the following commands to enable systemd /tmp mounting: systemctl umask tmp.mount; systemctl enable tmp.mount. Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount." + compliance: + - cis: ["1.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + - "c:systemctl is-enabled tmp.mount -> enabled" + + - id: 1508 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + - id: 1509 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nosuid /tmp" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + - id: 1510 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["1.1.5"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + - id: 1511 + title: "Ensure separate partition exists for /var/tmp" + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + - id: 1512 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nodev /var/tmp" + compliance: + - cis: ["1.1.7"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + + - id: 1513 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" + compliance: + - cis: ["1.1.8"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + - id: 1514 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" + compliance: + - cis: ["1.1.9"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + - id: 1515 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["1.1.10"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + - id: 1516 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + - id: 1517 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + - id: 1518 + title: "Ensure nodev option set on /home partition" + description: "When set on a file system, this option prevents character and block special devices from being defined, or if they exist, from being used as character and block special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). See the fstab(5) manual page for more information. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.13"] + - cis_csc: ["13", "15.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + - id: 1519 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /run/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + - id: 1520 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.15"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + - id: 1521 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec /run/shm" + compliance: + - cis: ["1.1.16"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + - id: 1522 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." + remediation: "Disable autofs: # update-rc.d autofs disable" + compliance: + - cis: ["1.1.21"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled autofs -> enabled" + + # 1.3 Filesystem Integrity Checking + - id: 1523 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Install AIDE: # apt-get install aide aide-common. Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: # aideinit" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:dpkg -s aide -> r:install ok installed" + + - id: 1524 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Execute the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check. Note: The checking in this instance occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy." + compliance: + - cis: ["1.3.2"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:crontab -u root -l -> !r:^# && r:/usr/bin/aide && r:--check" + + # 1.4 Secure Boot Settings + - id: 1525 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually grub.cfg stored in /boot/grub." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: chown root:root /boot/grub/grub.cfg, chmod og-rwx /boot/grub/grub.cfg" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /boot/grub/grub.cfg -> r:Access:\s*\(0\w00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 1526 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: '1) Create an encrypted password with grub-md5-crypt: # grub-mkpasswd-pbkdf2 Enter password: Reenter password: Your PBKDF2 is 2) Add the following into /etc/grub.d/00_header or a custom /etc/grub.d configuration file: cat < EOF Unless the --unrestricted option is added to CLASS in /etc/grub.d/10_linux a password will be required to boot in addition to editing boot parameters: CLASS="--class gnu-linux --class gnu --class os --unrestricted" 3) Run the following to update the grub configuration: # update-grub' + compliance: + - cis: ["1.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + - id: 1527 + title: "Ensure authentication required for single user mode" + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" + compliance: + - cis: ["1.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/shadow -> r:^root:*:|^root:!:" + + # 1.5 Additional Process Hardening + - id: 1528 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to the /etc/security/limits.conf file. * hard core 0 Add the following line to the /etc/sysctl.conf file: fs.suid_dumpable = 0. Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl fs.suid_dumpable -> r:=\s*\t*0$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:=\s*\t*0$' + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + + - id: 1529 + title: "Ensure XD/NX support is enabled" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.5.2"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sh -c "dmesg | grep NX" -> r:NX \(Execute Disable\) protection: active' + + - id: 1530 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Add the following line to the /etc/sysctl.conf file: kernel.randomize_va_space = 2 and run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:=\s*\t*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' + + - id: 1531 + title: "Ensure prelink is disabled" + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal and uninstall prelink: prelink -ua && apt-get remove prelink" + compliance: + - cis: ["1.5.4"] + - cis_csc: ["3.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s prelink -> r:install ok installed" + + # 1.6 Configure SELinux + + - id: 1532 + title: "Ensure SELinux is not disabled in bootloader configuration" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/grub and remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX="" || Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["1.6.1.1"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:linux\.*selinux=0|linux\.*enforcing=0' + + - id: 1533 + title: "Ensure the SELinux state is enforcing" + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing" + compliance: + - cis: ["1.6.1.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s+enabled$' + - 'c:sestatus -> r:^Current mode:\s+enforcing$' + - 'c:sestatus -> r:^Mode from config file:\s+enforcing$' + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + - id: 1534 + title: "Ensure SELinux policy is configured" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + compliance: + - cis: ["1.6.1.3"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+targeted$' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + - id: 1535 + title: "Ensure no unconfined daemons exist" + description: "Daemons that are not defined in SELinux policy will inherit the security context of their parent process." + rationale: "Since daemons are launched and descend from the init process, they will inherit the security context label initrc_t . This could cause the unintended consequence of giving the process more permission than it requires." + remediation: "Investigate any unconfined daemons found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.4"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:ps -eZ -> r:initrc && !r:tr|ps|egrep|bash|awk" + + - id: 1536 + title: "Ensure AppArmor is enabled in the bootloader configuration" + description: "Configure AppArmor to be enabled at boot time and verify that it has not been overwrittenby the bootloader boot parameters." + rationale: "AppArmor must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/grub and add the appermor=1 and security=apparmor parameters to the GRUB_CMDLINE_LINUX= line GRUB_CMDLINE_LINUX="apparmor=1 security=apparmor" update the grub configuration # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings.' + compliance: + - cis: ["1.6.2.1"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:apparmor=1' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:security=apparmor' + + - id: 1537 + title: "Ensure all AppArmor Profiles are enforcing" + description: "AppArmor profiles define what resources applicatons are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.6.2.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:apparmor_status -> n:^(\d+)\s*profiles are loaded compare > 0' + - 'c:apparmor_status -> r:^0\s*processes are in complain mode' + - 'c:apparmor_status -> r:^0\s*processes are unconfined' + + - id: 1538 + title: "Ensure SELinux or AppArmor are installed" + description: "SELinux and AppArmor provide Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run one of the following commands to install SELinux or apparmor: # apt-get install selinux-basics Or: # apt-get install apparmor apparmor-profiles apparmor-utils" + compliance: + - cis: ["1.6.3"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - "c:dpkg -s selinux-basics -> r:install ok installed" + - "c:dpkg -s apparmor -> r:install ok installed" + + # 1.7 Warning Banners + - id: 1539 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v." + compliance: + - cis: ["1.7.1.1"] + - cis_csc: ["13"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + - id: 1540 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m,\\r,\\s, or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.7.1.2"] + - cis_csc: ["13"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + - id: 1541 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.7.1.3"] + - cis_csc: ["13"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + - id: 1542 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 1543 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 1544 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 1545 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add: [org/gnome/login-screen], banner-message-enable=true, banner-message-text='Authorized uses only. All activity may be monitored and reported.'" + compliance: + - cis: ["1.7.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/gdm3/greeter.dconf-defaults -> r:^[org/gnome/login-screen]" + - "f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-enable=true" + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-text=\.+' + + - id: 1546 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. Notes: Site policy may mandate a testing period before install onto production systems for available updates." + compliance: + - cis: ["1.8"] + - cis_csc: ["4.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6", "SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: none + rules: + - "c:apt-get -s upgrade -> r:^The following packages will be upgraded" + + # 2 Services + - id: 1547 + title: "Ensure xinetd is not installed" + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." + remediation: "Run the following command to disable xinetd: # apt-get remove xinetd" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s xinetd -> r:install ok installed" + + - id: 1548 + title: "Ensure inetd is not installed" + description: "The inetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no inetd services required, it is recommended that the daemon be removed." + remediation: "Run the following commands to uninstall openbsd-inetd and inetutils-inetd: # apt-get remove openbsd-inetd # apt-get remove inetutils-inetd" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s openbsd-inetd -> r:install ok installed" + - "c:dpkg -s inetutils-inetd -> r:install ok installed" + + - id: 1549 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems or virtual systems where host based time synchronization is not available install NTP or chrony using one of the following commands: # apt-get install ntp # apt-get install chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization." + compliance: + - cis: ["2.2.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "c:dpkg -s ntp -> r:install ok installed" + - "c:dpkg -s chrony -> r:install ok installed" + + - id: 1550 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery . Add or edit server or pool lines to /etc/ntp.conf as appropriate: server . Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file: RUNASUSER=ntp" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://www.ntp.org/ + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/init.d/ntp -> r:^RUNASUSER\s*\t*=\s*\t*ntp' + + - id: 1551 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system." + remediation: "Add or edit server or pool lines to /etc/chrony/chrony.conf as appropriate: server " + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony/chrony.conf -> r:^server\.+|^pool\.+' + + # 2.2.2 Ensure the X Window system is not installed (Scored) + - id: 1552 + title: "Ensure the X Window system is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: apt-get remove xserver-xorg*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:dpkg -l xserver-xorg-core* -> r:^\wi\s*xserver-xorg' + + - id: 1553 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attach surface." + remediation: "Run the following command to disable avahi-daemon: # systemctl disable avahi-daemon" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled avahi-daemon -> enabled" + + - id: 1554 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups: # systemctl disable cups" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.cups.org + condition: none + rules: + - "c:systemctl is-enabled cups -> enabled" + + - id: 1555 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following commands to disable dhcpd: # systemctl disable isc-dhcp-server # systemctl disable isc-dhcp-server6" + references: + - https://www.isc.org/dhcp/ + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled isc-dhcp-server -> enabled" + - "c:systemctl is-enabled isc-dhcp-server6 -> enabled" + + - id: 1556 + title: "Ensure LDAP server is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # systemctl disable slapd" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.openldap.org + condition: none + rules: + - "c:systemctl is-enabled slapd -> enabled" + + - id: 1557 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs and rpcbind: # systemctl disable nfs-server # systemctl disable rpcbind" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled nfs-server -> enabled" + - "c:systemctl is-enabled rpcbind -> enabled" + + - id: 1558 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable named: # systemctl disable bind9" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled bind9 -> enabled" + + - id: 1559 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # systemctl disable vsftpd" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled vsftpd -> enabled" + + - id: 1560 + title: "Ensure HTTP Server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable apache2: # systemctl disable apache2" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled apache2 -> enabled" + + - id: 1561 + title: "Ensure IMAP and POP3 server is not enabled" + description: "exim is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following commands to remove exim: # apt-get remove exim4; # apt-get purge exim4" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s exim4 -> r:install ok installed" + + - id: 1562 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable smbd: # systemctl disable smbd" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled smbd -> enabled" + + - id: 1563 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # systemctl disable squid" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled squid -> enabled" + + - id: 1564 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # systemctl disable snmpd" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled snmpd -> enabled" + + - id: 1565 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only . Restart postfix: # systemctl restart postfix" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - tsc: ["CC5.2", "CC6.4", "CC6.6", "CC6.7"] + condition: none + rules: + - 'c:netstat -an -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.*LISTEN' + + - id: 1566 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # systemctl disable rsync" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled rsync -> enabled" + + - id: 1567 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable nis: # systemctl disable nis" + compliance: + - cis: ["2.2.17"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled nis -> enabled" + + - id: 1568 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Uninstall the nis package: # apt-get remove nis" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s nis -> r:install ok installed" + + - id: 1569 + title: "Ensure rsh client is not installed" + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rshpackage removes the clients for rsh, rcpand rlogin." + remediation: "Run the following command to uninstall rsh: apt-get remove rsh-client rsh-redone-client" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["3.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s rsh-client -> r:install ok installed" + - "c:dpkg -s rsh-redone-client -> r:install ok installed" + + - id: 1570 + title: "Ensure talk client is not installed" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talkclient, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk: apt-get remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s talk -> r:install ok installed" + + - id: 1571 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet: # apt-get remove telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["3.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s telnet -> r:install ok installed" + + - id: 1572 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Uninstall ldap-utils using the appropriate package manager or manual installation: # apt-get remove ldap-utils" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s ldap-utils -> r:install ok installed" + + # 3 Network Configuration + - id: 1573 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not." + rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0 net.ipv6.conf.all.forwarding = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv6.conf.all.forwarding=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.forwarding /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' + + - id: 1574 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the net.ipv4.conf.all.send_redirects and net.ipv4.conf.default.send_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.send_redirects=0 net.ipv4.conf.default.send_redirects=0 Modify active kernel parameters to match: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + - id: 1575 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv6.conf.all.accept_source_route=0 # sysctl -w net.ipv6.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0$' + + - id: 1576 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + + - id: 1577 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + - id: 1578 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + - id: 1579 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + - id: 1580 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + - id: 1581 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing. + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + - id: 1582 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + - id: 1583 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the systems ability to accept router advertisements" + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.9"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + + - id: 1584 + title: "Install TCP Wrappers" + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Install tcpd : # apt-get install tcpd Notes: To verify if a service supports TCP Wrappers, run the following command: # ldd | grep libwrap.so If there is any output, then the service supports TCP Wrappers." + compliance: + - cis: ["3.3.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "c:dpkg -s tcpd -> r:install ok installed" + + - id: 1585 + title: "Ensure /etc/hosts.allow is configured" + description: "The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." + remediation: 'Run the following command to create /etc/hosts.allow: # echo "ALL: /, /, ..." >/etc/hosts.allow. Where each / combination (for example, "192.168.1.0/255.255.255.0") represents one network block in use by your organization that requires access to this system.' + compliance: + - cis: ["3.3.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "f:/etc/hosts.allow" + + - id: 1586 + title: "Ensure /etc/hosts.deny is configured" + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the server." + remediation: 'Run the following command to create /etc/hosts.deny: # echo "ALL: ALL" >> /etc/hosts.deny' + compliance: + - cis: ["3.3.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "f:/etc/hosts.deny" + - 'f:/etc/hosts.deny -> r:^ALL:\s*ALL' + + - id: 1587 + title: "Verify permissions on /etc/hosts.allow" + description: "The /etc/hosts.allow file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.allow : # chown root:root /etc/hosts.allow # chmod 644 /etc/hosts.allow" + compliance: + - cis: ["3.3.4"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/hosts.allow -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + + - id: 1588 + title: "Verify permissions on /etc/hosts.deny" + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.deny : # chown root:root /etc/hosts.deny # chmod 644 /etc/hosts.deny" + compliance: + - cis: ["3.3.5"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/hosts.deny -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + + # 3.4 Uncommon Network Protocols + + - id: 1589 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in- sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/dccp.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v dccp -> r:install /bin/true" + - "c:lsmod -> r:dccp" + + - id: 1590 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/sctp.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.4.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v sctp -> r:install /bin/true" + - "c:lsmod -> r:sctp" + + - id: 1591 + title: "Ensure RDS is disabled" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/rds.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v rds -> r:install /bin/true" + - "c:lsmod -> r:rds" + + - id: 1592 + title: "Ensure TIPC is disabled" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/tipc.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v tipc -> r:install /bin/true" + - "c:lsmod -> r:tipc" + + # 3.5 Firewall configuration + + - id: 1593 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + compliance: + - cis: ["3.5.1.1"] + - cis_csc: ["9.1"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:iptables -L -> r:^Chain INPUT && r:policy DROP" + - "c:iptables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:iptables -L -> r:^Chain OUTPUT && r:policy DROP" + + - id: 1594 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.5.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + - id: 1595 + title: "Ensure IPv6 default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + compliance: + - cis: ["3.5.2.1"] + - cis_csc: ["9.1"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:ip6tables -L -> r:^Chain INPUT && r:policy DROP" + - "c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP" + + - id: 1596 + title: "Ensure IPv6 loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP" + compliance: + - cis: ["3.5.2.2"] + - cis_csc: ["9.1"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + - id: 1597 + title: "Ensure iptables is installed" + description: "iptables allows configuration of the IPv4 tables in the linux kernel and the rules stored within them. Most firewall configuration utilities operate as a front end to iptables." + rationale: "iptables is required for firewall management and configuration." + remediation: "Run the following command to install iptables: # apt-get install iptables" + compliance: + - cis: ["3.5.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:dpkg -s iptables -> r:install ok installed" + + # 3.7 Disable IPv6 (Not Scored) + - id: 1598 + title: "Disable IPv6" + description: "Although IPv6 has many advantages over IPv4, few organizations have implemented IPv6." + rationale: "If IPv6 is not to be used, it is recommended that it be disabled to reduce the attack surface of the system." + remediation: 'Edit /etc/default/grub and add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX="ipv6.disable=1" Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["3.7"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:ipv6.disable=1' + + # 4 Logging and Auditing + + - id: 1599 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = Notes: The max_log_file parameter is measured in megabytes." + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.3"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' + + - id: 1600 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.3"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*\t*=\s*\t*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*\t*=\s*\t*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*\t*=\s*\t*halt' + + - id: 1601 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.3"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' + + - id: 1602 + title: "Ensure auditd service is enabled" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl enable auditd" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1", "10.7"] + - tsc: [CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> enabled" + + - id: 1603 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub or lilo so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: '1) Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX="audit=1" 2) Run the following command to update the grub2 configuration: # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings.' + compliance: + - cis: ["4.1.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.2.6", "10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:audit=1' + + - id: 1604 + title: "Ensure events that modify date and time information are collected" + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier "time-change"' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time- change | -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change. For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change | -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change | -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["3.6"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.3", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change" + + - id: 1605 + title: "Ensure events that modify user/group information are collected" + description: 'Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/group -p wa -k identity | -w /etc/passwd -p wa -k identity | -w /etc/gshadow -p wa -k identity | -w /etc/shadow -p wa -k identity | -w /etc/security/opasswd -p wa -k identity Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/group && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity" + + - id: 1606 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre- login), /etc/hosts (file containing host names and associated IP addresses) and /etc/sysconfig/network (directory containing network interface scripts and configurations) files." + rationale: 'Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier "system-locale."' + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale | -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale | -w /etc/issue -p wa -k system-locale | -w /etc/issue.net -p wa -k system-locale | -w /etc/hosts -p wa -k system-locale | -w /etc/sysconfig/network -p wa -k system-locale Notes: /etc/sysconfig/network is common to Red Hat and SUSE based distributions. You should expand or replace this coverage to any network configuration files on your system such as /etc/network on Debian based distributions. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.6"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale" + + - id: 1607 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor SELinux/AppArmor mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux or /etc/apparmor and /etc/apparmor.d directories." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "On systems using SELinux add the following line to the /etc/audit/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy | -w /usr/share/selinux/ -p wa -k MAC-policy On systems using AppArmor add the following line to the /etc/audit/audit.rules file: -w /etc/apparmor/ -p wa -k MAC-policy | -w /etc/apparmor.d/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/selinux/ && r:-p wa && r:-k MAC-policy" + - "f:/etc/audit/audit.rules -> r:^-w && r:/usr/share/selinux/ && r:-p wa && r:-k MAC-policy" + + - id: 1608 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/faillog -p wa -k logins | -w /var/log/lastlog -p wa -k logins | -w /var/log/tallylog -p wa -k logins. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5", "16.10", "16.4"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/faillog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/tallylog && r:-p wa && r:-k logins" + + - id: 1609 + title: "Ensure session initiation information is collected" + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier "session." The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier "logins."' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/run/utmp -p wa -k session | -w /var/log/wtmp -p wa -k logins | -w /var/log/btmp -p wa -k logins. Notes: The last command can be used to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.9"] + - cis_csc: ["5.5", "16.10", "16.4"] + - pci_dss: ["10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k logins" + + - id: 1610 + title: "Ensure discretionary access control permission modification events are collected" + description: 'Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier "perm_mod."' + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.10"] + - cis_csc: ["3.6"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + + - id: 1611 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: 'Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier "access."' + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.11"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access" + + - id: 1612 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts | -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts" + + - id: 1613 + title: "Ensure file deletion events by users are collected" + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete | -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.14"] + - cis_csc: ["13"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete" + + - id: 1614 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: 'Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier "scope."' + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope | -w /etc/sudoers.d/ -p wa -k scope. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.15"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers.d/ && r:-p wa && r:-k scope" + + - id: 1615 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions. Notes: The system must be configured with sudisabled (See Item 5.6 Ensure access to the su command is restricted) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.16"] + - cis_csc: ["5.1", "5.5"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14", "AC.6", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/sudo.log && r:-p wa && r:-k actions" + + - id: 1616 + title: "Ensure kernel module loading and unloading is collected" + description: 'Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of "modules".' + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b64 -S init_module -S delete_module -k modules. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.17"] + - cis_csc: ["3"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/sbin/insmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/sbin/rmmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/sbin/modprobe && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S init_module && r:-S delete_module && r:-k modules" + + - id: 1617 + title: "Ensure the audit configuration is immutable" + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following line to the end of the /etc/audit/audit.rules file: -e 2. Notes: This setting will ensure reloading the auditd config to set active settings requires a system reboot." + compliance: + - cis: ["4.1.18"] + - cis_csc: ["3", "6"] + - pci_dss: ["10.5"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - 'f:/etc/audit/audit.rules -> r:^\s*\t*-e 2$' + + - id: 1618 + title: "Ensure rsyslog Service is enabled" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system will not have a syslog service running." + remediation: "Run the following command to enable rsyslog: # systemctl enable rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> enabled" + + # 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 1619 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1", "10.5.2"] + - nist_800_53: ["CM.1", "AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\. -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + - id: 1620 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host): *.* @@loghost.example.com. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - rsyslog.conf(5) man page + condition: all + rules: + - 'c:grep -Rh ^*.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^*.* @@\.+' + + - id: 1621 + title: "Ensure remote rsyslog messages are only accepted on designated log hosts" + description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." + rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." + remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines:$ModLoad imtcp & $InputTCPServerRun 514. For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["9.1"] + - pci_dss: ["10.5.1"] + references: + - rsyslog.conf(8) man page + condition: all + rules: + - 'c:grep -Rh ^\$ModLoad[[:space:]]*imtcp /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$ModLoad\s*\t*imtcp' + - 'c:grep -Rh ^\$InputTCPServerRun /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$InputTCPServerRun\s*\t*514' + + # 4.2.2.1 Ensure syslog-ng service is enabled (Scored) + - id: 1622 + title: "Ensure syslog-ng service is enabled" + description: "Once the syslog-ng package is installed it needs to be activated." + rationale: "If the syslog-ng service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable rsyslog : # systemctl enable syslog-ng" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "c:systemctl is-enabled syslog-ng -> enabled" + + # 4.2.2.3 Ensure syslog-ng default file permissions configured (Scored) + - id: 1623 + title: "Ensure syslog-ng default file permissions configured" + description: "syslog-ng will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive syslog-ng data is archived and protected." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf and set perm option to 0640 or more restrictive: options { chain_hostnames(off); flush_lines(0); perm(0640); stats_freq(3600); threaded(yes); };" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1", "10.5.2"] + - nist_800_53: ["CM.1", "AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:^options && r:perm\(06\d0\)|perm\(04\d0\)|perm\(02\d0\)|perm\(00\d0\) && r:perm\(0\d40\)|perm\(0\d00\)' + + # 4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host (Not Scored) + - id: 1624 + title: "Ensure syslog-ng is configured to send logs to a remote log host" + description: "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp("logfile.example.com" port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the rsyslogd configuration: # pkill -HUP syslog-ng' + compliance: + - cis: ["4.2.2.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/syslog-ng/syslog-ng.conf -> r:destination logserver" + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:log\.+source\.+destination' + + # 4.2.3 Ensure rsyslog or syslog-ng is installed (Scored) + - id: 1625 + title: "Ensure rsyslog or syslog-ng is installed" + description: "The rsyslog and syslog-ng software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog or syslog-ng using one of the following commands: # apt-get install rsyslog # apt-get install syslog-ng" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: any + rules: + - "c:dpkg -s rsyslog -> r:install ok installed" + - "c:dpkg -s syslog-ng -> r:install ok installed" + + # 5 Access, Authentication and Authorization + - id: 1626 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: systemctl enable cron" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled cron -> enabled" + + # 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 1627 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access: \(0\d00/\w\w\w-------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 1628 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 1629 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 1630 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 1631 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 1632 + title: "Ensure permissions on /etc/cron.d are configured" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + - id: 1633 + title: "Ensure at/cron is restricted to authorized users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/cron.allow" + - "f:/etc/at.allow" + - "not f:/etc/cron.deny" + - "not f:/etc/at.deny" + - 'c:stat -L -c%u-%g-%a /etc/cron.allow -> r:^0-0-\d00' + - 'c:stat -L -c%u-%g-%a /etc/at.allow -> r:^0-0-\d00' + + # 5.2 SSH Server Configuration + + - id: 1634 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non- privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L -c%u-%g-%a /etc/ssh/sshd_config -> r:^0-0-\d00' + + - id: 1635 + title: "Ensure SSH Protocol is set to 2" + description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.4"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:Protocol\s*2' + + - id: 1636 + title: "Ensure SSH LogLevel is appropriate" + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE or LogLevel INFO" + references: + - https://www.ssh.com/ssh/sshd_config/ + compliance: + - cis: ["5.2.5"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:LogLevel\s+INFO|LogLevel\s+VERBOSE' + + - id: 1637 + title: "Ensure SSH X11 forwarding is disabled" + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_configfile to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["16"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + reference: + - "https://www.ssh.com/ssh/sshd_config/" + condition: all + rules: + - 'c:sshd -T -> r:X11Forwarding\s+no' + + - id: 1638 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> n:MaxAuthTries\s*\t*(\d+) compare <= 4' + + - id: 1639 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhostsand .shostsfiles will not be used in RhostsRSAAuthenticationor HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:IgnoreRhosts\s+yes' + + - id: 1640 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:HostbasedAuthentication\s+no' + + - id: 1641 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["5.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitRootLogin\s+no' + + - id: 1642 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitEmptyPasswords\s+no' + + - id: 1643 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -> r:PermitUserEnvironment\s+no' + + # 5.2.13 Ensure only strong ciphers are used (Scored) + - id: 1644 + title: "Ensure only strong ciphers are used" + description: "This variable limits the ciphers that SSH can use during communication." + rationale: 'Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a "Sweet32" attack The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involving LSB values, aka the "Bar Mitzvah" issue The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher is used, does not properly initialize memory for a MAC context data structure, which allows remote authenticated users to bypass intended ForceCommand and login-shell restrictions via packet data that provides a crafted callback address' + remediation: "Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers Example: Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - "https://nvd.nist.gov/vuln/detail/CVE-2016-2183" + - "https://nvd.nist.gov/vuln/detail/CVE-2015-2808" + - "https://nvd.nist.gov/vuln/detail/CVE-2008-5161" + - "https://nvd.nist.gov/vuln/detail/CVE-2013-4548" + - "https://www.kb.cert.org/vuls/id/565052" + - "https://www.openssh.com/txt/cbc.adv" + condition: none + rules: + - "c:sshd -T -> r:ciphers && r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc|arcfour|arcfour128|arcfour256|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se" + + # 5.2.14 Ensure only sytrong MAC algorithms are used (Scored) + - id: 1645 + title: "Ensure only strong MAC algorithms are used" + description: "This variable limits the types of MAC algorithms that SSH can use during communication." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information" + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2- 512,hmac-sha2-256" + compliance: + - cis: ["5.2.14"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - "http://www.mitls.org/pages/attacks/SLOTH" + condition: none + rules: + - "c:sshd -T -> r:MACs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com" + + # 5.2.15 Ensure only strong Key Exchange algorithms are used (Scored) + - id: 1646 + title: "Ensure only strong Key Exchange algorithms are used" + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received" + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks" + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms Example: KexAlgorithms curve25519-sha256@libssh.org,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: none + rules: + - "c:sshd -T -> r:kexalgorithms && r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1" + + - id: 1647 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 ClientAliveCountMax 0" + compliance: + - cis: ["5.2.16"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'c:sshd -T -> n:ClientAliveInterval\s*\t*(\d+) compare <= 300 && n:ClientAliveInterval\s*\t*(\d+) compare != 0' + - 'c:sshd -T -> n:ClientAliveCountMax\s*\t*(\d+) compare <= 3' + + # 5.2.17 Ensure SSH LoginGraceTime is set to one minute or less (Scored) + - id: 1648 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.17"] + - cis_csc: ["16"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'c:sshd -T -> n:LoginGraceTime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + + - id: 1649 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " + compliance: + - cis: ["5.2.18"] + - cis_csc: ["5.1", "5.8"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'c:sshd -T -> r:AllowUsers\s+\w+|AllowGroups\s+\w+|DenyUsers\s+\w+|DenyGroups\s+\w+' + + - id: 1650 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:Banner\s*\t*/etc/issue.net' + + # 5.3 Configure PAM + + - id: 1651 + title: "Ensure password creation requirements are configured" + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options: - retry=3 (Allow 3 tries before sending back a failure). The following options are set in the /etc/security/pwquality.conf file: - minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 (The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies.)" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "1) Run the following command to install the pam_pwquality module: apt-get install libpam-pwquality 2) Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so retry=3 3) Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1. Notes: Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more. Settings in /etc/security/pwquality.conf must use spaces around the = symbol." + compliance: + - cis: ["5.3.1"] + - cis_csc: ["5.7", "16.12"] + - pci_dss: ["8.2.3"] + condition: all + rules: + - "c:dpkg -s libpam-pwquality -> r:install ok installed" + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*requisite\s*\t*pam_pwquality.so\s*\t*retry=\d' + - 'f:/etc/security/pwquality.conf -> !r:^# && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - "f:/etc/security/pwquality.conf -> !r:^# && r:dcredit" + - "f:/etc/security/pwquality.conf -> !r:^# && r:ucredit" + - "f:/etc/security/pwquality.conf -> !r:^# && r:ocredit" + - "f:/etc/security/pwquality.conf -> !r:^# && r:lcredit" + + - id: 1652 + title: "Ensure lockout for failed password attempts is configured" + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: 'Edit the /etc/pam.d/common-auth file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900. Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user. Notes: Use of the "audit" keyword may log credentials in the case of user error during authentication. This risk should be evaluated in the context of the site policies of your organization.' + compliance: + - cis: ["5.3.2"] + - cis_csc: ["16.7"] + - pci_dss: ["8.2.5"] + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d+ && r:unlock_time\s*=\s*\d+' + + - id: 1653 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown: password required pam_pwhistory.so remember=5. Notes: Additional module options may be set, recommendation only covers those listed here." + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare < 5' + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && !r:remember' + + # 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 1654 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the sha512 option for pam_unix.so as shown: password [success=1 default=ignore] pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.14"] + - pci_dss: ["3.6.1"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> r:^password\.+pam_unix.so && !r:sha512' + + # 5.4 User Accounts and Environment + + - id: 1655 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs: PASS_MAX_DAYS 90. Modify user parameters for all users with a password set to match: # chage --maxdays 90 . Notes: You can also check this setting in /etc/shadow directly. The 5th field should be 365 or less for all users with a password. A value of -1 will disable password expiration. Additionally the password expiration must be greater than the minimum days between password changes or users will be unable to change their password." + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare < 0' + + - id: 1656 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7. Modify user parameters for all users with a password set to match: # chage --mindays 7 . Notes: You can also check this setting in /etc/shadow directly. The 4th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + + - id: 1657 + title: "Ensure password expiration warning days is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7. Modify user parameters for all users with a password set to match: # chage --warndays 7 . Notes: You can also check this setting in /etc/shadow directly. The 6th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + - id: 1658 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30. Modify user parameters for all users with a password set to match: # chage --inactive 30 . Notes: You can also check this setting in /etc/shadow directly. The 7th field should be 30 or less for all users with a password. A value of -1 would disable this setting." + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - 'not f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare < 0' + + - id: 1659 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: # usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["5"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' + + # 5.4.4 Ensure default user umask is 027 or more restrictive (Scored) + - id: 1660 + title: "Ensure default user umask is 027 or more restrictive" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bash.bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["13"] + - pci_dss: ["3.6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + # 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 1661 + title: "Ensure default user shell timeout is 900 seconds or less" + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bashrc, /etc/profile files, and /etc/profile.d*.sh (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not d:/etc/profile.d -> .sh -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/bash.bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'd:/etc/profile.d -> .sh -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/bash.bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + - id: 1662 + title: "Ensure access to the su command is restricted" + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the sudo group to execute su." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "1) Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so 2) Create a comma separated list of users in the sudo statement in the /etc/group file: sudo:x:10:root, Notes: The use_uid option to pam_wheel.so is a no-op on debian based systems. It is acceptable but not required as these systems use its behavior as default." + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^# && r:auth\s*\t*required\s*\t*pam_wheel.so' + - 'f:/etc/group -> !r:^# && r:sudo:\w+:\d+:\.' + + # 6.1.2 Ensure permissions on /etc/passwd are configured (Scored) + - id: 1663 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.3 Ensure permissions on /etc/shadow are configured (Scored) + - id: 1664 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following commands to set permissions on /etc/shadow : # chown root:shadow /etc/shadow # chmod o-rwx,g-wx /etc/shadow" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/shadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + # 6.1.4 Configure /etc/group permissions (Scored) + - id: 1665 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.5 Ensure permissions on /etc/gshadow are configured (Scored) + - id: 1666 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following commands to set permissions on /etc/gshadow : # chown root:shadow /etc/gshadow # chmod o-rwx,g-wx /etc/gshadow" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/gshadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + # 6.1.6 Ensure permissions on /etc/passwd- are configured (Scored) + - id: 1667 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod u-x,go-wx /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/passwd- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.7 Ensure permissions on /etc/shadow- are configured (Scored) + - id: 1668 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/shadow- : # chown root:root /etc/shadow- # chown root:shadow /etc/shadow- # chmod o-rwx,g-rw /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/shadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\) && r:Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)|Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.8 Configure /etc/group- permissions (Scored) + - id: 1669 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod u-x,go-wx /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.9 Ensure permissions on /etc/gshadow- are configured (Scored) + - id: 1670 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chown root:shadow /etc/gshadow- # chmod o-rwx,g-wx /etc/gshadow-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/gshadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\) && r:Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)|Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.2 User and Group Settings + + - id: 1671 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + - id: 1672 + title: 'Ensure no legacy "+" entries exist in /etc/passwd' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/passwd -> !r:^# && r:^+:" + + - id: 1673 + title: 'Ensure no legacy "+" entries exist in /etc/shadow' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.3"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/shadow -> !r:^# && r:^+:" + + - id: 1674 + title: 'Ensure no legacy "+" entries exist in /etc/group' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/group if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/group -> !r:^# && r:^+:" + + - id: 1675 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:' + + - id: 1676 + title: "Ensure shadow group is empty" + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." + compliance: + - cis: ["6.2.20"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/etc/ruleset/sca/debian/cis_debian9.yml b/etc/ruleset/sca/debian/cis_debian9.yml new file mode 100644 index 0000000000..cadeb1db2a --- /dev/null +++ b/etc/ruleset/sca/debian/cis_debian9.yml @@ -0,0 +1,2955 @@ +# Security Configuration Assessment +# CIS Checks for Debian Linux 9 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Debian Linux 9 Benchmark v1.0.1 - 01-13-2020 + +policy: + id: "cis_debian9" + file: "cis_debian9.yml" + name: "CIS Debian Linux 9 Benchmark v1.0.1" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Debian Linux 9." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Debian version" + description: "Requirements for running the SCA scan against Debian/Ubuntu." + condition: all + rules: + - "f:/etc/debian_version" + - "f:/proc/sys/kernel/ostype -> Linux" + +checks: + # 1.1.1 Disable unused filesystems + - id: 2000 + title: "Ensure mounting of freevxfs filesystems is disabled" + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/freevxfs.conf and add the following line: install freevxfs /bin/true Run the following command to unload the freevxfs module: # rmmod freevxfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v freevxfs -> r:^install /bin/true" + - "not c:lsmod -> r:freevxfs" + + - id: 2001 + title: "Ensure mounting of jffs2 filesystems is disabled" + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/jffs2.conf and add the following line: install jffs2 /bin/true Run the following command to unload the jffs2 module: # rmmod jffs2" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v jffs2 -> r:^install /bin/true" + - "not c:lsmod -> r:jffs2" + + - id: 2002 + title: "Ensure mounting of hfs filesystems is disabled" + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/hfs.conf and add the following line: install hfs /bin/true Run the following command to unload the hfs module: # rmmod hfs" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v hfs -> r:^install /bin/true" + - "not c:lsmod -> r:hfs" + + - id: 2003 + title: "Ensure mounting of hfsplus filesystems is disabled" + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .confExample: vim /etc/modprobe.d/hfsplus.conf and add the following line: install hfsplus /bin/true Run the following command to unload the hfsplus module: # rmmod hfsplus" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v hfsplus -> r:^install /bin/true" + - "not c:lsmod -> r:hfsplus" + + - id: 2004 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/udf.conf and add the following line: install udf /bin/true Run the following command to unload the udf module: # rmmod udf" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v udf -> r:^install /bin/true" + - "not c:lsmod -> r:udf" + + # 2 Filesystem Configuration + - id: 2005 + title: "Ensure /tmp is configured" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "Configure /etc/fstab as appropriate. Example: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 or Run the following commands to enable systemd /tmp mounting: systemctl unmask tmp.mount systemctl enable tmp.mount Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount" + compliance: + - cis: ["1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + - "c:systemctl is-enabled tmp.mount -> enabled" + + - id: 2006 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount: [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,noexec,nodev,nosuid and run the following commands to enable systemd /tmp mounting: systemctl unmask tmp.mount systemctl enable tmp.mount" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + - id: 2007 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp : # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + - id: 2008 + title: "Ensure noexec option set on /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp ." + remediation: "Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp : # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["2.6", "8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + - id: 2009 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + - id: 2010 + title: "Ensure separate partition exists for /var/tmp" + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + - id: 2011 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,nodev /var/tmp" + compliance: + - cis: ["1.1.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + + - id: 2012 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" + compliance: + - cis: ["1.1.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + - id: 2013 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" + compliance: + - cis: ["1.1.10"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + - id: 2014 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + - id: 2015 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + - id: 2016 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + - id: 2017 + title: "Ensure nodev option set on /home partition" + description: "When set on a file system, this option prevents character and block special devices from being defined, or if they exist, from being used as character and block special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. See the fstab(5) manual page for more information. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + - id: 2018 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /run/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.15"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + - id: 2019 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.16"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + - id: 2020 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.17"] + - cis_csc: ["2.6", "8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + - id: 2021 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run the following command to disable autofs: # systemctl disable autofs" + compliance: + - cis: ["1.1.22"] + - cis_csc: ["8.4", "8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled autofs -> r:^enabled" + + # 1.3 Filesystem Integrity Checking + - id: 2022 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # apt-get install aide aide-common. Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: # aideinit" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + reference: + - "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: all + rules: + - "c:dpkg -s aide -> r:install ok installed" + + - id: 2023 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/bin/aide.wrapper --config /etc/aide/aide.conf --check" + compliance: + - cis: ["1.3.2"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:grep -Rh aide /etc/cron.d /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly /etc/crontab -> r:\.+' + - "c:crontab -u root -l -> !r:^# && r:/usr/bin/aide && r:--check" + + # 1.4 Secure Boot Settings + - id: 2024 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually grub.cfg stored in /boot/grub." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: chown root:root /boot/grub/grub.cfg, chmod og-rwx /boot/grub/grub.cfg" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /boot/grub/grub.cfg -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2025 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: 'Create an encrypted password with grub-mkpasswd-pbkdf2 Create a custom /etc/grub.d configuration file: If there is a requirement to be able to boot/reboot without entering the password, edit /etc/grub.d/10_linux and add --unrestricted to the line CLASS= Example: CLASS="--class gnu-linux --class gnu --class os --unrestricted" Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["1.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + - id: 2026 + title: "Ensure authentication required for single user mode" + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" + compliance: + - cis: ["1.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/shadow -> r:^root:*:|^root:!:" + + # 1.5 Additional Process Hardening + - id: 2027 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl fs.suid_dumpable -> r:=\s*\t*0$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> !r:^# && r:=\s*\t*0$' + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + + - id: 2028 + title: "Ensure XD/NX support is enabled" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.5.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sh -c "dmesg | grep NX" -> r:NX \(Execute Disable\) protection: active' + + - id: 2029 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:\s*\t*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' + + - id: 2030 + title: "Ensure prelink is disabled" + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal and uninstall prelink: prelink -ua && yum remove prelink" + compliance: + - cis: ["1.5.4"] + - cis_csc: ["14.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s prelink -> r:install ok installed" + + # 1.6 Configure SELinux + + - id: 2031 + title: "Ensure SELinux is enabled in the bootloader configuration" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: 'Run the following command to configure GRUB and PAM and to create /.autorelabel: # selinux-activate Edit /etc/default/grub and add the following parameters to the GRUB_CMDLINE_LINUX= line: selinux=1 security=selinux example: GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX="selinux=1 security=selinux enforcing=1 audit=1" Run the following command to update the grub2configuration: # update-grub' + compliance: + - cis: ["1.6.1.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:selinux=1' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:security=selinux' + + - id: 2032 + title: "Ensure the SELinux state is enforcing" + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: 'Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing Edit /etc/default/grub and add the following parameters to the GRUB_CMDLINE_LINUX= line: enforcing=1 Example: GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX="selinux=1 security=selinux enforcing=1 audit=1" Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["1.6.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s+enabled$' + - 'c:sestatus -> r:^Current mode:\s+enforcing$' + - 'c:sestatus -> r:^Mode from config file:\s+enforcing$' + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + - 'not f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:enforcing=1' + + - id: 2033 + title: "Ensure SELinux policy is configured" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + compliance: + - cis: ["1.6.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+default|^Loaded policy name:\s+mls' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*default|^\s*SELINUXTYPE\s*=\s*mls' + + - id: 2034 + title: "Ensure no unconfined daemons exist" + description: "Daemons that are not defined in SELinux policy will inherit the security context of their parent process." + rationale: "Since daemons are launched and descend from the init process, they will inherit the security context label initrc_t . This could cause the unintended consequence of giving the process more permission than it requires." + remediation: "Investigate any unconfined daemons found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:ps -eZ -> r:initrc && !r:tr|ps|egrep|bash|awk" + + - id: 2035 + title: "Ensure AppArmor is enabled in the bootloader configuration" + description: "Configure AppArmor to be enabled at boot time and verify that it has not been overwrittenby the bootloader boot parameters." + rationale: "AppArmor must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/grub and add the appermor=1 and security=apparmor parameters to the GRUB_CMDLINE_LINUX= line GRUB_CMDLINE_LINUX="apparmor=1 security=apparmor" update the grub configuration # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings.' + compliance: + - cis: ["1.6.2.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:apparmor=1' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:security=apparmor' + + - id: 2036 + title: "Ensure all AppArmor Profiles are enforcing" + description: "AppArmor profiles define what resources applicatons are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.6.2.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:apparmor status -> r:0 profiles are in complain mode" + - "c:apparmor status -> r:0 processes are unconfined" + - 'c:apparmor status -> n:(\d+) profiles are loaded compare > 0' + + - id: 2037 + title: "Ensure SELinux or AppArmor are installed" + description: "SELinux and AppArmor provide Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run one of the following commands to install SELinux or apparmor: # apt-get install selinux-basics Or: # apt-get install apparmor apparmor-profiles apparmor-utils" + compliance: + - cis: ["1.6.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - "c:dpkg -s selinux-basics -> r:install ok installed" + - "c:dpkg -s apparmor -> r:install ok installed" + + # 1.7 Warning Banners + - id: 2038 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v." + compliance: + - cis: ["1.7.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s|Debian' + + - id: 2039 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v , or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.7.1.2"] + - cis_csc: ["5.1"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Debian' + + - id: 2040 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.7.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|Debian' + + - id: 2041 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2042 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2043 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2044 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add: [org/gnome/login-screen], banner-message-enable=true, banner-message-text='Authorized uses only. All activity may be monitored and reported.'" + compliance: + - cis: ["1.7.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/gdm3/greeter.dconf-defaults -> r:^[org/gnome/login-screen]" + - "f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-enable=true" + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-text=\.+' + + - id: 2045 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. Notes: Site policy may mandate a testing period before install onto production systems for available updates." + compliance: + - cis: ["1.8"] + - cis_csc: ["3.4", "3.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6", "SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: none + rules: + - "c:apt-get -s upgrade -> r:^The following packages will be upgraded" + + # 2 Services + - id: 2046 + title: "Ensure xinetd is not installed" + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetddaemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed." + remediation: "Run the following commands to remove xinetd: # apt-get remove xinetd # apt-get purge xinetd" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:dpkg -s xinetd -> r:dpkg-query: package \.+ is not installed' + + - id: 2047 + title: "Ensure openbsd-inetd is not installed" + description: "The inetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no inetd services required, it is recommended that the daemon be removed." + remediation: "Run the following command to uninstall openbsd-inetd: apt-get remove openbsd-inetd" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s openbsd-inetd -> r:install ok installed" + + - id: 2048 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems or virtual systems where host based time synchronization is not available install NTP or chrony using one of the following commands: # apt-get install ntp # apt-get install chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization." + compliance: + - cis: ["2.2.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "c:dpkg -s ntp -> r:install ok installed" + - "c:dpkg -s chrony -> r:install ok installed" + + - id: 2049 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file: RUNASUSER=ntp" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://www.ntp.org/ + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/init.d/ntp -> r:^RUNASUSER\s*\t*=\s*\t*ntp' + + - id: 2050 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system." + remediation: "Add or edit server or pool lines to /etc/chrony/chrony.conf as appropriate: server " + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\.+|^pool\.+' + + # 2.2.2 Ensure the X Window system is not installed (Scored) + - id: 2051 + title: "Ensure the X Window system is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: apt-get remove xserver-xorg*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:dpkg -l xserver-xorg-core* -> r:^\wi\s*xserver-xorg' + + - id: 2052 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attach surface." + remediation: "Run the following command to disable avahi-daemon: # systemctl disable avahi-daemon" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled avahi-daemon -> enabled" + + - id: 2053 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups: # systemctl disable cups" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.cups.org + condition: none + rules: + - "c:systemctl is-enabled cups -> enabled" + + - id: 2054 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following commands to disable dhcpd: # systemctl disable isc-dhcp-server # systemctl disable isc-dhcp-server6" + references: + - https://www.isc.org/dhcp/ + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled isc-dhcp-server -> enabled" + - "c:systemctl is-enabled isc-dhcp-server6 -> enabled" + + - id: 2055 + title: "Ensure LDAP server is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # systemctl disable slapd" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.openldap.org + condition: none + rules: + - "c:systemctl is-enabled slapd -> enabled" + + - id: 2056 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs and rpcbind: # systemctl disable nfs-server # systemctl disable rpcbind" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled nfs-server -> enabled" + - "c:systemctl is-enabled rpcbind -> enabled" + + - id: 2057 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable named: # systemctl disable bind9" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled bind9 -> enabled" + + - id: 2058 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # systemctl disable vsftpd" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled vsftpd -> enabled" + + - id: 2059 + title: "Ensure HTTP Server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable apache2: # systemctl disable apache2" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled apache2 -> enabled" + + - id: 2060 + title: "Ensure IMAP and POP3 server is not enabled" + description: "exim is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following commands to remove exim: # apt-get remove exim4; # apt-get purge exim4" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s exim4 -> r:install ok installed" + + - id: 2061 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable smbd: # systemctl disable smbd" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled smbd -> enabled" + + - id: 2062 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # systemctl disable squid" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled squid -> enabled" + + - id: 2063 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # systemctl disable snmpd" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled snmpd -> enabled" + + - id: 2064 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only . Restart postfix: # systemctl restart postfix" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - tsc: ["CC5.2", "CC6.4", "CC6.6", "CC6.7"] + condition: none + rules: + - 'c:netstat -an -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.*LISTEN' + + - id: 2065 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # systemctl disable rsync" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled rsync -> enabled" + + - id: 2066 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable nis: # systemctl disable nis" + compliance: + - cis: ["2.2.17"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled nis -> enabled" + + - id: 2067 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Uninstall the nis package: # apt-get remove nis" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s nis -> r:install ok installed" + + - id: 2068 + title: "Ensure rsh client is not installed" + description: "The rshpackage contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rshpackage removes the clients for rsh, rcpand rlogin." + remediation: "Run the following command to uninstall rsh: apt-get remove rsh-client rsh-redone-client" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["2.6", "4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s rsh-client -> r:install ok installed" + - "c:dpkg -s rsh-redone-client -> r:install ok installed" + + - id: 2069 + title: "Ensure talk client is not installed" + description: "The talksoftware makes it possible for users to send and receive messages across systems through a terminal session. The talkclient, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk: apt-get remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s talk -> r:install ok installed" + + - id: 2070 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet: # apt-get remove telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["2.6", "4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s telnet -> r:install ok installed" + + - id: 2071 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients : # apt-get remove ldap-utils" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s ldap-utils -> r:install ok installed" + + # 3 Network Configuration + - id: 2072 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not." + rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0 net.ipv6.conf.all.forwarding = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv6.conf.all.forwarding=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.forwarding /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' + + - id: 2073 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the net.ipv4.conf.all.send_redirects and net.ipv4.conf.default.send_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.send_redirects=0 net.ipv4.conf.default.send_redirects=0 Modify active kernel parameters to match: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + - id: 2074 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv6.conf.all.accept_source_route=0 # sysctl -w net.ipv6.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0$' + + - id: 2075 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects and net.ipv6.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + + - id: 2076 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + - id: 2077 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + - id: 2078 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + - id: 2079 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + - id: 2080 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing. + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + - id: 2081 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + - id: 2082 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the systems ability to accept router advertisements" + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + + - id: 2083 + title: "Install TCP Wrappers" + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Install tcpd : # apt-get install tcpd To verify if a service supports TCP Wrappers, run the following command: # ldd | grep libwrap.so If there is any output, then the service supports TCP Wrappers." + compliance: + - cis: ["3.3.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "c:dpkg -s tcpd -> r:install ok installed" + + - id: 2084 + title: "Ensure /etc/hosts.allow is configured" + description: "The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." + remediation: 'Run the following command to create /etc/hosts.allow: # echo "ALL: /, /, ..." >/etc/hosts.allow. Where each / combination (for example, "192.168.1.0/255.255.255.0") represents one network block in use by your organization that requires access to this system.' + compliance: + - cis: ["3.3.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "f:/etc/hosts.allow" + + - id: 2085 + title: "Ensure /etc/hosts.deny is configured" + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the server." + remediation: 'Run the following command to create /etc/hosts.deny: # echo "ALL: ALL" >> /etc/hosts.deny' + compliance: + - cis: ["3.3.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "f:/etc/hosts.deny" + - 'f:/etc/hosts.deny -> r:^ALL:\s*ALL' + + - id: 2086 + title: "Verify permissions on /etc/hosts.allow" + description: "The /etc/hosts.allow file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.allow : # chown root:root /etc/hosts.allow # chmod 644 /etc/hosts.allow" + compliance: + - cis: ["3.3.4"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/hosts.allow -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + + - id: 2087 + title: "Verify permissions on /etc/hosts.deny" + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.deny : # chown root:root /etc/hosts.deny # chmod 644 /etc/hosts.deny" + compliance: + - cis: ["3.3.5"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/hosts.deny -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + + - id: 2088 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in- sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/dccp.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v dccp -> r:install /bin/true" + - "c:lsmod -> r:dccp" + + - id: 2089 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/sctp.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.4.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v sctp -> r:install /bin/true" + - "c:lsmod -> r:sctp" + + - id: 2090 + title: "Ensure RDS is disabled" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/rds.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v rds -> r:install /bin/true" + - "c:lsmod -> r:rds" + + - id: 2091 + title: "Ensure TIPC is disabled" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/tipc.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v tipc -> r:install /bin/true" + - "c:lsmod -> r:tipc" + + # 3.5 Firewall configuration + + - id: 2092 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + compliance: + - cis: ["3.5.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:iptables -L -> r:^Chain INPUT && r:policy DROP" + - "c:iptables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:iptables -L -> r:^Chain OUTPUT && r:policy DROP" + + - id: 2093 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.5.1.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + - id: 2094 + title: "Ensure IPv6 default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + compliance: + - cis: ["3.5.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:ip6tables -L -> r:^Chain INPUT && r:policy DROP" + - "c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP" + + - id: 2095 + title: "Ensure IPv6 loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP" + compliance: + - cis: ["3.5.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + - id: 2096 + title: "Ensure iptables is installed" + description: "iptables allows configuration of the IPv4 tables in the linux kernel and the rules stored within them. Most firewall configuration utilities operate as a front end to iptables." + rationale: "iptables is required for firewall management and configuration." + remediation: "Run the following command to install iptables: # apt-get install iptables" + compliance: + - cis: ["3.5.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:dpkg -s iptables -> r:install ok installed" + + ######################################### + # 4 Logging and Auditing + ######################################### + + - id: 2097 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = Notes: The max_log_file parameter is measured in megabytes." + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' + + - id: 2098 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*\t*=\s*\t*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*\t*=\s*\t*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*\t*=\s*\t*halt' + + - id: 2099 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' + + - id: 2100 + title: "Ensure auditd service is enabled" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl enable auditd" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1", "10.7"] + - tsc: [CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> enabled" + + - id: 2101 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub or lilo so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: '1) Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX="audit=1" 2) Run the following command to update the grub2 configuration: # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings.' + compliance: + - cis: ["4.1.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.2.6", "10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:audit=1' + + - id: 2102 + title: "Ensure events that modify date and time information are collected" + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier "time-change"' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time- change | -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change. For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change | -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change | -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.3", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change" + + - id: 2103 + title: "Ensure events that modify user/group information are collected" + description: 'Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/group -p wa -k identity | -w /etc/passwd -p wa -k identity | -w /etc/gshadow -p wa -k identity | -w /etc/shadow -p wa -k identity | -w /etc/security/opasswd -p wa -k identity Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.5"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/group && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity" + + - id: 2104 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre- login), /etc/hosts (file containing host names and associated IP addresses) and /etc/sysconfig/network (directory containing network interface scripts and configurations) files." + rationale: 'Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier "system-locale."' + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale | -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale | -w /etc/issue -p wa -k system-locale | -w /etc/issue.net -p wa -k system-locale | -w /etc/hosts -p wa -k system-locale | -w /etc/sysconfig/network -p wa -k system-locale Notes: /etc/sysconfig/network is common to Red Hat and SUSE based distributions. You should expand or replace this coverage to any network configuration files on your system such as /etc/network on Debian based distributions. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.6"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/network && r:-p wa && r:-k system-locale" + + - id: 2105 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor SELinux/AppArmor mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux or /etc/apparmor and /etc/apparmor.d directories." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "On systems using SELinux add the following line to the /etc/audit/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy | -w /usr/share/selinux/ -p wa -k MAC-policy On systems using AppArmor add the following line to the /etc/audit/audit.rules file: -w /etc/apparmor/ -p wa -k MAC-policy | -w /etc/apparmor.d/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/selinux/|/etc/apparmor/ && r:-p wa && r:-k MAC-policy" + - "f:/etc/audit/audit.rules -> r:^-w && r:/usr/share/selinux/|/etc/apparmor.d/ && r:-p wa && r:-k MAC-policy" + + - id: 2106 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/faillog -p wa -k logins | -w /var/log/lastlog -p wa -k logins | -w /var/log/tallylog -p wa -k logins. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.8"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/faillog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/tallylog && r:-p wa && r:-k logins" + + - id: 2107 + title: "Ensure session initiation information is collected" + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier "session." The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier "logins."' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/run/utmp -p wa -k session | -w /var/log/wtmp -p wa -k logins | -w /var/log/btmp -p wa -k logins. Notes: The last command can be used to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.9"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k logins" + + - id: 2108 + title: "Ensure discretionary access control permission modification events are collected" + description: 'Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier "perm_mod."' + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.10"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + + - id: 2109 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: 'Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier "access."' + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.11"] + - cis_csc: ["14.9"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access" + + - id: 2110 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts | -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts" + + - id: 2111 + title: "Ensure file deletion events by users are collected" + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete | -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.14"] + - cis_csc: ["6,2", "13"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete" + + - id: 2112 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: 'Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier "scope."' + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope | -w /etc/sudoers.d/ -p wa -k scope. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.15"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers.d/ && r:-p wa && r:-k scope" + + - id: 2113 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions. Notes: The system must be configured with sudisabled (See Item 5.6 Ensure access to the su command is restricted) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.16"] + - cis_csc: ["4.9"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14", "AC.6", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/sudo.log && r:-p wa && r:-k actions" + + - id: 2114 + title: "Ensure kernel module loading and unloading is collected" + description: 'Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of "modules".' + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b64 -S init_module -S delete_module -k modules. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.17"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/sbin/insmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/sbin/rmmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/sbin/modprobe && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32|-F arch=b64 && r:-S init_module && r:-S delete_module && r:-k modules" + + - id: 2115 + title: "Ensure the audit configuration is immutable" + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following line to the end of the /etc/audit/audit.rules file: -e 2. Notes: This setting will ensure reloading the auditd config to set active settings requires a system reboot." + compliance: + - cis: ["4.1.18"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.5"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "c:tail -1 /etc/audit/audit.rules -> -e 2" + + - id: 2116 + title: "Ensure rsyslog Service is enabled" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system will not have a syslog service running." + remediation: "Run the following command to enable rsyslog: # systemctl enable rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> enabled" + + # 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 2117 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1", "10.5.2"] + - nist_800_53: ["CM.1", "AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\. -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + - id: 2118 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host): *.* @@loghost.example.com. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - rsyslog.conf(5) man page + condition: all + rules: + - 'c:grep -Rh ^*.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^*.* @@\.+' + + - id: 2119 + title: "Ensure remote rsyslog messages are only accepted on designated log hosts" + description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." + rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." + remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines:$ModLoad imtcp & $InputTCPServerRun 514. For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["9.2"] + - pci_dss: ["10.5.1"] + references: + - rsyslog.conf(8) man page + condition: all + rules: + - 'c:grep -Rh ^\$ModLoad[[:space:]]*imtcp /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$ModLoad\s*\t*imtcp' + - 'c:grep -Rh ^\$InputTCPServerRun /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$InputTCPServerRun\s*\t*514' + + # 4.2.2.1 Ensure syslog-ng service is enabled (Scored) + - id: 2120 + title: "Ensure syslog-ng service is enabled" + description: "Once the syslog-ng package is installed it needs to be activated." + rationale: "If the syslog-ng service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable rsyslog : # systemctl enable syslog-ng" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "c:systemctl is-enabled syslog-ng -> enabled" + + # 4.2.2.3 Ensure syslog-ng default file permissions configured (Scored) + - id: 2121 + title: "Ensure syslog-ng default file permissions configured" + description: "syslog-ng will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive syslog-ng data is archived and protected." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf and set perm option to 0640 or more restrictive: options { chain_hostnames(off); flush_lines(0); perm(0640); stats_freq(3600); threaded(yes); };" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1", "10.5.2"] + - nist_800_53: ["CM.1", "AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:^options && r:perm\(06\d0\)|perm\(04\d0\)|perm\(02\d0\)|perm\(00\d0\) && r:perm\(0\d40\)|perm\(0\d00\)' + + # 4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host (Not Scored) + - id: 2122 + title: "Ensure syslog-ng is configured to send logs to a remote log host" + description: "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp("logfile.example.com" port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the rsyslogd configuration: # pkill -HUP syslog-ng' + compliance: + - cis: ["4.2.2.4"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/syslog-ng/syslog-ng.conf -> r:destination logserver" + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:log\.+source\.+destination' + + # 4.2.3 Ensure rsyslog or syslog-ng is installed (Scored) + - id: 2123 + title: "Ensure rsyslog or syslog-ng is installed" + description: "The rsyslog and syslog-ng software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog or syslog-ng using one of the following commands: # apt-get install rsyslog # apt-get install syslog-ng" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: any + rules: + - "c:dpkg -s rsyslog -> r:install ok installed" + - "c:dpkg -s syslog-ng -> r:install ok installed" + + ######################################### + # 5 Access, Authentication and Authorization + ######################################### + + - id: 2124 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: systemctl enable cron" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled cron -> enabled" + + # 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 2125 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access: \(0\d00/\w\w\w-------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 2126 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 2127 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 2128 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 2129 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 2130 + title: "Ensure permissions on /etc/cron.d are configured" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + - id: 2131 + title: "Ensure at/cron is restricted to authorized users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/cron.allow" + - "f:/etc/at.allow" + - "not f:/etc/cron.deny" + - "not f:/etc/at.deny" + - 'c:stat -L /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat -L /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2 SSH Server Configuration + + - id: 2132 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non- privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + - id: 2133 + title: "Ensure SSH Protocol is set to 2" + description: "Older versions of SSH support two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2. Notes: This command not longer exists in newer versions of SSH. This check is still being included for systems that may be running an older version of SSH. As of openSSH version 7.4 this parameter will not cause an issue when included." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.4"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\s*\t*2' + + - id: 2134 + title: "Ensure SSH LogLevel is appropriate" + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE or LogLevel INFO" + references: + - https://www.ssh.com/ssh/sshd_config/ + compliance: + - cis: ["5.2.5"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:LogLevel\s+INFO|LogLevel\s+VERBOSE' + + - id: 2135 + title: "Ensure SSH X11 forwarding is disabled" + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_configfile to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:sshd -T -> r:X11Forwarding\s+no' + + - id: 2136 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> n:MaxAuthTries\s*\t*(\d+) compare <= 4' + + - id: 2137 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhostsand .shostsfiles will not be used in RhostsRSAAuthenticationor HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:IgnoreRhosts\s+yes' + + - id: 2138 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:HostbasedAuthentication\s+no' + + - id: 2139 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["4.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitRootLogin\s+no' + + - id: 2140 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitEmptyPasswords\s+no' + + - id: 2141 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["5.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -> r:PermitUserEnvironment\s+no' + + - id: 2142 + title: "Ensure only strong ciphers are used" + description: "This variable limits the ciphers that SSH can use during communication." + rationale: 'Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a "Sweet32" attack The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involving LSB values, aka the "Bar Mitzvah" issue The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher is used, does not properly initialize memory for a MAC context data structure, which allows remote authenticated users to bypass intended ForceCommand and login-shell restrictions via packet data that provides a crafted callback address' + remediation: "Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers Example: Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - "https://nvd.nist.gov/vuln/detail/CVE-2016-2183" + - "https://nvd.nist.gov/vuln/detail/CVE-2015-2808" + - "https://nvd.nist.gov/vuln/detail/CVE-2008-5161" + - "https://nvd.nist.gov/vuln/detail/CVE-2013-4548" + - "https://www.kb.cert.org/vuls/id/565052" + - "https://www.openssh.com/txt/cbc.adv" + condition: none + rules: + - "c:sshd -T -> r:ciphers && r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc|arcfour|arcfour128|arcfour256|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se" + + - id: 2143 + title: "Ensure only strong MAC algorithms are used" + description: "This variable limits the types of MAC algorithms that SSH can use during communication." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information" + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2- 512,hmac-sha2-256" + compliance: + - cis: ["5.2.14"] + - cis_csc: ["14.4", "16.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - "http://www.mitls.org/pages/attacks/SLOTH" + condition: none + rules: + - "c:sshd -T -> r:MACs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com" + + - id: 2144 + title: "Ensure only strong Key Exchange algorithms are used" + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received" + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks" + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms Example: KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman- group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18- sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie- hellman-group-exchange-sha256" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: none + rules: + - "c:sshd -T -> r:kexalgorithms && r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1" + + - id: 2145 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 ClientAliveCountMax 0" + compliance: + - cis: ["5.2.16"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'c:sshd -T -> n:ClientAliveInterval\s*\t*(\d+) compare <= 300 && n:ClientAliveInterval\s*\t*(\d+) compare != 0' + - 'c:sshd -T -> n:ClientAliveCountMax\s*\t*(\d+) compare <= 3' + + - id: 2146 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.17"] + - cis_csc: ["5.1"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'c:sshd -T -> n:LoginGraceTime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + + - id: 2147 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " + compliance: + - cis: ["5.2.18"] + - cis_csc: ["5.1"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'c:sshd -T -> r:AllowUsers\s+\w+|AllowGroups\s+\w+|DenyUsers\s+\w+|DenyGroups\s+\w+' + + - id: 2148 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:Banner\s*\t*/etc/issue.net' + + # 5.3 Configure PAM + + - id: 2149 + title: "Ensure password creation requirements are configured" + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options: - retry=3 (Allow 3 tries before sending back a failure). The following options are set in the /etc/security/pwquality.conf file: - minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 (The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies.)" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "1) Run the following command to install the pam_pwquality module: apt-get install libpam-pwquality 2) Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so retry=3 3) Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1. Notes: Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more. Settings in /etc/security/pwquality.conf must use spaces around the = symbol." + compliance: + - cis: ["5.3.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.3"] + condition: all + rules: + - "c:dpkg -s libpam-pwquality -> r:install ok installed" + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*requisite\s*\t*pam_pwquality.so\s*\t*retry=\d' + - 'f:/etc/security/pwquality.conf -> !r:^# && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + + - id: 2150 + title: "Ensure lockout for failed password attempts is configured" + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: 'Edit the /etc/pam.d/common-auth file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900. Edit the /etc/pam.d/common-account file and add the account line bellow: account required pam_tally2.so. Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user. Notes:BUG In pam_tally2.so To work around this issue the addition of pam_tally2.so in the accounts section of the /etc/pam.d/common-account file has been added to the audit and remediation sections. pam_tally2 line must be added for the counter to reset to 0 when using sudo. Use of the "audit" keyword may log credentials in the case of user error during authentication. This risk should be evaluated in the context of the site policies of your organization.' + compliance: + - cis: ["5.3.2"] + - cis_csc: ["16.7"] + - pci_dss: ["8.2.5"] + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d+ && r:unlock_time\s*=\s*\d+' + - "f:/etc/pam.d/common-account -> !r:^# && r:pam_tally2.so" + + - id: 2151 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown: password required pam_pwhistory.so remember=5. Notes: Additional module options may be set, recommendation only covers those listed here." + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare < 5' + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && !r:remember' + + # 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 2152 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the sha512 option for pam_unix.so as shown: password [success=1 default=ignore] pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.4"] + - pci_dss: ["3.6.1"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> r:^password\.+pam_unix.so && !r:sha512' + + # 5.4 User Accounts and Environment + + - id: 2153 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs: PASS_MAX_DAYS 90. Modify user parameters for all users with a password set to match: # chage --maxdays 90 . Notes: You can also check this setting in /etc/shadow directly. The 5th field should be 365 or less for all users with a password. A value of -1 will disable password expiration. Additionally the password expiration must be greater than the minimum days between password changes or users will be unable to change their password." + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["8.2.4"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare < 0' + + - id: 2154 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7. Modify user parameters for all users with a password set to match: # chage --mindays 7 . Notes: You can also check this setting in /etc/shadow directly. The 4th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + + - id: 2155 + title: "Ensure password expiration warning days is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7. Modify user parameters for all users with a password set to match: # chage --warndays 7 . Notes: You can also check this setting in /etc/shadow directly. The 6th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + - id: 2156 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30. Modify user parameters for all users with a password set to match: # chage --inactive 30 . Notes: You can also check this setting in /etc/shadow directly. The 7th field should be 30 or less for all users with a password. A value of -1 would disable this setting." + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - 'not c:useradd -D -> n:^INACTIVE=(\d+) compare < 0' + + - id: 2157 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: # usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' + + - id: 2158 + title: "Ensure default user umask is 027 or more restrictive" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bash.bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["13"] + - pci_dss: ["3.6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + # 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 2159 + title: "Ensure default user shell timeout is 900 seconds or less" + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bashrc, /etc/profile files, and /etc/profile.d*.sh (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not d:/etc/profile.d -> .sh -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/bash.bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'd:/etc/profile.d -> .sh -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/bash.bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + - id: 2160 + title: "Ensure access to the su command is restricted" + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the sudo group to execute su." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "1) Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so 2) Create a comma separated list of users in the sudo statement in the /etc/group file: sudo:x:10:root, Notes: The use_uid option to pam_wheel.so is a no-op on debian based systems. It is acceptable but not required as these systems use its behavior as default." + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^# && r:auth\s*\t*required\s*\t*pam_wheel.so' + - 'f:/etc/group -> !r:^# && r:sudo:\w+:\d+:\.' + + ############################### + # 6 System Maintenance + ############################### + + - id: 2161 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following commands to set permissions on /etc/gshadow : # chown root:shadow /etc/gshadow # chmod o-rwx,g-rw /etc/gshadow" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/gshadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 2162 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/shadow- : # chown root:root /etc/shadow- # chown root:shadow /etc/shadow- # chmod o-rwx,g-rw /etc/shadow-" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/shadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 2163 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "# chown root:root /etc/gshadow- # chown root:shadow /etc/gshadow- # chmod o-rwx,g-rw /etc/gshadow-" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/gshadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 2164 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2165 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the one following commands to set permissions on /etc/shadow : # chown root:shadow /etc/shadow # chmod o-rwx,g-wx /etc/shadow" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/shadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 2166 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2167 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod 644 /etc/passwd-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/passwd- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 2168 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.2 User and Group Settings + + - id: 2169 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + - id: 2170 + title: 'Ensure no legacy "+" entries exist in /etc/passwd' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/passwd -> !r:^# && r:^+:" + + - id: 2171 + title: 'Ensure no legacy "+" entries exist in /etc/shadow' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.3"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/shadow -> !r:^# && r:^+:" + + - id: 2172 + title: 'Ensure no legacy "+" entries exist in /etc/group' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/group if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/group -> !r:^# && r:^+:" + + - id: 2173 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:' + + - id: 2174 + title: "Ensure shadow group is empty" + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." + compliance: + - cis: ["6.2.20"] + - cis_csc: ["16"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/etc/ruleset/sca/generic/sca_unix_audit.yml b/etc/ruleset/sca/generic/sca_unix_audit.yml index e69de29bb2..b7d56d8ee2 100644 --- a/etc/ruleset/sca/generic/sca_unix_audit.yml +++ b/etc/ruleset/sca/generic/sca_unix_audit.yml @@ -0,0 +1,308 @@ +# Security Configuration Assessment +# Audit for UNIX systems +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation + +policy: + id: "unix_audit" + file: "sca_unix_audit.yml" + name: "System audit for Unix based systems" + description: "Guidance for establishing a secure configuration for Unix based systems." + references: + - https://www.ssh.com/ssh/ + +requirements: + title: "Check that the SSH service and password-related files are present on the system" + description: "Requirements for running the SCA scan against the Unix based systems policy." + condition: any + rules: + - "f:$sshd_file" + - "f:/etc/passwd" + - "f:/etc/shadow" + +variables: + $sshd_file: /etc/ssh/sshd_config + $pam_d_files: /etc/pam.d/common-password,/etc/pam.d/password-auth,/etc/pam.d/system-auth,/etc/pam.d/system-auth-ac,/etc/pam.d/passwd + +checks: + - id: 3000 + title: "SSH Hardening: Port should not be 22" + description: "The ssh daemon should not be listening on port 22 (the default value) for incoming connections." + rationale: "Changing the default port you may reduce the number of successful attacks from zombie bots, an attacker or bot doing port-scanning can quickly identify your SSH port." + remediation: "Change the Port option value in the sshd_config file." + compliance: + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:Port && !r:\s*\t*22$' + + - id: 3001 + title: "SSH Hardening: Protocol should be set to 2" + description: "The SSH protocol should not be 1." + rationale: "The Protocol parameter dictates which version of the SSH communication and encryption protocols are in use. Version 1 of the SSH protocol has weaknesses." + remediation: "Change the Protocol option value in the sshd_config file." + compliance: + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*\t*Protocol\s*\t*2' + + - id: 3002 + title: "SSH Hardening: Root account should not be able to log in" + description: "The option PermitRootLogin should be set to no." + rationale: 'The option PermitRootLogin specifies whether root can log in using ssh. If you want log in as root, you should use the option "Match" and restrict it to a few IP addresses.' + remediation: "Change the PermitRootLogin option value in the sshd_config file." + condition: all + rules: + - 'f:$sshd_file -> r:^\s*PermitRootLogin\s*\t*no' + + - id: 3003 + title: "SSH Hardening: No Public Key authentication" + description: "The option PubkeyAuthentication should be set yes." + rationale: "Access only by public key. Generally people will use weak passwords and have poor password practices. Keys are considered stronger than password." + remediation: "Change the PubkeyAuthentication option value in the sshd_config file." + compliance: + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*PubkeyAuthentication\s*\t*yes' + + - id: 3004 + title: "SSH Hardening: Password Authentication should be disabled" + description: "The option PasswordAuthentication should be set to no." + rationale: "The option PasswordAuthentication specifies whether we should use password-based authentication. Use public key authentication instead of passwords." + remediation: "Change the PasswordAuthentication option value in the sshd_config file." + compliance: + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*PasswordAuthentication\s*\t*no' + + - id: 3005 + title: "SSH Hardening: Empty passwords should not be allowed" + description: "The option PermitEmptyPasswords should be set to no." + rationale: "The option PermitEmptyPasswords specifies whether the server allows logging in to accounts with a null password. Accounts with null passwords are a bad practice." + remediation: "Change the PermitEmptyPasswords option value in the sshd_config file." + compliance: + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*PermitEmptyPasswords\s*\t*no' + + - id: 3006 + title: "SSH Hardening: Rhost or shost should not be used for authentication" + description: "The option IgnoreRhosts should be set to yes." + rationale: "The option IgnoreRhosts specifies whether rhosts or shosts files should not be used in authentication. For security reasons it is recommended to no use rhosts or shosts files for authentication." + remediation: "Change the IgnoreRhosts option value in the sshd_config file." + compliance: + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*\t*IgnoreRhosts\s*\t*yes' + + - id: 3007 + title: "SSH Hardening: Grace Time should be one minute or less." + description: "The option LoginGraceTime should be set to 60 or less." + rationale: "The option LoginGraceTime specifies how long in seconds after a connection request the server will wait before disconnecting if the user has not successfully logged in. 30 seconds is the recommended time for avoiding open connections without authenticate." + remediation: "Change the LoginGraceTime option value in the sshd_config file." + compliance: + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*LoginGraceTime\s*\t*(\d+)s compare <= 60' + + - id: 3008 + title: "SSH Hardening: Wrong Maximum number of authentication attempts" + description: "The option MaxAuthTries should be set to 4 or less." + rationale: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. Once the number of failures reaches half this value, additional failures are logged. This should be set to 4." + remediation: "Change the MaxAuthTries option value in the sshd_config file." + compliance: + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + + - id: 3009 + title: "SSH Hardening: Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv , along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*\t*HostbasedAuthentication\s*\t*no' + + - id: 3010 + title: "Ensure retry option for passwords is less than 3" + description: "The pam_pwquality.so module and pam_cracklib.so module (depending on the Linux distribution used) checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the /etc/pam.d/common-password and /etc/security/pwquality.conf files, or the /etc/pam.d/password-auth and /etc/pam.d/system-auth files, to include the appropriate options for pam_pwquality.so or pam_cracklib.so and to conform to site policy." + compliance: + - cis_csc: ["4.4", "5.7", "16.12"] + references: + - https://linux-audit.com/configure-the-minimum-password-length-on-linux-systems/ + condition: all + rules: + - 'f:$pam_d_files -> r:password && r:requisite|required && r:pam_cracklib.so|pam_pwquality.so && n:retry\s*=\s*(\d+) compare <= 3' + + - id: 3011 + title: "Ensure passwords are longer than 14 characters" + description: "The pam_pwquality.so module and pam_cracklib.so module (depending on the Linux distribution used) checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the /etc/pam.d/common-password and /etc/security/pwquality.conf files, or the /etc/pam.d/password-auth and /etc/pam.d/system-auth files, to include the appropriate options for pam_pwquality.so or pam_cracklib.so and to conform to site policy." + compliance: + - cis_csc: ["4.4", "5.7", "16.12"] + references: + - https://linux-audit.com/configure-the-minimum-password-length-on-linux-systems/ + condition: all + rules: + - 'f:$pam_d_files -> r:pam_cracklib.so && n:minlen=(\d+) compare >= 14' + + - id: 3012 + title: "Ensure passwords contain at least one digit" + description: "The pam_pwquality.so module and pam_cracklib.so module (depending on the Linux distribution used) checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the /etc/pam.d/common-password and /etc/security/pwquality.conf files, or the /etc/pam.d/password-auth and /etc/pam.d/system-auth files, to include the appropriate options for pam_pwquality.so or pam_cracklib.so and to conform to site policy." + compliance: + - cis_csc: ["4.4", "5.7", "16.12"] + references: + - https://linux-audit.com/configure-the-minimum-password-length-on-linux-systems/ + condition: all + rules: + - 'f:$pam_d_files -> r:pam_cracklib.so && r:dcredit\s*\t*=' + + - id: 3013 + title: "Ensure passwords contain at least one lowercase character" + description: "The pam_pwquality.so module and pam_cracklib.so module (depending on the Linux distribution used) checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the /etc/pam.d/common-password and /etc/security/pwquality.conf files, or the /etc/pam.d/password-auth and /etc/pam.d/system-auth files, to include the appropriate options for pam_pwquality.so or pam_cracklib.so and to conform to site policy." + compliance: + - cis_csc: ["4.4", "5.7", "16.12"] + references: + - https://linux-audit.com/configure-the-minimum-password-length-on-linux-systems/ + condition: all + rules: + - 'f:$pam_d_files -> r:pam_cracklib.so && r:lcredit\s*\t*=' + + - id: 3014 + title: "Ensure passwords contain at least one uppercase character" + description: "The pam_pwquality.so module and pam_cracklib.so module (depending on the Linux distribution used) checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the /etc/pam.d/common-password and /etc/security/pwquality.conf files, or the /etc/pam.d/password-auth and /etc/pam.d/system-auth files, to include the appropriate options for pam_pwquality.so or pam_cracklib.so and to conform to site policy." + compliance: + - cis_csc: ["4.4", "5.7", "16.12"] + references: + - https://linux-audit.com/configure-the-minimum-password-length-on-linux-systems/ + condition: all + rules: + - 'f:$pam_d_files -> r:pam_cracklib.so && r:ucredit\s*\t*=' + + - id: 3015 + title: "Ensure passwords contain at least one special character" + description: "The pam_pwquality.so module and pam_cracklib.so module (depending on the Linux distribution used) checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the /etc/pam.d/common-password and /etc/security/pwquality.conf files, or the /etc/pam.d/password-auth and /etc/pam.d/system-auth files, to include the appropriate options for pam_pwquality.so or pam_cracklib.so and to conform to site policy." + compliance: + - cis_csc: ["4.4", "5.7", "16.12"] + references: + - https://linux-audit.com/configure-the-minimum-password-length-on-linux-systems/ + condition: all + rules: + - 'f:$pam_d_files -> r:pam_cracklib.so && r:ocredit\s*\t*=' + + - id: 3016 + title: "Ensure lockout for failed password attempts is configured" + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Edit the /etc/pam.d/common-auth file and add the auth line below: #auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900" + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d && r:unlock_time\s*=\s*\d\d\d+' + + - id: 3017 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the sha512 option for pam_unix.so as shown: password required pam_unix.so sha512" + compliance: + - cis_csc: ["16.14"] + condition: all + rules: + - 'f:$pam_d_files -> r:^password\.+pam_unix.so\.+sha512' + + - id: 3018 + title: "Ensure passwords in /etc/shadow are hashed with SHA-512 or SHA-256" + description: "SHA-512 and SHA-256 are much stronger hashing algorithms than MD5." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords." + remediation: "Set the default algorithm for password hashing in /etc/shadow to SHA-512 or SHA-256." + references: + - https://linux-audit.com/password-security-with-linux-etc-shadow-file/ + - https://docs.oracle.com/cd/E19253-01/816-4557/concept-23/index.html + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+:\$1\$|^\w+:\$2\$|^\w+:\$md5\$|^\w+:\$md5\$|^\w+:\$__unix__\$' + + - id: 3019 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs." + compliance: + - cis_csc: ["4.4", "16"] + references: + - https://www.thegeekdiary.com/understanding-etclogin-defs-file + condition: any + rules: + - 'f:/etc/login.defs -> n:^PASS_MAX_DAYS\s*\t*(\d+)$ compare <= 365' + + - id: 3020 + title: "Ensure SELinux or AppArmor are installed" + description: "SELinux and AppArmor provide Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run one of the following commands to install SELinux or apparmor: # apt-get install selinux-basics Or: # apt-get install apparmor apparmor-profiles apparmor-utils" + compliance: + - cis_csc: ["14.4", "14.6"] + condition: any + rules: + - "c:dpkg -s selinux-basics -> r:install ok installed" + - "c:dpkg -s apparmor -> r:install ok installed" + + - id: 3021 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups: # systemctl disable cups" + compliance: + - cis_csc: ["9.1", "9.2"] + references: + - "https://www.cups.org" + condition: none + rules: + - "c:systemctl is-enabled cups -> r:^enabled" + + - id: 3022 + title: "Ensure auditd service is enabled" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl enable auditd" + compliance: + - cis_csc: ["6.2", "6.3"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:^enabled" diff --git a/etc/ruleset/sca/hpux/cis_hpux_11i.yml b/etc/ruleset/sca/hpux/cis_hpux_11i.yml new file mode 100644 index 0000000000..65deb7f4df --- /dev/null +++ b/etc/ruleset/sca/hpux/cis_hpux_11i.yml @@ -0,0 +1,828 @@ +# Security Configuration Assessment +# CIS Checks for HPUX 11i +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for HP-UX 11i from 09-17-2009 + +policy: + id: "cis_hpux" + file: "cis_hpux_11i.yml" + name: "CIS HP-UX 11i Benchmark v1.5.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for HPUX version 11i. This guide was tested against HP-UX" + references: + - https://www.cisecurity.org/wp-content/uploads/2017/04/CIS_HP-UX_11i_Benchmark_v1.5.0.pdf + +requirements: + title: "Check HPUX version and bastille is not installed." + description: "Requirements for running the SCA scan against HPUX family." + condition: all + rules: + - "c:swlist HPUX*OE* -> r:HPUX11i" + - "not d:/opt/sec_mgmt/bastille/" + +checks: + ################################################################# + # 1.1 Install patches and supplementary software + ################################################################# + + - id: 25001 + title: "Install and configure HP-UX Secure Shell." + description: "OpenSSH is a popular free distribution of the standards-track SSH protocols which allows secure encrypted network logins and file transfers. HP-UX Secure Shell is HP's pre-compiled and supported version of OpenSSH." + rationale: "Common login and file transfer services such as telnet, FTP, rsh, rlogin, and rcp use insecure, clear-text protocols that are vulnerable to attack. OpenSSH provides a secure, encrypted replacement for these services. Security is improved by further constraining services in the default configuration." + remediation: 'Perform the following to install and securely configure Secure Shell (SSH) 1. Download and install HP-UX Secure Shell if not already installed on the system. 2. Perform the following post-installation actions to secure the SSH service: a. Change to the /opt/ssh/etc directory b. Open sshd_config c. Set the Protocol token to 2. If it is absent, add and set it. d. Set the X11Forwarding token to yes. If it is absent, add and set it. e. Set the IgnoreRhosts token to yes. If it is absent, add and set it. f. Set the RhostsAuthentication token to no. If it is absent, add and set it. g. Set the RhostsRSAAuthentication token to no. If it is absent, add and set it. h. Set the PermitRootLogin token to no. If it is absent, add and set it. i. Set the PermitEmptyPasswords token to no. If it is absent, add and set it. j. Set the Banner token to /etc/issue. If it is absent, add and set it. k. Set root as the owner of sshd_config and ssh_config. l. Set sys as the group owner of sshd_config and ssh_config. m. Restrict write access to sshd_config and ssh_config to the file owner. The following script will perform the above procedure: 13 | P a g e cd /opt/ssh/etc cp -p sshd_config sshd_config.tmp awk '' /^Protocol/ /^IgnoreRhosts/ /^RhostsAuthentication/ /^RhostsRSAAuthentication/ { $2 ="no" }; /(^#|^)PermitRootLogin/ { $1 = "PermitRootLogin"; $2 = "no" }; /^PermitEmptyPasswords/ { $2 = "no" }; /^#Banner/ { $1 = "Banner"; $2 = "/etc/issue" } { print }'' sshd_config.tmp > sshd_config { $2 ="2"}; { $2 = "yes" }; { $2 = "no" }; rm -f sshd_config.tmp chown root:sys ssh_config sshd_config chmod go-w ssh_config sshd_config' + compliance: + - cis: ["1.1.2"] + - cis_level: ["1"] + references: + - http://www.openssh.org/ + - http://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA + - http://h20293.www2.hp.com/portal/swdepot/displayInstallInfo.do?productNumber=T1471AA + condition: all + rules: + - "c:swlist -l bundle SecureShell -> r:HP-UX Secure Shell" + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*Protocol 2' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*X11Forwarding yes' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*IgnoreRhosts yes' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*RhostsAuthentication no' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*RhostsRSAAuthentication no' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*PermitRootLogin no' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*PermitEmptyPasswords no' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*Banner /etc/issue' + - 'not c:sh -c "ls -la /opt/ssh/etc/sshd_config | grep -v -e ^-rw-r--r--.*root.*sys | grep -v -e ^d | grep -v total" -> r:^\w' + - 'not c:sh -c "ls -la /opt/ssh/etc/ssh_config | grep -v -e ^-rw-r--r--.*root.*sys | grep -v -e ^d | grep -v total" -> r:^\w' + + ################################################################# + # 1.2 Minimize inetd network services + ################################################################# + + - id: 25002 + title: "Disable Standard Services." + description: "The stock /etc/inetd.conf file shipped with HP-UX contains many services which are rarely used, or which have more secure alternatives. Indeed, after enabling SSH (see item 1.1.2) it may be possible to completely do away with all inetd-based services, since SSH provides both a secure login mechanism and a means of transferring files to and from the system. The steps articulated in the Remediation section will disable all services normally enabled in the HP-UX inetd.conf file. The rest of the actions in this section give the administrator the option of re-enabling certain services—in particular, the services that are disabled in the last two loops in the Action section below." + rationale: "The stock /etc/inetd.conf file shipped with HP-UX contains services that are rarely used or have more secure alternatives. Removing these from inetd will avoid exposure to possible security vulnerability in those services." + remediation: 'Perform the following to disable standard inetd-based services: 1. Change to the /etc directory 2. Open inetd.conf 3. Disable the following services by adding a comment character (#) to the beginning of its definition: a. echo b. discard c. daytime d. chargen e. dtspc f. exec g. ntalk h. finger i. uucp j. ident k. auth l. instl_boots m. registrar n. recserv o. rpc.rstatd p. rpc.rusersd q. rpc.rwalld r. rpc.sprayd s. rpc.cmsd t. kcms_server u. printer v. shell w. login h. finger x. telnet y. ftp z. tftp aa. bootps bb. kshell cc. klogin dd. rpc.rquotad ee. rpc.ttdbserver 4. Save inetd.conf. 5. Set root as the owner of inetd.conf. 6. Set sys as the group owner of inetd.conf. 7. Restrict write access to inetd.conf to the file owner. 8. Remove the executable and sticky bit from inetd.conf. 9. Invoke inetd to reread it''s config file: inetd -c The following script will perform the above procedure: cd /etc for svc in echo discard daytime chargen dtspc \ exec ntalk finger uucp ident auth \ instl_boots registrar recserv; do awk "(\$1 == \"$svc\") { \$1 = \"#\" \$1 }; {print}" \ inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf done for svc in rpc.rstatd rpc.rusersd rpc.rwalld \ rpc.sprayd rpc.cmsd kcms_server; do awk "/\\/$svc/ { \$1 = \"#\" \$1 }; { print }" \ inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf done for svc in printer shell login telnet ftp tftp \ bootps kshell klogin; do awk "(\$1 == \"$svc\") { \$1 = \"#\" \$1 }; {print}" \ inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf done for svc in rpc.rquotad rpc.ttdbserver; do awk "/^$svc\\// { \$1 = \"#\" \$1 }; { print }" \ /etc/inetd.conf > /etc/inetd.conf.new cp inetd.conf.new inetd.conf done chown root:sys inetd.conf chmod go-w,a-xs inetd.conf rm -f /etc/inetd.conf.new inetd -c' + compliance: + - cis: ["1.2.1"] + - cis_level: ["1"] + references: + - http://docs.hp.com/en/B2355-60130/inetd.conf.4.html + condition: all + rules: + - 'not f:/etc/inetd.conf -> r:^\s*echo' + - 'not f:/etc/inetd.conf -> r:^\s*discard' + - 'not f:/etc/inetd.conf -> r:^\s*daytime' + - 'not f:/etc/inetd.conf -> r:^\s*chargen' + - 'not f:/etc/inetd.conf -> r:^\s*dtspc' + - 'not f:/etc/inetd.conf -> r:^\s*exec' + - 'not f:/etc/inetd.conf -> r:^\s*ntalk' + - 'not f:/etc/inetd.conf -> r:^\s*rpc.rwalld' + - 'not f:/etc/inetd.conf -> r:^\s*rpc.sprayd' + - 'not f:/etc/inetd.conf -> r:^\s*rpc.cmsd' + - 'not f:/etc/inetd.conf -> r:^\s*kcms_server' + - 'not f:/etc/inetd.conf -> r:^\s*printer' + - 'not f:/etc/inetd.conf -> r:^\s*shell' + - 'not f:/etc/inetd.conf -> r:^\s*login' + - 'not f:/etc/inetd.conf -> r:^\s*finger' + - 'not f:/etc/inetd.conf -> r:^\s*uucp' + - 'not f:/etc/inetd.conf -> r:^\s*ident' + - 'not f:/etc/inetd.conf -> r:^\s*auth' + - 'not f:/etc/inetd.conf -> r:^\s*instl_boots' + - 'not f:/etc/inetd.conf -> r:^\s*registrar' + - 'not f:/etc/inetd.conf -> r:^\s*recserv' + - 'not f:/etc/inetd.conf -> r:^\s*rpc.rstatd' + - 'not f:/etc/inetd.conf -> r:^\s*rpc.rusersd' + - 'not f:/etc/inetd.conf -> r:^\s*telnet' + - 'not f:/etc/inetd.conf -> r:^\s*ftp' + - 'not f:/etc/inetd.conf -> r:^\s*tftp' + - 'not f:/etc/inetd.conf -> r:^\s*bootps' + - 'not f:/etc/inetd.conf -> r:^\s*kshell' + - 'not f:/etc/inetd.conf -> r:^\s*klogin' + - 'not f:/etc/inetd.conf -> r:^\s*rpc.rquotad' + - 'not f:/etc/inetd.conf -> r:^\s*rpc.ttdbserver' + - 'not c:sh -c "ls -la /etc/inetd.conf | grep -v -e ^-rw-r--r--.*root.*sys | grep -v -e ^d | grep -v total" -> r:^\w' + + - id: 25003 + title: "Only enable telnet if absolutely necessary." + description: "Re-enable telnet. Telnet uses an unencrypted network protocol, which means data from the login session (such as passwords and all other data transmitted during the session) can be stolen by eavesdroppers on the network, and also that the session can be hijacked by outsiders to gain access to the remote system. HP-UX Secure Shell (OpenSSH) provides an encrypted alternative to telnet (and other utilities) and should be used instead." + rationale: "There is a mission-critical reason that requires users to access the system via telnet instead of the more secure SSH protocol." + remediation: 'Perform the following to re-enable telnet: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the telnet service definition. 3. Add -b /etc/issue to the end of the telnet service definition. This will cause telnet to display the contents of /etc/issue to users attempting to access the system via telnet. 4. Save /etc/inetd.conf. The following script will perform the above procedure: awk ''/^#telnet/ { $1 = "telnet" print $0 " -b /etc/issue"; next} { print } '' inetd.conf > /etc/inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new' + compliance: + - cis: ["1.2.2"] + condition: all + rules: + - 'not f:/etc/inetd.conf -> r:^\s*telnet' + + - id: 25004 + title: "Only enable FTP if absolutely necessary." + description: "Re-enable ftp. Like telnet, the FTP protocol is unencrypted, which means passwords and other data transmitted during the session can be captured by sniffing the network, and that the FTP session itself can be hijacked by an external attacker. SSH provides two alternative, encrypted file transfer mechanisms, scp and sftp, which should be used instead of FTP. Even if FTP is required because the local system is an anonymous FTP server, consider requiring authenticated users on the system to transfer files via SSH-based protocols. For further information on restricting FTP access to the system, see item 1.6.2 below. Sites may also consider augmenting the 'ftpd -l' below with '-v' (10.x and 11.x) or '-L' (11.x only) for additional logging of FTP transactions, or with '-a' (11.x only) for fine grain FTP access control through the use of a configuration file - see the ftpd(1M) man page on your systems for details." + rationale: "This machine serves as an (anonymous) FTP server or other mission-critical role where data must be transferred via FTP instead of the more secure alternatives." + remediation: 'Perform the following to re-enable FTP: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the ftp service definition. 3. Save /etc/inetd.conf. The following script will perform the above procedure: awk '' /^#ftp/ { $1 = "ftp"; print $0; next} { print } '' inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new' + compliance: + - cis: ["1.2.3"] + condition: all + rules: + - 'not f:/etc/inetd.conf -> r:^\s*ftp' + + - id: 25005 + title: "Only enable rlogin/remsh/rcp if absolutely necessary." + description: "Re-enable rlogin/remsh/rcp. SSH was designed to be a drop-in replacement for these protocols. Given the wide availability of free SSH implementations, there are few cases where these tools cannot be replaced with SSH (again, see item 1.2.1 - Install SSH)." + rationale: "There is a mission-critical reason to use rlogin/remsh/rcp instead of the more secure ssh/scp." + remediation: "Perform the following to re-enable rlogin/remsh/rcp: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the shell and login service definitions. 3. Save /etc/inetd.conf. The following script will perform the above procedure: sed 's/^#shell/shell/; s/^#login/login/' \ inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new" + compliance: + - cis: ["1.2.4"] + condition: all + rules: + - 'not f:/etc/inetd.conf -> r:^\s*shell' + - 'not f:/etc/inetd.conf -> r:^\s*login' + + - id: 25006 + title: "Only enable TFTP if absolutely necessary." + description: "Re-enable TFTP. TFTP is typically used for network booting of diskless workstations, X-terminals, and other similar devices. TFTP is also used during network installs of systems via the HP-UX Ignite facility. Routers and other network devices may copy configuration data to remote systems via TFTP for backup." + rationale: "This system serves as a boot server or has other mission-critical roles where data must be transferred to and from this system via TFTP." + remediation: "Perform the following to re-enable TFTP: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the tftp service definition. 3. Save /etc/inetd.conf. The following script will perform the above procedure: sed 's/^#tftp/tftp/' inetd.conf >inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new mkdir -p /var/opt/ignite" + compliance: + - cis: ["1.2.5"] + condition: all + rules: + - 'not f:/etc/inetd.conf -> r:^\s*TFTP' + + - id: 25007 + title: "Only enable printer service if absolutely necessary." + description: "Re-enable rlpdaemon based printer service. rlpdaemon provides a BSD-compatible print server interface. Even machines that are print servers may wish to leave this service disabled if they do not need to support BSD-style printing." + rationale: "This machine a print server for your network." + remediation: "Perform the following to re-enable the rlpdaemon based printer service: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the printer definition. 3. Save /etc/inetd.conf. The following script will perform the above procedure: sed 's/^#printer/printer/' inetd.conf >inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new" + compliance: + - cis: ["1.2.6"] + condition: all + rules: + - 'not f:/etc/inetd.conf -> r:^\s*printer' + + - id: 25008 + title: "Only enable rquotad if absolutely necessary." + description: "Re-enable rquotad. rquotad allows NFS clients to enforce disk quotas on file systems that are mounted from the local system. If your site does not use disk quotas, then you may leave the rquotad service disabled." + rationale: "This system an NFS file server that requires the use of disk quotas." + remediation: 'Perform the following to re-enable rquotad: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the rquotad definition. 3. Save /etc/inetd.conf. The following script will perform the above procedure: awk '' $6 ~ /\/rpc.rquotad$/ { sub(/^#/, "") } { print } '' inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new' + compliance: + - cis: ["1.2.7"] + condition: all + rules: + - 'not f:/etc/inetd.conf -> r:^\s*rquotad' + + - id: 25009 + title: "Only enable CDE-related daemons if absolutely necessary." + description: "Re-enable CDE-related daemons. The rpc.ttdbserver service supports HP's CDE windowing environment. This service has a history of security problems. Not only is it vital to keep up to date on vendor patches, but also never enable this service on any system which is not well protected by a complete network security infrastructure (including network and host-based firewalls, packet filters, and intrusion detection infrastructure). Note that since this service uses ONC RPC mechanisms, it is important that the system's RPC portmapper (rpcbind) also be enabled when this service is turned on." + rationale: "There a mission-critical reason to run a CDE GUI on this system." + remediation: 'Perform the following to re-enable CDE-related daemons: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the rpc.ttdbserver 3. Save /etc/inetd.conf. The following script will perform the above procedure: awk '' $6 ~ /\/rpc.ttdbserver$/ { sub(/^#/, "") } { print } '' inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new' + compliance: + - cis: ["1.2.8"] + condition: all + rules: + - 'not f:/etc/inetd.conf -> r:^\s*rpc.ttdbserver' + + - id: 25010 + title: "Only enable Kerberos-related daemons if absolutely necessary." + description: "Re-enable Kerberos-related daemons. Kerberized rlogin/remsh offers a higher degree of security than traditional rlogin, remsh, or telnet by eliminating many clear-text password exchanges from the network. However it is still not as secure as SSH, which encrypts all traffic. Given the wide availability of free SSH implementations, there are few cases where these tools cannot be replaced with SSH." + rationale: "The Kerberos security system is in use at this site and there is a mission-critical reason that requires users to access this system via Kerberized rlogin/remsh, rather than the more secure SSH protocol." + remediation: "Perform the following to re-enable Kerberos-related daemons: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the klogin definition. 3. Save /etc/inetd.conf. The following script will perform the above procedure: sed 's/^#kshell/kshell/; s/^#klogin/klogin/' \ inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new" + compliance: + - cis: ["1.2.9"] + condition: any + rules: + - 'not f:/etc/inetd.conf -> r:^\s*klogin' + - 'not f:/etc/inetd.conf -> r:^\s*kshell' + + - id: 25011 + title: "Only enable BOOTP/DHCP daemon if absolutely necessary." + description: "Re-enable BOOTP/DHCP services. BOOTP/DHCP is a popular protocol for dynamically assigning IP addresses and other network information to systems on the network (rather than having administrators manually manage this information on each host). However, if this system is not a BOOTP/DHCP server for the network, there is no need to be running this service." + rationale: "This server a BOOTP/DHCP server for the network." + remediation: "Perform the following to re-enable BOOTP/DHCP services: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the bootps definition. 3. Save /etc/inetd.conf. The following script will perform the above procedure: sed 's/^#bootps/bootps/' \ inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf" + compliance: + - cis: ["1.2.10"] + condition: all + rules: + - 'not f:/etc/inetd.conf -> r:^\s*bootps' + + ################################################################# + # 1.3 Minimize boot services + ################################################################# + + - id: 25012 + title: "Disable login: prompts on serial ports." + description: "Disable the login: prompt on the system serial devices to make it more difficult for unauthorized users to attach modems, terminals, and other remote access devices to these ports." + rationale: "If there is not a mission-critical need to provide login capability from any serial ports (such as for a modem) then disabling the login: prompt on the system serial devices reduces the risk of unauthorized access via these ports." + remediation: "Perform the following to disable the login: prompt on the system serial devices: 1. Open /etc/inittab. 2. Disable each getty instance associated with a tty device by adding a comment character (#) to the beginning of the line. 3. Save /etc/inittab.* The following script will perform the above procedure: cp -p /etc/inittab /etc/inittab.tmp sed 's/^[^#].*getty.*tty.*$/#&/' \ /etc/inittab.tmp > /etc/inittab rm -f /etc/inittab.tmp - Note that this action may safely be performed even if console access to the system is provided via the serial ports, as the line in the /etc/inittab file that corresponds to the console does not match the supplied pattern (i.e., it doesn't contain the string 'tty'). - Note that when serial port connectivity is needed, /etc/dialups and /etc/d_passwd can be set to require an extra password for serial port access. See the dialups(4) manual page for more information. - Note that by default in HP-UX 11i, only the console has a getty instance running on it." + compliance: + - cis: ["1.3.1"] + - cis_level: ["1"] + condition: all + rules: + - "not f:/etc/inittab -> !r:^# && r:getty" + + - id: 25013 + title: "Disable NIS/NIS+ related processes, if possible." + description: "Disable NIS/NIS+ related processes. Network Information Service (NIS) is a distributed database providing centralized control of names, addresses, services, and key configuration files throughout a network of servers and clients. NIS was formerly known as Yellow Pages (YP). NIS+ is a replacement for NIS services, and is more scalable, flexible, and secure. It adds a security system with authentication and authorization services to validate users on the network and to determine if they allowed to access or modify the information requested. However, both systems have known security vulnerabilities, and have been an entry point for security attacks." + rationale: "Eliminate exposure to NIS/NIS+ vulnerabilities by not running related daemons on hosts that are not NIS/NIS+ servers or clients." + remediation: "Perform the following to disable the startup of NIS/NIS+ related processes: ch_rc -a -p NIS_MASTER_SERVER=0 -p NIS_SLAVE_SERVER=0 \ -p NIS_CLIENT=0 -p NISPLUS_SERVER=0 \ -p NISPLUS_CLIENT=0 /etc/rc.config.d/namesvrs" + compliance: + - cis: ["1.3.2"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/rc.config.d/namesvrs -> r:^NIS_MASTER_SERVER=0" + - "f:/etc/rc.config.d/namesvrs -> r:^NIS_CLIENT=0" + - "f:/etc/rc.config.d/namesvrs -> r:^NIS_SLAVE_SERVER=0" + - "f:/etc/rc.config.d/namesvrs -> r:^NISPLUS_SERVER=0" + - "f:/etc/rc.config.d/namesvrs -> r:^NISPLUS_CLIENT=0" + + - id: 25014 + title: "Disable printer daemons, if possible." + description: "Disable printer daemons. The Technical Print Service (TPS) is a printer service used in the X-Windows and/or CDE environment. It is recommended that this service be disabled if the hosting system does not participate in print services The administrator may wish to consider converting to the LPRng print system (see http://www.lprng.org/) which was designed with security in mind and is widely portable across many different Unix platforms. Note, however, that LPRng is not supported by Hewlett-Packard." + rationale: "Disabling unused services, such as TPS, will reduce the remote and local attack surfaces of the hosting system." + remediation: 'Perform the following to disable printer daemons: 1. Set the LP parameter to zero in the lp system configuration file /etc/rc.config.d/lp 2. Set the XPRINTSERVERS parameter to an empty string in the tps system configuration file /etc/rc.config.d/tps The following script will perform the above procedure: ch_rc -a -p XPRINTSERVERS="''''" /etc/rc.config.d/tps ch_rc -a -p LP=0 /etc/rc.config.d/lp' + compliance: + - cis: ["1.3.3"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/rc.config.d/lp -> r:^LP=0" + - 'f:/etc/rc.config.d/tps -> r:^XPRINTSERVERS="''''"' + + - id: 25015 + title: "Disable the CDE GUI login, if possible." + description: "CDE stands for 'Common Desktop Environment,' and is an environment for logging on to and interacting with your system via an X-windows type GUI interface from the console. Intended for use with workstation or desktop systems, this service is not commonly used with the server-class systems or in large enterprise environments. The X Windows-based CDE GUI services were developed with a different set of security expecations from those expected in many enterprise deployments, and have had a history of security issues. Unless there is a mission-critical need for a CDE GUI login to the system, this service should not be run to further reduce opportunities for security attacks." + rationale: "The X Windows-based CDE GUI on HP-UX systems has had a history of security issues, and should be disabled if unused." + remediation: 'Perform the following to disable the GUI login: ch_rc -a -p DESKTOP="" /etc/rc.config.d/desktop' + compliance: + - cis: ["1.3.4"] + - cis_level: ["1"] + condition: any + rules: + - "not f:/etc/rc.config.d/desktop" + - 'f:/etc/rc.config.d/desktop -> r:DESKTOP=""$' + + - id: 25016 + title: "Disable email server, if possible." + description: "Disable the sendmail daemon to avoid processing incoming email. It is possible to run a Unix system with the Sendmail daemon disabled and still allow users on that system to send email out from that machine. Running Sendmail in 'daemon mode' (with the -bd command-line option) is only required on machines that act as mail servers, receiving and processing email from other hosts on the network. The remediation below will result in a machine that can send email but not receive it. - Note that after disabling the -bd option on the local mail server on systems running Sendmail v8.12 or later (8.13 is currently shipped as part of HP-UX 11iv3), it is also necessary to modify the /etc/mail/submit.cf file. Find the line that reads 'D{MTAHost}localhost' and change localhost to the name of some other local mail server for the organization. This will cause email generated on the local system to be relayed to that mail server for further processing and delivery. - Note that if the system is an email server, the administrator is encouraged to search the Web for additional documentation on Sendmail security issues." + rationale: "Avoid potential vulnerabilities in the sendmail server if incoming email service is not used." + remediation: "Perform the following to disable the sendmail server: 1. Set the SENDMAIL_SERVER parameter to zero in the mailservs system configuration file. 2. Setup a cron job to run sendmail at regular intervals (e.g. every hour) in order to process queued, outgoing mail. The following script will perform the above procedure: ch_rc -a -p SENDMAIL_SERVER=0 /etc/rc.config.d/mailservs cd /var/spool/cron/crontabs crontab -l >root.tmp echo '0 * * * * /usr/lib/sendmail -q' >>root.tmp crontab root.tmp rm -f root.tmp" + compliance: + - cis: ["1.3.5"] + - cis_level: ["1"] + references: + - http://www.deer-run.com/~hal/dns-sendmail/DNSandSendmail.pdf + - http://www.sendmail.org/ + condition: all + rules: + - "f:/etc/rc.config.d/mailservs -> r:SENDMAIL_SERVER=0" + - 'c:crontab -l -> r:^\d+\.*sendmail -q' + + - id: 25017 + title: "Disable SNMP and OpenView Agents, if remote management or monitoring are not needed." + description: "Disable SNMP and OpenView agents if they are not needed. Note: If SNMP is used, it is recommended to change the default SNMP community string by modifying the get-community and set-community parameters in the SNMP configuration file /etc/SnmpAgent.d/snmpd.conf." + rationale: "If SNMP and OpenView agents are not needed, avoid potential security vulnerabilities in these programs by disabling them." + remediation: "Perform the following to disable the SNMP and OpenView Agents: cd /sbin/rc2.d mv -f S570SnmpFddi .NOS570SnmpFddi ch_rc -a -p SNMP_HPUNIX_START=0 \ /etc/rc.config.d/SnmpHpunix ch_rc -a -p SNMP_MASTER_START=0 \ /etc/rc.config.d/SnmpMaster ch_rc -a -p SNMP_MIB2_START=0 \ /etc/rc.config.d/SnmpMib2 ch_rc -a -p SNMP_TRAPDEST_START=0 \ /etc/rc.config.d/SnmpTrpDst ch_rc -a -p OSPFMIB=0 \ /etc/rc.config.d/netdaemons ch_rc -a -p OPCAGT=0 \ /etc/rc.config.d/opcagt" + compliance: + - cis: ["1.3.6"] + - cis_level: ["1"] + condition: all + rules: + - "not f:/sbin/rc2.d/S570SnmpFddi" + - "f:/etc/rc.config.d/SnmpHpunix -> r:SNMP_HPUNIX_START=0" + - "f:/etc/rc.config.d/SnmpMaster -> r:SNMP_MASTER_START=0" + - "f:/etc/rc.config.d/SnmpMib2 -> r:SNMP_MIB2_START=0" + - "f:/etc/rc.config.d/SnmpTrpDst -> r:SNMP_TRAPDEST_START=0" + - "f:/etc/rc.config.d/netdaemons -> r:OSPFMIB=0" + - "f:/etc/rc.config.d/opcagt -> r:OPCAGT=0" + + - id: 25018 + title: "Disable rarely used standard boot services." + description: 'Disable other standard boot services. Setting these variables in the /etc/rc.config.d configuration files will effectively disable a wide variety of infrequently used subsystems. Variables are merely set (rather than renaming or removing startup scripts) so that the local administrator can easily "restore" any of these services if they discover a mission-critical need to have it. Additionally, HP-UX patches tend to supply fresh copies of the startup scripts, so they may get inadvertently re- enabled, whereas setting configuration variables usually survives patch installs. Finally, setting configuration variables is the method recommended and supported by HP. Note that not all of the configuration files listed above will exist on all systems (some are only valid for certain releases, others only exist if certain OEM vendor software is installed). The rest of the actions in this section give the administrator the option of re-enabling certain services - in particular, the services that are disabled in the second block of the remediation section below. Rather than disabling and then re-enabling these services, experienced administrators may wish to simply disable only those services that they know are unnecessary for their systems. Note: that HP-UX 11.31 was the first version to support disablement of the NFS core services. Disablement on earlier versions is possible by moving /sbin/rc2.d/S400nfs.core to /sbin/rc2.d/.NOS400nfs.core, but there is some risk of system instability.' + rationale: "Avoid potential security vulnerabilities in infrequently used subsystems by disabling them." + remediation: 'Perform the following: ch_rc -a -p START_SNAPLUS=0 -p START_SNANODE=0 \ -p START_SNAINETD=0 /etc/rc.config.d/snaplus2 ch_rc -a -p MROUTED=0 -p RWHOD=0 \-p DDFA=0 \ -p START_RBOOTD=0 /etc/rc.config.d/netdaemons ch_rc -a -p RARPD=0 -p RDPD=0 /etc/rc.config.d/netconf ch_rc -a -p PTYDAEMON_START=0 /etc/rc.config.d/ptydaemon ch_rc -a -p VTDAEMON_START=0 /etc/rc.config.d/vt ch_rc -a -p NAMED=0 /etc/rc.config.d/namesvrs ch_rc -a -p START_I4LMD=0 /etc/rc.config.d/i4lmd ch_rc -a -p RUN_X_FONT_SERVER=0 /etc/rc.config.d/xfs ch_rc -a -p AUDIO_SERVER=0 /etc/rc.config.d/audio ch_rc -a -p SLSD_DAEMON=0 /etc/rc.config.d/slsd ch_rc -a -p RUN_SAMBA=0 /etc/rc.config.d/samba ch_rc -a -p RUN_CIFSCLIENT=0 \ /etc/rc.config.d/cifsclient ch_rc -a -p NFS_SERVER=0 \ -p NFS_CLIENT=0 /etc/rc.config.d/nfsconf ch_rc -a -p HPWS_APACHE_START=0 /etc/rc.config.d/hpws_apacheconf ch_rc -a -p NFS_CORE=0 /etc/rc.config.d/nfsconf' + compliance: + - cis: ["1.3.7"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/rc.config.d/snaplus2 -> r:START_SNAPLUS=0" + - "f:/etc/rc.config.d/snaplus2 -> r:START_SNANODE=0" + - "f:/etc/rc.config.d/snaplus2 -> r:START_SNAINETD=0" + - "f:/etc/rc.config.d/netdaemons -> r:MROUTED=0" + - "f:/etc/rc.config.d/netdaemons -> r:RWHOD=0" + - "f:/etc/rc.config.d/netdaemons -> r:DDFA=0" + - "f:/etc/rc.config.d/netdaemons -> r:START_RBOOTD=0" + - "f:/etc/rc.config.d/netconf -> r:RARPD=0" + - "f:/etc/rc.config.d/netconf -> r:RDPD=0" + - "f:/etc/rc.config.d/ptydaemon -> r:PTYDAEMON_START=0" + - "f:/etc/rc.config.d/vt -> r:VTDAEMON_START=0" + - "f:/etc/rc.config.d/namesvrs -> r:NAMED=0" + - "f:/etc/rc.config.d/i4lmd -> r:START_I4LMD=0" + - "f:/etc/rc.config.d/xfs -> r:RUN_X_FONT_SERVER=0" + - "f:/etc/rc.config.d/audio -> r:AUDIO_SERVER=0" + - "f:/etc/rc.config.d/slsd -> r:SLSD_DAEMON=0" + - "f:/etc/rc.config.d/samba -> r:RUN_SAMBA=0" + - "f:/etc/rc.config.d/cifsclient -> r:RUN_CIFSCLIENT=0" + - "f:/etc/rc.config.d/nfsconf -> r:NFS_SERVER=0" + - "f:/etc/rc.config.d/nfsconf -> r:NFS_CLIENT=0" + - "f:/etc/rc.config.d/hpws_apacheconf -> r:HPWS_APACHE_START=0" + - "f:/etc/rc.config.d/hpws_nfsconf -> r:NFS_CORE=0" + + - id: 25019 + title: "Only enable Windows-compatibility server processes if absolutely necessary." + description: "Re-enable CIFS Server (Samba) services. HP-UX 11i includes the popular Open Source Samba server (HP-UX CIFS Server) for providing file and print services to Windows-based systems. This allows an HP-UX system to act as a file or print server on a Windows network, and even act as a Domain Controller (authentication server) to older Windows operating systems. However, if this functionality is not required by the site, this service should be disabled." + rationale: "This machine provides authentication, file sharing, or printer sharing services to systems running Microsoft Windows operating systems." + remediation: "Perform the following to re-enable CIFS Server: ch_rc -a -p RUN_SAMBA=1 /etc/rc.config.d/samba" + compliance: + - cis: ["1.3.8"] + condition: all + rules: + - "f:/etc/rc.config.d/samba -> r:RUN_SAMBA=0" + + - id: 25020 + title: "Only enable Windows-compatibility client processes if absolutely necessary." + description: "Re-enable the HP CIFS Client service." + rationale: "This system requires access to file systems from remote servers via the Windows (SMB) file services." + remediation: "Perform the following: ch_rc -a -p RUN_CIFSCLIENT=1 /etc/rc.config.d/cifsclient" + compliance: + - cis: ["1.3.9"] + condition: any + rules: + - "not f:/etc/rc.config.d/cifsclient" + - "f:/etc/rc.config.d/cifsclient -> r:RUN_CIFSCLIENT=0" + + - id: 25021 + title: "Only enable NFS server processes if absolutely necessary." + description: 'Re-enable the NFS file service. NFS is frequently exploited to gain unauthorized access to files and systems. Clearly there is no need to run the NFS server-related daemons on hosts that are not NFS servers. If the system is an NFS server, the admin should take reasonable precautions when exporting file systems, including restricting NFS access to a specific range of local IP addresses and exporting file systems "read-only" and "nosuid" where appropriate. For more information consult the exportfs(1M) manual page. Much higher levels of security can be achieved by combining NFS with secure RPC or Kerberos, although there is significant administrative overhead involved in this transition. Note that since this service uses ONC RPC mechanisms, it is important that the system''s RPC portmapper (rpcbind) also be enabled when this service is turned on. For more information see Item 1.3.12 below. Also, note that some releases of Oracle software for HP-UX require NFS services in order to install properly. Therefore, the NFS server process may need to be started by hand on systems on which Oracle software is to be installed/updated. This can be accomplished by performing the following: 1. Temporarily set NFS_SERVER=1, /etc/rc.config.d/nfsconf 2. Execute: /sbin/init.d/nfs.core start /sbin/init.d/nfs.server start 3. Install Oracle 4. Stop the NFS services: /sbin/init.d/nfs.core stop /sbin/init.d/nfs.server stop 5. Disable the NFS services by resetting NFS_SERVER=0, NUM_NFSD=0, and NUM_NFSIOD=0 in /etc/rc.config.d/nfsconf.' + rationale: "This machine is a NFS file server." + remediation: "Perform the following: ch_rc -a -p NFS_SERVER=1 /etc/rc.config.d/nfsconf" + compliance: + - cis: ["1.3.10"] + condition: all + rules: + - "f:/etc/rc.config.d/nfsconf -> r:NFS_SERVER=0" + - "f:/etc/rc.config.d/nfsconf -> r:NUM_NFSD=0" + - "f:/etc/rc.config.d/nfsconf -> r:NUM_NFSIOD=0" + + - id: 25022 + title: "Only enable NFS client processes if absolutely necessary." + description: "Re-enable the NFS Client service. Again, unless there is a significant need for this system to acquire data via NFS, administrators should disable NFS-related services. Note that other file transfer schemes (such as rdist via SSH) can often be more secure than NFS for certain applications, although again the use of secure RPC or Kerberos can significantly improve NFS security. Also note that if the machine will be an NFS client, then the rpcbind process must be running (see Item 3.12 below). - Note that since this service uses ONC RPC mechanisms, it is important that the system's RPC portmapper (rpcbind) also be enabled when this service is turned on. For more information see Item 3.12 below." + rationale: "This system must access file systems from remote servers via NFS." + remediation: "Perform the following: ch_rc -a -p NFS_CLIENT=1 /etc/rc.config.d/nfsconf" + compliance: + - cis: ["1.3.11"] + condition: all + rules: + - "f:/etc/rc.config.d/nfsconf -> r:NFS_CLIENT=0" + + - id: 25023 + title: "Only enable RPC-based services if absolutely necessary." + description: "Re-enable RPC-based services. RPC-based services typically use very weak or non-existent authentication and yet may share very sensitive information. Unless one of the services listed above is required on this machine, it is best to disable RPC-based tools completely. If you are unsure whether or not a particular third-party application requires RPC services, consult with the application vendor. Note that disabling this service by renaming the startup file may not survive the install of RPC-related patches." + rationale: "RPC-based services are used such as: - This machine is an NFS client or server. - This machine is an NIS (YP) or NIS+ client or server. - This machine runs a GUI or GUI-based administration tool. - The machine runs a third-party software application which is dependent on RPC support (example: FlexLM License managers)." + remediation: "Perform the following for 11.31 and later: ch_rc -a -p NFS_CORE=1 /etc/rc.config.d/nfsconf For 11.23 and prior: mv -f /sbin/rc2.d/.NOS400nfs.core \ /sbin/rc2.d/400nfs.core" + compliance: + - cis: ["1.3.12"] + condition: all + rules: + - "f:/etc/rc.config.d/nfsconf -> r:NFS_CORE=0" + + - id: 25024 + title: "Only enable Web server if absolutely necessary." + description: "Re-enable the Web server suite. Even if this machine is a Web server, the local site may choose not to use the Web server provided with HP-UX in favor of a locally developed and supported Web environment. If the machine is a Web server, the administrator is encouraged to search the Web for additional documentation on Web server security. A good starting point is http://httpd.apache.org/docs-2.0/misc/security_tips.html. Note that this action only disables the default web server shipped with the system. Other webservers instances may still be running." + rationale: "There is a mission-critical reason why this system must run a Web server." + remediation: "Perform the following: ch_rc -a -p NS_FTRACK=1 /etc/rc.config.d/ns-ftrack ch_rc -a -p APACHE_START=1 /etc/rc.config.d/apacheconf ch_rc -a -p HPWS_APACHE32_START=1 /etc/rc.config.d/hpws_apache32conf ch_rc -a -p HPWS_TOMCAT_START=1 /etc/rc.config.d/hpws_tomcatconf ch_rc -a -p NS_FTRACK=1 /etc/rc.config.d/ns-ftrack ch_rc -a -p HPWS_WEBMIN_START=1 /etc/rc.config.d/hpws_webminconf" + compliance: + - cis: ["1.3.13"] + condition: all + rules: + - "f:/etc/rc.config.d/apacheconf -> r:APACHE_START=0" + - "f:/etc/rc.config.d/hpws_apache32conf -> r:HPWS_APACHE32_START=0" + - "f:/etc/rc.config.d/hpws_tomcatconf -> r:HPWS_TOMCAT_START=0" + - "f:/etc/rc.config.d/ns-ftrack -> r:NS_FTRACK=0" + - "f:/etc/rc.config.d/hpws_webminconf -> r:HPWS_WEBMIN_START=0" + + - id: 25025 + title: "Only enable BIND DNS server if absolutely necessary." + description: "Re-enable the BIND DNS service. The BIND DNS server, or named, maps IP addresses to hostnames across the Internet and supplies these services to other hosts on the local local network. Though it has been widely implemented, BIND has a long history of security flaws, especially in the BIND 8.x release tree generally shipped with HP-UX 11.x systems. Therefore, if you are going to run BIND, you should strongly consider moving to the BIND 9.x release-tree. HP has supported BIND 9 packages available from http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=BIND9.2 . Or it is available directly from the Internet Software Consortium (the developers of BIND), whose website is at http://www.isc.org." + rationale: "There exists a mission-critical reason why this system must run a DNS server." + remediation: "Perform the following: 11.23 and prior: ch_rc -a -p NAMED=1 /etc/rc.config.d/namesvrs 11.31 and later: ch_rc -a -p NAMED=1 /etc/rc.config.d/namesvrs_dns" + compliance: + - cis: ["1.3.14"] + condition: all + rules: + - "f:/etc/rc.config.d/namesvrs_dns -> r:NAMED=0" + + ################################################################# + # 1.4 Kernel Tuning + ################################################################# + + - id: 25026 + title: "Enable stack protection." + description: "Enabling stack protection prevents certain classes of buffer overflow attacks and is a significant security enhancement. - Note that HP-UX 11i is much more capable in this and other security areas than older releases; therefore, administrators should strongly consider upgrading from older releases. - Note that this action requires a subsequent reboot to take effect in some versions of HP-UX." + rationale: "Buffer overflow exploits have been the basis for many of the recent highly publicized compromises and defacements of large numbers of Internet connected systems. Many of the automated tools in use by system crackers exploit well-known buffer overflow problems in vendor-supplied and third-party software. Enabling stack protection prevents certain classes of buffer overflow attacks and is a significant security enhancement." + remediation: "For 11i v2 and later: kctune -K executable_stack=0 For 11i v1: /usr/sbin/kmtune -s executable_stack=0 && mk_kernel && kmupdate" + compliance: + - cis: ["1.4.1"] + - cis_level: ["1"] + condition: all + rules: + - 'c:sh -c "kctune | grep executable_stack" -> r:executable_stack\s+0' + + - id: 25027 + title: "Network parameter modifications." + description: "Modify the network parameter boot configuration file to meet current best practices. Note: HP-UX 11.11 systems require patch PHNE_25644 for ndd to set arp_cleanup_interval from /etc/rc.config.d/nddconf. - Bastille Note: Bastille performs a similar action but does not support the exact same changes." + rationale: "Network parameter default values should align with current best practices unless there is a specific need to use other values." + remediation: "Perform the following to update the default network parameter values: 1. Change to the /etc/rc.config.d directory 2. Open nddconf and review the comment lines on how to use the configuration file 3. Set each of the following network parameters to the recommended value. If a parameter does not have an entry in nddconf then add a new entry to the end of the file while properly incrementing the parameter index. 4. Save nddconf. - If creating this file for the first time: 1. Set root as the owner of nddconf. 2. Set sys as the group owner of nddconf. 3. Restrict write access to nddconf to the file owner. 4. Remove the executable and sticky bit from nddconf. If the existing nddconf file contains no entries, then the following script will perform the above procedure: cd /etc/rc.config.d cat < nddconf # Increase size of half-open connection queue TRANSPORT_NAME[0]=tcp NDD_NAME[0]=tcp_syn_rcvd_max NDD_VALUE[0]=4096 # Reduce timeouts on ARP cache TRANSPORT_NAME[1]=arp NDD_NAME[1]=arp_cleanup_interval NDD_VALUE[1]=60000 # Drop source-routed packets TRANSPORT_NAME[2]=ip NDD_NAME[2]=ip_forward_src_routed NDD_VALUE[2]=0 # Don't forward directed broadcasts TRANSPORT_NAME[3]=ip NDD_NAME[3]=ip_forward_directed_broadcasts NDD_VALUE[3]=0 # Don't respond to unicast ICMP timestamp requests TRANSPORT_NAME[4]=ip NDD_NAME[4]=ip_respond_to_timestamp NDD_VALUE[4]=0 # Don't respond to broadcast ICMP tstamp reqs TRANSPORT_NAME[5]=ip NDD_NAME[5]=ip_respond_to_timestamp_broadcast NDD_VALUE[5]=0 # Don't respond to ICMP address mask requests TRANSPORT_NAME[6]=ip NDD_NAME[6]=ip_respond_to_address_mask_broadcast NDD_VALUE[6]=0 # Don‟t respond to broadcast echo requests TRANSPORT_NAME[7]=ip NDD_NAME[7]=ip_respond_to_echo_broadcast NDD_VALUE[7]=0 EOF chown root:sys nddconf chmod go-w,ug-s nddconf" + compliance: + - cis: ["1.4.2"] + - cis_level: ["1"] + condition: all + rules: + - "c:ndd -get /dev/tcp tcp_syn_rcvd_max -> r:4096" + - "c:ndd -get /dev/arp arp_cleanup_interval -> r:60000" + - "c:ndd -get /dev/ip ip_forward_src_routed -> r:^0$" + - "c:ndd -get /dev/ip ip_forward_directed_broadcasts -> r:^0$" + - "c:ndd -get /dev/ip ip_respond_to_timestamp -> r:^0$" + - "c:ndd -get /dev/ip ip_respond_to_timestamp_broadcast -> r:^0$" + - "c:ndd -get /dev/ip ip_respond_to_address_mask_broadcast -> r:^0$" + - "c:ndd -get /dev/ip ip_respond_to_echo_broadcast -> r:^0$" + - 'not c:sh -c "ls -la /etc/rc.config.d/nddconf | grep -v -e ^-rw-r--r--.*root.*sys | grep -v -e ^d | grep -v total" -> r:^\w' + + - id: 25028 + title: "Use more random TCP sequence numbers." + description: "Generate initial TCP sequence numbers that comply with RFC1948. - Note: In HP-UX 11i v1 and later, an algorithm largely compliant with RFC1948 is already used. However, setting the isn passphrase closes the small remaining gap, and adds entropy to the seed." + rationale: "Makes remote off-net session hijacking attacks more difficult." + remediation: "Perform the following to use more random TCP sequence numbers upon system startup: 1. Create/open the file /sbin/rc2.d/S999tcpisn 2. Add the following line: ndd -set /dev/tcp tcp_isn_passprase= replacing with a string of random characters. 3. Save the file. 4. Set root as the owner and bin as the group owner of the file. 5. Restrict write access to the file. 6. Set the execution bit for the file." + compliance: + - cis: ["1.4.3"] + - cis_level: ["1"] + condition: all + rules: + - "not c:ndd -get /dev/tcp tcp_isn_passphrase -> r:^\\w+$" + - 'not c:sh -c "ls -la /sbin/rc2.d/S999tcpisn | grep -v -e ^-r-xr-xr-x.*root.*bin | grep -v -e ^d | grep -v total" -> r:^\w' + + - id: 25029 + title: "Additional network parameter modifications." + description: "Configure networking to NOT forward TCP/IP packets between multiple networks, even if the machine has multiple network adapters connected to multiple networks." + rationale: "System is not going to be used as a firewall or gateway to pass network traffic between different networks." + remediation: "Perform the following to disable forwarding TCP/IP packets between networks: 1. Change to the /etc/rc.config.d directory 2. Open nddconf and review the comment lines on how to use the configuration file 3. Set each of the following network parameters to the recommended value. If a parameter does not have an entry in nddconf then add a new entry to the end of the file while properly incrementing the parameter index. 4. Save nddconf. If creating this file for the first time: 5. Set root as the owner of nddconf. 6. Set sys as the group owner of nddconf. 7. Restrict write access to nddconf to the file owner. 8. Remove the executable and sticky bit from nddconf. The following script will perform the above procedure properly if used as a follow-on from the script in item 1.4.2: cat <> /etc/rc.config.d/nddconf # Don‟t act as a router TRANSPORT_NAME[8]=ip NDD_NAME[8]=ip_forwarding NDD_VALUE[8]=0 TRANSPORT_NAME[9]=ip NDD_NAME[9]=ip_send_redirects NDD_VALUE[9]=0 EOF" + compliance: + - cis: ["1.4.4"] + - cis_level: ["1"] + condition: all + rules: + - "c:ndd -get /dev/ip ip_forwarding -> r:^0$" + - "c:ndd -get /dev/ip ip_send_redirects -> r:^0$" + - 'not c:sh -c "ls -la /etc/rc.config.d/nddconf | grep -v -e ^-rw-r--r--.*root.*sys | grep -v -e ^d | grep -v total" -> r:^\w' + + ################################################################# + # 1.5 File/Directory Permissions/Access + ################################################################# + + # List of find folders command may need to be configured to work in a customized HP-UX deployment + - id: 25030 + title: "Resolve 'unowned' files and directories." + description: "Evaluate ownership of any files that are not owned by a locally defined user, and consider reassignment to an active user." + rationale: "Sometimes when administrators delete users from the system they neglect to remove all files owned by those users from the system. A new user who is assigned the deleted user's user ID or group ID may then end up 'owning' these files, and thus have more access on the system than was intended. It is a good idea to locate files that are owned by users or groups not listed in the system configuration files, and make sure to reset the ownership of these files to some active user on the system (in this example, 'bin') as appropriate." + remediation: 'Perform the following to identify "unowned" files and directories, and consider resetting ownership to a default owner and restricting access permissions: 1. Locate all local files that are owned by users or groups not listed in the system configuration files. find / \( -nouser -o -nogroup \) 2. Consider resetting user and group ownership of these files to a default active user (e.g. bin) chown bin:bin 3. Consider restricting world-write permissions, and removing any SUID/SGID bits on these files. chmod ug-s,o-w - Note: there is no reason for an application to require an unowned file, so these changes should be application-safe.' + compliance: + - cis: ["1.5.3"] + - cis_level: ["1"] + condition: none + rules: + - 'c:find /bin \( -nouser -o -nogroup \) -> r:\w' + - 'c:find /diskaldata \( -nouser -o -nogroup \) -> r:\w' + - 'c:find /lib \( -nouser -o -nogroup \) -> r:\w' + - 'c:find /opt \( -nouser -o -nogroup \) -> r:\w' + - 'c:find /tmp \( -nouser -o -nogroup \) -> r:\w' + - 'c:find /core \( -nouser -o -nogroup \) -> r:\w' + - 'c:find /etc \( -nouser -o -nogroup \) -> r:\w' + - 'c:find /sbin \( -nouser -o -nogroup \) -> r:\w' + - 'c:find /usr \( -nouser -o -nogroup \) -> r:\w' + - 'c:find /dev \( -nouser -o -nogroup \) -> r:\w' + - 'c:find /home \( -nouser -o -nogroup \) -> r:\w' + - 'c:find /net \( -nouser -o -nogroup \) -> r:\w' + - 'c:find /stand \( -nouser -o -nogroup \) -> r:\w' + - 'c:find /var \( -nouser -o -nogroup \) -> r:\w' + + ################################################################# + # 1.6 System Access, Authentication, and Authorization + ################################################################# + + - id: 25031 + title: "Enable Hidden Passwords." + description: "Enable hidden passwords by converting the system to a Trusted System or to use Shadow Passwords. - Note: do not perform this if the system runs applications that read the encrypted password entries in /etc/passwd directly." + rationale: "Without hidden passwords, an intruder could use any user's account to obtain hashed passwords and use crack or similar utilities to find easily guessed passwords. Password aging (covered in item 1.8.3) ensures that users change their passwords on a regular basis and helps stop the use of stolen passwords." + remediation: "Perform one of the following to convert the system to trusted mode or shadowed mode: A. Use the system management program smh or sam to convert to a trusted system -or- B. Use the command pwconv to convert to shadowed passwords." + compliance: + - cis: ["1.6.1"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/shadow" + + - id: 25032 + title: "Restrict users who can access to FTP." + description: "Configure FTP to prevent certain users from accessing the system via FTP. The file ftpusers contains a list of users who are not allowed to access the system via FTP. Generally, only normal users should ever access the system via FTP - there should be no reason for 'system' type accounts to be transferring information via this mechanism. Certainly, the root account should never be allowed to transfer files directly via FTP. - Note: more fine-grained FTP access controls can be placed in /etc/ftpd/ftpaccess." + rationale: "Privileged users such as root and other 'system' type accounts should never be transferring information via such an insecure service as FTP." + remediation: "Perform the following to restrict default priviledged users from access to FTP: 1. Add the users root daemon bin sys adm lp uucp nuucp nobody hpdb useradm to the file /etc/ftpd/ftpusers (each user on a single line). 2. Set the file owner and group owner to the user bin. 3. Set the file permissions so that only the file owner has read or write perms and no user has execute permission (600). The following script will create and populate the ftpusers file as described above: for name in root daemon bin sys adm lp \ uucp nuucp nobody hpdb useradm do echo $name done >> $ftpusers sort -u $ftpusers > $ftpusers.tmp cp $ftpusers.tmp $ftpusers rm -f $ftpusers.tmp chown bin:bin $ftpusers chmod 600 $ftpusers" + compliance: + - cis: ["1.6.2"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/ftpd/ftpusers" + - "f:/etc/ftpd/ftpusers -> r:^root$" + - "f:/etc/ftpd/ftpusers -> r:^daemon$" + - "f:/etc/ftpd/ftpusers -> r:^bin$" + - "f:/etc/ftpd/ftpusers -> r:^adm$" + - "f:/etc/ftpd/ftpusers -> r:^lp$" + - "f:/etc/ftpd/ftpusers -> r:^uucp$" + - "f:/etc/ftpd/ftpusers -> r:^nuucp$" + - "f:/etc/ftpd/ftpusers -> r:^nobody$" + - "f:/etc/ftpd/ftpusers -> r:^hpdb$" + - "f:/etc/ftpd/ftpusers -> r:^useradm$" + - 'not c:sh -c "ls -la /etc/ftpd/ftpusers | grep -v -e ^-rw-------.*bin.*bin | grep -v -e ^d | grep -v total" -> r:^\w' + + - id: 25033 + title: "Prevent Syslog from accepting messages from the network." + description: "Prevent syslogd from accepting messages from the network. By default the system logging daemon, syslogd, listens for log messages from other systems on network port 514/udp. Unfortunately, the protocol used to transfer these messages does not include any form of authentication, so a malicious outsider could simply barrage the local system's Syslog port with spurious traffic—either as a denial-of-service attack on the system, or to fill up the local system's logging file systems so that subsequent attacks will not be logged. - Note: Do not perform this action if this machine is a log server, or needs to receive Syslog messages via the network from other systems. - Note: It is considered good practice to setup one or more machines as central 'log servers' to aggregate log traffic from all machines at a site. However, unless a system is set up to be one of these 'log server' systems, it should not be listening on 514/udp for incoming log messages." + rationale: "Disabling unused network services will reduce the remote attack surfaces of the hosting system." + remediation: 'Disable the syslog network option by doing the following: 1. Open the syslogd startup configuration file /etc/rc.config.d/syslogd 2. Add the parameter "-N" to the SYSLOGD_OPTS= line if it is not already present 3. Save and close the file. The following script will perform the procedure above: SYSLOGD_OPTS="`sh -c ". /etc/rc.config.d/syslogd ; \ echo "$SYSLOGD_OPTS"''`" if [[ "$SYSLOGD_OPTS" = *-N* ]]; then ch_rc -a -p SYSLOGD_OPTS="-N $SYSLOGD_OPTS" \ /etc/rc.config.d/syslogd fi' + compliance: + - cis: ["1.6.3"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/rc.config.d/syslogd -> r:^SYSLOGD_OPTS && r:-N" + + - id: 25034 + title: "Disable XDMCP port." + description: "Disable the XDMCP port for remote login services. The standard GUI login provided on most Unix systems can act as a remote login server to other devices (including X terminals and other workstations). Access control is handled via the Xaccess file—by default under HP-UX, this file allows any system on the network to get a remote login screen from the local system. This behavior can be overridden in the /etc/dt/config/Xaccess file." + rationale: "XDMCP is an unencrypted protocol that may reduce the confidentiality and integrity of data that traverses it." + remediation: "Perform the following to disable the XDMCP port: 1. Open the file /etc/dt/config/Xconfig. If it does not exist, copy it from /usr/dt/config/Xconfig. 2. Append the line Dtlogin.requestPort:0 to the file and close. The following script will perform the procedure above: if [ ! -f /etc/dt/config/Xconfig ]; then mkdir -p /etc/dt/config cp -p /usr/dt/config/Xconfig /etc/dt/config fi cd /etc/dt/config awk '/Dtlogin.requestPort:/ \ { print \"Dtlogin.requestPort: 0\"; next } { print }' Xconfig > Xconfig.new cp Xconfig.new Xconfig rm -f Xconfig.new" + compliance: + - cis: ["1.6.4"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/dt/config/Xconfig" + - 'f:/etc/dt/config/Xconfig -> r:Dtlogin.requestPort:\s*0' + + - id: 25035 + title: "Configure IPFilter to allow only select communication." + description: "HP-UX IPFilter (B9901AA) is a stateful system firewall that controls IP packet flow in or out of a machine. It is installed by default on HP-UX 11iv2 (11.23) and later. On older systems, IPFilter can be obtained from http://www.hp.com/go/ipfilter. The rules below will work in an otherwise-empty ipf.conf file, or, if there are rules already present, it will block all that were not passed earlier in the ruleset. This is less likely to break things, but will allow more traffic through. Alternatively, you can instead take the pass lines below (not using the block rule), and change them into 'block in quick' rules, and place those at the top of the file. This will error on the side of blocking traffic. See ipf(5) for detail. Your ruleset can be tested using ipftest(1). Bastille note: if using to change and monitor the IPFilter firewall, ensure that rules are added to /etc/opt/sec_mgmt/bastille/ipf.customrules, and that Bastille is rerun with the last config file, so they will not be overwritten in a subsequent lockdown." + rationale: "Restricting incoming network traffic to explicitly allowed hosts will help prevent unauthorized access the system." + remediation: "Perform the following to add enable ipfilter and install a default ruleset to block unauthorized incoming connections: 1. Enable ipfilter: ipfilter -e 2. Append the following lines to /etc/opt/ipf/ipf.conf: block in all pass in from / pass in from / replacing each / with an authorized IP address and mask. 3. Flush the old rules and read in the updated rules: ipf -Fa -f /etc/opt/ipf/ipf.conf The following script can be used to as a template for creating your own script to perform the procedure above: ipfilter -e cat <> /etc/opt/ipf/ipf.conf block in all pass in from / pass in from / EOF ipf -Fa -f /etc/opt/ipf/ipf.conf" + compliance: + - cis: ["1.6.6"] + - cis_level: ["1"] + condition: all + rules: + - "c:ipfilter -e -> r:IPFilter Enabled" + - "c:ipfstat -io -> r:block in from any to any" + + - id: 25036 + title: "Restrict at/cron to authorized users." + description: "The cron.allow and at.allow files are a list of users who are allowed to run the crontab and at commands to submit jobs to be run at scheduled intervals. - Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. cron.allow only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator needs the ability to schedule jobs." + remediation: "Perform the following to restrict at/cron to root only: 1. Change to the /var/adm/cron directory 2. Archive or delete any existing cron.deny and at.deny files 3. Create or replace the cron.allow and at.allow files with a single line file containing just root 4. Ensure that the files are owned by root and group owned by sys 5. Ensure that no users have write/execute permission to the files, and that only root has read access to the files. The following script will perform the procedures above: cd /var/adm/cron rm -f cron.deny at.deny echo root >cron.allow echo root >at.allow chown root:sys cron.allow at.allow chmod 400 cron.allow at.allow" + compliance: + - cis: ["1.6.7"] + - cis_level: ["1"] + condition: all + rules: + - "not f:/var/adm/cron/cron.deny" + - "not f:/var/adm/cron/at.deny" + - "f:/var/adm/cron/cron.allow" + - "f:/var/adm/cron/at.allow" + - "f:/var/adm/cron/cron.allow -> r:root" + - "f:/var/adm/cron/at.allow -> r:root" + - 'not c:sh -c "ls -la /var/adm/cron/cron.allow | grep -v -e ^-r--------.*root.*sys | grep -v -e ^d | grep -v total" -> r:^\w' + - 'not c:sh -c "ls -la /var/adm/cron/at.allow | grep -v -e ^-r--------.*root.*sys | grep -v -e ^d | grep -v total" -> r:^\w' + + - id: 25037 + title: "Restrict crontab file permissions." + description: "The system crontab files are only accessed by the cron daemon (which runs with superuser privileges) and the crontab command (which is set-UID to root)." + rationale: "Allowing unprivileged users to read or (even worse) modify system crontab files can create the potential for a local user on the system to gain elevated privileges." + remediation: "Perform the following so that only root has access to the crontab files: 1. Change to the /var/spool/cron/crontabs directory 2. Change the file owner to root and file group owner to sys 3. Set file permissions so that only root has access to the files. The following script will perform the procedure above: cd /var/spool/cron/crontabs chown root:sys * chmod og-rwx *" + compliance: + - cis: ["1.6.8"] + - cis_level: ["1"] + condition: all + rules: + - 'not c:sh -c "ls -la /var/spool/cron/crontabs | grep -v -e ^-rwxrwx---.*root.*sys | grep -v -e ^d | grep -v total" -> r:^\w' + + - id: 25038 + title: "Restrict root logins to system console." + description: "Anonymous root logins should never be allowed except on the system console in emergency situations. At all other times, the administrator should access the system via an unprivileged account and use some authorized mechanism to gain additional privilege, such as the su command, the freely-available sudo package discussed in item SN.6, or the HP Role Based Authorization system also discussed in item SN.6. These mechanisms provide at least a limited audit trail in the event of problems." + rationale: "Anonymous root logins do not provide an audit trail, nor are subject to additional authorization provisions." + remediation: "Perform the following to restrict root logins to the system console only: 1. Replace the file /etc/securetty with a single line file containing console 2. Change the file owner to root and file group owner to sys 3. Set file permissions so that only root has access to the file. The following script will perform the procedure above: echo console > /etc/securetty chown root:sys /etc/securetty chmod og-rwx /etc/securetty" + compliance: + - cis: ["1.6.9"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/securetty" + - "f:/etc/securetty -> r:console" + - 'c:sh -c "ls -la /etc/securetty | grep -e ^-rwxrwx---.*root.*sys | grep -v total" -> r:/etc/securetty' + + - id: 25039 + title: "Disable nobody access for secure RPC." + description: 'The keyserv process stores user keys that are utilized with the ONC secure RPC mechanism. The action below prevents keyserv from using default keys for the "nobody" user, effectively stopping this user from accessing information via secure RPC.' + rationale: "The default 'nobody' user should not be accessing information via secure RPC." + remediation: "Perform the following to disable nobody access for secure RPC: 1. Add the '-d' option to the KEYSERV_OPTIONS parameter in the system startup configuration file /etc/rc.config.d/namesvrs The following script will perform the procedure above: KEYSERV_OPTIONS=\"`sh -c '. /etc/rc.config.d/namesvrs ; echo \"$KEYSERV_OPTIONS\"'`\" ch_rc -a -p KEYSERV_OPTIONS=\"-d $KEYSERV_OPTIONS \" \ /etc/rc.config.d/namesvrs" + compliance: + - cis: ["1.6.11"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/rc.config.d/namesvrs -> r:KEYSERV_OPTIONS= && r:-d" + + ################################################################# + # 1.7 Logging + ################################################################# + + - id: 25040 + title: "Enable logging from inetd." + description: 'If inetd is running, it is a good idea to make use of the "logging" (-l) feature of the HP-UX inetd that logs information about the source of any network connections seen by the daemon, allowing the administrator (or software) to scan the logs for unusual activity. This is especially powerful when combined with the access control capabilities accessible through inetd''s /var/adm/inetd.sec configuration file. This information is logged via Syslog and by default HP-UX systems deposit this logging information in var/adm/syslog/syslog.log with other system log messages. Should the administrator wish to capture this information in a separate file, simply modify /etc/syslog.conf to log daemon.notice to some other log file destination. IPFilter, which comes with HP-UX, can log inetd and other connections or attempted connections with its "ipmon" daemon as either a compliment or alternative to inetd logging.' + rationale: "Logging information about the source of inetd network connections assists in the detection and identification of unusual activity that may be associated with security intrusions." + remediation: "Perform the following: ch_rc -a -p INETD_ARGS=-l /etc/rc.config.d/netdaemons" + compliance: + - cis: ["1.7.2"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/rc.config.d/netdaemons -> r:INETD_ARGS=-l" + + - id: 25141 + title: "Turn on additional logging for FTP daemon." + description: "If the FTP daemon is left on, it is recommended that the command logging (-L) and connection logging (-l) flags also be enabled to track FTP activity on the system, allowing the administrator (or software) to scan the logs for unusual activity. This is especially powerful when combined with the access control capabilities accessible through inetd's /var/adm/inetd.sec configuration file. Note that this setting has no effect if the FTP daemon remains de-activated from item 2.1. Also note that enabling command logging on the FTP daemon (HP-UX 11.x only) can cause user passwords to appear in clear-text form in the system logs, if the user accidentally types their password at the username prompt. Information about FTP sessions will be logged to Syslog and by default HP-UX systems deposit this logging information in /var/adm/syslog/syslog.log with other system log messages. Should the administrator wish to capture this information in a separate file, simply modify /etc/syslog.conf to log daemon.notice to some other log file destination." + rationale: "Logging information about the source of ftp network connections assists in the detection and identification of unusual activity that may be associated with security intrusions." + remediation: 'Perform the following to enable logging for the FTP daemon: 1. Change directory to /etc. 2. Open the inetd.conf file and locate the ftpd configuration entry line. 3. Add the "-L" and "-l" flags to the ftpd entry if not already present. 4. Save and close file. The following script will perform the procedure above: cd /etc awk ''/^ftpd/ && !/-L/ { $NF = $NF " -L" } /^ftpd/ && !/-l/ { $NF = $NF " -l" } { print }'' inetd.conf > inetd.conf.tmp cp inetd.conf.tmp inetd.conf rm -f inetd.conf.tmp' + compliance: + - cis: ["1.7.3"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/inetd.conf -> r:^ftpd && r:-l" + - "f:/etc/inetd.conf -> r:^ftpd && r:-L" + + ################################################################# + # 1.8 User Accounts and Environment + ################################################################# + + - id: 25042 + title: "Block system accounts." + description: "Accounts that are not being used by regular users should be locked. Not only should the password field for the account be set to an invalid string, but the shell field in the password file should contain an invalid shell. Access to the uucp and nuucp accounts is only needed when the deprecated Unix to Unix Copy (UUCP) service is in use. The other listed accounts should never require direct access. The actions below locks the passwords to these accounts (on systems converted to Trusted Mode only) and sets the login shell to /bin/false. Note that the above is not an exhaustive list of possible system/application accounts that could be installed on the system. An audit of all users on the system is the only way to be sure that only authorized accounts are in place." + rationale: "System accounts are not used by regular users, and almost never require direct access; thus, they should be locked to prevent accidental or malicious usage." + remediation: 'Perform the following to properly lock the following known system users: www sys smbnull iwww owww sshd hpsmh named uucp nuucp adm daemon bin lp nobody noaccess hpdb useradm 1. Lock the account: passwd -l 2. Set the login shell to an invalid program: /usr/sbin/usermod -s /bin/false 3. If a trusted system, set the adminstrator lock: /usr/lbin/modprpw -m alock=YES The following script will perform the procedure above: for user in www sys smbnull iwww owww sshd \ hpsmh named uucp nuucp adm daemon bin lp \ nobody noaccess hpdb useradm; do passwd -l "$user" /usr/sbin/usermod -s /bin/false "$user" if [[ -f /tcb ]]; then /usr/lbin/modprpw -m alock=YES "$user" fi done' + compliance: + - cis: ["1.8.1"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/passwd -> r:^www && r:/bin/false" + - "f:/etc/passwd -> r:^sys && r:/bin/false" + - "f:/etc/passwd -> r:^smbnull && r:/bin/false" + - "f:/etc/passwd -> r:^iwww && r:/bin/false" + - "f:/etc/passwd -> r:^owww && r:/bin/false" + - "f:/etc/passwd -> r:^sshd && r:/bin/false" + - "f:/etc/passwd -> r:^hpsmh && r:/bin/false" + - "f:/etc/passwd -> r:^named && r:/bin/false" + - "f:/etc/passwd -> r:^uucp && r:/bin/false" + - "f:/etc/passwd -> r:^nuucp && r:/bin/false" + - "f:/etc/passwd -> r:^adm && r:/bin/false" + - "f:/etc/passwd -> r:^daemon && r:/bin/false" + - "f:/etc/passwd -> r:^bin && r:/bin/false" + - "f:/etc/passwd -> r:^lp && r:/bin/false" + - "f:/etc/passwd -> r:^nobody && r:/bin/false" + - "f:/etc/passwd -> r:^noaccess && r:/bin/false" + - "f:/etc/passwd -> r:^hpdb && r:/bin/false" + - "f:/etc/passwd -> r:^useradm && r:/bin/false" + + - id: 25043 + title: "Verify that there are no accounts with empty password fields." + description: 'An account with an empty password field means that anybody may log in as that user without providing a password at all. All accounts should have strong passwords or should be locked by using a password string like "*", "NP", or "*LOCKED*"' + rationale: "User accounts should have passwords, or be locked." + remediation: "Perform the following to ensure that no accounts have an empty password field: 1. Identify all user accounts with an empty password field: logins -p 2. Lock each account: passwd -l 3. If a trusted system, set the administrator lock: /usr/lbin/modprpw -m alock=YES " + compliance: + - cis: ["1.8.2"] + - cis_level: ["1"] + condition: all + rules: + - 'not c:logins -p -> r:^\w' + + - id: 25044 + title: "Set account expiration parameters on active accounts." + description: "The commands below will set all active accounts (except the root account) to force password changes every 90 days (91 days when not running in HP-UX Trusted Mode) and then prevent password changes for seven days (one week) thereafter. Users will begin receiving warnings 30 days (28 days when not running in HP-UX Trusted Mode) before their password expires. Sites also have the option of expiring idle accounts after a certain number of days (see the on-line manual page for the usermod command, particularly the -f option). These are recommended starting values, but sites may choose to make them more restrictive depending on local policies." + rationale: "It is a good idea to force users to change passwords on a regular basis." + remediation: 'Perform the following to set password expiration parameters on all active accounts: 1. Identify all user accounts excluding root that are not locked, and for each: 2. Set password expiration parameters for the account (logname) by executing the following: passwd -x 91 -n 7 -w 28 for trusted systems, perform the following: /usr/lbin/modprpw -m exptm=90,mintm=7,expwarn=30 3. Set the default account expiration parameters by appending the following lines to /etc/default/security: a. PASSWORD_MAXDAYS=91 b. PASSWORD_MINDAYS=7 c. PASSWORD_WARNDAYS=28 4. Set the default parameters for trusted systems with: /usr/lbin/modprdef -m exptm=90,mintm=7,expwarn=30 The following script will perform the procedure above. logins -ox \ | awk -F: ''($8 != "LK" && $1 != "root") { print $1 }'' \ | while read logname; do passwd -x 91 -n 7 -w 28 "$logname" /usr/lbin/modprpw -m exptm=90,mintm=7,expwarn=30 \ "$logname" done echo PASSWORD_MAXDAYS=91 >> /etc/default/security echo PASSWORD_MINDAYS=7 >> /etc/default/security echo PASSWORD_WARNDAYS=28 >> /etc/default/security /usr/lbin/modprdef -m exptm=90,mintm=7,expwarn=30' + compliance: + - cis: ["1.8.3"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/etc/default/security -> n:^\s*PASSWORD_MAXDAYS=(\d+) compare <= 91' + - 'f:/etc/default/security -> n:^\s*PASSWORD_WARNDAYS=(\d+) compare <= 28' + - 'f:/etc/default/security -> n:^\s*PASSWORD_MINDAYS=(\d+) compare <= 7' + + - id: 25045 + title: "Set strong password enforcement policies." + description: "The policies set here are designed to force users to make better password choices when changing their passwords. Sites often have differing opinions on the optimal value of the MIN_PASSWORD_LENGTH and PASSWORD_HISTORY_DEPTH parameters. A minimum password length of seven is in line with industry standards, especially the Payment Card Industry (PCI) Security Standard; however, a longer value may be warranted if account locks are not enabled (item 1.6.10). A password history depth of ten combined with passwords that expire four times per year (item 1.8.3) means users will typically not re-use the same password in any given year. Requiring an upper/lowercase and special character password will dramatically increase the password search space and lower the chances for brute-force attack significantly. - Note: these settings are known to exist for HP-UX 11iv2, 0512 and later. The man page for security(5) will indicate if these exist on your particular system. Be sure to consult you local security standards before adopting the values given above." + rationale: "All users should use strong passwords." + remediation: "Perform the following to set strong password enforcement policies: 1. Change the following parameters in the /etc/default/security file to establish default password policies for new users: a. MIN_PASSORD_LENGTH=7 b. PASSWORD_HISTORY_DEPTH=10 c. PASSWORD_MIN_UPPER_CASE_CHARS=1 d. PASSWORD_MIN_DIGIT_CHARS=1 e. PASSWORD_MIN_SPECIAL_CHARS=1 f. PASSWORD_MIN_LOWER_CASE_CHARS=1 2. If using a trusted system, issue the following modprdef commands to disallow null or trivial passwords: modprdef -m nullpw=NO modprdef -m rstrpw=YES The following script will perform the procedure above: modprdef -m nullpw=NO modprdef -m rstrpw=YES ch_rc -a -p MIN_PASSORD_LENGTH=7 /etc/default/security ch_rc -a -p PASSWORD_HISTORY_DEPTH=10 \ /etc/default/security ch_rc -a -p PASSWORD_MIN_UPPER_CASE_CHARS=1 \ /etc/default/security ch_rc -a -p PASSWORD_MIN_DIGIT_CHARS=1 \ /etc/default/security ch_rc -a -p PASSWORD_MIN_SPECIAL_CHARS=1 \ /etc/default/security ch_rc -a -p PASSWORD_MIN_LOWER_CASE_CHARS=1 \ /etc/default/security modprdef -m nullpw=NO modprdef -m rstrpw=YES" + compliance: + - cis: ["1.8.4"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/etc/default/security -> r:^\s*MIN_PASSORD_LENGTH=(\d+) compare >= 7' + - 'f:/etc/default/security -> r:^\s*PASSWORD_HISTORY_DEPTH=(\d+) compare >= 10' + - 'f:/etc/default/security -> r:^\s*PASSWORD_MIN_UPPER_CASE_CHARS=(\d+) compare <= 1' + - 'f:/etc/default/security -> r:^\s*PASSWORD_MIN_DIGIT_CHARS=(\d+) compare >= 1' + - 'f:/etc/default/security -> r:^\s*PASSWORD_MIN_SPECIAL_CHARS=(\d+) compare >= 1' + - 'f:/etc/default/security -> r:^\s*PASSWORD_MIN_LOWER_CASE_CHARS=(\d+) compare >= 1' + + - id: 25046 + title: "Verify no legacy '+' entries exist in passwd and group files." + description: "'+' entries in various passwd and group files served as markers for systems to insert data from NIS maps at a certain point in a system configuration file. HP-UX does not use these markers, but they may exist in files that have been imported from other platforms. They should be deleted if they exist." + rationale: "Legacy '+' entries are no longer required on HP-UX systems, and may provide an avenue for attackers to gain privileged access on the system." + remediation: "Perform the following to remove any legacy '+' entries in passwd and group files: 1. Display legacy '+' entries: grep '^+:' /etc/passwd /etc/group 2. Remove any entries found from the passwd and group files." + compliance: + - cis: ["1.8.5"] + - cis_level: ["1"] + condition: all + rules: + - "not f:/etc/passwd -> r:^+:" + - "not f:/etc/group -> r:^+:" + + - id: 25047 + title: "Set default umask for users." + description: "Set the default umask to 077 so that files created by users will not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system. - Bastille Note: sets the default umask, but uses a umask of 027 rather than the 077." + rationale: "Restricting access to files and directories created by a user from any other user on the system reduces the possibility of an unauthorized account accessing that user's files. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files (.profile, .cshrc, etc.) in their home directories." + remediation: 'Perform the following to set a default umask for users: 1. Change directory to /etc 2. Append the line umask 077 to the following files: a. profile b. csh.login c. d.profile d. d.login 3. Update the UMASK parameter to 077 in the file /etc/default/security The following script performs the procedure above: cd /etc for file in profile csh.login d.profile d.login do echo umask 077 >> "$file" done ch_rc -a -p UMASK=077 /etc/default/security' + compliance: + - cis: ["1.8.10"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/etc/default/security -> r:^\s*UMASK=077' + - 'f:/etc/profile -> r:^\s*umask 077' + - 'f:/etc/csh.login -> r:^\s*umask 077' + - 'f:/etc/d.profile -> r:^\s*umask 077' + - 'f:/etc/d.login -> r:^\s*umask 077' + + - id: 25048 + title: "Set 'mesg n' as default for all users." + description: "Block the use of write or talk commands to contact the user at their terminal in order to slightly strengthen permissions on the user's tty device. Note that this setting is the default on HP-UX 11i." + rationale: "Since write and talk are no longer widely used at most sites, the incremental security increase is worth the loss of functionality." + remediation: 'Perform the following: 1. Change directory to /etc 2. Append the line mesg n to the following files: a. profile b. csh.login c. d.profile d. d.login The following script performs the procedure above: cd /etc for file in profile csh.login d.profile d.login do echo mesg n >> "$file" done' + compliance: + - cis: ["1.8.11"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/etc/profile -> r:^\s*mesg n' + - 'f:/etc/csh.login -> r:^\s*mesg n' + - 'f:/etc/d.profile -> r:^\s*mesg n' + - 'f:/etc/d.login -> r:^\s*mesg n' + + ################################################################# + # 1.9 Warning Banners + ################################################################# + + - id: 25049 + title: "Create warning banners for terminal-session logins." + description: "The contents of the /etc/issue file are displayed prior to the login prompt on the system's console and serial devices, as well as for remote terminal-session logins such as through SSH or Telnet. /etc/motd is generally displayed after all successful logins, no matter where the user is logging in from, but is thought to be less useful because it only provides notification to the user after the machine has been accessed." + rationale: "Presenting some sort of statutory warning message prior to the normal user logon may assist the prosecution of trespassers on the computer system. Changing some of these login banners also has the side effect of hiding OS version information and other detailed system information from attackers attempting to target specific attacks at a system." + remediation: 'Perform the following to create warning banners for terminal-session logins: 1. Compose a default banner text string 2. Append this string to the files /etc/motd and /etc/motd 3. Change the owner to root and group owner to sys for the file /etc/motd 4. Change the owner to root and group owner to root for the file /etc/issue 5. Change file permissions to (644) for the files /etc/motd and /etc/issue The following script performs the procedure above: banner="Authorized users only. All activity may \ be monitored and reported." echo "$banner" >> /etc/motd echo "$banner" >> /etc/issue chown root:sys /etc/motd chown root:root /etc/issue chmod 644 /etc/motd /etc/issue' + compliance: + - cis: ["1.9.1"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/motd" + - "f:/etc/issue" + - 'c:ls -la /etc/motd -> r:^-rw-r--r--\.*root\.*sys' + - 'c:ls -la /etc/issue -> r:^-rw-r--r--\.*root\.*root' + + - id: 25050 + title: "Create warning banners for FTP daemon." + description: "The FTP daemon in HP-UX 11 is based on the popular Washington University FTP daemon (WU-FTPD), which is an Open Source program widely distributed on the Internet. Note that this setting has no effect if the FTP daemon remains de-activated from item 1.2.1." + rationale: "Presenting some sort of statutory warning message prior to the normal user logon may assist the prosecution of trespassers on the computer system. Changing some of these login banners also has the side effect of hiding OS version information and other detailed system information from attackers attempting to target specific attacks at a system." + remediation: 'Perform the following to install a default warning banner for the FTP daemon: 1. Ensure that an appropriate warning message exists in the /etc/issue file . 2. Append the line "banner /etc/issue" to the file /etc/ftpd/ftpaccess 3. Change file permissions to 600 for /etc/ftpd/ftpaccess 4. Change owner to root and group owner to sys for both /etc/ftpd and /etc/ftpd/ftpaccess The following script performs the procedure above: if [ -d /etc/ftpd ]; then echo "banner /etc/issue" >>/etc/ftpd/ftpaccess chmod 600 /etc/ftpd/ftpaccess chown root:sys /etc/ftpd /etc/ftpd/ftpaccess fi' + compliance: + - cis: ["1.9.3"] + - cis_level: ["1"] + condition: all + rules: + - "d:/etc/ftpd" + - "f:/etc/ftpd/ftpaccess -> r:^banner /etc/issue" + - 'f:/etc/issue -> r:\w' + - 'c:sh -c "ls -la /etc/ftpd | grep -e ^-rw-------.*root.*sys | grep -v total" -> r:ftpd' + - 'c:sh -c "ls -la /etc/ftpd/ftpaccess | grep -e ^-rw-------.*root.*sys | grep -v total" -> r:ftpaccess' diff --git a/etc/ruleset/sca/hpux/cis_hpux_11i_bastille.yml b/etc/ruleset/sca/hpux/cis_hpux_11i_bastille.yml new file mode 100644 index 0000000000..74f90e93a6 --- /dev/null +++ b/etc/ruleset/sca/hpux/cis_hpux_11i_bastille.yml @@ -0,0 +1,801 @@ +# Security Configuration Assessment +# CIS Checks for HPUX 11i +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for HP-UX 11i from 09-17-2009 + +policy: + id: "cis_hpux_bastille" + file: "cis_hpux_11i_bastille.yml" + name: "CIS HP-UX 11i Benchmark" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for HPUX version 11i. This guide was tested against HP-UX using Bastille" + references: + - https://www.cisecurity.org/wp-content/uploads/2017/04/CIS_HP-UX_11i_Benchmark_v1.5.0.pdf + - https://myenterpriselicense.hpe.com/cwp-ui/free-software/B6849AA + +requirements: + title: "Check HPUX version, bastille is installed and a bastille report is present." + description: "Requirements for running the SCA scan against HPUX family." + condition: all + rules: + - "c:swlist HPUX*OE* -> r:HPUX11i" + - "d:/opt/sec_mgmt/bastille/" + - "f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config" + +checks: + ################################################################# + # 1.1 Install patches and supplementary software + ################################################################# + + - id: 30001 + title: "Install and configure HP-UX Secure Shell." + description: "OpenSSH is a popular free distribution of the standards-track SSH protocols which allows secure encrypted network logins and file transfers. HP-UX Secure Shell is HP's pre-compiled and supported version of OpenSSH." + rationale: "Common login and file transfer services such as telnet, FTP, rsh, rlogin, and rcp use insecure, clear-text protocols that are vulnerable to attack. OpenSSH provides a secure, encrypted replacement for these services. Security is improved by further constraining services in the default configuration." + remediation: 'Perform the following to install and securely configure Secure Shell (SSH) 1. Download and install HP-UX Secure Shell if not already installed on the system. 2. Perform the following post-installation actions to secure the SSH service: a. Change to the /opt/ssh/etc directory b. Open sshd_config c. Set the Protocol token to 2. If it is absent, add and set it. d. Set the X11Forwarding token to yes. If it is absent, add and set it. e. Set the IgnoreRhosts token to yes. If it is absent, add and set it. f. Set the RhostsAuthentication token to no. If it is absent, add and set it. g. Set the RhostsRSAAuthentication token to no. If it is absent, add and set it. h. Set the PermitRootLogin token to no. If it is absent, add and set it. i. Set the PermitEmptyPasswords token to no. If it is absent, add and set it. j. Set the Banner token to /etc/issue. If it is absent, add and set it. k. Set root as the owner of sshd_config and ssh_config. l. Set sys as the group owner of sshd_config and ssh_config. m. Restrict write access to sshd_config and ssh_config to the file owner. The following script will perform the above procedure: 13 | P a g e cd /opt/ssh/etc cp -p sshd_config sshd_config.tmp awk '' /^Protocol/ /^IgnoreRhosts/ /^RhostsAuthentication/ /^RhostsRSAAuthentication/ { $2 ="no" }; /(^#|^)PermitRootLogin/ { $1 = "PermitRootLogin"; $2 = "no" }; /^PermitEmptyPasswords/ { $2 = "no" }; /^#Banner/ { $1 = "Banner"; $2 = "/etc/issue" } { print }'' sshd_config.tmp > sshd_config { $2 ="2"}; { $2 = "yes" }; { $2 = "no" }; rm -f sshd_config.tmp chown root:sys ssh_config sshd_config chmod go-w ssh_config sshd_config' + compliance: + - cis: ["1.1.2"] + - cis_level: ["1"] + references: + - http://www.openssh.org/ + - http://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=T1471AA + - http://h20293.www2.hp.com/portal/swdepot/displayInstallInfo.do?productNumber=T1471AA + condition: all + rules: + - "c:swlist -l bundle SecureShell -> r:HP-UX Secure Shell" + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*Protocol 2' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*X11Forwarding yes' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*IgnoreRhosts yes' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*RhostsAuthentication no' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*RhostsRSAAuthentication no' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*PermitRootLogin no' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*PermitEmptyPasswords no' + - 'f:/opt/ssh/etc/sshd_config -> r:^\s*Banner /etc/issue' + - 'not c:sh -c "ls -la /opt/ssh/etc/sshd_config | grep -v -e ^-rw-r--r--.*root.*sys | grep -v -e ^d | grep -v total" -> r:^\w' + - 'not c:sh -c "ls -la /opt/ssh/etc/ssh_config | grep -v -e ^-rw-r--r--.*root.*sys | grep -v -e ^d | grep -v total" -> r:^\w' + + - id: 30002 + title: "Use Bastille to report security configuration state." + description: "Bastille is a security hardening, lockdown tool supplied with HP-UX to assist administrators in securing their systems. Included is an assessment function that covers a wide range of lockdown items including most all items in this Benchmark. Bastille can serve as a reporting and audit tool. Appendix D provides a mapping of Benchmark items to related Bastille configuration items." + rationale: "An automated, tested, and vendor supported reporting tool such as Bastille is more efficient and less error-prone than most manual or custom scripted methods." + remediation: "Run Bastille to create an assessment report as shown: /opt/sec_mgmt/bastille/bin/bastille --assessnobrowser" + compliance: + - cis: ["1.1.3"] + references: + - https://www.hp.com/go/bastille + condition: all + rules: + - "f:/opt/sec_mgmt/bastille/bin/bastille" + - "f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config" + + ################################################################# + # 1.2 Minimize inetd network services + ################################################################# + + - id: 30003 + title: "Disable Standard Services." + description: "The stock /etc/inetd.conf file shipped with HP-UX contains many services which are rarely used, or which have more secure alternatives. Indeed, after enabling SSH (see item 1.1.2) it may be possible to completely do away with all inetd-based services, since SSH provides both a secure login mechanism and a means of transferring files to and from the system. The steps articulated in the Remediation section will disable all services normally enabled in the HP-UX inetd.conf file. The rest of the actions in this section give the administrator the option of re-enabling certain services—in particular, the services that are disabled in the last two loops in the Action section below." + rationale: "The stock /etc/inetd.conf file shipped with HP-UX contains services that are rarely used or have more secure alternatives. Removing these from inetd will avoid exposure to possible security vulnerability in those services." + remediation: 'Perform the following to disable standard inetd-based services: 1. Change to the /etc directory 2. Open inetd.conf 3. Disable the following services by adding a comment character (#) to the beginning of its definition: a. echo b. discard c. daytime d. chargen e. dtspc f. exec g. ntalk h. finger i. uucp j. ident k. auth l. instl_boots m. registrar n. recserv o. rpc.rstatd p. rpc.rusersd q. rpc.rwalld r. rpc.sprayd s. rpc.cmsd t. kcms_server u. printer v. shell w. login h. finger x. telnet y. ftp z. tftp aa. bootps bb. kshell cc. klogin dd. rpc.rquotad ee. rpc.ttdbserver 4. Save inetd.conf. 5. Set root as the owner of inetd.conf. 6. Set sys as the group owner of inetd.conf. 7. Restrict write access to inetd.conf to the file owner. 8. Remove the executable and sticky bit from inetd.conf. 9. Invoke inetd to reread it''s config file: inetd -c The following script will perform the above procedure: cd /etc for svc in echo discard daytime chargen dtspc \ exec ntalk finger uucp ident auth \ instl_boots registrar recserv; do awk "(\$1 == \"$svc\") { \$1 = \"#\" \$1 }; {print}" \ inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf done for svc in rpc.rstatd rpc.rusersd rpc.rwalld \ rpc.sprayd rpc.cmsd kcms_server; do awk "/\\/$svc/ { \$1 = \"#\" \$1 }; { print }" \ inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf done for svc in printer shell login telnet ftp tftp \ bootps kshell klogin; do awk "(\$1 == \"$svc\") { \$1 = \"#\" \$1 }; {print}" \ inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf done for svc in rpc.rquotad rpc.ttdbserver; do awk "/^$svc\\// { \$1 = \"#\" \$1 }; { print }" \ /etc/inetd.conf > /etc/inetd.conf.new cp inetd.conf.new inetd.conf done chown root:sys inetd.conf chmod go-w,a-xs inetd.conf rm -f /etc/inetd.conf.new inetd -c' + compliance: + - cis: ["1.2.1"] + - cis_level: ["1"] + references: + - http://docs.hp.com/en/B2355-60130/inetd.conf.4.html + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.inetd_general="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_builtin="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_finger="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_ident="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_ntalk="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_recserv="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_time="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_uucp="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_dttools="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_printer="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_telnet="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_ftp="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_rtools="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_tftp="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_printer="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_ktools="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_bootp="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_rquotad="Y"' + - 'not c:sh -c "ls -la /etc/inetd.conf | grep -v -e ^-rw-r--r--.*root.*sys | grep -v -e ^d | grep -v total" -> r:^\w' + + - id: 30004 + title: "Only enable telnet if absolutely necessary." + description: "Re-enable telnet. Telnet uses an unencrypted network protocol, which means data from the login session (such as passwords and all other data transmitted during the session) can be stolen by eavesdroppers on the network, and also that the session can be hijacked by outsiders to gain access to the remote system. HP-UX Secure Shell (OpenSSH) provides an encrypted alternative to telnet (and other utilities) and should be used instead." + rationale: "There is a mission-critical reason that requires users to access the system via telnet instead of the more secure SSH protocol." + remediation: 'Perform the following to re-enable telnet: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the telnet service definition. 3. Add -b /etc/issue to the end of the telnet service definition. This will cause telnet to display the contents of /etc/issue to users attempting to access the system via telnet. 4. Save /etc/inetd.conf. The following script will perform the above procedure: awk ''/^#telnet/ { $1 = "telnet" print $0 " -b /etc/issue"; next} { print } '' inetd.conf > /etc/inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new' + compliance: + - cis: ["1.2.2"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_telnet="Y"' + + - id: 30005 + title: "Only enable FTP if absolutely necessary." + description: "Re-enable ftp. Like telnet, the FTP protocol is unencrypted, which means passwords and other data transmitted during the session can be captured by sniffing the network, and that the FTP session itself can be hijacked by an external attacker. SSH provides two alternative, encrypted file transfer mechanisms, scp and sftp, which should be used instead of FTP. Even if FTP is required because the local system is an anonymous FTP server, consider requiring authenticated users on the system to transfer files via SSH-based protocols. For further information on restricting FTP access to the system, see item 1.6.2 below. Sites may also consider augmenting the 'ftpd -l' below with '-v' (10.x and 11.x) or '-L' (11.x only) for additional logging of FTP transactions, or with '-a' (11.x only) for fine grain FTP access control through the use of a configuration file - see the ftpd(1M) man page on your systems for details." + rationale: "This machine serves as an (anonymous) FTP server or other mission-critical role where data must be transferred via FTP instead of the more secure alternatives." + remediation: 'Perform the following to re-enable FTP: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the ftp service definition. 3. Save /etc/inetd.conf. The following script will perform the above procedure: awk '' /^#ftp/ { $1 = "ftp"; print $0; next} { print } '' inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new' + compliance: + - cis: ["1.2.3"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_ftp="Y"' + + - id: 30006 + title: "Only enable rlogin/remsh/rcp if absolutely necessary." + description: "Re-enable rlogin/remsh/rcp. SSH was designed to be a drop-in replacement for these protocols. Given the wide availability of free SSH implementations, there are few cases where these tools cannot be replaced with SSH (again, see item 1.2.1 - Install SSH)." + rationale: "There is a mission-critical reason to use rlogin/remsh/rcp instead of the more secure ssh/scp." + remediation: "Perform the following to re-enable rlogin/remsh/rcp: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the shell and login service definitions. 3. Save /etc/inetd.conf. The following script will perform the above procedure: sed 's/^#shell/shell/; s/^#login/login/' \ inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new" + compliance: + - cis: ["1.2.4"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_rtools="Y"' + + - id: 30007 + title: "Only enable TFTP if absolutely necessary." + description: "Re-enable TFTP. TFTP is typically used for network booting of diskless workstations, X-terminals, and other similar devices. TFTP is also used during network installs of systems via the HP-UX Ignite facility. Routers and other network devices may copy configuration data to remote systems via TFTP for backup." + rationale: "This system serves as a boot server or has other mission-critical roles where data must be transferred to and from this system via TFTP." + remediation: "Perform the following to re-enable TFTP: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the tftp service definition. 3. Save /etc/inetd.conf. The following script will perform the above procedure: sed 's/^#tftp/tftp/' inetd.conf >inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new mkdir -p /var/opt/ignite" + compliance: + - cis: ["1.2.5"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_tftp="Y"' + + - id: 30008 + title: "Only enable printer service if absolutely necessary." + description: "Re-enable rlpdaemon based printer service. rlpdaemon provides a BSD-compatible print server interface. Even machines that are print servers may wish to leave this service disabled if they do not need to support BSD-style printing." + rationale: "This machine a print server for your network." + remediation: "Perform the following to re-enable the rlpdaemon based printer service: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the printer definition. 3. Save /etc/inetd.conf. The following script will perform the above procedure: sed 's/^#printer/printer/' inetd.conf >inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new" + compliance: + - cis: ["1.2.6"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_printer="Y"' + + - id: 30009 + title: "Only enable rquotad if absolutely necessary." + description: "Re-enable rquotad. rquotad allows NFS clients to enforce disk quotas on file systems that are mounted from the local system. If your site does not use disk quotas, then you may leave the rquotad service disabled." + rationale: "This system an NFS file server that requires the use of disk quotas." + remediation: 'Perform the following to re-enable rquotad: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the rquotad definition. 3. Save /etc/inetd.conf. The following script will perform the above procedure: awk '' $6 ~ /\/rpc.rquotad$/ { sub(/^#/, "") } { print } '' inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new' + compliance: + - cis: ["1.2.7"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_rquotad="Y"' + + - id: 30010 + title: "Only enable CDE-related daemons if absolutely necessary." + description: "Re-enable CDE-related daemons. The rpc.ttdbserver service supports HP's CDE windowing environment. This service has a history of security problems. Not only is it vital to keep up to date on vendor patches, but also never enable this service on any system which is not well protected by a complete network security infrastructure (including network and host-based firewalls, packet filters, and intrusion detection infrastructure). Note that since this service uses ONC RPC mechanisms, it is important that the system's RPC portmapper (rpcbind) also be enabled when this service is turned on." + rationale: "There a mission-critical reason to run a CDE GUI on this system." + remediation: 'Perform the following to re-enable CDE-related daemons: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the rpc.ttdbserver 3. Save /etc/inetd.conf. The following script will perform the above procedure: awk '' $6 ~ /\/rpc.ttdbserver$/ { sub(/^#/, "") } { print } '' inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new' + compliance: + - cis: ["1.2.8"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_dttools="Y"' + + - id: 30011 + title: "Only enable Kerberos-related daemons if absolutely necessary." + description: "Re-enable Kerberos-related daemons. Kerberized rlogin/remsh offers a higher degree of security than traditional rlogin, remsh, or telnet by eliminating many clear-text password exchanges from the network. However it is still not as secure as SSH, which encrypts all traffic. Given the wide availability of free SSH implementations, there are few cases where these tools cannot be replaced with SSH." + rationale: "The Kerberos security system is in use at this site and there is a mission-critical reason that requires users to access this system via Kerberized rlogin/remsh, rather than the more secure SSH protocol." + remediation: "Perform the following to re-enable Kerberos-related daemons: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the klogin definition. 3. Save /etc/inetd.conf. The following script will perform the above procedure: sed 's/^#kshell/kshell/; s/^#klogin/klogin/' \ inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf.new" + compliance: + - cis: ["1.2.9"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_ktools="Y"' + + - id: 30012 + title: "Only enable BOOTP/DHCP daemon if absolutely necessary." + description: "Re-enable BOOTP/DHCP services. BOOTP/DHCP is a popular protocol for dynamically assigning IP addresses and other network information to systems on the network (rather than having administrators manually manage this information on each host). However, if this system is not a BOOTP/DHCP server for the network, there is no need to be running this service." + rationale: "This server a BOOTP/DHCP server for the network." + remediation: "Perform the following to re-enable BOOTP/DHCP services: 1. Open /etc/inetd.conf. 2. Delete the comment character (#) from the bootps definition. 3. Save /etc/inetd.conf. The following script will perform the above procedure: sed 's/^#bootps/bootps/' \ inetd.conf > inetd.conf.new cp inetd.conf.new inetd.conf rm -f /etc/inetd.conf" + compliance: + - cis: ["1.2.10"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.deactivate_bootp="Y"' + + ################################################################# + # 1.3 Minimize boot services + ################################################################# + + - id: 30013 + title: "Disable login: prompts on serial ports." + description: "Disable the login: prompt on the system serial devices to make it more difficult for unauthorized users to attach modems, terminals, and other remote access devices to these ports." + rationale: "If there is not a mission-critical need to provide login capability from any serial ports (such as for a modem) then disabling the login: prompt on the system serial devices reduces the risk of unauthorized access via these ports." + remediation: "Perform the following to disable the login: prompt on the system serial devices: 1. Open /etc/inittab. 2. Disable each getty instance associated with a tty device by adding a comment character (#) to the beginning of the line. 3. Save /etc/inittab.* The following script will perform the above procedure: cp -p /etc/inittab /etc/inittab.tmp sed 's/^[^#].*getty.*tty.*$/#&/' \ /etc/inittab.tmp > /etc/inittab rm -f /etc/inittab.tmp - Note that this action may safely be performed even if console access to the system is provided via the serial ports, as the line in the /etc/inittab file that corresponds to the console does not match the supplied pattern (i.e., it doesn't contain the string 'tty'). - Note that when serial port connectivity is needed, /etc/dialups and /etc/d_passwd can be set to require an extra password for serial port access. See the dialups(4) manual page for more information. - Note that by default in HP-UX 11i, only the console has a getty instance running on it." + compliance: + - cis: ["1.3.1"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.serial_port_login="Y"' + + - id: 30014 + title: "Disable NIS/NIS+ related processes, if possible." + description: "Disable NIS/NIS+ related processes. Network Information Service (NIS) is a distributed database providing centralized control of names, addresses, services, and key configuration files throughout a network of servers and clients. NIS was formerly known as Yellow Pages (YP). NIS+ is a replacement for NIS services, and is more scalable, flexible, and secure. It adds a security system with authentication and authorization services to validate users on the network and to determine if they allowed to access or modify the information requested. However, both systems have known security vulnerabilities, and have been an entry point for security attacks." + rationale: "Eliminate exposure to NIS/NIS+ vulnerabilities by not running related daemons on hosts that are not NIS/NIS+ servers or clients." + remediation: "Perform the following to disable the startup of NIS/NIS+ related processes: ch_rc -a -p NIS_MASTER_SERVER=0 -p NIS_SLAVE_SERVER=0 \ -p NIS_CLIENT=0 -p NISPLUS_SERVER=0 \ -p NISPLUS_CLIENT=0 /etc/rc.config.d/namesvrs" + compliance: + - cis: ["1.3.2"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.nis_client="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.nis_server="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.nisplus_server="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.nisplus_client="Y"' + + - id: 30015 + title: "Disable printer daemons, if possible." + description: "Disable printer daemons. The Technical Print Service (TPS) is a printer service used in the X-Windows and/or CDE environment. It is recommended that this service be disabled if the hosting system does not participate in print services The administrator may wish to consider converting to the LPRng print system (see http://www.lprng.org/) which was designed with security in mind and is widely portable across many different Unix platforms. Note, however, that LPRng is not supported by Hewlett-Packard." + rationale: "Disabling unused services, such as TPS, will reduce the remote and local attack surfaces of the hosting system." + remediation: 'Perform the following to disable printer daemons: 1. Set the LP parameter to zero in the lp system configuration file /etc/rc.config.d/lp 2. Set the XPRINTSERVERS parameter to an empty string in the tps system configuration file /etc/rc.config.d/tps The following script will perform the above procedure: ch_rc -a -p XPRINTSERVERS="''''" /etc/rc.config.d/tps ch_rc -a -p LP=0 /etc/rc.config.d/lp' + compliance: + - cis: ["1.3.3"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:Printing.xprintserver="Y"' + + - id: 30016 + title: "Disable the CDE GUI login, if possible." + description: "CDE stands for 'Common Desktop Environment,' and is an environment for logging on to and interacting with your system via an X-windows type GUI interface from the console. Intended for use with workstation or desktop systems, this service is not commonly used with the server-class systems or in large enterprise environments. The X Windows-based CDE GUI services were developed with a different set of security expecations from those expected in many enterprise deployments, and have had a history of security issues. Unless there is a mission-critical need for a CDE GUI login to the system, this service should not be run to further reduce opportunities for security attacks." + rationale: "The X Windows-based CDE GUI on HP-UX systems has had a history of security issues, and should be disabled if unused." + remediation: 'Perform the following to disable the GUI login: ch_rc -a -p DESKTOP="" /etc/rc.config.d/desktop' + compliance: + - cis: ["1.3.4"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.gui_login="Y"' + + - id: 30017 + title: "Disable email server, if possible." + description: "Disable the sendmail daemon to avoid processing incoming email. It is possible to run a Unix system with the Sendmail daemon disabled and still allow users on that system to send email out from that machine. Running Sendmail in 'daemon mode' (with the -bd command-line option) is only required on machines that act as mail servers, receiving and processing email from other hosts on the network. The remediation below will result in a machine that can send email but not receive it. - Note that after disabling the -bd option on the local mail server on systems running Sendmail v8.12 or later (8.13 is currently shipped as part of HP-UX 11iv3), it is also necessary to modify the /etc/mail/submit.cf file. Find the line that reads 'D{MTAHost}localhost' and change localhost to the name of some other local mail server for the organization. This will cause email generated on the local system to be relayed to that mail server for further processing and delivery. - Note that if the system is an email server, the administrator is encouraged to search the Web for additional documentation on Sendmail security issues." + rationale: "Avoid potential vulnerabilities in the sendmail server if incoming email service is not used." + remediation: "Perform the following to disable the sendmail server: 1. Set the SENDMAIL_SERVER parameter to zero in the mailservs system configuration file. 2. Setup a cron job to run sendmail at regular intervals (e.g. every hour) in order to process queued, outgoing mail. The following script will perform the above procedure: ch_rc -a -p SENDMAIL_SERVER=0 /etc/rc.config.d/mailservs cd /var/spool/cron/crontabs crontab -l >root.tmp echo '0 * * * * /usr/lib/sendmail -q' >>root.tmp crontab root.tmp rm -f root.tmp" + compliance: + - cis: ["1.3.5"] + - cis_level: ["1"] + references: + - http://www.deer-run.com/~hal/dns-sendmail/DNSandSendmail.pdf + - http://www.sendmail.org/ + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:Sendmail.sendmaildaemon="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:Sendmail.sendmailcron="Y"' + + - id: 30018 + title: "Disable SNMP and OpenView Agents, if remote management or monitoring are not needed." + description: "Disable SNMP and OpenView agents if they are not needed. Note: If SNMP is used, it is recommended to change the default SNMP community string by modifying the get-community and set-community parameters in the SNMP configuration file /etc/SnmpAgent.d/snmpd.conf." + rationale: "If SNMP and OpenView agents are not needed, avoid potential security vulnerabilities in these programs by disabling them." + remediation: "Perform the following to disable the SNMP and OpenView Agents: cd /sbin/rc2.d mv -f S570SnmpFddi .NOS570SnmpFddi ch_rc -a -p SNMP_HPUNIX_START=0 \ /etc/rc.config.d/SnmpHpunix ch_rc -a -p SNMP_MASTER_START=0 \ /etc/rc.config.d/SnmpMaster ch_rc -a -p SNMP_MIB2_START=0 \ /etc/rc.config.d/SnmpMib2 ch_rc -a -p SNMP_TRAPDEST_START=0 \ /etc/rc.config.d/SnmpTrpDst ch_rc -a -p OSPFMIB=0 \ /etc/rc.config.d/netdaemons ch_rc -a -p OPCAGT=0 \ /etc/rc.config.d/opcagt" + compliance: + - cis: ["1.3.6"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.snmpd="Y"' + + - id: 30019 + title: "Disable rarely used standard boot services." + description: 'Disable other standard boot services. Setting these variables in the /etc/rc.config.d configuration files will effectively disable a wide variety of infrequently used subsystems. Variables are merely set (rather than renaming or removing startup scripts) so that the local administrator can easily "restore" any of these services if they discover a mission-critical need to have it. Additionally, HP-UX patches tend to supply fresh copies of the startup scripts, so they may get inadvertently re- enabled, whereas setting configuration variables usually survives patch installs. Finally, setting configuration variables is the method recommended and supported by HP. Note that not all of the configuration files listed above will exist on all systems (some are only valid for certain releases, others only exist if certain OEM vendor software is installed). The rest of the actions in this section give the administrator the option of re-enabling certain services - in particular, the services that are disabled in the second block of the remediation section below. Rather than disabling and then re-enabling these services, experienced administrators may wish to simply disable only those services that they know are unnecessary for their systems. Note: that HP-UX 11.31 was the first version to support disablement of the NFS core services. Disablement on earlier versions is possible by moving /sbin/rc2.d/S400nfs.core to /sbin/rc2.d/.NOS400nfs.core, but there is some risk of system instability.' + rationale: "Avoid potential security vulnerabilities in infrequently used subsystems by disabling them." + remediation: 'Perform the following: ch_rc -a -p START_SNAPLUS=0 -p START_SNANODE=0 \ -p START_SNAINETD=0 /etc/rc.config.d/snaplus2 ch_rc -a -p MROUTED=0 -p RWHOD=0 \-p DDFA=0 \ -p START_RBOOTD=0 /etc/rc.config.d/netdaemons ch_rc -a -p RARPD=0 -p RDPD=0 /etc/rc.config.d/netconf ch_rc -a -p PTYDAEMON_START=0 /etc/rc.config.d/ptydaemon ch_rc -a -p VTDAEMON_START=0 /etc/rc.config.d/vt ch_rc -a -p NAMED=0 /etc/rc.config.d/namesvrs ch_rc -a -p START_I4LMD=0 /etc/rc.config.d/i4lmd ch_rc -a -p RUN_X_FONT_SERVER=0 /etc/rc.config.d/xfs ch_rc -a -p AUDIO_SERVER=0 /etc/rc.config.d/audio ch_rc -a -p SLSD_DAEMON=0 /etc/rc.config.d/slsd ch_rc -a -p RUN_SAMBA=0 /etc/rc.config.d/samba ch_rc -a -p RUN_CIFSCLIENT=0 \ /etc/rc.config.d/cifsclient ch_rc -a -p NFS_SERVER=0 \ -p NFS_CLIENT=0 /etc/rc.config.d/nfsconf ch_rc -a -p HPWS_APACHE_START=0 /etc/rc.config.d/hpws_apacheconf ch_rc -a -p NFS_CORE=0 /etc/rc.config.d/nfsconf' + compliance: + - cis: ["1.3.7"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.disable_rbootd="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.nfs_server="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.nfs_client="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.disable_ptydaemon="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:Apache.deactivate_hpws_apache="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.snmpd="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.license_server="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.nfs_core="Y"' + + - id: 30020 + title: "Only enable Windows-compatibility server processes if absolutely necessary." + description: "Re-enable CIFS Server (Samba) services. HP-UX 11i includes the popular Open Source Samba server (HP-UX CIFS Server) for providing file and print services to Windows-based systems. This allows an HP-UX system to act as a file or print server on a Windows network, and even act as a Domain Controller (authentication server) to older Windows operating systems. However, if this functionality is not required by the site, this service should be disabled." + rationale: "This machine provides authentication, file sharing, or printer sharing services to systems running Microsoft Windows operating systems." + remediation: "Perform the following to re-enable CIFS Server: ch_rc -a -p RUN_SAMBA=1 /etc/rc.config.d/samba" + compliance: + - cis: ["1.3.8"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.disable_smbclient="Y"' + + - id: 30021 + title: "Only enable Windows-compatibility client processes if absolutely necessary." + description: "Re-enable the HP CIFS Client service." + rationale: "This system requires access to file systems from remote servers via the Windows (SMB) file services." + remediation: "Perform the following: ch_rc -a -p RUN_CIFSCLIENT=1 /etc/rc.config.d/cifsclient" + compliance: + - cis: ["1.3.9"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.disable_smbsever="Y"' + + - id: 30022 + title: "Only enable NFS server processes if absolutely necessary." + description: 'Re-enable the NFS file service. NFS is frequently exploited to gain unauthorized access to files and systems. Clearly there is no need to run the NFS server-related daemons on hosts that are not NFS servers. If the system is an NFS server, the admin should take reasonable precautions when exporting file systems, including restricting NFS access to a specific range of local IP addresses and exporting file systems "read-only" and "nosuid" where appropriate. For more information consult the exportfs(1M) manual page. Much higher levels of security can be achieved by combining NFS with secure RPC or Kerberos, although there is significant administrative overhead involved in this transition. Note that since this service uses ONC RPC mechanisms, it is important that the system''s RPC portmapper (rpcbind) also be enabled when this service is turned on. For more information see Item 1.3.12 below. Also, note that some releases of Oracle software for HP-UX require NFS services in order to install properly. Therefore, the NFS server process may need to be started by hand on systems on which Oracle software is to be installed/updated. This can be accomplished by performing the following: 1. Temporarily set NFS_SERVER=1, /etc/rc.config.d/nfsconf 2. Execute: /sbin/init.d/nfs.core start /sbin/init.d/nfs.server start 3. Install Oracle 4. Stop the NFS services: /sbin/init.d/nfs.core stop /sbin/init.d/nfs.server stop 5. Disable the NFS services by resetting NFS_SERVER=0, NUM_NFSD=0, and NUM_NFSIOD=0 in /etc/rc.config.d/nfsconf.' + rationale: "This machine is a NFS file server." + remediation: "Perform the following: ch_rc -a -p NFS_SERVER=1 /etc/rc.config.d/nfsconf" + compliance: + - cis: ["1.3.10"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.nfs_server="Y"' + + - id: 30023 + title: "Only enable NFS client processes if absolutely necessary." + description: "Re-enable the NFS Client service. Again, unless there is a significant need for this system to acquire data via NFS, administrators should disable NFS-related services. Note that other file transfer schemes (such as rdist via SSH) can often be more secure than NFS for certain applications, although again the use of secure RPC or Kerberos can significantly improve NFS security. Also note that if the machine will be an NFS client, then the rpcbind process must be running (see Item 3.12 below). - Note that since this service uses ONC RPC mechanisms, it is important that the system's RPC portmapper (rpcbind) also be enabled when this service is turned on. For more information see Item 3.12 below." + rationale: "This system must access file systems from remote servers via NFS." + remediation: "Perform the following: ch_rc -a -p NFS_CLIENT=1 /etc/rc.config.d/nfsconf" + compliance: + - cis: ["1.3.11"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.nfs_client="Y"' + + - id: 30024 + title: "Only enable RPC-based services if absolutely necessary." + description: "Re-enable RPC-based services. RPC-based services typically use very weak or non-existent authentication and yet may share very sensitive information. Unless one of the services listed above is required on this machine, it is best to disable RPC-based tools completely. If you are unsure whether or not a particular third-party application requires RPC services, consult with the application vendor. Note that disabling this service by renaming the startup file may not survive the install of RPC-related patches." + rationale: "RPC-based services are used such as: - This machine is an NFS client or server. - This machine is an NIS (YP) or NIS+ client or server. - This machine runs a GUI or GUI-based administration tool. - The machine runs a third-party software application which is dependent on RPC support (example: FlexLM License managers)." + remediation: "Perform the following for 11.31 and later: ch_rc -a -p NFS_CORE=1 /etc/rc.config.d/nfsconf For 11.23 and prior: mv -f /sbin/rc2.d/.NOS400nfs.core \ /sbin/rc2.d/400nfs.core" + compliance: + - cis: ["1.3.12"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.nfs_core="Y"' + + - id: 30025 + title: "Only enable Web server if absolutely necessary." + description: "Re-enable the Web server suite. Even if this machine is a Web server, the local site may choose not to use the Web server provided with HP-UX in favor of a locally developed and supported Web environment. If the machine is a Web server, the administrator is encouraged to search the Web for additional documentation on Web server security. A good starting point is http://httpd.apache.org/docs-2.0/misc/security_tips.html. Note that this action only disables the default web server shipped with the system. Other webservers instances may still be running." + rationale: "There is a mission-critical reason why this system must run a Web server." + remediation: "Perform the following: ch_rc -a -p NS_FTRACK=1 /etc/rc.config.d/ns-ftrack ch_rc -a -p APACHE_START=1 /etc/rc.config.d/apacheconf ch_rc -a -p HPWS_APACHE32_START=1 /etc/rc.config.d/hpws_apache32conf ch_rc -a -p HPWS_TOMCAT_START=1 /etc/rc.config.d/hpws_tomcatconf ch_rc -a -p NS_FTRACK=1 /etc/rc.config.d/ns-ftrack ch_rc -a -p HPWS_WEBMIN_START=1 /etc/rc.config.d/hpws_webminconf" + compliance: + - cis: ["1.3.13"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:Apache.deactivate_hpws_apache="Y"' + + - id: 30026 + title: "Only enable BIND DNS server if absolutely necessary." + description: "Re-enable the BIND DNS service. The BIND DNS server, or named, maps IP addresses to hostnames across the Internet and supplies these services to other hosts on the local local network. Though it has been widely implemented, BIND has a long history of security flaws, especially in the BIND 8.x release tree generally shipped with HP-UX 11.x systems. Therefore, if you are going to run BIND, you should strongly consider moving to the BIND 9.x release-tree. HP has supported BIND 9 packages available from http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=BIND9.2 . Or it is available directly from the Internet Software Consortium (the developers of BIND), whose website is at http://www.isc.org." + rationale: "There exists a mission-critical reason why this system must run a DNS server." + remediation: "Perform the following: 11.23 and prior: ch_rc -a -p NAMED=1 /etc/rc.config.d/namesvrs 11.31 and later: ch_rc -a -p NAMED=1 /etc/rc.config.d/namesvrs_dns" + compliance: + - cis: ["1.3.14"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.disable_bind="Y"' + + ################################################################# + # 1.4 Kernel Tuning + ################################################################# + + - id: 30027 + title: "Enable stack protection." + description: "Enabling stack protection prevents certain classes of buffer overflow attacks and is a significant security enhancement. - Note that HP-UX 11i is much more capable in this and other security areas than older releases; therefore, administrators should strongly consider upgrading from older releases. - Note that this action requires a subsequent reboot to take effect in some versions of HP-UX." + rationale: "Buffer overflow exploits have been the basis for many of the recent highly publicized compromises and defacements of large numbers of Internet connected systems. Many of the automated tools in use by system crackers exploit well-known buffer overflow problems in vendor-supplied and third-party software. Enabling stack protection prevents certain classes of buffer overflow attacks and is a significant security enhancement." + remediation: "For 11i v2 and later: kctune -K executable_stack=0 For 11i v1: /usr/sbin/kmtune -s executable_stack=0 && mk_kernel && kmupdate" + compliance: + - cis: ["1.4.1"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:HP_UX.stack_execute="Y"' + + - id: 30028 + title: "Network parameter modifications." + description: "Modify the network parameter boot configuration file to meet current best practices. Note: HP-UX 11.11 systems require patch PHNE_25644 for ndd to set arp_cleanup_interval from /etc/rc.config.d/nddconf. - Bastille Note: Bastille performs a similar action but does not support the exact same changes." + rationale: "Network parameter default values should align with current best practices unless there is a specific need to use other values." + remediation: "Perform the following to update the default network parameter values: 1. Change to the /etc/rc.config.d directory 2. Open nddconf and review the comment lines on how to use the configuration file 3. Set each of the following network parameters to the recommended value. If a parameter does not have an entry in nddconf then add a new entry to the end of the file while properly incrementing the parameter index. 4. Save nddconf. - If creating this file for the first time: 1. Set root as the owner of nddconf. 2. Set sys as the group owner of nddconf. 3. Restrict write access to nddconf to the file owner. 4. Remove the executable and sticky bit from nddconf. If the existing nddconf file contains no entries, then the following script will perform the above procedure: cd /etc/rc.config.d cat < nddconf # Increase size of half-open connection queue TRANSPORT_NAME[0]=tcp NDD_NAME[0]=tcp_syn_rcvd_max NDD_VALUE[0]=4096 # Reduce timeouts on ARP cache TRANSPORT_NAME[1]=arp NDD_NAME[1]=arp_cleanup_interval NDD_VALUE[1]=60000 # Drop source-routed packets TRANSPORT_NAME[2]=ip NDD_NAME[2]=ip_forward_src_routed NDD_VALUE[2]=0 # Don't forward directed broadcasts TRANSPORT_NAME[3]=ip NDD_NAME[3]=ip_forward_directed_broadcasts NDD_VALUE[3]=0 # Don't respond to unicast ICMP timestamp requests TRANSPORT_NAME[4]=ip NDD_NAME[4]=ip_respond_to_timestamp NDD_VALUE[4]=0 # Don't respond to broadcast ICMP tstamp reqs TRANSPORT_NAME[5]=ip NDD_NAME[5]=ip_respond_to_timestamp_broadcast NDD_VALUE[5]=0 # Don't respond to ICMP address mask requests TRANSPORT_NAME[6]=ip NDD_NAME[6]=ip_respond_to_address_mask_broadcast NDD_VALUE[6]=0 # Don‟t respond to broadcast echo requests TRANSPORT_NAME[7]=ip NDD_NAME[7]=ip_respond_to_echo_broadcast NDD_VALUE[7]=0 EOF chown root:sys nddconf chmod go-w,ug-s nddconf" + compliance: + - cis: ["1.4.2"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:HP_UX.ndd="Y"' + + - id: 30029 + title: "Use more random TCP sequence numbers." + description: "Generate initial TCP sequence numbers that comply with RFC1948. - Note: In HP-UX 11i v1 and later, an algorithm largely compliant with RFC1948 is already used. However, setting the isn passphrase closes the small remaining gap, and adds entropy to the seed." + rationale: "Makes remote off-net session hijacking attacks more difficult." + remediation: "Perform the following to use more random TCP sequence numbers upon system startup: 1. Create/open the file /sbin/rc2.d/S999tcpisn 2. Add the following line: ndd -set /dev/tcp tcp_isn_passprase= replacing with a string of random characters. 3. Save the file. 4. Set root as the owner and bin as the group owner of the file. 5. Restrict write access to the file. 6. Set the execution bit for the file." + compliance: + - cis: ["1.4.3"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:HP_UX.tcp_isn="Y"' + + - id: 30030 + title: "Additional network parameter modifications." + description: "Configure networking to NOT forward TCP/IP packets between multiple networks, even if the machine has multiple network adapters connected to multiple networks." + rationale: "System is not going to be used as a firewall or gateway to pass network traffic between different networks." + remediation: "Perform the following to disable forwarding TCP/IP packets between networks: 1. Change to the /etc/rc.config.d directory 2. Open nddconf and review the comment lines on how to use the configuration file 3. Set each of the following network parameters to the recommended value. If a parameter does not have an entry in nddconf then add a new entry to the end of the file while properly incrementing the parameter index. 4. Save nddconf. If creating this file for the first time: 5. Set root as the owner of nddconf. 6. Set sys as the group owner of nddconf. 7. Restrict write access to nddconf to the file owner. 8. Remove the executable and sticky bit from nddconf. The following script will perform the above procedure properly if used as a follow-on from the script in item 1.4.2: cat <> /etc/rc.config.d/nddconf # Don‟t act as a router TRANSPORT_NAME[8]=ip NDD_NAME[8]=ip_forwarding NDD_VALUE[8]=0 TRANSPORT_NAME[9]=ip NDD_NAME[9]=ip_send_redirects NDD_VALUE[9]=0 EOF" + compliance: + - cis: ["1.4.4"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:HP_UX.ndd="Y"' + + ################################################################# + # 1.5 File/Directory Permissions/Access + ################################################################# + + - id: 30131 + title: "Resolve 'unowned' files and directories." + description: "Evaluate ownership of any files that are not owned by a locally defined user, and consider reassignment to an active user." + rationale: "Sometimes when administrators delete users from the system they neglect to remove all files owned by those users from the system. A new user who is assigned the deleted user's user ID or group ID may then end up 'owning' these files, and thus have more access on the system than was intended. It is a good idea to locate files that are owned by users or groups not listed in the system configuration files, and make sure to reset the ownership of these files to some active user on the system (in this example, 'bin') as appropriate." + remediation: 'Perform the following to identify "unowned" files and directories, and consider resetting ownership to a default owner and restricting access permissions: 1. Locate all local files that are owned by users or groups not listed in the system configuration files. find / \( -nouser -o -nogroup \) 2. Consider resetting user and group ownership of these files to a default active user (e.g. bin) chown bin:bin 3. Consider restricting world-write permissions, and removing any SUID/SGID bits on these files. chmod ug-s,o-w - Note: there is no reason for an application to require an unowned file, so these changes should be application-safe.' + compliance: + - cis: ["1.5.3"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.unowned_files"Y"' + + ################################################################# + # 1.6 System Access, Authentication, and Authorization + ################################################################# + + - id: 30032 + title: "Enable Hidden Passwords." + description: "Enable hidden passwords by converting the system to a Trusted System or to use Shadow Passwords. - Note: do not perform this if the system runs applications that read the encrypted password entries in /etc/passwd directly." + rationale: "Without hidden passwords, an intruder could use any user's account to obtain hashed passwords and use crack or similar utilities to find easily guessed passwords. Password aging (covered in item 1.8.3) ensures that users change their passwords on a regular basis and helps stop the use of stolen passwords." + remediation: "Perform one of the following to convert the system to trusted mode or shadowed mode: A. Use the system management program smh or sam to convert to a trusted system -or- B. Use the command pwconv to convert to shadowed passwords." + compliance: + - cis: ["1.6.1"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.hidepasswords="Y"' + + - id: 30033 + title: "Restrict users who can access to FTP." + description: "Configure FTP to prevent certain users from accessing the system via FTP. The file ftpusers contains a list of users who are not allowed to access the system via FTP. Generally, only normal users should ever access the system via FTP - there should be no reason for 'system' type accounts to be transferring information via this mechanism. Certainly, the root account should never be allowed to transfer files directly via FTP. - Note: more fine-grained FTP access controls can be placed in /etc/ftpd/ftpaccess." + rationale: "Privileged users such as root and other 'system' type accounts should never be transferring information via such an insecure service as FTP." + remediation: "Perform the following to restrict default priviledged users from access to FTP: 1. Add the users root daemon bin sys adm lp uucp nuucp nobody hpdb useradm to the file /etc/ftpd/ftpusers (each user on a single line). 2. Set the file owner and group owner to the user bin. 3. Set the file permissions so that only the file owner has read or write perms and no user has execute permission (600). The following script will create and populate the ftpusers file as described above: for name in root daemon bin sys adm lp \ uucp nuucp nobody hpdb useradm do echo $name done >> $ftpusers sort -u $ftpusers > $ftpusers.tmp cp $ftpusers.tmp $ftpusers rm -f $ftpusers.tmp chown bin:bin $ftpusers chmod 600 $ftpusers" + compliance: + - cis: ["1.6.2"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:FTP.ftpusers="Y"' + + - id: 30034 + title: "Prevent Syslog from accepting messages from the network." + description: "Prevent syslogd from accepting messages from the network. By default the system logging daemon, syslogd, listens for log messages from other systems on network port 514/udp. Unfortunately, the protocol used to transfer these messages does not include any form of authentication, so a malicious outsider could simply barrage the local system's Syslog port with spurious traffic—either as a denial-of-service attack on the system, or to fill up the local system's logging file systems so that subsequent attacks will not be logged. - Note: Do not perform this action if this machine is a log server, or needs to receive Syslog messages via the network from other systems. - Note: It is considered good practice to setup one or more machines as central 'log servers' to aggregate log traffic from all machines at a site. However, unless a system is set up to be one of these 'log server' systems, it should not be listening on 514/udp for incoming log messages." + rationale: "Disabling unused network services will reduce the remote attack surfaces of the hosting system." + remediation: 'Disable the syslog network option by doing the following: 1. Open the syslogd startup configuration file /etc/rc.config.d/syslogd 2. Add the parameter "-N" to the SYSLOGD_OPTS= line if it is not already present 3. Save and close the file. The following script will perform the procedure above: SYSLOGD_OPTS="`sh -c ". /etc/rc.config.d/syslogd ; \ echo "$SYSLOGD_OPTS"''`" if [[ "$SYSLOGD_OPTS" = *-N* ]]; then ch_rc -a -p SYSLOGD_OPTS="-N $SYSLOGD_OPTS" \ /etc/rc.config.d/syslogd fi' + compliance: + - cis: ["1.6.3"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.syslog_localonly="Y"' + + - id: 30035 + title: "Disable XDMCP port." + description: "Disable the XDMCP port for remote login services. The standard GUI login provided on most Unix systems can act as a remote login server to other devices (including X terminals and other workstations). Access control is handled via the Xaccess file—by default under HP-UX, this file allows any system on the network to get a remote login screen from the local system. This behavior can be overridden in the /etc/dt/config/Xaccess file." + rationale: "XDMCP is an unencrypted protocol that may reduce the confidentiality and integrity of data that traverses it." + remediation: "Perform the following to disable the XDMCP port: 1. Open the file /etc/dt/config/Xconfig. If it does not exist, copy it from /usr/dt/config/Xconfig. 2. Append the line Dtlogin.requestPort:0 to the file and close. The following script will perform the procedure above: if [ ! -f /etc/dt/config/Xconfig ]; then mkdir -p /etc/dt/config cp -p /usr/dt/config/Xconfig /etc/dt/config fi cd /etc/dt/config awk '/Dtlogin.requestPort:/ \ { print \"Dtlogin.requestPort: 0\"; next } { print }' Xconfig > Xconfig.new cp Xconfig.new Xconfig rm -f Xconfig.new" + compliance: + - cis: ["1.6.4"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.xaccess="Y"' + + - id: 30036 + title: "Set default locking screensaver timeout." + description: "The default timeout is between 10 and 30 minutes of keyboard/mouse inactivity before a password-protected screen saver is invoked by the CDE session manager depending on the OS release and the locale. Uniformly reduce this default timeout value to 10 minutes (this setting can still be overridden by individual users in their own environment.)" + rationale: "Setting the inactivity timer to a low value will reduce the probability of a malicious entity compromising the system via the console." + remediation: 'Perform the following to set a default screensaver timeout for all environments: 1. For every sys.resources file in each directory in /usr/dt/config/ create a corresponding /etc/dt/config/*/sys.resources file if it does not already exist. 2. Append the following lines to each /etc/dt/config/*/sys.resources dtsession*saverTimeout: 10 dtsession*lockTimeout: 10 The following script will perform the procedure above: for file in /usr/dt/config/*/sys.resources; do dir="$(dirname "$file" | sed ''s|^/usr/|/etc/|'')" mkdir -p "$dir" echo ''dtsession*saverTimeout: 10'' >>"$dir/sys.resources" echo ''dtsession*lockTimeout: 10'' >>"$dir/sys.resources" done' + compliance: + - cis: ["1.6.5"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:HP_UX.screensaver_timeout="Y"' + + - id: 30037 + title: "Configure IPFilter to allow only select communication." + description: "HP-UX IPFilter (B9901AA) is a stateful system firewall that controls IP packet flow in or out of a machine. It is installed by default on HP-UX 11iv2 (11.23) and later. On older systems, IPFilter can be obtained from http://www.hp.com/go/ipfilter. The rules below will work in an otherwise-empty ipf.conf file, or, if there are rules already present, it will block all that were not passed earlier in the ruleset. This is less likely to break things, but will allow more traffic through. Alternatively, you can instead take the pass lines below (not using the block rule), and change them into 'block in quick' rules, and place those at the top of the file. This will error on the side of blocking traffic. See ipf(5) for detail. Your ruleset can be tested using ipftest(1). Bastille note: if using to change and monitor the IPFilter firewall, ensure that rules are added to /etc/opt/sec_mgmt/bastille/ipf.customrules, and that Bastille is rerun with the last config file, so they will not be overwritten in a subsequent lockdown." + rationale: "Restricting incoming network traffic to explicitly allowed hosts will help prevent unauthorized access the system." + remediation: "Perform the following to add enable ipfilter and install a default ruleset to block unauthorized incoming connections: 1. Enable ipfilter: ipfilter -e 2. Append the following lines to /etc/opt/ipf/ipf.conf: block in all pass in from / pass in from / replacing each / with an authorized IP address and mask. 3. Flush the old rules and read in the updated rules: ipf -Fa -f /etc/opt/ipf/ipf.conf The following script can be used to as a template for creating your own script to perform the procedure above: ipfilter -e cat <> /etc/opt/ipf/ipf.conf block in all pass in from / pass in from / EOF ipf -Fa -f /etc/opt/ipf/ipf.conf" + compliance: + - cis: ["1.6.6"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:IPFilter.configure_ipfilter="N"' + + - id: 30038 + title: "Restrict at/cron to authorized users." + description: "The cron.allow and at.allow files are a list of users who are allowed to run the crontab and at commands to submit jobs to be run at scheduled intervals. - Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. cron.allow only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator needs the ability to schedule jobs." + remediation: "Perform the following to restrict at/cron to root only: 1. Change to the /var/adm/cron directory 2. Archive or delete any existing cron.deny and at.deny files 3. Create or replace the cron.allow and at.allow files with a single line file containing just root 4. Ensure that the files are owned by root and group owned by sys 5. Ensure that no users have write/execute permission to the files, and that only root has read access to the files. The following script will perform the procedures above: cd /var/adm/cron rm -f cron.deny at.deny echo root >cron.allow echo root >at.allow chown root:sys cron.allow at.allow chmod 400 cron.allow at.allow" + compliance: + - cis: ["1.6.7"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.cronuser="Y"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.atuser="Y"' + + - id: 30039 + title: "Restrict crontab file permissions." + description: "The system crontab files are only accessed by the cron daemon (which runs with superuser privileges) and the crontab command (which is set-UID to root)." + rationale: "Allowing unprivileged users to read or (even worse) modify system crontab files can create the potential for a local user on the system to gain elevated privileges." + remediation: "Perform the following so that only root has access to the crontab files: 1. Change to the /var/spool/cron/crontabs directory 2. Change the file owner to root and file group owner to sys 3. Set file permissions so that only root has access to the files. The following script will perform the procedure above: cd /var/spool/cron/crontabs chown root:sys * chmod og-rwx *" + compliance: + - cis: ["1.6.8"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.crontabs_file="Y"' + + - id: 30040 + title: "Restrict root logins to system console." + description: "Anonymous root logins should never be allowed except on the system console in emergency situations. At all other times, the administrator should access the system via an unprivileged account and use some authorized mechanism to gain additional privilege, such as the su command, the freely-available sudo package discussed in item SN.6, or the HP Role Based Authorization system also discussed in item SN.6. These mechanisms provide at least a limited audit trail in the event of problems." + rationale: "Anonymous root logins do not provide an audit trail, nor are subject to additional authorization provisions." + remediation: "Perform the following to restrict root logins to the system console only: 1. Replace the file /etc/securetty with a single line file containing console 2. Change the file owner to root and file group owner to sys 3. Set file permissions so that only root has access to the file. The following script will perform the procedure above: echo console > /etc/securetty chown root:sys /etc/securetty chmod og-rwx /etc/securetty" + compliance: + - cis: ["1.6.9"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.create_securetty="Y"' + + - id: 30041 + title: "Disable nobody access for secure RPC." + description: 'The keyserv process stores user keys that are utilized with the ONC secure RPC mechanism. The action below prevents keyserv from using default keys for the "nobody" user, effectively stopping this user from accessing information via secure RPC.' + rationale: "The default 'nobody' user should not be accessing information via secure RPC." + remediation: "Perform the following to disable nobody access for secure RPC: 1. Add the '-d' option to the KEYSERV_OPTIONS parameter in the system startup configuration file /etc/rc.config.d/namesvrs The following script will perform the procedure above: KEYSERV_OPTIONS=\"`sh -c '. /etc/rc.config.d/namesvrs ; echo \"$KEYSERV_OPTIONS\"'`\" ch_rc -a -p KEYSERV_OPTIONS=\"-d $KEYSERV_OPTIONS \" \ /etc/rc.config.d/namesvrs" + compliance: + - cis: ["1.6.11"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.nobody_secure_rpc="N"' + + ################################################################# + # 1.7 Logging + ################################################################# + + - id: 30042 + title: "Enable kernel-level auditing." + description: "If inetd is running, it is a good idea to make use of the 'logging' (-l) feature of the HP-UX inetd that logs information about the source of any network connections seen by the daemon, allowing the administrator (or software) to scan the logs for unusual activity. This is especially powerful when combined with the access control capabilities accessible through inetd‟s /var/adm/inetd.sec configuration file. This information is logged via Syslog and by default HP-UX systemsdeposit this logging information in var/adm/syslog/syslog.log with other system log messages. Should the administrator wish to capture this information in a separate file, simply modify /etc/syslog.conf to log daemon.notice to some other log file destination. IPFilter, which comes with HP-UX, can log inetd and other connections or attempted connections with its 'ipmon' daemon as either a compliment or alternative to inetd logging." + rationale: "By recording key system events in log files, kernel-level auditing provides a trail to detect and analyze security breaches. Moreover, this data can be used to detect potential security weakness, and also serves as a deterrent against system abuses." + remediation: "Use the Systems Management Homepage (SMH) facility to configure and enable the type and level of auditing appropriate for your environment." + compliance: + - cis: ["1.7.1"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.system_auditing="Y"' + + - id: 30043 + title: "Enable logging from inetd." + description: 'If inetd is running, it is a good idea to make use of the "logging" (-l) feature of the HP-UX inetd that logs information about the source of any network connections seen by the daemon, allowing the administrator (or software) to scan the logs for unusual activity. This is especially powerful when combined with the access control capabilities accessible through inetd''s /var/adm/inetd.sec configuration file. This information is logged via Syslog and by default HP-UX systems deposit this logging information in var/adm/syslog/syslog.log with other system log messages. Should the administrator wish to capture this information in a separate file, simply modify /etc/syslog.conf to log daemon.notice to some other log file destination. IPFilter, which comes with HP-UX, can log inetd and other connections or attempted connections with its "ipmon" daemon as either a compliment or alternative to inetd logging.' + rationale: "Logging information about the source of inetd network connections assists in the detection and identification of unusual activity that may be associated with security intrusions." + remediation: "Perform the following: ch_rc -a -p INETD_ARGS=-l /etc/rc.config.d/netdaemons" + compliance: + - cis: ["1.7.2"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.log_inetd="Y"' + + - id: 30144 + title: "Turn on additional logging for FTP daemon." + description: "If the FTP daemon is left on, it is recommended that the command logging (-L) and connection logging (-l) flags also be enabled to track FTP activity on the system, allowing the administrator (or software) to scan the logs for unusual activity. This is especially powerful when combined with the access control capabilities accessible through inetd's /var/adm/inetd.sec configuration file. Note that this setting has no effect if the FTP daemon remains de-activated from item 2.1. Also note that enabling command logging on the FTP daemon (HP-UX 11.x only) can cause user passwords to appear in clear-text form in the system logs, if the user accidentally types their password at the username prompt. Information about FTP sessions will be logged to Syslog and by default HP-UX systems deposit this logging information in /var/adm/syslog/syslog.log with other system log messages. Should the administrator wish to capture this information in a separate file, simply modify /etc/syslog.conf to log daemon.notice to some other log file destination." + rationale: "Logging information about the source of ftp network connections assists in the detection and identification of unusual activity that may be associated with security intrusions." + remediation: 'Perform the following to enable logging for the FTP daemon: 1. Change directory to /etc. 2. Open the inetd.conf file and locate the ftpd configuration entry line. 3. Add the "-L" and "-l" flags to the ftpd entry if not already present. 4. Save and close file. The following script will perform the procedure above: cd /etc awk ''/^ftpd/ && !/-L/ { $NF = $NF " -L" } /^ftpd/ && !/-l/ { $NF = $NF " -l" } { print }'' inetd.conf > inetd.conf.tmp cp inetd.conf.tmp inetd.conf rm -f inetd.conf.tmp' + compliance: + - cis: ["1.7.3"] + - cis_level: ["1"] + condition: all + rules: + - "f:/etc/inetd.conf -> r:^ftpd && r:-l" + - "f:/etc/inetd.conf -> r:^ftpd && r:-L" + + ################################################################# + # 1.8 User Accounts and Environment + ################################################################# + + - id: 30045 + title: "Block system accounts." + description: "Accounts that are not being used by regular users should be locked. Not only should the password field for the account be set to an invalid string, but the shell field in the password file should contain an invalid shell. Access to the uucp and nuucp accounts is only needed when the deprecated Unix to Unix Copy (UUCP) service is in use. The other listed accounts should never require direct access. The actions below locks the passwords to these accounts (on systems converted to Trusted Mode only) and sets the login shell to /bin/false. Note that the above is not an exhaustive list of possible system/application accounts that could be installed on the system. An audit of all users on the system is the only way to be sure that only authorized accounts are in place." + rationale: "System accounts are not used by regular users, and almost never require direct access; thus, they should be locked to prevent accidental or malicious usage." + remediation: 'Perform the following to properly lock the following known system users: www sys smbnull iwww owww sshd hpsmh named uucp nuucp adm daemon bin lp nobody noaccess hpdb useradm 1. Lock the account: passwd -l 2. Set the login shell to an invalid program: /usr/sbin/usermod -s /bin/false 3. If a trusted system, set the adminstrator lock: /usr/lbin/modprpw -m alock=YES The following script will perform the procedure above: for user in www sys smbnull iwww owww sshd \ hpsmh named uucp nuucp adm daemon bin lp \ nobody noaccess hpdb useradm; do passwd -l "$user" /usr/sbin/usermod -s /bin/false "$user" if [[ -f /tcb ]]; then /usr/lbin/modprpw -m alock=YES "$user" fi done' + compliance: + - cis: ["1.8.1"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.block_system_accounts="Y"' + + - id: 30046 + title: "Verify that there are no accounts with empty password fields." + description: 'An account with an empty password field means that anybody may log in as that user without providing a password at all. All accounts should have strong passwords or should be locked by using a password string like "*", "NP", or "*LOCKED*"' + rationale: "User accounts should have passwords, or be locked." + remediation: "Perform the following to ensure that no accounts have an empty password field: 1. Identify all user accounts with an empty password field: logins -p 2. Lock each account: passwd -l 3. If a trusted system, set the administrator lock: /usr/lbin/modprpw -m alock=YES " + compliance: + - cis: ["1.8.2"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.lock_account_nopasswd="Y"' + + - id: 30047 + title: "Set account expiration parameters on active accounts." + description: "The commands below will set all active accounts (except the root account) to force password changes every 90 days (91 days when not running in HP-UX Trusted Mode) and then prevent password changes for seven days (one week) thereafter. Users will begin receiving warnings 30 days (28 days when not running in HP-UX Trusted Mode) before their password expires. Sites also have the option of expiring idle accounts after a certain number of days (see the on-line manual page for the usermod command, particularly the -f option). These are recommended starting values, but sites may choose to make them more restrictive depending on local policies." + rationale: "It is a good idea to force users to change passwords on a regular basis." + remediation: 'Perform the following to set password expiration parameters on all active accounts: 1. Identify all user accounts excluding root that are not locked, and for each: 2. Set password expiration parameters for the account (logname) by executing the following: passwd -x 91 -n 7 -w 28 for trusted systems, perform the following: /usr/lbin/modprpw -m exptm=90,mintm=7,expwarn=30 3. Set the default account expiration parameters by appending the following lines to /etc/default/security: a. PASSWORD_MAXDAYS=91 b. PASSWORD_MINDAYS=7 c. PASSWORD_WARNDAYS=28 4. Set the default parameters for trusted systems with: /usr/lbin/modprdef -m exptm=90,mintm=7,expwarn=30 The following script will perform the procedure above. logins -ox \ | awk -F: ''($8 != "LK" && $1 != "root") { print $1 }'' \ | while read logname; do passwd -x 91 -n 7 -w 28 "$logname" /usr/lbin/modprpw -m exptm=90,mintm=7,expwarn=30 \ "$logname" done echo PASSWORD_MAXDAYS=91 >> /etc/default/security echo PASSWORD_MINDAYS=7 >> /etc/default/security echo PASSWORD_WARNDAYS=28 >> /etc/default/security /usr/lbin/modprdef -m exptm=90,mintm=7,expwarn=30' + compliance: + - cis: ["1.8.3"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> n:AccountSecurity.PASSWORD_MAXDAYS="(\d+)" compare <= 91' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> n:AccountSecurity.PASSWORD_MINDAYS="(\d+)" compare <= 7' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> n:AccountSecurity.PASSWORD_WARNDAYS="(\d+)" compare <= 28' + + - id: 30048 + title: "Set strong password enforcement policies." + description: "The policies set here are designed to force users to make better password choices when changing their passwords. Sites often have differing opinions on the optimal value of the MIN_PASSWORD_LENGTH and PASSWORD_HISTORY_DEPTH parameters. A minimum password length of seven is in line with industry standards, especially the Payment Card Industry (PCI) Security Standard; however, a longer value may be warranted if account locks are not enabled (item 1.6.10). A password history depth of ten combined with passwords that expire four times per year (item 1.8.3) means users will typically not re-use the same password in any given year. Requiring an upper/lowercase and special character password will dramatically increase the password search space and lower the chances for brute-force attack significantly. - Note: these settings are known to exist for HP-UX 11iv2, 0512 and later. The man page for security(5) will indicate if these exist on your particular system. Be sure to consult you local security standards before adopting the values given above." + rationale: "All users should use strong passwords." + remediation: "Perform the following to set strong password enforcement policies: 1. Change the following parameters in the /etc/default/security file to establish default password policies for new users: a. MIN_PASSORD_LENGTH=7 b. PASSWORD_HISTORY_DEPTH=10 c. PASSWORD_MIN_UPPER_CASE_CHARS=1 d. PASSWORD_MIN_DIGIT_CHARS=1 e. PASSWORD_MIN_SPECIAL_CHARS=1 f. PASSWORD_MIN_LOWER_CASE_CHARS=1 2. If using a trusted system, issue the following modprdef commands to disallow null or trivial passwords: modprdef -m nullpw=NO modprdef -m rstrpw=YES The following script will perform the procedure above: modprdef -m nullpw=NO modprdef -m rstrpw=YES ch_rc -a -p MIN_PASSORD_LENGTH=7 /etc/default/security ch_rc -a -p PASSWORD_HISTORY_DEPTH=10 \ /etc/default/security ch_rc -a -p PASSWORD_MIN_UPPER_CASE_CHARS=1 \ /etc/default/security ch_rc -a -p PASSWORD_MIN_DIGIT_CHARS=1 \ /etc/default/security ch_rc -a -p PASSWORD_MIN_SPECIAL_CHARS=1 \ /etc/default/security ch_rc -a -p PASSWORD_MIN_LOWER_CASE_CHARS=1 \ /etc/default/security modprdef -m nullpw=NO modprdef -m rstrpw=YES" + compliance: + - cis: ["1.8.4"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> n:AccountSecurity.PASSWORD_HISTORY_DEPTH="(\d+) compare >= 10"' + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> n:AccountSecurity.MIN_PASSWORD_LENGTH="(\d+) compare >= 7"' + + - id: 30049 + title: "Verify no legacy '+' entries exist in passwd and group files." + description: "'+' entries in various passwd and group files served as markers for systems to insert data from NIS maps at a certain point in a system configuration file. HP-UX does not use these markers, but they may exist in files that have been imported from other platforms. They should be deleted if they exist." + rationale: "Legacy '+' entries are no longer required on HP-UX systems, and may provide an avenue for attackers to gain privileged access on the system." + remediation: "Perform the following to remove any legacy '+' entries in passwd and group files: 1. Display legacy '+' entries: grep '^+:' /etc/passwd /etc/group 2. Remove any entries found from the passwd and group files." + compliance: + - cis: ["1.8.5"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:MiscellaneousDaemons.nis_client="Y"' + + - id: 30050 + title: "No '.' or group/world-writable directory in root $PATH." + description: "Remove the current working directory ('.') or other world-writable directories from the root user's execution path. To execute a file in the current directory when „.‟ is not in the $PATH, use the format “./filename”." + rationale: "Including these paths in the root's executable path allows an attacker to gain superuser access if an administrator operating as root executes a Trojan horse program." + remediation: "Remove the following path components if they exist in the root user's $PATH: 1. current working directory ('.') 2. empty directories („::‟) 3. a trailing path seperator at the end of the $PATH (':') 4. any directory with world or group -write permissions set" + compliance: + - cis: ["1.8.6"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.root_path="Y"' + + - id: 30051 + title: "Secure user home directories." + description: "Remove group write and world access to all user home directories. While the modifications below are relatively benign, making global modifications to user home directories without alerting your user community can result in unexpected outages and unhappy users." + rationale: "Group or world-writable user home directories may enable malicious users to steal or modify other users' data or to gain another user's system privileges." + remediation: 'Perform the following to secure user home directories: 1. Identify all user accounts excluding root that are not locked, and for each of these user home directories: 2. Remove group write permission (g-w) and all other permissions (o-rwx) The following script will perform the procedure above: logins -ox \ | awk -F: ''($8 == "PS" && $1 != "root") { print $6 }'' \ | grep /home/ \ | while read dir do chmod g-w,o-rwx "$dir" done' + compliance: + - cis: ["1.8.7"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.restrict_home="Y"' + + - id: 30052 + title: "No user dot-files should be group/world writable." + description: "Remove group and world write permissions from user dot-files. While the modifications below are relatively benign, making global modifications to user dot-files without alerting your user community can result in unexpected outages and unhappy users." + rationale: "Group or world-writable user configuration files may enable malicious users to steal or modify other users' data or to gain another user's system privileges." + remediation: 'Perform the following: 1. Identify all user accounts excluding root that are not locked, and for each of these user home directories: 2. Remove group/other write permissions (go-w) from any files beginning with ''.'' The following script performs the procedure above: logins -ox \ | awk -F: ''($8 == "PS") { print $6 }'' \ | while read dir do ls -d "$dir/".[!.]* | while read file do if [ ! -h "$file" -a -f "$file" ] then chmod go-w "$file" fi done done' + compliance: + - cis: ["1.8.8"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.user_dot_files="Y"' + + - id: 30053 + title: "Remove user .netrc, .rhosts and .shosts files." + description: "Remove user .netrc, .rhosts, and .shosts files. Note that making global modifications to user security files in their home directories without alerting your user community can result in unexpected outages and unhappy users." + rationale: ".netrc files may contain unencrypted passwords that may be used to attack other systems, while .rhosts and .shosts files used in conjunction with the BSD-style “r-commands” (rlogin, remsh, rcp) or SSH implement a weak form of authentication based on the network address or host name of the remote computer (which can be spoofed by a potential attacker to exploit the local system)." + remediation: 'Perform the following to remove user .netrc, .rhosts, and .shosts files. 1. Identify all user accounts, and for each existing home directory: 2. Remove .netrc, .rhosts, and .shosts files The following script performs the procedure above: logins -ox | cut -f6 -d: | while read h do for file in "$h/.netrc" "$h/.rhosts" "$h/.shosts" do if [ -f "$file" ] then echo "removing $file" rm -f "$file" fi done done' + compliance: + - cis: ["1.8.9"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.user_rc_files="Y"' + + - id: 30054 + title: "Set default umask for users." + description: "Set the default umask to 077 so that files created by users will not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system. - Bastille Note: sets the default umask, but uses a umask of 027 rather than the 077." + rationale: "Restricting access to files and directories created by a user from any other user on the system reduces the possibility of an unauthorized account accessing that user's files. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files (.profile, .cshrc, etc.) in their home directories." + remediation: 'Perform the following to set a default umask for users: 1. Change directory to /etc 2. Append the line umask 077 to the following files: a. profile b. csh.login c. d.profile d. d.login 3. Update the UMASK parameter to 077 in the file /etc/default/security The following script performs the procedure above: cd /etc for file in profile csh.login d.profile d.login do echo umask 077 >> "$file" done ch_rc -a -p UMASK=077 /etc/default/security' + compliance: + - cis: ["1.8.10"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.umask="077"' + + - id: 30055 + title: "Set 'mesg n' as default for all users." + description: "Block the use of write or talk commands to contact the user at their terminal in order to slightly strengthen permissions on the user's tty device. Note that this setting is the default on HP-UX 11i." + rationale: "Since write and talk are no longer widely used at most sites, the incremental security increase is worth the loss of functionality." + remediation: 'Perform the following: 1. Change directory to /etc 2. Append the line mesg n to the following files: a. profile b. csh.login c. d.profile d. d.login The following script performs the procedure above: cd /etc for file in profile csh.login d.profile d.login do echo mesg n >> "$file" done' + compliance: + - cis: ["1.8.11"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:AccountSecurity.mesgn="Y"' + + ################################################################# + # 1.9 Warning Banners + ################################################################# + + - id: 30056 + title: "Create warning banners for terminal-session logins." + description: "The contents of the /etc/issue file are displayed prior to the login prompt on the system's console and serial devices, as well as for remote terminal-session logins such as through SSH or Telnet. /etc/motd is generally displayed after all successful logins, no matter where the user is logging in from, but is thought to be less useful because it only provides notification to the user after the machine has been accessed." + rationale: "Presenting some sort of statutory warning message prior to the normal user logon may assist the prosecution of trespassers on the computer system. Changing some of these login banners also has the side effect of hiding OS version information and other detailed system information from attackers attempting to target specific attacks at a system." + remediation: "Perform the following to create warning banners for terminal-session logins: 1. Compose a default banner text string 2. Append this string to the files /etc/motd and /etc/motd 3. Change the owner to root and group owner to sys for the file /etc/motd 4. Change the owner to root and group owner to root for the file /etc/issue 5. Change file permissions to (644) for the files /etc/motd and /etc/issue" + compliance: + - cis: ["1.9.1"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:SecureInetd.banners="Y"' + + - id: 30057 + title: "Create warning banners for GUI logins." + description: "The standard graphical login program for HP-UX requires the user to enter their username in one dialog box and their password in a second separate dialog. The commands below set the warning message on both to be the same message, but the site has the option of using different messages on each screen. The Dtlogin*greeting.labelString is the message for the first dialog where the user is prompted for their username, and .perslabelString is the message on the second dialog box. Note that system administrators may wish to consult with their site’s legal council about the specifics of any warning banners." + rationale: "Presenting some sort of statutory warning message prior to the normal user logon may assist the prosecution of trespassers on the computer system. Changing some of these login banners also has the side effect of hiding OS version information and other detailed system information from attackers attempting to target specific attacks at a system." + remediation: 'Perform the following to install default warning banners for GUI logins: 1. Create a default banner text string ($banner) 2. For each directory in /usr/dt/config that contains a Xresources file, copy that Xresources file into a corresponding directory in /etc/dt/config (creating the directory if needed) 3. Append the following lines (replacing $banner with the string in step 1) to each /etc/dt/config/*/Xresources file: a. Dtlogin*greeting.labelString: $banner b. Dtlogin*greeting.persLabelString: $banner 4. Change the owner to root and group owner to sys for each Xresource file 5. Change the file permissions to 644 for each Xresource file The following script performs the procedure above: banner="Authorized users only. All activity may \ be monitored and reported." for file in /usr/dt/config/*/Xresources; do dir="$(dirname "$file" | sed ''s|^/usr/|/etc/|'')" mkdir -p "$dir" if [ ! -f "$dir/Xresources" ]; then cp -p "$file" "$dir/Xresources" fi echo "Dtlogin*greeting.labelString: $banner" \ >> "$dir/Xresources" echo "Dtlogin*greeting.persLabelString: $banner" \ >> "$dir/Xresources" done chown root:sys /etc/dt/config/*/Xresources chmod 644 /etc/dt/config/*/Xresources' + compliance: + - cis: ["1.9.2"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:HP_UX.gui_banner="Y"' + + - id: 30058 + title: "Create warning banners for FTP daemon." + description: "The FTP daemon in HP-UX 11 is based on the popular Washington University FTP daemon (WU-FTPD), which is an Open Source program widely distributed on the Internet. Note that this setting has no effect if the FTP daemon remains de-activated from item 1.2.1." + rationale: "Presenting some sort of statutory warning message prior to the normal user logon may assist the prosecution of trespassers on the computer system. Changing some of these login banners also has the side effect of hiding OS version information and other detailed system information from attackers attempting to target specific attacks at a system." + remediation: 'Perform the following to install a default warning banner for the FTP daemon: 1. Ensure that an appropriate warning message exists in the /etc/issue file . 2. Append the line "banner /etc/issue" to the file /etc/ftpd/ftpaccess 3. Change file permissions to 600 for /etc/ftpd/ftpaccess 4. Change owner to root and group owner to sys for both /etc/ftpd and /etc/ftpd/ftpaccess The following script performs the procedure above: if [ -d /etc/ftpd ]; then echo "banner /etc/issue" >>/etc/ftpd/ftpaccess chmod 600 /etc/ftpd/ftpaccess chown root:sys /etc/ftpd /etc/ftpd/ftpaccess fi' + compliance: + - cis: ["1.9.3"] + - cis_level: ["1"] + condition: all + rules: + - 'f:/var/opt/sec_mgmt/bastille/log/Assessment/assessment-log.config -> r:FTP.ftpbanner="Y"' diff --git a/etc/ruleset/sca/mongodb/cis_mongodb_36.yml b/etc/ruleset/sca/mongodb/cis_mongodb_36.yml new file mode 100644 index 0000000000..7ce999d32d --- /dev/null +++ b/etc/ruleset/sca/mongodb/cis_mongodb_36.yml @@ -0,0 +1,277 @@ +# Security Configuration Assessment +# CIS Checks for MongoDB +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for MongoDB 3.6 v1.0.0 - 31-12-2019 + +policy: + id: "cis_mongodb" + file: "cis_mongodb_36.yml" + name: "CIS MongoDB 3.6 Benchmark v1.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for MongoDB version 3.6. This guide was tested against MongoDB 3.6 running on Ubuntu Linux and Windows but applies to other distributions as well" + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that MongoDB is installed on the system." + description: "Requirements for running the SCA scan against the MongoDB policy." + condition: any + rules: + - "f:/etc/mongodb.conf" + - "f:/etc/mongod.conf" + +variables: + $main-conf: /etc/mongod.conf + +checks: + #1 Installation and Patching + #1.1 Ensure the appropriate MongoDB software version/patches are installed - Not implemented + + #2 Authentication + #2.1 + - id: 22500 + title: "Ensure Authentication is configured." + description: "This setting ensures that all clients, users, servers are required to authenticate before being granted access to the MongoDB database. Authentication is the process of verifying the identity of a client. When access control, i.e. authorization, is enabled, MongoDB requires all clients to authenticate themselves in order to determine their access. To authenticate as a user, you must provide a username, password, and the authentication database associated with that user." + rationale: "Failure to authenticate clients, users, servers can enable unauthorized access to the MongoDB database and can prevent tracing actions back to their sources." + remediation: "The authentication mechanism should be implemented before anyone accesses the MongoDB Server. To enable the authentication mechanism: Start the MongoDB instance without authentication. Create the system user administrator, ensuring that its password meets organizationally-defined password complexity requirements. Open mongod.conf and change for authorization value to enabled. Restart the MongoDB instance." + compliance: + - cis: ["1.2"] + - cis_csc: ["16", "16.3"] + references: + - https://docs.mongodb.com/v3.6/core/authentication/ + condition: all + rules: + - 'c:sh -c "cat /etc/mongod.conf | grep \\-A4 \"security:\"" -> r:authorization: "enabled"' + + #2.2 + - id: 22501 + title: "Ensure that MongoDB does not bypass authentication via the localhost exception." + description: "MongoDB should not be set to bypass authentication via the localhost exception. The localhost exception allows the user to enable authorization before creating the first user in the system. When active, the localhost exception allows all connections from the localhost interface to have full access to that instance. The exception applies only when there are no users created in the MongoDB instance. Note: This recommendation only applies when there are no users created in the MongoDB instance." + rationale: "Disabling this exception will prevent unauthorized local access to the MongoDB database. It will also ensure the traceability of each database activity to a specific user. Localhost Exception allows direct connect to Mongod’s without any UN/PW." + remediation: "To disable local authentication on the MongoDB database, type OS Console Command: mongod --setParameter enableLocalhostAuthBypass=0, or manually configure use the setParameter option in the mongo configuration file to set it to false ." + compliance: + - cis: ["2.2"] + - cis_csc: ["16", "16.3"] + references: + - https://docs.mongodb.com/v3.6/reference/parameters/#param.enableLocalhostAuthBypass + condition: all + rules: + - 'f:$main-conf -> r:enableLocalhostAuthBypass: \(0|false\)' + + #2.3 + - id: 22502 + title: "Ensure authentication is enabled in the sharded cluster." + description: "Authentication is enabled in a sharded cluster when the certificate or key files are created and configured for all components. This ensures that every client that accesses the cluster must provide credentials, to include MongoDB instances that access each other within the cluster. With keyfile authentication, each mongod or mongos instance in the sharded cluster uses the contents of the keyfile as the shared password for authenticating other members in the deployment. Only mongod or mongos instances with the correct keyfile can join the sharded cluster. For Production Environment: x.509 certificate authentication with secure TSL/SSL connection must be used for authentication. For Development Purpose: Key file can be used as an authentication mechanism between the shared cluster. Keyfiles are bare-minimum forms of security and are best suited for testing or development environments." + rationale: "Enforcing a key or certificate on a sharded cluster prevents unauthorized access to the MongoDB database and provides traceability of database activities to a specific user or component. A MongoDB sharded cluster can enforce user authentication as well as internal authentication of its components to secure against unauthorized access." + remediation: "To authenticate to servers, clients can use x.509 certificates instead of usernames and passwords. MongoDB supports x.509 certificate authentication for use with a secure TLS/SSL connection. The x.509 client authentication allows clients to authenticate to servers with certificates rather than with a username and password." + compliance: + - cis: ["2.3"] + - cis_csc: ["16", "1.8"] + references: + - https://docs.mongodb.com/v3.6/tutorial/enforce-keyfile-access-control-in-existing-sharded-cluster-no-downtime/ + - https://docs.mongodb.com/v3.6/tutorial/enforce-keyfile-access-control-in-existing-sharded-cluster/ + - https://docs.mongodb.com/v3.6/tutorial/configure-x509-member-authentication/ + condition: all + rules: + - 'c:sh -c "cat /etc/mongod.conf | grep \\-A12 \"ssl:\"" -> r:PEMKeyFile' + - 'c:sh -c "cat /etc/mongod.conf | grep \\-A12 "ssl:\"" -> r:clusterFile' + - 'c:sh -c "cat /etc/mongod.conf | grep \\-A12 \"ssl:\"" -> r:CAFile' + - 'c:sh -c "cat /etc/mongod.conf | grep \\-A10 \"security:\"" -> r:clusterAuthMode: "x509"' + - 'c:sh -c "cat /etc/mongod.conf | grep \\-A10 \"security:\"" -> r:authenticationMechanisms: "MONGODB-X509"' + + #3 Access Control + #3.1 - Requires mongo shell commands, currently not supported + + #3.2 + - id: 22503 + title: "Ensure that MongoDB only listens for network connections on authorized interfaces." + description: "Ensuring that MongoDB runs in a trusted network environment involves limiting the network interfaces on which MongoDB instances listen for incoming connections. Any untrusted network connections should be dropped by MongoDB. Firewalls allow administrators to filter and control access to a system by providing granular control over network communications. For administrators of MongoDB, the following capabilities are important: 1. Limiting incoming traffic on a specific port to specific systems, 2. Limiting incoming traffic from untrusted hosts. On Linux systems, the iptables interface provides access to the underlying netfilter firewall. On Windows systems, netsh command line interface provides access to the underlying Windows Firewall." + rationale: "This configuration blocks connections from untrusted networks, leaving only systems on authorized and trusted networks able to attempt to connect to the MongoDB. If not configured, this may lead to unauthorized connections from untrusted networks to MongoDB." + remediation: "Configure the MongoDB configuration file to limit its exposure to only the network interfaces on which MongoDB instances should listen for incoming connections." + compliance: + - cis: ["3.2"] + - cis_csc: ["9.1", "9.2"] + references: + - https://docs.mongodb.com/v3.6/tutorial/configure-linux-iptables-firewall/ + - https://docs.mongodb.com/v3.6/tutorial/configure-windows-netsh-firewall/ + - https://docs.mongodb.com/v3.6/core/security-network/ + condition: all + rules: + - 'c:sh -c "cat /etc/mongod.conf | grep \\-A12 \"net:\"" -> r:bindIp' + + #3.3 + - id: 22504 + title: "Ensure that MongoDB is run using a Least Privileges, dedicated service account." + description: "The MongoDB service should not be run using a privileged account such as 'root' because this unnecessarily exposes the operating system to high risk. This setting ensures that the monogd service runs as a least-privileged user." + rationale: "Using a non-privileged, dedicated service account restricts the database from accessing the critical areas of the operating system which are not required by MongoDB. This will also mitigate the potential for unauthorized access via a compromised, privileged account on the operating system. Anyone who has been a victim of viruses, worms, and other malicious software (malware) will appreciate the security principle of “least privilege.” If all processes ran with the minial set of privileges needed to perform the user's tasks, it would be more difficult for malware to infect a machine and propagate to other machines." + remediation: "1. Create a user which is only used for running Mongodb and directly related processes. This user must not have administrative rights to the system. Steps to create user. 2. Set the Database data files, the keyfile, and the SSL private key files to only be readable by the mongod/mongos user and then set ownership to mongodb user only. 3. Set the log files to only be writable by the mongod/mongos user and readable only by root." + compliance: + - cis: ["3.3"] + - cis_csc: ["5.1", "4.3"] + references: + - https://docs.mongodb.com/v3.6/tutorial/manage-users-and-roles/ + condition: all + rules: + - 'not c:sh -c "ps -aef | grep mongod" -> r:root' + + #3.4 - Requires mongo shell commands, currently not supported + # - id: 22507 + # title: "Ensure that each role for each MongoDB database is needed and grants only the necessary privileges." + + #3.5 - Requires mongo shell commands, currently not supported + # - id: 22508 + # title: "Review User-Defined Roles." + + #3.6 - Requires mongo shell commands, currently not supported + # - id: 22509 + # title: "Review Superuser/Admin Roles." + + #4 Data Encryption + #4.1 + - id: 22505 + title: "Ensure Encryption of Data in Transit TLS/SSL (Transport Encryption)." + description: "Use TLS or SSL to protect all incoming and outgoing connections. This should include using TLS or SSL to encrypt communication between the mongod and mongos components of a MongoDB client as well as between all applications and MongoDB. MongoDB supports TLS/SSL (Transport Layer Security/Secure Sockets Layer) to encrypt all of MongoDB’s network traffic. TLS/SSL ensures that MongoDB network traffic is only readable by the intended client." + rationale: "This prevents sniffing of cleartext traffic between MongoDB components or performing a man-in-the-middle attack for MongoDB." + remediation: "Configure MongoDB servers to require the use of SSL or TLS to encrypt all MongoDB network communications. To implement SSL or TLS to encrypt all MongoDB network communication, perform the following steps: For mongod (“Primary daemon process for the MongoDB system”) In the configuration file /etc/mongod.conf , set the PEMKeyFile option to the certificate file’s path and then start the component" + compliance: + - cis: ["4.1"] + - cis_csc: ["14.2", "14.4"] + references: + - https://docs.mongodb.com/v3.6/core/security-transport-encryption/ + - https://docs.mongodb.com/v3.6/tutorial/configure-ssl/ + - https://docs.mongodb.com/v3.6/tutorial/configure-ssl-clients/ + - https://docs.mongodb.com/v3.6/tutorial/configure-x509-client-authentication/ + - https://docs.mongodb.com/v3.6/tutorial/configure-x509-member-authentication/ + condition: all + rules: + - 'c:sh -c "cat /etc/mongod.conf | grep \\-A12 \"ssl:\"" -> r:mode: "requireSSL"' + + #4.2 + - id: 22506 + title: "Ensure Federal Information Processing Standard (FIPS) is enabled." + description: "The Federal Information Processing Standard (FIPS) is a computer security standard used to certify software modules and libraries that encrypt and decrypt data securely. You can configure MongoDB to run with a FIPS 140-2 certified library for OpenSSL. FIPS is a property of the encryption system and not the access control system. However, the environment requires FIPS compliant encryption and access control. Organizations must ensure that the access control system uses only FIPS-compliant encryption." + rationale: "FIPS is an industry standard which dictates how data should be encrypted at rest and during transmission." + remediation: "Configuring FIPS mode, ensure that your certificate is FIPS compliant. Run mongod or mongos instance in FIPS mode. Make changes to configuration file, to configure your mongod or mongos instance to use FIPS mode, shut down the instance and update the configuration file" + compliance: + - cis: ["4.2"] + - cis_csc: ["14.2", "14.5", "14.4", "14.8"] + references: + - https://docs.mongodb.com/v3.6/tutorial/configure-fips/ + condition: all + rules: + - 'c:sh -c "cat /etc/mongod.conf | grep \\-A12 \"ssl:\"" -> r:FIPSMode: \(1|true\)' + + #4.3 - Does not provide audit steps + # - id: 22512 + # title: "Ensure Encryption of Data at Rest." + + #5 Auditing + #5.1 + - id: 22507 + title: "Ensure that system activity is audited." + description: "Track access and changes to database configurations and data. MongoDB Enterprise includes a system auditing facility that can record system events (e.g. user operations, connection events) on a MongoDB instance. These audit records permit forensic analysis and allow administrators to verify proper controls." + rationale: "System level logs can be handy while troubleshooting an operational problem or handling a security incident." + remediation: "Set the value of auditLog.destination to the appropriate value" + compliance: + - cis: ["5.1"] + - cis_csc: ["6.2", "6.3"] + references: + - https://docs.mongodb.com/v3.6/tutorial/configure-auditing/ + condition: all + rules: + - 'c:sh -c "cat /etc/mongod.conf | grep \\-A4 \"auditLog\"" -> r:destination' + + #5.2 + - id: 22508 + title: "Ensure that system activity is audited." + description: "MongoDB Enterprise supports auditing of various operations. When enabled, the audit facility, by default, records all auditable operations as detailed in Audit Event Actions, Details, and Results. To specify which events to record, the audit feature includes the --auditFilter option. This check is only for Enterprise editions." + rationale: "All operations carried out on the database are logged. This helps in backtracking and tracing any incident that occurs." + remediation: "Set the audit filters based on the organization’s requirements." + compliance: + - cis: ["5.2"] + - cis_csc: ["6.2", "6.3"] + references: + - https://docs.mongodb.com/v3.6/reference/audit-message/ + - https://docs.mongodb.com/v3.6/tutorial/configure-audit-filters/ + condition: all + rules: + - 'c:sh -c "cat /etc/mongod.conf | grep \\-A10 \"auditLog\"" -> r:filter' + + #5.3 + - id: 22509 + title: "Ensure that audit filters are configured properly." + description: "The SystemLog.quiet option stops logging of information such as:connection events, authentication events, replication sync activitie, evidence of some potentially impactful commands being run (eg: drop , dropIndexes , validate ). This information should be logged whenever possible. This check is only for Enterprise editions." + rationale: "The use of SystemLog.quiet makes troubleshooting problems and investigating possible security incidents much more difficult." + remediation: "Set SystemLog.quiet to false in the /etc/mongod.conf file to disable it." + compliance: + - cis: ["5.3"] + - cis_csc: ["6.2", "6.3"] + references: + - https://docs.mongodb.com/v3.6/reference/configuration-options/#systemLog.quiet + condition: all + rules: + - 'f:$main-conf -> r:quiet: \(0|false\)' + + #5.4 + - id: 22510 + title: "Ensure that new entries are appended to the end of the log file." + description: "By default, new log entries will overwrite old entries after a restart of the mongod or mongos service. Enabling the systemLog.logAppend setting causes new entries to be appended to the end of the log file rather than overwriting the existing content of the log when the mongod or mongos instance restarts." + rationale: "Allowing old entries to be overwritten by new entries instead of appending new entries to the end of the log may destroy old log data that is needed for a variety of purposes." + remediation: "Set systemLog.logAppend to true in the /etc/mongod.conf file." + compliance: + - cis: ["5.4"] + - cis_csc: ["6.3", "6.4"] + references: + - https://docs.mongodb.com/v3.6/reference/configuration-options/#systemLog.logAppend + condition: all + rules: + - 'c:sh -c "cat /etc/mongod.conf | grep \\-A10 \"systemLog\"" -> r:logAppend: \(1|true\)' + + #6 Operating System Hardening + #6.1 + - id: 22511 + title: "Ensure that MongoDB uses a non-default port." + description: "Changing the default port used by MongoDB makes it harder for attackers to find the database and target it." + rationale: "Standard ports are used in automated attacks and by attackers to verify which applications are running on a server." + remediation: "Change the port for MongoDB server to a number other than 27017." + compliance: + - cis: ["6.1"] + - cis_csc: ["9.2"] + references: + - https://docs.mongodb.com/v3.6/reference/default-mongodb-port/ + condition: all + rules: + - "not f:$main-conf -> r:port: 27017" + + #6.2 - Has to be done manually as it is specific to the MongoDB deployment + # - id: 22518 + # title: "Ensure that operating system resource limits are set for MongoDB." + + #6.3 + - id: 22512 + title: "Ensure that server-side scripting is disabled if not needed." + description: "MongoDB supports the execution of JavaScript code for certain server-side operations: mapReduce , group , and $where . If you do not use these operations, server-side scripting should be disabled." + rationale: "If server-side scripting is not needed and is not disabled, this introduces unnecessary risk which may allow an attacker to take advantage of insecure coding." + remediation: "If server-side scripting is not required, disable it by using the --noscripting option on the command line." + compliance: + - cis: ["6.3"] + - cis_csc: ["18.9", "9.2"] + references: + - https://docs.mongodb.com/v3.6/reference/configuration-options/#security.javascriptEnabled + condition: all + rules: + - 'c:sh -c "cat /etc/mongod.conf | grep \\-A10 \"security\"" -> r:javascriptEnabled: 0|false' +# 7 File Permissions +# 7.1 - Has to be done manually as it is specific to the MongoDB deployment +# - id: 22520 +# title: "Ensure authentication file permissions are set correctly." + +# 7.2 - Has to be done manually as it is specific to the MongoDB deployment +# - id: 22521 +# title: "Ensure that database file permissions are set correctly." diff --git a/etc/ruleset/sca/nginx/cis_nginx_1.yml b/etc/ruleset/sca/nginx/cis_nginx_1.yml new file mode 100644 index 0000000000..ee852fb34e --- /dev/null +++ b/etc/ruleset/sca/nginx/cis_nginx_1.yml @@ -0,0 +1,865 @@ +# Security Configuration Assessment +# CIS Checks for Debian Linux 10 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security NGINX Benchmark v1.0.0 - 02-28-2019 + +policy: + id: "cis_nginx1" + file: "cis_nginx1.yml" + name: "CIS NGINX version 1.14.0 Benchmark v1.0.0" + description: "This document, CIS NGINX Benchmark, provides prescriptive guidance for establishing a secure configuration posture for NGINX version 1.14.0 running on Linux." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Ensure NGINX is installed" + description: "The CIS NGINX Benchmark recommends using the NGINX binary provided by your vendor for most situations. As an alternative, packages from nginx.org are available for a variety of platforms, including Linux and FreeBSD." + condition: all + rules: + - 'c:nginx -v -> r:nginx\sversion' + +checks: + ############################################################ + # 1 Initial Setup + ############################################################ + + # 1.1 Installation + + # 1.1.1 Ensure NGINX is installed (Scored) + # Already implemented in "requirements" block. + + # 1.1.2 Ensure NGINX is installed from source (Not Scored) + # Not automatable + + # 1.2 Configure Software Updates + + # 1.2.1 Ensure package manager repositories are properly configured (Not Scored) + # Not automatable + + # 1.2.2 Ensure the latest software package is installed (Not Scored) + # Not automatable + + ############################################################ + # 2 Basic Configuration + ############################################################ + + # 2.1 Minimize NGINX Modules + + # 2.1.1 Ensure only required modules are installed (Not Scored) + # Not automatable + + # 2.1.2 Ensure HTTP WebDAV module is not installed (Scored) + - id: 23000 + title: "Ensure HTTP WebDAV module is not installed" + description: "The http_dav_module enables HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV) as defined by RFC 4918. This enables file-based operations on your web server, such as the ability to create, delete, change and move files on your server. Most modern architectures have replaced this functionality with cloud-based object storage, in which case the module should not be installed." + rationale: "WebDAV functionality opens up an unnecessary path for exploiting your web server. Through misconfigurations of WebDAV operations, an attacker may be able to access and manipulate files on the server." + remediation: "To remove the http_dav_module, recompile nginx from source without the --withhttp_dav_module flag." + compliance: + - cis: ["2.1.2"] + - cis_csc: ["5.1"] + references: + - http://nginx.org/en/docs/configure.html + - https://tools.ietf.org/html/rfc4918 + condition: all + rules: + - 'c:sh -c "nginx -V 2>&1 | grep \"http_dav_module\"" -> r:^$' + + # 2.1.3 Ensure modules with gzip functionality are disabled (Scored) + - id: 23001 + title: "Ensure modules with gzip functionality are disabled" + description: "gzip is used for compression. Compression functionality should be disabled to prevent certain types of attacks from being performed successfully." + rationale: "Compression has been linked with the Breach attack and others. While the Breach attack has been mitigated with modern usages of the HTTP protocol, disabling the use of compression is considered a defense-in-depth strategy to mitigate other attacks." + remediation: "In order to disable the http_gzip_module, nginx must be recompiled from source. This can be accomplished using the below command in the folder you used during your original compilation. This must be done without the --with-http_gzip_static_module configuration directive. './configure --without-http_gzip_module'" + compliance: + - cis: ["2.1.3"] + - cis_csc: ["5.1"] + references: + - http://nginx.org/en/docs/configure.html + - http://nginx.org/en/docs/configure.html + condition: all + rules: + - 'c:sh -c "nginx -V 2>&1 | grep \"http_gzip_module\|http_gzip_static_module\"" -> r:^$' + + # 2.1.4 Ensure the autoindex module is disabled (Scored) + - id: 23002 + title: "Ensure the autoindex module is disabled" + description: "The autoindex module processes requests ending with the slash character. This feature enables directory listing, which could be useful in attacker reconnaissance, so it should be disabled." + rationale: "Automated directory listings may reveal information helpful to an attacker, such as naming conventions and directory paths. Directory listings may also reveal files that were not intended to be revealed." + remediation: "Perform the following to disable the autoindex module: 1. Search the NGINX configuration files (nginx.conf and any included configuration files) to find autoindex directives. 'egrep -i '^\\s*autoindex\\s+' /etc/nginx/nginx.conf'. 'egrep -i '^\\s*autoindex\\s+' /etc/nginx/conf.d/*'. 2. Set the value for all autoindex directives to off, or remove those directives." + compliance: + - cis: ["2.1.4"] + - cis_csc: ["5.1"] + references: + - http://nginx.org/en/docs/http/ngx_http_autoindex_module.htm + condition: none + rules: + - "f:/etc/nginx/nginx.conf -> r:autoindex on" + - "f:/etc/nginx/conf.d/default.conf -> r:autoindex on" + + # 2.2 Account Security + + # 2.2.1 Ensure that NGINX is run using a non-privileged, dedicated service account (Not Scored) + - id: 23003 + title: "Ensure that NGINX is run using a non-privileged, dedicated service account" + description: "The nginx user directive designates which user account nginx worker processes run under. Ensuring a non-privileged, dedicated service account is used is a defense in depth measure to limit what an attacker who compromises the account can do." + rationale: "Running a web server under a non-privileged, dedicated service account helps mitigate the risk of lateral movement to other services or processes in the event the user account running the web services is compromised. The default user nobody is typically used for several processes, and if this is compromised, it could allow an attacker to have access to all processes running as that user." + remediation: "Add a system account for the nginx user with a home directory of /var/cache/nginx and a shell of /sbin/nologin so it does not have the ability to log in, then add the nginx user to be used by nginx: 'user add nginx -r -g nginx -d /var/cache/nginx -s /sbin/nologin'. Then add the nginx user to /etc/nginx/nginx.conf by adding the user directive as shown below: 'user nginx;'" + compliance: + - cis: ["2.2.1"] + - cis_csc: ["5.1"] + references: + - http://nginx.org/en/docs/ngx_core_module.html#user + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^user\s+nginx;' + - 'c:sudo -l -U nginx -> r:^User nginx is not allowed to run sudo\.*' + - 'c:groups nginx -> r:^nginx\s:\snginx$' + + # 2.2.2 Ensure the NGINX service account is locked (Scored) + - id: 23004 + title: "Ensure the NGINX service account is locked" + description: "The nginx user account should have a valid password, but the account should be locked. NOTE: If a different account is used to run nginx, that account's name should be substituted for nginx in the audit and remediation procedures." + rationale: "As a defense-in-depth measure, the nginx user account should be locked to prevent logins and to prevent someone from switching users to nginx using the password. In general, there shouldn't be a need for anyone to have to su as nginx, and when there is a need, sudo should be used instead, which would not require the nginx account password." + remediation: "Use the passwd command to lock the nginx service account: 'passwd -l nginx'" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:passwd -S nginx -> r:^nginx L\.+' + + # 2.2.3 Ensure the NGINX service account has an invalid shell (Scored) + - id: 23005 + title: "Ensure the NGINX service account has an invalid shell" + description: "The nginx account should not have the ability to log in, so the /sbin/nologin shell should be set for the account." + rationale: "The account used for nginx should only be used for the nginx service and does not need to have the ability to log in. This prevents an attacker who compromises the account to log in with it." + remediation: "Change the login shell for the nginx account to /sbin/nologin by using the following command: 'chsh -s /sbin/nologin nginx'" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["5.1"] + condition: all + rules: + - "c:grep nginx /etc/passwd -> r:/sbin/nologin" + + # 2.3 Permissions and Ownership + + # 2.3.1 Ensure NGINX directories and files are owned by root (Scored) + - id: 23006 + title: "Ensure NGINX directories and files are owned by root" + description: "The owner and group of the /etc/nginx directory and its files should be root." + rationale: "Setting ownership to only those users in the root group and the root user will reduce the likelihood of unauthorized modifications to the nginx configuration files." + remediation: "Run the following command to ensure ownership and group ownership is set to root: 'chown -R root:root /etc/nginx'" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:stat -L /etc/nginx -> r:Access:\s*(" && r:Uid:\s+\(\.+root\)\s+Gid:\s+\(\.+root\)$' + + # 2.3.2 Ensure access to NGINX directories and files is restricted (Scored) + - id: 23007 + title: "Ensure access to NGINX directories and files is restricted" + description: "Permissions on the /etc/nginx directory should enforce the principle of least privilege." + rationale: "This ensures that only users who need access to configuration files are able to view them, thus preventing unauthorized access. Other users will need to use sudo in order to access these files." + remediation: "To set permissions to least privilege on the nginx configuration files, issue these commands: 'find /etc/nginx -type d | xargs chmod 750'. 'find /etc/nginx -type f | xargs chmod 640'" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["14"] + references: + - https://dev-sec.io/baselines/nginx/ + condition: none + rules: + - "c:find /etc/nginx -type d -ls -> !r:^drwxr-x---" + - "c:find /etc/nginx -type f -ls -> !r:^-rw-r-----" + + # 2.3.3 Ensure the NGINX process ID (PID) file is secured (Scored) + - id: 23008 + title: "Ensure the NGINX process ID (PID) file is secured" + description: "The PID file stores the main process ID of the nginx process. This file should be protected from unauthorized modification." + rationale: "The PID file should be owned by root and the group root. It should also be readable to everyone, but only writable by root (permissions 644). This will prevent unauthorized modification of the PID file, which could cause a denial of service." + remediation: "If the PID file is not owned by root, issue this command: 'chown root:root /var/run/nginx.pid'. If the PID file has permissions greater than 644, issue this command: 'chown 644 /var/run/nginx.pid'" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:ls -l /var/run/nginx.pid -> r:^\.+\S+\s+root\s+root\s+\.+' + + # 2.3.4 Ensure the core dump directory is secured (Not Scored) + - id: 23009 + title: "Ensure the core dump directory is secured" + description: "Core dumps are snapshots of memory. The working_directorydirective is used to specify the directory NGINX attempts to create core dumps in. Core dumps will be disabled if the directory is not writable by the NGINX user. It is recommended that the working_directory directive be set to a directory that is owned by the root user and the group the NGINX process executes as, and is inaccessible to other users. Usually, production systems should not have this enabled." + rationale: "Core dumps may contain sensitive information that should not be accessible by other accounts on the system." + remediation: "Either remove the working_directory directive from the NGINX configuration files or ensure that the configured directory meets the following requirements: 1. It is not within the NGINX web document root. 2. It is owned by root and has a group ownership of the NGINX group: 'chown root:nginx /var/log/nginx'. 3. It has no read-write-search access permission for other users: 'chmod o-rwx /var/log/nginx'" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["5.1"] + references: + - https://www.nginx.com/resources/wiki/start/topics/tutorials/debugging/#coredump + condition: none + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*working_directory' + + # 2.4 Network Configuration + + # 2.4.1 Ensure NGINX only listens for network connections on authorized ports (Not Scored) + - id: 23010 + title: "Ensure NGINX only listens for network connections on authorized ports" + description: "NGINX can be configured to listen on any port, but it should be configured to listen on authorized ports only." + rationale: "Limiting the listening ports to only those that are authorized helps to ensure no unauthorized services are running through the use of nginx." + remediation: "If any ports are listening that are not authorized, comment out or delete the associated configuration for that listener." + compliance: + - cis: ["2.4.1"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:grep -ir " listen " /etc/nginx -> r:^\.+listen\s+80\s+\.*|^\.+listen\s+443\s+\.*|^\.+:443\s+\.*' + + # 2.4.2 Ensure requests for unknown host names are rejected (Not Scored) - Not automatable + + # 2.4.3 Ensure keepalive_timeout is 10 seconds or less, but not 0 (Scored) + - id: 23011 + title: "Ensure keepalive_timeout is 10 seconds or less, but not 0" + description: "Persistent connections are leveraged by all modern browsers to facilitate greater web performance. The keep-alive timeout limits the time a persistent connection may remain open. Setting the keep-alive timeout allows this timeout to be controlled on the server side." + rationale: "Setting a keep-alive timeout on the server side helps mitigate denial of service attacks that establish too many persistent connections, exhausting server resources." + remediation: "Find the HTTP or server block of your nginx configuration, and add the keepalive_timeout directive. Set it to 10 seconds or less, but not 0. This example command sets it to 10 seconds: 'keepalive_timeout 10;'" + compliance: + - cis: ["2.4.3"] + - cis_csc: ["5.1"] + references: + - http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_timeout + condition: any + rules: + - "c:grep -ir keepalive_timeout /etc/nginx -> r:^$" + - 'c:grep -ir keepalive_timeout /etc/nginx -> r:^\s*\t*keepalive_timeout\s+(\d+) compare <= 10 && r:^\s*\t*keepalive_timeout\s+(\d+) compare > 0;' + + # 2.4.4 Ensure send_timeout is set to 10 seconds or less, but not 0 (Scored) + - id: 23012 + title: "Ensure send_timeout is set to 10 seconds or less, but not 0" + description: "The send_timeout directive sets a timeout for transmitting a response to the client between two successive write operations." + rationale: "Setting the send_timeout directive on the server side helps mitigate slow HTTP denial of service attacks by ensuring write operations taking up large amounts of time are closed." + remediation: "Find the HTTP or server block of your nginx configuration, and add the send_timeout directive. Set it to 10 seconds or less, but not 0. 'send_timeout 10;'" + compliance: + - cis: ["2.4.4"] + references: + - https://www.owasp.org/index.php/SCG_WS_nginx + - http://nginx.org/en/docs/http/ngx_http_core_module.html#send_timeout + condition: any + rules: + - "c:grep -ir send_timeout /etc/nginx -> r:^$" + - 'c:grep -ir send_timeout /etc/nginx -> r:^\s*\t*send_timeout\s+(\d+) compare <= 10 && r:^\s*\t*send_timeout\s+(\d+) compare > 0;' + + # 2.5 Information Disclosure + + # 2.5.1 Ensure server_tokens directive is set to `off` (Scored) + - id: 23013 + title: "Ensure server_tokens directive is set to `off`" + description: "The server_tokens directive is responsible for displaying the NGINX version number and operating system version on error pages and in the Server HTTP response header field. This information should not be displayed." + rationale: "Attackers can conduct reconnaissance on a website using these response headers, then target attacks for specific known vulnerabilities associated with the underlying technologies. Hiding the version will slow down and deter some potential attackers." + remediation: "To disable the server_tokens directive, set it to off inside a server block in your nginx.conf: 'server {...server_tokens off;...}'" + compliance: + - cis: ["2.5.1"] + - cis_csc: ["5.1"] + condition: none + rules: + - 'c:curl -I 127.0.0.1 -> r:^\.*Server:\s+nginx/\.+' + + # 2.5.2 Ensure default error and index.html pages do not reference NGINX (Scored) + - id: 23014 + title: "Ensure default error and index.html pages do not reference NGINX" + description: "The default error and index.html pages for NGINX reveal that the server is NGINX. These default pages should be removed or modified so they do not advertise the underlying infrastructure of the server." + rationale: "By gathering information about the server, attackers can target attacks against its known vulnerabilities. Removing pages that disclose the server runs NGINX helps reduce targeted attacks on the server." + remediation: "Edit /usr/share/nginx/html/index.html andusr/share/nginx/html/50x.html and remove any lines that reference NGINX." + compliance: + - cis: ["2.5.2"] + - cis_csc: ["5.1"] + condition: none + rules: + - 'c:grep -i nginx /usr/share/nginx/html/index.html -> r:\.+' + - 'c:grep -i nginx /usr/share/nginx/html/50x.html -> r:\.+' + + # 2.5.3 Ensure hidden file serving is disabled (Not Scored) + - id: 23015 + title: "Ensure hidden file serving is disabled" + description: "Disabling hidden files is a defense-in-depth mechanism to help prevent accidentally exposing sensitive information." + rationale: "Disabling hidden files prevents an attacker from being able to reference a hidden file that may be put in your location and have sensitive information, like .git files." + remediation: "Edit the nginx.conf file and add the following line: 'location ~ /\\. { deny all; return 404; }'" + compliance: + - cis: ["2.5.3"] + - cis_csc: ["5.1"] + references: + - https://programming-review.com/nginx-disable-access-to-htaccess-file/ + condition: all + rules: + - 'c:grep location /etc/nginx/nginx.conf -> r:^\s*location\s+~\s+/\\.\.*' + + # 2.5.4 Ensure the NGINX reverse proxy does not enable information disclosure (Scored) + - id: 23016 + title: "Ensure the NGINX reverse proxy does not enable information disclosure" + description: "The server and x-powered-by header may specify the underlying technology used by an application. The NGINX reverse proxy may pass these headers if not explicitly directed to remove them." + rationale: "Attackers can conduct reconnaissance on a website using these response headers, then target attacks for specific known vulnerabilities associated with the underlying technologies. Removing these headers will reduce the likelihood of targeted attacks." + remediation: "Implement the below directives as part of your location block. Edit /etc/nginx/nginx.conf and add the following: 'location /docs {....proxy_hide_header X-Powered-By;proxy_hide_header Server;....}'" + compliance: + - cis: ["2.5.4"] + - cis_csc: ["5.1"] + references: + - http://nginx.org/en/docs/http/ngx_http_proxy_module.html + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*proxy_hide_header\s+X-Powered-By;' + - 'f:/etc/nginx/nginx.conf -> r:^\s*proxy_hide_header\s+Server;' + + ############################################################ + # 3 Logging + ############################################################ + + # 3.1 Ensure detailed logging is enabled (Not Scored) + - id: 23017 + title: "Ensure detailed logging is enabled" + description: "System logging should be configured to meet your organizational security and privacy policies. Enabling detailed logging to include information about events, event sources, timestamps, and users may assist in incident response activities. NOTE: Aim to keep sensitive information out of logs. For example, keep sensitive information out of query strings and URIs to avoid this." + rationale: "Performing detailed logging ensures that incident responders, auditors, and others are able to clearly view the activity that has occurred on your server." + remediation: "Edit the log format directive in /etc/nginx/nginx.conf so it logs everything needed to meet your organizational policies. The following variables may be considered as useful examples include in your log_format with descriptive logging. You should consult the NGINX documentation and your organizational policy to ensure you are logging sufficient information and removing sensitive information where needed. '$remote_addr - client address'. '$remote_user - the user if basic authentication is used'. '$status - the HTTP response status'. '$content_type - Content-Type request header field'. '$time_local - local time in the Common Log Format'. '$request_method - request method, usually GET or POST'. '$request - full original request line'. '$uri - normalized URI in request'. '$server_port - port of the server which accepted a request'. '$server_name - name of the server which accepted a request'. '$http_user_agent - user agent of the client requesting access'. '$http_x_forwarded_for - client address a proxy or load balancer is forwarding traffic for'" + compliance: + - cis: ["3.1"] + - cis_csc: ["6.3"] + references: + - http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\.*$remote_addr' + - 'f:/etc/nginx/nginx.conf -> r:^\.*$remote_user' + - 'f:/etc/nginx/nginx.conf -> r:^\.*$status' + - 'f:/etc/nginx/nginx.conf -> r:^\.*$content_type' + - 'f:/etc/nginx/nginx.conf -> r:^\.*$time_local' + - 'f:/etc/nginx/nginx.conf -> r:^\.*$request_method' + - 'f:/etc/nginx/nginx.conf -> r:^\.*$request' + - 'f:/etc/nginx/nginx.conf -> r:^\.*$uri' + - 'f:/etc/nginx/nginx.conf -> r:^\.*$server_port' + - 'f:/etc/nginx/nginx.conf -> r:^\.*$server_name' + - 'f:/etc/nginx/nginx.conf -> r:^\.*$http_user_agent' + - 'f:/etc/nginx/nginx.conf -> r:^\.*$http_x_forwarded_for' + + # 3.2 Ensure access logging is enabled (Scored) + - id: 23018 + title: "Ensure access logging is enabled" + description: "The access_log directive should be on for every core site. It is enabled by default." + rationale: "Access logging allows incident responders and auditors to investigate access to a system in the event of an incident." + remediation: "Ensure the access_log directive is configured for every core site your organization requires logging for. This should look similar to the below configuration snippet. You may use different log file locations based on your needs. 'access_log /var/log/nginx/host.access.log main;'" + compliance: + - cis: ["3.2"] + - cis_csc: ["6.3"] + references: + - http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format + condition: none + rules: + - 'c:grep -ir access_log /etc/nginx -> r:^\.*access_log\s+off;' + + # 3.3 Ensure error logging is enabled and set to the info logging level (Scored) + - id: 23019 + title: "Ensure error logging is enabled and set to the info logging level" + description: "All errors for applications should be logged." + rationale: "Error logging can be useful in identifying an attacker attempting to exploit a system and recreating an attacker's steps. Error logging also helps with identifying possible issues with an application." + remediation: "Edit /etc/nginx/nginx.conf so the error_log directive is present and not commented out. The error_log should be configured to the logging location of your choice. The configuration should look similar to the below: 'error_log /var/log/nginx/error.log info;'" + compliance: + - cis: ["3.3"] + - cis_csc: ["6.3"] + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*error_log\s+/var/log/nginx/error.log\s+info;' + + # 3.4 Ensure log files are rotated (Scored) + - id: 23020 + title: "Ensure log files are rotated" + description: "Log rotation ensures log files do not consume excessive disk space, potentially causing a denial of service." + rationale: "Log files are important to track activity that occurs on your server, but they take up significant amounts of space. Log rotation should be configured in order to ensure the logs do not consume so much disk space that logging becomes unavailable." + remediation: 'Follow the below procedure to change the default configuration to the recommended log rotation configuration. You may need to manually edit or change the below command if the configuration is not the default. To change log compression from daily to weekly: ''sed -i s/daily/weekly/ /etc/logrotate.d/nginx''. To change log rotation from every year to every 13 weeks: ''sed -i "s/rotate 52/rotate 13/" /etc/logrotate.d/nginx''' + compliance: + - cis: ["3.4"] + - cis_csc: ["6.3", "6.4"] + condition: all + rules: + - 'f:/etc/logrotate.d/nginx -> r:^\s*rotate\s+13' + - 'f:/etc/logrotate.d/nginx -> r:^\s*weekly' + + # 3.5 Ensure error logs are sent to a remote syslog server (Not Scored) + - id: 23021 + title: "Ensure error logs are sent to a remote syslog server" + description: "Centralized log management helps ensure logs are forensically sound and are available at a central location for auditing and incident investigation." + rationale: "A centralized logging solution aggregates logs from multiple systems to ensure logs can be referenced in the event systems are thought to be compromised. Centralized log servers are also often used to correlate logs for potential patterns of attack. If a centralized logging solution is not used and systems (and their logs) are believed to be compromised, then logs may not be permitted to be used as evidence." + remediation: "To enable central logging for your error logs, add the below line to your server block in your server configuration file. 192.168.2.1 should be replaced with the location of your central log server. 'error_log syslog:server=192.168.2.1 info;'" + compliance: + - cis: ["3.5"] + - cis_csc: ["6.5"] + references: + - http://nginx.org/en/docs/syslog.html + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*error_log\s+syslog:\.+\s+info;' + + # 3.6 Ensure access logs are sent to a remote syslog server (Not Scored) + - id: 23022 + title: "Ensure access logs are sent to a remote syslog server" + description: "Centralized log management helps ensure logs are forensically sound and are available at a central location for auditing and incident investigation." + rationale: "A centralized logging solution aggregates logs from multiple systems to ensure logs can be referenced in the event systems are thought to be compromised. Centralized log servers are also often used to correlate logs for potential patterns of attack. If a centralized logging solution is not used and systems (and their logs) are believed to be compromised, then logs may not be permitted to be used as evidence." + remediation: "To enable central logging for your access logs, add the below line to your server block in your server configuration file. 192.168.2.1 should be replaced with the location of your central log server. The local logging facility may be changed to any unconfigured facility on your server. 'access_log syslog:server=192.168.2.1,facility=local7,tag=nginx,severity=info combined;'" + compliance: + - cis: ["3.6"] + - cis_csc: ["6.5"] + references: + - http://nginx.org/en/docs/syslog.html + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*access_log\s+syslog:server\.+severity=info\.*;' + + # 3.7 Ensure proxies pass source IP information (Scored) + - id: 23023 + title: "Ensure proxies pass source IP information" + description: "The x-forwarded-for and remote address headers help identify and separate the originating client IP address of the user agent and the proxy IP address. The two types of addresses are the same, and one should always be present." + rationale: "Being able to identify the originating client IP address can help auditors or incident responders identify where the corresponding user came from. This may be useful in the event of an attack to analyze if the IP address is a good candidate for blocking. It may also be useful to correlate an attacker's actions." + remediation: "To ensure your proxy or load balancer will forward information about the client and the proxy to the application, you must set the below headers in your location block. Edit your location block so it shows the proxy_set_header directives for the client and the proxy as shown below. These headers are the exact same and there is no need to have both present. 'server {...location / {proxy_pass (Insert Application URL here);proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}}'" + compliance: + - cis: ["3.7"] + - cis_csc: ["6.4", "6.7"] + references: + - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For + - http://nginx.org/en/docs/http/ngx_http_proxy_module.html + condition: any + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*proxy_set_header\s+XReal-IP\s+\.+' + - 'f:/etc/nginx/nginx.conf -> r:^\.+X-Forwarded-For\s+\$proxy_add_x_forwarded_for' + + ############################################################ + # 4 Encryption + ############################################################ + # 4.1 TLS / SSL Configuration + + # 4.1.1 Ensure HTTP is redirected to HTTPS (Scored) + - id: 23024 + title: "Ensure HTTP is redirected to HTTPS" + description: "Browsers and clients establish encrypted connections with servers by leveraging HTTPS. Requests leveraging HTTP are unencrypted. Unencrypted requests should be redirected so they are encrypted. Any listening HTTP port on your web server should redirect to a server profile that uses encryption. The default HTTP (unencrypted) port is 80." + rationale: "Redirecting user agent traffic to HTTPS helps to ensure all user traffic is encrypted. Modern browsers alert users that your website is insecure when HTTPS is not used. This can decrease user trust in your website and ultimately result in decreased use of your web services. Redirection from HTTP to HTTPS couples security with usability; users are able to access your website even if they lack the security awareness to use HTTPS over HTTP when requesting your website." + remediation: "Edit your web server or proxy configuration file to redirect all unencrypted listening ports, such as port 80, using a redirection through the return directive (cisecurity.org is used as an example server name). 'server {listen 80;server_name cisecurity.org;return 301 https://$host$request_uri;}'" + compliance: + - cis: ["4.1.1"] + - cis_csc: ["5.1", "14.4"] + references: + - https://serversforhackers.com/c/redirect-http-to-https-nginx + condition: any + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*return\s+301\s+https://\.+' + - 'f:/etc/nginx/conf.d/default.conf -> r:^\s*return\s+301\s+https://\.+' + + # 4.1.2 Ensure a trusted certificate and trust chain is installed (Not Scored) + - id: 23025 + title: "Ensure a trusted certificate and trust chain is installed" + description: "Certificates and their trust chains are needed to establish the identity of a web server as legitimate and trusted. Certificate authorities validate a web server's identity and that you are the owner of that web server domain name." + rationale: "Without a certificate and full trust chain installed on your web server, modern browsers will flag your web server as untrusted." + remediation: "Use the following procedure to install a certificate and its signing certificate chain onto your web server, load balancer, or proxy. Step 1: Create the server's private key and a certificate signing request. The following command will create your certificate's private key with 2048-bit key strength. Optionally, this parameter may be changed to 4096 for greater security. It will also output your certificate signing request to the nginx.csr file in your present working directory. Step 2: Obtain a signed certificate from your certificate authority. Provide your chosen certificate authority with your certificate signing request. Follow your certificate authority's signing procedures in order to obtain a certificate and the certificate's trust chain. A full trust chain is typically delivered in .pem format. Step 3: Install certificate and signing certificate chain on your web server. Place the .pem file from your certificate authority into the directory of your choice. Locate your created key file from the command you used to generate your certificate signing request. Open your website configuration file and edit your encrypted listener to leverage the ssl_certificate and ssl_certificate_key directives for a web server as shown below. You should also inspect include files inside your nginx.conf. This should be part of the server block. After editing this file, you must recycle nginx services for these changes to take effect. This can be done with the following command: 'sudo service nginx restart'" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["14.2"] + references: + - http://nginx.org/en/docs/http/configuring_https_servers.html#chains + - https://www.digicert.com/csr-ssl-installation/nginx-openssl.htm + - https://support.globalsign.com/customer/portal/articles/1290470-installcertificate---nginx + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*ssl_certificate\s+\.+' + - 'f:/etc/nginx/nginx.conf -> r:^\s*ssl_certificate_key\s+\.+' + + # 4.1.3 Ensure private key permissions are restricted (Scored) + - id: 23026 + title: "Ensure private key permissions are restricted" + description: "The server's private key should be protected from unauthorized access by limiting access based on the principle of least privilege." + rationale: "A server's private key file should be restricted to 400 permissions. This ensures only the owner of the private key file can access it. This is the minimum necessary permissions for the server to operate. If the private key file is not protected, an unauthorized user with access to the server may be able to find the private key file and use it to decrypt traffic sent to your server." + remediation: "Run the following command on your key file to ensure its permissions are set to 400. The file name /etc/nginx/nginx.key should be replaced with the location of your key file. 'sudo chmod 400 /etc/nginx/nginx.key'" + compliance: + - cis: ["4.1.3"] + - cis_csc: ["5.1"] + condition: all + rules: + - "f:/etc/nginx/nginx.key" + - 'c:ls -l /etc/nginx/nginx.key -> r:^-r--------\.+' + + # 4.1.4 Ensure only modern TLS protocols are used (Scored) + - id: 23027 + title: "Ensure only modern TLS protocols are used" + description: "Only modern TLS protocols should be enabled in NGINX for all client connections and upstream connections. Removing legacy TLS and SSL protocols (SSL 3.0, TLS 1.0 and 1.1), and enabling emerging and stable TLS protocols (TLS 1.2), ensures users are able to take advantage of strong security capabilities and protects them from insecure legacy protocols." + rationale: "Why disable SSL 3.0: The POODLE Vulnerability allowed attackers to exploit SSL 3.0 to obtain cleartext information by exploiting weaknesses in CBC in 2014. SSL 3.0 is also no longer FIPS 140-2 compliant. Why disable TLS 1.0: TLS 1.0 was deprecated from use when PCI DSS Compliance mandated that it not be used for any applications processing credit card numbers in June 2018. TLS 1.0 does not make use of modern protections, and almost all user agents that do not support TLS 1.2 or higher are no longer supported by their vendor. Why disable TLS 1.1: Because of the increased security associated with higher versions of TLS, TLS 1.0 should be disabled. Modern browsers will begin to flag TLS 1.1 as deprecated in early 2019. Why enable TLS 1.2: TLS 1.2 takes advantage of several security features including modern cipher suites, perfect forward security, and authenticated encryption." + remediation: 'Run the following commands to change your ssl_protocols if they are already configured. This remediation advice assumes your nginx configuration file does not include server configuration outside of /etc/nginx/nginx.conf. You may have to also inspect the include files in your nginx.conf to ensure this is properly implemented. Web Server: ''sed -i "s/ssl_protocols[^;]*;/ssl_protocols TLSv1.2;/" /etc/nginx/nginx.conf''. Proxy. ''sed -i "s/proxy_ssl_protocols[^;]*;/proxy_ssl_protocols TLSv1.2;/" /etc/nginx/nginx.conf''. If your ssl_protocols are not already configured, this can be accomplished manually by opening your web server or proxy server configuration file and manually adding the directives. Web Server. ''server {ssl_protocols TLSv1.2;}''. Proxy. ''location / {proxy_pass cisecurity.org;proxy_ssl_protocols TLSv1.2;}''' + compliance: + - cis: ["4.1.4"] + - cis_csc: ["5.1"] + references: + - https://webkit.org/blog/8462/deprecation-of-legacy-tls-1-0-and-1-1-versions/ + - https://www.cloudflare.com/learning-resources/tls-1-3/ + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*ssl_protocols\s+\.+' + + # 4.1.5 Disable weak ciphers (Scored) + - id: 23028 + title: "Disable weak ciphers" + description: "The ssl_ciphers directive should be used to configure the available ciphers on your web server, and the proxy_ssl_ciphers directive should be used to configure the available ciphers for your proxy. Weak ciphers should be disabled based on your company's policy or an industry best practice compliance profile. The ssl_prefer_server_ciphers should be used to ensure the user agent respects the server's preferred cipher order and does not set its own. If you are using a proxy or load balancer, you should use the proxy_ssl_ciphers directive to ensure your upstream connections are negotiated using secure ciphers." + rationale: "The use of strong ciphers is critical to maintaining strong encryption on your web server, load balancer, or proxy. Weak ciphers may compromise the security of your site or your users by allowing legacy user agents to connect to your site in a vulnerable way. You may also meet compliance concerns by ensuring that your upstream connections meet the same level of security if using a proxy or load balancer. The server should enforce the cipher preference on the server side to protect users from malicious actors on the client side." + remediation: "The following procedures may be used to implement industry standard cipher profiles if you have an existing profile defined. These profiles may be modified to meet the requirements defined in your company's policy. This procedure assumes that all server blocks will be in /etc/nginx/nginx.conf and not inside any included files in the configuration. Set the ssl_cipher directive as part of your server block, and set the proxy_ssl_ciphers directive as part of the location block for your upstream server." + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.1", "14.4"] + references: + - CIS Apache HTTP Server Benchmark + - https://ssllabs.com + - https://mozilla.github.io/server-side-tls/ssl-config-generator/ + - http://nginx.org/en/docs/http/ngx_http_ssl_module.html + - https://www.owasp.org/index.php/Testing_for_SSL-TLS_%28OWASP-CM-001%29 + - https://www.acunetix.com/blog/articles/tls-vulnerabilities-attacks-final-part/ + - https://www.gracefulsecurity.com/tls-ssl-vulnerabilities/ + condition: all + rules: + - 'c:grep -ir "ssl_prefer_server_ciphers on;" /etc/nginx/ -> r:\.+' + + # 4.1.6 Ensure custom Diffie-Hellman parameters are used (Scored) + - id: 23029 + title: "Ensure custom Diffie-Hellman parameters are used" + description: "Custom Diffie-Hellman (DH) key exchange parameters should be used. DH Ephemeral (DHE) parameters with at least 2048 bits should be generated." + rationale: "Backward-compatible Perfect Forward Secrecy (PFS) ciphers (e.g. DHE-RSA-AES128-SHA256) should use strong and unique parameters. By default, NGINX will generate 1024-bit RSA keys for PFS ciphers; stronger alternatives should be used instead to provide betterprotection for data protected by encryption." + remediation: "Generate strong DHE (Ephemeral Diffie-Hellman) parameters using the following commands: 'mkdir /etc/nginx/ssl'. 'openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048'. 'chmod 400 /etc/nginx/ssl/dhparam.pem'. Alter the server configuration to use the new parameters: 'http {server {ssl_dhparam /etc/nginx/ssl/dhparam.pem;}}" + compliance: + - cis: ["4.1.6"] + - cis_csc: ["14.2"] + references: + - https://weakdh.org/sysadmin.html + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:\s*ssl_dhparam\s+\.+.' + + # 4.1.7 Ensure Online Certificate Status Protocol (OCSP) stapling is enabled (Scored) + - id: 23030 + title: "Ensure Online Certificate Status Protocol (OCSP) stapling is enabled" + description: "OCSP allows a user's browser or another user agent to verify the certificate it is seeing is not revoked. OCSP stapling ensures your server presents this information to the user's browser in a way that best meets the performance and security needs of your website. It polls the Certificate Authority's (CA) OCSP server at regular intervals to ensure it is continuously kept up to date. OCSP stapling helps improve performance and security, so it should be enabled." + rationale: "OCSP stapling protects your users from accessing a website where a private key is believed to be compromised. If a private key is compromised, an attacker may be able to obtain unauthorized access to the encrypted data transmitted by a user. Note: OCSP stapling, while a step forward from the older certificate revocation list model, does share similar risks. Between the time a certificate is revoked and the point where a new signed OCSP profile is requested, if a server's certificate has been revoked a user agent may not be informed." + remediation: 'Follow this procedure to enable OCSP validation. Step 1: Ensure your NGINX server has access to your CA''s OCSP server. Your CA''s OCSP server may be found on your CA''s website and will vary depending on your CA vendor. Issue the following command in order to check your connectivity to their site. ''curl -I "insert certificate authority ocsp server here"''. If you get a 200 code response, your server has access. Step 2. Enable OCSP on nginx. Implement the ssl_stapling and ssl_stapling_verify directives. The directive ssl_stapling enables OCSP stapling, and the directive ssl_stapling_verify enables verification of the OCSP responses on nginx. ''server {ssl_stapling on;ssl_stapling_verify on;}''' + compliance: + - cis: ["4.1.7"] + - cis_csc: ["5.1"] + references: + - https://www.digicert.com/ssl-support/nginx-enable-ocsp-stapling-on-server.htm + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*ssl_stapling\s+on' + - 'f:/etc/nginx/nginx.conf -> r:^\s*ssl_stapling_verify\s+on' + + # 4.1.8 Ensure HTTP Strict Transport Security (HSTS) is enabled (Scored) + - id: 23031 + title: "Ensure HTTP Strict Transport Security (HSTS) is enabled" + description: "HTTP Strict Transport Security (HSTS) headers instruct a user agent on how to communicate with a web server. HSTS headers ensure the strict transport security policies built into browsers and other user agents are informed only to communicate over HTTPS. HSTS with long validity periods should be used to most effectively secure your user population. Strict-Transport-Security should have a long max-age, which is recommended to be at least six months in length. This ensures the browser remembers your website should only be accessible via HTTPS for this amount of time." + rationale: "HSTS headers help protect a server's users from accessing the server over unencrypted protocols. This header helps to prevent HTTP downgrade attacks." + remediation: 'Ensure the below snippet of code can be found in your server configuration for your proxy or web server. This will ensure the HSTS header is set with a validity period of six months, or 15768000 seconds. ''server {add_header Strict-Transport-Security "max-age=15768000;";}''' + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.1", "14.4"] + references: + - https://www.globalsign.com/en/blog/what-is-hsts-and-how-do-i-use-it/ + - https://mozilla.github.io/server-side-tls/ssl-config-generator/ + - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-TransportSecurity#Preloading_Strict_Transport_Security + - https://hstspreload.org + - https://tools.ietf.org/html/rfc6797 + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*add_header\s+Strict-Transport-Security\s+"max-age=15768000;"' + + # 4.1.9 Ensure HTTP Public Key Pinning is enabled (Not Scored) + - id: 23032 + title: "Ensure HTTP Public Key Pinning is enabled" + description: "HTTP Public Key Pinning, also known as certificate pinning, allows a site to specify exactly which certificates the browser or another user agent should accept. HTTP Public Key Pinning allows for the certificate rotation to be scheduled using backup fingerprints to ensure that user agent has both certificates stored. HTTP Public Key Pinning should be enabled." + rationale: "HTTP Public Key Pinning assists in preventing a user agent from falling victim to a forged certificate, such as man in the middle attacks." + remediation: 'Find the fingerprint of your certificate by referencing the fingerprint section of your certificate details. Take down the SHA256 fingerprint in this section as well as that of a backup certificate or the next scheduled certificate for the website. Insert your SHA256 fingerprint along with the below header to your server configuration: ''add_header Public-Key-Pins ''pinsha256="base64+primary==InsertPrimaryCertificateSHA256FingerPrintHere"; pinsha256="base64+backup==InsertBackupCertificateSHA256FingerPrintHere"; maxage=5184000;''' + compliance: + - cis: ["4.1.9"] + - cis_csc: ["5.1"] + references: + - https://developer.mozilla.org/en-US/docs/Web/HTTP/Public_Key_Pinning + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*add_header\s+Public-Key-Pins\s+\.+' + + # 4.1.10 Ensure upstream server traffic is authenticated with a client certificate (Scored) + - id: 23033 + title: "Ensure upstream server traffic is authenticated with a client certificate" + description: "Client certificate validation allows the upstream server to authenticate the identity of the client connecting to it. This assists in the establishment of mutual authentication between the client and the server." + rationale: "Using client certificate validation allows you to establish a trusted proxy server." + remediation: "In order to implement this recommendation, you must create a client certificate to be authenticated against and have it signed. Once you have a signed certificate, place the certificate in a location of your choice. In the below example, we use /etc/nginx/ssl/cert.pem. Implement the configuration as part of the location block: 'proxy_ssl_certificate /etc/nginx/ssl/nginx.pem; proxy_ssl_certificate_key /etc/nginx/ssl/nginx.key;'" + compliance: + - cis: ["4.1.10"] + - cis_csc: ["1.6"] + references: + - https://docs.nginx.com/nginx/admin-guide/security-controls/securing-httptraffic-upstream/ + - http://www.staticshin.com/programming/proxy-ssl-cert-in-nginx.html + - http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ssl_certificate + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*proxy_ssl_certificate\s+\.+' + - 'f:/etc/nginx/nginx.conf -> r:^\s*proxy_ssl_certificate_key\s+\.+' + + # 4.1.11 Ensure the upstream traffic server certificate is trusted (Not Scored) + - id: 23034 + title: "Ensure the upstream traffic server certificate is trusted" + description: "The NGINX server should be configured to validate the identity of the upstream server it is sending information to." + rationale: "Configuring NGINX to validate the identity of the upstream server helps mitigate the risk of a man in the middle attack occurring against your server." + remediation: "Obtain the full certificate chain of the upstream server in .pem format. Then reference that file in the location block as part of the proxy_ssl_trusted_certificate directive. Implement the proxy_ssl_trusted_certificate and proxy_ssl_verify directives as shown below as part of the location block you are using to send traffic to your upstream server. 'proxy_ssl_trusted_certificate /etc/nginx/trusted_ca_cert.crt; proxy_ssl_verify on;'" + compliance: + - cis: ["4.1.11"] + - cis_csc: ["5.1"] + references: + - https://docs.nginx.com/nginx/admin-guide/security-controls/securing-httptraffic-upstream/ + - http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ssl_trusted_certificate + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*proxy_ssl_trusted_certificate\s+\.+' + - 'f:/etc/nginx/nginx.conf -> r:^\s*proxy_ssl_verify\s+on' + + # 4.1.12 Ensure your domain is preloaded (Not Scored) - Not automatable + + # 4.1.13 Ensure session resumption is disabled to enable perfect forward security (Scored) + - id: 23035 + title: "Ensure session resumption is disabled to enable perfect forward security" + description: "Session resumption for HTTPS sessions should be disabled so perfect forward secrecy can be achieved." + rationale: "Perfect forward secrecy is an encryption mechanism that enables past session keys to not be compromised even if the server's private key is compromised. If an attacker recorded all traffic to a server and stored it and then obtained the private key without perfect forward secrecy, all communications would be compromised. With perfect forward secrecy, session keys are generated using Diffie-Hellman for every session a user initiates, which isolates session compromise to only that communication session. Allowing session resumption breaks perfect forward secrecy; this expands the surface area for an attacker to compromise past sessions and communications with a server if they are able to compromise the session." + remediation: "Turn off the ssl_session_tickets directive as part of any server block in your nginx configuration. 'ssl_session_tickets off;'" + compliance: + - cis: ["4.1.13"] + - cis_csc: ["5.1"] + references: + - https://www.imperialviolet.org/2013/06/27/botchingpfs.html + - https://scotthelme.co.uk/perfect-forward-secrecy/ + condition: all + rules: + - 'f:/etc/nginx/nginx.conf ->r:^\s*ssl_session_tickets\s+off' + + # 4.1.14 Ensure HTTP/2.0 is used (Not Scored) + - id: 23036 + title: "Ensure HTTP/2.0 is used" + description: "HTTP/2.0 is an optimized and more secure version of the HTTP protocol. It should be enabled so users can take advantage of it. Note: Legacy user agents may not be able to connect to a server using HTTP/2.0." + rationale: "HTTP/2.0 introduces both performance benefits through full multiplexing and several security benefits. HTTP/2.0 has improved cipher suite requirements and blacklists. It also disables session renegotiation and TLS compression. This helps protect against vulnerabilities like CRIME and ensures we have stronger encryption." + remediation: "Open the nginx server configuration file and configure all listening ports with http2, similar to that of this example:" + compliance: + - cis: ["4.1.14"] + - cis_csc: ["5.1"] + references: + - https://mozilla.github.io/server-side-tls/ssl-config-generator/ + - http://http2.github.io/http2-spec/ + condition: all + rules: + - 'c:grep -ir http2 /etc/nginx -> r:^\.+listen\s+\.+http2\.*;' + + ############################################################ + # 5 Request Filtering and Restrictions + ############################################################ + + # 5.1 Access Control + + # 5.1.1 Ensure allow and deny filters limit access to specific IP addresses (Not Scored) + - id: 23037 + title: "Ensure allow and deny filters limit access to specific IP addresses" + description: "IP-based restrictions act as a defense in depth mechanism. They allow you to whitelist legitimate paths to your applications and explicitly deny IP addresses you believe to be malicious." + rationale: "IP restrictions help you to only allow traffic based on the concept of least privilege. You may specify vlans, countries, or specific servers that may be allowed or denied on your site. It is recommended that you implicitly deny all traffic and only allow those with a legitimate use case to access your website if choosing to take this approach. This allows you to limit the surface area an attack may come from." + remediation: "Compile a list of network ranges or IP addresses you would want to access your web server or proxy. Then add these ranges with the allow directive. The deny directive should be included with all IP addresses implicitly denied. 'location / {allow 10.1.1.1;deny all;}'" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["5.1", "9.5"] + references: + - https://help.dreamhost.com/hc/en-us/articles/222784068-The-most-importantsteps-to-take-to-make-an-nginx-server-more-secure + - http://nginx.org/en/docs/http/ngx_http_access_module.html + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*allow\s+\.+;' + - 'f:/etc/nginx/nginx.conf -> r:^\s*deny\s+all\s*;' + + # 5.1.2 Ensure only whitelisted HTTP methods are allowed (Not Scored) + # Not automatable + + # 5.2 Request Limits + + # 5.2.1 Ensure timeout values for reading the client header and body are set correctly (Scored) + - id: 23038 + title: "Ensure timeout values for reading the client header and body are set correctly" + description: "The client_header_timeout and client_body_timeout directives define the time the server will wait for the header or body to be sent from the client. If the client does not send the entire header in this predefined timeframe, the server will send back a 408 request timeout error." + rationale: "Setting the client header and body timeouts help your server mitigate possible denial of service attacks. By timing out a request, the server is able to free up resources that may be waiting for the body or header." + remediation: "Find the HTTP or server block of your nginx configuration and add the client_header_timeout and client_body_timeout directives set to the configuration. The below example sets the timeouts to 10 seconds. 'client_body_timeout 10; client_header_timeout 10;'" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + references: + - https://www.owasp.org/index.php/SCG_WS_nginx + - https://blog.qualys.com/securitylabs/2011/11/02/how-to-protect-against-slowhttp-attacks + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*client_body_timeout\s+10\s*;' + - 'f:/etc/nginx/nginx.conf -> r:^\s*client_header_timeout\s+10\s*;' + + # 5.2.2 Ensure the maximum request body size is set correctly (Scored) + - id: 23039 + title: "Ensure the maximum request body size is set correctly" + description: "The client_max_body_size directive sets the size of the request body that is allowed to read a client request. This defines the number of bytes allowed in a request and is equivalent to the Content-Length request header field." + rationale: "Limiting the size of the request body helps prevent unexpectedly long or large client requests from being passed to an application to perform buffer overflow attacks. This value should be set low enough to protect the application but high enough not to interfere with functionality and block legitimate request bodies." + remediation: "Find the HTTP or server block of your nginx configuration and add the client_max_body_size set to 100K in this block. The appropriate value may be different based on your application's needs. 'client_max_body_size 100K'" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["5.1"] + references: + - https://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html + - http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_temp_path + - https://www.acunetix.com/blog/articles/nginx-server-security-hardeningconfiguration-1/ + - https://www.tecmint.com/nginx-web-server-security-hardening-and-performancetips/ + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*client_max_body_size\s+100K' + + # 5.2.3 Ensure the maximum buffer size for URIs is defined (Scored) + - id: 23040 + title: "Ensure the maximum buffer size for URIs is defined" + description: "The large_client_header_buffers directive defines the number and size of buffers used within the URI. A request cannot exceed the size of this buffer when this directive is configured. The large_client_header_buffers directive should be set to restrict buffer usage. The number of buffers should generally set to two and the length be set to 1K; however, this may not be a good fit for your application and may need to be set differently." + rationale: "The large_client_header_buffers directive may assist in preventing buffer overflow attacks that leverage long URI query parameters." + remediation: "Open your nginx.conf file and locate your server or HTTP blocks. This may be added to the HTTP block for all configurations or the server block for more specific configurations to meet your needs. Add the below line to implement this recommendation: 'large_client_header_buffers 2 1k'" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["5.1"] + references: + - https://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html + - https://www.owasp.org/index.php/Denial_of_Service_Cheat_Sheet + - http://nginx.org/en/docs/http/ngx_http_core_module.html#large_client_header_buffers + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*large_client_header_buffers\s+2\s+1k' + + # 5.2.4 Ensure the number of connections per IP address is limited (Not Scored) + - id: 23041 + title: "Ensure the number of connections per IP address is limited" + description: "The maximum number of simultaneous connections allowed from a single IP address to your server should be limited. It should be set to a value that meets your organizational policies." + rationale: "Limiting the number of simultaneous connections is an effective way to prevent slow denial of service attacks that try to use as many server resources as possible. This can also help prevent brute force attacks on a login page." + remediation: "Implement the below directives under the HTTP and server blocks of your nginx configuration or any include files. The below configuration creates a memory zone of 10 megabytes called limitperip. It will limit the number of connections per IP address to 10 simultaneous connections. The number of simultaneous connections to allow may be different depending on your organization's policies and use cases. 'http {limit_conn_zone $binary_remote_addr zone=limitperip:10m;server {limit_conn limitperip 10;}}'" + compliance: + - cis: ["5.2.4"] + - cis_csc: ["5.1"] + references: + - https://www.nginx.com/resources/library/complete-nginx-cookbook/ + - http://nginx.org/en/docs/http/ngx_http_limit_conn_module.html + - https://scotthelme.co.uk/mitigating-http-get-dos-attack/ + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*limit_conn_zone\s+\.*zone=limitperip:10m' + - 'f:/etc/nginx/nginx.conf -> r:^\s*limit_conn\s+\.*limitperip\s+10\s*' + + # 5.2.5 Ensure rate limits by IP address are set (Not Scored) + - id: 23042 + title: "Ensure rate limits by IP address are set" + description: "Rate limiting should be enabled to limit the number of requests an IP address may make to a server in a given period of time. The configuration values should be set based on your application's needs and your organizational policy." + rationale: "Rate limiting allows you to mitigate potential denial of service attacks as a defense in depth mechanism." + remediation: 'Implement the below directives under the HTTP and server blocks of your nginx configuration or any include files. The below configuration creates a memory zone of 10 megabytes called "ratelimit" and sets the number of requests per second that can be sent by any given IP address to 5. Further, this configuration sets a burst of 10 to ensure that requests may come more frequently and sets no delay to ensure that the bursting may be all at once and not queued. ''http {limit_req_zone $binary_remote_addr zone=ratelimit:10m rate=5r/s;server {location / {limit_req zone=ratelimit burst=10 nodelay;}}}''' + compliance: + - cis: ["5.2.5"] + - cis_csc: ["5.1"] + references: + - https://scotthelme.co.uk/mitigating-http-get-dos-attack/ + - https://www.nginx.com/blog/rate-limiting-nginx/ + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*limit_req_zone\s+\.*zone=\.+:10m\s+rate=5r/s' + - 'f:/etc/nginx/nginx.conf -> r:^\s*limit_req\s+\.*zone=\.+\s+burst=10\s+nodelay' + + # 5.3 Browser Security + + # 5.3.1 Ensure X-Frame-Options header is configured and enabled (Scored) + - id: 23043 + title: "Ensure X-Frame-Options header is configured and enabled" + description: "The X-Frame-Options header should be set to allow specific websites or no sites at all to embed your website as an object within their own, depending on your organizational policy and application needs." + rationale: "The X-Frame-Options header allows you to mitigate the risk of clickjacking attacks." + remediation: 'Add the below to your server blocks in your nginx configuration. The policy should be configured to meet your organization''s needs. ''add_header X-Frame-Options "SAMEORIGIN";''' + compliance: + - cis: ["5.3.1"] + - cis_csc: ["5.1"] + references: + - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options + - https://scotthelme.co.uk/hardening-your-http-response-headers/ + - https://www.veracode.com/blog/2014/03/guidelines-for-setting-security-headers + - https://www.owasp.org/index.php/OWASP_Secure_Headers_Project + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*add_header\s+X-Frame-Options\s+\.+;' + + # 5.3.2 Ensure X-Content-Type-Options header is configured and enabled (Scored) + - id: 23044 + title: "Ensure X-Content-Type-Options header is configured and enabled" + description: "The X-Content-Type-Options header should be used to force supported user agents to check an HTTP response's content type header with what is expected from the destination of the request." + rationale: 'Implementing the X-Content-Type-Options header with the "nosniff" directive helps to prevent drive-by download attacks where a user agent is sniffing content types in responses.' + remediation: 'Open the nginx configuration file that contains your server blocks. Add the below line into your server block to add X-Content-Type-Options header and direct your user agent to not sniff content types. ''add_header X-Content-Type-Options "nosniff";''' + compliance: + - cis: ["5.3.2"] + - cis_csc: ["5.1"] + references: + - https://scotthelme.co.uk/hardening-your-http-response-headers/ + - https://www.veracode.com/blog/2014/03/guidelines-for-setting-security-headers + - https://www.owasp.org/index.php/OWASP_Secure_Headers_Project + - https://fetch.spec.whatwg.org/#x-content-type-options-header + - https://www.iana.org/assignments/message-headers/messageheaders.xml#perm-headers + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*add_header\s+X-Content-Type-Options\s+"nosniff"' + + # 5.3.3 Ensure the X-XSS-Protection Header is enabled and configured properly (Scored) + - id: 23045 + title: "Ensure the X-XSS-Protection Header is enabled and configured properly" + description: "The X-Xss-Protection Header allows you to leverage browser-based protections against cross-site scripting. This should be implemented on your web servers to protect your users and increase user trust in your site. Your policy should be set in blocking mode when possible to ensure the browser blocks a page if cross-site scripting is detected." + rationale: "X-Xss-Protection allows you to protect users whose browsers do not support Content Security Policy (generally older browsers), or protect users if you do not have a Content Security Policy." + remediation: 'Open your nginx configuration file that contains your server blocks. Add the below line into your server block to add Content-Security-Policy and direct your user agent to block reflected cross-site scripting. ''add_header X-Xss-Protection "1; mode=block";''' + compliance: + - cis: ["5.3.3"] + - cis_csc: ["5.1"] + references: + - https://www.owasp.org/index.php/OWASP_Secure_Headers_Project + - https://scotthelme.co.uk/hardening-your-http-response-headers/ + - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*add_header\s+X-Xss-Protection\s+"1;\s+mode=block"' + + # 5.3.4 Ensure that Content Security Policy (CSP) is enabled and configured properly (Not Scored) + - id: 23046 + title: "Ensure that Content Security Policy (CSP) is enabled and configured properly" + description: "Content Security Policy allows administrators to specify the locations from which allowable scripts may be executed, or if scripts may be executed at all. Content Security Policy should be used to improve user trust of your website." + rationale: "Content Security Policies assist organizations in mitigating and reporting cross-site scripting (XSS) attacks." + remediation: 'Open your nginx configuration file that contains your server blocks. Add the below line into your server block to add Content-Security-Policy and direct your user agent to accept documents from only specific origins. ''add_header Content-Security-Policy "default-src ''self''";''' + compliance: + - cis: ["5.3.4"] + - cis_csc: ["5.1"] + references: + - https://scotthelme.co.uk/hardening-your-http-response-headers/ + - https://www.owasp.org/index.php/OWASP_Secure_Headers_Project + - https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP + - https://www.w3.org/TR/CSP3/ + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*add_header\s+Content-Security-Policy\s+"default-src\s+\pself\p"' + + # 5.3.5 Ensure the Referrer Policy is enabled and configured properly (Not Scored) + - id: 23047 + title: "Ensure the Referrer Policy is enabled and configured properly" + description: "When an origin site directs a user to another site, a referrer is sent that identifies the URL the user came from. Depending on your site's specific use, this may present a privacy concern to your users. The Referrer Policy enables organizations to define what sites should see that a referral came from your site, which helps protect user privacy." + rationale: "A Referrer header may expose sensitive data in another web server's log if you use sensitive data in your URL parameters, such as personal information, username, and password or persistent sessions. Ultimately, depending on your application design, not using a properly configured Referrer Policy may allow session hijacking, credential gathering, or sensitive data exposure in a third party's logs." + remediation: 'Add the below line to the server blocks within your nginx configuration. The policy should be customized for your specific organization''s needs. The below policy will ensure your website is never allowed in a referrer. ''add_header Referrer-Policy "no-referrer";''' + compliance: + - cis: ["5.3.5"] + - cis_csc: ["5.1"] + references: + - https://scotthelme.co.uk/a-new-security-header-referrer-policy/ + - https://www.w3.org/TR/referrer-policy/ + condition: all + rules: + - 'f:/etc/nginx/nginx.conf -> r:^\s*add_header\s+Referrer-Policy\s+"no-referrer"' diff --git a/etc/ruleset/sca/ol/9/cis_oracle_linux_9.yml b/etc/ruleset/sca/ol/9/cis_oracle_linux_9.yml new file mode 100644 index 0000000000..81144d2251 --- /dev/null +++ b/etc/ruleset/sca/ol/9/cis_oracle_linux_9.yml @@ -0,0 +1,4478 @@ +# Security Configuration Assessment +# Center for Internet Security Checks for Oracle Linux 9. +# Copyright (C) 2023, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software Foundation +# +# +# Based on: +# Center for Internet Security Oracle Linux 9 Benchmark v1.0.0 - 12-13-2022 + +policy: + id: "cis_oracle_linux_9" + file: "cis_oracle_linux_9.yml" + name: "Center for Internet Security Oracle Linux 9 Benchmark v1.0.0." + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Oracle Linux 9 systems running on x86 and x64 platforms. This document was tested against Oracle Linux 9." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Oracle Linux 9 family platform." + description: "Requirements for running the policy against Oracle Linux 9 family." + condition: all + rules: + - 'f:/etc/oracle-release -> r:^Oracle Linux && r:release\s*9' + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + #################################### + # 1 Initial Setup + #################################### + # 1.1 Filesystem Configuration + #################################### + # 1.1.1 Disable unused filesystems + #################################### + # 1.1.1.1 Ensure mounting of squashfs filesystems is disabled. (Automated) - Not Implemented + # 1.1.1.2 Ensure mounting of udf filesystems is disabled. (Automated) - Not Implemented + #################################### + # 1.1.2 Configure /tmp + #################################### + # 1.1.2.1 Ensure /tmp is a separate partition. (Automated) + - id: 33500 + title: "Ensure /tmp is a separate partition." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "By design files saved to /tmp should have no expectation of surviving a reboot of the system. tmpfs is ram based and all files stored to tmpfs will be lost when the system is rebooted. If files need to be persistent through a reboot, they should be saved to /var/tmp not /tmp. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a configuration where /tmp is not a separate file system it will essentially have the whole disk available, as the default installation only creates a single / partition. On the other hand, a RAM-based /tmp (as with tmpfs) will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily. Another alternative is to create a dedicated partition for /tmp from a separate volume or disk. One of the downsides of a disk-based dedicated partition is that it will be slower than tmpfs which is RAM-based." + remediation: "First ensure that systemd is correctly configured to ensure that /tmp will be mounted at boot time. # systemctl unmask tmp.mount For specific configuration requirements of the /tmp mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs /tmp 0 tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 Example of using a volume or disk with specific mount options. The source location of the volume or disk will vary depending on your environment. /tmp defaults,nodev,nosuid,noexec 0 0." + references: + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + - "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html" + compliance: + - cis: ["1.1.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s' + - "c:systemctl is-enabled tmp.mount -> r:static|generated" + + # 1.1.2.2 Ensure nodev option set on /tmp partition. (Automated) + - id: 33501 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nodev" + + # 1.1.2.3 Ensure noexec option set on /tmp partition. (Automated) + - id: 33502 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:noexec" + + # 1.1.2.4 Ensure nosuid option set on /tmp partition. (Automated) + - id: 33503 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nosuid" + + #################################### + # 1.1.3 Configure /var + #################################### + # 1.1.3.1 Ensure separate partition exists for /var. (Automated) + - id: 33504 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "The reasoning for mounting /var on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s' + + # 1.1.3.2 Ensure nodev option set on /var partition. (Automated) + - id: 33505 + title: "Ensure nodev option set on /var partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:nodev" + + # 1.1.3.3 Ensure nosuid option set on /var partition. (Automated) + - id: 33506 + title: "Ensure nosuid option set on /var partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:nosuid" + + #################################### + # 1.1.4 Configure /var/tmp + #################################### + # 1.1.4.1 Ensure separate partition exists for /var/tmp. (Automated) + - id: 33507 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications. Temporary files residing in /var/tmp are to be preserved between reboots." + rationale: "The reasoning for mounting /var/tmp on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/tmp directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/tmp and cause potential disruption to daemons as the disk is full. Fine grained control over the mount Configuring /var/tmp as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var/tmp may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s' + + # 1.1.4.2 Ensure noexec option set on /var/tmp partition. (Automated) + - id: 33508 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:noexec" + + # 1.1.4.3 Ensure nosuid option set on /var/tmp partition. (Automated) + - id: 33509 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nosuid" + + # 1.1.4.4 Ensure nodev option set on /var/tmp partition. (Automated) + - id: 33510 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nodev" + + #################################### + # 1.1.5 Configure /var/log + #################################### + # 1.1.5.1 Ensure separate partition exists for /var/log. (Automated) + - id: 33511 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "The reasoning for mounting /var/log on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log directory contains log files which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. Fine grained control over the mount Configuring /var/log as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of log data As /var/log contains log files, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.5.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_techniques: ["T0005", "T1499", "T1499.001"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s' + + # 1.1.5.2 Ensure nodev option set on /var/log partition. (Automated) + - id: 33512 + title: "Ensure nodev option set on /var/log partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:nodev" + + # 1.1.5.3 Ensure noexec option set on /var/log partition. (Automated) + - id: 33513 + title: "Ensure noexec option set on /var/log partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot run executable binaries from /var/log." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:noexec" + + # 1.1.5.4 Ensure nosuid option set on /var/log partition. (Automated) + - id: 33514 + title: "Ensure nosuid option set on /var/log partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot create setuid files in /var/log." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:nosuid" + + #################################### + # 1.1.6 Configure /var/log/audit + #################################### + # 1.1.6.1 Ensure separate partition exists for /var/log/audit. (Automated) + - id: 33515 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "The reasoning for mounting /var/log/audit on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log/audit directory contains the audit.log file which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/log/audit and cause auditd to trigger it's space_left_action as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var/log/audit as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of audit data As /var/log/audit contains audit logs, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.6.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s' + + # 1.1.6.2 Ensure noexec option set on /var/log/audit partition. (Automated) + - id: 33516 + title: "Ensure noexec option set on /var/log/audit partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log/audit filesystem is only intended for audit logs, set this option to ensure that users cannot run executable binaries from /var/log/audit." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:noexec" + + # 1.1.6.3 Ensure nodev option set on /var/log/audit partition. (Automated) + - id: 33517 + title: "Ensure nodev option set on /var/log/audit partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log/audit filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:nodev" + + # 1.1.6.4 Ensure nosuid option set on /var/log/audit partition. (Automated) + - id: 33518 + title: "Ensure nosuid option set on /var/log/audit partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log/audit filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:nosuid" + + #################################### + # 1.1.7 Configure /home + #################################### + # 1.1.7.1 Ensure separate partition exists for /home. (Automated) + - id: 33519 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "The reasoning for mounting /home on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /home directory contains user generated data, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /home and impact all local users. Fine grained control over the mount Configuring /home as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. In the case of /home options such as usrquota/grpquota may be considered to limit the impact that users can have on each other with regards to disk resource exhaustion. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of user data As /home contains user data, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.7.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s' + + # 1.1.7.2 Ensure nodev option set on /home partition. (Automated) + - id: 33520 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /home filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:nodev" + + # 1.1.7.3 Ensure nosuid option set on /home partition. (Automated) + - id: 33521 + title: "Ensure nosuid option set on /home partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /home filesystem is only intended for user file storage, set this option to ensure that users cannot create setuid files in /home." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:nosuid" + + #################################### + # 1.1.8 Configure /dev/shm + #################################### + # 1.1.8.1 Ensure /dev/shm is a separate partition. (Automated) + - id: 33522 + title: "Ensure /dev/shm is a separate partition." + description: "The /dev/shm directory is a world-writable directory that can function as shared memory that facilitates inter process communication (IPC)." + rationale: "Making /dev/shm its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /dev/shm useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by mounting tmpfs to /dev/shm." + impact: "Since the /dev/shm directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. /dev/shm utilizing tmpfs can be resized using the size={size} parameter in the relevant entry in /etc/fstab." + remediation: "For specific configuration requirements of the /dev/shm mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs /dev/shm defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 0 tmpfs." + references: + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + - "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html" + compliance: + - cis: ["1.1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + + # 1.1.8.2 Ensure nodev option set on /dev/shm partition. (Automated) + - id: 33523 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + # 1.1.8.3 Ensure noexec option set on /dev/shm partition. (Automated) + - id: 33524 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Example: /dev/shm defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm NOTE It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /dev/shm -> r:noexec" + + # 1.1.8.4 Ensure nosuid option set on /dev/shm partition. (Automated) + - id: 33525 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + # 1.1.9 Disable USB Storage. (Automated) - Not Implemented + #################################### + #1.2 Configure Software Updates + #################################### + # 1.2.1 Ensure GPG keys are configured. (Manual) - Not Implemented + + # 1.2.2 Ensure gpgcheck is globally activated. (Automated) + - id: 33526 + title: "Ensure gpgcheck is globally activated." + description: "The gpgcheck option, found in the main section of the /etc/dnf/dnf.conf and individual /etc/yum.repos.d/* files, determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/dnf/dnf.conf and set gpgcheck=1 in the [main] section. Example: # sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' /etc/dnf/dnf.conf Edit any failing files in /etc/yum.repos.d/* and set all instances starting with gpgcheck to 1. Example: # find /etc/yum.repos.d/ -name \"*.repo\" -exec echo \"Checking:\" {} \\; -exec sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' {} \\;." + compliance: + - cis: ["1.2.2"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1195", "T1195.001"] + - nist_sp_800-53: ["SI-2"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - "f:/etc/dnf/dnf.conf -> r:gpgcheck=1" + - 'd:/etc/yum.repos.d/ -> r:\. -> n:gpgcheck=(\d+) compare = 1' + + # 1.2.3 Ensure package manager repositories are configured. (Manual) - Not Implemented + + # 1.2.4 Ensure repo_gpgcheck is globally activated. (Manual) + - id: 33527 + title: "Ensure repo_gpgcheck is globally activated." + description: "The repo_gpgcheck option, found in the main section of the /etc/dnf/dnf.conf and individual /etc/yum.repos.d/* files, will perform a GPG signature check on the repodata." + rationale: "It is important to ensure that the repository data signature is always checked prior to installation to ensure that the software is not tampered with in any way." + impact: "Not all repositories, notably RedHat, support repo_gpgcheck. Take care to set this value to false (default) for particular repositories that do not support it. If enabled on repositories that do not support repo_gpgcheck installation of packages will fail. Research is required by the user to determine which repositories is configured on the local system and, from that list, which support repo_gpgcheck." + remediation: "Global configuration Edit /etc/dnf/dnf.conf and set repo_gpgcheck=1 in the [main] section. Example: [main] repo_gpgcheck=1 Per repository configuration First check that the particular repository support GPG checking on the repodata. Edit any failing files in /etc/yum.repos.d/* and set all instances starting with repo_gpgcheck to 1." + compliance: + - cis: ["1.2.4"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1195", "T1195.001"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - "f:/etc/dnf/dnf.conf -> r:repo_gpgcheck=1" + + ###################################### + # 1.3 Filesystem Integrity Checking + ###################################### + # 1.3.1 Ensure AIDE is installed. (Automated) + - id: 33528 + title: "Ensure AIDE is installed." + description: "Advanced Intrusion Detection Environment (AIDE) is a intrusion detection tool that uses predefined rules to check the integrity of files and directories in the Linux operating system. AIDE has its own database to check the integrity of files and directories. AIDE takes a snapshot of files and directories including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # dnf install aide Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: Run the following commands: # aide --init # mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz." + references: + - "http://aide.sourceforge.net/stable/manual.html" + compliance: + - cis: ["1.3.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1565", "T1565.001"] + - nist_sp_800-53: ["AU-2"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:rpm -q aide -> r:aide-\S*' + + # 1.3.2 Ensure filesystem integrity is regularly checked. (Automated) + - id: 33529 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check OR if aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + references: + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service" + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer" + compliance: + - cis: ["1.3.2"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1036", "T1036.005"] + - nist_sp_800-53: ["AU-2"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:systemctl is-enabled aidecheck.service -> r:enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:enabled" + - 'c:systemctl status aidecheck.timer -> r:active\s*\t*\(running\)' + + # 1.3.3 Ensure cryptographic mechanisms are used to protect the integrity of audit tools. (Automated) + - id: 33530 + title: "Ensure cryptographic mechanisms are used to protect the integrity of audit tools." + description: "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." + rationale: "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. Attackers may replace the audit tools or inject code into the existing tools with the purpose of providing the capability to hide or erase system activity from the audit logs. Audit tools should be cryptographically signed in order 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." + remediation: "Add or update the following selection lines for to a file ending in .conf in the /etc/aide.conf.d/ directory or to /etc/aide.conf to protect the integrity of the audit tools: # Audit Tools /sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512." + compliance: + - cis: ["1.3.3"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + condition: all + rules: + - 'f:/etc/aide.conf -> r:p+i+n+u+g+s+b+acl+xattrs+sha512' + - 'd:/etc/aide.conf.d/ -> r:\.*.conf -> r:p+i+n+u+g+s+b+acl+xattrs+sha512' + + ############################# + # 1.4 Secure Boot Settings + ############################# + # 1.4.1 Ensure bootloader password is set. (Automated) + - id: 33531 + title: "Ensure bootloader password is set." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + impact: 'If password protection is enabled, only the designated superuser can edit a Grub 2 menu item by pressing "e" or access the GRUB 2 command line by pressing "c" If GRUB 2 is set up to boot automatically to a password-protected menu entry the user has no option to back out of the password prompt to select another menu entry. Holding the SHIFT key will not display the menu in this case. The user must enter the correct username and password. If unable, the configuration files will have to be edited via the LiveCD or other means to fix the problem.' + remediation: "Create an encrypted password with grub2-setpassword: # grub2-setpassword Enter password: Confirm password: ." + compliance: + - cis: ["1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1046"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1542"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - f:/boot/grub2/user.cfg + - f:/boot/grub2/user.cfg -> r:^\s*GRUB2_PASSWORD=grub.pbkdf2.sha512' + + # 1.4.2 Ensure permissions on bootloader config are configured. (Automated) + - id: 33532 + title: "Ensure permissions on bootloader config are configured." + description: "The grub files contain information on boot settings and passwords for unlocking boot options." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set ownership and permissions on your grub configuration files: Run the following command to set ownership and permissions on grub.cfg: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg Run the following command to set ownership and permissions on grubenv: # chown root:root /boot/grub2/grubenv # chmod u-x,og-rwx /boot/grub2/grubenv Run the following command to set ownership and permissions on user.cfg: # chown root:root /boot/grub2/user.cfg # chmod u-x,og-rwx /boot/grub2/user.cfg Note: This may require a re-boot to enable the change." + compliance: + - cis: ["1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005", "TA0007"] + - mitre_techniques: ["T1542"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %#a %u %U %g %G" /boot/grub2/grub.cfg -> r:0\d00\s+0\s+root\s+0\s+root' + - 'c:stat -Lc "%n %#a %u %U %g %G" /boot/grub2/grubenv -> r:0400\s|0600\s && r:0\s+root\s+0\s+root' + - 'c:stat -Lc "%n %#a %u %U %g %G" /boot/grub2/user.cfg -> r:0400\s|0600\s && r:0\s+root\s+0\s+root' + + ############################################### + # 1.5 Additional Process Hardening + ############################################### + # 1.5.1 Ensure core dump storage is disabled. (Automated) + - id: 33533 + title: "Ensure core dump storage is disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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." + remediation: "Edit /etc/systemd/coredump.conf and edit or add the following line: Storage=none." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1005"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*Storage\s*=\s*none' + + # 1.5.2 Ensure core dump backtraces are disabled. (Automated) + - id: 33534 + title: "Ensure core dump backtraces are disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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, increasing the risk to the system." + remediation: "Edit or add the following line in /etc/systemd/coredump.conf: ProcessSizeMax=0." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.2"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1005"] + - nist_sp_800-53: ["CM-6b"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*ProcessSizeMax\s*=\s*0' + + # 1.5.3 Ensure address space layout randomization (ASLR) is enabled. (Automated) - Not Implemented + ############################################### + # 1.6 Mandatory Access Control + ############################################### + ############################################### + # 1.6.1 Configure SELinux + ############################################### + # 1.6.1.1 Ensure SELinux is installed. (Automated) + - id: 33535 + title: "Ensure SELinux is installed." + description: "SELinux provides Mandatory Access Control." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install SELinux: # dnf install libselinux." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1068"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:rpm -q libselinux -> r:^libselinux-" + + # 1.6.1.2 Ensure SELinux is not disabled in bootloader configuration. (Automated) + - id: 33536 + title: "Ensure SELinux is not disabled in bootloader configuration." + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + impact: "Files created while SELinux is disabled are not labeled at all. This behavior causes problems when changing to enforcing mode because files are labeled incorrectly or are not labeled at all. To prevent incorrectly labeled and unlabeled files from causing problems, file systems are automatically relabeled when changing from the disabled state to permissive or enforcing mode. This can be a long running process that should be accounted for as it may extend downtime during initial re-boot." + remediation: "Run the following command to remove the selinux=0 and enforcing=0 parameters: grubby --update-kernel ALL --remove-args \"selinux=0 enforcing=0\" Run the following command to remove the selinux=0 and enforcing=0 parameters if they were created by the deprecated grub2-mkconfig command: # grep -Prsq -- '\\h*([^#\\n\\r]+\\h+)?kernelopts=([^#\\n\\r]+\\h+)?(selinux|enforcing)=0\\b' /boot/grub2 /boot/efi && grub2-mkconfig -o \"$(grep -Prl -- '\\h*([^#\\n\\r]+\\h+)?kernelopts=([^#\\n\\r]+\\h+)?(selinux|enforcing)=0\\b' /boot/grub2 /boot/efi)\"." + compliance: + - cis: ["1.6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1068"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + - 'f:/boot/grub2/grub.cfg -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + + # 1.6.1.3 Ensure SELinux policy is configured. (Automated) + - id: 33537 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1068"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+targeted$|^Loaded policy name:\s+mls$' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Ensure the SELinux mode is not disabled. (Automated) + - id: 33538 + title: "Ensure the SELinux mode is not disabled." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive." + references: + - "https://access.redhat.com/documentation/en-" + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$|^Permissive$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing|\s*SELINUX\s*=\s*permissive' + + # 1.6.1.5 Ensure the SELinux mode is enforcing. (Automated) + - id: 33539 + title: "Ensure the SELinux mode is enforcing." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode the system not only avoids enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future. Running SELinux in Permissive mode, though helpful for developing SELinux policy, only logs access denial entries, but does not deny any operations." + remediation: "Run the following command to set SELinux's running mode: # setenforce 1 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing." + references: + - "https://access.redhat.com/documentation/en-" + compliance: + - cis: ["1.6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + # 1.6.1.6 Ensure no unconfined services exist. (Automated) + - id: 33540 + title: "Ensure no unconfined services exist." + description: "Unconfined processes run in unconfined domains." + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules - it does not replace them." + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:ps -eZ -> r:unconfined_service_t" + + # 1.6.1.7 Ensure SETroubleshoot is not installed. (Automated) + - id: 33541 + title: "Ensure SETroubleshoot is not installed." + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # dnf remove setroubleshoot." + compliance: + - cis: ["1.6.1.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1543", "T1543.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q setroubleshoot -> r:package setroubleshoot is not installed" + + # 1.6.1.8 Ensure the MCS Translation Service (mcstrans) is not installed. (Automated) + - id: 33542 + title: "Ensure the MCS Translation Service (mcstrans) is not installed." + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf." + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # dnf remove mcstrans." + compliance: + - cis: ["1.6.1.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q mcstrans -> r:package mcstrans is not installed" + + ############################################### + # 1.7 Command Line Warning Banners + ############################################### + # 1.7.1 Ensure message of the day is configured properly. (Automated) + - id: 33543 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s|ol' + + # 1.7.2 Ensure local login warning banner is configured properly. (Automated) + - id: 33544 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.7.2"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|ol' + + # 1.7.3 Ensure remote login warning banner is configured properly. (Automated) + - id: 33545 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1018", "T1082", "T1592", "T1592.004"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|ol' + + # 1.7.4 Ensure permissions on /etc/motd are configured. (Automated) + - id: 33546 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd : # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.5 Ensure permissions on /etc/issue are configured. (Automated) + - id: 33547 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue : # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured. (Automated) + - id: 33548 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + ############################################### + # 1.8 GNOME Display Manager + ############################################### + # 1.8.1 Ensure GNOME Display Manager is removed. (Automated) + - id: 33549 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + impact: "Removing the GNOME Display manager will remove the Graphical User Interface (GUI) from the system." + remediation: "Run the following command to remove the gdm package # dnf remove gdm." + references: + - "https://wiki.gnome.org/Projects/GDM" + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:rpm -q gdm -> r:package gdm is not installed' + + # 1.8.2 Ensure GDM login banner is configured. (Automated) - Not Implemented + # 1.8.3 Ensure GDM disable-user-list option is enabled. (Automated) - Not Implemented + # 1.8.4 Ensure GDM screen locks when the user is idle. (Automated) - Not Implemented + # 1.8.5 Ensure GDM screen locks cannot be overridden. (Automated) - Not Implemented + # 1.8.6 Ensure GDM automatic mounting of removable media is disabled. (Automated) - Not Implemented + # 1.8.7 Ensure GDM disabling automatic mounting of removable media is not overridden. (Automated) - Not Implemented + # 1.8.8 Ensure GDM autorun-never is enabled. (Automated) - Not Implemented + # 1.8.9 Ensure GDM autorun-never is not overridden. (Automated) - Not Implemented + + # 1.8.10 Ensure XDCMP is not enabled. (Automated) + - id: 33550 + title: "Ensure XDCMP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. - XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user - XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server." + remediation: "Edit the file /etc/gdm/custom.conf and remove the line: Enable=true." + compliance: + - cis: ["1.8.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1050"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1040", "T1056", "T1056.001", "T1557"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - 'f:/etc/gdm/custom.conf -> r:^\s*Enable\s*=\s*true' + + # 1.9 Ensure updates, patches, and additional security software are installed. (Manual) + - id: 33551 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available updates: # dnf update Once the update process is complete, verify if reboot is required to load changes. dnf needs-restarting -r." + compliance: + - cis: ["1.9"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - mitre_mitigations: ["M1051"] + - mitre_tactics: ["TA0004", "TA0008"] + - mitre_techniques: ["T1211"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'not c:dnf check-update -> r:Updating|Last metadata' + - 'c:dnf needs-restarting -r -> r:Reboot should not be necessary' + + # 1.10 Ensure system-wide crypto policy is not legacy. (Automated) + - id: 33552 + title: "Ensure system-wide crypto policy is not legacy." + description: "The system-wide crypto-policies followed by the crypto core components allow consistently deprecating and disabling algorithms system-wide. The individual policy levels (DEFAULT, LEGACY, FUTURE, and FIPS) are included in the crypto-policies(7) package." + rationale: "If the Legacy system-wide crypto policy is selected, it includes support for TLS 1.0, TLS 1.1, and SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are allowed, while RSA and Diffie-Hellman parameters are accepted if larger than 1023-bits. These legacy protocols and algorithms can make the system vulnerable to attacks, including those listed in RFC 7457." + impact: "Environments that require compatibility with older insecure protocols may require the use of the less secure LEGACY policy level." + remediation: "Run the following command to change the system-wide crypto policy # update-crypto-policies --set Example: # update-crypto-policies --set DEFAULT Run the following to make the updated system-wide crypto policy active # update-crypto-policies." + references: + - "https://access.redhat.com/articles/3642912#what-polices-are-provided-1" + compliance: + - cis: ["1.10"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["SC-8"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: none + rules: + - 'f:/etc/crypto-policies/config -> r:^\s*LEGACY' + + ############################################### + # 2 Services + ############################################### + ############################################### + # 2.1 Time Synchronization + ############################################### + # 2.1.1 Ensure time synchronization is in use. (Automated) + - id: 33553 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them. Note: If another method for time synchronization is being used, this section may be skipped." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Run the following command to install chrony: # dnf install chrony." + compliance: + - cis: ["2.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:rpm -q chrony -> r:^chrony-" + + # 2.1.2 Ensure chrony is configured. (Automated) + - id: 33554 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: 'Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include ''-u chrony'': OPTIONS="-u chrony".' + compliance: + - cis: ["2.1.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1070", "T1070.002"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "f:/etc/chrony.conf" + - 'f:/etc/chrony.conf -> r:^\s*\t*server|^\s*\t*pool' + - 'f:/etc/sysconfig/chronyd -> r:^\s*\t*OPTIONS\.*-u chrony' + + ############################################### + # 2.2 Special Purpose Services + ############################################### + # 2.2.1 Ensure xorg-x11-server-common is not installed. (Automated) + - id: 33555 + title: "Ensure xorg-x11-server-common is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: 'Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime.' + remediation: "Run the following command to remove the X Windows Server packages: # dnf remove xorg-x11-server-common." + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q xorg-x11-server-common -> r:^package xorg-x11-server-common is not installed" + + # 2.2.2 Ensure Avahi Server is not installed. (Automated) + - id: 33556 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to stop, mask and remove avahi: # systemctl stop avahi-daemon.socket avahi-daemon.service # dnf remove avahi." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q avahi -> r:^package avahi is not installed" + + # 2.2.3 Ensure CUPS is not installed. (Automated) + - id: 33557 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface. Note: Removing CUPS will prevent printing from the system." + impact: "Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to remove cups: # dnf remove cups." + references: + - "http://www.cups.org." + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q cups -> r:^package cups is not installed" + + # 2.2.4 Ensure DHCP Server is not installed. (Automated) + - id: 33558 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that the dhcp-server package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcp: # dnf remove dhcp-server." + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dhcp-server -> r:^package dhcp-server is not installed" + + # 2.2.5 Ensure DNS Server is not installed. (Automated) + - id: 33559 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove bind: # dnf remove bind." + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q bind -> r:^package bind is not installed" + + # 2.2.6 Ensure VSFTP Server is not installed. (Automated) + - id: 33560 + title: "Ensure VSFTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "Unless there is a need to run the system as a FTP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # dnf remove vsftpd." + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q vsftpd -> r:^package vsftpd is not installed" + + # 2.2.7 Ensure TFTP Server is not installed. (Automated) + - id: 33561 + title: "Ensure TFTP Server is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "Unless there is a need to run the system as a TFTP server, it is recommended that the package be removed to reduce the potential attack surface. TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + impact: "TFTP is often used to provide files for network booting such as for PXE based installation of servers." + remediation: "Run the following command to remove tftp-server: # dnf remove tftp-server." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp-server -> r:^package tftp-server is not installed" + + # 2.2.8 Ensure a web server is not installed. (Automated) + - id: 33562 + title: "Ensure a web server is not installed." + description: "Web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the packages be removed to reduce the potential attack surface. Note: Several http servers exist. They should also be audited, and removed, if not required." + remediation: "Run the following command to remove httpd and nginx: # dnf remove httpd nginx." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nginx -> r:^package nginx is not installed" + - "c:rpm -q httpd -> r:^package httpd is not installed" + + # 2.2.9 Ensure IMAP and POP3 server is not installed. (Automated) + - id: 33563 + title: "Ensure IMAP and POP3 server is not installed." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface. Note: Several IMAP/POP3 servers exist and can use other service names. These should also be audited and the packages removed if not required." + remediation: "Run the following command to remove dovecot and cyrus-imapd: # dnf remove dovecot cyrus-imapd." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dovecot -> r:^package dovecot is not installed" + - "c:rpm -q cyrus-imapd -> r:^package cyrus-imapd is not installed" + + # 2.2.10 Ensure Samba is not installed. (Automated) + - id: 33564 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # dnf remove samba." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1005", "T1039", "T1083", "T1135", "T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q samba -> r:^package samba is not installed" + + # 2.2.11 Ensure HTTP Proxy Server is not installed. (Automated) + - id: 33565 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "Unless a system is specifically set up to act as a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface. Note: Several HTTP proxy servers exist. These should be checked and removed unless required." + remediation: "Run the following command to remove the squid package: # dnf remove squid." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q squid -> r:^package squid is not installed" + + # 2.2.12 Ensure net-snmp is not installed. (Automated) + - id: 33566 + title: "Ensure net-snmp is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. If SNMP v2 is absolutely necessary, modify the community strings' values. -." + remediation: "Run the following command to remove net-snmpd: # dnf remove net-snmp." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q net-snmp -> r:^package net-snmp is not installed" + + # 2.2.13 Ensure telnet-server is not installed. (Automated) + - id: 33567 + title: "Ensure telnet-server is not installed." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to remove the telnet-server package: # dnf remove telnet-server." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet-server -> r:^package telnet-server is not installed" + + # 2.2.14 Ensure dnsmasq is not installed. (Automated) + - id: 33568 + title: "Ensure dnsmasq is not installed." + description: "dnsmasq is a lightweight tool that provides DNS caching, DNS forwarding and DHCP (Dynamic Host Configuration Protocol) services." + rationale: "Unless a system is specifically designated to act as a DNS caching, DNS forwarding and/or DHCP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dnsmasq: # dnf remove dnsmasq." + compliance: + - cis: ["2.2.14"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + condition: all + rules: + - "c:rpm -q dnsmasq -> r:^package dnsmasq is not installed" + + # 2.2.15 Ensure mail transfer agent is configured for local-only mode. (Automated) + - id: 33569 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Note: - This recommendation is designed around the postfix mail server. - Depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1018", "T1210"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not c:ss -lntu -> r:\.*:25\s && !r:127.0.0.1:25\s+|::1]:25\s+' + + # 2.2.16 Ensure nfs-utils is not installed or the nfs-server service is masked. (Automated) + - id: 33570 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not require network shares, it is recommended that the nfs-utils package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization are dependent on the nfs-utils package. If the nfs-utils package is required as a dependency, the nfs-server service should be disabled and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove nfs-utils OR If the nfs-utils package is required as a dependency, run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1005", "T1039", "T1083", "T1135", "T1210"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q nfs-utils -> r:^package nfs-utils is not installed" + - "c:systemctl is-enabled nfs-server -> r:masked|No such file or directory" + + # 2.2.17 Ensure rpcbind is not installed or the rpcbind services are masked. (Automated) + - id: 33571 + title: "Ensure rpcbind is not installed or the rpcbind services are masked." + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening." + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization, and the nfs-utils package used for The Network File System (NFS), are dependent on the rpcbind package. If the rpcbind package is required as a dependency, the services rpcbind.service and rpcbind.socket should be stopped and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove rpcbind OR If the rpcbind package is required as a dependency, run the following commands to stop and mask the rpcbind.service and rpcbind.socket systemd units: # systemctl --now mask rpcbind.service # systemctl --now mask rpcbind.socket." + compliance: + - cis: ["2.2.17"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1498", "T1498.002", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rpcbind -> r:^package rpcbind is not installed" + - "not c:systemctl status rpcbind rpcbind.socket -> r:Loaded: && !r: masked" + + # 2.2.18 Ensure rsync-daemon is not installed or the rsyncd service is masked. (Automated) + - id: 33572 + title: "Ensure rsync-daemon is not installed or the rsyncd service is masked." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync-daemon package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication. Note: If a required dependency exists for the rsync-daemon package, but the rsyncd service is not required, the service should be masked." + impact: "There are packages that are dependent on the rsync package. If the rsync package is removed, these packages will be removed as well. Before removing the rsync-daemon package, review any dependent packages to determine if they are required on the system. If a dependent package is required, mask the rsyncd service and leave the rsync-daemon package installed." + remediation: "Run the following command to remove the rsync package: # dnf remove rsync-daemon OR Run the following command to mask the rsyncd service: # systemctl --now mask rsyncd." + compliance: + - cis: ["2.2.18"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1105", "T1203", "T1210", "T1543", "T1543.002", "T1570"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rsync-daemon -> r:^package rsync-daemon is not installed" + - "c:systemctl is-enabled rsyncd -> r:masked|No such file or directory" + + ############################################### + # 2.3 Service Clients + ############################################### + # 2.3.1 Ensure telnet client is not installed. (Automated) + - id: 33573 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the telnet package: # dnf remove telnet." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_mitigations: ["M1041", "M1042"] + - mitre_tactics: ["TA0006", "TA0008"] + - mitre_techniques: ["T1040", "T1203", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet -> r:^package telnet is not installed" + + # 2.3.2 Ensure LDAP client is not installed. (Automated) + - id: 33574 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Run the following command to remove the openldap-clients package: # dnf remove openldap-clients." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q openldap-clients -> r:^package openldap-clients is not installed" + + # 2.3.3 Ensure TFTP client is not installed. (Automated) + - id: 33575 + title: "Ensure TFTP client is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + remediation: "Run the following command to remove tftp: # dnf remove tftp." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp -> r:^package tftp is not installed" + + # 2.3.4 Ensure FTP client is not installed. (Automated) + - id: 33576 + title: "Ensure FTP client is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove ftp: # dnf remove ftp." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ftp -> r:^package ftp is not installed" + + # 2.4 Ensure nonessential services listening on the system are removed or masked. (Manual) - Not Implemented + ############################################### + # 3 Network Configuration + ############################################### + ############################################### + # 3.1 Disable unused network protocols and devices + ############################################### + # 3.1.1 Ensure IPv6 status is identified. (Manual) - Not Implemented + # 3.1.2 Ensure wireless interfaces are disabled. (Automated) - Not Implemented + # 3.1.3 Ensure TIPC is disabled. (Automated) - Not Implemented + ############################################### + # 3.2 Network Parameters (Host Only) + ############################################### + # 3.2.1 Ensure IP forwarding is disabled. (Automated) - Not Implemented + # 3.2.2 Ensure packet redirect sending is disabled. (Automated) - Not Implemented + ############################################### + # 3.3 Network Parameters (Host and Router) + ############################################### + # 3.3.1 Ensure source routed packets are not accepted. (Automated) - Not Implemented + # 3.3.2 Ensure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.3 Ensure secure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.4 Ensure suspicious packets are logged. (Automated) - Not Implemented + # 3.3.5 Ensure broadcast ICMP requests are ignored. (Automated) - Not Implemented + # 3.3.6 Ensure bogus ICMP responses are ignored. (Automated) - Not Implemented + # 3.3.7 Ensure Reverse Path Filtering is enabled. (Automated) - Not Implemented + # 3.3.8 Ensure TCP SYN Cookies is enabled. (Automated) - Not Implemented + # 3.3.9 Ensure IPv6 router advertisements are not accepted. (Automated) - Not Implemented + ############################################### + # 3.4 Configure Host Based Firewall + ############################################### + ############################################### + # 3.4.1 Configure a firewall utility + ############################################### + + # 3.4.1.1 Ensure nftables is installed. (Automated) + - id: 33577 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install nftables # dnf install nftables." + compliance: + - cis: ["3.4.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^nftables-" + + # 3.4.1.2 Ensure a single firewall configuration utility is in use. (Automated) - Not Implemented + ############################################### + # 3.4.2 Configure firewall rules + ############################################### + + # 3.4.2.1 Ensure firewalld default zone is set. (Automated) - Not Implemented + + # 3.4.2.2 Ensure at least one nftables table exists. (Automated) + - id: 33578 + title: "Ensure at least one nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "Without a table, nftables will not filter network traffic." + impact: "Adding or modifying firewall rules can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example if FirewallD is not in use on the system: # nft create table inet filter Note: FirewallD uses the table inet firewalld NFTables table that is created when FirewallD is installed." + compliance: + - cis: ["3.4.2.2"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list tables -> r:^table" + - "c:rpm -q nftables -> r:^nftables-" + + # 3.4.2.3 Ensure nftables base chains exist. (Automated) + - id: 33579 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.4.2.3"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^nftables-" + - "c:nft list ruleset -> r:filter hook input" + - "c:nft list ruleset -> r:filter hook forward" + - "c:nft list ruleset -> r:filter hook output" + + # 3.4.2.4 Ensure host based firewall loopback traffic is configured. (Automated) - Not Implemented + # 3.4.2.5 Ensure firewalld drops unnecessary services and ports. (Manual) - Not Implemented + # 3.4.2.6 Ensure nftables established connections are configured. (Manual) - Not Implemented + + # 3.4.2.7 Ensure nftables default deny firewall policy. (Automated) + - id: 33580 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue traversing the network stack. It is easier to explicitly permit acceptable usage than to deny unacceptable usage. Note: Changing firewall settings while connected over the network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "If NFTables utility is in use on your system: Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; }." + compliance: + - cis: ["3.4.2.7"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled nftables.service -> r:enabled" + - "not c:nft list ruleset -> r:hook input && !r:policy drop" + - "not c:nft list ruleset -> r:hook forward && !r:policy drop" + + ############################################################ + # 4 Logging and Auditing. + ############################################################ + # 4.1 Configure System Accounting (auditd). + ############################################################ + # 4.1.1 Ensure auditing is enabled. + ############################################################ + # 4.1.1.1 Ensure auditd is installed. (Automated) + - id: 33581 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # dnf install audit." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v8: ["8.2", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-2", "AU-3", "AU-3(1)", "SI-5"] + - pci_dss_v3.2.1: ["10.1", "10.2", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:rpm -q audit -> r:^audit-" + + # 4.1.1.2 Ensure auditing for processes that start prior to auditd is enabled. (Automated) + - id: 33582 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd , so that potential malicious activity cannot go undetected." + remediation: "Run the following command to update the grub2 configuration with audit=1: # grubby --update-kernel ALL --args 'audit=1'." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:grubby --info=ALL -> r:audit=1" + + # 4.1.1.3 Ensure audit_backlog_limit is sufficient. (Automated) + - id: 33583 + title: "Ensure audit_backlog_limit is sufficient." + description: "The backlog limit has a default setting of 64." + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more that 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected." + remediation: "Run the following command to add audit_backlog_limit= to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit_backlog_limit=' Example: # grubby --update-kernel ALL --args 'audit_backlog_limit=8192'." + compliance: + - cis: ["4.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:grubby --info=ALL -> n:audit_backlog_limit=(\d+) compare >= 8192' + + # 4.1.1.4 Ensure auditd service is enabled. (Automated) + - id: 33584 + title: "Ensure auditd service is enabled." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:enabled" + + ############################################################ + # 4.1.2 Configure Data Retention + ############################################################ + # 4.1.2.1 Ensure audit log storage size is configured. (Automated) + - id: 33585 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1053"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file\s*=\s*\d+' + + # 4.1.2.2 Ensure audit logs are not automatically deleted. (Automated) + - id: 33586 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file_action\s*=\s*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full. (Automated) + - id: 33587 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full. The admin_space_left_action parameter tells the system what action to take when the system has detected that it is low on disk space. Valid values are ignore, syslog, suspend, single, and halt. - ignore, the audit daemon does nothing - Syslog, the audit daemon will issue a warning to syslog - Suspend, the audit daemon will stop writing records to the disk - single, the audit daemon will put the computer system in single user mode - halt, the audit daemon will shut down the system." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + impact: "If the admin_space_left_action parameter is set to halt the audit daemon will shutdown the system when the disk partition containing the audit logs becomes full." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root set admin_space_left_action to either halt or single in /etc/audit/auditd.conf. Example: admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-12", "AU-2", "AU-8", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt|^\s*admin_space_left_action\s*=\s*single' + + ############################################# + # 4.1.3 Configure auditd rules + ############################################# + # 4.1.3.1 Ensure changes to system administration scope (sudoers) is collected. (Automated) + - id: 33588 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers, or files in /etc/sudoers.d, will be written to when the file(s) or related attributes have changed. The audit records will be tagged with the identifier "scope".' + rationale: "Changes in the /etc/sudoers and /etc/sudoers.d files can indicate that an unauthorized change has been made to the scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor scope changes for system administrators. Example: # printf \" -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d -p wa -k scope \" >> /etc/audit/rules.d/50-scope.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - d:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers -p wa -k scope|-w /etc/sudoers -p wa key=scope + - d:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers.d -p wa -k scope|-w /etc/sudoers.d -p wa key=scope + - c:auditctl -l -> r:-w /etc/sudoers -p wa -k scope|-w /etc/sudoers -p wa key=scope + - c:auditctl -l -> r:-w /etc/sudoers.d -p wa -k scope|-w /etc/sudoers.d -p wa key=scope + + # 4.1.3.2 Ensure actions as another user are always logged. (Automated) + - id: 33589 + title: "Ensure actions as another user are always logged." + description: "sudo provides users with temporary elevated privileges to perform operations, either as the superuser or another user." + rationale: "Creating an audit log of users with temporary elevated privileges and the operation(s) they performed is essential to reporting. Administrators will want to correlate the events written to the audit trail with the records written to sudo's logfile to verify if unauthorized commands have been executed." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor elevated privileges. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -C euid!=uid -F auid!=unset -S execve -k user_emulation -a always,exit -F arch=b32 -C euid!=uid -F auid!=unset -S execve -k user_emulation \" >> /etc/audit/rules.d/50-user_emulation.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + + # 4.1.3.3 Ensure events that modify the sudo log file are collected. (Automated) - Not Implemented + + # 4.1.3.4 Ensure events that modify date and time information are collected. (Automated) + - id: 33590 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the; - adjtimex - tune kernel clock - settimeofday - set time using timeval and timezone structures - stime - using seconds since 1/1/1970 - clock_settime - allows for the setting of several internal clocks and timers system calls have been executed. Further, ensure to write an audit record to the configured audit log file upon exit, tagging the records with a unique identifier such as "time-change".' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: 'Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in.rules extension, with the relevant rules to monitor events that modify date and time information. 64 Bit systems Example: # printf " -a always,exit -F arch=b64 -S adjtimex,settimeofday,clock_settime -k time-change -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime -k time-change -w /etc/localtime -p wa -k time-change " >> /etc/audit/rules.d/50-time-change.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64. In addition, add stime to the system call audit. Example: -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime,stime -k time-change.' + compliance: + - cis: ["4.1.3.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change' + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change" + + # 4.1.3.5 Ensure events that modify the system's network environment are collected. (Automated) + - id: 33591 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitors the following system calls, and write an audit event on system call exit: - sethostname - set the systems host name - setdomainname - set the systems domain name The files being monitored are: - /etc/issue and /etc/issue.net - messages displayed pre-login - /etc/hosts - file containing host names and associated IP addresses - /etc/sysconfig/network - additional information that is valid to all network interfaces - /etc/sysconfig/network-scripts/ - directory containing network interface scripts and configurations files." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domain name of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records should have a relevant tag associated with them." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's network environment. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S sethostname,setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname,setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale \" >> /etc/audit/rules.d/50-system_local.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/etc/network && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/etc/networks/ && r:-p wa && r:-k system-locale|key=system-locale' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/network && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/networks && r:-p wa && r:-k system-locale|key=system-locale" + + # 4.1.3.6 Ensure use of privileged commands are collected. (Automated) - Not Implemented + # 4.1.3.7 Ensure unsuccessful file access attempts are collected. (Automated) - Not Implemented + + # 4.1.3.8 Ensure events that modify user/group information are collected. (Automated) + - id: 33592 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the modification of user or group information, including that of passwords and old passwords if in use. - /etc/group - system groups - /etc/passwd - system users - /etc/gshadow - encrypted password for each group - /etc/shadow - system user passwords - /etc/security/opasswd - storage of old passwords if the relevant PAM module is in use The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify user/group information. Example: # printf \" -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity \" >> /etc/audit/rules.d/50-identity.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.8"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity' + - "c:auditctl -l -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity" + + # 4.1.3.9 Ensure discretionary access control permission modification events are collected. (Automated) - Not Implemented + + # 4.1.3.10 Ensure successful file system mounts are collected. (Automated) + - id: 33593 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful file system mounts. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=unset -k mounts -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=unset -k mounts \" >> /etc/audit/rules.d/50-mounts.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.10"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1034"] + - mitre_tactics: ["TA0010"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["CM-6"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + + # 4.1.3.11 Ensure session initiation information is collected. (Automated) + - id: 33594 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. - /var/run/utmp - tracks all currently logged in users. - /var/log/wtmp - file tracks logins, logouts, shutdown, and reboot events. - /var/log/btmp - keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier "session.".' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor session initiation information. Example: # printf \" -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k session -w /var/log/btmp -p wa -k session \" >> /etc/audit/rules.d/50-session.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.11"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session' + - "c:auditctl -l -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session" + + # 4.1.3.12 Ensure login and logout events are collected. (Automated) + - id: 33595 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. - /var/log/lastlog - maintain records of the last time a user successfully logged in. - /var/run/faillock - directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor login and logout events. Example: # printf \" -w /var/log/lastlog -p wa -k logins -w /var/run/faillock -p wa -k logins \" >> /etc/audit/rules.d/50-login.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.12"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.8.1.3", "A.9.4.2"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins' + - "c:auditctl -l -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins" + - "c:auditctl -l -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins" + + # 4.1.3.13 Ensure file deletion events by users are collected. (Automated) + - id: 33596 + title: "Ensure file deletion events by users are collected." + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for: - unlink - remove a file - unlinkat - remove a file attribute - rename - rename a file - renameat rename a file attribute system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor file deletion events by users. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete -a always,exit -F arch=b32 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete \" >> /etc/audit/rules.d/50-delete.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.13"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + + # 4.1.3.14 Ensure events that modify the system's Mandatory Access Controls are collected. (Automated) + - id: 33597 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor SELinux, an implementation of mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux/ and /usr/share/selinux/ directories. Note: If a different Mandatory Access Control method is used, changes to the corresponding directories should be audited." + rationale: "Changes to files in the /etc/selinux/ and /usr/share/selinux/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's Mandatory Access Controls. Example: # printf \" -w /etc/selinux -p wa -k MAC-policy -w /usr/share/selinux -p wa -k MAC-policy \" >> /etc/audit/rules.d/50-MAC-policy.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.14"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/etc/apparmor && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-w && r:/etc/apparmor.d && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - "c:auditctl -l -> r:^-w && r:/etc/apparmor && r:-p wa && r:-k MAC-policy|key=MAC-policy" + - "c:auditctl -l -> r:^-w && r:/etc/apparmor.d && r:-p wa && r:-k MAC-policy|key=MAC-policy" + + # 4.1.3.15 Ensure successful and unsuccessful attempts to use the chcon command are recorded. (Automated) + - id: 33598 + title: "Ensure successful and unsuccessful attempts to use the chcon command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chcon command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chcon command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.15"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + + # 4.1.3.16 Ensure successful and unsuccessful attempts to use the setfacl command are recorded. (Automated) + - id: 33599 + title: "Ensure successful and unsuccessful attempts to use the setfacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the setfacl command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the setfacl command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.16"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + + # 4.1.3.17 Ensure successful and unsuccessful attempts to use the chacl command are recorded. (Automated) + - id: 33600 + title: "Ensure successful and unsuccessful attempts to use the chacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chacl command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chacl command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.17"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + + # 4.1.3.18 Ensure successful and unsuccessful attempts to use the usermod command are recorded. (Automated) + - id: 33601 + title: "Ensure successful and unsuccessful attempts to use the usermod command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the usermod command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the usermod command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k usermod \" >> /etc/audit/rules.d/50-usermod.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.18"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + + # 4.1.3.19 Ensure kernel module loading unloading and modification is collected. (Automated) + - id: 33602 + title: "Ensure kernel module loading unloading and modification is collected." + description: "Monitor the loading and unloading of kernel modules. All the loading / listing / dependency checking of modules is done by kmod via symbolic links. The following system calls control loading and unloading of modules: - init_module - load a module - finit_module - load a module (used when the overhead of using cryptographically signed modules to determine the authenticity of a module can be avoided) - delete_module - delete a module - create_module - create a loadable module entry - query_module - query the kernel for various bits pertaining to modules Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of modules." + rationale: "Monitoring the use of all the various ways to manipulate kernel modules could provide system administrators with evidence that an unauthorized change was made to a kernel module, possibly compromising the security of the system." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor kernel module modification. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S init_module,finit_module,delete_module,create_module,query_module -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules -a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules \" >> /etc/audit/rules.d/50-kernel_modules.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.19"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l-> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - "c:ls -l /usr/sbin/lsmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/rmmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/insmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modinfo -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modprobe -> r:/bin/kmod" + - "c:ls -l /usr/sbin/depmod -> r:/bin/kmod" + + # 4.1.3.20 Ensure the audit configuration is immutable. (Automated) + - id: 33603 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: This setting will require the system to be rebooted to update the active auditd configuration settings.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line -e 2 at the end of the file: Example: # printf -- \"-e 2\" >> /etc/audit/rules.d/99-finalize.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.20"] + - cis_csc_v8: ["3.3", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AC-3", "AU-3", "AU-3(1)", "MP-2"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "7.1", "9.4.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + condition: any + rules: + - "f:/etc/audit/audit.rules -> r:^-e 2" + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-e 2' + + # 4.1.3.21 Ensure the running and on disk configuration is the same. (Manual) + - id: 33604 + title: "Ensure the running and on disk configuration is the same." + description: "The Audit system have both on disk and running configuration. It is possible for these configuration settings to differ. Note: Due to the limitations of augenrules and auditctl, it is not absolutely guaranteed that loading the rule sets via augenrules --load will result in all rules being loaded or even that the user will be informed if there was a problem loading the rules." + rationale: "Configuration differences between what is currently running and what is on disk could cause unexpected problems or may give a false impression of compliance requirements." + remediation: 'If the rules are not aligned across all three () areas, run the following command to merge and load all rules: # augenrules --load Check if reboot is required. if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then echo "Reboot required to load rules"; fi.' + compliance: + - cis: ["4.1.3.21"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:augenrules --check -> r:No change$" + + ######################################## + # 4.1.4 Configure auditd file access + ######################################## + # 4.1.4.1 Ensure audit log files are mode 0640 or less permissive. (Automated) - Not Implemented + # 4.1.4.2 Ensure only authorized users own audit log files. (Automated) - Not Implemented + + # 4.1.4.3 Ensure only authorized groups are assigned ownership of audit log files. (Automated) + - id: 33605 + title: "Ensure only authorized groups are assigned ownership of audit log files." + description: "Audit log files contain information about the system and system activity." + rationale: "Access to audit records can reveal system and configuration data to attackers, potentially compromising its confidentiality." + remediation: "Run the following command to configure the audit log files to be owned by adm group: # find $(dirname $(awk -F\"=\" '/^\\s*log_file\\s*=\\s*/ {print $2}' /etc/audit/auditd.conf | xargs)) -type f \\( ! -group adm -a ! -group root \\) -exec chgrp adm {} + Run the following command to configure the audit log files to be owned by the adm group: # chgrp adm /var/log/audit/ Run the following command to set the log_group parameter in the audit configuration file to log_group = adm: # sed -ri 's/^\\s*#?\\s*log_group\\s*=\\s*\\S+(\\s*#.*)?.*$/log_group = adm\\1/' /etc/audit/auditd.conf Run the following command to restart the audit daemon to reload the configuration file: # systemctl restart auditd." + compliance: + - cis: ["4.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*log_group\s*\t*=\s*\t*adm|^\s*\t*log_group\s*\t*=\s*\t*root' + + # 4.1.4.4 Ensure the audit log directory is 0750 or more restrictive. (Automated) - Not Implemented + + # 4.1.4.5 Ensure audit configuration files are 640 or more restrictive. (Automated) + - id: 33606 + title: "Ensure audit configuration files are 640 or more restrictive." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to remove more permissive mode than 0640 from the audit configuration files: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) -exec chmod u-x,g-wx,o-rwx {} +." + compliance: + - cis: ["4.1.4.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:sh -c "stat -Lc \"%n %a\" /etc/audit/*.rules" -> r:^/etc/audit && !r:640|600|400' + - 'not c:sh -c "stat -Lc \"%n %a\" /etc/audit/*.conf" -> r:^/etc/audit && !r:640|600|400' + + # 4.1.4.6 Ensure audit configuration files are owned by root. (Automated) + - id: 33607 + title: "Ensure audit configuration files are owned by root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change ownership to root user: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -user root -exec chown root {} +." + compliance: + - cis: ["4.1.4.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:sh -c "stat -Lc \"%n %U\" /etc/audit/*.rules" -> r:^/etc/audit && !r:root' + - 'not c:sh -c "stat -Lc \"%n %U\" /etc/audit/*.conf" -> r:^/etc/audit && !r:root' + + # 4.1.4.7 Ensure audit configuration files belong to group root. (Automated) + - id: 33608 + title: "Ensure audit configuration files belong to group root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change group to root: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -group root -exec chgrp root {} +." + compliance: + - cis: ["4.1.4.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:sh -c "stat -Lc \"%n %G\" /etc/audit/*.rules" -> r:^/etc/audit && !r:root' + - 'not c:sh -c "stat -Lc \"%n %G\" /etc/audit/*.conf" -> r:^/etc/audit && !r:root' + + # 4.1.4.8 Ensure audit tools are 755 or more restrictive. (Automated) + - id: 33609 + title: "Ensure audit tools are 755 or more restrictive." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %u %U %g %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:0 root 0 root' + + # 4.1.4.9 Ensure audit tools are owned by root. (Automated) + - id: 33610 + title: "Ensure audit tools are owned by root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to change the owner of the audit tools to the root user: # chown root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %u %U %g %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:0 root 0 root' + + # 4.1.4.10 Ensure audit tools belong to group root. (Automated) + - id: 33611 + title: "Ensure audit tools belong to group root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules Run the following command to change owner and group of the audit tools to root user and group: # chown root:root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.10"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %u %U %g %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:0 root 0 root' + + ############################################### + # 4.2 Configure Logging + ############################################### + # 4.2.1 Configure rsyslog + ############################################### + # 4.2.1.1 Ensure rsyslog is installed. (Automated) + - id: 33612 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is recommended in environments where journald does not meet operation requirements." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # dnf install rsyslog." + compliance: + - cis: ["4.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1005", "T1070", "T1070.002"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q rsyslog -> r:^rsyslog-" + + # 4.2.1.2 Ensure rsyslog service is enabled. (Automated) + - id: 33613 + title: "Ensure rsyslog service is enabled." + description: "Once the rsyslog package is installed, ensure that the service is enabled." + rationale: "If the rsyslog service is not enabled to start on boot, the system will not capture logging events." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1211", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:^enabled" + + # 4.2.1.3 Ensure journald is configured to send logs to rsyslog. (Manual) + - id: 33614 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the RSyslog service provides a consistent means of log collection and export." + rationale: "IF RSyslog is the preferred method for capturing logs, all logs of the system should be sent to it for further processing. Note: This recommendation only applies if rsyslog is the chosen method for client side logging. Do not apply this recommendation if journald is used." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.3"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006", "T1565"] + - nist_sp_800-53: ["AC-3", "AU-12", "AU-2", "AU-4", "MP-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*ForwardToSyslog=yes' + + # 4.2.1.4 Ensure rsyslog default file permissions are configured. (Automated) + - id: 33615 + title: "Ensure rsyslog default file permissions are configured." + description: "RSyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + impact: "The systems global umask could override, but only making the file permissions stricter, what is configured in RSyslog with the FileCreateMode directive. RSyslog also has its own $umask directive that can alter the intended file creation mode. In addition, consideration should be given to how FileCreateMode is used. Thus it is critical to ensure that the intended file creation mode is not overridden with less restrictive settings in /etc/rsyslog.conf, /etc/rsyslog.d/*conf files and that FileCreateMode is set before any file is created." + remediation: "Edit either /etc/rsyslog.conf or a dedicated .conf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640 Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.4"] + - cis_csc_v8: ["3.3", "8.2"] + - cis_csc_v7: ["5.1", "6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)", "164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.14.2.5", "A.8.1.3"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0' + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d20|^\$FileCreateMode 0\d00' + + # 4.2.1.5 Ensure logging is configured. (Manual) - Not Implemented + + # 4.2.1.6 Ensure rsyslog is configured to send logs to a remote log host. (Manual) + - id: 33616 + title: "Ensure rsyslog is configured to send logs to a remote log host." + description: "RSyslog supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralized log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). The target directive may either be a fully qualified domain name or an IP address. *.* action(type="omfwd" target="192.168.2.100" port="514" protocol="tcp" action.resumeRetryCount="100" queue.type="LinkedList" queue.size="1000") Run the following command to reload the rsyslogd configuration: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.6"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> !r:# && r:^*.* @@\.+' + - 'f:/etc/rsyslog.conf -> !r:# && r:^*.* action && r:target="' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:# && r:^*.* @@\.+' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:# && r:^*.* action && r:target="' + + # 4.2.1.7 Ensure rsyslog is not configured to receive logs from a remote client. (Automated) + - id: 33617 + title: "Ensure rsyslog is not configured to receive logs from a remote client." + description: "RSyslog supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside its operational boundary." + remediation: 'Should there be any active log server configuration found in the auditing section, modify those files and remove the specific lines highlighted by the audit. Ensure none of the following entries are present in any of /etc/rsyslog.conf or /etc/rsyslog.d/*.conf. New format module(load="imtcp") input(type="imtcp" port="514") -OR- Old format $ModLoad imtcp $InputTCPServerRun Restart the service: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.7"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - 'f:/etc/rsyslog.conf -> !r:^\s*# && r:ModLoad imtcp|InputTCPServerRun|load="imtcp"|type="imtcp"' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:\s*# && r:ModLoad imtcp|InputTCPServerRun|load="imtcp"|type="imtcp"' + + ############################################### + # 4.2.2 Configure journald + ############################################### + # 4.2.2.1 Ensure journald is configured to send logs to a remote log host + ############################################### + # 4.2.2.1.1 Ensure systemd-journal-remote is installed. (Manual) + - id: 33618 + title: "Ensure systemd-journal-remote is installed." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralized log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to install systemd-journal-remote: # dnf install systemd-journal-remote." + compliance: + - cis: ["4.2.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q systemd-journal-remote -> r:systemd-journal-remote-" + + # 4.2.2.1.2 Ensure systemd-journal-remote is configured. (Manual) - Not Implemented + + # 4.2.2.1.3 Ensure systemd-journal-remote is enabled. (Manual) + - id: 33619 + title: "Ensure systemd-journal-remote is enabled." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralized log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to enable systemd-journal-remote: # systemctl --now enable systemd-journal-upload.service." + compliance: + - cis: ["4.2.2.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-12", "AU-2", "CM-7", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-upload.service -> r:^enabled" + + # 4.2.2.1.4 Ensure journald is not configured to receive logs from a remote client. (Automated) + - id: 33620 + title: "Ensure journald is not configured to receive logs from a remote client." + description: "Journald supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts. NOTE: - The same package, systemd-journal-remote, is used for both sending logs to remote hosts and receiving incoming logs. - With regards to receiving logs, there are two services; systemd-journal- remote.socket and systemd-journal-remote.service." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: "Run the following command to disable systemd-journal-remote.socket: # systemctl --now mask systemd-journal-remote.socket." + compliance: + - cis: ["4.2.2.1.4"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-remote.socket -> r:^masked" + + # 4.2.2.2 Ensure journald service is enabled. (Automated) + - id: 33621 + title: "Ensure journald service is enabled." + description: "Ensure that the systemd-journald service is enabled to allow capturing of logging events." + rationale: "If the systemd-journald service is not enabled to start on boot, the system will not capture logging events." + remediation: "By default the systemd-journald service does not have an [Install] section and thus cannot be enabled / disabled. It is meant to be referenced as Requires or Wants by other unit files. As such, if the status of systemd-journald is not static, investigate why." + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journald.service -> r:^static" + + # 4.2.2.3 Ensure journald is configured to compress large log files. (Automated) + - id: 33622 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes Restart the service: # systemctl restart systemd-journald.service." + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.3", "6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1053"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Compress\s*=\s*yes' + + # 4.2.2.4 Ensure journald is configured to write logfiles to persistent disk. (Automated) + - id: 33623 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss due to a reboot." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent Restart the service: # systemctl restart systemd-journald.service." + compliance: + - cis: ["4.2.2.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Storage=persistent' + + # 4.2.2.5 Ensure journald is not configured to send logs to rsyslog. (Manual) + - id: 33624 + title: "Ensure journald is not configured to send logs to rsyslog." + description: "Data from journald should be kept in the confines of the service and not forwarded on to other services." + rationale: "IF journald is the method for capturing logs, all logs of the system should be handled by journald and not forwarded to other logging mechanisms. Note: This recommendation only applies if journald is the chosen method for client side logging. Do not apply this recommendation if rsyslog is used." + remediation: "Edit the /etc/systemd/journald.conf file and ensure that ForwardToSyslog=yes is removed. Restart the service: # systemctl restart systemd-journald.service." + compliance: + - cis: ["4.2.2.5"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006", "T1565"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'not f:/etc/systemd/journald.conf -> r:^\s*ForwardToSyslog' + + # 4.2.2.6 Ensure journald log rotation is configured per site policy. (Manual) - Not Implemented + # 4.2.2.7 Ensure journald default file permissions configured. (Manual) - Not Implemented + # 4.2.3 Ensure all logfiles have appropriate permissions and ownership. (Automated) - Not Implemented + # 4.3 Ensure logrotate is configured. (Manual) - Not Implemented + + ############################################### + # 5 Access, Authentication and Authorization + ############################################### + # 5.1 Configure time-based job schedulers + ############################################### + # 5.1.1 Ensure cron daemon is enabled. (Automated) + - id: 33625 + title: "Ensure cron daemon is enabled." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: # systemctl --now enable crond." + compliance: + - cis: ["5.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - "c:systemctl is-enabled crond -> r:^enabled" + + # 5.1.2 Ensure permissions on /etc/crontab are configured. (Automated) + - id: 33626 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to this file could provide unprivileged users with the ability to elevate their privileges. Read access to this file could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab." + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured. (Automated) + - id: 33627 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : # chown root:root /etc/cron.hourly # chmod og-rwx /etc/cron.hourly." + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured. (Automated) + - id: 33628 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily." + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured. (Automated) + - id: 33629 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : # chown root:root /etc/cron.weekly # chmod og-rwx /etc/cron.weekly." + compliance: + - cis: ["5.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured. (Automated) + - id: 33630 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly." + compliance: + - cis: ["5.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured. (Automated) + - id: 33631 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily, weekly and monthly jobs from /etc/crontab , but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d." + compliance: + - cis: ["5.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)' + + # 5.1.8 Ensure cron is restricted to authorized users. (Automated) - Not Implemented + # 5.1.9 Ensure at is restricted to authorized users. (Automated) - Not Implemented + ############################################### + # 5.2 Configure SSH Server + ############################################### + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured. (Automated) + - id: 33632 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod u-x,go-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1098", "T1098.004", "T1543", "T1543.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/ssh/sshd_config -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)' + + # 5.2.2 Ensure permissions on SSH private host key files are configured. (Automated) - Not Implemented + # 5.2.3 Ensure permissions on SSH public host key files are configured. (Automated) - Not Implemented + + # 5.2.4 Ensure SSH access is limited. (Automated) + - id: 33633 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: o The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: o The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: o The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: o The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set one or more of the parameters as follows: AllowUsers -OR- AllowGroups -OR- DenyUsers -OR- DenyGroups ." + compliance: + - cis: ["5.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021", "T1021.004"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'c:sshd -T -C user=root -> r:^\s*AllowUsers\s+\w*|^\s*AllowGroups\s+\w*|^\s*DenyUsers\s+\w*|^\s*DenyGroups\s+\w*' + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowUsers\s+\w*|^\s*AllowGroups\s+\w*|^\s*DenyUsers\s+\w*|^\s*DenyGroups\s+\w*' + - 'd:/etc/ssh/sshd_config.d -> r:\.*.conf -> r:^\s*AllowUsers\s+\w*|^\s*AllowGroups\s+\w*|^\s*DenyUsers\s+\w*|^\s*DenyGroups\s+\w*' + + # 5.2.5 Ensure SSH LogLevel is appropriate. (Automated) + - id: 33634 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the LogLevel parameter as follows: LogLevel VERBOSE OR LogLevel INFO Run the following command to comment out any LogLevel parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than VERBOSE or INFO: # grep -Pi '^\\h*LogLevel\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi '(VERBOSE|INFO)' | while read -r l_out; do sed -ri \"/^\\s*LogLevel\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + references: + - "https://www.ssh.com/ssh/sshd_config/" + compliance: + - cis: ["5.2.5"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: any + rules: + - 'c:sshd -T -C user=root -> r:^\s*LogLevel\s+VERBOSE|^\s*LogLevel\s+INFO' + - "f:/etc/ssh/sshd_config -> r:loglevel" + - 'd:/etc/ssh/sshd_config.d -> r:\.*.conf -> r:loglevel' + + # 5.2.6 Ensure SSH PAM is enabled. (Automated) + - id: 33635 + title: "Ensure SSH PAM is enabled." + description: 'UsePAM Enables the Pluggable Authentication Module interface. If set to "yes" this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types.' + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + impact: "If UsePAM is enabled, you will not be able to run sshd as a non-root user." + remediation: "Edit or create a file in the directory /etc/ssh/sshd_config.d/ ending in *.conf or the /etc/ssh/sshd_config file and set the parameter as follows: UsePAM yes Run the following command to comment out any UsePAM parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than yes # grep -Pi '^\\h*UsePAM\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'yes' | while read -r l_out; do sed -ri \"/^\\s*UsePAM\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.6"] + - mitre_mitigations: ["M1035"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1021", "T1021.004"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: any + rules: + - 'c:sshd -T -C user=root -> r:^\s*usepam\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\sUsePAM\s+no' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf -> r:^\sUsePAM\s+no' + + # 5.2.7 Ensure SSH root login is disabled. (Automated) + - id: 33636 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the PermitRootLogin parameter as follows: PermitRootLogin no Run the following command to comment out any PermitRootLogin parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi '^\\h*PermitRootLogin\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*PermitRootLogin\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.7"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitRootLogin\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitRootLogin\s+yes' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf -> r:^\sPermitRootLogin\s+yes' + + # 5.2.8 Ensure SSH HostbasedAuthentication is disabled. (Automated) + - id: 33637 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the HostbasedAuthentication parameter as follows: HostbasedAuthentication no Run the following command to comment out any HostbasedAuthentication parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no: # grep -Pi '^\\h*HostbasedAuthentication\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*HostbasedAuthentication\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'c:sshd -T -C user=root -> r:^\s*HostbasedAuthentication\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sHostbasedAuthentication\s+yes' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf -> r:^\sHostbasedAuthentication\s+yes' + + # 5.2.9 Ensure SSH PermitEmptyPasswords is disabled. (Automated) + - id: 33638 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the PermitEmptyPasswords parameter as follows: PermitEmptyPasswords no Run the following command to comment out any PermitEmptyPasswords parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi '^\\h*PermitEmptyPasswords\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*PermitEmptyPasswords\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.9"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: any + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitEmptyPasswords\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitEmptyPasswords\s+yes' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf -> r:^\sPermitEmptyPasswords\s+yes' + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled. (Automated) + - id: 33639 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the PermitUserEnvironment parameter as follows: PermitUserEnvironment no Run the following command to comment out any PermitUserEnvironment parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi '^\\h*PermitUserEnvironment\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*PermitUserEnvironment\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitUserEnvironment\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitUserEnvironment\s+yes' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf -> r:^\sPermitUserEnvironment\s+yes' + + # 5.2.11 Ensure SSH IgnoreRhosts is enabled. (Automated) + - id: 33640 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the IgnoreRhosts parameter as follows: IgnoreRhosts yes Run the following command to comment out any IgnoreRhosts parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than yes # grep -Pi '^\\h*IgnoreRhosts\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'yes' | while read -r l_out; do sed -ri \"/^\\s*IgnoreRhosts\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.11"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: any + rules: + - 'c:sshd -T -C user=root -> r:\s*ignorerhosts\s*yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*ignorerhosts\s+no' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf -> r:^\s*ignorerhosts\s+no' + + # 5.2.12 Ensure SSH X11 forwarding is disabled. (Automated) + - id: 33641 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the X11Forwarding parameter as follows: X11Forwarding no Run the following command to comment out any X11Forwarding parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi '^\\h*X11Forwarding\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*X11Forwarding\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1210"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'c:sshd -T -C user=root -> r:^\s*X11Forwarding\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*x11forwarding\s+yes' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf -> r:^\s*x11forwarding\s+yes' + + # 5.2.13 Ensure SSH AllowTcpForwarding is disabled. (Automated) + - id: 33642 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments that employ mainframe systems as their application backends. In those environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the AllowTcpForwarding parameter as follows: AllowTcpForwarding no Run the following command to comment out any AllowTcpForwarding parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no: # grep -Pi '^\\h*AllowTcpForwarding\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*AllowTcpForwarding\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + references: + - "https://www.ssh.com/ssh/tunneling/example" + compliance: + - cis: ["5.2.13"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1048", "T1048.002", "T1572"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*AllowTcpForwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*AllowTcpForwarding\s+yes' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf -> r:^\s*AllowTcpForwarding\s+yes' + + # 5.2.14 Ensure system-wide crypto policy is not over-ridden. (Automated) + - id: 33643 + title: "Ensure system-wide crypto policy is not over-ridden." + description: "System-wide Crypto policy can be over-ridden or opted out of for openSSH." + rationale: "Over-riding or opting out of the system-wide crypto policy could allow for the use of less secure Ciphers, MACs, KexAlgorithms and GSSAPIKexAlgorithm." + remediation: "Run the following commands: # sed -ri \"s/^\\s*(CRYPTO_POLICY\\s*=.*)$/# \\1/\" /etc/sysconfig/sshd /etc/ssh/sshd_config.d/*.conf # systemctl reload sshd." + compliance: + - cis: ["5.2.14"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["SC-8"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'not f:/etc/sysconfig/sshd -> r:^\s*CRYPTO_POLICY=' + + # 5.2.15 Ensure SSH warning banner is configured. (Automated) + - id: 33644 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the Banner parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.2.15"] + - mitre_mitigations: ["M1035"] + - mitre_tactics: ["TA0001", "TA0007"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*Banner\s*/\w+' + + # 5.2.16 Ensure SSH MaxAuthTries is set to 4 or less. (Automated) + - id: 33645 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the MaxAuthTries parameter as follows: MaxAuthTries 4 Run the following command to comment out any MaxAuthTries parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting greater than 4: # grep -Pi '^\\h*maxauthtries\\h+([5-9]|[1-9][0-9]+)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*maxauthtries\\s+([5-9]|[1-9][0-9]+)/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.16"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - mitre_mitigations: ["M1036"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: any + rules: + - 'c:sshd -T -C user=root -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'f:/etc/ssh/sshd_config -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'd:/etc/ssh/sshd_config.d -> r:\.*.conf -> n:^\s*MaxAuthTries\s*\t*(\d+) compare =< 4' + + # 5.2.17 Ensure SSH MaxStartups is configured. (Automated) + - id: 33646 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the MaxStartups parameter as follows: MaxStartups 10:30:60 Run the following command to comment out any MaxStartups parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting greater than 10:30:60: # grep -Pi '^\\s*maxstartups\\s+(((1[1-9]|[1-9][0-9][0-9]+):([0-9]+):([0- 9]+))|(([0-9]+):(3[1-9]|[4-9][0-9]|[1-9][0-9][0-9]+):([0-9]+))|(([0-9]+):([0- 9]+):(6[1-9]|[7-9][0-9]|[1-9][0-9][0-9]+)))' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*MaxStartups\\s+(((1[1-9]|[1-9][0-9][0-9]+):([0-9]+):([0-9]+))|(([0- 9]+):(3[1-9]|[4-9][0-9]|[1-9][0-9][0-9]+):([0-9]+))|(([0-9]+):([0-9]+):(6[1- 9]|[7-9][0-9]|[1-9][0-9][0-9]+)))/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1499", "T1499.002"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + - 'd:/etc/ssh/sshd_config.d -> r:\.*.conf -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare =< 10' + - 'd:/etc/ssh/sshd_config.d -> r:\.*.conf -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare =< 30' + - 'd:/etc/ssh/sshd_config.d -> r:\.*.conf -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare =< 60' + + # 5.2.18 Ensure SSH MaxSessions is set to 10 or less. (Automated) + - id: 33647 + title: "Ensure SSH MaxSessions is set to 10 or less." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the MaxSessions parameter as follows: MaxSessions 10 Run the following command to comment out any MaxSessions parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting greater than 10 # grep -Pi '^\\s*MaxSessions\\s+(1[1-9]|[2-9][0-9]|[1-9][0-9][0-9]+)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*MaxSessions\\s+(1[1-9]|[2-9][0-9]|[1-9][0-9][0-9]+)/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.18"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1499", "T1499.002"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: any + rules: + - 'c:sshd -T -C user=root -> n:^\s*MaxSessions\s+(\d+) compare <= 10' + - 'f:/etc/ssh/sshd_config -> n:^\s*MaxSessions\s+(\d+) compare => 10' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf -> n:^\s*MaxSessions\s+(\d+) compare => 10' + + # 5.2.19 Ensure SSH LoginGraceTime is set to one minute or less. (Automated) + - id: 33648 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60 Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the LoginGraceTime parameter as follows: LoginGraceTime 60 -or- LoginGraceTime 1m Run the following command to comment out any LoginGraceTime parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting equal to 0 or greater than 60 seconds: # grep -Pi '^\\s*LoginGraceTime\\s+(0|6[1-9]|[7-9][0-9]|[1-9][0-9][0- 9]+|[^1]m)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read - r l_out; do sed -ri \"/^\\s*LoginGraceTime\\s+(0|6[1-9]|[7-9][0-9]|[1-9][0-9][0- 9]+|[^1]m)/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.19"] + - mitre_mitigations: ["M1036"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003", "T1110.004"] + condition: any + rules: + - 'c:sshd -T -C user=root -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60 && n:^\s*LoginGraceTime\s*\t*(\d+) compare > 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60 && n:^\s*LoginGraceTime\s*\t*(\d+) compare > 0' + - 'd:/etc/ssh/sshd_config.d -> r:\.*.conf -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60 && n:^\s*LoginGraceTime\s*\t*(\d+) compare > 0' + + # 5.2.20 Ensure SSH Idle Timeout Interval is configured. (Automated) + - id: 33649 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "NOTE: To clarify, the two settings described below are only meant for idle connections from a protocol perspective and not meant to check if the user is active or not. An idle user does not mean an idle connection. SSH does not, and never had, intentionally the capability to drop idle users. In SSH versions before 8.2p1 there was a bug that caused these values to behave in such a manner that they were abused to disconnect idle users. This bug has been resolved in 8.2p1 and thus may no longer be abused to disconnect idle users. The two options ClientAliveInterval and ClientAliveCountMax control the timeout of SSH sessions. Taken directly from man 5 sshd_config: - ClientAliveInterval Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax Sets the number of client alive messages which may be sent without sshd(8) receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. It is important to note that the use of client alive messages is very different from TCPKeepAlive. The client alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The client alive mechanism is valuable when the client or server depend on knowing when a connection has become unresponsive. The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds. Setting a zero ClientAliveCountMax disables connection termination." + rationale: "In order to prevent resource exhaustion, appropriate values should be set for both ClientAliveInterval and ClientAliveCountMax. Specifically, looking at the source code, ClientAliveCountMax must be greater than zero in order to utilize the ability of SSH to drop idle connections. If connections are allowed to stay open indefinitely, this can potentially be used as a DDOS attack or simple resource exhaustion could occur over unreliable networks. The example set here is a 45 second timeout. Consult your site policy for network timeouts and apply as appropriate." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the ClientAliveInterval and ClientAliveCountMax parameters according to site policy. Example: ClientAliveInterval 15 ClientAliveCountMax 3 Edit files ending in *.conf in the /etc/ssh/sshd_config.d/ directory and the /etc/ssh/sshd_config file and remove occurrences of the ClientAliveInterval and ClientAliveCountMax parameters not in accordance with local site policy. Run the following command to comment out any ClientAliveCountMax parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include the setting of 0 \"disabled\": # grep -Pi '^\\h*ClientAliveCountMax\\h+0\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*ClientAliveCountMax\\s+0/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + references: + - "https://man.openbsd.org/sshd_config" + compliance: + - cis: ["5.2.20"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare > 0' + - 'c:sshd -T -C user=root -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare > 0' + + ############################################################ + # 5.3 Configure privilege escalation + ############################################################ + # 5.3.1 Ensure sudo is installed. (Automated) + - id: 33650 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plug-in architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plug-ins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers and any entries in /etc/sudoers.d. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo # dnf install sudo." + compliance: + - cis: ["5.3.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - "c:dnf list sudo -> r:sudo" + + # 5.3.2 Ensure sudo commands use pty. (Automated) + - id: 33651 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo terminal (pseudo-pty)." + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: "Edit the file /etc/sudoers with visudo or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["5.3.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1026", "M1038"] + - mitre_tactics: ["TA0001", "TA0003"] + - mitre_techniques: ["T1078", "T1078.003", "T1548", "T1548.003"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s+use_pty' + - 'd:/etc/sudoers.d -> r:\. -> r:^\s*Defaults\s+use_pty' + + # 5.3.3 Ensure sudo log file exists. (Automated) + - id: 33652 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files. Creation of additional log files can cause disk space exhaustion if not correctly managed. You should configure logrotate to manage the sudo log in accordance with your local policy." + remediation: 'Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile="" Example Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["5.3.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^Defaults logfile="' + - 'd:/etc/sudoers.d -> r:\. -> r:^Defaults\s+logfile="' + + # 5.3.4 Ensure users must provide password for escalation. (Automated) + - id: 33653 + title: "Ensure users must provide password for escalation." + description: "The operating system must be configured so that users must provide a password for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + impact: "This will prevent automated processes from being able to elevate privileges. To include Ansible and AWS builds." + remediation: "Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any line with occurrences of NOPASSWD tags in the file." + compliance: + - cis: ["5.3.4"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*# && r:NOPASSWD' + - 'd:/etc/sudoers.d -> r:\. -> !r:^\s*# && r:NOPASSWD' + + # 5.3.5 Ensure re-authentication for privilege escalation is not disabled globally. (Automated) + - id: 33654 + title: "Ensure re-authentication for privilege escalation is not disabled globally." + description: "The operating system must be configured so that users must re-authenticate for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + remediation: "Configure the operating system to require users to reauthenticate for privilege escalation. Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any occurrences of !authenticate tags in the file(s)." + compliance: + - cis: ["5.3.5"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*# && r:!authenticate' + - 'd:/etc/sudoers.d -> r:\. -> !r:^\s*# && r:!authenticate' + + # 5.3.6 Ensure sudo authentication timeout is configured correctly. (Automated) + - id: 33655 + title: "Ensure sudo authentication timeout is configured correctly." + description: "sudo caches used credentials for a default of 5 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized privileged access to another user." + remediation: "If the currently configured timeout is larger than 15 minutes, edit the file listed in the audit section with visudo -f and modify the entry timestamp_timeout= to 15 minutes or less as per your site policy. The value is in minutes. This particular entry may appear on its own, or on the same line as env_reset. See the following two examples: Defaults env_reset, timestamp_timeout=15 Defaults timestamp_timeout=15 Defaults env_reset." + references: + - "https://www.sudo.ws/man/1.9.0/sudoers.man.html" + compliance: + - cis: ["5.3.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'not f:/etc/sudoers -> !r:^\s*\t*# && r:timestamp_timeout\s*\t*=\s*\t*-1' + - 'not d:/etc/sudoers.d -> r:\.+ -> !r:^\s*\t*# && r:timestamp_timeout\s*\t*=\s*\t*-1' + - 'not f:/etc/sudoers -> !r:^\s*\t*# && n:timestamp_timeout\s*\t*=\s*\t*(\d+) compare > 15' + - 'not d:/etc/sudoers.d -> r:\.+ -> !r:^\s*\t*# && n:timestamp_timeout\s*\t*=\s*\t*(\d+) compare > 15' + + # 5.3.7 Ensure access to the su command is restricted. (Automated) + - id: 33656 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.3.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1078"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/su -> r:^auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + ############################################### + # 5.4 Configure authselect + ############################################### + # 5.4.1 Ensure custom authselect profile is used. (Manual) + - id: 33657 + title: "Ensure custom authselect profile is used." + description: "A custom profile can be created by copying and customizing one of the default profiles. The default profiles include: sssd, winbind, or the nis. This profile can then be customized to follow site specific requirements. You can select a profile for the authselect utility for a specific host. The profile will be applied to every user logging into the host." + rationale: "A custom profile is required to customize many of the pam options. When you deploy a profile, the profile is applied to every user logging into the given host." + remediation: 'Run the following command to create a custom authselect profile: # authselect create-profile Example: # authselect create-profile custom-profile -b sssd --symlink-meta Run the following command to select a custom authselect profile: # authselect select custom/ {with-} Example: # authselect select custom/custom-profile with-sudo with-faillock without-nullok.' + compliance: + - cis: ["5.4.1"] + - cis_csc_v8: ["16.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - iso_27001-2013: ["A.9.2.6"] + - pci_dss_v3.2.1: ["6.3.2"] + - pci_dss_v4.0: ["6.3.1"] + condition: all + rules: + - 'c:authselect list -> r:^\w*\s*custom' + - "f:/etc/authselect/authselect.conf -> r:custom" + + # 5.4.2 Ensure authselect includes with-faillock. (Automated) + - id: 33658 + title: "Ensure authselect includes with-faillock." + description: "The pam_faillock.so module maintains a list of failed authentication attempts per user during a specified interval and locks the account in case there were more than the configured number of consecutive failed authentications (this is defined by the deny parameter in the faillock configuration). It stores the failure records into per-user files in the tally directory." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Run the following commands to include the with-faillock option to the current authselect profile: # authselect enable-feature with-faillock # authselect apply-changes." + compliance: + - cis: ["5.4.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:required && r:pam_faillock.so" + - "f:/etc/pam.d/system-auth -> r:required && r:pam_faillock.so" + + ############################################### + # 5.5 Configure PAM + ############################################### + # 5.5.1 Ensure password creation requirements are configured. (Automated) + - id: 33659 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. - minlen=14 - password must be 14 characters or more Either of the following can be used to enforce complex passwords: - minclass=4 - provide at least four classes of characters for the new password OR - dcredit=-1 - provide at least one digit - ucredit=-1 - provide at least one uppercase character - ocredit=-1 - provide at least one special character - lcredit=-1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Run the following script to update the system-auth and password-auth files #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+.*enforce_for_r oot\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 enforce_for_root/' \"$file\" fi if grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=([4- 9]|[1-9][0-9]+)\\b.*$' \"$file\"; then sed -ri '/pwquality/s/retry=\\S+/retry=3/' \"$file\" elif ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 retry=3/' \"$file\" fi done authselect apply-changes." + compliance: + - cis: ["5.5.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.002", "T1110.003", "T1178.001", "T1178.002", "T1178.003", "T1178.004"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - "f:/etc/pam.d/system-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s+\t*=\s+\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> r:^\s*minclass|^\s*\Scredit' + + # 5.5.2 Ensure lockout for failed password attempts is configured. (Automated) + - id: 33660 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. - deny= - Number of attempts before the account is locked - unlock_time= - Time in seconds before the account is unlocked Note: The maximum configurable value for unlock_time is 604800." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + impact: "Use of unlock_time=0 may allow an attacker to cause denial of service to legitimate users." + remediation: "Set password lockouts and unlock times to conform to site policy. deny should be greater than 0 and no greater than 5. unlock_time should be 0 (never), or 900 seconds or greater. Edit /etc/security/faillock.conf and update or add the following lines: deny = 5 unlock_time = 900." + compliance: + - cis: ["5.5.2"] + - cis_csc_v8: ["6.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1"] + - hipaa: ["164.308(a)(3)(ii)(C)"] + - iso_27001-2013: ["A.9.2.6"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - nist_sp_800-53: ["AC-2(1)"] + - pci_dss_v3.2.1: ["8.1.3"] + - pci_dss_v4.0: ["8.2.4", "8.2.5"] + - soc_2: ["CC6.2", "CC6.3"] + condition: all + rules: + - 'f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:deny\s*\t*=\s*\t*(\d+) compare > 0 && n:deny\s*\t*=\s*\t*(\d+) compare <= 5' + - 'not f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:unlock_time\s*\t*=\s*\t*(\d+) compare > 0 && n:unlock_time\s*\t*=\s*\t*(\d+) compare < 900' + + # 5.5.3 Ensure password reuse is limited. (Automated) + - id: 33661 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. - remember=<5> - Number of old passwords to remember." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note: These change only apply to accounts configured on the local system." + remediation: "Set remembered password history to conform to site policy. Run the following script to add or modify the pam_pwhistory.so and pam_unix.so lines to include the remember option: #!/usr/bin/env bash { file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/system-auth\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so\\s+([^# \\n\\r]+\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file elif grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?.*$' \"$file\"; then sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so/ s/$/ remember=5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/i password required pam_pwhistory.so remember=5 use_authtok' $file fi fi if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so\\s+([^#\\n\\r] +\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/ s/$/ remember=5/' $file fi fi authselect apply-changes }." + compliance: + - cis: ["5.5.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.004"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+requisite\.+pam_pwhistory\.so\.+ && n:remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so\.+ && n:remember=(\d+) compare >= 5' + + # 5.5.4 Ensure password hashing algorithm is SHA-512 or yescrypt. (Automated) + - id: 33662 + title: "Ensure password hashing algorithm is SHA-512 or yescrypt." + description: "A cryptographic hash function converts an arbitrary-length input into a fixed length output. Password hashing performs a one-way transformation of a password, turning the password into another string, called the hashed password." + rationale: "The SHA-512 algorithm provides stronger hashing than other hashing algorithms used for password hashing with Linux, providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note: These changes only apply to accounts configured on the local system." + remediation: "Set password hashing algorithm to sha512. Edit /etc/libuser.conf and edit of add the following line: crypt_style = sha512 Edit /etc/login.defs and edit or add the following line: ENCRYPT_METHOD SHA512 Run the following script to configure pam_unix.so to use the sha512 hashing algorithm: #!/usr/bin/env bash { for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+sha512\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+(md5|blowfish|bigcrypt|sha256|yescrypt)\\b.*$' \"$file\"; then sed -ri 's/(md5|blowfish|bigcrypt|sha256|yescrypt)/sha512/' \"$file\" else sed -ri 's/(^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix.so\\s+)(.*)$/\\1s ha512 \\3/' \"$file\" fi fi done authselect apply-changes } Note: This only effects local users and passwords created after updating the files to use sha512. If it is determined that the password algorithm being used is not SHA-512, once it is changed, it is recommended that all user ID's be immediately expired and forced to change their passwords on next login." + compliance: + - cis: ["5.5.4"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1041"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1003", "T1003.008", "T1110", "T1110.002"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/libuser.conf -> r:^\s*\t*crypt_style\s*\t*=\s*\t*sha512|^\s*crypt_style\s*\t*=\s*\t*yescrypt' + - 'f:/etc/login.defs -> r:^\s*\t*ENCRYPT_METHOD SHA512|^\s*\t*ENCRYPT_METHOD YESCRYPT' + - 'f:/etc/pam.d/password-auth -> r:^\s*\t*password\.+sufficient\.+pam_unix\.so' + - 'f:/etc/pam.d/system-auth -> r:^\s*\t*password\.+sufficient\.+pam_unix\.so' + + ############################################### + # 5.6 User Accounts and Environment + ############################################### + ############################################### + # 5.6.1 Set Shadow Password Suite Parameters + ############################################### + # 5.6.1.1 Ensure password expiration is 365 days or less. (Automated) + - id: 33663 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + compliance: + - cis: ["5.6.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.001", "T1110.002", "T1110.003", "T1110.004"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:(\d+):\S*:\S*:\S*:\S* compare > 365' + + # 5.6.1.2 Ensure minimum days between password changes is configured. (Automated) + - id: 33664 + title: "Ensure minimum days between password changes is configured." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 1 in /etc/login.defs: PASS_MIN_DAYS 1 Modify user parameters for all users with a password set to match: # chage --mindays 1 ." + compliance: + - cis: ["5.6.1.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110.004"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 1' + - 'not f:/etc/shadow -> n:^\w+:\S*:\S*:(\d+):\S*:\S*:\S*:\S*:\S* compare < 1' + - 'not f:/etc/shadow -> r:^\w+:\S*:\S*::\S*:\S*:\S*:\S*:\S*' + + # 5.6.1.3 Ensure password expiration warning days is 7 or more. (Automated) + - id: 33665 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs : PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["5.6.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1078"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + - 'f:/etc/shadow -> n:^\w+:\S*:\S*:\S*:\S*:(\d+):\S*:\S*:\S* compare >= 7' + - 'not f:/etc/shadow -> r:^\w+:\S*:\S*:\S*:\S*::\S*:\S*:\S*' + + # 5.6.1.4 Ensure inactive password lock is 30 days or less. (Automated) + - id: 33666 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["5.6.1.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.002", "T1078.003"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*\t*(\d+) compare <= 30' + - 'f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:\S*:\S*:(\d+):\S*:\S* compare <= 30' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && r:^\w+:\S*:\S*:\S*:\S*:\S*::\S*:\S*' + + # 5.6.1.5 Ensure all users last password change date is in the past. (Automated) - Not Implemented + # 5.6.2 Ensure system accounts are secured. (Automated) - Not Implemented + # 5.6.3 Ensure default user shell timeout is 900 seconds or less. (Automated) - Not Implemented + + # 5.6.4 Ensure default group for the root account is GID 0. (Automated) + - id: 33667 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root account belongs to. This affects permissions of files that are created by the root account." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root account default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.6.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/passwd -> r:^root:x:0:0" + + # 5.6.5 Ensure default user umask is 027 or more restrictive. (Automated) - Not Implemented + + # 5.6.6 Ensure root password is set. (Automated) + - id: 33668 + title: "Ensure root password is set." + description: "There are a number of methods to access the root account directly. Without a password set any user would be able to gain access and thus control over the entire system." + rationale: "Access to root should be secured at all times." + impact: "If there are any automated processes that relies on access to the root account without authentication, they will fail after remediation." + remediation: "Set the root password with: # passwd root." + compliance: + - cis: ["5.6.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1078"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:passwd -S root -> r:Password set" + + ############################################### + # 6 System Maintenance + ############################################### + ############################################### + # 6.1 System File Permissions + ############################################### + # 6.1.1 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 33669 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd: # chmod u-x,go-wx /etc/passwd # chown root:root /etc/passwd." + compliance: + - cis: ["6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/passwd -> r:0/root 0/root && r:644|640|604|600' + + # 6.1.2 Ensure permissions on /etc/passwd- are configured. (Automated) + - id: 33670 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd-: # chmod u-x,go-wx /etc/passwd- # chown root:root /etc/passwd-." + compliance: + - cis: ["6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/passwd- -> r:0/root 0/root && r:644|640|604|600' + + # 6.1.3 Ensure permissions on /etc/group are configured. (Automated) + - id: 33671 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group: # chmod u-x,go-wx /etc/group # chown root:root /etc/group." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/group -> r:0/root 0/root && r:644|640|604|600' + + # 6.1.4 Ensure permissions on /etc/group- are configured. (Automated) + - id: 33672 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group-: # chmod u-x,go-wx /etc/group- # chown root:root /etc/group-." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/group- -> r:0/root 0/root && r:644|640|604|600' + + # 6.1.5 Ensure permissions on /etc/shadow are configured. (Automated) + - id: 33673 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following commands to set mode, owner, and group on /etc/shadow: # chown root:root /etc/shadow # chmod 0000 /etc/shadow." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/shadow -> r:\s0 0/root 0/root' + + # 6.1.6 Ensure permissions on /etc/shadow- are configured. (Automated) + - id: 33674 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set mode, owner, and group on /etc/shadow-: # chown root:root /etc/shadow- # chmod 0000 /etc/shadow-." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/shadow- -> r:\s0 0/root 0/root' + + # 6.1.7 Ensure permissions on /etc/gshadow are configured. (Automated) + - id: 33675 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run the following commands to set mode, owner, and group on /etc/gshadow: # chown root:root /etc/gshadow # chmod 0000 /etc/gshadow." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/gshadow -> r:\s0 0/root 0/root' + + # 6.1.8 Ensure permissions on /etc/gshadow- are configured. (Automated) + - id: 33676 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set mode, owner, and group on /etc/gshadow-: # chown root:root /etc/gshadow- # chmod 0000 /etc/gshadow-." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/gshadow- -> r:\s0 0/root 0/root' + + # 6.1.9 Ensure no world writable files exist. (Automated) - Not Implemented + # 6.1.10 Ensure no unowned files or directories exist. (Automated) - Not Implemented + # 6.1.11 Ensure no ungrouped files or directories exist. (Automated) - Not Implemented + # 6.1.12 Ensure sticky bit is set on all world-writable directories. (Automated) - Not Implemented + # 6.1.13 Audit SUID executables. (Manual) - Not Implemented + # 6.1.14 Audit SGID executables. (Manual) - Not Implemented + # 6.1.15 Audit system file permissions. (Manual) - Not Implemented + ################################################ + # 6.2 Local User and Group Settings + ################################################ + # 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords. (Automated) + - id: 33677 + title: "Ensure accounts in /etc/passwd use shadowed passwords." + description: "Local accounts can use shadowed passwords. With shadowed passwords, the passwords are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. Accounts with a shadowed password have an x in the second field in /etc/passwd." + rationale: "The /etc/passwd file also contains information like user ID's and group ID's that are used by many system programs. Therefore, the /etc/passwd file must remain world readable. In spite of encoding the password with a randomly-generated one-way hash function, an attacker could still break the system if they got access to the /etc/passwd file. This can be mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. This helps mitigate the risk of an attacker gaining access to the encoded passwords with which to perform a dictionary attack. Note: - All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user. - A user account with an empty second field in /etc/passwd allows the account to be logged into by providing only the username." + remediation: "Run the following command to set accounts to use shadowed passwords: # sed -e 's/^\\([a-zA-Z0-9_]*\\):[^:]*:/\\1:x:/' -i /etc/passwd Investigate to determine if the account is logged in and what it is being used for, to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1003", "T1003.008"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'not f:/etc/passwd -> !r:^\w+:x:' + + # 6.2.2 Ensure /etc/shadow password fields are not empty. (Automated) + - id: 33678 + title: "Ensure /etc/shadow password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + + # 6.2.3 Ensure all groups in /etc/passwd exist in /etc/group. (Automated) - Not Implemented + # 6.2.4 Ensure no duplicate UIDs exist. (Automated) - Not Implemented + # 6.2.5 Ensure no duplicate GIDs exist. (Automated) - Not Implemented + # 6.2.6 Ensure no duplicate user names exist. (Automated) - Not Implemented + # 6.2.7 Ensure no duplicate group names exist. (Automated) - Not Implemented + # 6.2.8 Ensure root PATH Integrity. (Automated) - Not Implemented + + # 6.2.9 Ensure root is the only UID 0 account. (Automated) + - id: 33679 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.9"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1548"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^\s*root && n:^\w+:\S*:(\d+):\S*:\S*:\S*:\S* compare == 0' + + # 6.2.10 Ensure local interactive user home directories exist. (Automated) - Not Implemented + # 6.2.11 Ensure local interactive users own their home directories. (Automated) - Not Implemented + # 6.2.12 Ensure local interactive user home directories are mode 750 or more restrictive. (Automated) - Not Implemented + # 6.2.13 Ensure no local interactive user has .netrc files. (Automated) - Not Implemented + # 6.2.14 Ensure no local interactive user has .forward files. (Automated) - Not Implemented + # 6.2.15 Ensure no local interactive user has .rhosts files. (Automated) - Not Implemented + # 6.2.16 Ensure local interactive user dot files are not group or world writable. (Automated) - Not Implemented \ No newline at end of file diff --git a/etc/ruleset/sca/oracledb/cis_oracle_database_19c.yml b/etc/ruleset/sca/oracledb/cis_oracle_database_19c.yml new file mode 100644 index 0000000000..fd4e29b234 --- /dev/null +++ b/etc/ruleset/sca/oracledb/cis_oracle_database_19c.yml @@ -0,0 +1,1533 @@ +# Security Configuration Assessment +# CIS Checks for Oracle Database 19c +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Oracle Database 19c Benchmark v1.0.0 - 09-21-2020 + +policy: + id: "cis_oracle_database_19c" + file: "cis_oracle_database_19c.yml" + name: "CIS Benchmark for Oracle Database 19c v1.0.0" + description: "The Oracle installation version and patches should be the most recent that are compatible with the organization's operational needs." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +variables: + $listener_file: /u01/app/oracle/product/19.0.0/db_1/network/admin/listener.ora + +checks: + ############################################### + # 1 Oracle Database Installation and Patching Requirements + ############################################### + ############################################### + # 1.1 Ensure the Appropriate Version/Patches for Oracle Software Is Installed (Manual) - EXCLUDED + ############################################### + ############################################### + # 2 Oracle Parameter Settings + ############################################### + ############################################### + # 2.1 Listener Settings + ############################################### + # 2.1.1 Ensure 'extproc' Is Not Present in 'listener.ora' + - id: 24500 + title: "Ensure 'extproc' Is Not Present in 'listener.ora'." + description: "extproc should be removed from the listener.ora to mitigate the risk that OS libraries can be invoked by the Oracle instance." + rationale: "extproc allows the database to run procedures from OS libraries. These library calls can, in turn, run any OS command." + remediation: "Remove extproc from the listener.ora file." + compliance: + - cis: ["2.1.1"] + - cis_csc: ["18.9", "9.2"] + condition: none + rules: + - "f:$listener_file -> r:extproc" + + # 2.1.2 Ensure 'ADMIN_RESTRICTIONS_' Is Set to 'ON' + - id: 24501 + title: "Ensure 'ADMIN_RESTRICTIONS_' Is Set to 'ON'." + description: "The admin_restrictions_ setting in the listener.ora file can require that any attempted real-time alteration of the parameters in the listener via the set command file be refused unless the listener.ora file is manually altered, then restarted by a privileged user." + rationale: "Blocking unprivileged users from making alterations of the listener.ora file, where remote data/service settings are specified, will help protect data confidentiality." + remediation: "Use a text editor such as vi to set the admin_restrictions_ to the value ON" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["5.1", "4.3"] + condition: any + rules: + - 'f:$listener_file -> r:\.+admin_restrictions_\.+ ON' + + ############################################### + # 2.2 Database Settings + ############################################### + # 2.2.1 Ensure 'AUDIT_SYS_OPERATIONS' Is Set to 'TRUE' + - id: 24502 + title: "Ensure 'AUDIT_SYS_OPERATIONS' Is Set to 'TRUE'." + description: "The AUDIT_SYS_OPERATIONS setting provides for the auditing of all user activities conducted under the SYSOPER and SYSDBA accounts. The setting should be set to TRUE to enable this auditing." + rationale: "If the parameter AUDIT_SYS_OPERATIONS is FALSE, all statements except for Startup/Shutdown and Logon by SYSDBA/SYSOPER users are not audited." + remediation: "To remediate this setting, execute the following SQL statement and restart the instance. ALTER SYSTEM SET AUDIT_SYS_OPERATIONS = TRUE SCOPE=SPFILE;" + compliance: + - cis: ["2.2.1"] + - cis_csc: ["5.4", "6.2", "4.8", "6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME) = ''AUDIT_SYS_OPERATIONS'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> TRUE' + + # 2.2.2 Ensure 'AUDIT_TRAIL' Is Set to 'DB', 'XML', 'OS', 'DB,EXTENDED', or 'XML,EXTENDED' + - id: 24503 + title: "Ensure 'AUDIT_TRAIL' Is Set to 'DB', 'XML', 'OS', 'DB,EXTENDED', or 'XML,EXTENDED'." + description: "The audit_trail setting determines whether or not Oracle's basic audit features are enabled. It can be set to Operating System(OS); DB; DB,EXTENDED; XML; or XML,EXTENDED. The value should be set according to the needs of the organization." + rationale: "Enabling the basic auditing features for the Oracle instance permits the collection of data to troubleshoot problems, as well as provides valuable forensic logs in the case of a system breach this value should be set according to the needs of the organization." + remediation: "To remediate this setting, execute one of the following SQL statements and restart the instance. ALTER SYSTEM SET AUDIT_TRAIL = DB, EXTENDED SCOPE = SPFILE; ALTER SYSTEM SET AUDIT_TRAIL = OS SCOPE = SPFILE; ALTER SYSTEM SET AUDIT_TRAIL = XML, EXTENDED SCOPE = SPFILE; ALTER SYSTEM SET AUDIT_TRAIL = DB SCOPE = SPFILE; ALTER SYSTEM SET AUDIT_TRAIL = XML SCOPE = SPFILE;" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["6", "6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''AUDIT_TRAIL'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> r:^DB|^OS|^XML|^DB,EXTENDED|^XML,EXTENDED' + + # 2.2.3 Ensure 'GLOBAL_NAMES' Is Set to 'TRUE' + - id: 24504 + title: "Ensure 'GLOBAL_NAMES' Is Set to 'TRUE'." + description: "The global_names setting requires that the name of a database link matches that of the remote database it will connect to. This setting should have a value of TRUE." + rationale: "Not requiring database connections to match the domain that is being called remotely could allow unauthorized domain sources to potentially connect via brute-force tactics." + remediation: "To remediate this setting, execute the following SQL statement. ALTER SYSTEM SET GLOBAL_NAMES = TRUE SCOPE = SPFILE;" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''GLOBAL_NAMES'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> TRUE' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT DISTINCT UPPER(V.VALUE), DECODE (V.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE V.CON_ID = B.CON_ID)) FROM V\\"\$SYSTEM_PARAMETER" V WHERE UPPER(NAME) = ''GLOBAL_NAMES'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^- | tail -n 1" -> r:TRUE' + + # 2.2.4 Ensure 'OS_ROLES' Is Set to 'FALSE' + - id: 24505 + title: "Ensure 'OS_ROLES' Is Set to 'FALSE'." + description: "The os_roles setting permits externally created groups to be applied to database management" + rationale: "Allowing the OS to use external groups for database management could cause privilege overlaps and generally weaken security." + remediation: "ALTER SYSTEM SET OS_ROLES = FALSE SCOPE = SPFILE;" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["16", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''OS_ROLES'';\" | sqlplus / as sysdba| grep -A 1 ^- | grep -v ^-" -> FALSE' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT DISTINCT UPPER(V.VALUE), DECODE (V.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE V.CON_ID = B.CON_ID)) FROM V\\"\$SYSTEM_PARAMETER" V WHERE UPPER(NAME) = ''OS_ROLES'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^- | tail -n 1" -> r:FALSE' + + # 2.2.5 Ensure 'REMOTE_LISTENER' Is Empty + - id: 24506 + title: "Ensure 'REMOTE_LISTENER' Is Empty." + description: "The remote_listener setting determines whether or not a valid listener can be established on a system separate from the database instance. This setting should be empty unless the organization specifically needs a valid listener on a separate system or on nodes running Oracle RAC instances" + rationale: "Permitting a remote listener for connections to the database instance can allow for the potential spoofing of connections and that could compromise data confidentiality and integrity." + remediation: "ALTER SYSTEM SET REMOTE_LISTENER = '' SCOPE = SPFILE;" + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9", "9.2"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''REMOTE_LISTENER'' AND VALUE IS NOT NULL;\" | sqlplus / as sysdba | grep -A 1 \"^SQL>\" | grep -v \"^SQL>\"" -> r:no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT DISTINCT UPPER(V.VALUE), DECODE (V.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE V.CON_ID = B.CON_ID)) FROM V\\"\$SYSTEM_PARAMETER" V WHERE UPPER(NAME) = ''REMOTE_LISTENER'' AND VALUE IS NOT NULL;\" | sqlplus / as sysdba | grep -A 1 \"^SQL>\" | grep -v \"^SQL>\" -> r:no rows selected' + + # 2.2.6 Ensure 'REMOTE_LOGIN_PASSWORDFILE' Is Set to 'NONE' + - id: 24507 + title: "Ensure 'REMOTE_LOGIN_PASSWORDFILE' Is Set to 'NONE'." + description: "The remote_login_passwordfile setting specifies whether or not Oracle checks for a password file during login and how many databases can use the password file. The setting should have a value of NONE or in the event you are running DR/Data Guard, EXCLUSIVE is an allowable value." + rationale: "The use of this sort of password login file could permit unsecured, privileged connections to the database." + remediation: "ALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE = 'NONE' SCOPE = SPFILE;" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["16", "16.2"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''REMOTE_LOGIN_PASSWORDFILE'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> r:^NONE|^EXCLUSIVE' + + # 2.2.7 Ensure 'REMOTE_OS_AUTHENT' Is Set to 'FALSE' + - id: 24508 + title: "Ensure 'REMOTE_OS_AUTHENT' Is Set to 'FALSE'." + description: "The remote_os_authent setting determines whether or not OS 'roles' with the attendant privileges are allowed for remote client connections. This setting should have a value of FALSE." + rationale: "Permitting OS roles for database connections can allow the spoofing of connections and permit granting the privileges of an OS role to unauthorized users to make connections, this value should be restricted according to the needs of the organization." + remediation: "ALTER SYSTEM SET REMOTE_OS_AUTHENT = FALSE SCOPE = SPFILE;" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["16", "16.2"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''REMOTE_OS_AUTHENT'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> FALSE' + + # 2.2.8 Ensure 'REMOTE_OS_ROLES' Is Set to 'FALSE' + - id: 24509 + title: "Ensure 'REMOTE_OS_ROLES' Is Set to 'FALSE'." + description: "The remote_os_roles setting permits remote users' OS roles to be applied to database management. This setting should have a value of FALSE." + rationale: "Allowing remote clients OS roles to have permissions for database management could cause privilege overlaps and generally weaken security" + remediation: "ALTER SYSTEM SET REMOTE_OS_ROLES = FALSE SCOPE = SPFILE;" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["16", "16.2"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''REMOTE_OS_ROLES'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> FALSE' + + # 2.2.9 Ensure 'SEC_CASE_SENSITIVE_LOGON' Is Set to 'TRUE' + - id: 24510 + title: "Ensure 'SEC_CASE_SENSITIVE_LOGON' Is Set to 'TRUE' ." + description: "The SEC_CASE_SENSITIVE_LOGON information determines whether or not case-sensitivity is required for passwords during login. Note: This parameter has been deprecated in 12.1 and higher versions." + rationale: "Oracle database password case-sensitivity increases the pool of characters that can be chosen for the passwords, making brute-force password attacks quite difficult." + remediation: "ALTER SYSTEM SET SEC_CASE_SENSITIVE_LOGON = TRUE SCOPE = SPFILE;" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["16", "4.4"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''SEC_CASE_SENSITIVE_LOGON'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> TRUE' + + # 2.2.10 Ensure 'SEC_MAX_FAILED_LOGIN_ATTEMPTS' Is '3' or Less + - id: 24511 + title: "Ensure 'SEC_MAX_FAILED_LOGIN_ATTEMPTS' Is '3' or Less37." + description: "The SEC_MAX_FAILED_LOGIN_ATTEMPTS parameter determines how many failed login attempts are allowed before Oracle closes the login connection." + rationale: "Allowing an unlimited number of login attempts for a user connection can facilitate both brute-force login attacks and the occurrence of denial-of-service." + remediation: "ALTER SYSTEM SET SEC_MAX_FAILED_LOGIN_ATTEMPTS = 3 SCOPE = SPFILE;" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["16.7"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''SEC_MAX_FAILED_LOGIN_ATTEMPTS'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> n:(\d+) compare <= 3' + + # 2.2.11 Ensure 'SEC_PROTOCOL_ERROR_FURTHER_ACTION' Is Set to '(DROP,3)' + - id: 24512 + title: "Ensure 'SEC_PROTOCOL_ERROR_FURTHER_ACTION' Is Set to '(DROP,3)'." + description: "The SEC_PROTOCOL_ERROR_FURTHER_ACTION setting determines the Oracle server's response to bad/malformed packets received from the client. This setting should have a value of (DROP,3), which will cause a connection to be dropped after three bad/malformed packets." + rationale: "Bad packets received from the client can potentially indicate packet-based attacks on the system, such as TCP SYN Flood or Smurf attacks, which could result in a denial-ofservice condition, this value should be set according to the needs of the organization." + remediation: "ALTER SYSTEM SET SEC_PROTOCOL_ERROR_FURTHER_ACTION = '(DROP,3)' SCOPE = SPFILE;" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["18"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''SEC_PROTOCOL_ERROR_FURTHER_ACTION'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> (DROP,3)' + + # 2.2.12 Ensure 'SEC_PROTOCOL_ERROR_TRACE_ACTION' Is Set to 'LOG' + - id: 24513 + title: "Ensure 'SEC_PROTOCOL_ERROR_TRACE_ACTION' Is Set to 'LOG'." + description: "The SEC_PROTOCOL_ERROR_TRACE_ACTION setting determines the Oracle's server's logging response level to bad/malformed packets received from the client by generating ALERT, LOG, or TRACE levels of detail in the log files. This setting should have a value of LOG unless the organization has a compelling reason to use a different value because LOG should cause the necessary information to be logged. Setting the value as TRACE can generate an enormous amount of log output and should be reserved for debugging only." + rationale: "Bad packets received from the client can potentially indicate packet-based attacks on the system, which could result in a denial-of-service condition." + remediation: "ALTER SYSTEM SET SEC_PROTOCOL_ERROR_TRACE_ACTION=LOG SCOPE = SPFILE;" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''SEC_PROTOCOL_ERROR_TRACE_ACTION'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> LOG' + + # 2.2.13 Ensure 'SEC_RETURN_SERVER_RELEASE_BANNER' Is Set to 'FALSE' + - id: 24514 + title: "Ensure 'SEC_RETURN_SERVER_RELEASE_BANNER' Is Set to 'FALSE'." + description: "The information about patch/update release number provides information about the exact patch/update release that is currently running on the database. This is sensitive information that should not be revealed to anyone who requests it." + rationale: "Allowing the database to return information about the patch/update release number could facilitate unauthorized users' attempts to gain access based upon known patch weaknesses." + remediation: "ALTER SYSTEM SET SEC_RETURN_SERVER_RELEASE_BANNER = FALSE SCOPE = SPFILE;" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''SEC_RETURN_SERVER_RELEASE_BANNER'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> FALSE' + + # 2.2.14 Ensure 'SQL92_SECURITY' Is Set to 'TRUE' + - id: 24515 + title: "Ensure 'SQL92_SECURITY' Is Set to 'TRUE'." + description: "The SQL92_SECURITY parameter setting TRUE requires that a user must also be granted the SELECT object privilege before being able to perform UPDATE or DELETE operations on tables that have WHERE or SET clauses. The setting should have a value of TRUE." + rationale: "A user without SELECT privilege can still infer the value stored in a column by referring to that column in a DELETE or UPDATE statement. This setting prevents inadvertent information disclosure by ensuring that only users who already have SELECT privilege can execute the statements that would allow them to infer the stored values." + remediation: "ALTER SYSTEM SET SQL92_SECURITY = TRUE SCOPE = SPFILE;" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["18", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''SQL92_SECURITY'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> TRUE' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT DISTINCT UPPER(V.VALUE), DECODE (V.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE V.CON_ID = B.CON_ID)) FROM V\\"\$SYSTEM_PARAMETER" V WHERE UPPER(NAME) = ''SQL92_SECURITY'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> r:TRUE' + + # 2.2.15 Ensure '_trace_files_public' Is Set to 'FALSE' - EXCLUDED: this check requires database presets based on SCA appendix instructions + + # 2.2.16 Ensure 'RESOURCE_LIMIT' Is Set to 'TRUE' + - id: 24516 + title: "Ensure 'RESOURCE_LIMIT' Is Set to 'TRUE'." + description: "RESOURCE_LIMIT determines whether resource limits are enforced in database profiles. This setting should have a value of TRUE." + rationale: "If RESOURCE_LIMIT is set to FALSE, none of the system resource limits that are set in any database profiles are enforced. If RESOURCE_LIMIT is set to TRUE, the limits set in database profiles are enforced." + remediation: "ALTER SYSTEM SET RESOURCE_LIMIT = TRUE SCOPE = SPFILE;" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["14.4", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT UPPER(VALUE) FROM V\\"\$SYSTEM_PARAMETER" WHERE UPPER(NAME)=''RESOURCE_LIMIT'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> TRUE' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT DISTINCT UPPER(V.VALUE), DECODE (V.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE V.CON_ID = B.CON_ID)) FROM V\\"\$SYSTEM_PARAMETER" V WHERE UPPER(NAME) = ''RESOURCE_LIMIT'';\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> TRUE' + + ############################################### + # 3 Oracle Connection and Login Restrictions + ############################################### + # 3.1 Ensure 'FAILED_LOGIN_ATTEMPTS' Is Less than or Equal to '5' + - id: 24517 + title: "Ensure 'FAILED_LOGIN_ATTEMPTS' Is Less than or Equal to '5'." + description: "The FAILED_LOGIN_ATTEMPTS setting determines how many failed login attempts are permitted before the system locks the user's account. While different profiles can have different and more restrictive settings, such as USERS and APPS, the minimum(s) recommended here should be set on the DEFAULT profile." + rationale: "Repeated failed login attempts can indicate the initiation of a brute-force login attack, this value should be set according to the needs of the organization. (See the Notes for a warning on a known bug that can make this security measure backfire.)" + remediation: "ALTER PROFILE LIMIT FAILED_LOGIN_ATTEMPTS 5;" + compliance: + - cis: ["3.1"] + - cis_csc: ["16.7"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''FAILED_LOGIN_ATTEMPTS''), ''UNLIMITED'',''9999'', P.LIMIT)) > 5 AND P.RESOURCE_NAME = ''FAILED_LOGIN_ATTEMPTS'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE ) ;\" | sqlplus / as sysdba | grep -A 1 FAILED_LOGIN_ATTEMPTS | grep -v FAILED_LOGIN_ATTEMPTS" -> n:(\d+) compare <= 5' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''FAILED_LOGIN_ATTEMPTS'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'',P.LIMIT)) > 5 AND P.RESOURCE_NAME = ''FAILED_LOGIN_ATTEMPTS'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep -A 1 FAILED_LOGIN_ATTEMPTS | grep -v FAILED_LOGIN_ATTEMPTS | head -n 1" -> n:(\d+) compare <= 5' + + # 3.2 Ensure 'PASSWORD_LOCK_TIME' Is Greater than or Equal to '1' + - id: 24518 + title: "Ensure 'PASSWORD_LOCK_TIME' Is Greater than or Equal to '1'." + description: "The PASSWORD_LOCK_TIME setting determines how many days must pass for the user's account to be unlocked after the set number of failed login attempts has occurred. The suggested value for this is one day or greater." + rationale: "Locking the user account after repeated failed login attempts can block further brute-force login attacks, but can create administrative headaches as this account unlocking process always requires DBA intervention." + remediation: "ALTER PROFILE LIMIT PASSWORD_LOCK_TIME 1;" + compliance: + - cis: ["3.2"] + - cis_csc: ["16.7"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_LOCK_TIME''), ''UNLIMITED'',''9999'', P.LIMIT)) < 1 AND P.RESOURCE_NAME = ''PASSWORD_LOCK_TIME'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> n:(\d+) compare >= 1' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_LOCK_TIME''), ''UNLIMITED'',''9999'', P.LIMIT)) < 1 AND P.RESOURCE_NAME = ''PASSWORD_LOCK_TIME'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_LOCK_TIME'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'',P.LIMIT)) < 1 AND P.RESOURCE_NAME = ''PASSWORD_LOCK_TIME'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> n:(\d+) compare >= 1' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_LOCK_TIME'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'',P.LIMIT)) < 1 AND P.RESOURCE_NAME = ''PASSWORD_LOCK_TIME'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + + # 3.3 Ensure 'PASSWORD_LIFE_TIME' Is Less than or Equal to '90' + - id: 24519 + title: "Ensure 'PASSWORD_LIFE_TIME' Is Less than or Equal to '90'." + description: "The PASSWORD_LIFE_TIME setting determines how long a password may be used before the user is required to be change it. The suggested value for this is 90 days or less." + rationale: "Allowing passwords to remain unchanged for long periods makes the success of bruteforce login attacks more likely." + remediation: "ALTER PROFILE LIMIT PASSWORD_LIFE_TIME 90;" + compliance: + - cis: ["3.3"] + - cis_csc: ["16"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_LIFE_TIME''), ''UNLIMITED'',''9999'',P.LIMIT)) > 90 AND P.RESOURCE_NAME = ''PASSWORD_LIFE_TIME'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep -A 1 \"PASSWORD_LIFE_TIME\" | grep -v \"PASSWORD_LIFE_TIME\"" -> n:(\d+) compare <= 90' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_LIFE_TIME''), ''UNLIMITED'',''9999'',P.LIMIT)) > 90 AND P.RESOURCE_NAME = ''PASSWORD_LIFE_TIME'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_LIFE_TIME'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'', P.LIMIT)) > 90 AND P.RESOURCE_NAME = ''PASSWORD_LIFE_TIME'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep -A 1 \"PASSWORD_LIFE_TIME\" | grep -v \"PASSWORD_LIFE_TIME\"" -> n:(\d+) compare <= 90' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_LIFE_TIME'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'', P.LIMIT)) > 90 AND P.RESOURCE_NAME = ''PASSWORD_LIFE_TIME'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep -A 1 \"PASSWORD_LIFE_TIME\" | grep \"no rows selected\"" -> r:no rows selected' + + # 3.4 Ensure 'PASSWORD_REUSE_MAX' Is Greater than or Equal to '20' + - id: 24520 + title: "Ensure 'PASSWORD_REUSE_MAX' Is Greater than or Equal to '20'." + description: "The PASSWORD_REUSE_MAX setting determines how many different passwords must be used before the user is allowed to reuse a prior password. The suggested value for this is 20 passwords or greater." + rationale: "Allowing reuse of a password within a short period of time after the password's initial use can make the success of both social-engineering and brute-force password-based attacks more likely." + remediation: "ALTER PROFILE LIMIT PASSWORD_REUSE_MAX 20;" + compliance: + - cis: ["3.4"] + - cis_csc: ["16", "4.4"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_REUSE_MAX''), ''UNLIMITED'',''9999'',P.LIMIT)) < 20 AND P.RESOURCE_NAME = ''PASSWORD_REUSE_MAX'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> n:(\d+) compare >= 20' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_REUSE_MAX''), ''UNLIMITED'',''9999'',P.LIMIT)) < 20 AND P.RESOURCE_NAME = ''PASSWORD_REUSE_MAX'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_REUSE_MAX'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'',P.LIMIT)) < 20 AND P.RESOURCE_NAME = ''PASSWORD_REUSE_MAX'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> n:(\d+) compare >= 20' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_REUSE_MAX'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'',P.LIMIT)) < 20 AND P.RESOURCE_NAME = ''PASSWORD_REUSE_MAX'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + + # 3.5 Ensure 'PASSWORD_REUSE_TIME' Is Greater than or Equal to '365' + - id: 24521 + title: "Ensure 'PASSWORD_REUSE_TIME' Is Greater than or Equal to '365'." + description: "The PASSWORD_REUSE_TIME setting determines the amount of time in days that must pass before the same password may be reused. The suggested value for this is 365 days or greater." + rationale: "Reusing the same password after only a short period of time has passed makes the success of brute-force login attacks more likely." + remediation: "ALTER PROFILE LIMIT PASSWORD_REUSE_TIME 365;" + compliance: + - cis: ["3.5"] + - cis_csc: ["16", "4.4"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_REUSE_TIME''), ''UNLIMITED'',''9999'',P.LIMIT)) < 365 AND P.RESOURCE_NAME = ''PASSWORD_REUSE_TIME'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> n:(\d+) compare >= 365' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_REUSE_TIME''), ''UNLIMITED'',''9999'',P.LIMIT)) < 365 AND P.RESOURCE_NAME = ''PASSWORD_REUSE_TIME'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_REUSE_TIME'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'',P.LIMIT)) < 365 AND P.RESOURCE_NAME = ''PASSWORD_REUSE_TIME'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep -A 1 ^- | grep -v ^-" -> n:(\d+) compare >= 365' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_REUSE_TIME'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'',P.LIMIT)) < 365 AND P.RESOURCE_NAME = ''PASSWORD_REUSE_TIME'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + + # 3.6 Ensure 'PASSWORD_GRACE_TIME' Is Less than or Equal to '5' + - id: 24522 + title: "Ensure 'PASSWORD_GRACE_TIME' Is Less than or Equal to '5'." + description: "The PASSWORD_GRACE_TIME setting determines how many days can pass after the user's password expires before the user's login capability is automatically locked out. The suggested value for this is five days or less." + rationale: "Locking the user account after the expiration of the password change requirement's grace period can help prevent password-based attacks against any forgotten or disused accounts, while still allowing the account and its information to be accessible by DBA intervention." + remediation: "ALTER PROFILE LIMIT PASSWORD_GRACE_TIME 5;" + compliance: + - cis: ["3.6"] + - cis_csc: ["16", "16.10", "16.9"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_GRACE_TIME''), ''UNLIMITED'',''9999'',P.LIMIT)) > 5 AND P.RESOURCE_NAME = ''PASSWORD_GRACE_TIME'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep -A 1 ^PASSWORD_GRACE_TIME | grep -v ^PASSWORD_GRACE_TIME" -> n:(\d+) compare <= 5' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_GRACE_TIME''), ''UNLIMITED'',''9999'',P.LIMIT)) > 5 AND P.RESOURCE_NAME = ''PASSWORD_GRACE_TIME'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_GRACE_TIME'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'',P.LIMIT)) > 5 AND P.RESOURCE_NAME = ''PASSWORD_GRACE_TIME'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep -A 1 ^PASSWORD_GRACE_TIME | grep -v ^PASSWORD_GRACE_TIME" -> n:(\d+) compare <= 5' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''PASSWORD_GRACE_TIME'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'',P.LIMIT)) > 5 AND P.RESOURCE_NAME = ''PASSWORD_GRACE_TIME'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + + # 3.7 Ensure 'PASSWORD_VERIFY_FUNCTION' Is Set for All Profiles + - id: 24523 + title: "Ensure 'PASSWORD_VERIFY_FUNCTION' Is Set for All Profiles." + description: "The PASSWORD_VERIFY_FUNCTION determines password settings requirements when a user password is changed at the SQL command prompt. It should be set for all profiles. Note that this setting does not apply for users managed by the Oracle password file." + rationale: "Through Oracle database profiles, password complexity rules (mixed cases with digits and special characters), blocking of simple combinations, and enforcing change/history settings can potentially thwart unauthorized logins by an unauthorized user." + remediation: "Create a custom password verification function which fulfills the password requirements of the organization." + compliance: + - cis: ["3.7"] + - cis_csc: ["16", "4.4"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE DECODE(P.LIMIT, ''DEFAULT'',(SELECT LIMIT FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME = P.RESOURCE_NAME), LIMIT) = ''NULL'' AND P.RESOURCE_NAME = ''PASSWORD_VERIFY_FUNCTION'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep -A 1 ^PASSWORD_VERIFY_FUNCTION | grep -v ^PASSWORD_VERIFY_FUNCTION" -> NULL' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE DECODE(P.LIMIT, ''DEFAULT'',(SELECT LIMIT FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME = P.RESOURCE_NAME AND CON_ID = P.CON_ID), LIMIT) = ''NULL'' AND P.RESOURCE_NAME = ''PASSWORD_VERIFY_FUNCTION'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep -A 1 ^PASSWORD_VERIFY_FUNCTION | grep -v ^PASSWORD_VERIFY_FUNCTION" -> NULL' + + # 3.8 Ensure 'SESSIONS_PER_USER' Is Less than or Equal to '10' + - id: 24524 + title: "Ensure 'SESSIONS_PER_USER' Is Less than or Equal to '10'." + description: "The SESSIONS_PER_USER setting determines the maximum number of user sessions that are allowed to be open concurrently. The suggested value for this is 10 or less." + rationale: "Limiting the number of the SESSIONS_PER_USER can help prevent memory resource exhaustion by poorly formed requests or intentional denial-of-service attacks." + remediation: "ALTER PROFILE LIMIT SESSIONS_PER_USER 10;" + compliance: + - cis: ["3.8"] + - cis_csc: ["18", "16.7"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''SESSIONS_PER_USER'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'',P.LIMIT)) > 10 AND P.RESOURCE_NAME = ''SESSIONS_PER_USER'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep -A 1 ^SESSIONS_PER_USER | grep -v ^SESSIONS_PER_USER" -> n:(\d+) compare <= 10' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''SESSIONS_PER_USER'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'',P.LIMIT)) > 10 AND P.RESOURCE_NAME = ''SESSIONS_PER_USER'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE ) ORDER BY CON_ID, PROFILE, RESOURCE_NAME;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''SESSIONS_PER_USER''), ''UNLIMITED'',''9999'',P.LIMIT)) > 10 AND P.RESOURCE_NAME = ''SESSIONS_PER_USER'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep -A 1 ^SESSIONS_PER_USER | grep -v ^SESSIONS_PER_USER" -> n:(\d+) compare <= 10' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''SESSIONS_PER_USER''), ''UNLIMITED'',''9999'',P.LIMIT)) > 10 AND P.RESOURCE_NAME = ''SESSIONS_PER_USER'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + + # 3.9 Ensure 'INACTIVE_ACCOUNT_TIME' Is Less than or Equal to '120 + - id: 24525 + title: "Ensure 'INACTIVE_ACCOUNT_TIME' Is Less than or Equal to '120'." + description: "The 'INACTIVE_ACCOUNT_TIME' setting determines the maximum number of days of inactivity (no logins at all) after which the account will be locked. The suggested value for this is 120 or less." + rationale: "Setting 'INACTIVE_ACCOUNT_TIME' can help with deactivation of inactive or unused accounts." + remediation: "ALTER PROFILE LIMIT INACTIVE_ACCOUNT_TIME 120;" + compliance: + - cis: ["3.9"] + - cis_csc: ["18", "16.9"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT,''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''INACTIVE_ACCOUNT_TIME''), ''UNLIMITED'',''9999'', P.LIMIT)) > 120 AND P.RESOURCE_NAME = ''INACTIVE_ACCOUNT_TIME'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep -A 1 ^INACTIVE_ACCOUNT_TIME | grep -v ^INACTIVE_ACCOUNT_TIME" -> n:(\d+) compare <= 120' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT P.PROFILE, P.RESOURCE_NAME, P.LIMIT FROM DBA_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT,''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM DBA_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''INACTIVE_ACCOUNT_TIME''), ''UNLIMITED'',''9999'', P.LIMIT)) > 120 AND P.RESOURCE_NAME = ''INACTIVE_ACCOUNT_TIME'' AND EXISTS ( SELECT ''X'' FROM DBA_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT DISTINCT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''INACTIVE_ACCOUNT_TIME'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'', P.LIMIT)) > 120 AND P.RESOURCE_NAME = ''INACTIVE_ACCOUNT_TIME'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep -A 1 ^INACTIVE_ACCOUNT_TIME | grep -v ^INACTIVE_ACCOUNT_TIME" -> n:(\d+) compare <= 120' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT DISTINCT P.PROFILE, P.RESOURCE_NAME, P.LIMIT, DECODE (P.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE P.CON_ID = B.CON_ID)) DATABASE FROM CDB_PROFILES P WHERE TO_NUMBER(DECODE(P.LIMIT, ''DEFAULT'',(SELECT DISTINCT DECODE(LIMIT,''UNLIMITED'',9999,LIMIT) FROM CDB_PROFILES WHERE PROFILE=''DEFAULT'' AND RESOURCE_NAME=''INACTIVE_ACCOUNT_TIME'' AND CON_ID = P.CON_ID), ''UNLIMITED'',''9999'', P.LIMIT)) > 120 AND P.RESOURCE_NAME = ''INACTIVE_ACCOUNT_TIME'' AND EXISTS ( SELECT ''X'' FROM CDB_USERS U WHERE U.PROFILE = P.PROFILE );\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + + ############################################## + # 4 Users + ############################################### + # 4.1 Ensure All Default Passwords Are Changed + - id: 24526 + title: "Ensure All Default Passwords Are Changed." + description: "Default passwords should not be used by Oracle database users." + rationale: "Default passwords should be considered well known to attackers. Consequently, if default passwords remain in place, any attacker with access to the database can authenticate as the user with that default password." + remediation: "" + compliance: + - cis: ["4.1"] + - cis_csc: ["5.3", "4.2"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT DISTINCT A.USERNAME FROM DBA_USERS_WITH_DEFPWD A, DBA_USERS B WHERE A.USERNAME = B.USERNAME AND B.ACCOUNT_STATUS = ''OPEN'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT DISTINCT A.USERNAME, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_USERS_WITH_DEFPWD A, CDB_USERS C WHERE A.USERNAME = C.USERNAME AND C.ACCOUNT_STATUS = ''OPEN'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> r:no rows selected' + + # 4.2 Ensure All Sample Data And Users Have Been Removed + - id: 24527 + title: "Ensure All Sample Data And Users Have Been Removed." + description: "Oracle sample schemas can be used to create sample users (BI,HR,IX,OE,PM,SCOTT,SH), with well-known default passwords, particular views, and procedures/functions, in addition to tables and fictitious data. The sample schemas should be removed." + rationale: "The sample schemas are typically not required for production operations of the database. The default users, views, and/or procedures/functions created by sample schemas could be used to launch exploits against production environments." + remediation: "$ORACLE_HOME/demo/schema/drop_sch.sql DROP USER SCOTT CASCADE;" + compliance: + - cis: ["4.2"] + - cis_csc: ["18.9", "4.7"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT USERNAME FROM DBA_USERS WHERE USERNAME IN (''BI'',''HR'',''IX'',''OE'',''PM'',''SCOTT'',''SH'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT DISTINCT A.USERNAME, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_USERS A WHERE A.USERNAME IN (''BI'',''HR'',''IX'',''OE'',''PM'',''SCOTT'',''SH'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 4.3 Ensure 'DBA_USERS.AUTHENTICATION_TYPE' Is Not Set to 'EXTERNAL' for Any User + - id: 24528 + title: "Ensure 'DBA_USERS.AUTHENTICATION_TYPE' Is Not Set to 'EXTERNAL' for Any User." + description: "The authentication_type=''EXTERNAL'' setting determines whether or not a user can be authenticated by a remote OS to allow access to the database with full authorization. This setting should not be used." + rationale: "Allowing remote OS authentication of a user to the database can potentially allow supposed privileged users to connect as authenticated, even when the remote system is compromised." + remediation: "ALTER USER IDENTIFIED BY ;" + compliance: + - cis: ["4.3"] + - cis_csc: ["16", "16.2"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT USERNAME FROM DBA_USERS WHERE AUTHENTICATION_TYPE = ''EXTERNAL'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT A.USERNAME, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_USERS A WHERE AUTHENTICATION_TYPE = ''EXTERNAL'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 4.4 Ensure No Users Are Assigned the 'DEFAULT' Profile + - id: 24529 + title: "Ensure No Users Are Assigned the 'DEFAULT' Profile." + description: "Upon creation database users are assigned to the DEFAULT profile unless otherwise specified. No users should be assigned to that profile." + rationale: "Users should be created with function-appropriate profiles. The DEFAULT profile, being defined by Oracle, is subject to change at any time (e.g. by patch or version update). The DEFAULT profile has unlimited settings that are often required by the SYS user when patching; such unlimited settings should be tightly reserved and not applied to unnecessary users." + remediation: "ALTER USER PROFILE ;" + compliance: + - cis: ["4.4"] + - cis_csc: ["16", "4.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT USERNAME FROM DBA_USERS WHERE PROFILE=''DEFAULT'' AND ACCOUNT_STATUS=''OPEN'' AND ORACLE_MAINTAINED = ''N'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT A.USERNAME, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_USERS A WHERE A.PROFILE=''DEFAULT'' AND A.ACCOUNT_STATUS=''OPEN'' AND A.ORACLE_MAINTAINED = ''N'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 4.5 Ensure 'SYS.USER$MIG' Has Been Dropped + - id: 24530 + title: "Ensure 'SYS.USER$MIG' Has Been Dropped." + description: "The table sys.user$mig is created during migration and contains the Oracle password hashes before the migration starts. This table should be dropped." + rationale: "The table sys.user$mig is not deleted after the migration. An attacker could access the table containing the Oracle password hashes." + remediation: "DROP TABLE SYS.USER$MIG;" + compliance: + - cis: ["4.5"] + - cis_csc: ["16.14", "16.4"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT OWNER, TABLE_NAME FROM DBA_TABLES WHERE TABLE_NAME=''USER\$MIG'' AND OWNER=''SYS'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT OWNER, TABLE_NAME, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_TABLES A WHERE TABLE_NAME=''USER\$MIG'' AND OWNER=''SYS'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 4.6 Ensure No Public Database Links Exist + - id: 24531 + title: "Ensure No Public Database Links Exist." + description: "Public Database links are used to allow connections between databases." + rationale: "Using public database links in the database can allow anyone with a connection to the database to query, update, insert, delete data on a remote database depending on the userid that is part of the link." + remediation: "DROP PUBLIC DATABASE LINK ;" + compliance: + - cis: ["4.6"] + - cis_csc: ["14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT DB_LINK, HOST FROM DBA_DB_LINKS WHERE OWNER = ''PUBLIC'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT DB_LINK, HOST, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_DB_LINKS A WHERE OWNER = ''PUBLIC'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + ############################################## + # 5 Privileges & Grants & ACLs + ############################################### + ############################################### + # 5.1 Excessive Table, View and Package Privileges + ############################################### + # 5.1.1 Public Privileges + ############################################### + # 5.1.1.1 Ensure 'EXECUTE' is revoked from 'PUBLIC' on "Network" Packages + - id: 24532 + title: "Ensure 'EXECUTE' is revoked from 'PUBLIC' on Network Packages." + description: "As described below, Oracle Database PL/SQL Network packages - DBMS_LDAP, UTL_INADDR, UTL_TCP, UTL_MAIL, UTL_SMTP, UTL_DBWS, UTL_ORAMTS, UTL_HTTP and type HTTPURITYPE – provide PL/SQL APIs to interact or access remote servers. The PUBLIC should not be able to execute these packages. • The Oracle database DBMS_LDAP package contains functions and procedures that enable programmers to access data from LDAP servers. • The Oracle database UTL_INADDR package provides an API to retrieve host names and IP addresses of local and remote hosts. • The Oracle database UTL_TCP package can be used to read/write file to TCP sockets on the server where the Oracle instance is installed. • The Oracle database UTL_MAIL package can be used to send email from the server where the Oracle instance is installed. • The Oracle database UTL_SMTP package can be used to send email from the server where the Oracle instance is installed. The user PUBLIC should not be able to execute UTL_SMTP. • The Oracle database UTL_DBWS package can be used to read/write file to web-based applications on the server where the Oracle instance is installed. This package is not automatically installed for security reasons. • The Oracle database UTL_ORAMTS package can be used to perform HTTP requests. This could be used to send information to the outside.85 | P a g e • The Oracle database UTL_HTTP package can be used to perform HTTP requests. This could be used to send information to the outside. • The Oracle database HTTPURITYPE object type can be used to perform HTTP requests." + rationale: "As described below, Oracle Database PL/SQL packages - DBMS_LDAP, UTL_INADDR, UTL_TCP, UTL_MAIL, UTL_SMTP, UTL_DBWS, UTL_ORAMTS, UTL_HTTP and type HTTPURITYPE can be used by unauthorized users to create specially crafted error messages or send information to external servers. The PUBLIC should not be able to execute these packages. • The use of the DBMS_LDAP package can be used to create specially crafted error messages or send information via DNS to the outside. • The UTL_INADDR package can be used to create specially crafted error messages or send information via DNS to the outside. • The UTL_TCP package could allow an unauthorized user to corrupt the TCP stream used to carry the protocols that communicate with the instance's external communications. • The UTL_MAIL package could allow an unauthorized user to corrupt the SMTP function to accept or generate junk mail that can result in a denial-of-service condition due to network saturation. • The UTL_SMTP package could allow an unauthorized user to corrupt the SMTP function to accept or generate junk mail that can result in a denial-of-service condition due to network saturation. • The UTL_DBWS package could allow an unauthorized user to corrupt the HTTP stream used to carry the protocols that communicate for the instance's web-based external communications. • The UTL_ORAMTS package could be used to send (sensitive) information to external websites. The use of this package should be restricted according to the needs of the organization. • The UTL_HTTP package could be used to send (sensitive) information to external websites. • The use of this package should be restricted according to the needs of the organization. • The ability to perform HTTP requests could be used to leak information from the database to an external destination." + remediation: "REVOKE EXECUTE ON DBMS_LDAP FROM PUBLIC; REVOKE EXECUTE ON UTL_INADDR FROM PUBLIC; REVOKE EXECUTE ON UTL_TCP FROM PUBLIC; REVOKE EXECUTE ON UTL_MAIL FROM PUBLIC; REVOKE EXECUTE ON UTL_SMTP FROM PUBLIC; REVOKE EXECUTE ON UTL_DBWS FROM PUBLIC; REVOKE EXECUTE ON UTL_ORAMTS FROM PUBLIC; REVOKE EXECUTE ON UTL_HTTP FROM PUBLIC; REVOKE EXECUTE ON HTTPURITYPE FROM PUBLIC;" + compliance: + - cis: ["5.1.1.1"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE FROM DBA_TAB_PRIVS WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_LDAP'',''UTL_INADDR'',''UTL_TCP'',''UTL_MAIL'',''UTL_SMTP'',''UTL_DBWS'',''UTL_ORA MTS'',''UTL_HTTP'',''HTTPURITYPE'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE,DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_TAB_PRIVS A WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_LDAP'',''UTL_INADDR'',''UTL_TCP'',''UTL_MAIL'',''UTL_SMTP'',''UTL_DBWS'',''UTL_ORA MTS'',''UTL_HTTP'',''HTTPURITYPE'') ORDER BY CON_ID, TABLE_NAME;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.1.1.2 Ensure 'EXECUTE' is revoked from 'PUBLIC' on "File System" Packages + - id: 24533 + title: "Ensure 'EXECUTE' is revoked from 'PUBLIC' on File System Packages." + description: "As described below, Oracle Database PL/SQL File System packages - DBMS_ADVISOR, DBMS_LOB and UTL_FILE – provide PL/SQL APIs to access files on the servers. The user PUBLIC should not be able to execute these packages. • The Oracle database DBMS_ADVISOR package can be used to write files located on the server where the Oracle instance is installed. The user PUBLIC should not be able to execute DBMS_ADVISOR. • The Oracle database DBMS_LOB package provides subprograms that can manipulate and read/write on BLOB's, CLOB's, NCLOB's, BFILE's, and temporary LOB's. The user PUBLIC should not be able to execute DBMS_LOB. • The Oracle database UTL_FILE package can be used to read/write files located on the server where the Oracle instance is installed. The user PUBLIC should not be able to execute UTL_FILE." + rationale: "As described below, Oracle Database PL/SQL File System packages - DBMS_ADVISOR, DBMS_LOB and UTL_FILE – should not be granted to PUBLIC. • Use of the DBMS_ADVISOR package could allow an unauthorized user to corrupt operating system files on the instance's host. • Use of the DBMS_LOB package could allow an unauthorized user to manipulate BLOB's, CLOB's, NCLOB's, BFILE's, and temporary LOBs on the instance, either destroying data or causing a denial-of-service condition due to corruption of disk space. • Use of the UTL_FILE package could allow a user to read OS files. These files could contain sensitive information (e.g. passwords in .bash_history)" + remediation: "REVOKE EXECUTE ON DBMS_ADVISOR FROM PUBLIC; REVOKE EXECUTE ON DBMS_LOB FROM PUBLIC; REVOKE EXECUTE ON UTL_FILE FROM PUBLIC;" + compliance: + - cis: ["6", "7"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE FROM DBA_TAB_PRIVS WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_ADVISOR'',''DBMS_LOB'',''UTL_FILE'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE,DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_TAB_PRIVS A WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_ADVISOR'',''DBMS_LOB'',''UTL_FILE'') ORDER BY CON_ID, TABLE_NAME;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.1.1.3 Ensure 'EXECUTE' is revoked from 'PUBLIC' on "Encryption" Packages + - id: 24534 + title: "Ensure 'EXECUTE' is revoked from 'PUBLIC' on Encryption Packages." + description: "As described below, Oracle Database PL/SQL Encryption packages - DBMS_CRYPTO, DBMS_OBFUSCATION_TOOLKIT and DBMS_RANDOM – provide PL/SQL APIs to perform functions related to cryptography. The PUBLIC should not be able to execute these packages. • The DBMS_CRYPTO settings provide a toolset that determines the strength of the encryption algorithm used to encrypt application data and is part of the SYS schema. The DES (56-bit key), 3DES (168-bit key), 3DES-2KEY (112-bit key), AES (128/192/256-bit keys), and RC4 are available. • The DBMS_OBFUSCATION_TOOLKIT provides one of the tools that determine the strength of the encryption algorithm used to encrypt application data and is part of the SYS schema. The DES (56-bit key) and 3DES (168-bit key) are the only two types available. • The Oracle database DBMS_RANDOM package is used for generating random numbers but should not be used for cryptographic purposes." + rationale: "As described below, Oracle Database PL/SQL Encryption packages - DBMS_CRYPTO, DBMS_OBFUSCATION_TOOLKIT and DBMS_RANDOM – should not be granted to PUBLIC. • Execution of the DBMS_CRYPTO procedures by the PUBLIC can potentially endanger portions of or all of the data storage. • Allowing the PUBLIC privileges to access this capability can be potentially harm data storage. • Use of the DBMS_RANDOM package can allow the unauthorized application of the random number-generating function." + remediation: "REVOKE EXECUTE ON DBMS_CRYPTO FROM PUBLIC; REVOKE EXECUTE ON DBMS_OBFUSCATION_TOOLKIT FROM PUBLIC; REVOKE EXECUTE ON DBMS_RANDOM FROM PUBLIC;" + compliance: + - cis: ["5.1.1.3"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE FROM DBA_TAB_PRIVS WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_CRYPTO'',''DBMS_OBFUSCATION_TOOLKIT'', ''DBMS_RANDOM'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE,DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_TAB_PRIVS A WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_CRYPTO'',''DBMS_OBFUSCATION_TOOLKIT'', ''DBMS_RANDOM'') ORDER BY CON_ID, TABLE_NAME;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.1.1.4 Ensure 'EXECUTE' is revoked from 'PUBLIC' on "Java" Packages + - id: 24535 + title: "Ensure 'EXECUTE' is revoked from 'PUBLIC' on Java Packages." + description: "As described below, Oracle Database PL/SQL Java packages - DBMS_JAVA and DBMS_JAVA_TEST – provide APIs to run Java classes or grant Java packages. The user PUBLIC should not be able to execute these packages. • The Oracle database DBMS_JAVA package can run Java classes (e.g. OS commands) or grant Java privileges. The user PUBLIC should not be able to execute DBMS_JAVA. • The Oracle database DBMS_JAVA_TEST package can run Java classes (e.g. OS commands) or grant Java privileges. The user PUBLIC should not be able to execute DBMS_JAVA_TEST." + rationale: "As described below, Oracle Database PL/SQL Java packages - DBMS_JAVA and DBMS_JAVA_TEST – should not be granted to PUBLIC. • The DBMS_JAVA package could allow an attacker to run OS commands from the database. • The DBMS_JAVA_TEST package could allow an attacker to run operating system commands from the database." + remediation: "REVOKE EXECUTE ON DBMS_JAVA FROM PUBLIC; REVOKE EXECUTE ON DBMS_JAVA_TEST FROM PUBLIC;" + compliance: + - cis: ["5.1.1.4"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE FROM DBA_TAB_PRIVS WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_JAVA'',''DBMS_JAVA_TEST'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE,DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_TAB_PRIVS A WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_JAVA'',''DBMS_JAVA_TEST'') ORDER BY CON_ID, TABLE_NAME;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.1.1.5 Ensure 'EXECUTE' is revoked from 'PUBLIC' on "Job Scheduler" Packages + - id: 24536 + title: "Ensure 'EXECUTE' is revoked from 'PUBLIC' on Job Scheduler Packages." + description: "As described below, Oracle Database PL/SQL Job Scheduler packages - DBMS_SCHEDULER and DBMS_JOB – provide APIs to schedule jobs. The user PUBLIC should not be able to execute these packages. • The Oracle database DBMS_SCHEDULER package schedules and manages the database and operating system jobs. The user PUBLIC should not be able to execute DBMS_SCHEDULER. • The Oracle database DBMS_JOB package schedules and manages the jobs sent to the job queue and has been superseded by the DBMS_SCHEDULER package, even though DBMS_JOB has been retained for backwards compatibility. The user PUBLIC should not be able to execute DBMS_JOB." + rationale: "As described below, Oracle Database PL/SQL Job Scheduler packages - DBMS_SCHEDULER and DBMS_JOB – should not be granted to the user PUBLIC. • Use of the DBMS_SCHEDULER package could allow an unauthorized user to run database or operating system jobs. • Use of the DBMS_JOB package could allow an unauthorized user to disable or overload the job queue. It has been superseded by the DBMS_SCHEDULER package" + remediation: "REVOKE EXECUTE ON DBMS_JOB FROM PUBLIC; REVOKE EXECUTE ON DBMS_SCHEDULER FROM PUBLIC;" + compliance: + - cis: ["6", "7"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE FROM DBA_TAB_PRIVS WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_SCHEDULER'',''DBMS_JOB'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE,DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_TAB_PRIVS A WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_SCHEDULER'',''DBMS_JOB'') ORDER BY CON_ID, TABLE_NAME;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.1.1.6 Ensure 'EXECUTE' is revoked from 'PUBLIC' on "SQL Injection Helper" Packages + - id: 24537 + title: "Ensure 'EXECUTE' is revoked from 'PUBLIC' on SQL Injection Helper Packages." + description: "As described below, Oracle Database PL/SQL SQL Injection Helper Packages packages - DBMS_SQL, DBMS_XMLGEN, DBMS_XMLQUERY, DBMS_XLMSTORE, DBMS_XLMSAVE and DBMS_REDACT – provide APIs to schedule jobs. The user PUBLIC should not be able to execute these packages. • The Oracle database DBMS_SQL package is used for running dynamic SQL statements. • The DBMS_XMLGEN package takes an arbitrary SQL query as input, converts it to XML format, and returns the result as a CLOB. • The Oracle package DBMS_XMLQUERY takes an arbitrary SQL query, converts it to XML format, and returns the result. This package is similar to DBMS_XMLGEN. • The DBMS_XLMSTORE package provides XML functionality. It accepts a table name and XML as input to perform DML operations against the table. • The DBMS_XLMSAVE package provides XML functionality. It accepts a table name and XML as input and then inserts into or updates that table. • The DBMS_REDACT package provides an interface to Oracle Data Redaction, which enables you to mask (redact) data that is returned from queries issued by lowprivileged users or an application." + rationale: "As described below, Oracle Database PL/SQL SQL Injection Helper Packages packages - DBMS_SQL, DBMS_XMLGEN, DBMS_XMLQUERY, DBMS_XLMSTORE, DBMS_XLMSAVE and 'DBMS_REDACT' – should not be granted to PUBLIC. • The DBMS_SQL package could allow privilege escalation if input validation is not done properly. • The package DBMS_XMLGEN can be used to search the entire database for sensitive information like credit card numbers • The package DBMS_XMLQUERY can be used to search the entire database for sensitive information like credit card numbers. Malicious users may be able to exploit this package as an auxiliary inject function in a SQL injection attack. • Malicious users may be able to exploit the DBMS_XLMSTORE package as an auxiliary inject function in a SQL injection attack. • Malicious users may be able to exploit the DBMS_XLMSAVE package as an auxiliary inject function in a SQL injection attack. • Malicious users may be able to exploit DBMS_REDACT as an auxiliary inject function in a SQL injection attack." + remediation: "REVOKE EXECUTE ON DBMS_SQL FROM PUBLIC; REVOKE EXECUTE ON DBMS_XMLGEN FROM PUBLIC; REVOKE EXECUTE ON DBMS_XMLQUERY FROM PUBLIC; REVOKE EXECUTE ON DBMS_XMLSAVE FROM PUBLIC; REVOKE EXECUTE ON DBMS_XMLSTORE FROM PUBLIC; REVOKE EXECUTE ON DBMS_AW FROM PUBLIC;REVOKE EXECUTE ON OWA_UTIL FROM PUBLIC; REVOKE EXECUTE ON DBMS_REDACT FROM PUBLIC;" + compliance: + - cis: ["5.1.1.6"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE FROM DBA_TAB_PRIVS WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_SQL'', ''DBMS_XMLGEN'', ''DBMS_XMLQUERY'',''DBMS_XMLSTORE'',''DBMS_XMLSAVE'',''DBMS_AW'',''OWA_UTIL'',''DBMS_RED ACT'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE,DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_TAB_PRIVS A WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_SQL'', ''DBMS_XMLGEN'', ''DBMS_XMLQUERY'',''DBMS_XMLSTORE'',''DBMS_XMLSAVE'',''DBMS_AW'',''OWA_UTIL'',''DBMS_RED ACT'') ORDER BY CON_ID, TABLE_NAME;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + ############################################### + # 5.1.2 Non-Default Privileges + ############################################### + # 5.1.2.1 Ensure 'EXECUTE' is not granted to 'PUBLIC' on "Non-default" Packages + - id: 24538 + title: "Ensure 'EXECUTE' is not granted to 'PUBLIC' on Non-default Packages." + description: "The packages described in this control are not granted to PUBLIC by default (Non-default packages). These packages should not be granted to PUBLIC. • The Oracle database DBMS_BACKUP_RESTORE package is used for applying PL/SQL commands to the native RMAN sequences. • The Oracle database DBMS_FILE_TRANSFER package allows a user to transfer files from one database server to another. • The Oracle database DBMS_SYS_SQL,DBMS_REPCAT_SQL_UTL, INITJVMAUX, DBMS_AQADM_SYS, DBMS_STREAMS_RPC, DBMS_PRVTAQIM, LTADM and DBMS_IJOB packages are shipped as undocumented." + rationale: "As described below, these non-default group of PL/SQL packages, which are not granted to PUBLIC by default, packages should not be granted to PUBLIC. • The DBMS_BACKUP_RESTORE package can allow access to OS files. • The DBMS_FILE_TRANSFER package could allow to transfer files from one database server to another without authorization to do so. • The DBMS_SYS_SQL package could allow a user to run code as a different user without entering valid credentials. • The DBMS_REPCAT_SQL_UTL package could allow an unauthorized user to run SQL commands as user SYS. • The INITJVMAUX package could allow an unauthorized user to run SQL commands as user SYS. • The DBMS_AQADM_SYS package could allow an unauthorized user to run SQL commands as user SYS. • The DBMS_STREAMS_RPC package could allow an unauthorized user to run SQL commands as user SYS.102 | P a g e • The DBMS_PRVTAQIM package could allow an unauthorized user to escalate privileges because any SQL statements could be executed as user SYS. • The LTADM package could allow an unauthorized user to run any SQL command as user SYS. It allows privilege escalation if granted to unprivileged users. • The DBMS_IJOB package could allow an attacker to change identities by using a different username to execute a database job. It allows a user to run database jobs in the context of another user." + remediation: "REVOKE EXECUTE ON DBMS_BACKUP_RESTORE FROM PUBLIC; REVOKE EXECUTE ON DBMS_FILE_TRANSFER FROM PUBLIC; REVOKE EXECUTE ON DBMS_SYS_SQL FROM PUBLIC; REVOKE EXECUTE ON DBMS_REPCAT_SQL_UTL FROM PUBLIC; REVOKE EXECUTE ON INITJVMAUX FROM PUBLIC; REVOKE EXECUTE ON DBMS_AQADM_SYS FROM PUBLIC; REVOKE EXECUTE ON DBMS_STREAMS_RPC FROM PUBLIC; REVOKE EXECUTE ON DBMS_PRVTAQIM FROM PUBLIC; REVOKE EXECUTE ON LTADM FROM PUBLIC; REVOKE EXECUTE ON DBMS_IJOB FROM PUBLIC; REVOKE EXECUTE ON DBMS_PDB_EXEC_SQL FROM PUBLIC;" + compliance: + - cis: ["5.1.2.1"] + - cis_csc: ["18", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE FROM DBA_TAB_PRIVS WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_BACKUP_RESTORE'',''DBMS_FILE_TRANSFER'',''DBMS_SYS_SQL'',''DBMS_REPCAT_SQL_U TL'',''INITJVMAUX'', ''DBMS_AQADM_SYS'',''DBMS_STREAMS_RPC'',''DBMS_PRVTAQIM'',''LTADM'', ''DBMS_IJOB'',''DBMS_PDB_EXEC_SQL'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE,DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_TAB_PRIVS A WHERE GRANTEE=''PUBLIC'' AND PRIVILEGE=''EXECUTE'' AND TABLE_NAME IN (''DBMS_BACKUP_RESTORE'',''DBMS_FILE_TRANSFER'',''DBMS_SYS_SQL'',''DBMS_REPCAT_SQL_U TL'',''INITJVMAUX'', ''DBMS_AQADM_SYS'',''DBMS_STREAMS_RPC'',''DBMS_PRVTAQIM'',''LTADM'', ''DBMS_IJOB'',''DBMS_PDB_EXEC_SQL'') ORDER BY CON_ID, TABLE_NAME;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + ############################################### + # 5.1.3 Other Privileges + ############################################### + # 5.1.3.1 Ensure 'ALL' Is Revoked from Unauthorized 'GRANTEE' on 'AUD$' + - id: 24539 + title: "Ensure 'ALL' Is Revoked from Unauthorized 'GRANTEE' on 'AUD$'." + description: "The Oracle database SYS.AUD$ table contains all the audit records for the database of the non-Data Manipulation Language (DML) events, such as ALTER, DROP, and CREATE, and so forth. (DML changes need trigger-based audit events to record data alterations.) Unauthorized grantees should not have full access to that table." + rationale: "Permitting non-privileged users the authorization to manipulate the SYS.AUD$ table can allow distortion of the audit records, hiding unauthorized activities." + remediation: "REVOKE ALL ON AUD$ FROM ;" + compliance: + - cis: ["5.1.3.1"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_TAB_PRIVS WHERE TABLE_NAME=''AUD\$'' AND OWNER = ''SYS'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_TAB_PRIVS A WHERE TABLE_NAME=''AUD\$'' AND OWNER = ''SYS'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.1.3.2 Ensure 'ALL' Is Revoked from Unauthorized 'GRANTEE' on 'DBA_%' + - id: 24540 + title: "Ensure 'ALL' Is Revoked from Unauthorized 'GRANTEE' on 'DBA_%'." + description: "The Oracle database DBA_ views show all information which is relevant to administrative accounts. Unauthorized grantees should not have full access to those views." + rationale: "Permitting users the authorization to manipulate the DBA_ views can expose sensitive data." + remediation: "REVOKE ALL ON FROM ;" + compliance: + - cis: ["5.1.3.2"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE,TABLE_NAME FROM DBA_TAB_PRIVS WHERE TABLE_NAME LIKE ''DBA_%'' AND OWNER = ''SYS'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE,TABLE_NAME, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_TAB_PRIVS A WHERE TABLE_NAME LIKE ''DBA_%'' AND OWNER = ''SYS'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.1.3.3 Ensure 'ALL' Is Revoked on 'Sensitive' Tables + - id: 24541 + title: "Ensure 'ALL' Is Revoked on 'Sensitive' Tables ." + description: "The Oracle database tables listed below may contain sensitive information, and should not be accessible to unauthorized users. • USER$, USER_HISTORY$, XS$VERIFIERS and DEFAULT_PWD$ may contain password hashes. • CDB_LOCAL_ADMINAUTH$ and PDB_SYNC$ may contain DDLs. • LINK$ and SCHEDULER$_CREDENTIAL may contain encrypted passwords. • ENC$ may contains encryption keys. • HISTGRM$ and HIST_HEAD$ may contain sensitive data." + rationale: "Access to sensitive information such as hashed passwords may allow unauthorized users to decrypt the passwords hashes which could potentially result in complete compromise of the database." + remediation: "REVOKE ALL ON SYS.CDB_LOCAL_ADMINAUTH$ FROM ; REVOKE ALL ON SYS.DEFAULT_PWD$ FROM ; REVOKE ALL ON SYS.ENC$ FROM ; REVOKE ALL ON SYS.HISTGRM$ FROM ; REVOKE ALL ON SYS.HIST_HEAD$ FROM ; REVOKE ALL ON SYS.LINK$ FROM ; REVOKE ALL ON SYS.PDB_SYNC$ FROM ; REVOKE ALL ON SYS.SCHEDULER$_CREDENTIAL FROM ; REVOKE ALL ON SYS.USER$ FROM ; REVOKE ALL ON SYS.USER_HISTORY$ FROM ; REVOKE ALL ON SYS.XS$VERIFIERS FROM ;" + compliance: + - cis: ["5.1.3.3"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, TABLE_NAME FROM DBA_TAB_PRIVS WHERE TABLE_NAME in (''CDB_LOCAL_ADMINAUTH\$'',''DEFAULT_PWD\$'',''ENC\$'',''HISTGRM\$'',''HIST_HEAD\$'',''LINK\$'' ,''PDB_SYNC\$'',''SCHEDULER\$_CREDENTIAL'',''USER\$'',''USER_HISTORY\$'',''XS\$VERIFIERS'') AND OWNER = ''SYS'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT TABLE_NAME, PRIVILEGE, GRANTEE,DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) DATABASE FROM CDB_TAB_PRIVS A WHERE TABLE_NAME in (''CDB_LOCAL_ADMINAUTH\$'',''DEFAULT_PWD\$'',''ENC\$'',''HISTGRM\$'',''HIST_HEAD\$'',''LINK\$'' ,''PDB_SYNC\$'',''SCHEDULER\$_CREDENTIAL'',''USER\$'',''USER_HISTORY\$'',''XS\$VERIFIERS'') AND OWNER = ''SYS'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'') ORDER BY CON_ID, TABLE_NAME;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + ############################################### + # 5.2 Excessive System Privileges + ############################################### + # 5.2.1 Ensure '%ANY%' Is Revoked from Unauthorized 'GRANTEE' + - id: 24542 + title: "Ensure '%ANY%' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database ANY keyword provides the user the capability to alter any item in the catalog of the database. Unauthorized grantees should not have that keyword assigned to them" + rationale: "Authorization to use the ANY expansion of a privilege can allow an unauthorized user to potentially change confidential data or damage the data catalog." + remediation: "REVOKE '' FROM ;" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["14.4", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE LIKE ''%ANY%'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE LIKE ''%ANY%'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.2 Ensure 'DBA_SYS_PRIVS.%' Is Revoked from Unauthorized 'GRANTEE' with 'ADMIN_OPTION' Set to 'YES' + - id: 24543 + title: "Ensure 'DBA_SYS_PRIVS.%' Is Revoked from Unauthorized 'GRANTEE' with 'ADMIN_OPTION' Set to 'YES'." + description: "The Oracle database WITH_ADMIN privilege allows the designated user to grant another user the same privileges. Unauthorized grantees should not have that privilege." + rationale: "Assignment of the WITH_ADMIN privilege can allow the granting of a restricted privilege to an unauthorized user." + remediation: "REVOKE FROM ;" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE ADMIN_OPTION=''YES'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE ADMIN_OPTION=''YES'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.3 Ensure 'EXECUTE ANY PROCEDURE' Is Revoked from 'OUTLN' + - id: 24544 + title: "Ensure 'EXECUTE ANY PROCEDURE' Is Revoked from 'OUTLN'." + description: "Remove unneeded EXECUTE ANY PROCEDURE privileges from OUTLN." + rationale: "Migrated OUTLN users have more privileges than required." + remediation: "REVOKE EXECUTE ANY PROCEDURE FROM OUTLN;" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''EXECUTE ANY PROCEDURE'' AND GRANTEE=''OUTLN'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''EXECUTE ANY PROCEDURE'' AND GRANTEE=''OUTLN'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.4 Ensure 'EXECUTE ANY PROCEDURE' Is Revoked from 'DBSNMP' + - id: 24545 + title: "Ensure 'EXECUTE ANY PROCEDURE' Is Revoked from 'DBSNMP'." + description: "Remove unneeded EXECUTE ANY PROCEDURE privileges from DBSNMP." + rationale: "Migrated DBSNMP users have more privileges than required." + remediation: "REVOKE EXECUTE ANY PROCEDURE FROM DBSNMP;" + compliance: + - cis: ["5.2.4"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''EXECUTE ANY PROCEDURE'' AND GRANTEE=''DBSNMP'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''EXECUTE ANY PROCEDURE'' AND GRANTEE=''DBSNMP'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.5 Ensure 'SELECT ANY DICTIONARY' Is Revoked from Unauthorized 'GRANTEE' + - id: 24546 + title: "Ensure 'SELECT ANY DICTIONARY' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database SELECT ANY DICTIONARY privilege allows the designated user to access SYS schema objects. Unauthorized grantees should not have that privilege." + rationale: "SELECT ANY DICTIONARY is a powerful system privilege which would allow an unauthorized user to gather information about the database through data dictionary objects. Information collected could potentially be used to exploit the database." + remediation: "REVOKE SELECT ANY DICTIONARY FROM ;" + compliance: + - cis: ["5.2.5"] + - cis_csc: ["14.4", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''SELECT ANY DICTIONARY'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''SELECT ANY DICTIONARY'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.6 Ensure 'SELECT ANY TABLE' Is Revoked from Unauthorized 'GRANTEE' + - id: 24547 + title: "Ensure 'SELECT ANY TABLE' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database SELECT ANY TABLE privilege allows the designated user to open any table, except SYS, to view it. Unauthorized grantees should not have that privilege." + rationale: "Assignment of the SELECT ANY TABLE privilege can allow the unauthorized viewing of sensitive data." + remediation: "REVOKE SELECT ANY TABLE FROM ;" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["14.4", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''SELECT ANY TABLE'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''SELECT ANY TABLE'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.7 Ensure 'AUDIT SYSTEM' Is Revoked from Unauthorized 'GRANTEE' + - id: 24548 + title: "Ensure 'AUDIT SYSTEM' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database AUDIT SYSTEM privilege allows changes to auditing activities on the system. Unauthorized grantees should not have that privilege." + rationale: "The AUDIT SYSTEM privilege can allow the unauthorized alteration of system audit activities, such as disabling the creation of audit trails." + remediation: "REVOKE AUDIT SYSTEM FROM ;" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''AUDIT SYSTEM'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''AUDIT SYSTEM'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.8 Ensure 'EXEMPT ACCESS POLICY' Is Revoked from Unauthorized 'GRANTEE' + - id: 24549 + title: "Ensure 'EXEMPT ACCESS POLICY' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database EXEMPT ACCESS POLICY keyword provides the user the capability to access all the table rows regardless of row-level security lockouts. Unauthorized grantees should not have that keyword assigned to them." + rationale: "The EXEMPT ACCESS POLICY privilege can allow an unauthorized user to potentially access and change data." + remediation: "REVOKE EXEMPT ACCESS POLICY FROM ;" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["14.4", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''EXEMPT ACCESS POLICY'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''EXEMPT ACCESS POLICY'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.9 Ensure 'BECOME USER' Is Revoked from Unauthorized 'GRANTEE' + - id: 24550 + title: "Ensure 'BECOME USER' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database BECOME USER privilege allows the designated user to inherit the rights of another user. Unauthorized grantees should not have that privilege." + rationale: "The BECOME USER privilege can allow the unauthorized use of another user's privileges, this capability should be restricted according to the needs of the organization." + remediation: "REVOKE BECOME USER FROM ;" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''BECOME USER'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''BECOME USER'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.10 Ensure 'CREATE PROCEDURE' Is Revoked from Unauthorized 'GRANTEE' + - id: 24551 + title: "Ensure 'CREATE PROCEDURE' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database CREATE PROCEDURE privilege allows the designated user to create a stored procedure that will fire when given the correct command sequence. Unauthorized grantees should not have that privilege." + rationale: "The CREATE PROCEDURE privilege can lead to severe problems in unauthorized hands, such as rogue procedures facilitating data theft or denial-of-service by corrupting data tables." + remediation: "REVOKE CREATE PROCEDURE FROM ;" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''CREATE PROCEDURE'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''CREATE PROCEDURE'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.11 Ensure 'ALTER SYSTEM' Is Revoked from Unauthorized 'GRANTEE' + - id: 24552 + title: "Ensure 'ALTER SYSTEM' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database ALTER SYSTEM privilege allows the designated user to dynamically alter the instance's running operations. Unauthorized grantees should not have that privilege." + rationale: "The ALTER SYSTEM privilege can lead to severe problems, such as the instance's session being killed or the stopping of redo log recording, which would make transactions unrecoverable." + remediation: "REVOKE ALTER SYSTEM FROM ;" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''ALTER SYSTEM'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''ALTER SYSTEM'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.12 Ensure 'CREATE ANY LIBRARY' Is Revoked from Unauthorized 'GRANTEE' + - id: 24553 + title: "Ensure 'CREATE ANY LIBRARY' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database CREATE ANY LIBRARY privilege allows the designated user to create objects that are associated to the shared libraries. Unauthorized grantees should not have that privilege." + rationale: "The CREATE ANY LIBRARY privilege can allow the creation of numerous library-associated objects and potentially corrupt the libraries' integrity." + remediation: "REVOKE CREATE ANY LIBRARY FROM ;" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''CREATE ANY LIBRARY'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''CREATE ANY LIBRARY'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.13 Ensure 'CREATE LIBRARY' Is Revoked from Unauthorized 'GRANTEE' + - id: 24554 + title: "Ensure 'CREATE LIBRARY' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database CREATE LIBRARY privilege allows the designated user to create objects that are associated to the shared libraries. Unauthorized grantees should not have that privilege." + rationale: "The CREATE LIBRARY privilege can allow the creation of numerous library-associated objects and potentially corrupt the libraries' integrity" + remediation: "REVOKE CREATE LIBRARY FROM ;" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''CREATE LIBRARY'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''CREATE LIBRARY'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.14 Ensure 'GRANT ANY OBJECT PRIVILEGE' Is Revoked from Unauthorized 'GRANTEE' + - id: 24555 + title: "Ensure 'GRANT ANY OBJECT PRIVILEGE' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database GRANT ANY OBJECT PRIVILEGE keyword provides the grantee the capability to grant access to any single or multiple combinations of objects to any grantee in the catalog of the database. Unauthorized grantees should not have that keyword assigned to them." + rationale: "The GRANT ANY OBJECT PRIVILEGE capability can allow an unauthorized user to potentially access or change confidential data, or damage the data catalog due to potential complete instance access." + remediation: "REVOKE GRANT ANY OBJECT PRIVILEGE FROM ;" + compliance: + - cis: ["5.2.14"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''GRANT ANY OBJECT PRIVILEGE'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''GRANT ANY OBJECT PRIVILEGE'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.15 Ensure 'GRANT ANY ROLE' Is Revoked from Unauthorized 'GRANTEE' + - id: 24556 + title: "Ensure 'GRANT ANY ROLE' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database GRANT ANY ROLE keyword provides the grantee the capability to grant any single role to any grantee in the catalog of the database. Unauthorized grantees should not have that keyword assigned to them." + rationale: "The GRANT ANY ROLE capability can allow an unauthorized user to potentially access or change confidential data or damage the data catalog due to potential complete instance access." + remediation: "REVOKE GRANT ANY ROLE FROM ;" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''GRANT ANY ROLE'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''GRANT ANY ROLE'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.2.16 Ensure 'GRANT ANY PRIVILEGE' Is Revoked from Unauthorized 'GRANTEE' + - id: 24557 + title: "Ensure 'GRANT ANY PRIVILEGE' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database GRANT ANY PRIVILEGE keyword provides the grantee the capability to grant any single privilege to any item in the catalog of the database. Unauthorized grantees should not have that privilege." + rationale: "The GRANT ANY PRIVILEGE capability can allow an unauthorized user to potentially access or change confidential data or damage the data catalog due to potential complete instance access." + remediation: "REVOKE GRANT ANY PRIVILEGE FROM ;" + compliance: + - cis: ["5.2.16"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE FROM DBA_SYS_PRIVS WHERE PRIVILEGE=''GRANT ANY PRIVILEGE'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, PRIVILEGE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_SYS_PRIVS A WHERE PRIVILEGE=''GRANT ANY PRIVILEGE'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + ############################################### + # 5.3 Excessive Role Privileges + ############################################### + # 5.3.1 Ensure 'SELECT_CATALOG_ROLE' Is Revoked from Unauthorized 'GRANTEE' + - id: 24558 + title: "Ensure 'SELECT_CATALOG_ROLE' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database SELECT_CATALOG_ROLE provides SELECT privileges on all data dictionary views held in the SYS schema. Unauthorized grantees should not have that role." + rationale: "Permitting unauthorized access to the SELECT_CATALOG_ROLE can allow the disclosure of all dictionary data." + remediation: "REVOKE SELECT_CATALOG_ROLE FROM ;" + compliance: + - cis: ["5.3.1"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, GRANTED_ROLE FROM DBA_ROLE_PRIVS WHERE GRANTED_ROLE=''SELECT_CATALOG_ROLE'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, GRANTED_ROLE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_ROLE_PRIVS A WHERE GRANTED_ROLE=''SELECT_CATALOG_ROLE'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.3.2 Ensure 'EXECUTE_CATALOG_ROLE' Is Revoked from Unauthorized 'GRANTEE' + - id: 24559 + title: "Ensure 'EXECUTE_CATALOG_ROLE' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database EXECUTE_CATALOG_ROLE provides EXECUTE privileges for a number of packages and procedures in the data dictionary in the SYS schema. Unauthorized grantees should not have that role." + rationale: "Permitting unauthorized access to the EXECUTE_CATALOG_ROLE can allow the disruption of operations by initialization of rogue procedures, this capability should be restricted according to the needs of the organization." + remediation: "REVOKE EXECUTE_CATALOG_ROLE FROM ;" + compliance: + - cis: ["5.3.2"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, GRANTED_ROLE FROM DBA_ROLE_PRIVS WHERE GRANTED_ROLE=''EXECUTE_CATALOG_ROLE'' AND GRANTEE NOT IN (SELECT USERNAME FROM DBA_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM DBA_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT GRANTEE, GRANTED_ROLE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_ROLE_PRIVS A WHERE GRANTED_ROLE=''EXECUTE_CATALOG_ROLE'' AND GRANTEE NOT IN (SELECT USERNAME FROM CDB_USERS WHERE ORACLE_MAINTAINED=''Y'') AND GRANTEE NOT IN (SELECT ROLE FROM CDB_ROLES WHERE ORACLE_MAINTAINED=''Y'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 5.3.3 Ensure 'DBA' Is Revoked from Unauthorized 'GRANTEE' + - id: 24560 + title: "Ensure 'DBA' Is Revoked from Unauthorized 'GRANTEE'." + description: "The Oracle database DBA role is the default database administrator role provided for the allocation of administrative privileges. Unauthorized grantees should not have that role." + rationale: "Assignment of the DBA role to an ordinary user can provide a great number of unnecessary privileges to that user and open the door to data breaches, integrity violations, and denialof-service conditions." + remediation: "REVOKE DBA FROM ;" + compliance: + - cis: ["5.3.3"] + - cis_csc: ["5.1", "14.6"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT ''GRANT'' AS PATH, GRANTEE, GRANTED_ROLE FROM DBA_ROLE_PRIVS WHERE GRANTED_ROLE = ''DBA'' AND GRANTEE NOT IN (''SYS'', ''SYSTEM'') UNION SELECT ''PROXY'', PROXY || ''-'' || CLIENT, ''DBA'' FROM DBA_PROXIES WHERE CLIENT IN (SELECT GRANTEE FROM DBA_ROLE_PRIVS WHERE GRANTED_ROLE = ''DBA'');\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT ''GRANT'' AS PATH, GRANTEE, GRANTED_ROLE, DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) CON FROM CDB_ROLE_PRIVS A WHERE GRANTED_ROLE=''DBA'' AND GRANTEE NOT IN (''SYS'', ''SYSTEM'') UNION SELECT ''PROXY'', PROXY || ''-'' || CLIENT, ''DBA'', DECODE (A.CON_ID,0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) CON FROM CDB_PROXIES A WHERE CLIENT IN (SELECT GRANTEE FROM CDB_ROLE_PRIVS B WHERE GRANTED_ROLE = ''DBA'' AND A.CON_ID = B.CON_ID);\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + ############################################### + # 6 Audit/Logging Policies and Procedures + ############################################### + ############################################### + # 6.1 Traditional Auditing + ############################################### + # 6.1.1 Ensure the 'USER' Audit Option Is Enabled + - id: 24561 + title: "Ensure the 'USER' Audit Option Is Enabled." + description: "The USER object allows for creating accounts that can interact with the database according to the roles and privileges allotted to the account. It may also own database objects. Enabling the audit option causes auditing of all activities and requests to create, drop or alter a user, including a user changing their own password. (The latter is not audited by audit ALTER USER.)" + rationale: "Any unauthorized attempts to create, drop or alter a user should cause concern, whether successful or not. Auditing can also be useful in forensics if an account is compromised, and auditing is mandated by many common security initiatives. An abnormally high number of these activities in a given period might be worth investigation. Any failed attempt to drop a user or create a user may be worth further review." + remediation: "AUDIT USER;" + compliance: + - cis: ["6.1.1"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''USER'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''USER'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.2 Ensure the 'ROLE' Audit Option Is Enabled + - id: 24562 + title: "Ensure the 'ROLE' Audit Option Is Enabled." + description: "The ROLE object allows for the creation of a set of privileges that can be granted to users or other roles. Enabling the audit option causes auditing of all attempts, successful or not, to create, drop, alter or set roles." + rationale: "Roles are a key database security infrastructure component. Any attempt to create, drop or alter a role should be audited. This statement auditing option also audits attempts, successful or not, to set a role in a session. Any unauthorized attempts to create, drop or alter a role may be worthy of investigation. Attempts to set a role by users without the role privilege may warrant investigation." + remediation: "AUDIT ROLE;" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''ROLE'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''ROLE'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.3 Ensure the 'SYSTEM GRANT' Audit Option Is Enabled + - id: 24563 + title: "Ensure the 'SYSTEM GRANT' Audit Option Is Enabled." + description: "Enabling the audit option for the SYSTEM GRANT object causes auditing of any attempt, successful or not, to grant or revoke any system privilege or role, regardless of privilege held by the user attempting the operation." + rationale: "Logging of all grant and revokes (roles and system privileges) can provide forensic evidence about a pattern of suspect/unauthorized activities. Any unauthorized attempt may be cause for further investigation." + remediation: "AUDIT SYSTEM GRANT;" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["5.4", "4.8"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''SYSTEM GRANT'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''SYSTEM GRANT'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.4 Ensure the 'PROFILE' Audit Option Is Enabled + - id: 24564 + title: "Ensure the 'PROFILE' Audit Option Is Enabled." + description: "The PROFILE object allows for the creation of a set of database resource limits that can be assigned to a user, so that that user cannot exceed those resource limitations. Enabling the audit option causes auditing of all attempts, successful or not, to create, drop or alter any profile." + rationale: "As profiles are part of the database security infrastructure, auditing the creation, modification, and deletion of profiles is recommended." + remediation: "AUDIT PROFILE;" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''PROFILE'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''PROFILE'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.5 Ensure the 'DATABASE LINK' Audit Option Is Enabled + - id: 24565 + title: "Ensure the 'DATABASE LINK' Audit Option Is Enabled." + description: "Enabling the audit option for the DATABASE LINK object causes all activities on database links to be audited." + rationale: "As the logging of user activities involving the creation or dropping of a DATABASE LINK can provide forensic evidence about a pattern of unauthorized activities, the audit capability should be enabled." + remediation: "AUDIT DATABASE LINK;" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''DATABASE LINK'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''DATABASE LINK'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.6 Ensure the 'PUBLIC DATABASE LINK' Audit Option Is Enabled + - id: 24566 + title: "Ensure the 'PUBLIC DATABASE LINK' Audit Option Is Enabled." + description: "The PUBLIC DATABASE LINK object allows for the creation of a public link for an application-based user to access the database for connections/session creation. Enabling the audit option causes all user activities involving the creation, alteration, or dropping of public links to be audited." + rationale: "As the logging of user activities involving the creation, alteration, or dropping of a PUBLIC DATABASE LINK can provide forensic evidence about a pattern of unauthorized activities, the audit capability should be enabled." + remediation: "AUDIT PUBLIC DATABASE LINK;" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''PUBLIC DATABASE LINK'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''PUBLIC DATABASE LINK'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.7 Ensure the 'PUBLIC SYNONYM' Audit Option Is Enabled + - id: 24567 + title: "Ensure the 'PUBLIC SYNONYM' Audit Option Is Enabled." + description: "The PUBLIC SYNONYM object allows for the creation of an alternate description of an object. Public synonyms are accessible by all users that have the appropriate privileges to the underlying object. Enabling the audit option causes all user activities involving the creation or dropping of public synonyms to be audited." + rationale: "As the logging of user activities involving the creation or dropping of a PUBLIC SYNONYM can provide forensic evidence about a pattern of unauthorized activities, the audit capability should be enabled." + remediation: "AUDIT PUBLIC SYNONYM;" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''PUBLIC SYNONYM'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''PUBLIC SYNONYM'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.8 Ensure the 'SYNONYM' Audit Option Is Enabled + - id: 24568 + title: "Ensure the 'SYNONYM' Audit Option Is Enabled." + description: "The SYNONYM operation allows for the creation of an alternative name for a database object such as a Java class schema object, materialized view, operator, package, procedure, sequence, stored function, table, view, user-defined object type, or even another synonym. This synonym puts a dependency on its target and is rendered invalid if the target object is changed/dropped. Enabling the audit option causes all user activities involving the creation or dropping of synonyms to be audited." + rationale: "As the logging of user activities involving the creation or dropping of a SYNONYM can provide forensic evidence about a pattern of suspect/unauthorized activities, the audit capability should be enabled." + remediation: "AUDIT SYNONYM;" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''SYNONYM'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''SYNONYM'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.9 Ensure the 'DIRECTORY' Audit Option Is Enabled + - id: 24569 + title: "Ensure the 'DIRECTORY' Audit Option Is Enabled." + description: "The DIRECTORY object allows for the creation of a directory object that specifies an alias for a directory on the server file system, where the external binary file LOBs (BFILEs)/ table data are located. Enabling this audit option causes all user activities involving the creation or dropping of a directory alias to be audited." + rationale: "As the logging of user activities involving the creation or dropping of a DIRECTORY can provide forensic evidence about a pattern of unauthorized activities, the audit capability should be enabled." + remediation: "AUDIT DIRECTORY;" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''DIRECTORY'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''DIRECTORY'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.10 Ensure the 'SELECT ANY DICTIONARY' Audit Option Is Enabled + - id: 24570 + title: "Ensure the 'SELECT ANY DICTIONARY' Audit Option Is Enabled." + description: "The SELECT ANY DICTIONARY capability allows the user to view the definitions of all schema objects in the database. Enabling the audit option causes all user activities involving this capability to be audited." + rationale: "As the logging of user activities involving the capability to access the description of all schema objects in the database can provide forensic evidence about a pattern of unauthorized activities, the audit capability should be enabled." + remediation: "AUDIT SELECT ANY DICTIONARY;" + compliance: + - cis: ["6.1.10"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''SELECT ANY DICTIONARY'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''SELECT ANY DICTIONARY'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.11 Ensure the 'GRANT ANY OBJECT PRIVILEGE' Audit Option Is Enabled + - id: 24571 + title: "Ensure the 'GRANT ANY OBJECT PRIVILEGE' Audit Option Is Enabled." + description: "GRANT ANY OBJECT PRIVILEGE allows the user to grant or revoke any object privilege, which includes privileges on tables, directories, mining models, etc. Enabling this audit option causes auditing of all uses of that privilege." + rationale: "Logging of privilege grants that can lead to the creation, alteration, or deletion of critical data, the modification of objects, object privilege propagation and other such activities can be critical to forensic investigations." + remediation: "AUDIT GRANT ANY OBJECT PRIVILEGE;" + compliance: + - cis: ["6.1.11"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''GRANT ANY OBJECT PRIVILEGE'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''GRANT ANY OBJECT PRIVILEGE'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.12 Ensure the 'GRANT ANY PRIVILEGE' Audit Option Is Enabled + - id: 24572 + title: "Ensure the 'GRANT ANY PRIVILEGE' Audit Option Is Enabled." + description: "GRANT ANY PRIVILEGE allows a user to grant any system privilege, including the most powerful privileges typically available only to administrators - to change the security infrastructure, to drop/add/modify users and more." + rationale: "Auditing the use of this privilege is part of a comprehensive auditing policy that can help in detecting issues and can be useful in forensics." + remediation: "AUDIT GRANT ANY PRIVILEGE;" + compliance: + - cis: ["6.1.12"] + - cis_csc: ["5.4", "6.2", "4.8", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''GRANT ANY PRIVILEGE'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''GRANT ANY PRIVILEGE'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.13 Ensure the 'DROP ANY PROCEDURE' Audit Option Is Enabled + - id: 24573 + title: "Ensure the 'DROP ANY PROCEDURE' Audit Option Is Enabled." + description: "The AUDIT DROP ANY PROCEDURE command is auditing the dropping of procedures. Enabling the option causes auditing of all such activities." + rationale: "Dropping procedures of another user could be part of a privilege escalation exploit and should be audited." + remediation: "AUDIT DROP ANY PROCEDURE;" + compliance: + - cis: ["6.1.13"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''DROP ANY PROCEDURE'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''DROP ANY PROCEDURE'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.14 Ensure the 'ALL' Audit Option on 'SYS.AUD$' Is Enabled + - id: 24574 + title: "Ensure the 'ALL' Audit Option on 'SYS.AUD$' Is Enabled." + description: "The logging of attempts to alter the audit trail in the SYS.AUD$ table (open for read/update/delete/view) will provide a record of any activities that may indicate unauthorized attempts to access the audit trail. Enabling the audit option will cause these activities to be audited." + rationale: "As the logging of attempts to alter the SYS.AUD$ table can provide forensic evidence of the initiation of a pattern of unauthorized activities, this logging capability should be enabled." + remediation: "AUDIT ALL ON SYS.AUD$ BY ACCESS;" + compliance: + - cis: ["6.1.14"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT * FROM CDB_OBJ_AUDIT_OPTS WHERE OBJECT_NAME=''AUD$'' AND ALT=''A/A'' AND AUD=''A/A'' AND COM=''A/A'' AND DEL=''A/A'' AND GRA=''A/A'' AND IND=''A/A'' AND INS=''A/A'' AND LOC=''A/A'' AND REN=''A/A'' AND SEL=''A/A'' AND UPD=''A/A'' AND FBK=''A/A'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.15 Ensure the 'PROCEDURE' Audit Option Is Enabled + - id: 24575 + title: "Ensure the 'PROCEDURE' Audit Option Is Enabled." + description: "In this statement audit, PROCEDURE means any procedure, function, package or library. Enabling this audit option causes any attempt, successful or not, to create or drop any of these types of objects to be audited, regardless of privilege or lack thereof. Java schema objects (sources, classes, and resources) are considered the same as procedures for the purposes of auditing SQL statements." + rationale: "Any unauthorized attempts to create or drop a procedure in another's schema should cause concern, whether successful or not. Changes to critical stored code can dramatically change the behavior of the application and produce serious security consequences, including enabling privilege escalation and introducing SQL injection vulnerabilities. Audit records of such changes can be helpful in forensics." + remediation: "AUDIT PROCEDURE;" + compliance: + - cis: ["6.1.15"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''PROCEDURE'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''PROCEDURE'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.16 Ensure the 'ALTER SYSTEM' Audit Option Is Enabled + - id: 24576 + title: "Ensure the 'ALTER SYSTEM' Audit Option Is Enabled." + description: "ALTER SYSTEM allows one to change instance settings, including security settings and auditing options. Additionally, ALTER SYSTEM can be used to run operating system commands using undocumented Oracle functionality. Enabling the audit option will audit all attempts to perform ALTER SYSTEM, whether successful or not and regardless of whether or not the ALTER SYSTEM privilege is held by the user attempting the action." + rationale: "Any unauthorized attempt to alter the system should be cause for concern. Alterations outside of some specified maintenance window may be of concern. In forensics, these audit records could be quite useful." + remediation: "AUDIT ALTER SYSTEM;" + compliance: + - cis: ["6.1.16"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''ALTER SYSTEM'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''ALTER SYSTEM'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.17 Ensure the 'TRIGGER' Audit Option Is Enabled + - id: 24577 + title: "Ensure the 'TRIGGER' Audit Option Is Enabled." + description: "A TRIGGER may be used to modify DML actions or invoke other (recursive) actions when some types of user-initiated actions occur. Enabling this audit option will cause auditing of any attempt, successful or not, to create, drop, enable or disable any schema trigger in any schema regardless of privilege or lack thereof. For enabling and disabling a trigger, it covers both ALTER TRIGGER and ALTER TABLE." + rationale: "Triggers are often part of schema security, data validation and other critical constraints upon actions and data. A trigger in another schema may be used to escalate privileges, redirect operations, transform data and perform other sorts of perhaps undesired actions. Any unauthorized attempt to create, drop or alter a trigger in another schema may be cause for investigation." + remediation: "AUDIT TRIGGER;" + compliance: + - cis: ["6.1.17"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''TRIGGER'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''TRIGGER'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.1.18 Ensure the 'CREATE SESSION' Audit Option Is Enabled + - id: 24578 + title: "Ensure the 'CREATE SESSION' Audit Option Is Enabled." + description: "Enabling this audit option will cause auditing of all attempts to connect to the database, whether successful or not, as well as audit session disconnects/logoffs. The commands to audit SESSION, CONNECT or CREATE SESSION all accomplish the same thing - they initiate statement auditing of the connect statement used to create a database session." + rationale: "Auditing attempts to connect to the database is basic and mandated by most security initiatives. Any attempt to logon to a locked account, failed attempts to logon to default accounts or an unusually high number of failed logon attempts of any sort, for any user, in a particular time period may indicate an intrusion attempt. In forensics, the logon record may be first in a chain of evidence and contain information found in no other type of audit record for the session. Logon and logoff in the audit trail define the period and duration of the session." + remediation: "AUDIT SESSION;" + compliance: + - cis: ["6.1.18"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE FROM DBA_STMT_AUDIT_OPTS WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''CREATE SESSION'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"SELECT AUDIT_OPTION,SUCCESS,FAILURE, DECODE (A.CON_ID, 0,(SELECT NAME FROM V\\"\$DATABASE"), 1,(SELECT NAME FROM V\\"\$DATABASE"), (SELECT NAME FROM V\\"\$PDBS" B WHERE A.CON_ID = B.CON_ID)) FROM CDB_STMT_AUDIT_OPTS A WHERE USER_NAME IS NULL AND PROXY_NAME IS NULL AND SUCCESS = ''BY ACCESS'' AND FAILURE = ''BY ACCESS'' AND AUDIT_OPTION=''CREATE SESSION'';\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + ############################################### + # 6.2 Unified Auditing + ############################################### + # 6.2.1 Ensure the 'CREATE USER' Action Audit Is Enabled + - id: 24579 + title: "Ensure the 'CREATE USER' Action Audit Is Enabled." + description: "The CREATE USER statement is used to create Oracle database accounts and assign database properties to them. Enabling this unified action audit causes logging of all CREATE USER statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to create user accounts, whether successful or unsuccessful, may provide clues and forensic evidences about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all activities involving CREATE USER." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS CREATE USER;" + compliance: + - cis: ["6.2.1"] + - cis_csc: ["6.2", "16", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''CREATE USER'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''CREATE USER'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL ;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.2 Ensure the 'ALTER USER' Action Audit Is Enabled + - id: 24580 + title: "Ensure the 'ALTER USER' Action Audit Is Enabled." + description: "The ALTER USER statement is used to change database users’ password, lock accounts, and expire passwords. In addition, this statement is used to change database properties of user accounts such as database profiles, default and temporary tablespaces, and tablespace quotas. This unified audit action enables logging of all ALTER USER statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to alter user accounts, whether successful or unsuccessful, may provide clues and forensic evidences about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all activities involving ALTER USER." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS ALTER USER;" + compliance: + - cis: ["6.2.2"] + - cis_csc: ["6.2", "16", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''ALTER USER'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''ALTER USER'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.3 Ensure the 'DROP USER' Audit Option Is Enabled + - id: 24581 + title: "Ensure the 'DROP USER' Audit Option Is Enabled." + description: "The DROP USER statement is used to drop Oracle database accounts and schemas associated with them. Enabling this unified action audit enables logging of all DROP USER statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to drop user, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all activities involving DROP USER." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS DROP USER;" + compliance: + - cis: ["6.2.3"] + - cis_csc: ["6.2", "16", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''DROP USER'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''DROP USER'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.4 Ensure the 'CREATE ROLE' Action Audit Is Enabled + - id: 24582 + title: "Ensure the 'CREATE ROLE' Action Audit Is Enabled." + description: "An Oracle database role is a collection or set of privileges that can be granted to users or other roles. Roles may include system privileges, object privileges or other roles. Enabling this unified audit action enables logging of all CREATE ROLE statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to create roles, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving CREATE ROLE." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS CREATE ROLE;" + compliance: + - cis: ["6.2.4"] + - cis_csc: ["6.2", "16", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''CREATE ROLE'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''CREATE ROLE'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.5 Ensure the 'ALTER ROLE' Action Audit Is Enabled + - id: 24583 + title: "Ensure the 'ALTER ROLE' Action Audit Is Enabled." + description: "An Oracle database role is a collection or set of privileges that can be granted to users or other roles. Roles may include system privileges, object privileges or other roles. The ALTER ROLE statement is used to change the authorization needed to enable a role. Enabling this unified action audit causes logging of all ALTER ROLE statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to alter roles, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving alteration of roles." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS ALTER ROLE;" + compliance: + - cis: ["6.2.5"] + - cis_csc: ["6.2", "16", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''ALTER ROLE'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''ALTER ROLE'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.6 Ensure the 'DROP ROLE' Action Audit Is Enabled + - id: 24584 + title: "Ensure the 'DROP ROLE' Action Audit Is Enabled." + description: "An Oracle database role is a collection or set of privileges that can be granted to users or other roles. Roles may include system privileges, object privileges or other roles. Enabling this unified audit action enables logging of all DROP ROLE statements, successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to drop roles, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving DROP ROLE." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS DROP ROLE;" + compliance: + - cis: ["6.2.6"] + - cis_csc: ["6.2", "16", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''DROP ROLE'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''DROP ROLE'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.7 Ensure the 'GRANT' Action Audit Is Enabled + - id: 24585 + title: "Ensure the 'GRANT' Action Audit Is Enabled." + description: "GRANT statements are used to grant privileges to Oracle database users and roles, including the most powerful privileges and roles typically available to the database administrators. Enabling this unified action audit enables logging of all GRANT statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "With unauthorized grants and permissions, a malicious user may be able to change the security of the database, access/update confidential data, or compromise the integrity of the database. Logging and monitoring of all attempts to grant system privileges, object privileges or roles, whether successful or unsuccessful, may provide forensic evidence about potential suspicious/unauthorized activities as well as privilege escalation activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving GRANT." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS GRANT;" + compliance: + - cis: ["6.2.7"] + - cis_csc: ["6.2", "16", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''GRANT'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''GRANT'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.8 Ensure the 'REVOKE' Action Audit Is Enabled + - id: 24586 + title: "Ensure the 'REVOKE' Action Audit Is Enabled." + description: "REVOKE statements are used to revoke privileges from Oracle database users and roles. Enabling this unified action audit enables logging of all REVOKE statements, successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to revoke system privileges, object privileges or roles, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving REVOKE." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS REVOKE;" + compliance: + - cis: ["6.2.8"] + - cis_csc: ["6.2", "16", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''REVOKE'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''REVOKE'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.9 Ensure the 'CREATE PROFILE' Action Audit Is Enabled + - id: 24587 + title: "Ensure the 'CREATE PROFILE' Action Audit Is Enabled." + description: "Oracle database profiles are used to enforce resource usage limits and implement password policies such as password complexity rules and reuse restrictions. Enabling this unified action audit enables logging of all CREATE PROFILE statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to create profiles, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving creation of database profiles." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS CREATE PROFILE;" + compliance: + - cis: ["6.2.9"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''CREATE PROFILE'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''CREATE PROFILE'') AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.10 Ensure the 'ALTER PROFILE' Action Audit Is Enabled + - id: 24588 + title: "Ensure the 'ALTER PROFILE' Action Audit Is Enabled." + description: "Oracle database profiles are used to enforce resource usage limits and implement password policies such as password complexity rules and reuse restrictions. Enabling this unified action audit enables logging of all ALTER PROFILE statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to alter profiles, whether successful or unsuccessful, may provide forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving alteration of database profiles." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS ALTER PROFILE;" + compliance: + - cis: ["6.2.10"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''ALTER PROFILE'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''ALTER PROFILE'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.11 Ensure the 'DROP PROFILE' Action Audit Is Enabled + - id: 24589 + title: "Ensure the 'DROP PROFILE' Action Audit Is Enabled ." + description: "Oracle database profiles are used to enforce resource usage limits and implement password policies such as password complexity rules and reuse restrictions. Enabling this unified action audit enables logging of all DROP PROFILE statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to drop profiles, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving dropping database profiles." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS DROP PROFILE;" + compliance: + - cis: ["6.2.11"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''DROP PROFILE'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''DROP PROFILE'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.12 Ensure the 'CREATE DATABASE LINK' Action Audit Is Enabled + - id: 24590 + title: "Ensure the 'CREATE DATABASE LINK' Action Audit Is Enabled." + description: "Oracle database links are used to establish database-to-database connections to other databases. These connections are available without further authentication once the link is established. Enabling this unified action audit causes logging of all CREATE DATABASE and CREATE PUBLIC DATABASE statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to create database links, whether successful or unsuccessful, may provide forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving creation of database links." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS CREATE DATABASE LINK;" + compliance: + - cis: ["6.2.12"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''CREATE DATABASE LINK'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''CREATE DATABASE LINK'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.13 Ensure the 'ALTER DATABASE LINK' Action Audit Is Enabled + - id: 24591 + title: "Ensure the 'ALTER DATABASE LINK' Action Audit Is Enabled." + description: "Oracle database links are used to establish database-to-database connections to other databases. These connections are always available without further authentication once the link is established. Enabling this unified action audit causes logging of all ALTER DATABASE and ALTER PUBLIC DATABASE statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to alter database links, whether successful or unsuccessful, may provide forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving alteration of database links." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS ALTER DATABASE LINK;" + compliance: + - cis: ["6.2.13"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''ALTER DATABASE LINK'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''ALTER DATABASE LINK'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.14 Ensure the 'DROP DATABASE LINK' Action Audit Is Enabled + - id: 24592 + title: "Ensure the 'DROP DATABASE LINK' Action Audit Is Enabled." + description: "Oracle database links are used to establish database-to-database connections to other databases. These connections are always available without further authentication once the link is established. Enabling this unified action audit causes logging of all DROP DATABASE and DROP PUBLIC DATABASE, whether successful or unsuccessful, statements issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to drop database links, whether successful or unsuccessful, may provide forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving dropping database links." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS DROP DATABASE LINK;" + compliance: + - cis: ["6.2.14"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS (SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''DROP DATABASE LINK'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''DROP DATABASE LINK'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.15 Ensure the 'CREATE SYNONYM' Action Audit Is Enabled + - id: 24593 + title: "Ensure the 'CREATE SYNONYM' Action Audit Is Enabled." + description: "An Oracle database synonym is used to create an alternative name for a database object such as table, view, procedure, java object or even another synonym, etc. Enabling this unified action audit causes logging of all CREATE SYNONYM and CREATE PUBLIC SYNONYM statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to create synonyms, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving creation of synonyms or public synonyms." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS CREATE SYNONYM;" + compliance: + - cis: ["6.2.15"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY( ''CREATE SYNONYM'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''CREATE SYNONYM'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.16 Ensure the 'ALTER SYNONYM' Action Audit Is Enabled + - id: 24594 + title: "Ensure the 'ALTER SYNONYM' Action Audit Is Enabled." + description: "An Oracle database synonym is used to create an alternative name for a database object such as table, view, procedure, or java object, or even another synonym. Enabling this unified action audit causes logging of all ALTER SYNONYM and ALTER PUBLIC SYNONYM statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to alter synonyms, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving alteration of synonyms or public synonyms." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS ALTER SYNONYM;" + compliance: + - cis: ["6.2.16"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY(''ALTER SYNONYM'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''ALTER SYNONYM'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.17 Ensure the 'DROP SYNONYM' Action Audit Is Enabled + - id: 24595 + title: "Ensure the 'DROP SYNONYM' Action Audit Is Enabled." + description: "An Oracle database synonym is used to create an alternative name for a database object such as table, view, procedure, or java object, or even another synonym. Enabling his unified action audit causes logging of all DROP SYNONYM and DROP PUBLIC SYNONYM statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to drop synonyms, whether successful or unsuccessful, may provide forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving dropping of synonyms or public synonyms." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS DROP SYNONYM;" + compliance: + - cis: ["6.2.17"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY( ''DROP SYNONYM'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''DROP SYNONYM'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.18 Ensure the 'SELECT ANY DICTIONARY' Privilege Audit Is Enabled + - id: 24596 + title: "Ensure the 'SELECT ANY DICTIONARY' Privilege Audit Is Enabled." + description: "The SELECT ANY DICTIONARY system privilege allows the user to view the definition of all schema objects in the database. It grants SELECT privileges on the data dictionary objects to the grantees, including SELECT on DBA_ views, V$ views, X$ views and underlying SYS tables such as TAB$ and OBJ$. This privilege also allows grantees to create stored objects such as procedures, packages and views on the underlying data dictionary objects. Please note that this privilege does not grant SELECT on tables with password hashes such as USER$, DEFAULT_PWD$, LINK$, and USER_HISTORY$. Enabling this audit causes logging of activities that exercise this privilege." + rationale: "Logging and monitoring of all attempts to access a data dictionary, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving access to the database." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD PRIVILEGES SELECT ANY DICTIONARY;" + compliance: + - cis: ["6.2.18"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY( ''SELECT ANY DICTIONARY'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''SELECT ANY DICTIONARY'' ) AND AUD.AUDIT_OPTION_TYPE = ''SYSTEM PRIVILEGE'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL ;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.19 Ensure the 'AUDSYS.AUD$UNIFIED' Access Audit Is Enabled + - id: 24597 + title: "Ensure the 'AUDSYS.AUD$UNIFIED' Access Audit Is Enabled." + description: "The AUDSYS.AUD$UNIFIED holds audit trail records generated by the database. Enabling this audit action causes logging of all access attempts to the AUDSYS.AUD$UNIFIED, whether successful or unsuccessful, regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to access the AUDSYS.AUD$UNIFIED, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving access to this table." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS ALL on AUDSYS.AUD$UNIFIED;" + compliance: + - cis: ["6.2.19"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY( ''AUD$UNIFIED'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT OBJECT_NAME FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''ALL'' ) AND AUD.AUDIT_OPTION_TYPE = ''OBJECT ACTION'' AND AUD.OBJECT_SCHEMA = ''AUDSYS'' AND AUD.OBJECT_NAME = ''AUD$UNIFIED'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.OBJECT_NAME WHERE E.OBJECT_NAME IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.20 Ensure the 'CREATE PROCEDURE/FUNCTION/PACKAGE/PACKAGE BODY' Action Audit Is Enabled + - id: 24598 + title: "Ensure the 'CREATE PROCEDURE/FUNCTION/PACKAGE/PACKAGE BODY' Action Audit Is Enabled." + description: "Oracle database procedures, function, packages, and package bodies, which are stored within the database, are created to perform business functions and access database as defined by PL/SQL code and SQL statements contained within these objects. Enabling this unified action audit causes logging of all CREATE PROCEDURE, CREATE FUNCTION, CREATE PACKAGE and CREATE PACKAGE BODY statements, successful or unsuccessful, statements issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to create procedures, functions, packages or package bodies, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving creation of procedures, functions, packages or package bodies." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS CREATE PROCEDURE, CREATE FUNCTION, CREATE PACKAGE, CREATE PACKAGE BODY;" + compliance: + - cis: ["6.2.20"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY( ''CREATE PROCEDURE'',''CREATE FUNCTION'',''CREATE PACKAGE'',''CREATE PACKAGE BODY'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''CREATE PROCEDURE'',''CREATE FUNCTION'',''CREATE PACKAGE'',''CREATE PACKAGE BODY'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.21 Ensure the 'ALTER PROCEDURE/FUNCTION/PACKAGE/PACKAGE BODY' Action Audit Is Enabled + - id: 24599 + title: "Ensure the 'ALTER PROCEDURE/FUNCTION/PACKAGE/PACKAGE BODY' Action Audit Is Enabled." + description: "Oracle database procedures, functions, packages, and package bodies, which are stored within the database, are created to carry out business functions and access database as defined by PL/SQL code and SQL statements contained within these objects. Enabling this unified action audit causes logging of all ALTER PROCEDURE, ALTER FUNCTION, ALTER PACKAGE and ALTER PACKAGE BODY statements, successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Unauthorized alteration of procedures, functions, packages or package bodies may impact critical business functions or compromise integrity of the database. Logging and monitoring of all attempts, whether successful or unsuccessful, to alter procedures, functions, packages or package bodies may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving alteration of procedures, functions, packages or package bodies." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS ALTER PROCEDURE, ALTER FUNCTION, ALTER PACKAGE, ALTER PACKAGE BODY;" + compliance: + - cis: ["6.2.21"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY( ''ALTER PROCEDURE'',''ALTER FUNCTION'',''ALTER PACKAGE'',''ALTER PACKAGE BODY'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''ALTER PROCEDURE'',''ALTER FUNCTION'',''ALTER PACKAGE'',''ALTER PACKAGE BODY'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.22 Ensure the 'DROP PROCEDURE/FUNCTION/PACKAGE/PACKAGE BODY' Action Audit Is Enabled + - id: 24600 + title: "Ensure the 'DROP PROCEDURE/FUNCTION/PACKAGE/PACKAGE BODY' Action Audit Is Enabled." + description: "Oracle database procedures, functions, packages, and package bodies, which are stored within the database, are created to carry out business functions and access database as defined by PL/SQL code and SQL statements contained within these objects. Enabling this unified action audit causes logging of all DROP PROCEDURE, DROP FUNCTION, DROP PACKAGE or DROP PACKAGE BODY statements, successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts, whether successful or unsuccessful, to drop procedures, functions, packages or package bodies may provide forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving dropping procedures, functions, packages or package bodies." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS DROP PROCEDURE, DROP FUNCTION, DROP PACKAGE, DROP PACKAGE BODY;" + compliance: + - cis: ["6.2.22"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS (SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY( ''DROP PROCEDURE'',''DROP FUNCTION'',''DROP PACKAGE'',''DROP PACKAGE BODY'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''DROP PROCEDURE'',''DROP FUNCTION'',''DROP PACKAGE'',''DROP PACKAGE BODY'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.23 Ensure the 'ALTER SYSTEM' Privilege Audit Is Enabled + - id: 24601 + title: "Ensure the 'ALTER SYSTEM' Privilege Audit Is Enabled." + description: "The ALTER SYSTEM privilege allows the user to change instance settings which could impact security posture, performance or normal operation of the database. Additionally, the ALTER SYSTEM privilege may be used to run operating system commands using undocumented Oracle functionality. Enabling this unified audit causes logging of activities that involve exercise of this privilege, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to execute ALTER SYSTEM statements, whether successful or unsuccessful, may provide forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities that involve ALTER SYSTEM statements." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS ALTER SYSTEM;" + compliance: + - cis: ["6.2.23"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY( ''ALTER SYSTEM'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''ALTER SYSTEM'' ) AND AUD.AUDIT_OPTION_TYPE = ''SYSTEM PRIVILEGE'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.24 Ensure the 'CREATE TRIGGER' Action Audit Is Enabled + - id: 24602 + title: "Ensure the 'CREATE TRIGGER' Action Audit Is Enabled." + description: "Oracle database triggers are executed automatically when specified conditions on the underlying objects occur. Trigger bodies contain the code, quite often to perform data validation, ensure data integrity/security or enforce critical constraints on allowable actions on data. Enabling this unified audit causes logging of all CREATE TRIGGER statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to create triggers, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving creation of triggers." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS CREATE TRIGGER;" + compliance: + - cis: ["6.2.24"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY( ''CREATE TRIGGER'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''CREATE TRIGGER'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.25 Ensure the 'ALTER TRIGGER' Action Audit IS Enabled + - id: 24603 + title: "Ensure the 'ALTER TRIGGER' Action Audit IS Enabled." + description: "Oracle database triggers are executed automatically when specified conditions on the underlying objects occur. Trigger bodies contain the code, quite often to perform data validation, ensure data integrity/security or enforce critical constraints on allowable actions on data. Enabling this unified audit causes logging of all ALTER TRIGGER statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Unauthorized alteration of triggers may impact critical business functions or compromise integrity/security of the database. Logging and monitoring of all attempts to alter triggers, whether successful or unsuccessful, may provide clues and forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving alteration of triggers." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS ALTER TRIGGER;" + compliance: + - cis: ["6.2.25"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY( ''ALTER TRIGGER'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''ALTER TRIGGER'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.26 Ensure the 'DROP TRIGGER' Action Audit Is Enabled + - id: 24604 + title: "Ensure the 'DROP TRIGGER' Action Audit Is Enabled." + description: "Oracle database triggers are executed automatically when specified conditions on the underlying objects occur. Trigger bodies contain the code, quite often to perform data validation, ensure data integrity/security or enforce critical constraints on allowable actions on data. Enabling this unified audit causes logging of all DROP TRIGGER statements, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to issue such statements." + rationale: "Logging and monitoring of all attempts to drop triggers, whether successful or unsuccessful, may provide forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving dropping triggers." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS DROP TRIGGER;" + compliance: + - cis: ["6.2.26"] + - cis_csc: ["6.2", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY( ''DROP TRIGGER'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''DROP TRIGGER'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' + + # 6.2.27 Ensure the 'LOGON' AND 'LOGOFF' Actions Audit Is Enabled + - id: 24605 + title: "Ensure the 'LOGON' AND 'LOGOFF' Actions Audit Is Enabled." + description: "Oracle database users log on to the database to perform their work. Enabling this unified audit causes logging of all LOGON actions, whether successful or unsuccessful, issued by the users regardless of the privileges held by the users to log into the database. In addition, LOGOFF action audit captures logoff activities. This audit action also captures logon/logoff to the open database by SYSDBA and SYSOPER." + rationale: "Logging and monitoring of all attempts to logon to the database, whether successful or unsuccessful, may provide forensic evidence about potential suspicious/unauthorized activities. Any such activities may be a cause for further investigation. In addition, organization security policies and industry/government regulations may require logging of all user activities involving LOGON and LOGOFF." + remediation: "ALTER AUDIT POLICY CIS_UNIFIED_AUDIT_POLICY ADD ACTIONS LOGON, LOGOFF;" + compliance: + - cis: ["6.2.27"] + - cis_csc: ["6.2", "16", "6.3"] + condition: any + rules: + - 'c:sudo -u oracle bash -c ". ~/.bash_profile; echo \"WITH CIS_AUDIT(AUDIT_OPTION) AS ( SELECT * FROM TABLE( DBMSOUTPUT_LINESARRAY( ''LOGON'',''LOGOFF'' ) ) ), AUDIT_ENABLED AS ( SELECT DISTINCT AUDIT_OPTION FROM AUDIT_UNIFIED_POLICIES AUD WHERE AUD.AUDIT_OPTION IN (''LOGON'',''LOGOFF'' ) AND AUD.AUDIT_OPTION_TYPE = ''STANDARD ACTION'' AND EXISTS (SELECT * FROM AUDIT_UNIFIED_ENABLED_POLICIES ENABLED WHERE ENABLED.SUCCESS = ''YES'' AND ENABLED.FAILURE = ''YES'' AND ENABLED.ENABLED_OPTION = ''BY USER'' AND ENABLED.ENTITY_NAME = ''ALL USERS'' AND ENABLED.POLICY_NAME = AUD.POLICY_NAME) ) SELECT C.AUDIT_OPTION FROM CIS_AUDIT C LEFT JOIN AUDIT_ENABLED E ON C.AUDIT_OPTION = E.AUDIT_OPTION WHERE E.AUDIT_OPTION IS NULL;\" | sqlplus / as sysdba | grep \"no rows selected\"" -> no rows selected' diff --git a/etc/ruleset/sca/rhel/5/cis_rhel5_linux.yml b/etc/ruleset/sca/rhel/5/cis_rhel5_linux.yml new file mode 100644 index 0000000000..f3e41d1915 --- /dev/null +++ b/etc/ruleset/sca/rhel/5/cis_rhel5_linux.yml @@ -0,0 +1,1047 @@ +# Security Configuration Assessment +# CIS Checks for RHEL 5 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for Red Hat Enterprise Linux 5 v2.2.0 - 03-02-2015 + +policy: + id: "cis_rhel5_linux" + file: "cis_rhel5_linux.yml" + name: "CIS Red Hat Enterprise Linux 5 Benchmark v2.2.0" + description: "This document, Security Configuration Benchmark for Red Hat Enterprise Linux 5 provides prescriptive guidance for establishing a secure configuration posture for Red Hat Enterprise Linux (RHEL) versions 5.0 - 5.11 running on x86 platforms." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check RHEL5 version" + description: "Requirements for running the SCA scan against RHEL 5 family." + condition: any + rules: + - "f:/etc/redhat-release -> r:^Red Hat Enterprise Linux && r:release 5" + - "f:/etc/redhat-release -> r:^CentOS && r:release 5" + - "f:/etc/redhat-release -> r:^Cloud && r:release 5" + - "f:/etc/redhat-release -> r:^Oracle && r:release 5" + - "f:/etc/redhat-release -> r:^Better && r:release 5" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # 1.1.1 /tmp: partition + - id: 3500 + title: "Create Separate Partition for /tmp" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code." + remediation: "For new installations, check the box to 'Review and modify partitioning' and create a separate partition for /tmp . For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["1.1.1"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + - CCE-14161-4 + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + # 1.1.2 /tmp: nodev + - id: 3501 + title: "Set nodev option for /tmp Partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-14412-1 + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + # 1.1.3 /tmp: nosuid + - id: 3502 + title: "Set nosuid option for /tmp Partition" + description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp ." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options)." + compliance: + - cis: ["1.1.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-14940-1 + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + # 1.1.4 /tmp: noexec + - id: 3503 + title: "Set noexec option for /tmp Partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp ." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options). # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-14412-1 + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + # 1.1.5 Build considerations - Partition scheme. + - id: 3504 + title: "Create Separate Partition for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, check the box to 'Review and modify partitioning' and create a separate partition for /var. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["1.1.5"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + - CCE-14777-7 + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + # 1.1.6 bind mount /var/tmp to /tmp + - id: 3505 + title: "Bind Mount the /var/tmp directory to /tmp" + description: "The /var/tmp directory is normally a standalone directory in the /var file system. Binding /var/tmp to /tmp establishes an unbreakable link to /tmp that cannot be removed (even by the root user). It also allows /var/tmp to inherit the same mount options that /tmp owns, allowing /var/tmp to be protected in the same /tmp is protected." + rationale: "All programs that use /var/tmp and /tmp to read/write temporary files will always be written to the /tmp file system, preventing a user from running the /var file system out of space or trying to perform operations that have been blocked in the /tmp filesystem." + remediation: "# mount --bind /tmp /var/tmp and edit the /etc/fstab file to contain the following line: /tmp /var/tmp none bind 0 0" + compliance: + - cis: ["1.1.6"] + references: + - CCE-14584-7 + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + # 1.1.7 /var/log: partition + - id: 3506 + title: "Create Separate Partition for /var/log" + description: "The /var/log directory is used by system services to store log data ." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, check the box to 'Review and modify partitioning' and create a separate partition for /var/log. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["1.1.7"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + - CCE-14011-1 + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + # 1.1.8 /var/log/audit: partition + - id: 3507 + title: "Create Separate Partition for /var/log/audit" + description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data." + remediation: "For new installations, check the box to 'Review and modify partitioning' and create a separate partition for /var/log/audit . For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["1.1.8"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + - CCE-14171-3 + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + # 1.1.9 /home: partition + - id: 3508 + title: "Create Separate Partition for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, check the box to 'Review and modify partitioning' and create a separate partition for /home. For systems that were previously installed, use the Logical Volume Manager (LVM) to create partitions." + compliance: + - cis: ["1.1.9"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + - CCE-14559-9 + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + # 1.1.10 /home: nodev + - id: 3509 + title: "Add nodev Option to /home" + description: "When set on a file system, this option prevents character and block special devices from being defined, or if they exist, from being used as character and block special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options). # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.10"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-4249-9 + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + # 1.1.14 /dev/shm: nodev + - id: 3510 + title: "Add nodev Option to /dev/shm Partition" + description: "The nodev mount option specifies that the /dev/shm (temporary filesystem stored in memory) cannot contain block or character special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options of entries that have mount points that contain /dev/shm). # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-15007-8 + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + # 1.1.15 /dev/shm: nosuid + - id: 3511 + title: "Add nosuid Option to /dev/shm Partition" + description: "The nosuid mount option specifies that the /dev/shm (temporary filesystem stored in memory) will not execute setuid and setgid on executable programs as such, but rather execute them with the uid and gid of the user executing the program." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options). Look for entries that have mount points that contain /dev/shm. # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-14306-5 + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + # 1.1.16 /dev/shm: noexec + - id: 3512 + title: "Add noexec Option to /dev/shm Partition" + description: "Set noexec on the shared memory partition to prevent programs from executing from there." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options). Look for entries that have mount points that contain /dev/shm. # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-14927-8 + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + ########################################## + # 1.2 Software Updates + ########################################## + # 1.2.5 Disable yum-updatesd (Scored) + - id: 3513 + title: "Disable yum-updatesd" + description: "The yum-updatesd utility provides notification of updates that are available for your system." + rationale: "The yum-updatesd service may introduce unnecessary overhead and prevent other programs from running. When possible, replace this service with a cron job that calls yum directly." + remediation: "Disable the yum-updatesd daemon by running the following command: # chkconfig yum-updatesd off" + compliance: + - cis: ["1.2.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2"] + - tsc: ["A1.2", "CC6.8"] + references: + - CCE-4218-4 + condition: none + rules: + - "c:/sbin/chkconfig --list -> r:yum-updatesd && r::on" + + ############################################### + # 1.4 Configure SELinux + ############################################### + # 1.4.1 enable selinux in /etc/grub.conf + - id: 3514 + title: "Enable SELinux in /etc/grub.conf" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters" + rationale: "SELinux must be enabled at boot time in /etc/grub.conf to ensure that the controls it provides are not overwritten." + remediation: "Remove all instances of selinux=0 and enforcing=0 from /etc/grub.conf." + compliance: + - cis: ["1.4.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-3977-6 + condition: none + rules: + - "f:/boot/grub/grub.conf -> r:selinux=0|enforcing=0" + + # 1.4.2 Set selinux state + - id: 3515 + title: "Set the SELinux State" + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing" + compliance: + - cis: ["1.4.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-3999-0 + condition: all + rules: + - "f:/etc/selinux/config -> r:^SELINUX=enforcing$" + + # 1.4.3 Set seliux policy + - id: 3516 + title: "Set the SELinux Policy" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + compliance: + - cis: ["1.4.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-3624-4 + condition: all + rules: + - "f:/etc/selinux/config -> r:^SELINUXTYPE=targeted$" + + # 1.4.4 Remove SETroubleshoot + - id: 3517 + title: "Remove SETroubleshoot" + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "rpm -qa setroubleshoot" + compliance: + - cis: ["1.4.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:/sbin/chkconfig --list -> r:setroubleshoot && r::on" + + # 1.4.5 Disable MCS Translation service mcstrans + - id: 3518 + title: "Disable MCS Translation Service (mcstrans)" + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" + rationale: "Since this service is not used very often, disable it to reduce the amount of potentially vulnerable code running on the system." + remediation: "# chkconfig mctrans off" + compliance: + - cis: ["1.4.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-3668-1 + condition: none + rules: + - "c:/sbin/chkconfig --list -> r:mctrans && r::on" + + ############################################### + # 1.5 Secure Boot Settings + ############################################### + # 1.5.3 Set Boot Loader Password (Scored) + - id: 3519 + title: "Set Boot Loader Password" + description: "Setting the boot loader password will require that the person who is rebooting system the must enter a password before being able to set command line boot parameters" + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: "Set a bootloader password" + compliance: + - cis: ["1.5.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-3818-2 + condition: all + rules: + - "f:/boot/grub/grub.conf -> !r:^# && r:password --md5" + + # 1.5.4 Require Authentication for Single-User Mode (Scored) + - id: 3520 + title: "Require Authentication for Single-User Mode" + description: "Since /etc/init determines what run state the system is in, setting the entry in /etc/inittab will force single user authentication." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Add the following to /etc/inittab : ~:S:wait:/sbin/sulogin" + compliance: + - cis: ["1.5.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-4241-6 + condition: none + rules: + - "f:/etc/inittab -> r:^~:S:wait:/sbin/sulogin" + + # 1.5.5 Disable Interactive Boot (Scored) + - id: 3521 + title: "Disable Interactive Boot" + description: "The PROMPT option provides console users the ability to interactively boot the system and select which services to start on boot ." + rationale: "Turn off the PROMPT option on the console to prevent console users from potentially overriding established security settings." + remediation: "Set the PROMPT parameter in /etc/sysconfig/init to no ." + compliance: + - cis: ["1.5.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-4245-7 + condition: all + rules: + - "f:/etc/sysconfig/init -> r:^PROMPT=no$" + + ############################################### + # 1.6 Additional Process Hardening + ############################################### + # 1.6.1 Restrict Core Dumps (Scored) + - id: 3522 + title: "Restrict Core Dumps" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid.dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf file. * hard core 0. Add the following line to the /etc/sysctl.conf file. fs.suid_dumpable = 0" + compliance: + - cis: ["1.6.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + - 'c:/sbin/sysctl fs.suid_dumpable -> r:^fs.suid_dumpable\s*=\s*0\s*$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + + # 1.6.3 Enable Randomized Virtual Memory Region Placement (Scored) + - id: 3523 + title: "Enable Randomized Virtual Memory Region Placement" + description: "Set the system flag to force randomized virtual memory region placement." + rationale: "Randomly placing virtual memory regions will make it difficult for to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Add the following line to the /etc/sysctl.conf file. kernel.randomize_va_space = 2" + compliance: + - cis: ["1.6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-4146-7 + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'c:/sbin/sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + + # 1.6.2 Configure ExecShield (Scored) + - id: 3524 + title: "Configure ExecShield" + description: "Execshield is made up of a number of kernel features to provide protection against buffer overflow attacks. These features include prevention of execution in memory data space, and special handling of text buffers." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "Add the following line to the /etc/sysctl.conf file. kernel.exec-shield = 1" + compliance: + - cis: ["1.6.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-4168-1 + condition: all + rules: + - 'c:/sbin/sysctl kernel.exec-shield -> r:\s1$' + + # 1.6.4 Enable XD/NX Support on 32-bit x86 Systems (Scored) + # TODO + # 1.6.5 Disable Prelink (Scored) + - id: 3525 + title: "Disable Prelink" + description: "Prelinking is a performance enhancing feature that decreases process start up time. It loads shared libraries into addresses for which the linking of required symbols has already been performed. After a binary has been prelinked, the addresses at which shared libraries is not changed, even if kernel.randomize_va_space is set to 1." + rationale: "There is a bug in prelink that interferes with AIDE, the Linux file integrity checker. This has been fixed in RHEL6 (so prelink does not need to be disabled in RHEL6 systems)." + remediation: "Edit /etc/sysconfig/prelink and set PRELINKING=no" + compliance: + - cis: ["1.6.5"] + condition: all + rules: + - "f:/etc/sysconfig/prelink -> r:^PRELINKING=no$" + + ############################################### + # 2 OS Services + ############################################### + ############################################### + # 2.1 Remove Legacy Services + ############################################### + # 2.1.1 Remove telnet-server (Scored) + - id: 3526 + title: "Remove telnet-server" + description: "The telnet-server package contains the telnetd daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Red Hat Linux distributions." + remediation: "# yum erase telnet-server" + compliance: + - cis: ["2.1.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + references: + - CCE-3390-2 + - CCE-4330-7 + condition: none + rules: + - "c:rpm -qa telnet-server -> r:telnet-server" + + # Remove rsh-server (Scored) + - id: 3527 + title: "Remove rsh-server" + description: "The Berkeley rsh-server ( rsh , rlogin , rcp ) package contains legacy services that exchange credentials in clear-text." + rationale: "These legacy service contain numerous security exposures and have been replaced with the more secure SSH package." + remediation: "# yum erase rsh-server" + compliance: + - cis: ["2.1.3"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + references: + - CCE-4308-3 + condition: none + rules: + - "c:rpm -qa rsh-server -> r:rsh-server" + + - id: 3528 + title: "Remove NIS Client" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client (ypbind) was used to bind a machine to an NIS server and receive the distributed configuration files" + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "# yum erase ypbind" + compliance: + - cis: ["2.1.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + references: + - CCE-3705-1 (disable) + - CCE-4348-9 (uninstall) + condition: none + rules: + - "c:rpm -qa ypbind -> r:ypbind" + + # 2.1.6 Remove NIS Server (Scored) + - id: 3529 + title: "Remove NIS Server" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used." + remediation: "# yum erase ypserv" + compliance: + - cis: ["2.1.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + references: + - CCE-3705-1 (disable) + - CCE-4348-9 (uninstall) + condition: none + rules: + - "c:rpm -qa ypserv -> r:ypserv" + + # 2.1.7 Remove tftp (Scored) + - id: 3530 + title: "Remove tftp-server" + description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package tftp-server is the server package used to define and support a TFTP server." + rationale: "TFTP does not support authentication nor does it ensure the confidentiality of integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." + remediation: "# yum erase tftp-server" + compliance: + - cis: ["2.1.8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + references: + - CCE-4273-9 (disable) + - CCE-3916-4 (uninstall) + condition: none + rules: + - "c:rpm -qa tftpd -> r:tftpd" + + # 2.1.9 Remove talk (Scored) + - id: 3531 + title: "Remove talk-server" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initialization of talk sessions) is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "# yum erase talk-server" + compliance: + - cis: ["2.1.10"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:rpm -qa talk-server -> r:talk-server" + + ############################################### + # 3 Special Purpose Services + ############################################### + # 3.2 Set Daemon umask (Scored) + - id: 3532 + title: "Set Daemon umask" + description: "Set the default umask for all processes started at boot time. The settings in umask selectively turn off default permission when a file is created by a daemon process." + rationale: "Setting the umask to 027 will make sure that files created by daemons will not be readable, writable or executable by any other than the group and owner of the daemon process and will not be writable by the group of the daemon process. The daemon process can manually override these settings if these files need additional permission." + remediation: "Add the following line to the /etc/sysconfig/init file. umask 027" + compliance: + - cis: ["3.2"] + condition: all + rules: + - "f:/etc/sysconfig/init -> umask 027" + + # 3.3 Remove X Windows (Scored) + - id: 3533 + title: "Remove X Windows" + description: "The X Windows system provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Edit /etc/inittab set default runlevel as follows: s/:5:/:3:/ Uninstall the X Windows System: # yum groupremove 'X Window System'" + compliance: + - cis: ["3.3"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'f:/etc/inittab -> r:^\s*id:3:initdefault' + - "not c:yum grouplist X?Window?System -> r:Installed Groups" + + # 3.1.1 Disable Avahi Server (Scored) + - id: 3534 + title: "Disable Avahi Server" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration." + rationale: "Since servers are not normally used for printing, this service is not needed unless dependencies require it. If this is the case, disable the service to reduce the potential attack surface. If for some reason the service is required on the server, follow the recommendations in sub-sections 3.2.1 - 3.2.5 to secure it." + remediation: "# chkconfig avahi-daemon off In addition, edit the /etc/sysconfig/network file and remove zeroconf." + compliance: + - cis: ["3.1.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:/sbin/chkconfig --list -> r:avahi-daemon && r::on" + + # 3.8 Disable NFS and RPC (Not Scored) + - id: 3535 + title: "Disable NFS and RPC" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the server does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "# chkconfig nfslock off; #chkconfig rpcgssd off; #chkconfig rpcidmapd off; # chkconfig portmap off;" + compliance: + - cis: ["3.8"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:/sbin/chkconfig --list -> r:nfslock|rpcgssd|rpcidmapd|portmap && r::on" + + # 3.10 Remove FTP Server (Not Scored) + - id: 3536 + title: "Remove FTP Server" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "# yum erase vsftpd" + compliance: + - cis: ["3.10"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:rpm -qa vsftpd -> r:vsftpd" + + # 3.11 Remove HTTP Server (Not Scored) + - id: 3537 + title: "Remove HTTP Server" + description: "HTTP or web servers provide the ability to host web site content. The default HTTP server shipped with Red Hat Linux is Apache." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "# yum erase httpd" + compliance: + - cis: ["3.11"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:rpm -qa httpd -> r:httpd" + + # 3.12 Remove Dovecot (IMAP and POP3 services) (Not Scored) + - id: 3538 + title: "Remove Dovecot" + description: "Dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided to this server, it is recommended that the service be deleted to reduce the potential attack surface." + remediation: "# yum erase dovecot" + compliance: + - cis: ["3.12"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:rpm -qa dovecot -> r:dovecot" + + # 3.13 Remove Samba (Not Scored) + - id: 3539 + title: "Remove Samba" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." + remediation: "# yum erase samba" + compliance: + - cis: ["3.13"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:rpm -qa samba -> r:samba" + + # 3.14 Remove HTTP Proxy Server (Not Scored) + - id: 3540 + title: "Remove HTTP Proxy Server" + description: "The default HTTP proxy package shipped with Red Hat Linux is squid." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "# yum erase squid" + compliance: + - cis: ["3.14"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:rpm -qa squid -> r:squid" + + # 3.15 Remove SNMP Server (Not Scored) + - id: 3541 + title: "Remove SNMP Server" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server communicates using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used." + remediation: "# yum erase net-snmp" + compliance: + - cis: ["3.15"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:rpm -qa net-snmp -> r:net-snmp" + + ############################################### + # 4 Network Configuration and Firewalls + ############################################### + ############################################### + # 4.1 Modify Network Parameters (Host Only) + ############################################### + # 4.1.1 Disable IP Forwarding (Scored) + - id: 3542 + title: "Disable IP Forwarding" + description: "The net.ipv4.ip_forward flag is used to tell the server whether it can forward packets or not. If the server is not to be used as a router, set the flag to 0." + rationale: "Setting the flag to 0 ensures that a server with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the net.ipv4.ip_forward parameter to 0 in /etc/sysctl.conf and modify active kernel parameters to match:" + compliance: + - cis: ["4.1.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-3561-8 + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.ip_forward -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + + # 4.1.2 Disable Send Packet Redirects (Scored) + - id: 3543 + title: "Disable Send Packet Redirects" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the net.ipv4.conf.all.send_redirects and net.ipv4.conf.default.send_redirects parameters to 0 in /etc/sysctl.conf" + compliance: + - cis: ["4.1.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-4151-7 + - CCE-4155-8 + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.send_redirects -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + ############################################### + # 4.2 Modify Network Parameters (Host and Router) + ############################################### + # 4.2.1 Disable Source Routed Packet Acceptance (Scored) + - id: 3544 + title: "Disable Source Routed Packet Acceptance" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network." + rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this server was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface." + remediation: "Set the net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route parameters to 0 in /etc/sysctl.conf and modify active kernel parameters to match." + compliance: + - cis: ["4.2.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-4236-6 + - CCE-4091-5 + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.accept_source_route -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.accept_source_route -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + + # 4.2.2 Disable ICMP Redirect Acceptance (Scored) + - id: 3545 + title: "Disable ICMP Redirect Acceptance" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the net.ipv4.conf.all.accept_redirects and net.ipv4.conf.default.accept_redirects parameters to 0 in /etc/sysctl.conf and modify active kernel parameters to match." + compliance: + - cis: ["4.2.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-4217-6 + - CCE-4186-3 + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.accept_redirects -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + + # 4.2.3 Disable Secure ICMP Redirect Acceptance (Scored) + - id: 3546 + title: "Disable Secure ICMP Redirect Acceptance" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the net.ipv4.conf.all.secure_redirects and net.ipv4.conf.default.secure_redirects parameters to 0 in /etc/sysctl.conf and modify active kernel parameters to match." + compliance: + - cis: ["4.2.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-3472-8 + - CCE-3339-9 + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + # 4.2.4 Log Suspicious Packets (Scored) + - id: 3547 + title: "Log Suspicious Packets" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." + remediation: "Set the net.ipv4.conf.all.log_martians and net.ipv4.conf.default.log_martians parameters to 1 in /etc/sysctl.conf and modify active kernel parameters to match." + compliance: + - cis: ["4.2.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-4320-8 + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:/sbin/sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + # 4.2.5 Enable Ignore Broadcast Requests (Scored) + - id: 3548 + title: "Enable Ignore Broadcast Requests" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address." + remediation: "Set the net.ipv4.icmp_echo_ignore_broadcasts parameter to 1 in /etc/sysctl.conf and modify active kernel parameters to match." + compliance: + - cis: ["4.2.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-3644-2 + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + # 4.2.6 Enable Bad Error Message Protection (Scored) + - id: 3549 + title: "Enable Bad Error Message Protection" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the net.ipv4.icmp_ignore_bogus_error_responses parameter to 1 in /etc/sysctl.conf and modify active kernel parameters to match." + compliance: + - cis: ["4.2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-4133-5 + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + # 4.2.7 Enable RFC-recommended Source Route Validation (Scored) + - id: 3550 + title: "Enable RFC-recommended Source Route Validation" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid." + rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed." + remediation: "Set the net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter parameters to 1 in /etc/sysctl.conf and modify active kernel parameters to match." + compliance: + - cis: ["4.2.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-4080-8 + - CCE-3840-6 + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:/sbin/sysctl net.ipv4.conf.default.rp_filter -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + # 4.2.8 Enable TCP SYN Cookies (Scored) + - id: 3551 + title: "Enable TCP SYN Cookies" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a server by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding." + remediation: "Set the net.ipv4.tcp_syncookies parameter to 1 in /etc/sysctl.conf: net.ipv4.tcp_syncookies=1 Modify active kernel parameters to match." + compliance: + - cis: ["4.2.8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + references: + - CCE-4265-5 + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + ############################################### + # 6 System Access, Authentication and Authorization + ############################################### + ############################################### + # 6.1 Configure SSH + ############################################### + # 6.2.1 Set SSH Protocol to 2 (Scored) + - id: 3552 + title: "Set SSH Protocol to 2" + description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["6.2.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - CCE-4245-7 + - https://www.ssh.com/ssh/ + condition: all + rules: + - 'f:$sshd_file -> r:^\s*\t*Protocol\s*\t*2' + + # 6.2.2 Set LogLevel to INFO (Scored) + - id: 3553 + title: "Ensure SSH LogLevel is set to INFO" + description: "The INFO parameter specifies that login and logout activity will be logged." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:LogLevel\s*\t*INFO' + + # 6.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) + - id: 3554 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.5"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 6.2.6 Set SSH IgnoreRhosts to Yes (Scored) + - id: 3555 + title: "Set SSH IgnoreRhosts to Yes" + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication ." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh ." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["6.2.6"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - CCE-4250-7 + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:IgnoreRhosts\s*\t*yes' + + # 6.2.7 Set SSH HostbasedAuthentication to No (Scored) + - id: 3556 + title: "Set SSH HostbasedAuthentication to No" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv , along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf , disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["6.2.7"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - CCE-4251-5 + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:HostbasedAuthentication\s*\t*no' + + # 6.2.8 Disable SSH Root Login (Scored) + - id: 3557 + title: "Disable SSH Root Login" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1) . The default is no." + rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["6.2.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - CCE-4252-3 + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitRootLogin\s*\t*no' + + # 6.2.9 Set SSH PermitEmptyPasswords to No (Scored) + - id: 3558 + title: "Set SSH PermitEmptyPasswords to No" + description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["6.2.9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - CCE-4256-4 + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitEmptyPasswords\s*\t*no' + + ############################################### + # 9 System Maintenance + ############################################### + ############################################### + # 9.2 Review User and Group Settings + ############################################### + # 9.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) + - id: 3559 + title: "Verify No UID 0 Accounts Exist Other Than root" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 7.5 Restrict root Login to System Console." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["9.2.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: + - CCE-4009-7 + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' diff --git a/etc/ruleset/sca/rhel/6/cis_rhel6_linux.yml b/etc/ruleset/sca/rhel/6/cis_rhel6_linux.yml new file mode 100644 index 0000000000..e7798f3302 --- /dev/null +++ b/etc/ruleset/sca/rhel/6/cis_rhel6_linux.yml @@ -0,0 +1,3235 @@ +# Security Configuration Assessment +# CIS Checks for RHEL 6 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for Red Hat Enterprise Linux 6 v2.1.0 - 12-27-2017 + +policy: + id: "cis_rhel6_linux" + file: "cis_rhel6_linux.yml" + name: "CIS Red Hat Enterprise Linux 6 Benchmark v2.1.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Red Hat Enterprise Linux 6 systems running on x86 and x64 platforms. This document was tested against Red Hat Enterprise Linux 6.9." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check RHEL6 version" + description: "Requirements for running the policy against RHEL 6 family." + condition: any + rules: + - "f:/etc/redhat-release -> r:^Red Hat Enterprise Linux && r:release 6" + - "f:/etc/redhat-release -> r:^Cloud && r:release 6" + - "f:/etc/redhat-release -> r:^Oracle && r:release 6" + - "f:/etc/redhat-release -> r:^Better && r:release 6" + - "f:/etc/system-release -> r:^Amazon Linux AMI" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # 1.1.1.1 cramfs: filesystem + - id: 4000 + title: "Ensure mounting of cramfs filesystems is disabled" + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install cramfs /bin/true. Run the following command to unload the cramfs module: rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:install /bin/true|Module cramfs not found" + - "not c:lsmod -> r:cramfs" + + # 1.1.1.2 freevxfs: filesystem + - id: 4001 + title: "Ensure mounting of freevxfs filesystems is disabled" + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install freevxfs /bin/true. Run the following command to unload the freevxfs module: rmmod freevxfs" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v freevxfs -> r:install /bin/true|Module freevxfs not found" + - "not c:lsmod -> r:freevxfs" + + # 1.1.1.3 jffs2: filesystem + - id: 4002 + title: "Ensure mounting of jffs2 filesystems is disabled" + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install jffs2 /bin/true. Run the following command to unload the jffs2 module: rmmod jffs2" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v jffs2 -> r:install /bin/true|Module jffs2 not found" + - "not c:lsmod -> r:jffs2" + + # 1.1.1.4 hfs: filesystem + - id: 4003 + title: "Ensure mounting of hfs filesystems is disabled" + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfs /bin/true. Run the following command to unload the hfs module: rmmod hfs" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v hfs -> r:install /bin/true|Module hfs not found" + - "not c:lsmod -> r:hfs" + # 1.1.1.5 hfsplus: filesystem + - id: 4004 + title: "Ensure mounting of hfsplus filesystems is disabled" + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install hfsplus /bin/true. Run the following command to unload the hfsplus module: rmmod hfsplus" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v hfsplus -> r:install /bin/true|Module hfsplus not found" + - "not c:lsmod -> r:hfsplus" + # 1.1.1.6 squashfs: filesystem + - id: 4005 + title: "Ensure mounting of squashfs filesystems is disabled" + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install squashfs /bin/true. Run the following command to unload the squashfs module: rmmod squashfs" + compliance: + - cis: ["1.1.1.6"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + # 1.1.1.7 udfs: filesystem + - id: 4006 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install udf /bin/true. Run the following command to unload the udf module: rmmod udf" + compliance: + - cis: ["1.1.1.7"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v udf -> r:install /bin/true|Module udf not found" + - "not c:lsmod -> r:udf" + + # 1.1.1.8 FAT: filesystem + - id: 4007 + title: "Ensure mounting of FAT filesystems is disabled" + description: "The FAT filesystem format is primarily used on older windows systems and portable USB drives or flash modules. It comes in three types FAT12 , FAT16 , and FAT32 all of which are supported by the vfat kernel module." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install vfat /bin/true. Run the following command to unload the vfat module: rmmod vfat" + compliance: + - cis: ["1.1.1.8"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v vfat -> r:install /bin/true|Module vfat not found" + - "not c:lsmod -> r:vfat" + + # 1.1.2 /tmp: partition + - id: 4008 + title: "Ensure separate partition exists for /tmp" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + # 1.1.3 /tmp: nodev + - id: 4009 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstabfile and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp:# mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + # 1.1.4 /tmp: nosuid + - id: 4010 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp: # mount -o remount,nosuid /tmp" + compliance: + - cis: ["1.1.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + # 1.1.5 /tmp: noexec + - id: 4011 + title: "Ensure noexec option set on /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. See the fstab(5)manual page for more information. Run the following command to remount /tmp: # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + # 1.1.6 Build considerations - Partition scheme. + - id: 4012 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + # 1.1.7 bind mount /var/tmp to /tmp + - id: 4013 + title: "Ensure separate partition exists for /var/tmp" + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + # 1.1.8 nodev set on /var/tmp + - id: 4014 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp ." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + + # 1.1.9 nosuid set on /var/tmp + - id: 4015 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + # 1.1.10 noexec set on /var/tmp + - id: 4016 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.10"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + # 1.1.11 /var/log: partition + - id: 4017 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data ." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4", "10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + # 1.1.12 /var/log/audit: partition + - id: 4018 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4", "10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + # 1.1.13 /home: partition + - id: 4019 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + # 1.1.14 /home: nodev + - id: 4020 + title: "Ensure nodev option set on /home partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + # 1.1.15 /dev/shm: nodev + - id: 4021 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + # 1.1.16 /dev/shm: nosuid + - id: 4022 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + # 1.1.17 /dev/shm: noexec + - id: 4023 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.17"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + # 1.1.22 Disable Automounting + - id: 4024 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run the following command to disable autofs: # chkconfig autofs off" + compliance: + - cis: ["1.1.22"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list autofs -> r:^\s*\t*autofs\.*on' + + ############################################### + # 1.2 Configure Software Updates + ############################################### + + # 1.2.2 Activate gpgcheck + - id: 4025 + title: "Ensure gpgcheck is globally activated" + description: "The gpgcheck option, found in the main section of the /etc/yum.conf and individual /etc/yum/repos.d/* files determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/yum.conf and set ' gpgcheck=1 ' in the [main] section. Edit any failing files in /etc/yum.repos.d/* and set all instances of gpgcheck to ' 1 '." + compliance: + - cis: ["1.2.3"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + condition: all + rules: + - "f:/etc/yum.conf -> r:^gpgcheck=1" + - "not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck=0" + + # 1.2.5 Disable the rhnsd Daemon (Not Scored) + - id: 4026 + title: "Disable the rhnsd Daemon" + description: "The rhnsd daemon polls the Red Hat Network web site for scheduled actions and, if there are, executes those actions." + rationale: "Patch management policies may require that organizations test the impact of a patch before it is deployed in a production environment. Having patches automatically deployed could have a negative impact on the environment. It is best to not allow an action by default but only after appropriate consideration has been made. It is recommended that the service be disabled unless the risk is understood and accepted or you are running your own satellite . This item is not scored because organizations may have addressed the risk." + remediation: "Run the following command to disable rhnsd : # chkconfig rhnsd off" + compliance: + - cis: ["1.2.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'c:chkconfig --list rhnsd -> r:^rhnsd\s*\t*0:off\s*\t*1:off\s*\t*2:off\s*\t*3:off\s*\t*4:off\s*\t*5:off\s*\t*6:off' + + ############################################### + # 1.3 Filesystem Integrity Checking + ############################################### + + # 1.3.1 install AIDE + - id: 4027 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install aide: yum install aide // Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: aide --init && mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: all + rules: + - 'c:rpm -q aide -> r:aide-\S*' + + # 1.3.2 AIDE regular checks + - id: 4028 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Run the following command: crontab -u root -e // Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check // Notes: The checking in this recommendation occurs every day at 5am. Alter the frequency and time of the checks in compliance with site policy. " + compliance: + - cis: ["1.3.2"] + - cis_csc: ["3.5"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "c:crontab -u root -l -> r:aide" + - "c:grep -r aide /etc/cron.* /etc/crontab -> r:aide" + + ############################################### + # 1.4 Secure Boot Settings + ############################################### + # 1.4.1 Configure bootloader + - id: 4029 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually located at /boot/grub/grub.conf and linked as /boot/grub/menu.lst and /etc/grub.conf ." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub/grub.conf # chmod og-rwx /boot/grub/grub.conf" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /boot/grub/grub.conf -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.4.2 Set Boot Loader Password (Scored) + - id: 4030 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: "Create an encrypted password with grub-md5-crypt: # grub-md5-crypt Password: Retype Password: Copy and paste the into the global section of /boot/grub/grub.conf : password --md5 " + compliance: + - cis: ["1.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.conf -> r:^password --md5\s\.+' + + # 1.4.3 Single user authentication + - id: 4031 + title: "Ensure authentication required for single user mode" + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Edit /etc/sysconfig/init and set SINGLE to ' /sbin/sulogin': SINGLE=/sbin/sulogin" + compliance: + - cis: ["1.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/sysconfig/init -> r:SINGLE\s*=\s*/sbin/sulogin' + + # 1.4.4 Ensure interactive boot is not enabled (Scored) + - id: 4032 + title: "Ensure interactive boot is not enabled" + description: "Interactive boot allows console users to interactively select which services start on boot. The PROMPT option provides console users the ability to interactively boot the system and select which services to start on boot . " + rationale: "Turn off the PROMPT option on the console to prevent console users from potentially overriding established security settings. " + remediation: "Edit the /etc/sysconfig/init file and set PROMPT to ' no ': PROMPT=no" + compliance: + - cis: ["1.4.4"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'f:/etc/sysconfig/init -> r:PROMPT\s*=\s*no' + + ############################################### + # 1.5 Additional Process Hardening + ############################################### + # 1.5.1 Restrict Core Dumps (Scored) + - id: 4033 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 and Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:^fs.suid_dumpable\s*=\s*0\s*$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + + # 1.5.2 XD/NX enabled + - id: 4034 + title: "Ensure XD/NX support is enabled" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.5.2"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sh -c "dmesg | grep NX" -> r:NX \(Execute Disable\) protection: active' + + # 1.5.3 Enable Randomized Virtual Memory Region Placement (Scored) + - id: 4035 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2. Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + + # 1.5.4 Disable prelink + - id: 4036 + title: "Ensure prelink is disabled" + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal and uninstall prelink: prelink -ua && yum remove prelink" + compliance: + - cis: ["1.5.4"] + - cis_csc: ["3.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q prelink -> package prelink is not installed" + + ############################################### + # 1.6 Configure SELinux + ############################################### + + # 1.6.1.1 SELinux not disabled + - id: 4037 + title: "Ensure SELinux is not disabled in bootloader configuration" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: "Edit /boot/grub/grub.conf and remove all instances of selinux=0 and enforcing=0 on all kernel lines" + compliance: + - cis: ["1.6.1.1"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.conf -> r:^\s*\t*kernel\.*selinux=0|^\s*\t*kernel\.*enforcing=0' + + # 1.6.1.2 Set selinux state + - id: 4038 + title: "Ensure the SELinux state is enforcing" + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing" + compliance: + - cis: ["1.6.1.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s+enabled' + - 'c:sestatus -> r:^Current mode:\s+enforcing' + - 'c:sestatus -> r:^Mode from config file:\s+enforcing' + - 'f:/etc/selinux/config -> r:^SELINUX\s*=\s*enforcing' + + # 1.6.1.3 Set selinux policy + - id: 4039 + title: "Ensure SELinux policy is configured" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted" + compliance: + - cis: ["1.6.1.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Policy from config file:\s+targeted|^Policy from config file:\s+mls' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Remove SETroubleshoot + - id: 4040 + title: "Ensure SETroubleshoot is not installed" + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # yum remove setroubleshoot" + compliance: + - cis: ["1.6.1.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:rpm -qa setroubleshoot -> r:setroubleshoot" + + # 1.6.1.5 Disable MCS Translation service mcstrans + - id: 4041 + title: "Ensure the MCS Translation Service (mcstrans) is not installed" + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf" + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # yum remove mcstrans" + compliance: + - cis: ["1.6.1.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:rpm -qa mcstrans -> r:mcstrans" + + # 1.6.1.6 Ensure no unconfined daemons exist + - id: 4042 + title: "Ensure no unconfined daemons exist" + description: "Daemons that are not defined in SELinux policy will inherit the security context of their parent process." + rationale: "Since daemons are launched and descend from the init process, they will inherit the security context label initrc_t . This could cause the unintended consequence of giving the process more permission than it requires." + remediation: "Investigate any unconfined daemons found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:ps -eZ -> r:initrc && !r:tr|ps|egrep|bash|awk" + # 1.6.2 Install SELinux + - id: 4043 + title: "Ensure SELinux is installed" + description: "SELinux provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install libselinux: yum install libselinux" + compliance: + - cis: ["1.6.2"] + - cis_csc: ["14.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:rpm -q libselinux -> r:libselinux-\S+' + + ############################################### + # 1.7 Warning Banners + ############################################### + # 1.7.1.1 Configure message of the day (Scored) + - id: 4044 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v." + compliance: + - cis: ["1.7.1.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + + # 1.7.1.2 Configure local login warning banner (Not Scored) + - id: 4045 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.7.1.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + + # 1.7.1.3 Configure remote login warning banner (Not Scored) + - id: 4046 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.7.1.3"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + + # 1.7.1.4 Configure /etc/motd permissions (Not Scored) + - id: 4047 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.1.5 Configure /etc/issue permissions (Scored) + - id: 4048 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + # 1.7.1.6 Configure /etc/issue.net permissions (Not Scored) + - id: 4049 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.2 Ensure GDM login banner is configured (Scored) + - id: 4050 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Create the /etc/dconf/profile/gdm file with the following contents: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults || Create or edit the banner-message-enable and banner-message-text options in /etc/dconf/db/gdm.d/01-banner-message : [org/gnome/login-screen] banner-message-enable=true banner-message-text='Authorized uses only. All activity may be monitored and reported.' || Run the following command to update the system databases: dconf update" + compliance: + - cis: ["1.7.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm -> r:user-db:user" + - "f:/etc/dconf/profile/gdm -> r:system-db:gdm" + - "f:/etc/dconf/profile/gdm -> r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - "f:/etc/dconf/db/gdm.d/01-banner-message -> r:banner-message-enable=true" + - 'f:/etc/dconf/db/gdm.d/01-banner-message -> r:banner-message-text=\.+' + + # 1.8 Ensure updates, patches, and additional security software are installed (Not Scored) + - id: 4051 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Site policy may mandate a testing period before install onto production systems for available updates. The audit and remediation here only cover security updates. Non-security updates can be audited with and comparing against site policy: # yum check-update" + compliance: + - cis: ["1.8"] + - cis_csc: ["4.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6", "SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: all + rules: + - "c:yum check-update --security -> r:No packages needed for security" + + ############################################### + # 2 OS Services + ############################################### + ############################################### + # 2.1 inetd Services + ############################################### + # 2.1.1 Disable chargen services (Scored) + + - id: 4052 + title: "Ensure chargen services are not enabled" + description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable chargen-dgram and chargen-stream: # chkconfig chargen-dgram off; # chkconfig chargen-stream off" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list chargen-dgram -> r:^\s*\t*chargen-dgram:\s*\t*on' + - 'c:chkconfig --list chargen-stream -> r:^\s*\t*chargen-stream:\s*\t*on' + + # 2.1.2 Disable daytime services (Scored) + - id: 4053 + title: "Ensure daytime services are not enabled" + description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable daytime-dgram and daytime-stream: # chkconfig daytime-dgram off; # chkconfig daytime-stream off" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list daytime-dgram -> r:^\s*\t*daytime-dgram:\s*\t*on' + - 'c:chkconfig --list daytime-stream -> r:^\s*\t*daytime-stream:\s*\t*on' + + # 2.1.3 Disable discard services (Scored) + - id: 4054 + title: "Ensure discard services are not enabled" + description: "discardis a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable discard-dgram and discard-stream: # chkconfig discard-dgram off; # chkconfig discard-stream off" + compliance: + - cis: ["2.1.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list discard-dgram -> r:^\s*\t*discard-dgram:\s*\t*on' + - 'c:chkconfig --list discard-stream -> r:^\s*\t*discard-stream:\s*\t*on' + + # 2.1.4 Disable echo-dgram (Scored) + - id: 4055 + title: "Ensure echo services are not enabled" + description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable echo-dgram and echo-stream: # chkconfig echo-dgram off; # chkconfig echo-stream off" + compliance: + - cis: ["2.1.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list echo-dgram -> r:^\s*\t*echo-dgram:\s*\t*on' + - 'c:chkconfig --list echo-stream -> r:^\s*\t*echo-stream:\s*\t*on' + + # 2.1.5 Disable time-stream (Scored) + - id: 4056 + title: "Ensure time services are not enabled" + description: "time is a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable time-dgram and time-stream: # chkconfig time-dgram off; # chkconfig time-stream off" + compliance: + - cis: ["2.1.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list time-dgram -> r:^\s*\t*time-dgram:\s*\t*on' + - 'c:chkconfig --list time-stream -> r:^\s*\t*time-stream:\s*\t*on' + + # 2.1.6 Remove rsh-server (Scored) + - id: 4057 + title: "Ensure rsh server is not enabled" + description: "The Berkeley rsh-server ( rsh , rlogin , rexec ) package contains legacy services that exchange credentials in clear-text." + rationale: "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." + remediation: "Run the following commands to disable rsh, rlogin, and rexec: # chkconfig rsh off # chkconfig rlogin off # chkconfig rexec off" + compliance: + - cis: ["2.1.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list rexec -> r:^\s*\t*rexec:\s*\t*on' + - 'c:chkconfig --list rlogin -> r:^\s*\t*rlogin:\s*\t*on' + - 'c:chkconfig --list rsh -> r:^\s*\t*rsh:\s*\t*on' + + # 2.1.7 Remove talk server (Scored) + - id: 4058 + title: "Ensure talk server is not enabled" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable talk: # chkconfig talk off" + compliance: + - cis: ["2.1.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list talk -> r:^\s*\t*talk:\s*\t*on' + + # 2.1.8 Remove telnet-server (Scored) + - id: 4059 + title: "Ensure telnet server is not enabled" + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to disable telnet: # chkconfig telnet off" + compliance: + - cis: ["2.1.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list telnet -> r:^\s*\t*telnet:\s*\t*on' + + # 2.1.9 Ensure tftp server is not enabled (Scored) + - id: 4060 + title: "Ensure tftp server is not enabled" + description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package tftp-server is used to define and support a TFTP server." + rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." + remediation: "Run the following command to disable tftp: # chkconfig tftp off" + compliance: + - cis: ["2.1.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list tftp -> r:^\s*\t*tftp:\s*\t*on' + + # 2.1.10 Remove rsync service (Scored) + - id: 4061 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # chkconfig rsyncd off" + compliance: + - cis: ["2.1.10"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list rsync -> r:^\s*\t*rsync:\s*\t*on' + + # 2.1.11 Remove xinetd (Scored) + - id: 4062 + title: "Ensure xinetd is not enabled" + description: "The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." + remediation: "Run the following command to disable xinetd: # chkconfig xinetd off" + compliance: + - cis: ["2.1.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list xinetd -> r:^\s*\t*xinetd\.*on' + + ############################################## + # 2.2 Remove Legacy Services + ############################################### + + # 2.2.1.1 Ensure time synchronization is in use (Not Scored) + - id: 4063 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems or virtual systems where host based time synchronization is not available run the following commands and verify either ntp or chrony is installed: # rpm -q ntp # rpm -q chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and verify that host based synchronization is in use." + compliance: + - cis: ["2.2.2.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "not c:rpm -q ntp -> r:^package ntp is not installed" + - "not c:rpm -q chrony -> r:^package chrony is not installed" + + # 2.2.1.2 Configure Network Time Protocol (NTP) (Scored) + - id: 4064 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "1) Add or edit restrict lines in /etc/ntp.conf to match the following: - restrict -4 default kod nomodify notrap nopeer noquery and - restrict -4 default kod nomodify notrap nopeer noquery. 2) Add or edit server or pool lines to /etc/ntp.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ' -u ntp:ntp ': - OPTIONS='-u ntp:ntp'" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/sysconfig/ntpd -> r:^OPTIONS\s*=\s* && r:-u ntp:ntp' + + # 2.2.1.3 Configure Network Time Protocol (Chrony) (Scored) + - id: 4065 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://www.ntp.org. ntp can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "1) Add or edit restrict lines in /etc/chrony.conf to match the following: - 1) Add or edit server or pool lines to /etc/chrony.conf as appropriate: server . 3) Add or edit the OPTIONS in /etc/sysconfig/chronyd to include: - OPTIONS='-u chronyd'" + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/sysconfig/chronyd -> r:^OPTIONS\s*=\s* && r:-u chrony' + + # 2.2.2 Remove X Windows (Scored) + - id: 4066 + title: "Ensure X Window System is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: # yum remove xorg-x11*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:rpm -qa xorg-x11* -> r:^xorg-x11" + + # 2.2.3 Disable Avahi Server (Scored) + - id: 4067 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface." + remediation: "Run the following command to disable avahi-daemon: # chkconfig avahi-daemon off" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list avahi-daemon -> r:^\s*\t*avahi-daemon\.*on' + + # 2.2.4 Ensure CUPS is not enabled (Scored) + - id: 4068 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups : # chkconfig cups off" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list cups -> r:^\s*\t*cups\.*on' + + # 2.2.5 Remove DHCP Server (Scored) + - id: 4069 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dhcpd: # chkconfig dhcpd off" + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on DHCP is available at https://www.isc.org/software/dhcp + condition: none + rules: + - 'c:chkconfig --list dhcpd -> r:^\s*\t*dhcpd\.*on' + + # 2.2.6 Remove LDAP Server (Scored) + - id: 4070 + title: "Ensure LDAP Server is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # chkconfig slapd off" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - More detailed documentation on OpenLDAP is available at https://www.openldap.org + condition: none + rules: + - 'c:chkconfig --list slapd -> r:^\s*\t*slapd\.*on' + + # 2.2.7 Disable NFS and RPC (Scored) + - id: 4071 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs, nfs-server and rpcbind: # chkconfig nfs off; # chkconfig rpcbind off" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list nfs -> r:^\s*\t*nfs\.*on' + - 'c:chkconfig --list rpcbind -> r:^\s*\t*rpcbind\.*on' + + # 2.2.8 Ensure DNS Server is not enabled (Scored) + - id: 4072 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable named : # chkconfig named off" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list named -> r:^\s*\t*named\.*on' + + # 2.2.9 Remove FTP Server (Scored) + - id: 4073 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # chkconfig vsftpd off" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list vsftpd -> r:^\s*\t*vsftpd\.*on' + + # 2.2.10 Remove HTTP Server (Scored) + - id: 4074 + title: "Ensure HTTP server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable httpd: # chkconfig httpd off" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list httpd -> r:^\s*\t*httpd\.*on' + + # 2.2.11 Remove Dovecot (IMAP and POP3 services) (Scored) + - id: 4075 + title: "Ensure IMAP and POP3 server is not enabled" + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dovecot: # chkconfig dovecot off" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list dovecot -> r:^\s*\t*dovecot\.*on' + + # 2.2.12 Remove Samba (Scored) + - id: 4076 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable smb: # chkconfig smb off" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list smb -> r:^\s*\t*smb\.*on' + + # 2.2.13 Remove HTTP Proxy Server (Scored) + - id: 4077 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # chkconfig squid off" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list squid -> r:^\s*\t*squid\.*on' + + # 2.2.14 Remove SNMP Server (Not Scored) + - id: 4078 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # chkconfig snmpd off" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list snmpd -> r:^\s*\t*snmpd\.*on' + + # 2.2.15 Ensure mail transfer agent is configured for local-only mode (Scored) + - id: 4079 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Restart postfix: # service postfix restart" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - tsc: ["CC5.2", "CC6.4", "CC6.6", "CC6.7"] + condition: none + rules: + - 'c:netstat -an -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.+LISTEN' + + # 2.2.16 Remove NIS Server (Scored) + - id: 4080 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable ypserv: # chkconfig ypserv off" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'c:chkconfig --list ypserv -> r:^\s*\t*ypserv\.*on' + + ############################################### + # 2.3 Service Clients + ############################################### + # 2.3.1 Remove NIS Client (Scored) + - id: 4081 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Run the following command to uninstall ypbind: # yum remove ypbind" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q ypbind -> package ypbind is not installed" + + # 2.3.2 Ensure rsh client is not installed (Scored) + - id: 4082 + title: "Ensure rsh client is not installed" + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin ." + remediation: "Run the following command to uninstall rsh : # yum remove rsh" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q rsh -> package rsh is not installed" + + # 2.3.3 Ensure talk client is not installed (Scored) + - id: 4083 + title: "Ensure talk client is not installed" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk : # yum remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q talk -> package talk is not installed" + + # 2.3.4 Ensure telnet client is not installed (Scored) + - id: 4084 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet : # yum remove telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q telnet -> package telnet is not installed" + + # 2.3.5 Ensure LDAP client is not installed (Scored) + - id: 4085 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients : # yum remove openldap-clients" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:rpm -q openldap-clients -> package openldap-clients is not installed" + + ############################################### + # 3 Network Configuration and Firewalls + ############################################### + ############################################### + # 3.1 Modify Network Parameters (Host Only) + ############################################### + # 3.1.1 Disable IP Forwarding (Scored) + - id: 4086 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." + rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + + # 3.1.2 Disable Send Packet Redirects (Scored) + - id: 4087 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0; net.ipv4.conf.default.send_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0; # sysctl -w net.ipv4.conf.default.send_redirects=0; # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + ############################################### + # 3.2 Modify Network Parameters (Host and Router) + ############################################### + # 3.2.1 Disable Source Routed Packet Acceptance (Scored) + - id: 4088 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0; net.ipv4.conf.default.accept_source_route = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + + # 3.2.2 Disable ICMP Redirect Acceptance (Scored) + - id: 4089 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0; net.ipv4.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + + # 3.2.3 Disable Secure ICMP Redirect Acceptance (Scored) + - id: 4090 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0; net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + # 3.2.4 Log Suspicious Packets (Scored) + - id: 4091 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1; net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + # 3.2.5 Enable Ignore Broadcast Requests (Scored) + - id: 4092 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + # 3.2.6 Enable Bad Error Message Protection (Scored) + - id: 4093 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + # 3.2.7 Enable RFC-recommended Source Route Validation (Scored) + - id: 4094 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your server bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1; net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + # 3.2.8 Enable TCP SYN Cookies (Scored) + - id: 4095 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + ############################################### + # 3.3 IPv6 + ############################################### + # 3.3.1 Ensure IPv6 router advertisements are not accepted (Not Scored) + - id: 4096 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the system's ability to accept IPv6 router advertisements." + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 and net.ipv6.conf.default.accept_ra = 0 Then, run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0' + + # 3.3.2 Ensure IPv6 redirects are not accepted (Not Scored) + - id: 4097 + title: "Ensure IPv6 redirects are not accepted" + description: "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic." + rationale: "It is recommended that systems not accept ICMP redirects as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 || net.ipv6.conf.default.accept_redirects = 0 Then, run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirect /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirect /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0' + + # 3.3.3 Ensure IPv6 is disabled (Not Scored) + - id: 4098 + title: "Ensure IPv6 is disabled" + description: "Although IPv6 has many advantages over IPv4, few organizations have implemented IPv6." + rationale: "If IPv6 is not to be used, it is recommended that it be disabled to reduce the attack surface of the system." + remediation: "Edit /boot/grub/grub.conf to include ipv6.disable=1 on all kernel lines." + compliance: + - cis: ["3.3.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.conf -> r:^\s*\t*kernel && !r:ipv6.disable=1' + + ############################################### + # 3.4 TCP Wrappers + ############################################### + # 3.4.1 Ensure TCP Wrappers is installed (Scored) + - id: 4099 + title: "Ensure TCP Wrappers is installed" + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Run the following command to install tcp_wrappers: yum install tcp_wrappers" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "c:rpm -q tcp_wrappers -> r:^tcp_wrappers-" + - "c:rpm -q tcp_wrappers-libs -> r:^tcp_wrappers-libs-" + + # 3.4.3 Ensure /etc/hosts.deny is configured (Scored) + - id: 4100 + title: "Ensure /etc/hosts.deny is configured" + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." + remediation: "Run the following command to create /etc/hosts.deny: echo 'ALL: ALL' >> /etc/hosts.deny" + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'f:/etc/hosts.deny -> r:^ALL\s*:\s*ALL' + + # 3.4.4 Ensure permissions on /etc/hosts.allow are configured (Scored) + - id: 4101 + title: "Ensure permissions on /etc/hosts.allow are configured." + description: "The /etc/hosts.allow file contains networking information that is used by many applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.allow : chown root:root /etc/hosts.allow and chmod 644 /etc/hosts.allow" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'c:stat -L /etc/hosts.allow -> r:^Access: \(0644/-rw-r--r--\) Uid: \( 0/ root\) Gid: \( 0/ root\)' + + # 3.4.5 Ensure permissions on /etc/hosts.deny are configured (Scored) + - id: 4102 + title: "Ensure permissions on /etc/hosts.deny are configured." + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.deny : chown root:root /etc/hosts.deny and chmod 644 /etc/hosts.deny" + compliance: + - cis: ["3.4.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/hosts.deny -> r:^Access: \(0644/-rw-r--r--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + ############################################### + # 3.5 Uncommon Network Protocols + ############################################### + # 3.5.1 Ensure DCCP is disabled (Not Scored) + - id: 4103 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.5.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v dccp -> r:install /bin/true" + - "not c:lsmod -> r:dccp" + + # 3.5.2 Ensure SCTP is disabled (Not Scored) + - id: 4104 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.5.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v sctp -> r:install /bin/true" + - "not c:lsmod -> r:sctp" + + # 3.5.3 Ensure RDS is disabled (Not Scored) + - id: 4105 + title: "Ensure RDS is disabled" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.5.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v rds -> r:install /bin/true" + - "not c:lsmod -> r:rds" + + # 3.5.4 Ensure TIPC is disabled (Not Scored) + - id: 4106 + title: "Ensure TIPC is disabled" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.5.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:modprobe -n -v tipc -> r:install /bin/true" + - "not c:lsmod -> r:tipc" + + ############################################### + # 3.6 Firewall Configuration + ############################################### + # 3.6.1 Ensure iptables is installed (Scored) + - id: 4107 + title: "Ensure iptables is installed" + description: "iptables allows configuration of the IPv4 tables in the linux kernel and the rules stored within them. Most firewall configuration utilities operate as a front end to iptables ." + rationale: "iptables is required for firewall management and configuration." + remediation: "Run the following command to install iptables : yum install iptables" + compliance: + - cis: ["3.6.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.1"] + condition: all + rules: + - "c:rpm -q iptables -> r:iptables-" + + # 3.6.2 Ensure default deny firewall policy (Scored) + - id: 4108 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: iptables -P INPUT DROP; iptables -P OUTPUT DROP and iptables -P FORWARD DROP" + compliance: + - cis: ["3.6.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)' + + # 3.6.3 Ensure loopback traffic is configured (Scored) + - id: 4109 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.6.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + ############################################### + # 4 Logging and Auditing + ############################################### + + ############################################### + # 4.1 Configure System Accounting (auditd) + ############################################### + + # 4.1.1.1 Ensure audit log storage size is configured (Not Scored) + - id: 4110 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = " + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file\s*=\s*\d+' + + # 4.1.1.2 Ensure system is disabled when audit logs are full (Scored) + - id: 4111 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^admin_space_left_action\s*=\s*halt' + + # 4.1.1.3 Ensure audit logs are not automatically deleted (Scored) + - id: 4112 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file_action\s*=\s*keep_logs' + + # 4.1.2 Ensure auditd service is enabled (Scored) + - id: 4113 + title: "Ensure auditd service is enabled" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd : # chkconfig auditd on" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1", "10.7"] + - tsc: ["CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:chkconfig --list auditd -> r:2:on && r:3:on && r:4:on && r:5:on" + + # 4.1.3 Ensure auditing for processes that start prior to auditd is enabled (Scored) + - id: 4114 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: "Edit /boot/grub/grub.conf to include audit=1 on all kernel lines. Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + compliance: + - cis: ["4.1.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.2.6", "10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/boot/grub/grub.conf -> r:^\s*\t*kernel && !r:audit=1' + + # 4.1.4 Ensure events that modify date and time information are collected (Scored) + - id: 4115 + title: "Ensure events that modify date and time information are collected" + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier "time-change".' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -Farch=b32 -S clock_settime -k time-change -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["3.6"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:-w /etc/localtime && r:-p wa && r:-k time-change" + + # 4.1.5 Ensure events that modify user/group information are collected (Scored) + - id: 4116 + title: "Ensure events that modify user/group information are collected" + description: 'Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity" + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /etc/group && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:-w /etc/passwd && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:-w /etc/gshadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:-w /etc/shadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:-w /etc/security/opasswd && r:-p wa && r:-k identity" + + # 4.1.6 Ensure events that modify the system's network environment are collected (Scored) + - id: 4117 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre-login), /etc/hosts (file containing host names and associated IP addresses), /etc/sysconfig/network file and /etc/sysconfig/network-scripts/ directory (containing network interface scripts and configurations)." + rationale: 'Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network and /etc/sysconfig/network-scripts/ is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier "system-locale."' + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale" + compliance: + - cis: ["4.1.6"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/issue && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/issue.net && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/hosts && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/sysconfig/network && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:-w /etc/sysconfig/network-scripts/ && r:-p wa && r:-k system-locale" + + # 4.1.7 Ensure events that modify the system's Mandatory Access Controls are collected (Scored) + - id: 4118 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux or directory." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy -w /usr/share/selinux/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /etc/selinux/ && r:-p wa && r:-k MAC-policy" + - "f:/etc/audit/audit.rules -> r:-w /usr/share/selinux/ && r:-p wa && r:-k MAC-policy" + + # 4.1.8 Ensure login and logout events are collected (Scored) + - id: 4119 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The /var/run/failock directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/lastlog -p wa -k logins -w /var/run/faillock/ -p wa -k logins" + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5", "16.10", "16.4"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /var/log/lastlog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:-w /var/run/faillock/ && r:-p wa && r:-k logins" + + # 4.1.9 Ensure session initiation information is collected (Scored) + - id: 4120 + title: "Ensure session initiation information is collected" + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier "session." The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier "logins.".' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k logins -w /var/log/btmp -p wa -k logins" + compliance: + - cis: ["4.1.8"] + - cis_csc: ["5.5", "16.10", "16.4"] + - pci_dss: ["10.3"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /var/run/utmp && r:-p wa && r:-k session" + - "f:/etc/audit/audit.rules -> r:-w /var/log/wtmp && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:-w /var/log/btmp && r:-p wa && r:-k logins" + + # 4.1.10 Ensure discretionary access control permission modification events are collected (Scored) + - id: 4121 + title: "Ensure discretionary access control permission modification events are collected" + description: 'Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 500) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier "perm_mod."' + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=500 -F auid!=4294967295 -k perm_mod For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=500 -F auid!=4294967295 -k perm_mod -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lrem" + compliance: + - cis: ["4.1.10"] + - cis_csc: ["3.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k perm_mod" + + # 4.1.11 Ensure unsuccessful unauthorized file access attempts are collected (Scored) + - id: 4122 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: 'Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 500), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier "access."' + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=500 -F auid!=4294967295 -k access" + compliance: + - cis: ["4.1.11"] + - cis_csc: ["14.6"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EACCES && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k access" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-S ftruncate && r:-F exit=-EPERM && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k access" + + # 4.1.13 Ensure successful file system mounts are collected (Scored) + - id: 4123 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S mount -F auid>=500 -F auid!=4294967295 -k mounts For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=500 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=500 -F auid!=4294967295 -k mounts" + compliance: + - cis: ["4.1.13"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k mounts" + + # 4.1.14 Ensure file deletion events by users are collected (Scored) + - id: 4124 + title: "Ensure file deletion events by users are collected" + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=500 -F auid!=4294967295 -k delete" + compliance: + - cis: ["4.1.14"] + - pci_dss: ["10.5.5"] + - tsc: ["PI1.4", "PI1.5", "CC7.1", "CC7.2", "CC7.3", "CC8.1"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=500 && r:-F auid!=4294967295 && r:-k delete" + + # 4.1.15 Ensure changes to system administration scope (sudoers) is collected (Scored) + - id: 4125 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: 'Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier "scope."' + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d/ -p wa -k scope" + compliance: + - cis: ["4.1.15"] + - cis_csc: ["5.4"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /etc/sudoers && r:-p wa && r:-k scope" + - "f:/etc/audit/audit.rules -> r:-w /etc/sudoers.d/ && r:-p wa && r:-k scope" + + # 4.1.16 Ensure system administrator actions (sudolog) are collected (Scored) + - id: 4126 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions" + compliance: + - cis: ["4.1.16"] + - cis_csc: ["5.1", "5.5"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14", "AC.6", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /var/log/sudo.log && r:-p wa && r:-k actions" + + # 4.1.17 Ensure kernel module loading and unloading is collected (Scored) + - id: 4127 + title: "Ensure kernel module loading and unloading is collected" + description: 'Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of "modules".' + rationale: "Monitoring the use of insmod , rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions" + compliance: + - cis: ["4.1.17"] + - cis_csc: ["3"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:-w /sbin/insmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:-w /sbin/rmmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:-w /sbin/modprobe && r:-p x && r:-k modules" + - 'f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b\d\d && r:-S init_module && r:-S delete_module && r:-k modules' + + # 4.1.18 Ensure the audit configuration is immutable (Scored) + - id: 4128 + title: "Ensure the audit configuration is immutable" + description: 'Set system audit so that audit rules cannot be modified with auditctl . Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following line to the end of the /etc/audit/audit.rules file. -e 2" + compliance: + - cis: ["4.1.18"] + - cis_csc: ["3", "6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:tail -1 /etc/audit/audit.rules -> r:^-e 2" + + ############################################### + # 4.2 Configure Logging + ############################################### + + # 4.2.1.1 Ensure rsyslog Service is enabled (Scored) + - id: 4129 + title: "Ensure rsyslog Service is enabled" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system may default to the syslogd service or lackblogging instead." + remediation: "Run the following command to enable rsyslog : # chkconfig rsyslog on" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:chkconfig --list rsyslog -> r:2:on && r:3:on && r:4:on && r:5:on" + # 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 4130 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 0600|^\$FileCreateMode 0640|^\$FileCreateMode 0440|^\$FileCreateMode 0400|^\$FileCreateMode 0040|^\$FileCreateMode 0000' + + # 4.2.1.4 Ensure rsyslog is configured to send logs to a remote log host (Scored) + - id: 4131 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). *.* @@loghost.example.com Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:grep *.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/*.conf -> !r:# && r:*.* @@\.+' + + # 4.2.2.1 Ensure syslog-ng service is enabled (Scored) + - id: 4132 + title: "Ensure syslog-ng service is enabled" + description: "Once the syslog-ng package is installed it needs to be activated." + rationale: "If the syslog-ng service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable syslog-ng : # chkconfig syslog-ng on" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:chkconfig --list syslog-ng -> r:2:on && r:3:on && r:4:on && r:5:on" + + # 4.2.2.3 Ensure syslog-ng default file permissions configured (Scored) + - id: 4133 + title: "Ensure syslog-ng default file permissions configured" + description: "syslog-ng will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive syslog-ng data is archived and protected." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf and set perm option to 0640 or more restrictive: options { chain_hostnames(off); flush_lines(0); perm(0640); stats_freq(3600); threaded(yes); };" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:^options && r:perm\(0600\)|perm\(0640\)|perm\(0440\)|perm\(0400\)|perm\(0000\)' + + # 4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host (Not Scored) + - id: 4134 + title: "Ensure syslog-ng is configured to send logs to a remote log host" + description: "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp("logfile.example.com" port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the rsyslogd configuration: # pkill -HUP syslog-ng' + compliance: + - cis: ["4.2.2.4"] + - cis_csc: ["6.6"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/syslog-ng/syslog-ng.conf -> !r:^# && r:destination logserver" + - 'f:/etc/syslog-ng/syslog-ng.conf -> !r:^# && r:log\.+source\.+destination' + + # 4.2.3 Ensure rsyslog or syslog-ng is installed (Scored) + - id: 4135 + title: "Ensure rsyslog or syslog-ng is installed" + description: "The rsyslog and syslog-ng software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog or syslog-ng using one of the following commands: # yum install rsyslog # yum install syslog-ng" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["6.2"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "not c:rpm -q rsyslog -> package rsyslog is not installed" + - "not c:rpm -q syslog-ng -> package syslog-ng is not installed" + + # 4.2.4 Ensure permissions on all logfiles are configured (Scored) + - id: 4136 + title: "Ensure permissions on all logfiles are configured" + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitivebdata is archived and protected." + remediation: "Run the following command to set permissions on all existing log files: # find /var/log -type f -exec chmod g-wx,o-rwx {} +" + compliance: + - cis: ["4.2.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + + ############################################### + # 5 System Access, Authentication and Authorization + ############################################### + ############################################### + # 5.2 Configure SSH + ############################################### + + # 5.1.1 Ensure cron daemon is enabled (Scored) + - id: 4137 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron : # chkconfig crond on" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:chkconfig --list crond -> r:2:on && r:3:on && r:4:on && r:5:on" + + # 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 4138 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 4139 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 4140 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 4141 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 4142 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access: \(0\w00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 4143 + title: "Ensure permissions on /etc/cron.d are configured" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.8 Ensure at/cron is restricted to authorized users (Scored) + - id: 4144 + title: "Ensure at/cron is restricted to authorized users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:stat -L /etc/cron.deny -> r:No such file or directory$" + - "c:stat -L /etc/at.deny -> r:No such file or directory$" + - 'c:stat -L /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat -L /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + ############################################### + # 5.2 Configure SSH + ############################################### + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured (Scored) + - id: 4145 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: chown root:root /etc/ssh/sshd_config and chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2.2 Set SSH Protocol to 2 (Scored) + - id: 4146 + title: "Ensure SSH Protocol is set to 2" + description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:Protocol\s*\t*2' + + # 5.2.3 Set LogLevel to INFO (Scored) + - id: 4147 + title: "Ensure SSH LogLevel is set to INFO" + description: "The INFO parameter specifies that login and logout activity will be logged." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:LogLevel\s*\t*INFO' + + # 5.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) + - id: 4148 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.5"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.2.6 Set SSH IgnoreRhosts to Yes (Scored) + - id: 4149 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:IgnoreRhosts\s*\t*yes' + + # 5.2.7 Set SSH HostbasedAuthentication to No (Scored) + - id: 4150 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:HostbasedAuthentication\s*\t*no' + + # 5.2.8 Disable SSH Root Login (Scored) + - id: 4151 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["5.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitRootLogin\s*\t*no' + + # 5.2.9 Set SSH PermitEmptyPasswords to No (Scored) + - id: 4152 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitEmptyPasswords\s*\t*no' + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled (Scored) + - id: 4153 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:PermitUserEnvironment\s*\t*no' + + # 5.2.12 Ensure SSH Idle Timeout Interval is configured (Scored) + - id: 4154 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 and ClientAliveCountMax 0" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare <= 300' + - 'f:$sshd_file -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare <= 3' + + # 5.2.13 Ensure SSH LoginGraceTime is set to one minute or less (Scored) + - id: 4155 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.13"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:$sshd_file -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60' + + # 5.2.14 Ensure SSH access is limited (Scored) + - id: 4156 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. AllowGroups The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. DenyUsers The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. DenyGroups The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers ; AllowGroups ; DenyUsers and DenyGroups " + compliance: + - cis: ["5.2.14"] + - cis_csc: ["5.1", "5.8"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'f:$sshd_file -> r:^\s*AllowUsers' + - 'f:$sshd_file -> r:^\s*AllowGroups' + - 'f:$sshd_file -> r:^\s*DenyUsers' + - 'f:$sshd_file -> r:^\s*DenyGroups' + + # 5.2.15 Ensure SSH warning banner is configured (Scored) + - id: 4157 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*Banner\s*\t*/etc/issue.net' + + ############################################### + # 5.3 Configure PAM + ############################################### + # 5.3.1 Ensure password creation requirements are configured (Scored) + - id: 4158 + title: "Ensure password creation requirements are configured" + description: "The pam_cracklib.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_cracklib.so and to conform to site policy: password requisite pam_cracklib.so try_first_pass retry=3 minlen=14 dcredit=-1 ucredit=-1 ocredit=-1 lcredit=-1" + compliance: + - cis: ["5.3.1"] + - cis_csc: ["5.7", "16.12"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:grep pam_cracklib.so /etc/pam.d/password-auth -> r:try_first_pass && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'c:grep pam_cracklib.so /etc/pam.d/system-auth -> r:try_first_pass && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + + # 5.3.3 Ensure password reuse is limited (Scored) + - id: 4159 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the remember option and conform to site policy as shown: password sufficient pam_unix.so remember=5 or password required pam_pwhistory.so remember=5" + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> n:^password\s+sufficient\s+pam_unix.so\.+remember=(\d+)|^password\s+required\s+pam_pwhistory.so\.+remember=(\d+) compare >= 5' + + # 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 4160 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the sha512 option for pam_unix.so as shown: password sufficient pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.14"] + - pci_dss: ["3.6.1", "8.2.1"] + - tsc: ["CC6.1", "CC6.7"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + - 'f:/etc/pam.d/system-auth -> r:^password\s*sufficient\s*pam_unix.so\s*sha512' + ############################################### + # 5.4 User Accounts and Environment + ############################################### + ############################################### + # 5.4.1 Set Shadow Password Suite Parameters + ############################################### + # 5.4.1.1 Ensure password expiration is 365 days or less (Scored) + - id: 4161 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 90 and modify user parameters for all users with a password set to match: chage --maxdays 90 " + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + + # 5.4.1.2 Ensure minimum days between password changes is 7 or more (Scored) + - id: 4162 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7 and modify user parameters for all users with a password set to match: chage --mindays 7 " + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + + # 5.4.1.3 Ensure password expiration warning days is 7 or more (Scored) + - id: 4163 + title: "Ensure password expiration warning days is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 and modify user parameters for all users with a password set to match: chage --warndays 7 " + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + # 5.4.1.4 Ensure inactive password lock is 30 days or less (Scored) + - id: 4164 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: useradd -D -f 30 and modify user parameters for all users with a password set to match: chage --inactive 30 " + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*(\d+) compare <= 30' + + # 5.4.3 Ensure default group for the root account is GID 0 (Scored) + - id: 4165 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\w:\w:0' + + # 5.4.4 Ensure default user umask is 027 or more restrictive (Scored) + - id: 4166 + title: "Ensure default user umask is 027 or more restrictive" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["13"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/bashrc -> n:^\s*\t*umask\s+(\d+) compare >= 027' + - 'f:/etc/profile -> n:^\s*\t*umask\s+(\d+) compare >= 027' + - 'd:/etc/profile.d -> .sh -> n:^\s*\t*umask\s+(\d+) compare >= 027' + + # 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 4167 + title: "Ensure default user shell timeout is 900 seconds or less" + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bashrc and /etc/profile files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + # 5.6 Ensure access to the su command is restricted (Scored) + - id: 4168 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo , which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su , the su command will only allow users in the wheel group to execute su ." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so use_uid" + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/pam.d/su -> r:^auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + ############################################### + # 6 System Maintenance + ############################################### + ############################################### + # 6.1 System File Permissions + ############################################### + + # 6.1.2 Configure /etc/passwd permissions (Scored) + - id: 4169 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.3 Configure /etc/shadow permissions (Scored) + - id: 4170 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following command to set permissions on /etc/shadow: # chown root:root /etc/shadow # chmod 000 /etc/shadow" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/shadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.4 Configure /etc/group permissions (Scored) + - id: 4171 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.5 Configure /etc/gshadow permissions (Scored) + - id: 4172 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following command to set permissions on /etc/gshadow: # chown root:root /etc/gshadow # chmod 000 /etc/gshadow" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/gshadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.6 Configure /etc/passwd- permissions (Scored) + - id: 4173 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod 644 /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/passwd- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.7 Configure /etc/shadow- permissions (Scored) + - id: 4174 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/shadow-: # chown root:root /etc/shadow- # chmod 000 /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/shadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.8 Configure /etc/group- permissions (Scored) + - id: 4175 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.9 Configure /etc/gshadow- permissions (Scored) + - id: 4176 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/gshadow-: # chown root:root /etc/gshadow- # chmod 000 /etc/gshadow-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat -L /etc/gshadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + ############################################### + # 6.2 Review User and Group Settings + ############################################### + # 6.2.1 Check passwords fields (Scored) + - id: 4177 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: passwd -l || Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + + # 6.2.2 Delete legacy entries in /etc/passwd (Scored) + - id: 4178 + title: 'Ensure no legacy "+" entries exist in /etc/passwd' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/passwd -> !r:^# && r:^+:" + + # 6.2.3 Delete legacy entries in /etc/shadow (Scored) + - id: 4179 + title: 'Ensure no legacy "+" entries exist in /etc/shadow' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.3"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/shadow -> !r:^# && r:^+:" + + # 6.2.4 Delete legacy entries in /etc/group (Scored) + - id: 4180 + title: 'Ensure no legacy "+" entries exist in /etc/group' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy '+' entries from /etc/group if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/group -> !r:^# && r:^+:" + + # 6.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) + - id: 4181 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' diff --git a/etc/ruleset/sca/rhel/7/cis_rhel7_linux.yml b/etc/ruleset/sca/rhel/7/cis_rhel7_linux.yml new file mode 100644 index 0000000000..bdfa8fec56 --- /dev/null +++ b/etc/ruleset/sca/rhel/7/cis_rhel7_linux.yml @@ -0,0 +1,4555 @@ +# Security Configuration Assessment +# CIS Checks for RHEL 7. +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software Foundation +# +# +# Based on: +# Center for Internet Security Red Hat Enterprise Linux 7 Benchmark v3.1.1 - 05-21-2021 + +policy: + id: "cis_rhel7_linux" + file: "cis_rhel7_linux.yml" + name: "CIS Red Hat Enterprise Linux 7 Benchmark v3.1.1" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Red Hat Enterprise Linux 7 systems running on x86 and x64 platforms. This document was tested against Red Hat Enterprise Linux 7." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check RHEL7 family platform" + description: "Requirements for running the policy against RHEL 7 family." + condition: any + rules: + - "f:/etc/redhat-release -> r:^Red Hat Enterprise Linux && r:release 7" + - "f:/etc/redhat-release -> r:^Cloud && r:release 7" + - "f:/etc/redhat-release -> r:^Oracle && r:release 7" + - "f:/etc/redhat-release -> r:^Better && r:release 7" + - "f:/etc/redhat-release -> r:^OpenVZ && r:release 7" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # 1.1.1.1 Ensure mounting of cramfs filesystems is disabled. (Automated) + - id: 4500 + title: "Ensure mounting of cramfs filesystems is disabled." + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/cramfs.conf and add the following line: install cramfs /bin/true Run the following command to unload the cramfs module: # rmmod cramfs." + compliance: + - cis: ["1.1.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:install /bin/true|Module cramfs not found" + - "not c:lsmod -> r:cramfs" + + # 1.1.1.2 Ensure mounting of squashfs filesystems is disabled. (Automated) + - id: 4501 + title: "Ensure mounting of squashfs filesystems is disabled." + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: 'Disabling squashfs will prevent the use of snap. Snap is a package manager for Linux for installing Snap packages. "Snap" application packages of software are self-contained and work across a range of Linux distributions. This is unlike traditional Linux package management approaches, like APT or RPM, which require specifically adapted packages per Linux distribution on an application update and delay therefore application deployment from developers to their software''s end-user. Snaps themselves have no dependency on any external store ("App store"), can be obtained from any source and can be therefore used for upstream software deployment. When snaps are deployed on versions of Linux, the Ubuntu app store is used as default back-end, but other stores can be enabled as well.' + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/squashfs.conf and add the following line: install squashfs /bin/true Run the following command to unload the squashfs module: # rmmod squashfs." + compliance: + - cis: ["1.1.1.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + + # 1.1.1.3 Ensure mounting of udf filesystems is disabled. (Automated) + - id: 4502 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/udf.conf and add the following line: install udf /bin/true Run the following command to unload the udf module: # rmmod udf." + compliance: + - cis: ["1.1.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:modprobe -n -v udf -> r:install /bin/true|Module udf not found" + - "not c:lsmod -> r:udf" + + # 1.1.2 Ensure /tmp is configured. (Automated) + - id: 4503 + title: "Ensure /tmp is configured." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a default installation a disk-based /tmp will essentially have the whole disk available, as it only creates a single / partition. On the other hand, a RAM-based /tmp as with tmpfs will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily." + remediation: "Create or update an entry for /tmp in either /etc/fstab OR in a systemd tmp.mount file: If /etc/fstab is used: configure /etc/fstab as appropriate. _ Example:_ tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp # mount -o remount,noexec,nodev,nosuid /tmp OR if systemd tmp.mount file is used: run the following command to create the file /etc/systemd/system/tmp.mount if it doesn't exist: # [ ! -f /etc/systemd/system/tmp.mount ] && cp -v /usr/lib/systemd/system/tmp.mount /etc/systemd/system/ Edit the file /etc/systemd/system/tmp.mount: [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to reload the systemd daemon: # systemctl daemon-reload Run the following command to unmask and start tmp.mount: # systemctl --now unmask tmp.mount." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + compliance: + - cis: ["1.1.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.4", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s' + - "c:systemctl is-enabled tmp.mount -> r:enabled|static|generated" + + # 1.1.3 Ensure noexec option set on /tmp partition. (Automated) + - id: 4504 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file OR the /etc/systemd/system/local- fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,noexec /tmp OR if systemd is used to mount /tmp:_ Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount." + compliance: + - cis: ["1.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'c:mount -> r:\s/tmp\s && !r:noexec' + + # 1.1.4 Ensure nodev option set on /tmp partition. (Automated) + - id: 4505 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file OR the /etc/systemd/system/local- fs.target.wants/tmp.mount file: IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nodev /tmp OR if systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount # systemctl restart tmp.mount." + compliance: + - cis: ["1.1.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'c:mount -> r:\s/tmp\s && !r:nodev' + + # 1.1.5 Ensure nosuid option set on /tmp partition. (Automated) + - id: 4506 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "IF /etc/fstab is used to mount /tmp Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,nosuid /tmp OR if systemd is used to mount /tmp: Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuid to the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to restart the systemd daemon: # systemctl daemon-reload Run the following command to restart tmp.mount: # systemctl restart tmp.mount." + compliance: + - cis: ["1.1.5"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: none + rules: + - 'c:mount -> r:\s/tmp\s && !r:nosuid' + + # 1.1.6 Ensure /dev/shm is configured. (Automated) + - id: 4507 + title: "Ensure /dev/shm is configured." + description: "/dev/shm is a traditional shared memory concept. One program will create a memory portion, which other processes (if permitted) can access. Mounting tmpfs at /dev/shm is handled automatically by systemd." + rationale: "Any user can upload and execute files inside the /dev/shm similar to the /tmp partition. Configuring /dev/shm allows an administrator to set the noexec option on the mount, making /dev/shm useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "Edit /etc/fstab and add or edit the following line: tmpfs /dev/shm tmpfs defaults,noexec,nodev,nosuid,seclabel 0 0 Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm." + compliance: + - cis: ["1.1.6"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + - 'f:/etc/fstab -> r:\s/dev/shm\s' + + # 1.1.7 Ensure noexec option set on /dev/shm partition. (Automated) + - id: 4508 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm." + compliance: + - cis: ["1.1.7"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["2.6", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + - "c:findmnt --kernel /dev/shm -> r:noexec" + + # 1.1.8 Ensure nodev option set on /dev/shm partition. (Automated) + - id: 4509 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm." + compliance: + - cis: ["1.1.8"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + - "c:findmnt --kernel /dev/shm -> r:nodev" + + # 1.1.9 Ensure nosuid option set on /dev/shm partition. (Automated) + - id: 4510 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec,nodev,nosuid /dev/shm." + compliance: + - cis: ["1.1.9"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + - "c:findmnt --kernel /dev/shm -> r:nosuid" + + # 1.1.10 Ensure separate partition exists for /var. (Automated) + - id: 4511 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + # 1.1.11 Ensure separate partition exists for /var/tmp. (Automated) + - id: 4512 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications and is intended for temporary files that are preserved across reboots." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + # 1.1.12 Ensure /var/tmp partition includes the noexec option. (Automated) + - id: 4513 + title: "Ensure /var/tmp partition includes the noexec option." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "For existing /var/tmp partitions, edit the /etc/fstab file and add noexec to the fourth field (mounting options) of the /var/tmp entry. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,noexec /var/tmp." + compliance: + - cis: ["1.1.12"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: none + rules: + - 'c:mount -> r:\s/var/tmp\s && !r:noexec' + + # 1.1.13 Ensure /var/tmp partition includes the nodev option. (Automated) + - id: 4514 + title: "Ensure /var/tmp partition includes the nodev option." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." + remediation: "For existing /var/tmp partitions, edit the /etc/fstab file and add nodev to the fourth field (mounting options) of the /var/tmp entry. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nodev /var/tmp." + compliance: + - cis: ["1.1.13"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: none + rules: + - 'c:mount -> r:\s/var/tmp\s && !r:nodev' + + # 1.1.14 Ensure /var/tmp partition includes the nosuid option. (Automated) + - id: 4515 + title: "Ensure /var/tmp partition includes the nosuid option." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "For existing /var/tmp partitions, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) of the /var/tmp entry. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,nosuid /var/tmp." + compliance: + - cis: ["1.1.14"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: none + rules: + - 'c:mount -> r:\s/var/tmp\s && !r:nosuid' + + # 1.1.15 Ensure separate partition exists for /var/log. (Automated) + - id: 4516 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.15"] + - cis_csc_v8: ["4.1", "8.3"] + - cis_csc_v7: ["6.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["10.7", "11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["A1.1", "CC7.1", "CC8.1"] + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + # 1.1.16 Ensure separate partition exists for /var/log/audit. (Automated) + - id: 4517 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd , it may not perform as desired." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.16"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + # 1.1.17 Ensure separate partition exists for /home. (Automated) + - id: 4518 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + # 1.1.18 Ensure /home partition includes the nodev option. (Automated) + - id: 4519 + title: "Ensure /home partition includes the nodev option." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "For existing /home partitions, edit the /etc/fstab file and add nodev to the fourth field (mounting options) of the /home entry. See the fstab(5) manual page for more information. Run the following command to remount /home: # mount -o remount,nodev /home." + compliance: + - cis: ["1.1.18"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: none + rules: + - 'c:mount -> r:\s/home\s && !r:nodev' + + # 1.1.19 Ensure removable media partitions include noexec option. (Automated) + - id: 4520 + title: "Ensure removable media partitions include noexec option." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from the removable media. This deters users from being able to introduce potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) of all removable media partitions. Look for entries that have mount points that contain words such as floppy or cdrom. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.19"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["2.6", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:mount -> r:\s/etc/fstab\s && !r:noexec' + + # 1.1.20 Ensure nodev option set on removable media partitions. (Automated) + - id: 4521 + title: "Ensure nodev option set on removable media partitions." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Removable media containing character and block special devices could be used to circumvent security controls by allowing non-root users to access sensitive device files such as /dev/kmem or the raw disk partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) of all removable media partitions. Look for entries that have mount points that contain words such as floppy or cdrom. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.20"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: none + rules: + - 'c:mount -> r:\s/etc/fstab\s && !r:nodev' + + # 1.1.21 Ensure nosuid option set on removable media partitions. (Automated) + - id: 4522 + title: "Ensure nosuid option set on removable media partitions." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) of all removable media partitions. Look for entries that have mount points that contain words such as floppy or cdrom. See the fstab(5) manual page for more information." + compliance: + - cis: ["1.1.21"] + - cis_csc_v8: ["3.3", "4.1"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.3.1", "1.5.1", "2.1.1", "2.2.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC7.1", "CC8.1"] + condition: none + rules: + - 'c:mount -> r:\s/etc/fstab\s && !r:nosuid' + + # 1.1.22 Ensure sticky bit is set on all world-writable directories. (Automated) - Not Implemented + + # 1.1.23 Disable Automounting. (Automated) + - id: 4523 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "Run the following command to mask autofs: # systemctl --now mask autofs OR run the following command to remove autofs # yum remove autofs." + compliance: + - cis: ["1.1.23"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.4", "8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: any + rules: + - "c:systemctl is-enabled autofs -> r:Failed to get unit file state for autofs.service: No such file or directory" + - "c:systemctl is-enabled autofs -> r:disabled" + - 'not c:systemctl show "autofs.service" -> r:\s*unitfilestate=enabled' + + # 1.1.24 Disable USB Storage. (Automated) + - id: 4524 + title: "Disable USB Storage." + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/usb_storage.conf Add the following line: install usb-storage /bin/true Run the following command to unload the usb-storage module: rmmod usb-storage." + compliance: + - cis: ["1.1.24"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["8.4", "8.5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.12.2.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:modprobe -n -v usb-storage -> r:install /bin/true" + - "not c:lsmod -> r:usb-storage" + + ############################################### + # 1.2 Configure Software Updates + ############################################### + + # 1.2.1 Ensure GPG keys are configured. (Manual) - Not Implemented + # 1.2.2 Ensure package manager repositories are configured. (Manual) - Not Implemented + + # 1.2.3 Ensure gpgcheck is globally activated. (Automated) + - id: 4525 + title: "Ensure gpgcheck is globally activated." + description: "The gpgcheck option, found in the main section of the /etc/yum.conf and individual /etc/yum/repos.d/*.repo files determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/yum.conf and set 'gpgcheck=1' in the [main] section. Edit any failing files in /etc/yum.repos.d/*.repo and set all instances of gpgcheck to 1." + compliance: + - cis: ["1.2.3"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - "f:/etc/yum.conf -> r:gpgcheck=1" + - 'd:/etc/yum.repos.d/ -> r:\.*.repo -> r:gpgcheck=1' + + # 1.2.4 Ensure Red Hat Subscription Manager connection is configured. (Manual) - Not Implemented + + # 1.2.5 Disable the rhnsd Daemon. (Manual) - Not Implemented + + ############################################### + # 1.3 Filesystem Integrity Checking + ############################################### + + # 1.3.1 Ensure AIDE is installed. (Automated) + - id: 4526 + title: "Ensure AIDE is installed." + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system. Note: The prelinking feature can interfere with AIDE because it alters binaries to speed up their start up times. Run prelink -ua to restore the binaries to their prelinked state, thus avoiding false positives from AIDE." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # yum install aide Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: Run the following commands: # aide --init # mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz." + references: + - "http://aide.sourceforge.net/stable/manual.html" + compliance: + - cis: ["1.3.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AC-6(9)"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:rpm -q aide -> r:aide-\S*' + + # 1.3.2 Ensure filesystem integrity is regularly checked. (Automated) + - id: 4527 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check OR if aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + references: + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.servic" + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer" + compliance: + - cis: ["1.3.2"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AC-6(9)"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:systemctl is-enabled aidecheck.service -> r:enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:enabled" + - "c:systemctl status aidecheck.timer -> r:active" + + ############################################### + # 1.4 Secure Boot Settings + ############################################### + + # 1.4.1 Ensure bootloader password is set. (Automated) + - id: 4528 + title: "Ensure bootloader password is set." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + impact: 'If password protection is enabled, only the designated superuser can edit a Grub 2 menu item by pressing "e" or access the GRUB 2 command line by pressing "c" If GRUB 2 is set up to boot automatically to a password-protected menu entry the user has no option to back out of the password prompt to select another menu entry. Holding the SHIFT key will not display the menu in this case. The user must enter the correct username and password. If unable, the configuration files will have to be edited via the LiveCD or other means to fix the problem - You can add --unrestricted to the menu entries to allow the system to boot without entering a password. Password will still be required to edit menu items.' + remediation: 'For newer grub2 based systems (Release 7.2 and newer), create an encrypted password with grub2-setpassword : # grub2-setpassword Enter password: Confirm password: OR For older grub2 based systems, create an encrypted password with grub2-mkpasswd- pbkdf2: # grub2-mkpasswd-pbkdf2 Enter password: Reenter password: Your PBKDF2 is Add the following into /etc/grub.d/01_users or a custom /etc/grub.d configuration file: cat < EOF Note: - If placing the information in a custom file, do not include the "cat << EOF" and "EOF" lines as the content is automatically added from these files - The superuser/user information and password should not be contained in the /etc/grub.d/00_header file. The information can be placed in any /etc/grub.d file as long as that file is incorporated into grub.cfg. It is preferable to enter this data into a custom file, such as /etc/grub.d/40_custom, so it is not overwritten should the Grub package be updated Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg.' + compliance: + - cis: ["1.4.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/boot/grub2/user.cfg -> r:^GRUB2_PASSWORD\s*=\.+' + + # 1.4.2 Ensure permissions on bootloader config are configured. (Automated) + - id: 4529 + title: "Ensure permissions on bootloader config are configured." + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub2 configuration is usually grub.cfg. On newer grub2 systems the encrypted bootloader password is contained in user.cfg. If the system uses UEFI, /boot/efi is a vfat filesystem. The vfat filesystem itself doesn't have the concept of permissions but can be mounted under Linux with whatever permissions desired." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set ownership and permissions on your grub configuration file(s): # chown root:root /boot/grub2/grub.cfg # test -f /boot/grub2/user.cfg && chown root:root /boot/grub2/user.cfg # chmod og-rwx /boot/grub2/grub.cfg # test -f /boot/grub2/user.cfg && chmod og-rwx /boot/grub2/user.cfg OR If the system uses UEFI, edit /etc/fstab and add the fmask=0077 option: Example: /boot/efi vfat defaults,umask=0027,fmask=0077,uid=0,gid=0 0 0 Note: This may require a re-boot to enable the change." + compliance: + - cis: ["1.4.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:stat -L /boot/grub2/grub.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat -L /boot/grub2/grubenv -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.4.3 Ensure authentication required for single user mode. (Automated) + - id: 4530 + title: "Ensure authentication required for single user mode." + description: "Single user mode (rescue mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader. Note: The systemctl option --fail is synonymous with --job-mode=fail. Using either is acceptable." + rationale: "Requiring authentication in single user mode (rescue mode) prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: 'Edit /usr/lib/systemd/system/rescue.service and /usr/lib/systemd/system/emergency.service and set ExecStart to use /sbin/sulogin or /usr/sbin/sulogin: ExecStart=-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default".' + compliance: + - cis: ["1.4.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/usr/lib/systemd/system/rescue.service -> r:ExecStart=-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"|ExecStart=-/bin/sh -c "/usr/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"' + - 'f:/usr/lib/systemd/system/emergency.service -> r:ExecStart=-/bin/sh -c "/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"|ExecStart=-/bin/sh -c "/usr/sbin/sulogin; /usr/bin/systemctl --fail --no-block default"' + + ############################################### + # 1.5 Additional Process Hardening + ############################################### + + # 1.5.1 Ensure core dumps are restricted. (Automated) + - id: 4531 + title: "Ensure core dumps are restricted." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5)). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0 If systemd-coredump is installed: edit /etc/systemd/coredump.conf and add/modify the following lines: Storage=none ProcessSizeMax=0 Run the command: systemctl daemon-reload." + compliance: + - cis: ["1.5.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/security/limits.conf -> r:hard\s*\t*core\s*\t*0$' + - 'd:/etc/security/limits.d/ -> r:\. -> r:hard\s*\t*core\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + - 'f:/etc/sysctl.conf -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + - 'd:/etc/sysctl.d/ -> r:\. -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + + # 1.5.2 Ensure XD/NX support is enabled. (Automated) + - id: 4532 + title: "Ensure XD/NX support is enabled." + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system. Note: Ensure your system supports the XD or NX bit and has PAE support before implementing this recommendation as this may prevent it from booting if these are not supported by your hardware." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.5.2"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'c:journalctl -> r:\s*protection:\s*\t*active' + + # 1.5.3 Ensure address space layout randomization (ASLR) is enabled. (Automated) + - id: 4533 + title: "Ensure address space layout randomization (ASLR) is enabled." + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2." + compliance: + - cis: ["1.5.3"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + - 'f:/etc/sysctl.conf -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'd:/etc/sysctl.d -> r:\.* -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + + # 1.5.4 Ensure prelink is not installed. (Automated) + - id: 4534 + title: "Ensure prelink is not installed." + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following command to restore binaries to normal: # prelink -ua Run the following command to uninstall prelink: # yum remove prelink." + references: + - "http://www.nsa.gov/research/selinux" + - "http://www.nsa.gov/research/selinux/list.shtml" + - "http://docs.fedoraproject.org/selinux-faq" + - "http://docs.fedoraproject.org/selinux-user-guide" + - "http://docs.fedoraproject.org/selinux-managing-" + - "http://www.selinuxproject.org" + compliance: + - cis: ["1.5.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - "c:rpm -qa prelink -> r:prelink" + + ############################################### + # 1.6 Configure SELinux + ############################################### + + # 1.6.1.1 Ensure SELinux is installed. (Automated) + - id: 4535 + title: "Ensure SELinux is installed." + description: "SELinux provides Mandatory Access Control." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install SELinux: # yum install libselinux." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:rpm -q libselinux -> r:libselinux-" + + # 1.6.1.2 Ensure SELinux is not disabled in bootloader configuration. (Automated) + - id: 4536 + title: "Ensure SELinux is not disabled in bootloader configuration." + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters. Note: This recommendation is designed around the grub 2 bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/grub and remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX="" Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg.' + compliance: + - cis: ["1.6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + + # 1.6.1.3 Ensure SELinux policy is configured. (Automated) + - id: 4537 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only. Note: If your organization requires stricter policies, ensure that they are set in the /etc/selinux/config file." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+targeted$|^Loaded policy name:\s+mls$' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Ensure the SELinux mode is enforcing or permissive. (Automated) + - id: 4538 + title: "Ensure the SELinux mode is enforcing or permissive." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive." + references: + - "https://access.redhat.com/documentation/en-us/SELinux-mode" + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s+enabled$' + - 'c:sestatus -> r:^Current mode:\s+enforcing$' + - 'c:sestatus -> r:^Mode from config file:\s+enforcing$' + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + - "c:getenforce -> r:^Enforcing|^Permissive" + + # 1.6.1.5 Ensure the SELinux mode is enforcing. (Automated) + - id: 4539 + title: "Ensure the SELinux mode is enforcing." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode the system not only avoids enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future. Running SELinux in Permissive mode, though helpful for developing SELinux policy, only logs access denial entries, but does not deny any operations." + remediation: "Run the following command to set SELinux's running mode: # setenforce 1 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing." + references: + - "https://access.redhat.com/documentation/en-us/selinux-mode" + compliance: + - cis: ["1.6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + - "c:getenforce -> r:^Enforcing" + + # 1.6.1.6 Ensure no unconfined services exist. (Automated) + - id: 4540 + title: "Ensure no unconfined services exist." + description: "Unconfined processes run in unconfined domains Note: Occasionally certain daemons such as backup or centralized management software may require running unconfined. Any such software should be carefully analyzed and documented before such an exception is made." + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules - it does not replace them." + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:ps -eZ -> r:unconfined_service_t" + + # 1.6.1.7 Ensure SETroubleshoot is not installed. (Automated) + - id: 4541 + title: "Ensure SETroubleshoot is not installed." + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to Uninstall setroubleshoot: # yum remove setroubleshoot." + compliance: + - cis: ["1.6.1.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.9.1.1"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -qa setroubleshoot -> r:setroubleshoot" + + # 1.6.1.8 Ensure the MCS Translation Service (mcstrans) is not installed. (Automated) + - id: 4542 + title: "Ensure the MCS Translation Service (mcstrans) is not installed." + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf." + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # yum remove mcstrans." + compliance: + - cis: ["1.6.1.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -qa mcstrans -> r:mcstrans" + + ############################################### + # 1.7 Warning Banners + ############################################### + + # 1.7.1 Ensure message of the day is configured properly. (Automated) + - id: 4543 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + + # 1.7.2 Ensure local login warning banner is configured properly. (Automated) + - id: 4544 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.7.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + + # 1.7.3 Ensure remote login warning banner is configured properly. (Automated) + - id: 4545 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + + # 1.7.4 Ensure permissions on /etc/motd are configured. (Automated) + - id: 4546 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd : # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.5 Ensure permissions on /etc/issue are configured. (Automated) + - id: 4547 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue : # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured. (Automated) + - id: 4548 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.8.1 Ensure GNOME Display Manager is removed. (Manual) + - id: 4549 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + impact: "Removing the GNOME Display manager will remove the GUI from the system." + remediation: "Run the following command to remove the gdm package # yum remove gdm." + references: + - "https://wiki.gnome.org/Projects/GDM" + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q gdm -> r:is not installed" + + # 1.8.2 Ensure GDM login banner is configured. (Automated) + - id: 4550 + title: "Ensure GDM login banner is configured." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Note: If a graphical login is not required, it should be removed to reduce the attack surface of the system." + remediation: "Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/01-banner-message) [org/gnome/login-screen] banner-message-enable=true banner-message-text='' Example Banner Text: 'Authorized users only. All activity may be monitored and reported.' Run the following command to update the system databases: # dconf update." + compliance: + - cis: ["1.8.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm -> r:user-db:user && r:system-db:gdm && r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - "f:/etc/dconf/db/gdm.d/01-banner-message -> r:[org/gnome/login-screen]" + - "f:/etc/dconf/db/gdm.d/01-banner-message -> r:banner-message-enable=true" + - "f:/etc/dconf/db/gdm.d/01-banner-message -> r:banner-message-text=" + + # 1.8.3 Ensure last logged in user display is disabled. (Automated) + - id: 4551 + title: "Ensure last logged in user display is disabled." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Displaying the last logged in user eliminates half of the Userid/Password equation that an unauthorized person would need to log on. Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Notes: - - If a graphical login is not required, it should be removed to reduce the attack surface of the system. If a different GUI login service is in use and required on the system, consult your documentation to disable displaying the last logged on user." + remediation: "Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/00-login-screen) [org/gnome/login-screen] # Do not show the user list disable-user-list=true Run the following command to update the system databases: # dconf update." + compliance: + - cis: ["1.8.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm -> r:user-db:user && r:system-db:gdm && r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - "f:/etc/dconf/db/gdm.d/01-banner-message -> r:[org/gnome/login-screen]" + - "f:/etc/dconf/db/gdm.d/01-banner-message -> r:disable-user-list=true" + + # 1.8.4 Ensure XDCMP is not enabled. (Automated) + - id: 4552 + title: "Ensure XDCMP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. - XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user - XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server." + remediation: "Edit the file /etc/gdm/custom.conf and remove the line Enable=true." + references: + - "https://help.gnome.org/admin/gdm/2.32/configuration.html.en" + compliance: + - cis: ["1.8.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "f:/etc/gdm/custom.conf -> r:Enable=true" + + # 1.9 Ensure updates, patches, and additional security software are installed. (Manual) - Not Implemented + + ############################################### + # 2.1 Remove Legacy Services + ############################################### + + # 2.1.1 Ensure xinetd is not installed. (Automated) + - id: 4553 + title: "Ensure xinetd is not installed." + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed to reduce the attack surface are of the system. Note: If an xinetd service or services are required, ensure that any xinetd service not required is stopped and disabled." + remediation: "Run the following command to remove xinetd: # yum remove xinetd." + compliance: + - cis: ["2.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -qa xinetd -> r:xinetd" + + # 2.2.1.1 Ensure time synchronization is in use. (Manual) + - id: 4554 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them. Note: - If another method for time synchronization is being used, this section may be skipped. - Only one time synchronization package should be installed." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Run One of the following commands to install chrony or NTP: To install chrony, run the following command: # yum install chrony OR To install ntp, run the following command: # yum install ntp Note: On systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization." + compliance: + - cis: ["2.2.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:rpm -q chrony -> r:^chrony-" + - "c:rpm -q ntp -> r:ntp-" + + # 2.2.1.2 Ensure chrony is configured. (Automated) + - id: 4555 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. Note: This recommendation only applies if chrony is in use on the system." + remediation: 'Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include ''-u chrony'': OPTIONS="-u chrony".' + compliance: + - cis: ["2.2.1.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\s*\t*\.+|^pool\s*\t*\.+' + - 'not c:ps -ef -> r:\.+/chronyd\s*\t*$ && !r:^\s*\t*chrony\s*\t*' + - 'f:/etc/sysconfig/chronyd -> r:^\s*\t*OPTIONS\.*-u chrony' + + # 2.2.1.3 Ensure ntp is configured. (Automated) + - id: 4556 + title: "Ensure ntp is configured." + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. Note: This recommendation only applies if ntp is in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: 'Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/ntpd to include ''-u ntp:ntp'': OPTIONS="-u ntp:ntp" Reload the systemd daemon: systemctl daemon-reload Enable and start the ntp service: systemctl --now enable ntpd.' + compliance: + - cis: ["2.2.1.3"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "f:/etc/ntp.conf" + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod && r:\s+nomodify && r:\s+notrap && r:\s+nopeer && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod && r:\s+nomodify && r:\s+notrap && r:\s+nopeer && r:\s+noquery' + + # 2.2.2 Ensure X11 Server components are not installed. (Automated) + - id: 4557 + title: "Ensure X11 Server components are not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: 'Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime.' + remediation: "Run the following command to remove the X Windows Server packages: # yum remove xorg-x11-server*." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -qa xorg-x11-server* -> r:xorg-x11-server*" + + # 2.2.3 Ensure Avahi Server is not installed. (Automated) + - id: 4558 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to stop, mask and remove avahi-autoipd and avahi: # systemctl stop avahi-daemon.socket avahi-daemon.service # yum remove avahi-autoipd avahi." + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q avahi -> r:^package avahi is not installed" + - "c:rpm -q avahi-autoipd -> r:package avahi-autoipd is not installed" + + # 2.2.4 Ensure CUPS is not installed. (Automated) + - id: 4559 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface. Note: Removing CUPS will prevent printing from the system." + impact: "Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to remove cups: # yum remove cups." + references: + - "http://www.cups.org." + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q cups -> r:^package cups is not installed" + + # 2.2.5 Ensure DHCP Server is not installed. (Automated) + - id: 4560 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that the dhcp package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcp: # yum remove dhcp." + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dhcp-server -> r:^package dhcp-server is not installed" + + # 2.2.6 Ensure LDAP server is not installed. (Automated) + - id: 4561 + title: "Ensure LDAP server is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to remove openldap-servers: # yum remove openldap-servers." + references: + - "http://www.openldap.org." + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q openldap-servers -> r:^package openldap-servers is not installed" + + # 2.2.7 Ensure DNS Server is not installed. (Automated) + - id: 4562 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove bind: # yum remove bind." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q bind -> r:^package bind is not installed" + + # 2.2.8 Ensure FTP Server is not installed. (Automated) + - id: 4563 + title: "Ensure FTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface. Note: Additional FTP servers also exist and should be removed if not required." + remediation: "Run the following command to remove vsftpd: # yum remove vsftpd." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q vsftpd -> r:^package vsftpd is not installed" + + # 2.2.9 Ensure HTTP server is not installed. (Automated) + - id: 4564 + title: "Ensure HTTP server is not installed." + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be removed to reduce the potential attack surface. Notes: - Several http servers exist. apache, apache2, lighttpd, and nginx are example packages that provide an HTTP server. - These and other packages should also be audited, and removed if not required." + remediation: "Run the following command to remove httpd: # yum remove httpd." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nginx -> r:^package nginx is not installed" + - "c:rpm -q httpd -> r:^package httpd is not installed" + + # 2.2.10 Ensure IMAP and POP3 server is not installed. (Automated) + - id: 4565 + title: "Ensure IMAP and POP3 server is not installed." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface. Notes: - Several IMAP/POP3 servers exist and can use other service names. courier-imap and cyrus-imap are example services that provide a mail server. - These and other services should also be audited and the packages removed if not required." + remediation: "Run the following command to remove dovecot: # yum remove dovecot." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dovecot -> r:^package dovecot is not installed" + - "c:rpm -q cyrus-imapd -> r:^package cyrus-imapd is not installed" + + # 2.2.11 Ensure Samba is not installed. (Automated) + - id: 4566 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # yum remove samba." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q samba -> r:^package samba is not installed" + + # 2.2.12 Ensure HTTP Proxy Server is not installed. (Automated) + - id: 4567 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "Unless a system is specifically set up to act as a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface. Note: Several HTTP proxy servers exist. These should be checked and removed unless required." + remediation: "Run the following command to remove the squid package: # yum remove squid." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q squid -> r:^package squid is not installed" + + # 2.2.13 Ensure net-snmp is not installed. (Automated) + - id: 4568 + title: "Ensure net-snmp is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. If SNMP v2 is absolutely necessary, modify the community strings' values. -." + remediation: "Run the following command to remove net-snmpd: # yum remove net-snmp." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q net-snmp -> r:^package net-snmp is not installed" + + # 2.2.14 Ensure NIS server is not installed. (Automated) + - id: 4569 + title: "Ensure NIS server is not installed." + description: "The ypserv package provides the Network Information Service (NIS). This service, formally known as Yellow Pages, is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the ypserv package be removed, and if required a more secure services be used." + remediation: "Run the following command to remove ypserv: # yum remove ypserv." + compliance: + - cis: ["2.2.14"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ypserv -> r:^package ypserv is not installed" + + # 2.2.15 Ensure telnet-server is not installed. (Automated) + - id: 4570 + title: "Ensure telnet-server is not installed." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to remove the telnet-server package: # yum remove telnet-server." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet-server -> r:^package telnet-server is not installed" + + # 2.2.16 Ensure mail transfer agent is configured for local-only mode. (Automated) + - id: 4571 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Notes: - This recommendation is designed around the postfix mail server. - Depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - 'c:ss -lntu -> r:\.*:25\.* && !r:\s*127.0.0.1:25\s*|\s*::1:25\s*' + + # 2.2.17 Ensure nfs-utils is not installed or the nfs-server service is masked. (Automated) + - id: 4572 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not require network shares, it is recommended that the nfs-utils package be removed to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # yum remove nfs-utils OR If the nfs-package is required as a dependency, run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server." + compliance: + - cis: ["2.2.17"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q nfs-utils -> r:^package nfs-utils is not installed" + - "c:systemctl is-enabled nfs-server -> r:masked|No such file or directory" + + # 2.2.18 Ensure rpcbind is not installed or the rpcbind services are masked. (Automated) + - id: 4573 + title: "Ensure rpcbind is not installed or the rpcbind services are masked." + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening." + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # yum remove rpcbind OR If the rpcbind package is required as a dependency, run the following commands to stop and mask the rpcbind and rpcbind.socket services: # systemctl --now mask rpcbind # systemctl --now mask rpcbind.socket." + compliance: + - cis: ["2.2.18"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rpcbind -> r:^package rpcbind is not installed" + - "not c:systemctl status rpcbind rpcbind.socket -> r:Loaded: && !r: masked" + + # 2.2.19 Ensure rsync is not installed or the rsyncd service is masked. (Automated) + - id: 4574 + title: "Ensure rsync is not installed or the rsyncd service is masked." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication. Note: If a required dependency exists for the rsync package, but the rsyncd service is not required, the service should be masked." + impact: "There are packages that are dependent on the rsync package. If the rsync package is removed, these packages will be removed as well. Before removing the rsync package, review any dependent packages to determine if they are required on the system. If a dependent package is required, mask the rsyncd service and leave the rsync package installed." + remediation: "Run the following command to remove the rsync package: # yum remove rsync OR Run the following command to mask the rsyncd service: # systemctl --now mask rsyncd." + compliance: + - cis: ["2.2.19"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rsync -> r:^package rsync is not installed" + - "c:systemctl is-enabled rsyncd -> r:masked|No such file or directory" + + ############################################### + # 2.3 Service Clients + ############################################### + + # 2.3.1 Ensure NIS Client is not installed. (Automated) + - id: 4575 + title: "Ensure NIS Client is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the ypbind package: # yum remove ypbind." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -qa ypbind -> r:ypbind" + + # 2.3.2 Ensure rsh client is not installed. (Automated) + - id: 4576 + title: "Ensure rsh client is not installed." + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the rsh package: # yum remove rsh." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -qa rsh -> r:rsh" + + # 2.3.3 Ensure talk client is not installed. (Automated) + - id: 4577 + title: "Ensure talk client is not installed." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the talk package: # yum remove talk." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -qa talk -> r:talk" + + # 2.3.4 Ensure telnet client is not installed. (Automated) + - id: 4578 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the telnet package: # yum remove telnet." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet -> r:^package telnet is not installed" + + # 2.3.5 Ensure LDAP client is not installed. (Automated) + - id: 4579 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Run the following command to remove the openldap-clients package: # yum remove openldap-clients." + compliance: + - cis: ["2.3.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q openldap-clients -> r:^package openldap-clients is not installed" + + # 2.4 Ensure nonessential services are removed or masked. (Manual) - Not Implemented + + ############################################### + # 3 Network Configuration + ############################################### + ############################################### + # 3.1 Uncommon Network Protocols + ############################################### + + # 3.1.1 Disable IPv6. (Manual) + - id: 4580 + title: "Disable IPv6." + description: "Although IPv6 has many advantages over IPv4, not all organizations have IPv6 or dual stack configurations implemented." + rationale: "If IPv6 or dual stack is not to be used, it is recommended that IPv6 be disabled to reduce the attack surface of the system." + impact: "If IPv6 is disabled through sysctl config, SSH X11forwarding may no longer function as expected. We recommend that SSH X11fowarding be disabled, but if required, the following will allow for SSH X11forwarding with IPv6 disabled through sysctl config: Add the following line the /etc/ssh/sshd_config file: AddressFamily inet Run the following command to re-start the openSSH server: # systemctl restart sshd." + remediation: 'Use one of the two following methods to disable IPv6 on the system: To disable IPv6 through the GRUB2 config: Edit /etc/default/grub and add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX="ipv6.disable=1" Ru the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg OR To disable IPv6 through sysctl settings: Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.disable_ipv6=1 # sysctl -w net.ipv6.conf.default.disable_ipv6=1 # sysctl -w net.ipv6.route.flush=1.' + compliance: + - cis: ["3.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'f:/boot/grub2/grubenv -> r:^\s*kernelopts=\.+ipv6.disable=1' + - 'f:/boot/grub2/grub.cfg -> r:^\s*\t*linux && !r:ipv6.disable=1' + - 'c:sysctl net.ipv6.conf.all.disable_ipv6 -> r:net.ipv6.conf.all.disable_ipv6\s*=\s*0' + - 'c:sysctl net.ipv6.conf.default.disable_ipv6 -> r:net.ipv6.conf.default.disable_ipv6\s*=\s*0' + + # 3.1.2 Ensure wireless interfaces are disabled. (Automated) - Not Implemented + + # 3.2.1 Ensure IP forwarding is disabled. (Automated) + - id: 4581 + title: "Ensure IP forwarding is disabled." + description: "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not." + rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Run the following commands to restore the default parameters and set the active kernel parameters: # grep -Els \"^\\s*net\\.ipv4\\.ip_forward\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv4\\.ip_forward\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv4.ip_forward=0; sysctl -w net.ipv4.route.flush=1 # grep -Els \"^\\s*net\\.ipv6\\.conf\\.all\\.forwarding\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv6\\.conf\\.all\\.forwarding\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv6.conf.all.forwarding=0; sysctl -w net.ipv6.route.flush=1." + compliance: + - cis: ["3.2.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.ip_forward\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.ip_forward\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.ip_forward\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.ip_forward\s*=\s*1$' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.ip_forward\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.forwarding\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.forwarding\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.forwarding\s*=\s*1$' + + # 3.2.2 Ensure packet redirect sending is disabled. (Automated) + - id: 4582 + title: "Ensure packet redirect sending is disabled." + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.2.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + ############################################### + # 3.3 Network Parameters (Host and Router) + ############################################### + + # 3.3.1 Ensure source routed packets are not accepted. (Automated) + - id: 4583 + title: "Ensure source routed packets are not accepted." + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1 IF IPv6 is not disabled: Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_source_route=0 # sysctl -w net.ipv6.conf.default.accept_source_route=0 # sysctl -w net.ipv6.route.flush=1." + compliance: + - cis: ["3.3.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + + # 3.3.2 Ensure ICMP redirects are not accepted. (Automated) + - id: 4584 + title: "Ensure ICMP redirects are not accepted." + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects and net.ipv6.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1 IF IPv6 is not disabled Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1." + compliance: + - cis: ["3.3.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + + # 3.3.3 Ensure secure ICMP redirects are not accepted. (Automated) + - id: 4585 + title: "Ensure secure ICMP redirects are not accepted." + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + # 3.3.4 Ensure suspicious packets are logged. (Automated) + - id: 4586 + title: "Ensure suspicious packets are logged." + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + # 3.3.5 Ensure broadcast ICMP requests are ignored. (Automated) + - id: 4587 + title: "Ensure broadcast ICMP requests are ignored." + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.5"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + # 3.3.6 Ensure bogus ICMP responses are ignored. (Automated) + - id: 4588 + title: "Ensure bogus ICMP responses are ignored." + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.6"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + # 3.3.7 Ensure Reverse Path Filtering is enabled. (Automated) + - id: 4589 + title: "Ensure Reverse Path Filtering is enabled." + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.7"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + + # 3.3.8 Ensure TCP SYN Cookies is enabled. (Automated) + - id: 4590 + title: "Ensure TCP SYN Cookies is enabled." + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.3.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + # 3.3.9 Ensure IPv6 router advertisements are not accepted. (Automated) + - id: 4591 + title: "Ensure IPv6 router advertisements are not accepted." + description: "This setting disables the system's ability to accept IPv6 router advertisements." + rationale: "It is recommended that systems do not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "IF IPv6 is enabled: Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1." + compliance: + - cis: ["3.3.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_raa -> r:^net.ipv6.conf.all.accept_raa\s*=\s*1$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:^net.ipv6.conf.default.accept_ra\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv6.conf.all.accept_raa\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.accept_raa\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.accept_raa\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.all.accept_raa\s*=\s*1$' + - 'f:/etc/sysctl.conf -> r:^net.ipv6.conf.default.accept_ra\s*=\s*1$' + - 'd:->/etc/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.default.accept_ra\s*=\s*1$' + - 'd:->/usr/lib/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.default.accept_ra\s*=\s*1$' + - 'd:->/run/sysctl.d/ -> r:\.*.conf -> r:^net.ipv6.conf.default.accept_ra\s*=\s*1$' + + ############################################### + # 3.4 Uncommon Network Protocols + ############################################### + + # 3.4.1 Ensure DCCP is disabled. (Automated) + - id: 4592 + title: "Ensure DCCP is disabled." + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/dccp.conf Add the following line: install dccp /bin/true." + compliance: + - cis: ["3.4.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:modprobe -n -v dccp -> r:install\s*\t*/bin/true' + - "not c:lsmod -> r:dccp" + + # 3.4.2 Ensure SCTP is disabled. (Automated) + - id: 4593 + title: "Ensure SCTP is disabled." + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/sctp.conf Add the following line: install sctp /bin/true." + compliance: + - cis: ["3.4.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:modprobe -n -v sctp -> r:install\s*\t*/bin/true' + - "not c:lsmod -> r:sctp" + + ############################################### + # 3.5 Firewall Configuration + ############################################### + ############################################### + # 3.5.1 Ensure Firewall software is installed + ############################################### + + # 3.5.1.1 Ensure firewalld is installed. (Automated) + - id: 4594 + title: "Ensure firewalld is installed." + description: "firewalld is a firewall management tool for Linux operating systems. It provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the iptables backend or provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the nftables utility. firewalld replaces iptables as the default firewall management tool. Use the firewalld utility to configure a firewall for less complex firewalls. The utility is easy to use and covers the typical use cases scenario. FirewallD supports both IPv4 and IPv6 networks and can administer separate firewall zones with varying degrees of trust as defined in zone profiles. Note: Starting in v0.6.0, FirewallD added support for acting as a front-end for the Linux kernel's netfilter framework via the nftables userspace utility, acting as an alternative to the nft command line program." + rationale: "A firewall utility is required to configure the Linux kernel's netfilter framework via the iptables or nftables back-end. The Linux kernel's netfilter framework host-based firewall can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host. Note: Only one firewall utility should be installed and configured. FirewallD is dependent on the iptables package." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install FirewallD and iptables: # yum install firewalld iptables." + compliance: + - cis: ["3.5.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - "c:rpm -q firewalld -> r:^firewalld-" + - "c:rpm -q iptables -> r:^iptables-" + + # 3.5.1.2 Ensure iptables-services not installed with firewalld. (Automated) + - id: 4595 + title: "Ensure iptables-services not installed with firewalld." + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both firewalld and the services included in the iptables-services package may lead to conflict." + impact: "Running both firewalld and iptables/ip6tables service may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package # systemctl stop iptables # systemctl stop ip6tables # yum remove iptables-services." + compliance: + - cis: ["3.5.1.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q iptables-services -> r:^package iptables-services is not installed" + + # 3.5.1.3 Ensure nftables either not installed or masked with firewalld. (Automated) + - id: 4596 + title: "Ensure nftables either not installed or masked with firewalld." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables. _Note: Support for using nftables as the back-end for firewalld was added in release v0.6.0. In Fedora 19 Linux derivatives, firewalld utilizes iptables as its back-end by default." + rationale: "Running both firewalld and nftables may lead to conflict. Note: firewalld may configured as the front-end to nftables. If this case, nftables should be stopped and masked instead of removed." + remediation: 'Run the following command to remove nftables: # yum remove nftables OR Run the following command to stop and mask nftables" systemctl --now mask nftables.' + compliance: + - cis: ["3.5.1.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q nftables -> r:package nftables is not installed" + - 'not c:systemctl status nftables -> r:active \(running\)|\(exited\)' + - "c:systemctl is-enabled nftables -> r:masked" + + # 3.5.1.4 Ensure firewalld service enabled and running. (Automated) + - id: 4597 + title: "Ensure firewalld service enabled and running." + description: "firewalld.service enables the enforcement of firewall rules configured through firewalld." + rationale: "Ensure that the firewalld.service is enabled and running to enforce firewall rules configured through firewalld." + impact: "Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following command to unmask firewalld # systemctl unmask firewalld Run the following command to enable and start firewalld # systemctl --now enable firewalld." + compliance: + - cis: ["3.5.1.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "p:firewalld" + - "c:firewall-cmd --state -> r:running" + + # 3.5.1.5 Ensure firewalld default zone is set. (Automated) - Not Implemented + # 3.5.1.6 Ensure network interfaces are assigned to appropriate zone. (Manual) - Not Implemented + # 3.5.1.7 Ensure firewalld drops unnecessary services and ports. (Manual) - Not Implemented + + # 3.5.2.1 Ensure nftables is installed. (Automated) + - id: 4598 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem. Note: - nftables is available in Linux kernel 3.13 and newer. - Only one firewall utility should be installed and configured." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install nftables # yum install nftables." + compliance: + - cis: ["3.5.2.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^nftables-" + + # 3.5.2.2 Ensure firewalld is either not installed or masked with nftables. (Automated) + - id: 4599 + title: "Ensure firewalld is either not installed or masked with nftables." + description: 'firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with support for network/firewall "zones" to assign a level of trust to a network and its associated connections, interfaces or sources. It has support for IPv4, IPv6, Ethernet bridges and also for IPSet firewall settings. There is a separation of the runtime and permanent configuration options.' + rationale: "Running both nftables.service and firewalld.service may lead to conflict and unexpected results." + remediation: "Run the following command to remove firewalld # yum remove firewalld OR Run the following command to stop and mask firewalld # systemctl --now mask firewalld." + compliance: + - cis: ["3.5.2.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "p:firewalld" + - "c:firewall-cmd --state -> r:running" + + # 3.5.2.3 Ensure iptables-services not installed with nftables. (Automated) + - id: 4600 + title: "Ensure iptables-services not installed with nftables." + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both nftables and the services included in the iptables-services package may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package # systemctl stop iptables # systemctl stop ip6tables # yum remove iptables-services." + compliance: + - cis: ["3.5.2.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q iptables-services -> r:^package iptables-services is not installed" + + # 3.5.2.4 Ensure iptables are flushed with nftables. (Manual) + - id: 4601 + title: "Ensure iptables are flushed with nftables." + description: "nftables is a replacement for iptables, ip6tables, ebtables and arptables." + rationale: "It is possible to mix iptables and nftables. However, this increases complexity and also the chance to introduce errors. For simplicity flush out all iptables rules, and ensure it is not loaded." + remediation: "Run the following commands to flush iptables: For iptables: # iptables -F For ip6tables: # ip6tables -F." + compliance: + - cis: ["3.5.2.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: none + rules: + - 'c:iptables -L -> !r:^\s*Chain|^\s*target && r:\s*\S+' + - 'c:ip6tables -L -> !r:^\s*Chain|^\s*target && r:\s*\S+' + + # 3.5.2.5 Ensure an nftables table exists. (Automated) + - id: 4602 + title: "Ensure an nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + impact: "Adding rules to a running nftables can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example: # nft create table inet filter." + compliance: + - cis: ["3.5.2.5"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:nft list tables -> r:\w+' + + # 3.5.2.6 Ensure nftables base chains exist. (Automated) + - id: 4603 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.5.2.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input" + - "c:nft list ruleset -> r:hook forward" + - "c:nft list ruleset -> r:hook output" + + # 3.5.2.7 Ensure nftables loopback traffic is configured. (Automated) + - id: 4604 + title: "Ensure nftables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # nft add rule inet filter input iif lo accept # nft create rule inet filter input ip saddr 127.0.0.0/8 counter drop IF IPv6 is enabled: Run the following command to implement the IPv6 loopback rules: # nft add rule inet filter input ip6 saddr ::1 counter drop." + compliance: + - cis: ["3.5.2.7"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:nft list ruleset -> r:iif "lo" accept' + - "c:nft list ruleset -> r:ip saddr 127.0.0.0/8 counter packets 0 bytes 0 drop" + + # 3.5.2.8 Ensure nftables outbound and established connections are configured. (Manual) - Not Implemented + + # 3.5.2.9 Ensure nftables default deny firewall policy. (Automated) + - id: 4605 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue traversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over the network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; } # nft chain inet filter output { policy drop \\; }." + compliance: + - cis: ["3.5.2.9"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input && r:policy drop" + - "c:nft list ruleset -> r:hook forward && r:policy drop" + - "c:nft list ruleset -> r:hook output && r:policy drop" + + # 3.5.2.10 Ensure nftables service is enabled. (Automated) + - id: 4606 + title: "Ensure nftables service is enabled." + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables." + compliance: + - cis: ["3.5.2.10"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled nftables -> r:enabled" + + # 3.5.2.11 Ensure nftables rules are permanent. (Automated) - Not Implemented + + ############################################### + # 3.5.3 Configure iptables + ############################################### + ############################################### + # 3.5.3.1 Configure IPv4 iptables + ############################################### + + # 3.5.3.1.1 Ensure iptables packages are installed. (Automated) + - id: 4607 + title: "Ensure iptables packages are installed." + description: "iptables is a utility program that allows a system administrator to configure the tables provided by the Linux kernel firewall, implemented as different Netfilter modules, and the chains and rules it stores. Different kernel modules and programs are used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames." + rationale: "A method of configuring and maintaining firewall rules is necessary to configure a Host Based Firewall." + remediation: "Run the following command to install iptables and iptables-services # yum install iptables iptables-services." + compliance: + - cis: ["3.5.3.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q iptables -> r:^iptables-" + - "c:rpm -q iptables-services -> r:iptables-services-" + + # 3.5.3.1.2 Ensure nftables is not installed with iptables. (Automated) + - id: 4608 + title: "Ensure nftables is not installed with iptables." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables." + rationale: "Running both iptables and nftables may lead to conflict." + remediation: "Run the following command to remove nftables: # yum remove nftables." + compliance: + - cis: ["3.5.3.1.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^package nftables is not installed" + + # 3.5.3.1.3 Ensure firewalld is either not installed or masked with iptables. (Automated) + - id: 4609 + title: "Ensure firewalld is either not installed or masked with iptables." + description: 'firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with support for network/firewall "zones" to assign a level of trust to a network and its associated connections, interfaces or sources. It has support for IPv4, IPv6, Ethernet bridges and also for IPSet firewall settings. There is a separation of the runtime and permanent configuration options.' + rationale: "Running iptables.service and\\or ip6tables.service with firewalld.service may lead to conflict and unexpected results." + remediation: "Run the following command to remove firewalld # yum remove firewalld OR Run the following command to stop and mask firewalld # systemctl --now mask firewalld." + compliance: + - cis: ["3.5.3.1.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -q firewalld -> r:package firewalld is not installed" + - 'not c:systemctl status firewalld -> r:active \(running\)' + - "c:systemctl is-enabled firewalld -> r:masked" + + # 3.5.3.2.1 Ensure iptables loopback traffic is configured. (Automated) + - id: 4610 + title: "Ensure iptables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP." + compliance: + - cis: ["3.5.3.2.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + # 3.5.3.2.2 Ensure iptables outbound and established connections are configured. (Manual) - Not Implemented + # 3.5.3.2.3 Ensure iptables rules exist for all open ports. (Automated) - Not Implemented + + # 3.5.3.2.4 Ensure iptables default deny firewall policy. (Automated) + - id: 4611 + title: "Ensure iptables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP." + compliance: + - cis: ["3.5.3.2.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)' + + # 3.5.3.2.5 Ensure iptables rules are saved. (Automated) - Not Implemented + + # 3.5.3.2.6 Ensure iptables is enabled and running. (Automated) + - id: 4612 + title: "Ensure iptables is enabled and running." + description: "iptables.service is a utility for configuring and maintaining iptables." + rationale: "iptables.service will load the iptables rules saved in the file /etc/sysconfig/iptables at boot, otherwise the iptables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start iptables: # systemctl --now enable iptables." + compliance: + - cis: ["3.5.3.2.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled iptables -> r:enabled" + - 'c:systemctl status iptables -> r:active \(running\)|\(exited\)' + + ############################################### + # 3.5.3.3 Configure IPv6 ip6tables + ############################################### + + # 3.5.3.3.1 Ensure ip6tables loopback traffic is configured. (Automated) + - id: 4613 + title: "Ensure ip6tables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP." + compliance: + - cis: ["3.5.3.3.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + # 3.5.3.3.2 Ensure ip6tables outbound and established connections are configured. (Manual) - Not Implemented + # 3.5.3.3.3 Ensure ip6tables firewall rules exist for all open ports. (Automated) - Not Implemented + + # 3.5.3.3.4 Ensure ip6tables default deny firewall policy. (Automated) + - id: 4614 + title: "Ensure ip6tables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP." + compliance: + - cis: ["3.5.3.3.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:ip6tables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:ip6tables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:ip6tables -L -> r:Chain OUTPUT \(policy DROP\)' + + # 3.5.3.3.5 Ensure ip6tables rules are saved. (Automated) - Not Implemented + + # 3.5.3.3.6 Ensure ip6tables is enabled and running. (Automated) + - id: 4615 + title: "Ensure ip6tables is enabled and running." + description: "ip6tables.service is a utility for configuring and maintaining ip6tables." + rationale: "ip6tables.service will load the iptables rules saved in the file /etc/sysconfig/ip6tables at boot, otherwise the ip6tables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start ip6tables: # systemctl --now start ip6tables." + compliance: + - cis: ["3.5.3.3.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:^\s*kernelopts=\.+ipv6.disable=1' + + ############################################### + # 4 Logging and Auditing + ############################################### + ############################################### + # 4.1.1 Configure System Accounting (auditd) + ############################################### + + # 4.1.1.1 Ensure auditd is installed. (Automated) + - id: 4616 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # yum install audit audit-libs." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q audit -> r:^audit-" + - "c:rpm -q audit-libs -> r:^audit-libs-" + + # 4.1.1.2 Ensure auditd service is enabled and running. (Automated) + - id: 4617 + title: "Ensure auditd service is enabled and running." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable and start auditd : # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:^enabled" + - 'c:systemctl status auditd -> r:Active: active \(running\)' + + # 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled. (Automated) + - id: 4618 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd , so that potential malicious activity cannot go undetected. Note: This recommendation is designed around the grub2 bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + remediation: 'Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX="audit=1" Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg.' + compliance: + - cis: ["4.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: none + rules: + - "f:/boot/grub2/grubenv -> r:kernelopts= && !r:audit=1" + + ############################################### + # 4.1.2 Configure Data Retention + ############################################### + + # 4.1.2.1 Ensure audit log storage size is configured. (Automated) + - id: 4619 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started. Notes: - The max_log_file parameter is measured in megabytes. - Other methods of log rotation may be appropriate based on site policy. One example is time-based rotation strategies which don't have native support in auditd configurations. Manual audit of custom configurations should be evaluated for effectiveness and completeness." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file\s*=\s*\d+' + + # 4.1.2.2 Ensure audit logs are not automatically deleted. (Automated) + - id: 4620 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.2", "6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file_action\s*=\s*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full. (Automated) + - id: 4621 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^admin_space_left_action\s*=\s*halt' + + # 4.1.2.4 Ensure audit_backlog_limit is sufficient. (Automated) + - id: 4622 + title: "Ensure audit_backlog_limit is sufficient." + description: "The backlog limit has a default setting of 64." + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more than 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected." + remediation: 'Edit /etc/default/grub and add audit_backlog_limit= to GRUB_CMDLINE_LINUX: Example: GRUB_CMDLINE_LINUX="audit_backlog_limit=8192" Run the following command to update the grub2 configuration: # grub2-mkconfig -o /boot/grub2/grub.cfg.' + compliance: + - cis: ["4.1.2.4"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:grubby --info=ALL -> n:^args=\.*\saudit_backlog_limit=(\d+) compare >= 8192' + + # 4.1.3 Ensure events that modify date and time information are collected. (Automated) + - id: 4623 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier "time-change" Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot.' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: 'For 32 bit systems Edit or Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify date and time information. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S adjtimex,settimeofday,clock_settime -k time-change -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime -k time-change -w /etc/localtime -p wa -k time-change \" >> /etc/audit/rules.d/50-time-change.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64. In addition, add stime to the system call audit. Example: -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime,stime -k time-change.' + compliance: + - cis: ["4.1.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:adjtimex && r:settimeofday|settimeofday -S stime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32|-F arch=b64 && r:-S && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change' + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:adjtimex && r:settimeofday|settimeofday -S stime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32|-F arch=b64 && r:-S && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change" + + # 4.1.4 Ensure events that modify user/group information are collected. (Automated) + - id: 4624 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file. Note: Reloading the auditd config to set active settings may require a system reboot.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-identity.rules Add the following lines: -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity." + compliance: + - cis: ["4.1.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/group -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/passwd -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/gshadow -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/shadow -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/security/opasswd -p wa -k identity' + - "c:auditctl -l -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity" + + # 4.1.5 Ensure events that modify the system's network environment are collected. (Automated) + - id: 4625 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre-login), /etc/hosts (file containing host names and associated IP addresses) and /etc/sysconfig/network (directory containing network interface scripts and configurations) files. Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: 'Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier "system-locale.".' + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-system_local.rules Add the following lines: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-system_local.rules Add the following lines: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale." + compliance: + - cis: ["4.1.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5", "6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2", "A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d -> r:.+.rules$" + - "d:/etc/audit/rules.d -> r:.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64|-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale" + - "d:/etc/audit/rules.d -> r:.+.rules$ -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale" + - "d:/etc/audit/rules.d -> r:.+.rules$ -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale" + - "d:/etc/audit/rules.d -> r:.+.rules$ -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale" + - "d:/etc/audit/rules.d -> r:.+.rules$ -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64|-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale|key=system-locale" + + # 4.1.6 Ensure events that modify the system's Mandatory Access Controls are collected. (Automated) + - id: 4626 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor SELinux mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux/ and /usr/share/selinux/ directories. Note: - If a different Mandatory Access Control method is used, changes to the corresponding directories should be audited. - Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Changes to files in the /etc/selinux/ and /usr/share/selinux/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-MAC_policy.rules Add the following lines: -w /etc/selinux/ -p wa -k MAC-policy -w /usr/share/selinux/ -p wa -k MAC-policy." + compliance: + - cis: ["4.1.6"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/selinux/ -p wa -k MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /usr/share/selinux/ -p wa -k MAC-policy' + - "c:auditctl -l -> r:^-w && r:/etc/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy" + - "c:auditctl -l -> r:^-w && r:/usr/share/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy" + + # 4.1.7 Ensure login and logout events are collected. (Automated) + - id: 4627 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. - The file /var/log/lastlog maintain records of the last time a user successfully logged in. - The /var/run/faillock/ directory maintains records of login failures via the pam_faillock module. Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-logins.rules Add the following lines: -w /var/log/lastlog -p wa -k logins -w /var/run/faillock/ -p wa -k logins." + compliance: + - cis: ["4.1.7"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.8.1.3", "A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/log/lastlog -p wa -k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/run/faillock/ -p wa -k logins' + - "c:auditctl -l -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins" + - "c:auditctl -l -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins" + + # 4.1.8 Ensure session initiation information is collected. (Automated) + - id: 4628 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. - /var/run/utmp - tracks all currently logged in users. - /var/log/wtmp - file tracks logins, logouts, shutdown, and reboot events. - /var/log/btmp - keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier "session.". - Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot.' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-session.rules Add the following lines: -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k logins -w /var/log/btmp -p wa -k logins." + compliance: + - cis: ["4.1.8"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.8.1.3", "A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/run/utmp -p wa -k session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/log/wtmp -p wa -k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/log/btmp -p wa -k logins' + - "c:auditctl -l -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session" + + # 4.1.9 Ensure discretionary access control permission modification events are collected. (Automated) - Not Implemented + + # 4.1.10 Ensure unsuccessful unauthorized file access attempts are collected. (Automated) + - id: 4629 + title: "Ensure unsuccessful unauthorized file access attempts are collected." + description: "Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation (creat), opening (open , openat) and truncation ( truncate , ftruncate) of files. An audit log record will only be written if the user is a non-privileged user (auid>=1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier \"access.\" Note: Systems may have been customized to change the default UID_MIN. To confirm the UID_MIN for your system, run the following command: # awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs If your systems' UID_MIN is not 1000, replace audit>=1000 with audit>= in the Audit and Remediation procedures. Reloading the auditd config to set active settings may require a system reboot." + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-access.rules Add the following lines: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-access.rules Add the following lines: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access." + compliance: + - cis: ["4.1.10"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:.+.rules$ -> r:-a always,exit && r:-F arch=b32|-F arch=b64 && r:-S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access' + - 'd:/etc/audit/rules.d -> r:.+.rules$ -> r:-a always,exit && r:-F arch=b32|-F arch=b64 && r:-S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access' + - 'c:auditctl -l -> r:-a always,exit && r:-F arch=b32|-F arch=b64 && r:-S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access' + - 'c:auditctl -l -> r:-a always,exit && r:-F arch=b32|-F arch=b64 && r:-S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access' + + # 4.1.11 Ensure use of privileged commands is collected. (Automated) - Not Implemented + + # 4.1.12 Ensure successful file system mounts are collected. (Automated) + - id: 4630 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user Note: Systems may have been customized to change the default UID_MIN. To confirm the UID_MIN for your system, run the following command: # awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs If your systems' UID_MIN is not 1000, replace audit>=1000 with audit>= in the Audit and Remediation procedures. Reloading the auditd config to set active settings may require a system reboot." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-mounts.rules Add the following lines: -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-mounts.rules Add the following lines: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts." + compliance: + - cis: ["4.1.12"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d -> r:.+.rules$ -> r:-a always,exit && r:-F arch=b32|-F arch=b64 && r:-S mount -F auid>=1000 -F auid!=4294967295 -k mounts" + - "d:/etc/audit/rules.d -> r:.+.rules$ -> r:-a always,exit && r:-F arch=b32|-F arch=b64 && r:-S mount-F auid>=1000 -F auid!=4294967295 -k mounts" + - "c:auditctl -l -> r:-a always,exit && r:-F arch=b32|-F arch=b64 && r:-S mount -F auid>=1000 -F auid!=4294967295 -k mounts" + + # 4.1.13 Ensure file deletion events by users are collected. (Automated) + - id: 4631 + title: "Ensure file deletion events by users are collected." + description: "Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for following system calls and tags them with the identifier \"delete\": - unlink - remove a file - unlinkat - remove a file attribute - rename - rename a file - renameat - rename a file attribute Note: Systems may have been customized to change the default UID_MIN. To confirm the UID_MIN for your system, run the following command: # awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs If your systems' UID_MIN is not 1000, replace audit>=1000 with audit>= in the Audit and Remediation procedures. Reloading the auditd config to set active settings may require a system reboot." + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-deletion.rules Add the following lines: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-deletion.rules Add the following lines: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete." + compliance: + - cis: ["4.1.13"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2", "13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d -> r:.+.rules$ -> r:-a always,exit && r:-F arch=b32|-F arch=b64 && r:-S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete" + - "d:/etc/audit/rules.d -> r:.+.rules$ -> r:-a always,exit && r:-F arch=b32|-F arch=b64 && r:-S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete" + - "c:auditctl -l -> r:-a always,exit && r:-F arch=b32|-F arch=b64 && r:-S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete" + + # 4.1.14 Ensure changes to system administration scope (sudoers) is collected. (Automated) + - id: 4632 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: "Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers or a file in the /etc/sudoers.d directory will be written to when the file or its attributes have changed. Note: Reloading the auditd config to set active settings may require a system reboot." + rationale: "Changes in the /etc/sudoers file, or a file in the /etc/sudoers.d/ directory can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-scope.rules Add the following lines: -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d/ -p wa -k scope." + compliance: + - cis: ["4.1.14"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers && r:-p wa && r:-k scope' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers.d/ && r:-p wa && r:-k scope' + + # 4.1.15 Ensure system administrator command executions (sudo) are collected. (Automated) + - id: 4633 + title: "Ensure system administrator command executions (sudo) are collected." + description: "sudo provides users with temporary elevated privileges to perform operations. Monitor the administrator with temporary elevated privileges and the operation(s) they performed." + rationale: "creating an audit log of administrators with temporary elevated privileges and the operation(s) they performed is essential to reporting. Administrators will want to correlate the events written to the audit trail with the records written to sudo logfile to verify if unauthorized commands have been executed. Note: Systems may have been customized to change the default UID_MIN. To confirm the UID_MIN for your system, run the following command: # awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs If your systems' UID_MIN is not 1000, replace audit>=1000 with audit>= in the Audit and Remediation procedures. Reloading the auditd config to set active settings may require a system reboot." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules: Example: vi /etc/audit/rules.d/50-actions.rules Add the following line: -a exit,always -F arch=b32 -C euid!=uid -F euid=0 -F auid>=1000 -F auid!=4294967295 -S execve -k actions For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules: Example: vi /etc/audit/rules.d/50-actions.rules Add the following lines: -a always,exit -F arch=b64 -C euid!=uid -F euid=0 -F auid>=1000 -F auid!=4294967295 -S execve -k actions -a always,exit -F arch=b32 -C euid!=uid -F euid=0 -F auid>=1000 -F auid!=4294967295 -S execve -k actions." + compliance: + - cis: ["4.1.15"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64|-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F euid=0 && r:-F auid!=4294967295 && r:-k actions|key=actions' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64|-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F euid=0 && r:-k actions|key=actions" + + # 4.1.16 Ensure kernel module loading and unloading is collected. (Automated) + - id: 4634 + title: "Ensure kernel module loading and unloading is collected." + description: 'Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of "modules". Note: Reloading the auditd config to set active settings requires the auditd service to be restarted, and may require a system reboot.' + rationale: "Monitoring the use of insmod , rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-modules.rules Add the following lines: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b32 -S init_module -S delete_module -k modules For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/50-modules.rules Add the following lines: -w /sbin/insmod -p x -k modules -w /sbin/rmmod -p x -k modules -w /sbin/modprobe -p x -k modules -a always,exit -F arch=b64 -S init_module -S delete_module -k modules." + compliance: + - cis: ["4.1.16"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /sbin/insmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /sbin/rmmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /sbin/modprobe && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d/ -> r:\.*.rules -> r:-a && r:always,exit|exit,always && r:-F arch=b\d\d && r:-S init_module && r:-S delete_module && r:-k modules' + + # 4.1.17 Ensure the audit configuration is immutable. (Automated) + - id: 4635 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: This setting will require the system to be rebooted to update the active auditd configuration settings.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the following line at the end of the file: -e 2." + compliance: + - cis: ["4.1.17"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not d:/etc/audit/rules.d -> r:\.+.rules$ -> !r:\s*\t*-e 2$' + + ############################################### + # 4.2 Configure Logging + ############################################### + # 4.2.1 Configure rsyslog + ############################################### + + # 4.2.1.1 Ensure rsyslog is installed. (Automated) + - id: 4636 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is a recommended replacement to the original syslogd daemon. rsyslog provides improvements over syslogd, including: connection-oriented (i.e. TCP) transmission of logs - - The option to log to database formats - Encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # yum install rsyslog." + compliance: + - cis: ["4.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q rsyslog -> r:^rsyslog-" + + # 4.2.1.2 Ensure rsyslog Service is enabled and running. (Automated) + - id: 4637 + title: "Ensure rsyslog Service is enabled and running." + description: "rsyslog needs to be enabled and running to perform logging." + rationale: "If the rsyslog service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable and start rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:enabled" + - 'c:systemctl status rsyslog -> r:active \(running\)' + + # 4.2.1.3 Ensure rsyslog default file permissions configured. (Automated) + - id: 4638 + title: "Ensure rsyslog default file permissions configured." + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files. The $FileCreateMode parameter specifies the file creation mode with which rsyslogd creates new files. If not specified, the value 0644 is used. Notes: - The value given must always be a 4-digit octal number, with the initial digit being zero. - This setting can be overridden by a less restrictive setting in any file ending in .conf in the /etc/rsyslog.d/ directory." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640." + compliance: + - cis: ["4.2.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\.*.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + # 4.2.1.4 Ensure logging is configured. (Manual) - Not Implemented + + # 4.2.1.5 Ensure rsyslog is configured to send logs to a remote log host. (Automated) + - id: 4639 + title: "Ensure rsyslog is configured to send logs to a remote log host." + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead. Note: Ensure that the selection of logfiles being sent follows local site policy." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add one of the following lines: Newer syntax: action(type="omfwd" target="" port="" protocol="tcp" action.resumeRetryCount="" queue.type="LinkedList" queue.size=") Example: *.* action(type="omfwd" target="192.168.2.100" port="514" protocol="tcp" action.resumeRetryCount="100" queue.type="LinkedList" queue.size="1000") Older syntax: *.* @@ Example: *.* @@192.168.2.100 Run the following command to reload the rsyslog configuration: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.5"] + - cis_csc_v8: ["8.9"] + - cis_csc_v7: ["6.6", "6.8"] + - nist_sp_800-53: ["AU-6(3)"] + - pci_dss_v3.2.1: ["10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.3.3"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> !r:# && r:^*.* @@\.+' + - 'f:/etc/rsyslog.conf -> !r:# && r:^*.* action && r:target="' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:# && r:^*.* @@\.+' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:# && r:^*.* action && r:target="' + + # 4.2.1.6 Ensure remote rsyslog messages are only accepted on designated log hosts. (Manual) + - id: 4640 + title: "Ensure remote rsyslog messages are only accepted on designated log hosts." + description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port. Note: The $ModLoad imtcp line can have the .so extension added to the end of the module, or use the full path to the module." + rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." + remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and uncomment or add the following lines: $ModLoad imtcp $InputTCPServerRun 514 For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514 Run the following command to reload the rsyslogd configuration: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not d:/etc/rsyslog.d -> r:\.+.conf$ -> r:^\s*\t*\$ModLoad imtcp|\s*\t*^\$InputTCPServerRun|^\s*\t*module load="imtcp"|^\s*\t*input type="imtcp" port="514"' + - 'not f:/etc/rsyslog.conf -> r:^\s*\t*\$ModLoad imtcp|^\s*\t*\$InputTCPServerRun|^\s*\t*module load="imtcp"|^\s*\t*input type="imtcp" port="514"' + + ############################################### + # 4.2.2.1 Configure systemd journal remote + ############################################### + + # 4.2.2.1 Ensure journald is configured to send logs to rsyslog. (Automated) + - id: 4641 + title: "Ensure journald is configured to send logs to rsyslog." + description: 'Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the rsyslog service provides a consistent means of log collection and export. Notes: - This recommendation assumes that recommendation 4.2.1.5, "Ensure rsyslog is configured to send logs to a remote log host" has been implemented. - The main configuration file /etc/systemd/journald.conf is read before any of the custom *.conf files. If there are custom configs present, they override the main configuration parameters - As noted in the journald man pages: journald logs may be exported to rsyslog either through the process mentioned here, or through a facility like systemd-journald.service. There are trade-offs involved in each implementation, where ForwardToSyslog will immediately capture all events (and forward to an external log server, if properly configured), but may not capture all boot-up activities. Mechanisms such as systemd-journald.service, on the other hand, will record bootup events, but may delay sending the information to rsyslog, leading to the potential for log manipulation prior to export. Be aware of the limitations of all tools employed to secure a system.' + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes." + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsyste" + compliance: + - cis: ["4.2.2.1"] + - cis_csc_v8: ["8.9"] + - cis_csc_v7: ["6.5"] + - nist_sp_800-53: ["AU-6(3)"] + - pci_dss_v3.2.1: ["10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.3.3"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + + # 4.2.2.2 Ensure journald is configured to compress large log files. (Automated) + - id: 4642 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large. Note: The main configuration file /etc/systemd/journald.conf is read before any of the custom *.conf files. If there are custom configs present, they override the main configuration parameters." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes." + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsyste" + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Compress\s*=\s*yes' + + # 4.2.2.3 Ensure journald is configured to write logfiles to persistent disk. (Automated) + - id: 4643 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss. Note: The main configuration file /etc/systemd/journald.conf is read before any of the custom *.conf files. If there are custom configs present, they override the main configuration parameters." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent." + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsyste" + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Storage\s*=\s*persistent' + + # 4.2.3 Ensure permissions on all logfiles are configured. (Manual) + - id: 4644 + title: "Ensure permissions on all logfiles are configured." + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected. Other/world should not have the ability to view this information. Group should not have the ability to modify this information." + remediation: 'Run the following commands to set permissions on all existing log files: # find /var/log -type f -exec chmod g-wx,o-rwx "{}" + Note: The configuration for your logging software or services may need to also be modified for any logs that had incorrect permissions, otherwise, the permissions may be reverted to the incorrect permissions.' + compliance: + - cis: ["4.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + + # 4.2.4 Ensure logrotate is configured. (Manual) - Not Implemented + + ############################################### + # 5 Access, Authentication and Authorization + ############################################### + ############################################### + # 5.1 Configure cron + ############################################### + + # 5.1.1 Ensure cron daemon is enabled and running. (Automated) + - id: 4645 + title: "Ensure cron daemon is enabled and running." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run. If another method for scheduling tasks is not being used, cron is used to execute them, and needs to be enabled and running." + remediation: "Run the following command to enable and start cron: # systemctl --now enable crond OR Run the following command to remove cron: # yum remove cronie." + compliance: + - cis: ["5.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:systemctl is-enabled crond -> r:enabled" + - 'c:systemctl status crond -> r:Active: active \(running\) since \w+ \d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d' + + # 5.1.2 Ensure permissions on /etc/crontab are configured. (Automated) + - id: 4646 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab: # chown root:root /etc/crontab # chmod u-x,og-rwx /etc/crontab OR Run the following command to remove cron: # yum remove cronie." + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured. (Automated) + - id: 4647 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.hourly/ directory: # chown root:root /etc/cron.hourly/ # chmod og-rwx /etc/cron.hourly/ OR Run the following command to remove cron # yum remove cronie." + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured. (Automated) + - id: 4648 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily directory: # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily OR Run the following command to remove cron: # yum remove cronie." + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured. (Automated) + - id: 4649 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly/ directory: # chown root:root /etc/cron.weekly/ # chmod og-rwx /etc/cron.weekly/ OR Run the following command to remove cron: # yum remove cronie." + compliance: + - cis: ["5.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured. (Automated) + - id: 4650 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly directory: # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly OR Run the following command to remove cron: # yum remove cronie." + compliance: + - cis: ["5.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured. (Automated) + - id: 4651 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d/ directory contains system cron jobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab , but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d directory: # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d OR Run the following command to remove cron: # yum remove cronie." + compliance: + - cis: ["5.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.8 Ensure cron is restricted to authorized users. (Automated) + - id: 4652 + title: "Ensure cron is restricted to authorized users." + description: "If cron is installed in the system, configure /etc/cron.allow to allow specific users to use these services. If /etc/cron.allow does not exist, then /etc/cron.deny is checked. Any user not specifically defined in those files is allowed to use cron. By removing the file, only users in /etc/cron.allow are allowed to use cron. Note: Even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following command to remove /etc/cron.deny: # rm /etc/cron.deny Run the following command to create /etc/cron.allow # touch /etc/cron.allow Run the following commands to set the owner and permissions on /etc/cron.allow: # chown root:root /etc/cron.allow # chmod u-x,og-rwx /etc/cron.allow OR Run the following command to remove cron # yum remove cronie." + compliance: + - cis: ["5.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:stat /etc/cron.deny -> r:No such file or directory$" + - 'c:stat /etc/cron.allow -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.9 Ensure at is restricted to authorized users. (Automated) + - id: 4653 + title: "Ensure at is restricted to authorized users." + description: "If at is installed in the system, configure /etc/at.allow to allow specific users to use these services. If /etc/at.allow does not exist, then /etc/at.deny is checked. Any user not specifically defined in those files is allowed to use at. By removing the file, only users in /etc/at.allow are allowed to use at. Note: Even though a given user is not listed in at.allow, at jobs can still be run as that user. The at.allow file only controls administrative access to the at command for scheduling and modifying at jobs." + rationale: "On many systems, only the system administrator is authorized to schedule at jobs. Using the at.allow file to control who can run at jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following command to remove /etc/at.deny: # rm /etc/at.deny Run the following command to create /etc/at.allow # touch /etc/at.allow Run the following commands to set the owner and permissions on /etc/at.allow: # chown root:root /etc/at.allow # chmod u-x,og-rwx /etc/at.allow OR Run the following command to remove at: # yum remove at." + compliance: + - cis: ["5.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:stat -L /etc/at.deny -> r:No such file or directory$" + - 'c:stat -L /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + ############################################### + # 5.2 Configure sudo + ############################################### + + # 5.2.1 Ensure sudo is installed. (Automated) + - id: 4654 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo. # yum install sudo." + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:rpm -q sudo -> r:sudo-" + + # 5.2.2 Ensure sudo commands use pty. (Automated) + - id: 4655 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo-pty Note: visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks for parse errors. If the sudoers file is currently being edited you will receive a message to try again later. The -f option allows you to tell visudo which file to edit." + rationale: "Attackers can run a malicious program using sudo, which would again fork a background process that remains even when the main program has finished executing. This can be mitigated by configuring sudo to run other commands only from a pseudo-pty, whether I/O logging is turned on or not." + remediation: "Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["5.2.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s+use_pty' + - 'd:/etc/sudoers.d -> r:\. -> r:^\s*Defaults\s+use_pty' + + # 5.2.3 Ensure sudo log file exists. (Automated) + - id: 4656 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file Note: visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks for parse errors. If the sudoers file is currently being edited you will receive a message to try again later. The -f option allows you to tell visudo which file to edit." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "Editing the sudo configuration incorrectly can cause sudo to stop functioning." + remediation: 'edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile="" Example: Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["5.2.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^Defaults logfile="' + - 'd:/etc/sudoers.d -> r:\. -> r:^Defaults\s+logfile="' + + ############################################### + # 5.2 Configure SSH + ############################################### + + # 5.3.1 Ensure permissions on /etc/ssh/sshd_config are configured. (Automated) + - id: 4657 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.3.2 Ensure permissions on SSH private host key files are configured. (Automated) - Not Implemented + # 5.3.3 Ensure permissions on SSH public host key files are configured. (Automated) - Not Implemented + + # 5.3.4 Ensure SSH access is limited. (Automated) + - id: 4658 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: o The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: o The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: o The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: o The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers OR AllowGroups OR DenyUsers OR DenyGroups ." + compliance: + - cis: ["5.3.4"] + - cis_csc_v8: ["3.3", "5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "MP.L2-3.8.2", "SC.L2-3.13.3"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1", "CC6.3"] + condition: any + rules: + - 'c:sshd -T -> r:^\s*AllowUsers\s+\w*|^\s*AllowGroups\s+\w*|^\s*DenyUsers\s+\w*|^\s*DenyGroups\s+\w*' + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowUsers\s+\w*|^\s*AllowGroups\s+\w*|^\s*DenyUsers\s+\w*|^\s*DenyGroups\s+\w*' + + # 5.3.5 Ensure SSH LogLevel is appropriate. (Automated) + - id: 4659 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE OR LogLevel INFO." + references: + - "https://www.ssh.com/ssh/sshd_config/" + compliance: + - cis: ["5.3.5"] + - cis_csc_v8: ["8.2", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*LogLevel\s+VERBOSE|^\s*LogLevel\s+INFO' + - 'f:/etc/ssh/sshd_config ->!r:^# && r:loglevel\s*(VERBOSE|INFO)' + + # 5.3.6 Ensure SSH X11 forwarding is disabled. (Automated) + - id: 4660 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through an existing SSH shell session to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + impact: "X11 programs on the server will not be able to be forwarded to a ssh-client display." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no." + compliance: + - cis: ["5.3.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:sshd -T -> r:^x11forwarding no" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*x11forwarding\\s*\\t*yes" + + # 5.3.7 Ensure SSH MaxAuthTries is set to 4 or less. (Automated) + - id: 4661 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4." + compliance: + - cis: ["5.3.7"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'f:/etc/ssh/sshd_config -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.3.8 Ensure SSH IgnoreRhosts is enabled. (Automated) + - id: 4662 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes." + compliance: + - cis: ["5.3.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:\s*ignorerhosts\s*yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*ignorerhosts\s+no' + + # 5.3.9 Ensure SSH HostbasedAuthentication is disabled. (Automated) + - id: 4663 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no." + compliance: + - cis: ["5.3.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*HostbasedAuthentication\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sHostbasedAuthentication\s+yes' + + # 5.3.10 Ensure SSH root login is disabled. (Automated) + - id: 4664 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no." + compliance: + - cis: ["5.3.10"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'c:sshd -T -> !r:^# && r:PermitRootLogin\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitRootLogin\s+yes' + + # 5.3.11 Ensure SSH PermitEmptyPasswords is disabled. (Automated) + - id: 4665 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no." + compliance: + - cis: ["5.3.11"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> !r:^# && r:PermitEmptyPasswords\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitEmptyPasswords\s+yes' + + # 5.3.12 Ensure SSH PermitUserEnvironment is disabled. (Automated) + - id: 4666 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing a Trojan's programs)." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no." + compliance: + - cis: ["5.3.12"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*PermitUserEnvironment\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitUserEnvironment\s+yes' + + # 5.3.13 Ensure only strong Ciphers are used. (Automated) + - id: 4667 + title: "Ensure only strong Ciphers are used." + description: "This variable limits the ciphers that SSH can use during communication. Note: Some organizations may have stricter requirements for approved ciphers. Ensure that ciphers used are in compliance with site policy." + rationale: 'Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised. - The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a "Sweet32" attack - The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involving LSB values, aka the "Bar Mitzvah" issue - The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session - Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors.' + remediation: "Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers Example: Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128- gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr." + references: + - "https://nvd.nist.gov/vuln/detail/CVE-2016-2183" + - "https://nvd.nist.gov/vuln/detail/CVE-2015-2808" + - "https://www.kb.cert.org/vuls/id/565052" + - "https://www.openssh.com/txt/cbc.adv" + - "https://nvd.nist.gov/vuln/detail/CVE-2008-5161" + - "https://nvd.nist.gov/vuln/detail/CVE-2013-4548" + compliance: + - cis: ["5.3.13"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - "c: sshd -T -> r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc|arcfour|arcfour128|arcfour256|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se" + - "not f:/etc/ssh/sshd_config -> r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc|arcfour|arcfour128|arcfour256|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se" + + # 5.3.14 Ensure only strong MAC algorithms are used. (Automated) + - id: 4668 + title: "Ensure only strong MAC algorithms are used." + description: "This variable Specifies the available MAC (message authentication code) algorithms. The MAC algorithm is used in protocol version 2 for data integrity protection. Multiple algorithms must be comma-separated. Note: Some organizations may have stricter requirements for approved MACs. Ensure that MACs used are in compliance with site policy." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information." + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2- 512,hmac-sha2-256." + references: + - "http://www.mitls.org/pages/attacks/SLOTH" + compliance: + - cis: ["5.3.14"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["14.4", "16.5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c: sshd -T -> r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com" + - "not f:/etc/ssh/sshd_config -> r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com" + + # 5.3.15 Ensure only strong Key Exchange algorithms are used. (Automated) + - id: 4669 + title: "Ensure only strong Key Exchange algorithms are used." + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received Note: Some organizations may have stricter requirements for approved Key Exchange algorithms. Ensure that Key Exchange algorithms used are in compliance with site policy." + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks." + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms Example: KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2- nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange- sha256." + compliance: + - cis: ["5.3.15"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c: sshd -T -C user=root -> r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1" + - "not f:/etc/ssh/sshd_config -> r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1" + + # 5.3.16 Ensure SSH Idle Timeout Interval is configured. (Automated) + - id: 4670 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. - ClientAliveInterval sets 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 default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax sets the number of client alive messages which may be sent without sshd receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. The default value is 3. o The client alive messages are sent through the encrypted channel o Setting ClientAliveCountMax to 0 disables connection termination Example: The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value reduces this risk. - The recommended ClientAliveInterval setting is no greater than 900 seconds (15 minutes) - The recommended ClientAliveCountMax setting is 0 - At the 15 minute interval, if the ssh session is inactive, the session will be terminated." + impact: "In some cases this setting may cause termination of long-running scripts over SSH or remote automation tools which rely on SSH. In developing the local site policy, the requirements of such scripts should be considered and appropriate ServerAliveInterval and ClientAliveInterval settings should be calculated to insure operational continuity." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy. This should include ClientAliveInterval between 1 and 900 and ClientAliveCountMax of 0: ClientAliveInterval 900 ClientAliveCountMax 0." + references: + - "https://man.openbsd.org/sshd_config" + compliance: + - cis: ["5.3.16"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*clientaliveinterval\s*\t*(\d+) compare => 1 && n:^\s*clientaliveinterval\s*\t*(\d+) compare <= 900' + - 'c:sshd -T -> n:^\s*clientalivecountmax\s*\t*(\d+) compare == 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*clientaliveinterval\s*\t*(\d+) compare => 1 && n:^\s*clientaliveinterval\s*\t*(\d+) compare <= 900' + - 'f:/etc/ssh/sshd_config -> n:^\s*clientalivecountmax\s*\t*(\d+) compare == 0' + + # 5.3.17 Ensure SSH LoginGraceTime is set to one minute or less. (Automated) + - id: 4671 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60." + compliance: + - cis: ["5.3.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*logingracetime\s*\t*(\d+) compare => 1 && n:^\s*logingracetime\s*\t*(\d+) compare <= 60' + - 'f:/etc/ssh/sshd_config -> n:^\s*logingracetime\s*\t*(\d+) compare => 1 && n:^\s*logingracetime\s*\t*(\d+) compare <= 60' + + # 5.3.18 Ensure SSH warning banner is configured. (Automated) + - id: 4672 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.3.18"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*Banner\s*\t*/etc/issue.net' + + # 5.3.19 Ensure SSH PAM is enabled. (Automated) + - id: 4673 + title: "Ensure SSH PAM is enabled." + description: 'UsePAM Enables the Pluggable Authentication Module interface. If set to "yes" this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types.' + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + impact: "If UsePAM is enabled, you will not be able to run sshd(5) as a non-root user." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes." + compliance: + - cis: ["5.3.19"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*usepam\s*yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*UsePAM\s+no' + + # 5.3.20 Ensure SSH AllowTcpForwarding is disabled. (Automated) + - id: 4674 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments that employ mainframe systems as their application backends. In those environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no." + references: + - "https://www.ssh.com/ssh/tunneling/example" + compliance: + - cis: ["5.3.20"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2", "13.5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.1", "A.13.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*allowtcpforwarding\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*AllowTcpForwarding\s+yes' + + # 5.3.21 Ensure SSH MaxStartups is configured. (Automated) + - id: 4675 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: maxstartups 10:30:60." + compliance: + - cis: ["5.3.21"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'c:sshd -T -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'c:sshd -T -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + + # 5.3.22 Ensure SSH MaxSessions is limited. (Automated) + - id: 4676 + title: "Ensure SSH MaxSessions is limited." + description: "The MaxSessions parameter Specifies the maximum number of open sessions permitted per network connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10." + compliance: + - cis: ["5.3.22"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'c:sshd -T -> n:^\s*MaxSessions\s+(\d+) compare <= 10' + - 'not f:/etc/ssh/sshd_config -> n:^\s*MaxSessions\s+(\d+) compare > 10' + + ############################################### + # 5.4 Configure PAM + ############################################### + + # 5.4.1 Ensure password creation requirements are configured. (Automated) + - id: 4677 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. The following options are set in the /etc/security/pwquality.conf file: Password Length: - minlen = 14 - password must be 14 characters or more Password complexity: - minclass = 4 - The minimum number of required classes of characters for the new password (digits, uppercase, lowercase, others) OR - dcredit = -1 - provide at least one digit - ucredit = -1 - provide at least one uppercase character - ocredit = -1 - provide at least one special character - lcredit = -1 - provide at least one lowercase character The following is set in the /etc/pam.d/password-auth and /etc/pam.d/system-auth files - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies. Notes: - Settings in /etc/security/pwquality.conf must use spaces around the = symbol. - Additional modules options may be set in the /etc/pam.d/password-auth and /etc/pam.d/system-auth files." + rationale: "Strong passwords and limited attempts before locking an account protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so try_first_pass retry=3." + compliance: + - cis: ["5.4.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:pam_pwquality.so && r:try_first_pass" + - "f:/etc/pam.d/system-auth -> r:pam_pwquality.so && r:try_first_pass" + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s+\t*=\s+\t*(\d+) compare >= 14' + + # 5.4.2 Ensure lockout for failed password attempts is configured. (Automated) + - id: 4678 + title: "Ensure lockout for failed password attempts is configured." + description: 'Lock out users after n unsuccessful consecutive login attempts. These settings are commonly configured with the pam_faillock.so module. Some environments may continue using the pam_tally2.so module, where this older method may simplify automation in mixed environments. Set the lockout number in deny= to the policy in effect at your site. unlock_time=_n_ is the number of seconds the account remains locked after the number of attempts configured in deny=_n_ has been met. Notes: - Additional module options may be set, recommendation only covers those listed here. - When modifying authentication configuration using the authconfig utility, the system-auth and password-auth files are overwritten with the settings from the authconfig utility. This can be avoided by creating symbolic links in place of the configuration files, which authconfig recognizes and does not overwrite. These symbolic links are the default for Fedora 19 derived distributions. - Use of the "audit" keyword may log credentials in the case of user error during - authentication. This risk should be evaluated in the context of the site policies of your organization. If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_faillock.so or the pam_tally2.so module, the user can be unlocked by issuing following commands. This command sets the failed count to 0, effectively unlocking the user. If pam_faillock.so is used: o o # faillock --user --reset o o # pam_tally2 -u --reset If pam_tally2.so is used:.' + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: 'Edit the files /etc/pam.d/system-auth and /etc/pam.d/password-auth and add the following lines: Modify the deny= and unlock_time= parameters to conform to local site policy, Not to be greater than deny=5 To use pam_faillock.so module, add the following lines to the auth section: auth required pam_faillock.so preauth silent audit deny=5 unlock_time=900 auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900 The auth sections should look similar to the following example: Note: The ordering on the lines in the auth section is important. The preauth line needs to below the line auth required pam_env.so and above all password validation lines. The authfail line needs to be after all password validation lines such as pam_sss.so. Incorrect order can cause you to be locked out of the system Example: auth required pam_env.so auth required pam_faillock.so preauth silent audit deny=5 unlock_time=900 # <- Under "auth required pam_env.so" auth sufficient pam_unix.so nullok try_first_pass auth [default=die] pam_faillock.so authfail audit deny=5 unlock_time=900 # <- Last auth line before "auth requisite pam_succeed_if.so" auth requisite pam_succeed_if.so uid >= 1000 quiet_success auth required pam_deny.so Add the following line to the account section: account required pam_faillock.so Example: account required pam_faillock.so account required pam_unix.so account sufficient pam_localuser.so account sufficient pam_pam_succeed_if.so uid < 1000 quiet account required pam_permit.so OR To use the pam_tally2.so module, add the following line to the auth section: auth required pam_tally2.so deny=5 onerr=fail unlock_time=900 The auth sections should look similar to the following example: Note: The ordering on the lines in the auth section is important. the additional line needs to below the line auth required pam_env.so and above all password validation lines. Example: auth required pam_env.so auth required pam_tally2.so deny=5 onerr=fail unlock_time=900 # <- Under "auth required pam_env.so" auth sufficient pam_unix.so nullok try_first_pass auth requisite pam_succeed_if.so uid >= 1000 quiet_success auth required pam_deny.so Add the following line to the account section: account required pam_tally2.so Example: account required pam_tally2.so account required pam_unix.so account sufficient pam_localuser.so account sufficient pam_pam_succeed_if.so uid < 1000 quiet account required pam_permit.so.' + references: + - "https://access.redhat.com/documentation/en-" + compliance: + - cis: ["5.4.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^\s*auth\.+required\.+pam_faillock.so\.+ && n:deny=(\d+) compare <= 5 && n:unlock_time=(\d+) compare >= 900' + - 'f:/etc/pam.d/system-auth -> r:^\s*auth\.+required\.+pam_faillock.so\.+ && n:deny=(\d+) compare <= 5 && n:unlock_time=(\d+) compare >= 900' + + # 5.4.3 Ensure password hashing algorithm is SHA-512. (Automated) + - id: 4679 + title: "Ensure password hashing algorithm is SHA-512." + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm. Note: - These changes only apply to accounts configured on the local system. - Additional module options may be set, recommendation only covers those listed here." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords." + remediation: "Edit the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include sha512 option and remove the md5 option for pam_unix.so: password sufficient pam_unix.so sha512 Note: - Any system accounts that need to be expired should be carefully done separately by the - system administrator to prevent any potential problems. If it is determined that the password algorithm being used is not SHA-512, once it is changed, it is recommended that all user ID's be immediately expired and forced to change their passwords on next login, In accordance with local site policies. - To accomplish this, the following command can be used. o This command intentionally does not affect the root account. The root account's password will also need to be changed. # awk -F: '( $3<'\"$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs)\"' && $1 !~ /^(nfs)?nobody$/ && $1 != \"root\" ) { print $1 }' /etc/passwd | xargs -n 1 chage -d 0." + compliance: + - cis: ["5.4.3"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so && r:sha512' + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so && r:sha512' + + # 5.4.4 Ensure password reuse is limited. (Automated) + - id: 4680 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. Note: Additional module options may be set, recommendation only covers those listed here." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password." + remediation: "Edit both the /etc/pam.d/password-auth and /etc/pam.d/system-auth files to include the remember option and conform to site policy as shown: Note: Add or modify the line containing the pam_pwhistory.so after the first occurrence of password requisite: password required pam_pwhistory.so remember=5 Example: (Second line is modified) password requisite pam_pwquality.so try_first_pass local_users_only authtok_type= password required pam_pwhistory.so use_authtok remember=5 retry=3 password sufficient pam_unix.so sha512 shadow nullok try_first_pass use_authtok password required pam_deny.so." + compliance: + - cis: ["5.4.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["16"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+requisite\.+pam_pwquality\.so\.+ && n:remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so\.+ && n:remember=(\d+) compare >= 5' + + ############################################### + # 5.5 User Accounts and Environment + ############################################### + ############################################### + # 5.5.1 Set Shadow Password Suite Parameters + ############################################### + + # 5.5.1.1 Ensure password expiration is 365 days or less. (Automated) + - id: 4681 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days. Notes: - A value of -1 will disable password expiration. - The password expiration must be greater than the minimum days between password changes or users will be unable to change their password." + rationale: "The window of opportunity for an attacker to leverage compromised credentials via a brute force attack, using already compromised credentials, or gaining the credentials by other means, can be limited by the age of the password. Therefore, reducing the maximum age of a password can also reduce an attacker's window of opportunity. Requiring passwords to be changed helps to mitigate the risk posed by the poor security practice of passwords being used for multiple accounts, and poorly implemented off-boarding and change of responsibility policies. This should not be considered a replacement for proper implementation of these policies and practices. Note: If it is believed that a user's password may have been compromised, the user's account should be locked immediately. Local policy should be followed to ensure the secure update of their password." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + compliance: + - cis: ["5.5.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + + # 5.5.1.2 Ensure minimum days between password changes is configured. (Automated) + - id: 4682 + title: "Ensure minimum days between password changes is configured." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 1 in /etc/login.defs : PASS_MIN_DAYS 1 Modify user parameters for all users with a password set to match: # chage --mindays 1 ." + compliance: + - cis: ["5.5.1.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 1' + + # 5.5.1.3 Ensure password expiration warning days is 7 or more. (Automated) + - id: 4683 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs : PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["5.5.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + # 5.5.1.4 Ensure inactive password lock is 30 days or less. (Automated) + - id: 4684 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled. Note: A value of -1 would disable this setting." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["5.5.1.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.9"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*(\d+) compare <= 30' + + # 5.5.1.5 Ensure all users last password change date is in the past. (Automated) - Not Implemented + # 5.5.2 Ensure system accounts are secured. (Automated) - Not Implemented + + # 5.5.3 Ensure default group for the root account is GID 0. (Automated) + - id: 4685 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.5.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\w:\w:0' + + # 5.5.4 Ensure default user shell timeout is configured. (Automated) + - id: 4686 + title: "Ensure default user shell timeout is configured." + description: "TMOUT is an environmental setting that determines the timeout of a shell in seconds. - TMOUT=n - Sets the shell timeout to n seconds. A setting of TMOUT=0 disables - timeout. readonly TMOUT-Sets the TMOUT environmental variable as readonly, preventing unwanted modification during run-time. -export TMOUT -exports the TMOUT variable System Wide Shell Configuration Files: -/etc/profile -used to set system wide environmental variables on users shells. The variables are sometimes the same ones that are in the .bash_profile, however this file is used to set an initial PATH or PS1 for all shell users of the system. is only executed for interactive login shells, or shells executed with the --login parameter. -/etc/profile.d -/etc/profile will execute the scripts within /etc/profile.d/*.sh. It is recommended to place your configuration in a shell script within /etc/profile.d to set your own system wide environmental variables. -/etc/bashrc -System wide version of .bashrc. In Fedora derived distributions, etc/bashrc also invokes /etc/profile.d/*.sh if non-login shell, but redirects output to /dev/null if non-interactive. Is only executed for interactive shells or if BASH_ENV is set to /etc/bashrc." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized user access to another user's shell session that has been left unattended. It also ends the inactive session and releases the resources associated with that session." + remediation: "Review /etc/bashrc, /etc/profile, and all files ending in *.sh in the /etc/profile.d/ directory and remove or edit all TMOUT=_n_ entries to follow local site policy. TMOUT should not exceed 900 or be equal to 0. Configure TMOUT in one of the following files: - A file in the /etc/profile.d/ directory ending in .sh - /etc/profile - /etc/bashrc TMOUT configuration examples: - As multiple lines: TMOUT=900 readonly TMOUT export TMOUT - As a single line: readonly TMOUT=900 ; export TMOUT." + compliance: + - cis: ["5.5.4"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - 'not f:/etc/bashrc -> !r:^# && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not c:grep -Rh TMOUT /etc/profile /etc/profile.d/*.sh -> !r:^# && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'f:/etc/bashrc -> !r:^# && n:readonly TMOUT\s*=\s*(\d+)\s*; compare <= 900 && r:export TMOUT\s*$' + - 'c:grep -Rh TMOUT /etc/profile /etc/profile.d/*.sh -> !r:^# && n:readonly TMOUT\s*=\s*(\d+)\s*; compare <= 900 && r:export TMOUT\s*$' + + # 5.5.5 Ensure default user umask is configured. (Automated) + - id: 4687 + title: "Ensure default user umask is configured." + description: "The user file-creation mode mask (umask) is use to determine the file permission for newly created directories and files. In Linux, the default permissions for any newly created directory is 0777 (rwxrwxrwx), and for any newly created file it is 0666 (rw-rw-rw-). The umask modifies the default Linux permissions by restricting (masking) these permissions. The umask is not simply subtracted, but is processed bitwise. Bits set in the umask are cleared in the resulting file mode. umask can be set with either octal or Symbolic values: - Octal (Numeric) Value - Represented by either three or four digits. ie umask 0027 or umask 027. If a four digit umask is used, the first digit is ignored. The remaining three digits effect the resulting permissions for user, group, and world/other respectively. - Symbolic Value - Represented by a comma separated list for User u, group g, and world/other o. The permissions listed are not masked by umask. ie a umask set by umask u=rwx,g=rx,o= is the Symbolic equivalent of the Octal umask 027. This umask would set a newly created directory with file mode drwxr-x--- and a newly created file with file mode rw-r-----. The default umask can be set to use the pam_umask module or in a System Wide Shell Configuration File. The user creating the directories or files has the discretion of changing the permissions via the chmod command, or choosing a different default umask by adding the umask command into a User Shell Configuration File, (.bash_profile or .bashrc), in their home directory. Setting the default umask: - pam_umask module: o will set the umask according to the system default in /etc/login.defs and user settings, solving the problem of different umask settings with different shells, display managers, remote sessions etc. o umask= value in the /etc/login.defs file is interpreted as Octal o Setting USERGROUPS_ENAB to yes in /etc/login.defs (default): will enable setting of the umask group bits to be the same as owner bits. (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is the same as gid, and username is the same as the userdel will remove the user's group if it contains no more members, and useradd will create by default a group with the name of the user - System Wide Shell Configuration File: o /etc/profile - used to set system wide environmental variables on users shells. The variables are sometimes the same ones that are in the .bash_profile, however this file is used to set an initial PATH or PS1 for all shell users of the system. is only executed for interactive login shells, or shells executed with the --login parameter. o /etc/profile.d - /etc/profile will execute the scripts within /etc/profile.d/*.sh. It is recommended to place your configuration in a shell script within /etc/profile.d to set your own system wide environmental variables. o /etc/bashrc - System wide version of .bashrc. In Fedora derived distributions, etc/bashrc also invokes /etc/profile.d/*.sh if non-login shell, but redirects output to /dev/null if non-interactive. Is only executed for interactive shells or if BASH_ENV is set to /etc/bashrc. User Shell Configuration Files: - ~/.bash_profile - Is executed to configure your shell before the initial command prompt. Is only read by login shells. - ~/.bashrc - Is executed for interactive shells. only read by a shell that's both interactive and non-login." + rationale: "Setting a secure default value for umask ensures that users make a conscious choice about their file permissions. A permissive umask value could result in directories or files with excessive permissions that can be read and/or written to by unauthorized users." + remediation: "Review /etc/bashrc, /etc/profile, and all files ending in *.sh in the /etc/profile.d/ directory and remove or edit all umask entries to follow local site policy. Any remaining entries should be: umask 027, umask u=rwx,g=rx,o= or more restrictive. Configure umask in one of the following files: - A file in the /etc/profile.d/ directory ending in .sh - /etc/profile - /etc/bashrc Example: # vi /etc/profile.d/set_umask.sh umask 027 Run the following command and remove or modify the umask of any returned files: # grep -RPi '(^|^[^#]*)\\s*umask\\s+([0-7][0-7][01][0-7]\\b|[0-7][0-7][0-7][0- 6]\\b|[0-7][01][0-7]\\b|[0-7][0-7][0- 6]\\b|(u=[rwx]{0,3},)?(g=[rwx]{0,3},)?o=[rwx]+\\b|(u=[rwx]{1,3},)?g=[^rx]{1,3}( ,o=[rwx]{0,3})?\\b)' /etc/login.defs /etc/profile* /etc/bashrc* Follow one of the following methods to set the default user umask: Edit /etc/login.defs and edit the UMASK and USERGROUPS_ENAB lines as follows: UMASK 027 USERGROUPS_ENAB no Edit the files /etc/pam.d/password-auth and /etc/pam.d/system-auth and add or edit the following: session optional pam_umask.so OR Configure umask in one of the following files: - A file in the /etc/profile.d/ directory ending in .sh - /etc/profile - /etc/bashrc Example: /etc/profile.d/set_umask.sh umask 027 Note: this method only applies to bash and shell. If other shells are supported on the system, it is recommended that their configuration files also are checked." + compliance: + - cis: ["5.5.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1", "13"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'f:/etc/bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + # 5.6 Ensure root login is restricted to system console. (Manual) - Not Implemented + + # 5.7 Ensure access to the su command is restricted. (Automated) + - id: 4688 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^\s*\t*# && r:auth\s*\t*required\s*\t*pam_wheel.so && r:use_uid && r:group=\w+' + + # 6.1.1 Audit system file permissions. (Manual) - Not Implemented + + ############################################### + # 6 System Maintenance + ############################################### + ############################################### + # 6.1 System File Permissions + ############################################### + + # 6.1.2 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 4689 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/passwd : # chown root:root /etc/passwd # chmod u-x,g-wx,o-wx /etc/passwd." + compliance: + - cis: ["6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.3 Ensure permissions on /etc/passwd- are configured. (Automated) + - id: 4690 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/passwd- : # chown root:root /etc/passwd- # chmod u-x,go-wx /etc/passwd-." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/passwd- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.4 Ensure permissions on /etc/shadow are configured. (Automated) + - id: 4691 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following commands to set owner, group, and permissions on /etc/shadow : # chown root:root /etc/shadow # chmod 0000 /etc/shadow." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/shadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + + # 6.1.5 Ensure permissions on /etc/shadow- are configured. (Automated) + - id: 4692 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/shadow- : # chown root:root /etc/shadow- # chmod 0000 /etc/shadow-." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/shadow- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + + # 6.1.6 Ensure permissions on /etc/gshadow- are configured. (Automated) + - id: 4693 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chmod 0000 /etc/gshadow-." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/gshadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + + # 6.1.7 Ensure permissions on /etc/gshadow are configured. (Automated) + - id: 4694 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run the following commands to set owner, group, and permissions on /etc/gshadow : # chown root:root /etc/gshadow # chmod 0000 /etc/gshadow." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/gshadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + + # 6.1.8 Ensure permissions on /etc/group are configured. (Automated) + - id: 4695 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following commands to set owner, group, and permissions on /etc/group : # chown root:root /etc/group # chmod u-x,g-wx,o-wx /etc/group." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.9 Ensure permissions on /etc/group- are configured. (Automated) + - id: 4696 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/group-: # chown root:root /etc/group- # chmod u-x,go-wx /etc/group-." + compliance: + - cis: ["6.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.10 Ensure no world writable files exist. (Automated) - Not Implemented + # 6.1.11 Ensure no unowned files or directories exist. (Automated) - Not Implemented + # 6.1.12 Ensure no ungrouped files or directories exist. (Automated) - Not Implemented + # 6.1.13 Audit SUID executables. (Manual) - Not Implemented + # 6.1.14 Audit SGID executables. (Manual) - Not Implemented + + # 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords. (Automated) + - id: 4697 + title: "Ensure accounts in /etc/passwd use shadowed passwords." + description: "Local accounts can uses shadowed passwords. With shadowed passwords, The passwords are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. Accounts with a shadowed password have an x in the second field in /etc/passwd." + rationale: "The /etc/passwd file also contains information like user ID's and group ID's that are used by many system programs. Therefore, the /etc/passwd file must remain world readable. In spite of encoding the password with a randomly-generated one-way hash function, an attacker could still break the system if they got access to the /etc/passwd file. This can be mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. This helps mitigate the risk of an attacker gaining access to the encoded passwords with which to perform a dictionary attack. Notes: - All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user. - A user account with an empty second field in /etc/passwd allows the account to be logged into by providing only the username." + remediation: "If any accounts in the /etc/passwd file do not have a single x in the password field, run the following command to set these accounts to use shadowed passwords: # sed -e 's/^\\([a-zA-Z0-9_]*\\):[^:]*:/\\1:x:/' -i /etc/passwd Investigate to determine if the account is logged in and what it is being used for, to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^\w+:x:' + + # 6.2.2 Ensure /etc/shadow password fields are not empty. (Automated) + - id: 4698 + title: "Ensure /etc/shadow password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + # 6.2.3 Ensure all groups in /etc/passwd exist in /etc/group. (Automated) - Not Implemented + # 6.2.4 Ensure shadow group is empty. (Automated) - Not Implemented + # 6.2.5 Ensure no duplicate user names exist. (Automated) - Not Implemented + # 6.2.6 Ensure no duplicate group names exist. (Automated) - Not Implemented + # 6.2.7 Ensure no duplicate UIDs exist. (Automated) - Not Implemented + # 6.2.8 Ensure no duplicate GIDs exist. (Automated) - Not Implemented + # 6.2.9 Ensure root is the only UID 0 account. (Automated) + - id: 4699 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' + + # 6.2.10 Ensure root PATH Integrity. (Automated) - Not Implemented + # 6.2.11 Ensure all users' home directories exist. (Automated) - Not Implemented + # 6.2.12 Ensure users own their home directories. (Automated) - Not Implemented + # 6.2.13 Ensure users' home directories permissions are 750 or more restrictive. (Automated) - Not Implemented + # 6.2.14 Ensure users' dot files are not group or world writable. (Automated) - Not Implemented + # 6.2.15 Ensure no users have .forward files. (Automated) - Not Implemented + # 6.2.16 Ensure no users have .netrc files. (Automated) - Not Implemented + # 6.2.17 Ensure no users have .rhosts files. (Automated) - Not Implemented diff --git a/etc/ruleset/sca/rhel/8/cis_rhel8_linux.yml b/etc/ruleset/sca/rhel/8/cis_rhel8_linux.yml new file mode 100644 index 0000000000..a288426c9e --- /dev/null +++ b/etc/ruleset/sca/rhel/8/cis_rhel8_linux.yml @@ -0,0 +1,4706 @@ +# Security Configuration Assessment +# CIS Checks for RHEL 8. +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software Foundation +# +# +# Based on: +# Center for Internet Security Red Hat Enterprise Linux 8 Benchmark v2.0.0 - 02-23-2022 + +policy: + id: "cis_rhel8_linux" + file: "cis_rhel8_linux.yml" + name: "CIS Red Hat Enterprise Linux 8 Benchmark v2.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Red Hat Enterprise Linux 8 systems running on x86 and x64 platforms. This document was tested against Red Hat Enterprise Linux 8." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check RHEL8 family platform" + description: "Requirements for running the policy against RHEL 8 family." + condition: any + rules: + - "f:/etc/redhat-release -> r:^Red Hat Enterprise Linux && r:release 8" + - "f:/etc/redhat-release -> r:^Cloud && r:release 8" + - "f:/etc/redhat-release -> r:^Oracle && r:release 8" + - "f:/etc/redhat-release -> r:^Better && r:release 8" + - "f:/etc/redhat-release -> r:^OpenVZ && r:release 8" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # 1.1.1.1 Ensure mounting of cramfs filesystems is disabled. (Automated) + - id: 5000 + title: "Ensure mounting of cramfs filesystems is disabled." + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf with a line that reads install cramfs /bin/false and a line the reads blacklist cramfs. Example: # printf "install cramfs /bin/false blacklist cramfs " >> /etc/modprobe.d/cramfs.conf Run the following command to unload the cramfs module: # modprobe -r cramfs.' + compliance: + - cis: ["1.1.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:install /bin/false|Module cramfs not found" + - "not c:lsmod -> r:cramfs" + - 'd:/etc/modprobe.d -> r:\.*.conf -> r:blacklist\t*\s*cramfs' + + # 1.1.1.2 Ensure mounting of squashfs filesystems is disabled. (Automated) + - id: 5001 + title: "Ensure mounting of squashfs filesystems is disabled." + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: 'As Snap packages utilizes squashfs as a compressed filesystem, disabling squashfs will cause Snap packages to fail. Snap application packages of software are self-contained and work across a range of Linux distributions. This is unlike traditional Linux package management approaches, like APT or RPM, which require specifically adapted packages per Linux distribution on an application update and delay therefore application deployment from developers to their software''s end-user. Snaps themselves have no dependency on any external store ("App store"), can be obtained from any source and can be therefore used for upstream software deployment.' + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf with the lines that reads install squashfs /bin/false and blacklist squashfs. Example: # printf "install squashfs /bin/false blacklist squashfs " >> /etc/modprobe.d/squashfs.conf Run the following command to unload the squashfs module: # modprobe -r squashfs.' + compliance: + - cis: ["1.1.1.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/false|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + - 'd:/etc/modprobe.d -> r:\.*.conf -> r:blacklist\t*\s*squashfs' + + # 1.1.1.3 Ensure mounting of udf filesystems is disabled. (Automated) + - id: 5002 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: "Microsoft Azure requires the usage of udf. udf should not be disabled on systems run on Microsoft Azure." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf with a line that reads install udf /bin/false. Example: # printf "install udf /bin/false blacklist udf " >> /etc/modprobe.d/udf.conf Run the following command to unload the udf module: # modprobe -r udf.' + compliance: + - cis: ["1.1.1.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v udf -> r:install /bin/false|Module udf not found" + - "not c:lsmod -> r:udf" + - 'd:/etc/modprobe.d -> r:\.*.conf -> r:blacklist\t*\s*udf' + + # 1.1.2.1 Ensure /tmp is a separate partition. (Automated) + - id: 5003 + title: "Ensure /tmp is a separate partition." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a configuration where /tmp is not a separate file system it will essentially have the whole disk available, as the default installation only creates a single / partition. On the other hand, a RAM-based /tmp (as with tmpfs) will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily. Another alternative is to create a dedicated partition for /tmp from a separate volume or disk. One of the downsides of a disk-based dedicated partition is that it will be slower than tmpfs which is RAM-based. /tmp utilizing tmpfs can be resized using the size={size} parameter in the relevant entry in /etc/fstab." + remediation: "First ensure that systemd is correctly configured to ensure that /tmp will be mounted at boot time. # systemctl unmask tmp.mount For specific configuration requirements of the /tmp mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs /tmp 0 tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 Example of using a volume or disk with specific mount options. The source location of the volume or disk will vary depending on your environment. /tmp defaults,nodev,nosuid,noexec 0 0." + references: + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + - "https://www.freedesktop.org/software/systemd/man/systemd-fstab" + compliance: + - cis: ["1.1.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s' + - "c:systemctl is-enabled tmp.mount -> r:enabled|static|generated" + + # 1.1.2.2 Ensure nodev option set on /tmp partition. (Automated) + - id: 5004 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nodev" + + # 1.1.2.3 Ensure noexec option set on /tmp partition. (Automated) + - id: 5005 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:noexec" + + # 1.1.2.4 Ensure nosuid option set on /tmp partition. (Automated) + - id: 5006 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nosuid" + + # 1.1.3.1 Ensure separate partition exists for /var. (Automated) + - id: 5007 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "The reasoning for mounting /var on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s' + + # 1.1.3.2 Ensure nodev option set on /var partition. (Automated) + - id: 5008 + title: "Ensure nodev option set on /var partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:nodev" + + # 1.1.3.3 Ensure noexec option set on /var partition. (Automated) + - id: 5009 + title: "Ensure noexec option set on /var partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot run executable binaries from /var." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:noexec" + + # 1.1.3.4 Ensure nosuid option set on /var partition. (Automated) + - id: 5010 + title: "Ensure nosuid option set on /var partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:nosuid" + + # 1.1.4.1 Ensure separate partition exists for /var/tmp. (Automated) + - id: 5011 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications. Temporary file residing in /var/tmp is to be preserved between reboots." + rationale: "The reasoning for mounting /var/tmp on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s' + + # 1.1.4.2 Ensure noexec option set on /var/tmp partition. (Automated) + - id: 5012 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:noexec" + + # 1.1.4.3 Ensure nosuid option set on /var/tmp partition. (Automated) + - id: 5013 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nosuid" + + # 1.1.4.4 Ensure nodev option set on /var/tmp partition. (Automated) + - id: 5014 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nodev" + + # 1.1.5.1 Ensure separate partition exists for /var/log. (Automated) + - id: 5015 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "The reasoning for mounting /var/log on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.5.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s' + + # 1.1.5.2 Ensure nodev option set on /var/log partition. (Automated) + - id: 5016 + title: "Ensure nodev option set on /var/log partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:nodev" + + # 1.1.5.3 Ensure noexec option set on /var/log partition. (Automated) + - id: 5017 + title: "Ensure noexec option set on /var/log partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot run executable binaries from /var/log." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:noexec" + + # 1.1.5.4 Ensure nosuid option set on /var/log partition. (Automated) + - id: 5018 + title: "Ensure nosuid option set on /var/log partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot create setuid files in /var/log." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:nosuid" + + # 1.1.6.1 Ensure separate partition exists for /var/log/audit. (Automated) + - id: 5019 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "The reasoning for mounting /var/log/audit on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.6.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s' + + # 1.1.6.2 Ensure noexec option set on /var/log/audit partition. (Automated) + - id: 5020 + title: "Ensure noexec option set on /var/log/audit partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log/audit filesystem is only intended for audit logs, set this option to ensure that users cannot run executable binaries from /var/log/audit." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:noexec" + + # 1.1.6.3 Ensure nodev option set on /var/log/audit partition. (Automated) + - id: 5021 + title: "Ensure nodev option set on /var/log/audit partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log/audit filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:nodev" + + # 1.1.6.4 Ensure nosuid option set on /var/log/audit partition. (Automated) + - id: 5022 + title: "Ensure nosuid option set on /var/log/audit partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log/audit filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:nosuid" + + # 1.1.7.1 Ensure separate partition exists for /home. (Automated) + - id: 5023 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "The reasoning for mounting /home on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.7.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s' + + # 1.1.7.2 Ensure nodev option set on /home partition. (Automated) + - id: 5024 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /home filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:nodev" + + # 1.1.7.3 Ensure nosuid option set on /home partition. (Automated) + - id: 5025 + title: "Ensure nosuid option set on /home partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /home filesystem is only intended for user file storage, set this option to ensure that users cannot create setuid files in /home." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:nosuid" + + # 1.1.7.4 Ensure usrquota option set on /home partition. (Automated) + - id: 5026 + title: "Ensure usrquota option set on /home partition." + description: "The usrquota mount option allows for the filesystem to have disk quotas configured." + rationale: "To ensure the availability of disk space on /home, it is important to limit the impact a single user or group can cause for other users (or the wider system) by accidentally filling up the partition. Quotas can also be applied to inodes for filesystems where inode exhaustion is a concern." + remediation: "Edit the /etc/fstab file and add usrquota to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,usrquota,grpquota,nodev,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home Create the quota database. This example will ignore any existing quota files. # quotacheck -cugv /home quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. quotacheck: Scanning /dev/sdb [/home] done quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Checked 8 directories and 0 files quotacheck: Old file not found. quotacheck: Old file not found. Restore SELinux context on the quota database files. Order of operations is important as quotaon will set the immutable attribute on the files and thus restorecon will fail. # restorecon /home/aquota.user Enable quotas on the partition: # quotaon -vug /home /dev/sdb [/home]: group quotas turned on /dev/sdb [/home]: user quotas turned on." + compliance: + - cis: ["1.1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:usrquota" + + # 1.1.7.5 Ensure grpquota option set on /home partition. (Automated) + - id: 5027 + title: "Ensure grpquota option set on /home partition." + description: "The grpquota mount option allows for the filesystem to have disk quotas configured." + rationale: "To ensure the availability of disk space on /home, it is important to limit the impact a single user or group can cause for other users (or the wider system) by accidentally filling up the partition. Quotas can also be applied to inodes for filesystems where inode exhaustion is a concern." + remediation: "Edit the /etc/fstab file and add grpquota to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,usrquota,grpquota,nodev,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home Create the quota database. This example will ignore any existing quota files. # quotacheck -cugv /home quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. quotacheck: Scanning /dev/sdb [/home] done quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Checked 8 directories and 0 files quotacheck: Old file not found. quotacheck: Old file not found. Restore SELinux context on the quota database files. Order of operations is important as quotaon will set the immutable attribute on the files and thus restorecon will fail. # restorecon /home/aquota.group Enable quotas on the partition: # quotaon -vug /home /dev/sdb [/home]: group quotas turned on /dev/sdb [/home]: user quotas turned on." + compliance: + - cis: ["1.1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:grpquota" + + # 1.1.8.1 Ensure nodev option set on /dev/shm partition. (Automated) + - id: 5028 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /dev/shm -> r:nodev" + + # 1.1.8.2 Ensure noexec option set on /dev/shm partition. (Automated) + - id: 5029 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Example: /dev/shm defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm NOTE It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /dev/shm -> r:noexec" + + # 1.1.8.3 Ensure nosuid option set on /dev/shm partition. (Automated) + - id: 5030 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /dev/shm -> r:nosuid" + + # 1.1.9 Disable Automounting. (Automated) + - id: 5031 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "If there are no other packages that depends on autofs, remove the package with: # dnf remove autofs Run the following command to disable autofs if it is required: # systemctl --now disable autofs." + compliance: + - cis: ["1.1.9"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: any + rules: + - "c:systemctl is-enabled autofs -> r:Failed to get unit file state for autofs.service: No such file or directory" + - "c:systemctl is-enabled autofs -> r:disabled" + + # 1.1.10 Disable USB Storage. (Automated) + - id: 5032 + title: "Disable USB Storage." + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/usb_storage.conf and add the following line: install usb-storage /bin/true Run the following command to unload the usb-storage module: rmmod usb-storage." + compliance: + - cis: ["1.1.10"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["13.7"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.8.3.1"] + condition: all + rules: + - "c:modprobe -n -v usb-storage -> r:install /bin/true" + - "not c:lsmod -> r:usb-storage" + + ############################################### + # 1.2 Configure Software Updates + ############################################### + + # 1.2.1 Ensure Red Hat Subscription Manager connection is configured. (Manual) - Not Implemented + + # 1.2.2 Ensure GPG keys are configured. (Manual) - Not Implemented + + # 1.2.3 Ensure gpgcheck is globally activated. (Automated) + - id: 5033 + title: "Ensure gpgcheck is globally activated." + description: "The gpgcheck option, found in the main section of the /etc/dnf/dnf.conf and individual /etc/yum.repos.d/* files, determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/dnf/dnf.conf and set gpgcheck=1 in the [main] section. Example: # sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' /etc/dnf/dnf.conf Edit any failing files in /etc/yum.repos.d/* and set all instances starting with gpgcheck to 1. Example: # find /etc/yum.repos.d/ -name \"*.repo\" -exec echo \"Checking:\" {} \\; -exec sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' {} \\;." + compliance: + - cis: ["1.2.3"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - "f:/etc/dnf/dnf.conf -> r:gpgcheck=1" + - 'd:/etc/yum.repos.d/ -> r:\. -> r:gpgcheck=1' + + # 1.2.4 Ensure package manager repositories are configured. (Manual) - Not Implemented + + ############################################### + # 1.3 Filesystem Integrity Checking + ############################################### + + # 1.3.1 Ensure AIDE is installed. (Automated) + - id: 5034 + title: "Ensure AIDE is installed." + description: "Advanced Intrusion Detection Environment (AIDE) is a intrusion detection tool that uses predefined rules to check the integrity of files and directories in the Linux operating system. AIDE has its own database to check the integrity of files and directories. AIDE takes a snapshot of files and directories including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # dnf install aide Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: Run the following commands: # aide --init # mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz." + references: + - "http://aide.sourceforge.net/stable/manual.html" + compliance: + - cis: ["1.3.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AC-6(9)"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:rpm -q aide -> r:aide-\S*' + + # 1.3.2 Ensure filesystem integrity is regularly checked. (Automated) + - id: 5035 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check OR if aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + references: + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.servic" + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer" + compliance: + - cis: ["1.3.2"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AC-6(9)"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:systemctl is-enabled aidecheck.service -> r:enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:enabled" + - "c:systemctl status aidecheck.timer -> r:active" + + ############################################### + # 1.4 Secure Boot Settings + ############################################### + + # 1.4.1 Ensure bootloader password is set. (Automated) + - id: 5036 + title: "Ensure bootloader password is set." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + impact: 'If password protection is enabled, only the designated superuser can edit a Grub 2 menu item by pressing "e" or access the GRUB 2 command line by pressing "c" If GRUB 2 is set up to boot automatically to a password-protected menu entry the user has no option to back out of the password prompt to select another menu entry. Holding the SHIFT key will not display the menu in this case. The user must enter the correct username and password. If unable, the configuration files will have to be edited via the LiveCD or other means to fix the problem You can add --unrestricted to the menu entries to allow the system to boot without entering a password. Password will still be required to edit menu items.' + remediation: "Create an encrypted password with grub2-setpassword: # grub2-setpassword Enter password: Confirm password: Run the following command to update the grub2 configuration: # grub2-mkconfig -o \"$(dirname \"$(find /boot -type f \\( -name 'grubenv' -o - name 'grub.conf' -o -name 'grub.cfg' \\) -exec grep -Pl '^\\h*(kernelopts=|linux|kernel)' {} \\;)\")/grub.cfg\"." + compliance: + - cis: ["1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/boot/grub2/user.cfg -> r:^GRUB2_PASSWORD\s*=\.+' + + # 1.4.2 Ensure permissions on bootloader config are configured. (Automated) + - id: 5037 + title: "Ensure permissions on bootloader config are configured." + description: "The grub files contain information on boot settings and passwords for unlocking boot options. The grub2 configuration is usually grub.cfg. On newer grub2 systems the encrypted bootloader password is contained in user.cfg. If the system uses UEFI, /boot/efi is a vfat filesystem. The vfat filesystem itself doesn't have the concept of permissions but can be mounted under Linux with whatever permissions desired." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set ownership and permissions on your grub configuration file(s): # [ -f /boot/grub2/grub.cfg ] && chown root:root /boot/grub2/grub.cfg # [ -f /boot/grub2/grub.cfg ] && chmod og-rwx /boot/grub2/grub.cfg # [ -f /boot/grub2/grubenv ] && chown root:root /boot/grub2/grubenv # [ -f /boot/grub2/grubenv ] && chmod og-rwx /boot/grub2/grubenv # [ -f /boot/grub2/user.cfg ] && chown root:root /boot/grub2/user.cfg # [ -f /boot/grub2/user.cfg ] && chmod og-rwx /boot/grub2/user.cfg OR If the system uses UEFI, edit /etc/fstab and add the fmask=0077, uid=0, and gid=0 options: Example: /boot/efi vfat defaults,umask=0027,fmask=0077,uid=0,gid=0 0 0 Note: This may require a re-boot to enable the change." + compliance: + - cis: ["1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /boot/grub2/grub.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat -L /boot/grub2/grubenv -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.4.3 Ensure authentication is required when booting into rescue mode. (Automated) + - id: 5038 + title: "Ensure authentication is required when booting into rescue mode." + description: "Rescue mode (former single user mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in rescue mode (former single user mode) prevents an unauthorized user from rebooting the system into rescue mode to gain root privileges without credentials." + remediation: "The systemd drop-in files must be created if it is necessary to change the default settings: Create the file /etc/systemd/system/rescue.service.d/00-require-auth.conf which contains only the configuration to be overridden: [Service] ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue." + compliance: + - cis: ["1.4.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: any + rules: + - 'f:/systemd-sulogin-shell -> r:ExecStart=-/usr/lib/systemd/systemd-sulogin-shell\s*rescue' + - 'f:/usr/lib/systemd/system/rescue.service -> r:ExecStart=-/usr/lib/systemd/systemd-sulogin-shell\s*rescue' + - 'f:/etc/systemd/system/rescue.service.d -> r:ExecStart=-/usr/lib/systemd/systemd-sulogin-shell\s*rescue' + + ############################################### + # 1.5 Additional Process Hardening + ############################################### + + # 1.5.1 Ensure core dump storage is disabled. (Automated) + - id: 5039 + title: "Ensure core dump storage is disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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." + remediation: "Edit /etc/systemd/coredump.conf and edit or add the following line: Storage=none." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.1"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*Storage\s*=\s*none' + + # 1.5.2 Ensure core dump backtraces are disabled. (Automated) + - id: 5040 + title: "Ensure core dump backtraces are disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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, increasing the risk to the system." + remediation: "Edit or add the following line in /etc/systemd/coredump.conf: ProcessSizeMax=0." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.2"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*ProcessSizeMax\s*=\s*0' + + # 1.5.3 Ensure address space layout randomization (ASLR) is enabled. (Automated) + - id: 5041 + title: "Ensure address space layout randomization (ASLR) is enabled." + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: 'Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: Example: # printf " kernel.randomize_va_space = 2 " >> /etc/sysctl.d/60-kernel_sysctl.conf Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2.' + compliance: + - cis: ["1.5.3"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + + ############################################### + # 1.6 Configure SELinux + ############################################### + + # 1.6.1.1 Ensure SELinux is installed. (Automated) + - id: 5042 + title: "Ensure SELinux is installed." + description: "SELinux provides Mandatory Access Control." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install SELinux: # dnf install libselinux." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:rpm -q libselinux -> r:libselinux-" + + # 1.6.1.2 Ensure SELinux is not disabled in bootloader configuration. (Automated) + - id: 5043 + title: "Ensure SELinux is not disabled in bootloader configuration." + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + impact: "Files created while SELinux is disabled are not labeled at all. This behavior causes problems when changing to enforcing mode because files are labeled incorrectly or are not labeled at all. To prevent incorrectly labeled and unlabeled files from causing problems, file systems are automatically relabeled when changing from the disabled state to permissive or enforcing mode. This can be a long running process that should be accounted for as it may extend downtime during initial re-boot." + remediation: "Run the following command to remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: grubby --update-kernel ALL --remove-args 'selinux=0 enforcing=0'." + compliance: + - cis: ["1.6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + + # 1.6.1.3 Ensure SELinux policy is configured. (Automated) + - id: 5044 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+targeted$|^Loaded policy name:\s+mls$' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Ensure the SELinux mode is not disabled. (Automated) + - id: 5045 + title: "Ensure the SELinux mode is not disabled." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive." + references: + - "https://access.redhat.com/documentation/en-us/selinux" + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$|^Permissive$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing|\s*SELINUX\s*=\s*permissive' + + # 1.6.1.5 Ensure the SELinux mode is enforcing. (Automated) + - id: 5046 + title: "Ensure the SELinux mode is enforcing." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode the system not only avoids enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future. Running SELinux in Permissive mode, though helpful for developing SELinux policy, only logs access denial entries, but does not deny any operations." + remediation: "Run the following command to set SELinux's running mode: # setenforce 1 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing." + references: + - "https://access.redhat.com/documentation/en-us/selinux" + compliance: + - cis: ["1.6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s+enabled$' + - 'c:sestatus -> r:^Current mode:\s+enforcing$' + - 'c:sestatus -> r:^Mode from config file:\s+enforcing$' + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + # 1.6.1.6 Ensure no unconfined services exist. (Automated) + - id: 5047 + title: "Ensure no unconfined services exist." + description: "Unconfined processes run in unconfined domains." + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules - it does not replace them." + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:ps -eZ -> r:unconfined_service_t" + + # 1.6.1.7 Ensure SETroubleshoot is not installed. (Automated) + - id: 5048 + title: "Ensure SETroubleshoot is not installed." + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # dnf remove setroubleshoot." + compliance: + - cis: ["1.6.1.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.9.1.1"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -q setroubleshoot -> r:setroubleshoot" + + # 1.6.1.8 Ensure the MCS Translation Service (mcstrans) is not installed. (Automated) + - id: 5049 + title: "Ensure the MCS Translation Service (mcstrans) is not installed." + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf." + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # dnf remove mcstrans." + compliance: + - cis: ["1.6.1.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -q mcstrans -> r:mcstrans" + + ############################################### + # 1.7 Warning Banners + ############################################### + + # 1.7.1 Ensure message of the day is configured properly. (Automated) + - id: 5050 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + + # 1.7.2 Ensure local login warning banner is configured properly. (Automated) + - id: 5051 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.7.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + + # 1.7.3 Ensure remote login warning banner is configured properly. (Automated) + - id: 5052 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + + # 1.7.4 Ensure permissions on /etc/motd are configured. (Automated) + - id: 5053 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd : # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.5 Ensure permissions on /etc/issue are configured. (Automated) + - id: 5054 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue : # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured. (Automated) + - id: 5055 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.8.1 Ensure GNOME Display Manager is removed. (Manual) + - id: 5056 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + impact: "Removing the GNOME Display manager will remove the GUI from the system." + remediation: "Run the following command to remove the gdm package # dnf remove gdm." + references: + - "https://wiki.gnome.org/Projects/GDM" + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q gdm -> r:is not installed" + + # 1.8.2 Ensure GDM login banner is configured. (Automated) + - id: 5057 + title: "Ensure GDM login banner is configured." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Note: If a graphical login is not required, it should be removed to reduce the attack surface of the system." + remediation: "Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/01-banner-message) [org/gnome/login-screen] banner-message-enable=true banner-message-text='' Example Banner Text: 'Authorized users only. All activity may be monitored and reported.' Run the following command to update the system databases: # dconf update." + compliance: + - cis: ["1.8.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm -> r:user-db:user && r:system-db:gdm && r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - "f:/etc/dconf/db/gdm.d/01-banner-message -> r:[org/gnome/login-screen]" + - "f:/etc/dconf/db/gdm.d/01-banner-message -> r:banner-message-enable=true" + - "f:/etc/dconf/db/gdm.d/01-banner-message -> r:banner-message-text=" + + # 1.8.3 Ensure last logged in user display is disabled. (Automated) + - id: 5058 + title: "Ensure last logged in user display is disabled." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Displaying the last logged in user eliminates half of the Userid/Password equation that an unauthorized person would need to log on. Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Notes: - - If a graphical login is not required, it should be removed to reduce the attack surface of the system. If a different GUI login service is in use and required on the system, consult your documentation to disable displaying the last logged on user." + remediation: "Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/00-login-screen) [org/gnome/login-screen] # Do not show the user list disable-user-list=true Run the following command to update the system databases: # dconf update." + compliance: + - cis: ["1.8.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm -> r:user-db:user && r:system-db:gdm && r:file-db:/usr/share/gdm/greeter-dconf-defaults" + - "f:/etc/dconf/db/gdm.d/01-banner-message -> r:[org/gnome/login-screen]" + - "f:/etc/dconf/db/gdm.d/01-banner-message -> r:disable-user-list=true" + + # 1.8.4 Ensure XDMCP is not enabled. (Automated) + - id: 5059 + title: "Ensure XDMCP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. - XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user - XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server." + remediation: "Edit the file /etc/gdm/custom.conf and remove the line Enable=true." + references: + - "https://help.gnome.org/admin/gdm/2.32/configuration.html.en" + compliance: + - cis: ["1.8.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - 'f:/etc/gdm/custom.conf -> r:^\s*Enable\s*=\s*true' + + # 1.8.5 Ensure automatic mounting of removable media is disabled. (Automated) + - id: 5060 + title: "Ensure automatic mounting of removable media is disabled." + description: "By default GNOME automatically mounts removable media when inserted as a convenience to the user." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "Ensure that automatic mounting of media is disabled for all GNOME users: # cat << EOF >> /etc/dconf/db/local.d/00-media-automount [org/gnome/desktop/media-handling] automount=false automount-open=false EOF Apply the changes with: # dconf update." + references: + - "https://access.redhat.com/solutions/20107" + compliance: + - cis: ["1.8.5"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - "c:gsettings get org.gnome.desktop.media-handling automount -> r:false" + + # 1.9 Ensure updates, patches, and additional security software are installed. (Manual) + - id: 5061 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available updates: # dnf update." + compliance: + - cis: ["1.9"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'not c:sh -c "dnf check-update | egrep -v \"Updating|Last metadata|^$\"" -> r:^\w' + + # 1.10 Ensure system-wide crypto policy is not legacy. (Automated) + - id: 5062 + title: "Ensure system-wide crypto policy is not legacy." + description: "The system-wide crypto-policies followed by the crypto core components allow consistently deprecating and disabling algorithms system-wide. The individual policy levels (DEFAULT, LEGACY, FUTURE, and FIPS) are included in the crypto-policies(7) package." + rationale: "If the Legacy system-wide crypto policy is selected, it includes support for TLS 1.0, TLS 1.1, and SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are allowed, while RSA and Diffie-Hellman parameters are accepted if larger than 1023-bits. These legacy protocols and algorithms can make the system vulnerable to attacks, including those listed in RFC 7457." + impact: "Environments that require compatibility with older insecure protocols may require the use of the less secure LEGACY policy level." + remediation: "Run the following command to change the system-wide crypto policy # update-crypto-policies --set Example: # update-crypto-policies --set DEFAULT Run the following to make the updated system-wide crypto policy active # update-crypto-policies." + references: + - "https://access.redhat.com/articles/3642912#what-polices-are-provided-1" + compliance: + - cis: ["1.10"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: none + rules: + - 'f:/etc/crypto-policies/config -> r:^\s*LEGACY' + + ############################################### + # 2.1 Remove Legacy Services + ############################################### + + # 2.1.1 Ensure time synchronization is in use. (Automated) + - id: 5063 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them. Note: If another method for time synchronization is being used, this section may be skipped." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Run the following command to install chrony: # dnf install chrony." + compliance: + - cis: ["2.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:rpm -q chrony -> r:^chrony-" + + # 2.1.2 Ensure chrony is configured. (Automated) + - id: 5064 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: 'Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include ''-u chrony'': OPTIONS="-u chrony".' + compliance: + - cis: ["2.1.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "f:/etc/chrony.conf" + - 'f:/etc/chrony.conf -> r:^\s*\t*server|^\s*\t*pool' + - 'f:/etc/sysconfig/chronyd -> r:^\s*\t*OPTIONS\.*-u chrony' + + # 2.2.1 Ensure xinetd is not installed. (Automated) + - id: 5065 + title: "Ensure xinetd is not installed." + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed to reduce the attack surface are of the system. Note: If an xinetd service or services are required, ensure that any xinetd service not required is stopped and disabled." + remediation: "Run the following command to remove xinetd: # dnf remove xinetd." + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q xinetd -> r:^package xinetd is not installed" + + # 2.2.2 Ensure xorg-x11-server-common is not installed. (Automated) + - id: 5066 + title: "Ensure xorg-x11-server-common is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: 'Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime.' + remediation: "Run the following command to remove the X Windows Server packages: # dnf remove xorg-x11-server-common." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q xorg-x11-server-common -> r:^package xorg-x11-server-common is not installed" + + # 2.2.3 Ensure Avahi Server is not installed. (Automated) + - id: 5067 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to stop, mask and remove avahi-autoipd and avahi: # systemctl stop avahi-daemon.socket avahi-daemon.service # dnf remove avahi-autoipd avahi." + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q avahi -> r:^package avahi is not installed" + + # 2.2.4 Ensure CUPS is not installed. (Automated) + - id: 5068 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface. Note: Removing CUPS will prevent printing from the system." + impact: "Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to remove cups: # dnf remove cups." + references: + - "http://www.cups.org." + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q cups -> r:^package cups is not installed" + + # 2.2.5 Ensure DHCP Server is not installed. (Automated) + - id: 5069 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that the rpm -q dhcp-server package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcp: # dnf remove dhcp-server." + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dhcp-server -> r:^package dhcp-server is not installed" + + # 2.2.6 Ensure DNS Server is not installed. (Automated) + - id: 5070 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove bind: # dnf remove bind." + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q bind -> r:^package bind is not installed" + + # 2.2.7 Ensure FTP Server is not installed. (Automated) + - id: 5071 + title: "Ensure FTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove ftp: # dnf remove ftp." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ftpd -> r:^package ftpd is not installed" + + # 2.2.8 Ensure VSFTP Server is not installed. (Automated) + - id: 5072 + title: "Ensure VSFTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "Unless there is a need to run the system as an FTP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # dnf remove vsftpd." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q vsftpd -> r:^package vsftpd is not installed" + + # 2.2.9 Ensure TFTP Server is not installed. (Automated) + - id: 5073 + title: "Ensure TFTP Server is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + remediation: "Run the following command to remove tftp-server: # dnf remove tftp-server." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp-server -> r:^package tftp-server is not installed" + + # 2.2.10 Ensure a web server is not installed. (Automated) + - id: 5074 + title: "Ensure a web server is not installed." + description: "Web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the packages be removed to reduce the potential attack surface. Note: Several http servers exist. They should also be audited, and removed, if not required." + remediation: "Run the following command to remove httpd and nginx: # dnf remove httpd nginx." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nginx -> r:^package nginx is not installed" + - "c:rpm -q httpd -> r:^package httpd is not installed" + + # 2.2.11 Ensure IMAP and POP3 server is not installed. (Automated) + - id: 5075 + title: "Ensure IMAP and POP3 server is not installed." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface. Note: Several IMAP/POP3 servers exist and can use other service names. These should also be audited and the packages removed if not required." + remediation: "Run the following command to remove dovecot and cyrus-imapd: # dnf remove dovecot cyrus-imapd." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dovecot -> r:^package dovecot is not installed" + - "c:rpm -q cyrus-imapd -> r:^package cyrus-imapd is not installed" + + # 2.2.12 Ensure Samba is not installed. (Automated) + - id: 5076 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # dnf remove samba." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q samba -> r:^package samba is not installed" + + # 2.2.13 Ensure HTTP Proxy Server is not installed. (Automated) + - id: 5077 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "Unless a system is specifically set up to act as a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface. Note: Several HTTP proxy servers exist. These should be checked and removed unless required." + remediation: "Run the following command to remove the squid package: # dnf remove squid." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q squid -> r:^package squid is not installed" + + # 2.2.14 Ensure net-snmp is not installed. (Automated) + - id: 5078 + title: "Ensure net-snmp is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. If SNMP v2 is absolutely necessary, modify the community strings' values. -." + remediation: "Run the following command to remove net-snmpd: # dnf remove net-snmp." + compliance: + - cis: ["2.2.14"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q net-snmp -> r:^package net-snmp is not installed" + + # 2.2.15 Ensure NIS server is not installed. (Automated) + - id: 5079 + title: "Ensure NIS server is not installed." + description: "The ypserv package provides the Network Information Service (NIS). This service, formally known as Yellow Pages, is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the ypserv package be removed, and if required a more secure services be used." + remediation: "Run the following command to remove ypserv: # dnf remove ypserv." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ypserv -> r:^package ypserv is not installed" + + # 2.2.16 Ensure telnet-server is not installed. (Automated) + - id: 5080 + title: "Ensure telnet-server is not installed." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to remove the telnet-server package: # dnf remove telnet-server." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet-server -> r:^package telnet-server is not installed" + + # 2.2.17 Ensure mail transfer agent is configured for local-only mode. (Automated) + - id: 5081 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Notes: - This recommendation is designed around the postfix mail server. - Depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.17"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:ss -lntu -> r:\.*:25\.* && !r:\s*127.0.0.1:25\s*|\s*::1:25\s*' + + # 2.2.18 Ensure nfs-utils is not installed or the nfs-server service is masked. (Automated) + - id: 5082 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not require network shares, it is recommended that the nfs-utils package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization are dependent on the nfs-utils package. If the nfs-package is required as a dependency, the nfs-server should be disabled and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove nfs-utils OR If the nfs-package is required as a dependency, run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server." + compliance: + - cis: ["2.2.18"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q nfs-utils -> r:package nfs-utils is not installed" + - "c:systemctl is-enabled nfs-server -> r:masked|No such file or directory" + + # 2.2.19 Ensure rpcbind is not installed or the rpcbind services are masked. (Automated) + - id: 5083 + title: "Ensure rpcbind is not installed or the rpcbind services are masked." + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service. Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening." + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization, and the nfs-utils package used for The Network File System (NFS), are dependent on the rpcbind package. If the rpcbind package is required as a dependency, the services rpcbind.service and rpcbind.socket should be stopped and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove rpcbind OR If the rpcbind package is required as a dependency, run the following commands to stop and mask the rpcbind and rpcbind.socket services: # systemctl --now mask rpcbind # systemctl --now mask rpcbind.socket." + compliance: + - cis: ["2.2.19"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q -> r:rpcbind package rpcbind is not installed" + - "c:systemctl is-enabled rpcbind rpcbind.socket -> r:masked" + + # 2.2.20 Ensure rsync is not installed or the rsyncd service is masked. (Automated) + - id: 5084 + title: "Ensure rsync is not installed or the rsyncd service is masked." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication. Note: If a required dependency exists for the rsync package, but the rsyncd service is not required, the service should be masked." + impact: "There are packages that are dependent on the rsync package. If the rsync package is removed, these packages will be removed as well. Before removing the rsync package, review any dependent packages to determine if they are required on the system. If a dependent package is required, mask the rsyncd service and leave the rsync package installed." + remediation: "Run the following command to remove the rsync package: # dnf remove rsync OR Run the following command to mask the rsyncd service: # systemctl --now mask rsyncd." + compliance: + - cis: ["2.2.20"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rsync -> r:package rsync is not installed" + - "c:systemctl is-enabled rsyncd -> r:masked" + + ############################################### + # 2.3 Service Clients + ############################################### + + # 2.3.1 Ensure NIS Client is not installed. (Automated) + - id: 5085 + title: "Ensure NIS Client is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the ypbind package: # dnf remove ypbind." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -q ypbind -> r:^package ypbind is not installed" + + # 2.3.2 Ensure rsh client is not installed. (Automated) + - id: 5086 + title: "Ensure rsh client is not installed." + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh, rcp and rlogin." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the rsh package: # dnf remove rsh." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -q rsh -> r:^package rsh is not installed" + + # 2.3.3 Ensure talk client is not installed. (Automated) + - id: 5087 + title: "Ensure talk client is not installed." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the talk package: # dnf remove talk." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -q talk -> r:^package talk is not installed" + + # 2.3.4 Ensure telnet client is not installed. (Automated) + - id: 5088 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the telnet package: # dnf remove telnet." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet -> r:^package telnet is not installed" + + # 2.3.5 Ensure LDAP client is not installed. (Automated) + - id: 5089 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Run the following command to remove the openldap-clients package: # dnf remove openldap-clients." + compliance: + - cis: ["2.3.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q openldap-clients -> r:^package openldap-clients is not installed" + + # 2.3.6 Ensure TFTP client is not installed. (Automated) + - id: 5090 + title: "Ensure TFTP client is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + remediation: "Run the following command to remove tftp: # dnf remove tftp." + compliance: + - cis: ["2.3.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp -> r:^package tftp is not installed" + + # 2.4 Ensure nonessential services are removed or masked. (Manual) - Not Implemented + + ############################################### + # 3 Network Configuration + ############################################### + ############################################### + # 3.1 Uncommon Network Protocols + ############################################### + + # 3.1.1 Verify if IPv6 is enabled on the system. (Manual) + - id: 5091 + title: "Verify if IPv6 is enabled on the system." + description: "Internet Protocol Version 6 (IPv6) is the most recent version of Internet Protocol (IP). It's designed to supply IP addressing and additional security to support the predicted growth of connected devices." + rationale: "It is recommended that either IPv6 settings are configured OR IPv6 be disabled to reduce the attack surface of the system." + impact: "IETF RFC 4038 recommends that applications are built with an assumption of dual stack. If IPv6 is disabled through sysctl config, SSH X11forwarding may no longer function as expected. We recommend that SSH X11fowarding be disabled, but if required, the following will allow for SSH X11forwarding with IPv6 disabled through sysctl config: Add the following line the /etc/ssh/sshd_config file: AddressFamily inet Run the following command to re-start the openSSH server: # systemctl restart sshd." + remediation: 'If IPv6 is to be disabled, use one of the two following methods to disable IPv6 on the system: To disable IPv6 through the GRUB2 config, run the following command to add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: grubby --update-kernel ALL --args ''ipv6.disable=1'' OR To disable IPv6 through sysctl settings, set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: Example: # printf " net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 " >> /etc/sysctl.d/60-disable_ipv6.conf Run the following command to set the active kernel parameters: # { sysctl -w net.ipv6.conf.all.disable_ipv6=1 sysctl -w net.ipv6.conf.default.disable_ipv6=1 sysctl -w net.ipv6.route.flush=1 }.' + compliance: + - cis: ["3.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'f:/boot/grub2/grubenv -> r:^\s*kernelopts=\.+ipv6.disable=1' + + # 3.1.2 Ensure SCTP is disabled. (Automated) + - id: 5092 + title: "Ensure SCTP is disabled." + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message-oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: printf " install sctp /bin/true " >> /etc/modprobe.d/sctp.conf.' + compliance: + - cis: ["3.1.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:modprobe -n -v sctp -> r:^\s*install\s*/bin/true|Module sctp not found' + - "not c:lsmod -> r:sctp" + + # 3.1.3 Ensure DCCP is disabled. (Automated) + - id: 5093 + title: "Ensure DCCP is disabled." + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: printf " install dccp /bin/true " >> /etc/modprobe.d/dccp.conf.' + compliance: + - cis: ["3.1.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:modprobe -n -v dccp -> r:^\s*install\s*/bin/true|Module dccp not found' + - "not c:lsmod -> r:dccp" + + # 3.1.4 Ensure wireless interfaces are disabled. (Automated) - Not Implemented + # 3.2.1 Ensure IP forwarding is disabled. (Automated) - Not Implemented + # 3.2.2 Ensure packet redirect sending is disabled. (Automated) - Not Implemented + + ############################################### + # 3.3 Network Parameters (Host and Router) + ############################################### + + # 3.3.1 Ensure source routed packets are not accepted. (Automated) - Not Implemented + # 3.3.2 Ensure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.3 Ensure secure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.4 Ensure suspicious packets are logged. (Automated) - Not Implemented + # 3.3.5 Ensure broadcast ICMP requests are ignored. (Automated) - Not Implemented + # 3.3.6 Ensure bogus ICMP responses are ignored. (Automated) - Not Implemented + # 3.3.7 Ensure Reverse Path Filtering is enabled. (Automated) - Not Implemented + # 3.3.8 Ensure TCP SYN Cookies is enabled. (Automated) - Not Implemented + # 3.3.9 Ensure IPv6 router advertisements are not accepted. (Automated) - Not Implemented + + ############################################### + # 3.4 Firewall Configuration + ############################################### + ############################################### + # 3.4.1 Ensure Firewall software is installed + ############################################### + + # 3.4.1.1 Ensure firewalld is installed. (Automated) + - id: 5094 + title: "Ensure firewalld is installed." + description: "firewalld is a firewall management tool for Linux operating systems. It provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the iptables backend or provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the nftables utility. firewalld replaces iptables as the default firewall management tool. Use the firewalld utility to configure a firewall for less complex firewalls. The utility is easy to use and covers the typical use cases scenario. FirewallD supports both IPv4 and IPv6 networks and can administer separate firewall zones with varying degrees of trust as defined in zone profiles. Note: Starting in v0.6.0, FirewallD added support for acting as a front-end for the Linux kernel's netfilter framework via the nftables userspace utility, acting as an alternative to the nft command line program." + rationale: "A firewall utility is required to configure the Linux kernel's netfilter framework via the iptables or nftables back-end. The Linux kernel's netfilter framework host-based firewall can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host. Note: Only one firewall utility should be installed and configured. FirewallD is dependent on the iptables package." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install FirewallD and iptables: # dnf install firewalld iptables." + compliance: + - cis: ["3.4.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - "c:rpm -q firewalld -> r:^firewalld-" + - "c:rpm -q iptables -> r:^iptables-" + + # 3.4.1.2 Ensure iptables-services not installed with firewalld. (Automated) + - id: 5095 + title: "Ensure iptables-services not installed with firewalld." + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both firewalld and the services included in the iptables-services package may lead to conflict." + impact: "Running both firewalld and iptables/ip6tables service may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package # systemctl stop iptables # systemctl stop ip6tables # dnf remove iptables-services." + compliance: + - cis: ["3.4.1.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q iptables-services -> r:^package iptables-services is not installed" + + # 3.4.1.3 Ensure nftables either not installed or masked with firewalld. (Automated) + - id: 5096 + title: "Ensure nftables either not installed or masked with firewalld." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables. Note: Support for using nftables as the back-end for firewalld was added in release v0.6.0. In Fedora 19 Linux derivatives, firewalld utilizes iptables as its back-end by default." + rationale: "Running both firewalld and nftables may lead to conflict. Note: firewalld may configured as the front-end to nftables. If this case, nftables should be stopped and masked instead of removed." + remediation: 'Run the following command to remove nftables: # dnf remove nftables OR Run the following command to stop and mask nftables" systemctl --now mask nftables.' + compliance: + - cis: ["3.4.1.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:systemctl status nftables -> r:Loaded:\s*disabled|Loaded:\s*masked|could not be found' + - 'c:systemctl status nftables -> r:Active:\s*inactive\s*\(dead\)|could not be found' + - "not p:nftables" + + # 3.4.1.4 Ensure firewalld service enabled and running. (Automated) + - id: 5097 + title: "Ensure firewalld service enabled and running." + description: "firewalld.service enables the enforcement of firewall rules configured through firewalld." + rationale: "Ensure that the firewalld.service is enabled and running to enforce firewall rules configured through firewalld." + impact: "Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following command to unmask firewalld # systemctl unmask firewalld Run the following command to enable and start firewalld # systemctl --now enable firewalld." + compliance: + - cis: ["3.4.1.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "p:firewalld" + - "c:firewall-cmd --state -> r:running" + + # 3.4.1.5 Ensure firewalld default zone is set. (Automated) Not Implemented + # 3.4.1.6 Ensure network interfaces are assigned to appropriate zone. (Manual) Not Implemented + # 3.4.1.7 Ensure firewalld drops unnecessary services and ports. (Manual) - Not Implemented + + # 3.4.2.1 Ensure nftables is installed. (Automated) + - id: 5098 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem. Note: - nftables is available in Linux kernel 3.13 and newer. - Only one firewall utility should be installed and configured." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install nftables # dnf install nftables." + compliance: + - cis: ["3.4.2.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^nftables-" + + # 3.4.2.2 Ensure firewalld is either not installed or masked with nftables. (Automated) + - id: 5099 + title: "Ensure firewalld is either not installed or masked with nftables." + description: "Firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with support for network-firewall zones to assign a level of trust to a network and its associated connections interfaces or sources. It has support for IPv4, IPv6, Ethernet bridges and also for IPSet firewall settings. There is a separation of the runtime and permanent configuration options." + rationale: "Running both nftables.service and firewalld.service may lead to conflict and unexpected results." + remediation: "Run the following command to remove firewalld # dnf remove firewalld OR Run the following command to stop and mask firewalld # systemctl --now mask firewalld." + compliance: + - cis: ["3.4.2.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "p:firewalld" + - "c:firewall-cmd --state -> r:running" + + # 3.4.2.3 Ensure iptables-services not installed with nftables. (Automated) + - id: 5100 + title: "Ensure iptables-services not installed with nftables." + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both nftables and the services included in the iptables-services package may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package # systemctl stop iptables # systemctl stop ip6tables # dnf remove iptables-services." + compliance: + - cis: ["3.4.2.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q iptables-services -> r:^package iptables-services is not installed" + + # 3.4.2.4 Ensure iptables are flushed with nftables. (Manual) + - id: 5101 + title: "Ensure iptables are flushed with nftables." + description: "nftables is a replacement for iptables, ip6tables, ebtables and arptables." + rationale: "It is possible to mix iptables and nftables. However, this increases complexity and also the chance to introduce errors. For simplicity flush out all iptables rules, and ensure it is not loaded." + remediation: "Run the following commands to flush iptables: For iptables: # iptables -F For ip6tables: # ip6tables -F." + compliance: + - cis: ["3.4.2.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: none + rules: + - 'c:iptables -L -> !r:^\s*Chain|^\s*target && r:\s*\S+' + - 'c:ip6tables -L -> !r:^\s*Chain|^\s*target && r:\s*\S+' + + # 3.4.2.5 Ensure an nftables table exists. (Automated) + - id: 5102 + title: "Ensure an nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + impact: "Adding rules to a running nftables can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example: # nft create table inet filter." + compliance: + - cis: ["3.4.2.5"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:nft list tables -> r:\w+' + + # 3.4.2.6 Ensure nftables base chains exist. (Automated) + - id: 5103 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.4.2.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input" + - "c:nft list ruleset -> r:hook forward" + - "c:nft list ruleset -> r:hook output" + + # 3.4.2.7 Ensure nftables loopback traffic is configured. (Automated) + - id: 5104 + title: "Ensure nftables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # nft add rule inet filter input iif lo accept # nft create rule inet filter input ip saddr 127.0.0.0/8 counter drop. IF IPv6 is enabled on the system: Run the following command to implement the IPv6 loopback rule: # nft add rule inet filter input ip6 saddr ::1 counter drop." + compliance: + - cis: ["3.4.2.7"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:sh -c "nft list ruleset | awk ''/hook input/,/}/''" -> r:iif "lo" accept' + - 'c:sh -c "nft list ruleset | awk ''/hook input/,/}/''" -> r:ip saddr 127.0.0.0/8' + - 'c:sh -c "nft list ruleset | awk ''/hook input/,/}/''" -> r:ip6 saddr ::1' + + # 3.4.2.8 Ensure nftables outbound and established connections are configured. (Manual) - Not Implemented + + # 3.4.2.9 Ensure nftables default deny firewall policy. (Automated) + - id: 5105 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue traversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over the network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; } # nft chain inet filter output { policy drop \\; }." + compliance: + - cis: ["3.4.2.9"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input && r:policy drop" + - "c:nft list ruleset -> r:hook forward && r:policy drop" + - "c:nft list ruleset -> r:hook output && r:policy drop" + + # 3.4.2.10 Ensure nftables service is enabled. (Automated) + - id: 5106 + title: "Ensure nftables service is enabled." + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables." + compliance: + - cis: ["3.4.2.10"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "p:nftables" + + # 3.4.2.11 Ensure nftables rules are permanent. (Automated) - Not Implemented + + ############################################### + # 3.4.3 Configure iptables + ############################################### + ############################################### + # 3.4.3.1 Configure IPv4 iptables + ############################################### + + # 3.4.3.1.1 Ensure iptables packages are installed. (Automated) + - id: 5107 + title: "Ensure iptables packages are installed." + description: "iptables is a utility program that allows a system administrator to configure the tables provided by the Linux kernel firewall, implemented as different Netfilter modules, and the chains and rules it stores. Different kernel modules and programs are used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames." + rationale: "A method of configuring and maintaining firewall rules is necessary to configure a Host Based Firewall." + remediation: "Run the following command to install iptables and iptables-services # dnf install iptables iptables-services." + compliance: + - cis: ["3.4.3.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q iptables -> r:^iptables-" + + # 3.4.3.1.2 Ensure nftables is not installed with iptables. (Automated) + - id: 5108 + title: "Ensure nftables is not installed with iptables." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables." + rationale: "Running both iptables and nftables may lead to conflict." + remediation: "Run the following command to remove nftables: # dnf remove nftables." + compliance: + - cis: ["3.4.3.1.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^package nftables is not installed" + + # 3.4.3.1.3 Ensure firewalld is either not installed or masked with iptables. (Automated) + - id: 5109 + title: "Ensure firewalld is either not installed or masked with iptables." + description: "firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with support for network/firewall zones to assign a level of trust to a network and its associated connections, interfaces or sources. It has support for IPv4, IPv6, Ethernet bridges and also for IPSet firewall settings. There is a separation of the runtime and permanent configuration options." + rationale: "Running iptables.service and\\or ip6tables.service with firewalld.service may lead to conflict and unexpected results." + remediation: "Run the following command to remove firewalld # yum remove firewalld OR Run the following command to stop and mask firewalld # systemctl --now mask firewalld." + compliance: + - cis: ["3.4.3.1.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "p:firewalld" + - "c:firewall-cmd --state -> r:running" + + # 3.4.3.2.1 Ensure iptables loopback traffic is configured. (Automated) + - id: 5110 + title: "Ensure iptables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP." + compliance: + - cis: ["3.4.3.2.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + # 3.4.3.2.2 Ensure iptables outbound and established connections are configured. (Manual) - Not Implemented + # 3.4.3.2.3 Ensure iptables rules exist for all open ports. (Automated) - Not Implemented + + # 3.4.3.2.4 Ensure iptables default deny firewall policy. (Automated) + - id: 5111 + title: "Ensure iptables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP." + compliance: + - cis: ["3.4.3.2.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)' + + # 3.4.3.2.5 Ensure iptables rules are saved. (Automated) - Not Implemented + # 3.4.3.2.6 Ensure iptables is enabled and active. (Automated) + - id: 5112 + title: "Ensure iptables is enabled and active." + description: "iptables.service is a utility for configuring and maintaining iptables." + rationale: "iptables.service will load the iptables rules saved in the file /etc/sysconfig/iptables at boot, otherwise the iptables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start iptables: systemctl --now enable iptables." + compliance: + - cis: ["3.4.3.2.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled iptables -> r:^enabled" + - "c:systemctl is-active iptables -> r:^active" + + ############################################### + # 3.4.3.3 Configure IPv6 ip6tables + ############################################### + + # 3.4.3.3.1 Ensure ip6tables loopback traffic is configured. (Automated) + - id: 5113 + title: "Ensure ip6tables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP." + compliance: + - cis: ["3.4.3.3.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + # 3.4.3.3.2 Ensure ip6tables outbound and established connections are configured. (Manual) - Not Implemented + # 3.4.3.3.3 Ensure ip6tables firewall rules exist for all open ports. (Automated) - Not Implemented + # 3.4.3.3.4 Ensure ip6tables default deny firewall policy. (Automated) + - id: 5114 + title: "Ensure ip6tables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP." + compliance: + - cis: ["3.4.3.3.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:ip6tables -L -> r:Chain INPUT \(policy DROP\)' + - 'c:ip6tables -L -> r:Chain FORWARD \(policy DROP\)' + - 'c:ip6tables -L -> r:Chain OUTPUT \(policy DROP\)' + + # 3.4.3.3.5 Ensure ip6tables rules are saved. (Automated) - Not Implemented + + # 3.4.3.3.6 Ensure ip6tables is enabled and active. (Automated) + - id: 5115 + title: "Ensure ip6tables is enabled and active." + description: "ip6tables.service is a utility for configuring and maintaining ip6tables." + rationale: "ip6tables.service will load the iptables rules saved in the file /etc/sysconfig/ip6tables at boot, otherwise the ip6tables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start ip6tables: # systemctl --now start ip6tables." + compliance: + - cis: ["3.4.3.3.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:^\s*kernelopts=\.+ipv6.disable=1' + + ############################################### + # 4 Logging and Auditing + ############################################### + ############################################### + # 4.1.1 Configure System Accounting (auditd) + ############################################### + + # 4.1.1.1 Ensure auditd is installed. (Automated) + - id: 5116 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # dnf install audit." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v8: ["8.2", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:rpm -q audit audit-libs -> r:^audit-" + + # 4.1.1.2 Ensure auditd service is enabled. (Automated) + - id: 5117 + title: "Ensure auditd service is enabled." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "p:auditd" + + # 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled. (Automated) + - id: 5118 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: "Run the following command to add audit=1 to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit=1'." + compliance: + - cis: ["4.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: none + rules: + - "f:/boot/grub2/grubenv -> r:kernelopts= && !r:audit=1" + + # 4.1.1.4 Ensure audit_backlog_limit is sufficient. (Automated) + - id: 5119 + title: "Ensure audit_backlog_limit is sufficient." + description: "The backlog limit has a default setting of 64." + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more than 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected." + remediation: "Run the following command to add audit_backlog_limit= to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit_backlog_limit=' Example: # grubby --update-kernel ALL --args 'audit_backlog_limit=8192'." + compliance: + - cis: ["4.1.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:grubby --info=ALL -> n:^args=\.*\saudit_backlog_limit=(\d+) compare >= 8192' + + ############################################### + # 4.1.2 Configure Data Retention + ############################################### + + # 4.1.2.1 Ensure audit log storage size is configured. (Automated) + - id: 5120 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file\s*=\s*\d+' + + # 4.1.2.2 Ensure audit logs are not automatically deleted. (Automated) + - id: 5121 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^max_log_file_action\s*=\s*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full. (Automated) + - id: 5122 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full. The admin_space_left_action parameter tells the system what action to take when the system has detected that it is low on disk space. Valid values are ignore, syslog, suspend, single, and halt. - ignore, the audit daemon does nothing - Syslog, the audit daemon will issue a warning to syslog - Suspend, the audit daemon will stop writing records to the disk - single, the audit daemon will put the computer system in single user mode - halt, the audit daemon will shutdown the system." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + impact: "If the admin_space_left_action parameter is set to halt the audit daemon will shutdown the system when the disk partition containing the audit logs becomes full." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root set admin_space_left_action to either halt or single in /etc/audit/auditd.conf. Example: admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^admin_space_left_action\s*=\s*halt' + + # 4.1.3.1 Ensure changes to system administration scope (sudoers) is collected. (Automated) + - id: 5123 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers, or files in /etc/sudoers.d, will be written to when the file(s) or related attributes have changed. The audit records will be tagged with the identifier "scope".' + rationale: "Changes in the /etc/sudoers and /etc/sudoers.d files can indicate that an unauthorized change has been made to the scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor scope changes for system administrators. Example: # printf \" -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d -p wa -k scope \" >> /etc/audit/rules.d/50-scope.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.1"] + - cis_csc_v7: ["4.8"] + - iso_27001-2013: ["A.12.4.3"] + condition: all + rules: + - "d:/etc/audit/rules.d -> .rules -> r:-w /etc/sudoers && r:-p wa && r:-k scope" + - "d:/etc/audit/rules.d -> .rules -> r:-w /etc/sudoers.d/ && r:-p wa && r:-k scope" + + # 4.1.3.2 Ensure actions as another user are always logged. (Automated) + - id: 5124 + title: "Ensure actions as another user are always logged." + description: "sudo provides users with temporary elevated privileges to perform operations, either as the superuser or another user." + rationale: "Creating an audit log of users with temporary elevated privileges and the operation(s) they performed is essential to reporting. Administrators will want to correlate the events written to the audit trail with the records written to sudo's logfile to verify if unauthorized commands have been executed." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor elevated privileges. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -C euid!=uid -F auid!=unset -S execve -k user_emulation -a always,exit -F arch=b32 -C euid!=uid -F auid!=unset -S execve -k user_emulation \" >> /etc/audit/rules.d/50-user_emulation.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + + # 4.1.3.3 Ensure events that modify the sudo log file are collected. (Automated) - Not Implemented + + # 4.1.3.4 Ensure events that modify date and time information are collected. (Automated) + - id: 5125 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the; - adjtimex - tune kernel clock - settimeofday - set time using timeval and timezone structures - stime - using seconds since 1/1/1970 - clock_settime - allows for the setting of several internal clocks and timers system calls have been executed. Further, ensure to write an audit record to the configured audit log file upon exit, tagging the records with a unique identifier such as "time-change".' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "Create audit rules Edit or create fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64. In addition, add stime to the system call audit. Example: -a always,exit -F arch=b32 -S adjtimex settimeofday clock_settime stime -k time-change." + compliance: + - cis: ["4.1.3.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b32 -S clock_settime -k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b64 -S adjtimex -S settimeofday -S stime -k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b64 -S clock_settime -k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/localtime -p wa -k time-change' + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change" + + # 4.1.3.5 Ensure events that modify the system's network environment are collected. (Automated) + - id: 5126 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitor the following system calls, and write an audit event on system call exit: - sethostname - set the systems host name - setdomainname - set the systems domain name The files being monitored are: - /etc/issue and /etc/issue.net - messages displayed pre-login - /etc/hosts - file containing host names and associated IP addresses - /etc/sysconfig/network - additional information that is valid to all network interfaces - /etc/sysconfig/network-scripts/ - directory containing network interface scripts and configurations files." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records should have a relevant tag associated with them." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's network environment. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S sethostname,setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname,setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/sysconfig/network -p wa -k system-locale -w /etc/sysconfig/network-scripts/ -p wa -k system-locale \" >> /etc/audit/rules.d/50-system_local.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.5"] + - cis_csc_v7: ["5.5"] + - iso_27001-2013: ["A.12.1.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/issue -p wa -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/issue.net -p wa -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/hosts -p wa -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/sysconfig/network -p wa -k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/sysconfig/network-scripts/ -p wa -k system-locale' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/sysconfig/network-scripts && r:-p wa && r:-k system-locale|key=system-locale" + + # 4.1.3.6 Ensure use of privileged commands are collected. (Automated) - Not Implemented + + # 4.1.3.7 Ensure unsuccessful file access attempts are collected. (Automated) + - id: 5127 + title: "Ensure unsuccessful file access attempts are collected." + description: "Monitor for unsuccessful attempts to access files. The following parameters are associated with system calls that control files: creation - creat - - opening - open , openat - truncation - truncate , ftruncate An audit log record will only be written if all of the following criteria is met for the user when trying to access a file: - a non-privileged user (auid>=UID_MIN) - - is not a Daemon event (auid=4294967295/unset/-1) if the system call returned EACCES (permission denied) or EPERM (some other permanent error associated with the specific system call)." + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor unsuccessful file access attempts. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S creat,open,openat,truncate,ftruncate -F exit=- EACCES -F auid>=${UID_MIN} -F auid!=unset -k access -a always,exit -F arch=b64 -S creat,open,openat,truncate,ftruncate -F exit=- EPERM -F auid>=${UID_MIN} -F auid!=unset -k access -a always,exit -F arch=b32 -S creat,open,openat,truncate,ftruncate -F exit=- EACCES -F auid>=${UID_MIN} -F auid!=unset -k access -a always,exit -F arch=b32 -S creat,open,openat,truncate,ftruncate -F exit=- EPERM -F auid>=${UID_MIN} -F auid!=unset -k access \" >> /etc/audit/rules.d/50-access.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.7"] + - cis_csc_v7: ["14.9"] + - iso_27001-2013: ["A.12.4.3"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EACCES && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EACCES && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EPERM && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:creat && r:open && r:openat && r:truncate && r:ftruncate && r:-F exit=-EPERM && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k access|key=access' + + # 4.1.3.8 Ensure events that modify user/group information are collected. (Automated) + - id: 5128 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the modification of user or group information, including that of passwords and old passwords if in use. - /etc/group - system groups - /etc/passwd - system users - /etc/gshadow - encrypted password for each group - /etc/shadow - system user passwords - /etc/security/opasswd - storage of old passwords if the relevant PAM module is in use The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify user/group information. Example: # printf \" -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity \" >> /etc/audit/rules.d/50-identity.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.8"] + - cis_csc_v7: ["4.8"] + - iso_27001-2013: ["A.12.4.3"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/group -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/passwd -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/gshadow -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/shadow -p wa -k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -w /etc/security/opasswd -p wa -k identity' + - "c:auditctl -l -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity" + + # 4.1.3.9 Ensure discretionary access control permission modification events are collected. (Automated) - Not Implemented + + # 4.1.3.10 Ensure successful file system mounts are collected. (Automated) + - id: 5129 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non-privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful file system mounts. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=unset -k mounts -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=unset -k mounts \" >> /etc/audit/rules.d/50-perm_mod.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.10"] + - cis_csc_v7: ["5.1"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + + # 4.1.3.11 Ensure session initiation information is collected. (Automated) + - id: 5130 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. - /var/run/utmp - tracks all currently logged in users. - /var/log/wtmp - file tracks logins, logouts, shutdown, and reboot events. - /var/log/btmp - keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier "session.".' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor session initiation information. Example: # printf \" -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k session -w /var/log/btmp -p wa -k session \" >> /etc/audit/rules.d/50-session.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.11"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/run/utmp -p wa -k session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/log/wtmp -p wa -k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/log/btmp -p wa -k logins' + - "c:auditctl -l -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session" + + # 4.1.3.12 Ensure login and logout events are collected. (Automated) + - id: 5131 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. - /var/log/lastlog - maintain records of the last time a user successfully logged in. - /var/run/faillock - directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor login and logout events. Example: # printf \" -w /var/log/lastlog -p wa -k logins -w /var/run/faillock -p wa -k logins \" >> /etc/audit/rules.d/50-login.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.12"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.8.1.3", "A.9.4.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/log/lastlog -p wa -k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /var/run/faillock/ -p wa -k logins' + - "c:auditctl -l -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins" + - "c:auditctl -l -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins" + + # 4.1.3.13 Ensure file deletion events by users are collected. (Automated) + - id: 5132 + title: "Ensure file deletion events by users are collected." + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for: - unlink - remove a file - unlinkat - remove a file attribute - rename - rename a file - renameat rename a file attribute system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor file deletion events by users. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete -a always,exit -F arch=b32 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete \" >> /etc/audit/rules.d/50-delete.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.13"] + - cis_csc_v7: ["13"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + + # 4.1.3.14 Ensure events that modify the system's Mandatory Access Controls are collected. (Automated) + - id: 5133 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor SELinux, an implementation of mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux/ and /usr/share/selinux/ directories. Note: If a different Mandatory Access Control method is used, changes to the corresponding directories should be audited." + rationale: "Changes to files in the /etc/selinux/ and /usr/share/selinux/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's Mandatory Access Controls. Example: # printf \" -w /etc/selinux -p wa -k MAC-policy -w /usr/share/selinux -p wa -k MAC-policy \" >> /etc/audit/rules.d/50-MAC-policy.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.14"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /etc/selinux/ -p wa -k MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:-w /usr/share/selinux/ -p wa -k MAC-policy' + - "c:auditctl -l -> r:^-w && r:/etc/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy" + - "c:auditctl -l -> r:^-w && r:/usr/share/selinux && r:-p wa && r:-k MAC-policy|key=MAC-policy" + + # 4.1.3.15 Ensure successful and unsuccessful attempts to use the chcon command are recorded. (Automated) + - id: 5134 + title: "Ensure successful and unsuccessful attempts to use the chcon command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chcon command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chcon command. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.15"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + + # 4.1.3.16 Ensure successful and unsuccessful attempts to use the setfacl command are recorded. (Automated) + - id: 5135 + title: "Ensure successful and unsuccessful attempts to use the setfacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the setfacl command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the setfacl command. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-priv_cmd.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.16"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + + # 4.1.3.17 Ensure successful and unsuccessful attempts to use the chacl command are recorded. (Automated) + - id: 5136 + title: "Ensure successful and unsuccessful attempts to use the chacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chacl command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chacl command. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.17"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k priv_cmd|-F key=priv_cmd' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k priv_cmd|-F key=priv_cmd' + + # 4.1.3.18 Ensure successful and unsuccessful attempts to use the usermod command are recorded. (Automated) + - id: 5137 + title: "Ensure successful and unsuccessful attempts to use the usermod command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the usermod command." + rationale: "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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the usermod command. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k usermod \" >> /etc/audit/rules.d/50-usermod.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.18"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + + # 4.1.3.19 Ensure kernel module loading unloading and modification is collected. (Automated) + - id: 5138 + title: "Ensure kernel module loading unloading and modification is collected." + description: "Monitor the loading and unloading of kernel modules. All the loading / listing / dependency checking of modules is done by kmod via symbolic links. The following system calls control loading and unloading of modules: - init_module - load a module - finit_module - load a module (used when the overhead of using cryptographically signed modules to determine the authenticity of a module can be avoided) - delete_module - delete a module - create_module - create a loadable module entry - query_module - query the kernel for various bits pertaining to modules Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of modules." + rationale: "Monitoring the use of all the various ways to manipulate kernel modules could provide system administrators with evidence that an unauthorized change was made to a kernel module, possibly compromising the security of the system." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor kernel module modification. 64 Bit systems Example: # UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) # [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S init_module,finit_module,delete_module,create_module,query_module -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules -a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules \" >> /etc/audit/rules.d/50-kernel_modules.rules \\ || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.19"] + - cis_csc_v7: ["5.1"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + condition: all + rules: + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l-> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - "c:ls -l /usr/sbin/lsmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/rmmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/insmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modinfo -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modprobe -> r:/bin/kmod" + - "c:ls -l /usr/sbin/depmod -> r:/bin/kmod" + + # 4.1.3.20 Ensure the audit configuration is immutable. (Automated) + - id: 5139 + title: "Ensure the audit configuration is immutable." + description: "Set system audit so that audit rules cannot be modified with auditctl. Setting the flag -e 2 forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: This setting will require the system to be rebooted to update the active auditd configuration settings." + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the following line at the end of the file: -e 2." + compliance: + - cis: ["4.1.3.20"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not d:/etc/audit/rules.d -> r:\.+.rules$ -> !r:\s*\t*-e 2$' + + # 4.1.3.21 Ensure the running and on disk configuration is the same. (Manual) + - id: 5140 + title: "Ensure the running and on disk configuration is the same." + description: "The Audit system have both on disk and running configuration. It is possible for these configuration settings to differ. Note: Due to the limitations of augenrules and auditctl, it is not absolutely guaranteed that loading the rule sets via augenrules --load will result in all rules being loaded or even that the user will be informed if there was a problem loading the rules." + rationale: "Configuration differences between what is currently running and what is on disk could cause unexpected problems or may give a false impression of compliance requirements." + remediation: 'If the rules are not aligned across all three () areas, run the following command to merge and load all rules: # augenrules --load Check if reboot is required. if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then echo "Reboot required to load rules"; fi.' + compliance: + - cis: ["4.1.3.21"] + - cis_csc_v8: ["8.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:augenrules --check -> r:/usr/sbin/augenrules && r:No change" + + ############################################### + # 4.2 Configure Logging + ############################################### + # 4.2.1 Configure rsyslog + ############################################### + + # 4.2.1.1 Ensure rsyslog is installed. (Automated) + - id: 5141 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is recommended in environments where journald does not meet operation requirements." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # dnf install rsyslog." + compliance: + - cis: ["4.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q rsyslog -> r:^rsyslog-" + + # 4.2.1.2 Ensure rsyslog service is enabled. (Automated) + - id: 5142 + title: "Ensure rsyslog service is enabled." + description: "Once the rsyslog package is installed, ensure that the service is enabled." + rationale: "If the rsyslog service is not enabled to start on boot, the system will not capture logging events." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "p:rsyslog" + + # 4.2.1.3 Ensure journald is configured to send logs to rsyslog. (Manual) + - id: 5143 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the RSyslog service provides a consistent means of log collection and export." + rationale: "IF RSyslog is the preferred method for capturing logs, all logs of the system should be sent to it for further processing." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.3"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + + # 4.2.1.4 Ensure rsyslog default file permissions are configured. (Automated) + - id: 5144 + title: "Ensure rsyslog default file permissions are configured." + description: "RSyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + impact: "The systems global umask could override, but only making the file permissions stricter, what is configured in RSyslog with the FileCreateMode directive. RSyslog also has it's own $umask directive that can alter the intended file creation mode. In addition, consideration should be given to how FileCreateMode is used. Thus it is critical to ensure that the intended file creation mode is not overridden with less restrictive settings in /etc/rsyslog.conf, /etc/rsyslog.d/*conf files and that FileCreateMode is set before any file is created." + remediation: "Edit either /etc/rsyslog.conf or a dedicated .conf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640 Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.4"] + - cis_csc_v8: ["3.3", "8.2"] + - cis_csc_v7: ["5.1", "6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)", "164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0' + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d20|^\$FileCreateMode 0\d00' + + # 4.2.1.5 Ensure logging is configured. (Manual) - Not Implemented + + # 4.2.1.6 Ensure rsyslog is configured to send logs to a remote log host. (Manual) + - id: 5145 + title: "Ensure rsyslog is configured to send logs to a remote log host." + description: "RSyslog supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). The target directive may either be a fully qualified domain name or an IP address. *.* action(type="omfwd" target="192.168.2.100" port="514" protocol="tcp" action.resumeRetryCount="100" queue.type="LinkedList" queue.size="1000") Run the following command to reload the rsyslogd configuration: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.6"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> !r:# && r:^*.* @@\.+' + - 'f:/etc/rsyslog.conf -> !r:# && r:^*.* action && r:target="' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:# && r:^*.* @@\.+' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:# && r:^*.* action && r:target="' + + # 4.2.1.7 Ensure rsyslog is not configured to recieve logs from a remote client. (Automated) + - id: 5146 + title: "Ensure rsyslog is not configured to recieve logs from a remote client." + description: "RSyslog supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: 'Should there be any active log server configuration found in the auditing section, modify those files and remove the specific lines highlighted by the audit. Ensure none of the following entries are present in any of /etc/rsyslog.conf or /etc/rsyslog.d/*.conf. Old format $ModLoad imtcp $InputTCPServerRun New format module(load="imtcp") input(type="imtcp" port="514") Restart the service: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.7"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not d:/etc/rsyslog.d -> r:\.+.conf$ -> r:^\s*\t*\$ModLoad imtcp|\s*\t*^\$InputTCPServerRun|^\s*\t*module load="imtcp"|^\s*\t*input type="imtcp" port="514"' + - 'not f:/etc/rsyslog.conf -> r:^\s*\t*\$ModLoad imtcp|^\s*\t*\$InputTCPServerRun|^\s*\t*module load="imtcp"|^\s*\t*input type="imtcp" port="514"' + + ############################################### + # 4.2.2.1 Configure systemd journal remote + ############################################### + + # 4.2.2.1.1 Ensure systemd-journal-remote is installed. (Manual) + - id: 5147 + title: "Ensure systemd-journal-remote is installed." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to install systemd-journal-remote: # dnf install systemd-journal-remote." + compliance: + - cis: ["4.2.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q systemd-journal-remote -> r:^systemd-journal-remote-" + + # 4.2.2.1.2 Ensure systemd-journal-remote is configured. (Manual) - Not Implemented + + # 4.2.2.1.3 Ensure systemd-journal-remote is enabled. (Manual) + - id: 5148 + title: "Ensure systemd-journal-remote is enabled." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to enable systemd-journal-remote: # systemctl --now enable systemd-journal-upload.service." + compliance: + - cis: ["4.2.2.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-upload.service -> r:^enabled" + + ############################################### + # 4.2.2.1 Configure journald + ############################################### + + # 4.2.2.1.4 Ensure journald is not configured to recieve logs from a remote client. (Automated) + - id: 5149 + title: "Ensure journald is not configured to recieve logs from a remote client." + description: "Journald supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts. NOTE: - The same package, systemd-journal-remote, is used for both sending logs to remote hosts and receiving incoming logs. - With regards to receiving logs, there are two services; systemd-journal- remote.socket and systemd-journal-remote.service." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: "Run the following command to disable systemd-journal-remote.socket: # systemctl --now mask systemd-journal-remote.socket." + compliance: + - cis: ["4.2.2.1.4"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-remote.socket -> r:^masked" + + # 4.2.2.2 Ensure journald service is enabled. (Automated) + - id: 5150 + title: "Ensure journald service is enabled." + description: "Ensure that the systemd-journald service is enabled to allow capturing of logging events." + rationale: "If the systemd-journald service is not enabled to start on boot, the system will not capture logging events." + remediation: "By default the systemd-journald service does not have an [Install] section and thus cannot be enabled / disabled. It is meant to be referenced as Requires or Wants by other unit files. As such, if the status of systemd-journald is not static, investigate why." + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journald.service -> r:^static" + + # 4.2.2.3 Ensure journald is configured to compress large log files. (Automated) + - id: 5151 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.3", "6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Compress\s*=\s*yes' + + # 4.2.2.4 Ensure journald is configured to write logfiles to persistent disk. (Automated) + - id: 5152 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss due to a reboot." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Storage\s*=\s*persistent' + + # 4.2.2.5 Ensure journald is not configured to send logs to rsyslog. (Manual) + - id: 5153 + title: "Ensure journald is not configured to send logs to rsyslog." + description: "Data from journald should be kept in the confines of the service and not forwarded on to other services." + rationale: "IF journald is the method for capturing logs, all logs of the system should be handled by journald and not forwarded to other logging mechanisms." + remediation: "Edit the /etc/systemd/journald.conf file and ensure that ForwardToSyslog=yes is removed. Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.5"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: none + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + + # 4.2.2.6 Ensure journald log rotation is configured per site policy. (Manual) - Not Implemented + # 4.2.2.7 Ensure journald default file permissions configured. (Manual) - Not Implemented + + # 4.2.3 Ensure permissions on all logfiles are configured. (Automated) + - id: 5154 + title: "Ensure permissions on all logfiles are configured." + description: "Log files contain information from many services on the the local system, or in the event of a centralized log server, others systems logs as well. In general log files are found in /var/log/, although application can be configured to store logs elsewhere. Should your application store logs in another, ensure to run the same test on that location." + rationale: "It is important that log files have the correct permissions to ensure that sensitive data is protected and that only the appropriate users / groups have access to them." + remediation: 'Run the following command to set permissions on all existing log files in /var/log. Although the command is not destructive, ensure that the output of the audit procedure is captured in the event that the remediation causes issues. # find /var/log/ -type f -perm /g+wx,o+rwx -exec chmod --changes g-wx,o-rwx "{}" + If there are services that logs to other locations, ensure that those log files have the appropriate permissions.' + compliance: + - cis: ["4.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + + # 4.3 Ensure logrotate is configured. (Manual) - Not Implemented + + ############################################### + # 5 Access, Authentication and Authorization + ############################################### + ############################################### + # 5.1 Configure cron + ############################################### + + # 5.1.1 Ensure cron daemon is enabled. (Automated) + - id: 5155 + title: "Ensure cron daemon is enabled." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: # systemctl --now enable crond." + compliance: + - cis: ["5.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "p:crond" + + # 5.1.2 Ensure permissions on /etc/crontab are configured. (Automated) + - id: 5156 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab." + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured. (Automated) + - id: 5157 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : # chown root:root /etc/cron.hourly # chmod og-rwx /etc/cron.hourly." + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured. (Automated) + - id: 5158 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily." + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured. (Automated) + - id: 5159 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : # chown root:root /etc/cron.weekly # chmod og-rwx /etc/cron.weekly." + compliance: + - cis: ["5.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured. (Automated) + - id: 5160 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly." + compliance: + - cis: ["5.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured. (Automated) + - id: 5161 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab , but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d." + compliance: + - cis: ["5.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.8 Ensure cron is restricted to authorized users. (Automated) + - id: 5162 + title: "Ensure cron is restricted to authorized users." + description: "If cron is installed in the system, configure /etc/cron.allow to allow specific users to use these services. If /etc/cron.allow does not exist, then /etc/cron.deny is checked. Any user not specifically defined in those files is allowed to use cron. By removing the file, only users in /etc/cron.allow are allowed to use cron. Note: Even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: 'Run the following scritp to remove /etc/cron.deny, create /etc/cron.allow, and set the file mode on /etc/cron.allow`: #!/usr/bin/env bash cron_fix() { if rpm -q cronie >/dev/null; then [ -e /etc/cron.deny ] && rm -f /etc/cron.deny [ ! -e /etc/cron.allow ] && touch /etc/cron.allow chown root:root /etc/cron.allow chmod u-x,go-rwx /etc/cron.allow else echo "cron is not installed on the system" fi } cron_fix OR Run the following command to remove cron: # dnf remove cronie.' + compliance: + - cis: ["5.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:stat -L /etc/cron.deny -> r:No such file or directory$" + - 'c:stat -L /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.9 Ensure at is restricted to authorized users. (Automated) + - id: 5163 + title: "Ensure at is restricted to authorized users." + description: "If at is installed in the system, configure /etc/at.allow to allow specific users to use these services. If /etc/at.allow does not exist, then /etc/at.deny is checked. Any user not specifically defined in those files is allowed to use at. By removing the file, only users in /etc/at.allow are allowed to use at. Note: Even though a given user is not listed in at.allow, at jobs can still be run as that user. The at.allow file only controls administrative access to the at command for scheduling and modifying at jobs." + rationale: "On many systems, only the system administrator is authorized to schedule at jobs. Using the at.allow file to control who can run at jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: 'Run the following script to remove /etc/at.deny, create /etc/at.allow, and set the file mode for /etc/at.allow: #!/usr/bin/env bash at_fix() { if rpm -q at >/dev/null; then [ -e /etc/at.deny ] && rm -f /etc/at.deny [ ! -e /etc/at.allow ] && touch /etc/at.allow chown root:root /etc/at.allow chmod u-x,go-rwx /etc/at.allow else echo "at is not installed on the system" fi } at_fix OR Run the following command to remove at: # dnf remove at.' + compliance: + - cis: ["5.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:stat -L /etc/at.deny -> r:No such file or directory$" + - 'c:stat -L /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + ############################################### + # 5.2 Configure SSH + ############################################### + + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured. (Automated) + - id: 5164 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2.2 Ensure permissions on SSH private host key files are configured. (Automated) + - id: 5165 + title: "Ensure permissions on SSH private host key files are configured." + description: "An SSH private key is one of two files used in SSH public key authentication. In this authentication method, the possession of the private key is proof of identity. Only a private key that corresponds to a public key will be able to authenticate successfully. The private keys need to be stored and handled carefully, and no copies of the private key should be distributed." + rationale: "If an unauthorized user obtains the private SSH host key file, the host could be impersonated." + remediation: "Run the following commands to set permissions, ownership, and group on the private SSH host key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chmod u-x,g-wx,o- rwx {} \\; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chown root:ssh_keys {} \\;." + compliance: + - cis: ["5.2.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/ssh/ssh_host_rsa_key -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat -L /etc/ssh/ssh_host_ecdsa_key -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat -L /etc/ssh/ssh_host_ed25519_key -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2.3 Ensure permissions on SSH public host key files are configured. (Automated) + - id: 5166 + title: "Ensure permissions on SSH public host key files are configured." + description: "An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully." + rationale: "If a public host key file is modified by an unauthorized user, the SSH service may be compromised." + remediation: "Run the following commands to set permissions and ownership on the SSH host public key files # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chmod u-x,go- wx {} \\; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chown root:root {} \\;." + compliance: + - cis: ["5.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/ssh/ssh_host_rsa_key.pub -> r:^Access: \(0\d\d\d/\w\w\w\w\w\w-\w\w-\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat -L /etc/ssh/ssh_host_ecdsa_key.pub -> r:^Access: \(0\d\d\d/\w\w\w\w\w\w-\w\w-\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat -L /etc/ssh/ssh_host_ed25519_key.pub -> r:^Access: \(0\d\d\d/\w\w\w\w\w\w-\w\w-\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2.4 Ensure SSH access is limited. (Automated) + - id: 5167 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: o The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: o The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: o The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: o The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers OR AllowGroups OR DenyUsers OR DenyGroups ." + compliance: + - cis: ["5.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowUsers' + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowGroups' + - 'f:/etc/ssh/sshd_config -> r:^\s*DenyUsers' + - 'f:/etc/ssh/sshd_config -> r:^\s*DenyGroups' + + # 5.2.5 Ensure SSH LogLevel is appropriate. (Automated) + - id: 5168 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE OR LogLevel INFO." + references: + - "https://www.ssh.com/ssh/sshd_config/" + compliance: + - cis: ["5.2.5"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*LogLevel\s+VERBOSE|^\s*loglevel\s+INFO' + - "f:/etc/ssh/sshd_config -> r:loglevel" + + # 5.2.6 Ensure SSH PAM is enabled. (Automated) + - id: 5169 + title: "Ensure SSH PAM is enabled." + description: "UsePAM Enables the Pluggable Authentication Module interface. If set to yes this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types." + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + impact: "If UsePAM is enabled, you will not be able to run sshd(8) as a non-root user." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes." + compliance: + - cis: ["5.2.6"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*usepam\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\sUsePAM\s+no' + + # 5.2.7 Ensure SSH root login is disabled. (Automated) + - id: 5170 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no." + compliance: + - cis: ["5.2.7"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'c:sshd -T -C user=root -> !r:^# && r:PermitRootLogin\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitRootLogin\s+yes' + + # 5.2.8 Ensure SSH HostbasedAuthentication is disabled. (Automated) + - id: 5171 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no." + compliance: + - cis: ["5.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> !r:^# && r:HostbasedAuthentication\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sHostbasedAuthentication\s+yes' + + # 5.2.9 Ensure SSH PermitEmptyPasswords is disabled. (Automated) + - id: 5172 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no." + compliance: + - cis: ["5.2.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> !r:^# && r:PermitEmptyPasswords\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitEmptyPasswords\s+yes' + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled. (Automated) + - id: 5173 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no." + compliance: + - cis: ["5.2.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitUserEnvironment\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitUserEnvironment\s+yes' + + # 5.2.11 Ensure SSH IgnoreRhosts is enabled. (Automated) + - id: 5174 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes." + compliance: + - cis: ["5.2.11"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> !r:^# && r:ignorerhosts\s*\t*yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*ignorerhosts\s+no' + + # 5.2.12 Ensure SSH X11 forwarding is disabled. (Automated) + - id: 5175 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no." + compliance: + - cis: ["5.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*X11Forwarding\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*x11forwarding\s+yes' + + # 5.2.13 Ensure SSH AllowTcpForwarding is disabled. (Automated) + - id: 5176 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments that employ mainframe systems as their application backends. In those environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no." + references: + - "https://www.ssh.com/ssh/tunneling/example" + compliance: + - cis: ["5.2.13"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*AllowTcpForwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*AllowTcpForwarding\s+yes' + + # 5.2.14 Ensure system-wide crypto policy is not over-ridden. (Automated) + - id: 5177 + title: "Ensure system-wide crypto policy is not over-ridden." + description: "System-wide Crypto policy can be over-ridden or opted out of for openSSH." + rationale: "Over-riding or opting out of the system-wide crypto policy could allow for the use of less secure Ciphers, MACs, KexAlgorithms and GSSAPIKexAlgorithm." + remediation: "Run the following commands: # sed -ri \"s/^\\s*(CRYPTO_POLICY\\s*=.*)$/# \\1/\" /etc/sysconfig/sshd # systemctl reload sshd." + compliance: + - cis: ["5.2.14"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'f:/etc/sysconfig/sshd -> !r:^\s*CRYPTO_POLICY=' + + # 5.2.15 Ensure SSH warning banner is configured. (Automated) + - id: 5178 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.2.15"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*Banner\s*\t*/etc/issue.net' + + # 5.2.16 Ensure SSH MaxAuthTries is set to 4 or less. (Automated) + - id: 5179 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4." + compliance: + - cis: ["5.2.16"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -C user=root -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'f:/etc/ssh/sshd_config -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.2.17 Ensure SSH MaxStartups is configured. (Automated) + - id: 5180 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: maxstartups 10:30:60." + compliance: + - cis: ["5.2.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + + # 5.2.18 Ensure SSH MaxSessions is set to 10 or less. (Automated) + - id: 5181 + title: "Ensure SSH MaxSessions is set to 10 or less." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10." + compliance: + - cis: ["5.2.18"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'c:sshd -T -C user=root -> n:^\s*MaxSessions\s+(\d+) compare <= 10' + - 'not f:/etc/ssh/sshd_config -> n:^\s*MaxSessions\s+(\d+) compare > 10' + + # 5.2.19 Ensure SSH LoginGraceTime is set to one minute or less. (Automated) + - id: 5182 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60." + compliance: + - cis: ["5.2.19"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60 && n:^\s*LoginGraceTime\s*\t*(\d+) compare > 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60 && n:^\s*LoginGraceTime\s*\t*(\d+) compare > 0' + + # 5.2.20 Ensure SSH Idle Timeout Interval is configured. (Automated) + - id: 5183 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. - ClientAliveInterval sets 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 default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax sets the number of client alive messages which may be sent without sshd receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. The default value is 3. o The client alive messages are sent through the encrypted channel o Setting ClientAliveCountMax to 0 disables connection termination Example: The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value reduces this risk. - The recommended ClientAliveInterval setting is no greater than 900 seconds (15 minutes) - The recommended ClientAliveCountMax setting is 0 - At the 15 minute interval, if the ssh session is inactive, the session will be terminated." + impact: "In some cases this setting may cause termination of long-running scripts over SSH or remote automation tools which rely on SSH. In developing the local site policy, the requirements of such scripts should be considered and appropriate ServerAliveInterval and ClientAliveInterval settings should be calculated to insure operational continuity." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy. This should include ClientAliveInterval between 1 and 900 and ClientAliveCountMax of 0: ClientAliveInterval 900 ClientAliveCountMax 0." + references: + - "https://man.openbsd.org/sshd_config" + compliance: + - cis: ["5.2.20"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare > 0 && n:^\s*ClientAliveInterval\s*\t*(\d+) compare <= 900' + - 'c:sshd -T -C user=root -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare == 0' + + ############################################### + # 5.3 Configure sudo + ############################################### + + # 5.3.1 Ensure sudo is installed. (Automated) + - id: 5184 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plug-in architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plug-ins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers and any entries in /etc/sudoers.d. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo # dnf install sudo." + compliance: + - cis: ["5.3.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - "c:rpm -q sudo -> r:sudo-" + + # 5.3.2 Ensure sudo commands use pty. (Automated) + - id: 5185 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo terminal (pseudo-pty)." + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: "Edit the file /etc/sudoers with visudo or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["5.3.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s+use_pty' + - 'd:/etc/sudoers.d -> r:\. -> r:^\s*Defaults\s+use_pty' + + # 5.3.3 Ensure sudo log file exists. (Automated) + - id: 5186 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: 'Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile="" Example Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["5.3.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^Defaults logfile="' + - 'd:/etc/sudoers.d -> r:\. -> r:^Defaults\s+logfile="' + + # 5.3.4 Ensure users must provide password for escalation. (Automated) + - id: 5187 + title: "Ensure users must provide password for escalation." + description: "The operating system must be configured so that users must provide a password for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + impact: "This will prevent automated processes from being able to elevate privileges. To include Ansible and AWS builds." + remediation: "Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any line with occurrences of NOPASSWD tags in the file." + compliance: + - cis: ["5.3.4"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*# && r:NOPASSWD' + - 'd:/etc/sudoers.d -> r:\. -> !r:^\s*# && r:NOPASSWD' + + # 5.3.5 Ensure re-authentication for privilege escalation is not disabled globally. (Automated) + - id: 5188 + title: "Ensure re-authentication for privilege escalation is not disabled globally." + description: "The operating system must be configured so that users must re-authenticate for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + remediation: "Configure the operating system to require users to reauthenticate for privilege escalation. Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any occurrences of !authenticate tags in the file(s)." + compliance: + - cis: ["5.3.5"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*# && r:!authenticate' + - 'd:/etc/sudoers.d -> r:\. -> !r:^\s*# && r:!authenticate' + + # 5.3.6 Ensure sudo authentication timeout is configured correctly. (Automated) + - id: 5189 + title: "Ensure sudo authentication timeout is configured correctly." + description: "sudo caches used credentials for a default of 5 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized privileged access to another user." + remediation: "If the currently configured timeout is larger than 15 minutes, edit the file listed in the audit section with visudo -f and modify the entry timestamp_timeout= to 15 minutes or less as per your site policy. The value is in minutes. This particular entry may appear on it's own, or on the same line as env_reset. See the following two examples: Defaults env_reset, timestamp_timeout=15 Defaults timestamp_timeout=15 Defaults env_reset." + references: + - "https://www.sudo.ws/man/1.9.0/sudoers.man.html" + compliance: + - cis: ["5.3.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'not f:/etc/sudoers -> !r:^\s*\t*# && r:timestamp_timeout\s*\t*=\s*\t*-1' + - 'not d:/etc/sudoers.d -> r:\.+ -> !r:^\s*\t*# && r:timestamp_timeout\s*\t*=\s*\t*-1' + - 'not f:/etc/sudoers -> !r:^\s*\t*# && n:timestamp_timeout\s*\t*=\s*\t*(\d+) compare > 15' + - 'not d:/etc/sudoers.d -> r:\.+ -> !r:^\s*\t*# && n:timestamp_timeout\s*\t*=\s*\t*(\d+) compare > 15' + + # 5.3.7 Ensure access to the su command is restricted. (Automated) + - id: 5190 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.3.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:# && r:auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + ############################################### + # 5.4 Configure authselect + ############################################### + + # 5.4.1 Ensure custom authselect profile is used. (Manual) + - id: 5191 + title: "Ensure custom authselect profile is used." + description: "A custom profile can be created by copying and customizing one of the default profiles. The default profiles include: sssd, winbind, or the nis. This profile can then be customized to follow site specific requirements. You can select a profile for the authselect utility for a specific host. The profile will be applied to every user logging into the host." + rationale: "A custom profile is required to customize many of the pam options. When you deploy a profile, the profile is applied to every user logging into the given host." + remediation: "Run the following command to create a custom authselect profile: # authselect create-profile Example: # authselect create-profile custom-profile -b sssd --symlink-meta Run the following command to select a custom authselect profile: # authselect select custom/ {with-} Example: # authselect select custom/custom-profile with-sudo with-faillock without-nullok." + compliance: + - cis: ["5.4.1"] + - cis_csc_v8: ["16.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - iso_27001-2013: ["A.9.2.6"] + - pci_dss_v3.2.1: ["6.3.2"] + - pci_dss_v4.0: ["6.3.1"] + condition: all + rules: + - "c:authselect current -> r:^Profile ID: custom/" + + # 5.4.2 Ensure authselect includes with-faillock. (Automated) + - id: 5192 + title: "Ensure authselect includes with-faillock." + description: "The pam_faillock.so module maintains a list of failed authentication attempts per user during a specified interval and locks the account in case there were more than deny consecutive failed authentications. It stores the failure records into per-user files in the tally directory." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Run the following commands to include the with-faillock option to the current authselect profile: # authselect enable-feature with-faillock # authselect apply-changes." + compliance: + - cis: ["5.4.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:authselect current -> r:with-faillock" + - "f:/etc/authselect/authselect.conf -> r:with-faillock" + + ############################################### + # 5.5 Configure PAM + ############################################### + + # 5.5.1 Ensure password creation requirements are configured. (Automated) + - id: 5193 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. - minlen=14 - password must be 14 characters or more ** Either of the following can be used to enforce complex passwords:** - minclass=4 - provide at least four classes of characters for the new password OR - dcredit=-1 - provide at least one digit - ucredit=-1 - provide at least one uppercase character - ocredit=-1 - provide at least one special character - lcredit=-1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Run the following script to update the system-auth and password-auth files #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+.*enforce_for_r oot\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 enforce_for_root/' \"$file\" fi if grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=([4- 9]|[1-9][0-9]+)\\b.*$' \"$file\"; then sed -ri '/pwquality/s/retry=\\S+/retry=3/' \"$file\" elif ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 retry=3/' \"$file\" fi done authselect apply-changes." + compliance: + - cis: ["5.5.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:pam_pwquality.so && r:try_first_pass" + - "f:/etc/pam.d/system-auth -> r:pam_pwquality.so && r:try_first_pass" + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s+\t*=\s+\t*(\d+) compare >= 14' + + # 5.5.2 Ensure lockout for failed password attempts is configured. (Automated) + - id: 5194 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. - deny= - Number of attempts before the account is locked - unlock_time= - Time in seconds before the account is unlocked Note: The maximum configurable value for unlock_time is 604800." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Set password lockouts and unlock times to conform to site policy. deny should be not greater than 5 and unlock_time should be 0 (never), or 900 seconds or greater. Depending on the version you are running, follow one of the two methods bellow. Versions 8.2 and later: Edit /etc/security/faillock.conf and update or add the following lines: deny = 5 unlock_time = 900 Versions 8.0 and 8.1: Run the following script to update the system-auth and password-auth files. This script will update/add the deny=5 and unlock_time=900 options. This script should be modified as needed to follow local site policy. #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if grep -Pq -- '^\\h*auth\\h+required\\h+pam_faillock\\.so(\\h+[^#\\n\\r]+)?\\h+deny=(0|[6-9]|[1- 9][0-9]+)\\b.*$' \"$file\"; then sed -ri '/pam_faillock.so/s/deny=\\S+/deny=5/g' \"$file\" elif ! grep -Pq -- '^\\h*auth\\h+required\\h+pam_faillock\\.so(\\h+[^#\\n\\r]+)?\\h+deny=\\d*\\b.*$' \"$file\"; then sed -r 's/^\\s*(auth\\s+required\\s+pam_faillock\\.so\\s+)([^{}#\\n\\r]+)?\\s*(\\{.*\\})?(.*)$ /\\1\\2\\3 deny=5 \\4/' $file fi if grep -P -- '^\\h*(auth\\h+required\\h+pam_faillock\\.so\\h+)([^#\\n\\r]+)?\\h+unlock_time=([1- 9]|[1-9][0-9]|[1-8][0-9][0-9])\\b.*$' \"$file\"; then sed -ri '/pam_faillock.so/s/unlock_time=\\S+/unlock_time=900/g' \"$file\" elif ! grep -Pq -- '^\\h*auth\\h+required\\h+pam_faillock\\.so(\\h+[^#\\n\\r]+)?\\h+unlock_time=\\d*\\b.*$ ' \"$file\"; then sed -ri 's/^\\s*(auth\\s+required\\s+pam_faillock\\.so\\s+)([^{}#\\n\\r]+)?\\s*(\\{.*\\})?(.*)$ /\\1\\2\\3 unlock_time=900 \\4/' \"$file\" fi done authselect apply-changes." + compliance: + - cis: ["5.5.2"] + - cis_csc_v8: ["6.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1"] + - hipaa: ["164.308(a)(3)(ii)(C)"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["AC-2(1)"] + - pci_dss_v3.2.1: ["8.1.3"] + - pci_dss_v4.0: ["8.2.4", "8.2.5"] + - soc_2: ["CC6.2", "CC6.3"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^\s*auth\.+required\.+pam_faillock.so\.+ && n:deny=(\d+) compare <= 5 && n:unlock_time=(\d+) compare >= 900' + - 'f:/etc/pam.d/system-auth -> r:^\s*auth\.+required\.+pam_faillock.so\.+ && n:deny=(\d+) compare <= 5 && n:unlock_time=(\d+) compare >= 900' + + # 5.5.3 Ensure password reuse is limited. (Automated) + - id: 5195 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. - remember=<5> - Number of old passwords to remember." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note: These change only apply to accounts configured on the local system." + remediation: "Set remembered password history to conform to site policy. Run the following script to add or modify the pam_pwhistory.so and pam_unix.so lines to include the remember option: #!/usr/bin/env bash { file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/system-auth\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so\\s+([^# \\n\\r]+\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file elif grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?.*$' \"$file\"; then sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so/ s/$/ remember=5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/i password required pam_pwhistory.so remember=5 use_authtok' $file fi fi if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so\\s+([^#\\n\\r] +\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/ s/$/ remember=5/' $file fi fi authselect apply-changes }." + compliance: + - cis: ["5.5.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+requisite\.+pam_pwquality\.so\.+ && n:remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so\.+ && n:remember=(\d+) compare >= 5' + + # 5.5.4 Ensure password hashing algorithm is SHA-512. (Automated) + - id: 5196 + title: "Ensure password hashing algorithm is SHA-512." + description: "A cryptographic hash function converts an arbitrary-length input into a fixed length output. Password hashing performs a one-way transformation of a password, turning the password into another string, called the hashed password." + rationale: "The SHA-512 algorithm provides stronger hashing than other hashing algorithms used for password hashing with Linux, providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note: These changes only apply to accounts configured on the local system." + remediation: "Set password hashing algorithm to sha512. Edit /etc/libuser.conf and edit of add the following line: crypt_style = sha512 Edit /etc/login.defs and edit or add the following line: ENCRYPT_METHOD SHA512 Run the following script to configure pam_unix.so to use the sha512 hashing algorithm: #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+sha512\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+(md5|blowfish|bigcrypt|sha256)\\b.*$' \"$file\"; then sed -ri 's/(md5|blowfish|bigcrypt|sha256)/sha512/' \"$file\" else sed -ri 's/(^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix.so\\s+)(.*)$/\\1s ha512 \\3/' $file fi fi done authselect apply-changes Note: This only effects local users and passwords created after updating the files to use sha512. If it is determined that the password algorithm being used is not SHA-512, once it is changed, it is recommended that all user ID's be immediately expired and forced to change their passwords on next login." + compliance: + - cis: ["5.5.4"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/password-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so && r:sha512' + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so && r:sha512' + + ############################################### + # 5.6 User Accounts and Environment + ############################################### + ############################################### + # 5.6.1 Set Shadow Password Suite Parameters + ############################################### + + # 5.6.1.1 Ensure password expiration is 365 days or less. (Automated) + - id: 5197 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + compliance: + - cis: ["5.6.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + + # 5.6.1.2 Ensure minimum days between password changes is 7 or more. (Automated) + - id: 5198 + title: "Ensure minimum days between password changes is 7 or more." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs : PASS_MIN_DAYS 7 Modify user parameters for all users with a password set to match: # chage --mindays 7 ." + compliance: + - cis: ["5.6.1.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + + # 5.6.1.3 Ensure password expiration warning days is 7 or more. (Automated) + - id: 5199 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs : PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["5.6.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + # 5.6.1.4 Ensure inactive password lock is 30 days or less. (Automated) + - id: 5200 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["5.6.1.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*(\d+) compare <= 30' + + # 5.6.1.5 Ensure all users last password change date is in the past. (Automated) - Not Implemented + # 5.6.2 Ensure system accounts are secured. (Automated) - Not Implemented + + # 5.6.3 Ensure default user shell timeout is 900 seconds or less. (Automated) + - id: 5201 + title: "Ensure default user shell timeout is 900 seconds or less." + description: "TMOUT is an environmental setting that determines the timeout of a shell in seconds. - TMOUT=n - Sets the shell timeout to n seconds. A setting of TMOUT=0 disables - timeout. readonly TMOUT- Sets the TMOUT environmental variable as readonly, preventing unwanted modification during run-time. - export TMOUT - exports the TMOUT variable System Wide Shell Configuration Files: - /etc/profile - used to set system wide environmental variables on users shells. The variables are sometimes the same ones that are in the .bash_profile, however this file is used to set an initial PATH or PS1 for all shell users of the system. is only executed for interactive login shells, or shells executed with the --login parameter. - /etc/profile.d - /etc/profile will execute the scripts within /etc/profile.d/*.sh. It is recommended to place your configuration in a shell script within /etc/profile.d to set your own system wide environmental variables. - /etc/bashrc - System wide version of .bashrc. In Fedora derived distributions, etc/bashrc also invokes /etc/profile.d/*.sh if non-login shell, but redirects output to /dev/null if non-interactive. Is only executed for interactive shells or if BASH_ENV is set to /etc/bashrc." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized user access to another user's shell session that has been left unattended. It also ends the inactive session and releases the resources associated with that session." + remediation: "Review /etc/bashrc, /etc/profile, and all files ending in *.sh in the /etc/profile.d/ directory and remove or edit all TMOUT=_n_ entries to follow local site policy. TMOUT should not exceed 900 or be equal to 0. Configure TMOUT in one of the following files: - A file in the /etc/profile.d/ directory ending in .sh - /etc/profile - /etc/bashrc TMOUT configuration examples: - As multiple lines: TMOUT=900 readonly TMOUT export TMOUT - As a single line: readonly TMOUT=900 ; export TMOUT." + compliance: + - cis: ["5.6.3"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - 'not f:/etc/bashrc -> !r:^# && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not c:grep -Rh TMOUT /etc/profile /etc/profile.d/*.sh -> !r:^# && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'f:/etc/bashrc -> !r:^# && n:readonly TMOUT\s*=\s*(\d+)\s*; compare <= 900 && r:export TMOUT\s*$' + - 'c:grep -Rh TMOUT /etc/profile /etc/profile.d/*.sh -> !r:^# && n:readonly TMOUT\s*=\s*(\d+)\s*; compare <= 900 && r:export TMOUT\s*$' + + # 5.6.4 Ensure default group for the root account is GID 0. (Automated) + - id: 5202 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root account belongs to. This affects permissions of files that are created by the root account." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root account default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.6.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\w:\w:0' + + # 5.6.5 Ensure default user umask is 027 or more restrictive. (Automated) + - id: 5203 + title: "Ensure default user umask is 027 or more restrictive." + description: "The user file-creation mode mask (umask) is use to determine the file permission for newly created directories and files. In Linux, the default permissions for any newly created directory is 0777 (rwxrwxrwx), and for any newly created file it is 0666 (rw-rw-rw-). The umask modifies the default Linux permissions by restricting (masking) these permissions. The umask is not simply subtracted, but is processed bitwise. Bits set in the umask are cleared in the resulting file mode. umask can be set with either octal or Symbolic values: - Octal (Numeric) Value - Represented by either three or four digits. ie umask 0027 or umask 027. If a four digit umask is used, the first digit is ignored. The remaining three digits effect the resulting permissions for user, group, and world/other respectively. - Symbolic Value - Represented by a comma separated list for User u, group g, and world/other o. The permissions listed are not masked by umask. ie a umask set by umask u=rwx,g=rx,o= is the Symbolic equivalent of the Octal umask 027. This umask would set a newly created directory with file mode drwxr-x--- and a newly created file with file mode rw-r-----. The default umask can be set to use the pam_umask module or in a System Wide Shell Configuration File. The user creating the directories or files has the discretion of changing the permissions via the chmod command, or choosing a different default umask by adding the umask command into a User Shell Configuration File, (.bash_profile or .bashrc), in their home directory. Setting the default umask: - pam_umask module: o will set the umask according to the system default in /etc/login.defs and user settings, solving the problem of different umask settings with different shells, display managers, remote sessions etc. o umask= value in the /etc/login.defs file is interpreted as Octal o Setting USERGROUPS_ENAB to yes in /etc/login.defs (default): will enable setting of the umask group bits to be the same as owner bits. (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is the same as gid, and username is the same as the userdel will remove the user's group if it contains no more members, and useradd will create by default a group with the name of the user - System Wide Shell Configuration File: o /etc/profile - used to set system wide environmental variables on users shells. The variables are sometimes the same ones that are in the .bash_profile, however this file is used to set an initial PATH or PS1 for all shell users of the system. is only executed for interactive login shells, or shells executed with the --login parameter. o /etc/profile.d - /etc/profile will execute the scripts within /etc/profile.d/*.sh. It is recommended to place your configuration in a shell script within /etc/profile.d to set your own system wide environmental variables. o /etc/bashrc - System wide version of .bashrc. In Fedora derived distributions, etc/bashrc also invokes /etc/profile.d/*.sh if non-login shell, but redirects output to /dev/null if non-interactive. Is only executed for interactive shells or if BASH_ENV is set to /etc/bashrc. User Shell Configuration Files: - ~/.bash_profile - Is executed to configure your shell before the initial command prompt. Is only read by login shells. - ~/.bashrc - Is executed for interactive shells. only read by a shell that's both interactive and non-login." + rationale: "Setting a secure default value for umask ensures that users make a conscious choice about their file permissions. A permissive umask value could result in directories or files with excessive permissions that can be read and/or written to by unauthorized users." + remediation: "Review /etc/bashrc, /etc/profile, and all files ending in *.sh in the /etc/profile.d/ directory and remove or edit all umask entries to follow local site policy. Any remaining entries should be: umask 027, umask u=rwx,g=rx,o= or more restrictive. Configure umask in one of the following files: - A file in the /etc/profile.d/ directory ending in .sh - /etc/profile - /etc/bashrc Example: # vi /etc/profile.d/set_umask.sh umask 027 Run the following command and remove or modify the umask of any returned files: # grep -RPi '(^|^[^#]*)\\s*umask\\s+([0-7][0-7][01][0-7]\\b|[0-7][0-7][0-7][0- 6]\\b|[0-7][01][0-7]\\b|[0-7][0-7][0- 6]\\b|(u=[rwx]{0,3},)?(g=[rwx]{0,3},)?o=[rwx]+\\b|(u=[rwx]{1,3},)?g=[^rx]{1,3}( ,o=[rwx]{0,3})?\\b)' /etc/login.defs /etc/profile* /etc/bashrc* Follow one of the following methods to set the default user umask: Edit /etc/login.defs and edit the UMASK and USERGROUPS_ENAB lines as follows: UMASK 027 USERGROUPS_ENAB no Edit the files /etc/pam.d/password-auth and /etc/pam.d/system-auth and add or edit the following: session optional pam_umask.so OR Configure umask in one of the following files: - A file in the /etc/profile.d/ directory ending in .sh - /etc/profile - /etc/bashrc Example: /etc/profile.d/set_umask.sh umask 027 Note: this method only applies to bash and shell. If other shells are supported on the system, it is recommended that their configuration files also are checked." + compliance: + - cis: ["5.6.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'f:/etc/bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + # 6.1.1 Audit system file permissions. (Manual) - Not Implemented + # 6.1.2 Ensure sticky bit is set on all world-writable directories. (Automated) - Not Implemented + + ############################################### + # 6 System Maintenance + ############################################### + ############################################### + # 6.1 System File Permissions + ############################################### + + # 6.1.3 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 5204 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.4 Ensure permissions on /etc/shadow are configured. (Automated) + - id: 5205 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following commands to set owner, group, and permissions on /etc/shadow: # chown root:root /etc/shadow # chmod 0000 /etc/shadow." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/shadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + + # 6.1.5 Ensure permissions on /etc/group are configured. (Automated) + - id: 5206 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following commands to set owner, group, and permissions on /etc/group: # chown root:root /etc/group # chmod u-x,g-wx,o-wx /etc/group." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.6 Ensure permissions on /etc/gshadow are configured. (Automated) + - id: 5207 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run the following commands to set owner, group, and permissions on /etc/gshadow # chown root:root /etc/gshadow # chmod 0000 /etc/gshadow." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/gshadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + + # 6.1.7 Ensure permissions on /etc/passwd- are configured. (Automated) + - id: 5208 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod chmod u-x,go-wx /etc/passwd-." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/passwd- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.8 Ensure permissions on /etc/shadow- are configured. (Automated) + - id: 5209 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/shadow- : # chown root:root /etc/shadow- # chmod 0000 /etc/shadow-." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/shadow- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + + # 6.1.9 Ensure permissions on /etc/group- are configured. (Automated) + - id: 5210 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/group-: # chown root:root /etc/group- # chmod u-x,go-wx /etc/group-." + compliance: + - cis: ["6.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.10 Ensure permissions on /etc/gshadow- are configured. (Automated) + - id: 5211 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chmod 0000 /etc/gshadow-." + compliance: + - cis: ["6.1.10"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/gshadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\w*/\s*\t*shadow\)' + + # 6.1.11 Ensure no world writable files exist. (Automated) - Not Implemented + # 6.1.12 Ensure no unowned files or directories exist. (Automated) - Not Implemented + # 6.1.13 Ensure no ungrouped files or directories exist. (Automated) - Not Implemented + # 6.1.14 Audit SUID executables. (Manual) - Not Implemented + # 6.1.15 Audit SGID executables. (Manual) - Not Implemented + + ############################################### + # 6.2 Review User and Group Settings + ############################################### + + # 6.2.1 Ensure password fields are not empty. (Automated) + - id: 5212 + title: "Ensure password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + + # 6.2.2 Ensure all groups in /etc/passwd exist in /etc/group. (Automated) - Not Implemented + # 6.2.3 Ensure no duplicate UIDs exist. (Automated) - Not Implemented + # 6.2.4 Ensure no duplicate GIDs exist. (Automated) - Not Implemented + # 6.2.5 Ensure no duplicate user names exist. (Automated) - Not Implemented + # 6.2.6 Ensure no duplicate group names exist. (Automated) - Not Implemented + # 6.2.7 Ensure root PATH Integrity. (Automated) - Not Implemented + + # 6.2.8 Ensure root is the only UID 0 account. (Automated) + - id: 5213 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: 'This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in recommendation "Ensure access to the su command is restricted".' + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' + + # 6.2.9 Ensure all users' home directories exist. (Automated) - Not Implemented + # 6.2.10 Ensure users own their home directories. (Automated) - Not Implemented + # 6.2.11 Ensure users' home directories permissions are 750 or more restrictive. (Automated) - Not Implemented + # 6.2.12 Ensure users' dot files are not group or world writable. (Automated) - Not Implemented + # 6.2.13 Ensure users' .netrc Files are not group or world accessible. (Automated) - Not Implemented + # 6.2.14 Ensure no users have .forward files. (Automated) - Not Implemented + # 6.2.15 Ensure no users have .netrc files. (Automated) - Not Implemented + # 6.2.16 Ensure no users have .rhosts files. (Automated) - Not Implemented diff --git a/etc/ruleset/sca/rhel/9/cis_rhel9_linux.yml b/etc/ruleset/sca/rhel/9/cis_rhel9_linux.yml new file mode 100644 index 0000000000..6438c839d5 --- /dev/null +++ b/etc/ruleset/sca/rhel/9/cis_rhel9_linux.yml @@ -0,0 +1,4020 @@ +# Security Configuration Assessment +# CIS Checks for RHEL 9 +# Copyright (C) 2022, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Red Hat Enterprise Linux 9 Benchmark v1.0.0 - 11-28-2022 + +policy: + id: "cis_rhel9_linux" + file: "cis_rhel9_linux.yml" + name: "CIS Red Hat Enterprise Linux 9 Benchmark v1.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Red Hat Enterprise Linux 9 systems running on x86 and x64 platforms. This document was tested against Red Hat Enterprise Linux 9." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check RHEL9 family platform." + description: "Requirements for running the policy against RHEL 9 family." + condition: any + rules: + - "f:/etc/redhat-release -> r:^Red Hat Enterprise Linux && r:release 9" + - "f:/etc/redhat-release -> r:^Cloud && r:release 9" + - "f:/etc/redhat-release -> r:^Oracle && r:release 9" + - "f:/etc/redhat-release -> r:^Better && r:release 9" + - "f:/etc/redhat-release -> r:^OpenVZ && r:release 9" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + ############################################### + # 1 Initial setup + ############################################### + ############################################### + # 1.1 Filesystem Configuration + ############################################### + ############################################### + # 1.1.1 Disable unused filesystems + ############################################### + # 1.1.1.1 Ensure mounting of squashfs filesystems is disabled - Not implemented + # 1.1.1.2 Ensure mounting of udf filesystems is disabled - Not implemented + ############################################### + # 1.1.2 Configure /tmp + ############################################### + + # 1.1.2.1 Ensure /tmp is a separate partition (Automated) + - id: 28000 + title: "Ensure /tmp is a separate partition." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "By design files saved to /tmp should have no expectation of surviving a reboot of the system. tmpfs is ram based and all files stored to tmpfs will be lost when the system is rebooted. If files need to be persistent through a reboot, they should be saved to /var/tmp not /tmp. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a configuration where /tmp is not a separate file system it will essentially have the whole disk available, as the default installation only creates a single / partition. On the other hand, a RAM-based /tmp (as with tmpfs) will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily. Another alternative is to create a dedicated partition for /tmp from a separate volume or disk. One of the downsides of a disk-based dedicated partition is that it will be slower than tmpfs which is RAM-based." + remediation: "First ensure that systemd is correctly configured to ensure that /tmp will be mounted at boot time. # systemctl unmask tmp.mount For specific configuration requirements of the /tmp mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 0 Example of using a volume or disk with specific mount options. The source location of the volume or disk will vary depending on your environment. /tmp defaults,nodev,nosuid,noexec 0 0." + references: + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + - "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html" + compliance: + - cis: ["1.1.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - iso_27001-2013: ["A.13.1.3"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s' + - "c:systemctl is-enabled tmp.mount -> r:enabled|static|generated" + + # 1.1.2.2 Ensure nodev option set on /tmp partition (Automated) + - id: 28001 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - iso_27001-2013: ["A.13.1.3"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nodev" + + # 1.1.2.3 Ensure noexec option set on /tmp partition (Automated) + - id: 28002 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:noexec" + + # 1.1.2.4 Ensure nosuid option set on /tmp partition (Automated) + - id: 28003 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nosuid" + + ############################################### + # 1.1.3 Configure /var + ############################################### + + # 1.1.3.1 Ensure separate partition exists for /var (Automated) + - id: 28004 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "The reasoning for mounting /var on a separate partition is as follows. - Protection from resource exhaustion: The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. - Fine grained control over the mount: Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. - Protection from exploitation: An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - 'AJ Lewis, "LVM HOWTO", http://tldp.org/HOWTO/LVM-HOWTO/' + compliance: + - cis: ["1.1.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0006"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s' + + # 1.1.3.2 Ensure nodev option set on /var partition (Automated) + - id: 28005 + title: "Ensure nodev option set on /var partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:nodev" + + # 1.1.3.3 Ensure nosuid option set on /var partition (Automated) + - id: 28006 + title: "Ensure nosuid option set on /var partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:nosuid" + + ############################################### + # 1.1.4 Configure /var/tmp + ############################################### + + # 1.1.4.1 Ensure separate partition exists for /var/tmp (Automated) + - id: 28007 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications. Temporary files residing in /var/tmp are to be preserved between reboots." + rationale: "The reasoning for mounting /var/tmp on a separate partition is as follows. - Protection from resource exhaustion: The default installation only creates a single / partition. Since the /var/tmp directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/tmp and cause potential disruption to daemons as the disk is full. - Fine grained control over the mount: Configuring /var/tmp as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. - Protection from exploitation: An example of exploiting /var/tmp may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - 'AJ Lewis, "LVM HOWTO", http://tldp.org/HOWTO/LVM-HOWTO/' + compliance: + - cis: ["1.1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s' + + # 1.1.4.2 Ensure noexec option set on /var/tmp partition (Automated) + - id: 28008 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:noexec" + + # 1.1.4.3 Ensure nosuid option set on /var/tmp partition (Automated) + - id: 28009 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nosuid" + + # 1.1.4.4 Ensure nodev option set on /var/tmp partition (Automated) + - id: 28010 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nodev" + + ############################################### + # 1.1.5 Configure /var/log + ############################################### + + # 1.1.5.1 Ensure separate partition exists for /var/log (Automated) + - id: 28011 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "The reasoning for mounting /var/log on a separate partition is as follows. - Protection from resource exhaustion: The default installation only creates a single / partition. Since the /var/log directory contains log files which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. - Fine grained control over the mount: Configuring /var/log as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. - Protection of log data: As /var/log contains log files, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + compliance: + - cis: ["1.1.5.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_3.2.1: ["10.7"] + - soc_2: ["A1.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s' + + # 1.1.5.2 Ensure nodev option set on /var/log partition (Automated) + - id: 28012 + title: "Ensure nodev option set on /var/log partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1038"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:nodev" + + # 1.1.5.3 Ensure noexec option set on /var/log partition (Automated) + - id: 28013 + title: "Ensure noexec option set on /var/log partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot run executable binaries from /var/log." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:noexec" + + # 1.1.5.4 Ensure nosuid option set on /var/log partition (Automated) + - id: 28014 + title: "Ensure nosuid option set on /var/log partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot create setuid files in /var/log." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:nosuid" + + ############################################### + # 1.1.6 Configure /var/log/audit + ############################################### + + # 1.1.6.1 Ensure separate partition exists for /var/log/audit (Automated) + - id: 28015 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "The reasoning for mounting /var/log/audit on a separate partition is as follows. - Protection from resource exhaustion: The default installation only creates a single / partition. Since the /var/log/audit directory contains the audit.log file which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/log/audit and cause auditd to trigger it's space_left_action as the disk is full. See man auditd.conf for details. - Fine grained control over the mount: Configuring /var/log/audit as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. - Protection of audit data: As /var/log/audit contains audit logs, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + compliance: + - cis: ["1.1.6.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_3.2.1: ["10.7"] + - soc_2: ["A1.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s' + + # 1.1.6.2 Ensure noexec option set on /var/log/audit partition (Automated) + - id: 28016 + title: "Ensure noexec option set on /var/log/audit partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log/audit filesystem is only intended for audit logs, set this option to ensure that users cannot run executable binaries from /var/log/audit." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:noexec" + + # 1.1.6.3 Ensure nodev option set on /var/log/audit partition (Automated) + - id: 28017 + title: "Ensure nodev option set on /var/log/audit partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log/audit filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:nodev" + + # 1.1.6.4 Ensure nosuid option set on /var/log/audit partition (Automated) + - id: 28018 + title: "Ensure nosuid option set on /var/log/audit partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log/audit filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:nosuid" + + ############################################### + # 1.1.7 Configure /home + ############################################### + + # 1.1.7.1 Ensure separate partition exists for /home (Automated) + - id: 28019 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "The reasoning for mounting /home on a separate partition is as follows. - Protection from resource exhaustion: The default installation only creates a single / partition. Since the /home directory contains user generated data, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /home and impact all local users. - Fine grained control over the mount: Configuring /home as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. In the case of /home options such as usrquota/grpquota may be considered to limit the impact that users can have on each other with regards to disk resource exhaustion. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. - Protection of user data: As /home contains user data, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + compliance: + - cis: ["1.1.7.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1038"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s' + + # 1.1.7.2 Ensure nodev option set on /home partition (Automated) + - id: 28020 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /home filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /home." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1038"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:nodev" + + # 1.1.7.3 Ensure nosuid option set on /home partition (Automated) + - id: 28021 + title: "Ensure nosuid option set on /home partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /home filesystem is only intended for user file storage, set this option to ensure that users cannot create setuid files in /home." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:nosuid" + + ############################################### + # 1.1.8 Configure /dev/shm + ############################################### + + # 1.1.8.1 Ensure /dev/shm is a separate partition (Automated) + - id: 28022 + title: "Ensure /dev/shm is a separate partition." + description: "The /dev/shm directory is a world-writable directory that can function as shared memory that facilitates inter process communication (IPC)." + rationale: "Making /dev/shm its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /dev/shm useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by mounting tmpfs to /dev/shm." + impact: "Since the /dev/shm directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. /dev/shm utilizing tmpfs can be resized using the size={size} parameter in the relevant entry in /etc/fstab." + remediation: "For specific configuration requirements of the /dev/shm mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs /dev/shm tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 0." + references: + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + - https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html + compliance: + - cis: ["1.1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - iso_27001-2013: ["A.13.1.3"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1499", "T1499.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + + # 1.1.8.2 Ensure nodev option set on /dev/shm partition (Automated) + - id: 28023 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1200"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /dev/shm -> r:nodev" + + # 1.1.8.3 Ensure noexec option set on /dev/shm partition (Automated) + - id: 28024 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Example: /dev/shm defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm. NOTE It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1204", "T1204.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:findmnt --kernel /dev/shm -> r:noexec" + + # 1.1.8.4 Ensure nosuid option set on /dev/shm partition (Automated) + - id: 28025 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1548", "T1548.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1038"] + condition: all + rules: + - "c:findmnt --kernel /dev/shm -> r:nosuid" + + # 1.1.9 Disable USB Storage (Automated) - Not Implemented + ############################################### + # 1.2 Configure Software Updates + ############################################### + # 1.2.1 Ensure GPG keys are configured (Manual) - Not implemented + + # 1.2.2 Ensure gpgcheck is globally activated (Automated) + - id: 28026 + title: "Ensure gpgcheck is globally activated." + description: "The gpgcheck option, found in the main section of the /etc/dnf/dnf.conf and individual /etc/yum.repos.d/* files, determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: 'Edit /etc/dnf/dnf.conf and set gpgcheck=1 in the [main] section. Example: # sed -i ''s/^gpgcheck\s*=\s*.*/gpgcheck=1/'' /etc/dnf/dnf.conf. Edit any failing files in /etc/yum.repos.d/* and set all instances starting with gpgcheck to 1. Example: # find /etc/yum.repos.d/ -name "*.repo" -exec echo "Checking:" {} \; -exec sed -i ''s/^gpgcheck\s*=\s*.*/gpgcheck=1/'' {} \;.' + compliance: + - cis: ["1.2.2"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - nist_sp_800-53: ["SI-2"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - pci_dss_3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + - mitre_techniques: ["T1195", "T1195.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'f:/etc/dnf/dnf.conf -> r:^\s*gpgcheck\s*=\s*1' + - 'not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck\s*=\s*0' + + # 1.2.3 Ensure package manager repositories are configured (Manual) - Not implemented + # 1.2.4 Ensure repo_gpgcheck is globally activated (Manual) - Not implemented + ############################################### + # 1.3 Filesystem Integrity Checking + ############################################### + + # 1.3.1 Ensure AIDE is installed (Automated) + - id: 28027 + title: "Ensure AIDE is installed." + description: "Advanced Intrusion Detection Environment (AIDE) is a intrusion detection tool that uses predefined rules to check the integrity of files and directories in the Linux operating system. AIDE has its own database to check the integrity of files and directories. AIDE takes a snapshot of files and directories including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # dnf install aide. Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: Run the following commands: # aide --init # mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz." + compliance: + - cis: ["1.3.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - nist_sp_800-53: ["AU-2"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - pci_dss_3.2.1: ["10.2.1", "11.5"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + - mitre_techniques: ["T1565", "T1565.001"] + - mitre_tactics: ["TA0001"] + condition: all + rules: + - "c:rpm -q aide -> r:aide-" + + # 1.3.2 Ensure filesystem integrity is regularly checked (Automated) + - id: 28028 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check. Run the following command: # crontab -u root -e. Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check. OR if aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target. Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target. Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + references: + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service" + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer" + compliance: + - cis: ["1.3.2"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - nist_sp_800-53: ["AU-2"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - pci_dss_3.2.1: ["10.2.1", "11.5"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_techniques: ["T1036", "T1036.005"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "c:systemctl is-enabled aidecheck.service -> r:enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:enabled" + - "c:systemctl status aidecheck.timer -> r:active" + + # 1.3.3 Ensure cryptographic mechanisms are used to protect the integrity of audit tools (Automated) - Not implemented + ############################################### + # 1.4 Secure Boot Settings + ############################################### + + # 1.4.1 Ensure bootloader password is set (Automated) + - id: 28029 + title: "Ensure bootloader password is set." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + impact: 'If password protection is enabled, only the designated superuser can edit a Grub 2 menu item by pressing "e" or access the GRUB 2 command line by pressing "c". If GRUB 2 is set up to boot automatically to a password-protected menu entry the user has no option to back out of the password prompt to select another menu entry. Holding the SHIFT key will not display the menu in this case. The user must enter the correct username and password. If unable, the configuration files will have to be edited via the LiveCD or other means to fix the problem.' + remediation: "Create an encrypted password with grub2-setpassword: # grub2-setpassword Enter password: Confirm password: ." + compliance: + - cis: ["1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1542"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1046"] + condition: all + rules: + - f:/boot/grub2/user.cfg + - f:/boot/grub2/user.cfg -> r:^\s*GRUB2_PASSWORD=grub.pbkdf2.sha512 + + # 1.4.2 Ensure permissions on bootloader config are configured (Automated) + - id: 28030 + title: "Ensure permissions on bootloader config are configured." + description: "The grub files contain information on boot settings and passwords for unlocking boot options." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set ownership and permissions on your grub configuration files: Run the following command to set ownership and permissions on grub.cfg: # chown root:root /boot/grub2/grub.cfg # chmod og-rwx /boot/grub2/grub.cfg Run the following command to set ownership and permissions on grubenv: # chown root:root /boot/grub2/grubenv # chmod u-x,og-rwx /boot/grub2/grubenv Run the following command to set ownership and permissions on user.cfg: # chown root:root /boot/grub2/user.cfg # chmod u-x,og-rwx /boot/grub2/user.cfg Note: This may require a re-boot to enable the change." + compliance: + - cis: ["1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1542"] + - mitre_tactics: ["TA0005", "TA0007"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%#a %u %U %g %G" /boot/grub2/grub.cfg -> r:0\d00\s+0\s+root\s+0\s+root' + - 'c:stat -Lc "%#a %u %U %g %G" /boot/grub2/grubenv -> r:0400\s|0600\s && r:0\s+root\s+0\s+root' + - 'c:stat -Lc "%#a %u %U %g %G" /boot/grub2/user.cfg -> r:0400\s|0600\s && r:0\s+root\s+0\s+root' + + ############################################### + # 1.5 Additional Process Hardening + ############################################### + + # 1.5.1 Ensure core dump storage is disabled (Automated) + - id: 28031 + title: "Ensure core dump storage is disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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." + remediation: "Edit /etc/systemd/coredump.conf and edit or add the following line: Storage=none." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.1"] + - mitre_techniques: ["T1005"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*Storage\s*=\s*none' + + # 1.5.2 Ensure core dump backtraces are disabled (Automated) + - id: 28032 + title: "Ensure core dump backtraces are disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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, increasing the risk to the system." + remediation: "Edit or add the following line in /etc/systemd/coredump.conf: ProcessSizeMax=0." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.2"] + - nist_sp_800-53: ["CM-6b"] + - mitre_techniques: ["T1005"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*ProcessSizeMax\s*=\s*0' + + # 1.5.3 Ensure address space layout randomization (ASLR) is enabled (Automated) - Not implemented - needs a script. + ############################################### + # 1.6 Mandatory Access Control + ############################################### + ############################################### + # 1.6.1 Configure SELinux + ############################################### + + # 1.6.1.1 Ensure SELinux is installed (Automated) + - id: 28033 + title: "Ensure SELinux is installed." + description: "SELinux provides Mandatory Access Control." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install SELinux: # dnf install libselinux." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1068"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - "c:rpm -q libselinux -> r:^libselinux-" + + # 1.6.1.2 Ensure SELinux is not disabled in bootloader configuration (Automated) + - id: 28034 + title: "Ensure SELinux is not disabled in bootloader configuration." + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + impact: "Files created while SELinux is disabled are not labeled at all. This behavior causes problems when changing to enforcing mode because files are labeled incorrectly or are not labeled at all. To prevent incorrectly labeled and unlabeled files from causing problems, file systems are automatically relabeled when changing from the disabled state to permissive or enforcing mode. This can be a long running process that should be accounted for as it may extend downtime during initial re-boot." + remediation: 'Run the following command to remove the selinux=0 and enforcing=0 parameters: grubby --update-kernel ALL --remove-args "selinux=0 enforcing=0" Run the following command to remove the selinux=0 and enforcing=0 parameters if they were created by the deprecated grub2-mkconfig command: # grep -Prsq -- ''\h*([^#\n\r]+\h+)?kernelopts=([^#\n\r]+\h+)?(selinux|enforcing)=0\b'' /boot/grub2 /boot/efi && grub2-mkconfig -o "$(grep -Prl -- ''\h*([^#\n\r]+\h+)?kernelopts=([^#\n\r]+\h+)?(selinux|enforcing)=0\b'' /boot/grub2 /boot/efi).' + compliance: + - cis: ["1.6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1068"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1026"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + - 'f:/boot/grub2/grub.cfg -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + + # 1.6.1.3 Ensure SELinux policy is configured (Automated) + - id: 28035 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1068"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+targeted$|^Loaded policy name:\s+mls$' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Ensure the SELinux mode is not disabled (Automated) + - id: 28036 + title: "Ensure the SELinux mode is not disabled." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future. Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes" + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$|^Permissive$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing|\s*SELINUX\s*=\s*permissive' + + # 1.6.1.5 Ensure the SELinux mode is enforcing (Automated) + - id: 28037 + title: "Ensure the SELinux mode is enforcing." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future. Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode the system not only avoids enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future. Running SELinux in Permissive mode, though helpful for developing SELinux policy, only logs access denial entries, but does not deny any operations." + remediation: "Run the following command to set SELinux's running mode: # setenforce 1 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes" + compliance: + - cis: ["1.6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + # 1.6.1.6 Ensure no unconfined services exist (Automated) + - id: 28038 + title: "Ensure no unconfined services exist." + description: "Unconfined processes run in unconfined domains." + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules - it does not replace them." + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.13.1.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1022"] + condition: none + rules: + - "c:ps -eZ -> r:unconfined_service_t" + + # 1.6.1.7 Ensure SETroubleshoot is not installed (Automated) + - id: 28039 + title: "Ensure SETroubleshoot is not installed." + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # dnf remove setroubleshoot." + compliance: + - cis: ["1.6.1.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1543", "T1543.002"] + - mitre_tactics: ["TA0005"] + condition: none + rules: + - "c:rpm -qa setroubleshoot -> r:setroubleshoot" + + # 1.6.1.8 Ensure the MCS Translation Service (mcstrans) is not installed (Automated) + - id: 28040 + title: "Ensure the MCS Translation Service (mcstrans) is not installed." + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf." + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # dnf remove mcstrans." + compliance: + - cis: ["1.6.1.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - iso_27001-2013: ["A.13.1.3"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1543", "T1543.002"] + - mitre_tactics: ["TA0005"] + condition: none + rules: + - "c:rpm -qa mcstrans -> r:mcstrans" + + ############################################### + # 1.7 Command Line Warning Banners + ############################################### + + # 1.7.1 Ensure message of the day is configured properly (Automated) + - id: 28041 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the "uname -a" command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + - mitre_tactics: ["TA0007"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s|rhel' + + # 1.7.2 Ensure local login warning banner is configured properly (Automated) + - id: 28042 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.7.2"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + - mitre_tactics: ["TA0007"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|rhel' + + # 1.7.3 Ensure remote login warning banner is configured properly (Automated) + - id: 28043 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + - mitre_techniques: ["T1018", "T1082", "T1592", "T1592.004"] + - mitre_tactics: ["TA0007"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|rhel' + + # 1.7.4 Ensure permissions on /etc/motd are configured (Automated) + - id: 28044 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.5 Ensure permissions on /etc/issue are configured (Automated) + - id: 28045 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured (Automated) + - id: 28046 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + ############################################### + # 1.8 GNOME Display Manager + ############################################### + + # 1.8.1 Ensure GNOME Display Manager is removed (Automated) + - id: 28047 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + impact: "Removing the GNOME Display manager will remove the Graphical User Interface (GUI) from the system." + remediation: "Run the following command to remove the gdm package # dnf remove gdm." + references: + - "https://wiki.gnome.org/Projects/GDM" + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - iso_27001-2013: ["A.13.1.3"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1543", "T1543.002"] + - mitre_tactics: ["TA0002"] + condition: all + rules: + - "c:rpm -q gdm -> r:is not installed" + + # 1.8.2 Ensure GDM login banner is configured (Automated) - Not implemented + # 1.8.3 Ensure GDM disable-user-list option is enabled (Automated) - Not implemented + # 1.8.4 Ensure GDM screen locks when the user is idle (Automated) - Not implemented + # 1.8.5 Ensure GDM screen locks cannot be overridden (Automated) - Not implemented + # 1.8.6 Ensure GDM automatic mounting of removable media is disabled (Automated) - Not implemented + # 1.8.7 Ensure GDM disabling automatic mounting of removable media is not overridden (Automated) - Not implemented + # 1.8.8 Ensure GDM autorun-never is enabled (Automated) - Not implemented + # 1.8.9 Ensure GDM autorun-never is not overridden (Automated) - Not implemented + + # 1.8.10 Ensure XDCMP is not enabled (Automated) + - id: 28048 + title: "Ensure XDCMP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. - XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user. - XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server." + remediation: "Edit the file /etc/gdm/custom.conf and remove the line: Enable=true." + compliance: + - cis: ["1.8.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - iso_27001-2013: ["A.13.1.3"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1040", "T1056", "T1056.001", "T1557"] + - mitre_tactics: ["TA0002"] + - mitre_mitigations: ["M1050"] + condition: none + rules: + - 'f:/etc/gdm/custom.conf -> r:^\s*Enable\s*=\s*true' + + # 1.9 Ensure updates, patches, and additional security software are installed (Manual) + - id: 28049 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available updates: # dnf update. Once the update process is complete, verify if reboot is required to load changes. dnf needs-restarting -r." + compliance: + - cis: ["1.9"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4"] + - iso_27001-2013: ["A.13.1.3"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - pci_dss_3.2.1: ["6.2"] + - nist_sp_800-53: ["SI-2(2)"] + - soc_2: ["CC7.1"] + - mitre_techniques: ["T1211"] + - mitre_tactics: ["TA0004", "TA0008"] + - mitre_mitigations: ["M1051"] + condition: all + rules: + - 'not c:sh -c "dnf check-update | egrep -v \"Updating|Last metadata|^$\"" -> r:^\w' + + # 1.10 Ensure system-wide crypto policy is not legacy (Automated) + - id: 28050 + title: "Ensure system-wide crypto policy is not legacy." + description: "The system-wide crypto-policies followed by the crypto core components allow consistently deprecating and disabling algorithms system-wide. The individual policy levels (DEFAULT, LEGACY, FUTURE, and FIPS) are included in the crypto-policies(7) package." + rationale: "If the Legacy system-wide crypto policy is selected, it includes support for TLS 1.0, TLS 1.1, and SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are allowed, while RSA and Diffie-Hellman parameters are accepted if larger than 1023-bits. These legacy protocols and algorithms can make the system vulnerable to attacks, including those listed in RFC 7457." + impact: "Environments that require compatibility with older insecure protocols may require the use of the less secure LEGACY policy level." + remediation: "Run the following command to change the system-wide crypto policy # update-crypto-policies --set Example: # update-crypto-policies --set DEFAULT Run the following to make the updated system-wide crypto policy active # update-crypto-policies." + references: + - https://access.redhat.com/articles/3642912#what-polices-are-provided-1 + compliance: + - cis: ["1.10"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - nist_sp_800-53: ["SC-8"] + - iso_27001-2013: ["A.13.1.1", "A.10.1.1"] + - cmmc_v2.0: ["AC.L2-3.1.17", "AC.L2-3.1.13", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.8", "SC.L2-3.13.15"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - pci_dss_3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: none + rules: + - 'f:/etc/crypto-policies/config -> r:^\s*LEGACY' + + ############################################### + # 2 Services + ############################################### + ############################################### + # 2.1 Time Synchronization + ############################################### + + # 2.1.1 Ensure time synchronization is in use (Automated) + - id: 28051 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them. Note: If another method for time synchronization is being used, this section may be skipped." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Run the following command to install chrony: # dnf install chrony." + compliance: + - cis: ["2.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - nist_sp_800-53: ["AU-3", "AU-12"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - pci_dss_3.2.1: ["10.4"] + - pci_dss_4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:rpm -q chrony -> r:^chrony-" + + # 2.1.2 Ensure chrony is configured (Automated) + - id: 28052 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: 'Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include ''-u chrony'': OPTIONS="-u chrony".' + compliance: + - cis: ["2.1.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - nist_sp_800-53: ["AU-3", "AU-12"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - pci_dss_3.2.1: ["10.4"] + - pci_dss_4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_techniques: ["T1070", "T1070.002"] + - mitre_tactics: ["TA0002"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - "f:/etc/chrony.conf" + - 'f:/etc/chrony.conf -> r:^\s*\t*server|^\s*\t*pool' + - 'f:/etc/sysconfig/chronyd -> r:^\s*\t*OPTIONS\.*-u chrony' + + ############################################### + # 2.2 Special Purpose Services + ############################################### + + # 2.2.1 Ensure xorg-x11-server-common is not installed (Automated) + - id: 28053 + title: "Ensure xorg-x11-server-common is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: 'Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime.' + remediation: "Run the following command to remove the X Windows Server packages: # dnf remove xorg-x11-server-common." + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q xorg-x11-server-common -> r:^package xorg-x11-server-common is not installed" + + # 2.2.2 Ensure Avahi Server is not installed (Automated) + - id: 28054 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to stop, mask and remove avahi: # systemctl stop avahi-daemon.socket avahi-daemon.service # dnf remove avahi." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q avahi -> r:^package avahi is not installed" + + # 2.2.3 Ensure CUPS is not installed (Automated) + - id: 28055 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface. Note: Removing CUPS will prevent printing from the system." + impact: "Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to remove cups: # dnf remove cups." + references: + - "More detailed documentation on CUPS is available at the project homepage at http://www.cups.org." + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q cups -> r:^package cups is not installed" + + # 2.2.4 Ensure DHCP Server is not installed (Automated) + - id: 28056 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that the dhcp-server package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcp: # dnf remove dhcp-server." + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q dhcp-server -> r:^package dhcp-server is not installed" + + # 2.2.5 Ensure DNS Server is not installed (Automated) + - id: 28057 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove bind: # dnf remove bind." + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q bind -> r:^package bind is not installed" + + # 2.2.6 Ensure VSFTP Server is not installed (Automated) + - id: 28058 + title: "Ensure VSFTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "Unless there is a need to run the system as a FTP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # dnf remove vsftpd." + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q vsftpd -> r:^package vsftpd is not installed" + + # 2.2.7 Ensure TFTP Server is not installed (Automated) + - id: 28059 + title: "Ensure TFTP Server is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "Unless there is a need to run the system as a TFTP server, it is recommended that the package be removed to reduce the potential attack surface. TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + impact: "TFTP is often used to provide files for network booting such as for PXE based installation of servers." + remediation: "Run the following command to remove tftp-server: # dnf remove tftp-server." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q tftp-server -> r:^package tftp-server is not installed" + + # 2.2.8 Ensure a web server is not installed (Automated) + - id: 28060 + title: "Ensure a web server is not installed." + description: "Web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the packages be removed to reduce the potential attack surface. Note: Several http servers exist. They should also be audited, and removed, if not required." + remediation: "Run the following command to remove httpd and nginx: # dnf remove httpd nginx." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q nginx -> r:^package nginx is not installed" + - "c:rpm -q httpd -> r:^package httpd is not installed" + + # 2.2.9 Ensure IMAP and POP3 server is not installed (Automated) + - id: 28061 + title: "Ensure IMAP and POP3 server is not installed." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface. Note: Several IMAP/POP3 servers exist and can use other service names. These should also be audited and the packages removed if not required." + remediation: "Run the following command to remove dovecot and cyrus-imapd: # dnf remove dovecot cyrus-imapd." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q dovecot -> r:^package dovecot is not installed" + - "c:rpm -q cyrus-imapd -> r:^package cyrus-imapd is not installed" + + # 2.2.10 Ensure Samba is not installed (Automated) + - id: 28062 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # dnf remove samba." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1005", "T1039", "T1083", "T1135", "T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q samba -> r:^package samba is not installed" + + # 2.2.11 Ensure HTTP Proxy Server is not installed (Automated) + - id: 28063 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "Unless a system is specifically set up to act as a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface. Note: Several HTTP proxy servers exist. These should be checked and removed unless required." + remediation: "Run the following command to remove the squid package: # dnf remove squid." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q squid -> r:^package squid is not installed" + + # 2.2.12 Ensure net-snmp is not installed (Automated) + - id: 28064 + title: "Ensure net-snmp is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. - If SNMP v2 is absolutely necessary, modify the community strings' values." + remediation: "Run the following command to remove net-snmpd: # dnf remove net-snmp." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3", "A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q net-snmp -> r:^package net-snmp is not installed" + + # 2.2.13 Ensure telnet-server is not installed (Automated) + - id: 28065 + title: "Ensure telnet-server is not installed." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to remove the telnet-server package: # dnf remove telnet-server." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3", "A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q telnet-server -> r:^package telnet-server is not installed" + + # 2.2.14 Ensure dnsmasq is not installed (Automated) + - id: 28066 + title: "Ensure dnsmasq is not installed." + description: "dnsmasq is a lightweight tool that provides DNS caching, DNS forwarding and DHCP (Dynamic Host Configuration Protocol) services." + rationale: "Unless a system is specifically designated to act as a DNS caching, DNS forwarding and/or DHCP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dnsmasq: # dnf remove dnsmasq." + compliance: + - cis: ["2.2.14"] + - nist_sp_800-53: ["CM-7"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q dnsmasq -> r:^package dnsmasq is not installed" + + # 2.2.15 Ensure mail transfer agent is configured for local-only mode (Automated) + - id: 28067 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Note: - This recommendation is designed around the postfix mail server. - Depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only. Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1018", "T1210"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'not c:ss -lntu -> r:\s*127.0.0.1:25\s*|\s*::1:25\s*' + + # 2.2.16 Ensure nfs-utils is not installed or the nfs-server service is masked (Automated) + - id: 28068 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not require network shares, it is recommended that the nfs-utils package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization are dependent on the nfs-utils package. If the nfs-utils package is required as a dependency, the nfs-server service should be disabled and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove nfs-utils OR If the nfs-utils package is required as a dependency, run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1005", "T1039", "T1083", "T1135", "T1210"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: any + rules: + - "c:rpm -q nfs-utils -> r:^package nfs-utils is not installed" + - "c:systemctl is-enabled nfs-server -> r:masked|No such file or directory" + + # 2.2.17 Ensure rpcbind is not installed or the rpcbind services are masked (Automated) + - id: 28069 + title: "Ensure rpcbind is not installed or the rpcbind services are masked." + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service. Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening." + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization, and the nfs-utils package used for The Network File System (NFS), are dependent on the rpcbind package. If the rpcbind package is required as a dependency, the services rpcbind.service and rpcbind.socket should be stopped and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove rpcbind: # dnf remove rpcbind OR If the rpcbind package is required as a dependency, run the following commands to stop and mask the rpcbind.service and rpcbind.socket systemd units: # systemctl --now mask rpcbind.service # systemctl --now mask rpcbind.socket." + compliance: + - cis: ["2.2.17"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1210", "T1498", "T1498.002", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: any + rules: + - "c:rpm -q rpcbind -> r:^package rpcbind is not installed" + - "not c:systemctl status rpcbind rpcbind.socket -> r:Loaded: && !r: masked" + + # 2.2.18 Ensure rsync-daemon is not installed or the rsyncd service is masked (Automated) + - id: 28070 + title: "Ensure rsync-daemon is not installed or the rsyncd service is masked." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync-daemon package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication. Note: If a required dependency exists for the rsync-daemon package, but the rsyncd service is not required, the service should be masked." + impact: "There are packages that are dependent on the rsync package. If the rsync package is removed, these packages will be removed as well. Before removing the rsync-daemon package, review any dependent packages to determine if they are required on the system. If a dependent package is required, mask the rsyncd service and leave the rsync-daemon package installed." + remediation: "Run the following command to remove the rsync package: # dnf remove rsync-daemon OR Run the following command to mask the rsyncd service: # systemctl --now mask rsyncd." + compliance: + - cis: ["2.2.18"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1105", "T1203", "T1210", "T1543", "T1543.002", "T1570"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: any + rules: + - "c:rpm -q rsync-daemon -> r:^package rsync-daemon is not installed" + - "c:systemctl is-enabled rsyncd -> r:masked|No such file or directory" + + ############################################### + # 2.3 Service Clients + ############################################### + # 2.3.1 Ensure telnet client is not installed (Automated) + - id: 28071 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the telnet package: # dnf remove telnet." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1040", "T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0006", "TA0008"] + - mitre_mitigations: ["M1041", "M1042"] + condition: all + rules: + - "c:rpm -q telnet -> r:^package telnet is not installed" + + # 2.3.2 Ensure LDAP client is not installed (Automated) + - id: 28072 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Run the following command to remove the openldap-clients package: # dnf remove openldap-clients." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q openldap-clients -> r:^package openldap-clients is not installed" + + # 2.3.3 Ensure TFTP client is not installed (Automated) + - id: 28073 + title: "Ensure TFTP client is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + remediation: "Run the following command to remove tftp: # dnf remove tftp." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q tftp -> r:^package tftp is not installed" + + # 2.3.4 Ensure FTP client is not installed (Automated) + - id: 28074 + title: "Ensure FTP client is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove ftp: # dnf remove ftp." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - "c:rpm -q ftp -> r:^package ftp is not installed" + + # 2.4 Ensure nonessential services are removed or masked (Manual) - Not implemented + ############################################### + # 3 Network Configuration + ############################################### + ############################################### + # 3.1 Disable unused network protocols and devices + ############################################### + # 3.1.1 Ensure IPv6 status is identified (Manual) - Not implemented + # 3.1.2 Ensure wireless interfaces are disabled (Automated) - Not implemented + # 3.1.3 Ensure TIPC is disabled (Automated) - Not implemented + ############################################### + # 3.2 Network Parameters (Host Only) + ############################################### + # 3.2.1 Ensure IP forwarding is disabled (Automated) - Not implemented + # 3.2.2 Ensure packet redirect sending is disabled (Automated) - Not implemented + ############################################### + # 3.3 Network Parameters (Host and Router) + ############################################### + # 3.3.1 Ensure source routed packets are not accepted (Automated) - Not implemented + # 3.3.2 Ensure ICMP redirects are not accepted (Automated) - Not implemented + # 3.3.3 Ensure secure ICMP redirects are not accepted (Automated) - Not implemented + # 3.3.4 Ensure suspicious packets are logged (Automated) - Not implemented + # 3.3.5 Ensure broadcast ICMP requests are ignored (Automated) - Not implemented + # 3.3.6 Ensure bogus ICMP responses are ignored (Automated) - Not implemented + # 3.3.7 Ensure Reverse Path Filtering is enabled (Automated) - Not implemented + # 3.3.8 Ensure TCP SYN Cookies is enabled (Automated) - Not implemented + # 3.3.9 Ensure IPv6 router advertisements are not accepted (Automated) - Not implemented + ############################################### + # 3.4 Configure Host Based Firewall + ############################################### + ############################################### + # 3.4.1 Configure a firewall utility + ############################################### + + # 3.4.1.1 Ensure nftables is installed (Automated) + - id: 28075 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install nftables # dnf install nftables." + compliance: + - cis: ["3.4.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - nist_sp_800-53: ["CA-9"] + - iso_27001-2013: ["A.13.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + - mitre_techniques: ["T1562", "T1562.004"] + - mitre_tactics: ["TA0011"] + - mitre_mitigations: ["M1031", "M1037"] + condition: all + rules: + - "c:rpm -q firewalld -> r:^package firewalld is not installed" + - "c:rpm -q iptables -> r:^package iptables is not installed" + - "c:rpm -q nftables -> r:^nftables-" + + # 3.4.1.2 Ensure a single firewall configuration utility is in use (Automatic) - Not implemented + ############################################### + # 3.4.2 Configure firewall rules + ############################################### + # 3.4.2.1 Ensure firewalld default zone is set (Automated) - Not implemented + # 3.4.2.2 Ensure at least one nftables table exists (Automated) + - id: 28076 + title: "Ensure at least one nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "Without a table, nftables will not filter network traffic." + impact: "Adding or modifying firewall rules can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example if FirewallD is not in use on the system: # nft create table inet filter Note: FirewallD uses the table inet firewalld NFTables table that is created when FirewallD is installed." + compliance: + - cis: ["3.4.2.2"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - nist_sp_800-53: ["CA-9"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + condition: all + rules: + - "c:nft list tables -> r:^table" + - "c:rpm -q nftables -> r:^nftables-" + + # 3.4.2.3 Ensure nftables base chains exist (Automated) + - id: 28077 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: 'Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \; } Example: # nft create chain inet filter input { type filter hook input priority 0 \; } # nft create chain inet filter forward { type filter hook forward priority 0 \; } # nft create chain inet filter output { type filter hook output priority 0 \; }.' + compliance: + - cis: ["3.4.2.3"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - nist_sp_800-53: ["CA-9"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + condition: all + rules: + - "c:rpm -q nftables -> r:^nftables-" + - "c:nft list ruleset -> r:filter hook input" + - "c:nft list ruleset -> r:filter hook forward" + - "c:nft list ruleset -> r:filter hook output" + + # 3.4.2.4 Ensure host based firewall loopback traffic is configured (Automated) - Not implemented + # 3.4.2.5 Ensure firewalld drops unnecessary services and ports (Manual) - Not Implemented + # 3.4.2.6 Ensure nftables established connections are configured (Manual) - Not Implemented + + # 3.4.2.7 Ensure nftables default deny firewall policy (Automated) + - id: 28078 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue traversing the network stack. It is easier to explicitly permit acceptable usage than to deny unacceptable usage. Note: Changing firewall settings while connected over the network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: 'If NFTables utility is in use on your system: Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \; } Example: # nft chain inet filter input { policy drop \; } # nft chain inet filter forward { policy drop \; }.' + compliance: + - cis: ["3.4.2.7"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - nist_sp_800-53: ["CA-9"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + - iso_27001-2013: ["A.13.1.1"] + condition: all + rules: + - "c:systemctl is-enabled nftables.service -> r:enabled" + - "not c:nft list ruleset -> r:hook input && !r:policy drop" + - "not c:nft list ruleset -> r:hook forward && !r:policy drop" + + ############################################################ + # 4 Logging and Auditing. + ############################################################ + ############################################################ + # 4.1 Configure System Accounting (auditd). + ############################################################ + ############################################################ + # 4.1.1 Ensure auditing is enabled. + ############################################################ + + # 4.1.1.1 Ensure auditd is installed (Automated). + - id: 28079 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd: # dnf install audit." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v8: ["8.2", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - nist_sp_800-53: ["AU-2", "AU-3", "AU-3(1)", "AU-12", "SI-5"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "9.4.5", "10.2"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:rpm -q audit -> r:^audit-" + + # 4.1.1.2 Ensure auditing for processes that start prior to auditd is enabled (Automated). + - id: 28080 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: "Run the following command to update the grub2 configuration with audit=1: # grubby --update-kernel ALL --args 'audit=1'." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:grubby --info=ALL -> r:audit=1" + + # 4.1.1.3 Ensure audit_backlog_limit is sufficient (Automated) + - id: 28081 + title: "Ensure audit_backlog_limit is sufficient." + description: "The backlog limit has a default setting of 64." + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more that 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected." + remediation: "Run the following command to add audit_backlog_limit= to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit_backlog_limit=' Example: # grubby --update-kernel ALL --args 'audit_backlog_limit=8192'." + compliance: + - cis: ["4.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - nist_sp_800-53: ["AU-2", "AU-12", "SI-5"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:grubby --info=ALL -> n:^args=\.*\saudit_backlog_limit=(\d+) compare >= 8192' + + # 4.1.1.4 Ensure auditd service is enabled (Automated) + - id: 28082 + title: "Ensure auditd service is enabled." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - nist_sp_800-53: ["AU-2", "AU-12", "SI-5"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:enabled" + + ############################################################ + # 4.1.2 Configure Data Retention + ############################################################ + + # 4.1.2.1 Ensure audit log storage size is configured (Automated) + - id: 28083 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - nist_sp_800-53: ["AU-8"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_3.2.1: ["10.7"] + - soc_2: ["A1.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1053"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file\s*=\s*\d+' + + # 4.1.2.2 Ensure audit logs are not automatically deleted (Automated) + - id: 28084 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - nist_sp_800-53: ["AU-8"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_3.2.1: ["10.7"] + - soc_2: ["A1.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file_action\s*=\s*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full (Automated) + - id: 28085 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full. The admin_space_left_action parameter tells the system what action to take when the system has detected that it is low on disk space. Valid values are ignore, syslog, suspend, single, and halt. - ignore, the audit daemon does nothing - Syslog, the audit daemon will issue a warning to syslog - Suspend, the audit daemon will stop writing records to the disk - single, the audit daemon will put the computer system in single user mode - halt, the audit daemon will shutdown the system." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + impact: "If the admin_space_left_action parameter is set to halt the audit daemon will shutdown the system when the disk partition containing the audit logs becomes full." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root. set admin_space_left_action to either halt or single in /etc/audit/auditd.conf. Example: admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - nist_sp_800-53: ["AU-2", "AU-8", "AU-12", "SI-5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - soc_2: ["A1.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt|^\s*admin_space_left_action\s*=\s*single' + + ############################################# + # 4.1.3 Configure auditd rules + ############################################# + + # 4.1.3.1 Ensure changes to system administration scope (sudoers) is collected (Automated) + - id: 28086 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers, or files in /etc/sudoers.d, will be written to when the file(s) or related attributes have changed. The audit records will be tagged with the identifier "scope".' + rationale: "Changes in the /etc/sudoers and /etc/sudoers.d files can indicate that an unauthorized change has been made to the scope of system administrator activity." + remediation: 'Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor scope changes for system administrators. Example: # printf " -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d -p wa -k scope " >> /etc/audit/rules.d/50-scope.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi.' + compliance: + - cis: ["4.1.3.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - iso_27001-2013: ["A.12.4.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1047"] + condition: all + rules: + - d:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers -p wa -k scope|-w /etc/sudoers -p wa key=scope + - d:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers.d -p wa -k scope|-w /etc/sudoers.d -p wa key=scope + - c:auditctl -l -> r:-w /etc/sudoers -p wa -k scope|-w /etc/sudoers -p wa key=scope + - c:auditctl -l -> r:-w /etc/sudoers.d -p wa -k scope|-w /etc/sudoers.d -p wa key=scope + + # 4.1.3.2 Ensure actions as another user are always logged (Automated) - Not implemented + # 4.1.3.3 Ensure events that modify the sudo log file are collected (Automated) - Not implemented + # 4.1.3.4 Ensure events that modify date and time information are collected (Automated) - Not implemented + # 4.1.3.5 Ensure events that modify the system's network environment are collected (Automated) - Not implemented + # 4.1.3.6 Ensure use of privileged commands are collected (Automated) - Not implemented + # 4.1.3.7 Ensure unsuccessful file access attempts are collected (Automated) - Not implemented + # 4.1.3.8 Ensure events that modify user/group information are collected (Automated) - Not implemented + # 4.1.3.9 Ensure discretionary access control permission modification events are collected (Automated) - Not implemented + # 4.1.3.10 Ensure successful file system mounts are collected (Automated) - Not implemented + # 4.1.3.11 Ensure session initiation information is collected (Automated) - Not implemented + # 4.1.3.12 Ensure login and logout events are collected (Automated) - Not implemented + # 4.1.3.13 Ensure file deletion events by users are collected (Automated) - Not implemented + # 4.1.3.14 Ensure events that modify the system's Mandatory Access Controls are collected (Automated) - Not implemented + # 4.1.3.15 Ensure successful and unsuccessful attempts to use the chcon command are recorded (Automated) - Not implemented + # 4.1.3.16 Ensure successful and unsuccessful attempts to use the setfacl command are recorded (Automated) - Not implemented + # 4.1.3.17 Ensure successful and unsuccessful attempts to use the chacl command are recorded (Automated) - Not implemented + # 4.1.3.18 Ensure successful and unsuccessful attempts to use the usermod command are recorded (Automated) - Not implemented + # 4.1.3.19 Ensure kernel module loading unloading and modification is collected (Automated) - Not implemented + + # 4.1.3.20 Ensure the audit configuration is immutable (Automated) + - id: 28087 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: This setting will require the system to be rebooted to update the active auditd configuration settings.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: 'Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line -e 2 at the end of the file: Example: # printf -- "-e 2" >> /etc/audit/rules.d/99-finalize.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then printf "Reboot required to load rules\n"; fi.' + compliance: + - cis: ["4.1.3.20"] + - cis_csc_v8: ["3.3", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - nist_sp_800-53: ["AC-3", "AU-3", "AU-3(1)", "MP-2"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2", "AU.L2-3.3.1"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["1.3.1", "7.1", "9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: any + rules: + - "f:/etc/audit/audit.rules -> r:^-e 2" + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-e 2' + + # 4.1.3.21 Ensure the running and on disk configuration is the same (Manual) + - id: 28088 + title: "Ensure the running and on disk configuration is the same." + description: "The Audit system have both on disk and running configuration. It is possible for these configuration settings to differ. Note: Due to the limitations of augenrules and auditctl, it is not absolutely guaranteed that loading the rule sets via augenrules --load will result in all rules being loaded or even that the user will be informed if there was a problem loading the rules." + rationale: "Configuration differences between what is currently running and what is on disk could cause unexpected problems or may give a false impression of compliance requirements." + remediation: 'If the rules are not aligned across all three () areas, run the following command to merge and load all rules: # augenrules --load Check if reboot is required. if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then echo "Reboot required to load rules"; fi.' + compliance: + - cis: ["4.1.3.21"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:augenrules --check -> r:No change$" + + # 4.1.4 Configure auditd file access + # 4.1.4.1 Ensure audit log files are mode 0640 or less permissive (Automated) - Not implemented + # 4.1.4.2 Ensure only authorized users own audit log files (Automated) - Not implemented + # 4.1.4.3 Ensure only authorized groups are assigned ownership of audit log files (Automated) - Not implemented + # 4.1.4.4 Ensure the audit log directory is 0750 or more restrictive (Automated) - Not implemented + # 4.1.4.5 Ensure audit configuration files are 640 or more restrictive (Automated) - Not implemented + # 4.1.4.6 Ensure audit configuration files are owned by root (Automated) - Not implemented + # 4.1.4.7 Ensure audit configuration files belong to group root (Automated) - Not implemented + + # 4.1.4.8 Ensure audit tools are 755 or more restrictive (Automated) + - id: 28089 + title: "Ensure audit tools are 755 or more restrictive." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %u %U %g %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:0 root 0 root' + + # 4.1.4.9 Ensure audit tools are owned by root (Automated) + - id: 28090 + title: "Ensure audit tools are owned by root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to change the owner of the audit tools to the root user: # chown root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %u %U %g %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:0 root 0 root' + + # 4.1.4.10 Ensure audit tools belong to group root (Automated) + - id: 28091 + title: "Ensure audit tools belong to group root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules Run the following command to change owner and group of the audit tools to root user and group: # chown root:root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.10"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'not c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %u %U %g %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:0 root 0 root' + + ############################################### + # 4.2 Configure Logging + ############################################### + # 4.2.1 Configure rsyslog + ############################################### + + # 4.2.1.1 Ensure rsyslog is installed (Automated) + - id: 28092 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is recommended in environments where journald does not meet operation requirements." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # dnf install rsyslog." + compliance: + - cis: ["4.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - nist_sp_800-53: ["AU-2", "AU-12", "SI-5"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - mitre_techniques: ["T1005", "T1070", "T1070.002"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:rpm -q rsyslog -> r:^rsyslog-" + + # 4.2.1.2 Ensure rsyslog service is enabled (Automated) + - id: 28093 + title: "Ensure rsyslog service is enabled." + description: "Once the rsyslog package is installed, ensure that the service is enabled." + rationale: "If the rsyslog service is not enabled to start on boot, the system will not capture logging events." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - nist_sp_800-53: ["AU-2", "AU-12", "SI-5"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - mitre_techniques: ["T1070", "T1070.002", "T1211", "T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:^enabled" + + # 4.2.1.3 Ensure journald is configured to send logs to rsyslog (Manual) + - id: 28094 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the RSyslog service provides a consistent means of log collection and export." + rationale: "IF RSyslog is the preferred method for capturing logs, all logs of the system should be sent to it for further processing. Note: This recommendation only applies if rsyslog is the chosen method for client side logging. Do not apply this recommendation if journald is used." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.3"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - nist_sp_800-53: ["AC-3", "AU-2", "AU-4", "AU-12", "MP-2", "SI-5"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3"] + - soc_2: ["PL1.4"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006", "T1565"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*ForwardToSyslog=yes' + + # 4.2.1.4 Ensure rsyslog default file permissions configured (Automated) + - id: 28095 + title: "Ensure rsyslog default file permissions configured." + description: "Rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + impact: "The systems global umask could override, but only making the file permissions stricter, what is configured in RSyslog with the FileCreateMode directive. RSyslog also has its own $umask directive that can alter the intended file creation mode. In addition, consideration should be given to how FileCreateMode is used. Thus it is critical to ensure that the intended file creation mode is not overridden with less restrictive settings in /etc/rsyslog.conf, /etc/rsyslog.d/*conf files and that FileCreateMode is set before any file is created." + remediation: "Edit either /etc/rsyslog.conf or a dedicated .conf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640 Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.4"] + - cis_csc_v8: ["3.3", "8.2"] + - cis_csc_v7: ["5.1", "6.2", "6.3"] + - nist_sp_800-53: ["AC-3", "AU-2", "AU-4", "AU-12", "MP-2", "SI-5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2", "AU.L2-3.3.1"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)", "164.312(b)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3", "10.2", "10.3"] + - pci_dss_4.0: ["1.3.1", "7.1", "5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0' + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d20|^\$FileCreateMode 0\d00' + + # 4.2.1.5 Ensure logging is configured (Manual) - Not implemented + + # 4.2.1.6 Ensure rsyslog is configured to send logs to a remote log host (Manual) + - id: 28096 + title: "Ensure rsyslog is configured to send logs to a remote log host." + description: "RSyslog supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralized log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). The target directive may either be a fully qualified domain name or an IP address. *.* action(type="omfwd" target="192.168.2.100" port="514" protocol="tcp" action.resumeRetryCount="100" queue.type="LinkedList" queue.size="1000") Run the following command to reload the rsyslogd configuration: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.6"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> !r:# && r:^*.* @@\.+' + - 'f:/etc/rsyslog.conf -> !r:# && r:^*.* action && r:target="' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:# && r:^*.* @@\.+' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:# && r:^*.* action && r:target="' + + # 4.2.1.7 Ensure rsyslog is not configured to receive logs from a remote client (Automated) + - id: 28097 + title: "Ensure rsyslog is not configured to receive logs from a remote client." + description: "RSyslog supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: 'Should there be any active log server configuration found in the auditing section, modify those files and remove the specific lines highlighted by the audit. Ensure none of the following entries are present in any of /etc/rsyslog.conf or /etc/rsyslog.d/*.conf. New format: module(load="imtcp") input(type="imtcp" port="514") -OR- Old format: $ModLoad imtcp $InputTCPServerRun - Restart the service: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.7"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6", "AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5", "10.2", "10.3"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - soc_2: ["CC6.3", "CC6.6"] + - nist_sp_800-53: ["AU-7"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: none + rules: + - 'f:/etc/rsyslog.conf -> !r:^\s*# && r:ModLoad imtcp|InputTCPServerRun|load="imtcp"|type="imtcp"' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:\s*# && r:ModLoad imtcp|InputTCPServerRun|load="imtcp"|type="imtcp"' + + ############################################### + # 4.2.2 Configure journald + ############################################### + ############################################### + # 4.2.2.1 Ensure journald is configured to send logs to a remote log host + ############################################### + + # 4.2.2.1.1 Ensure systemd-journal-remote is installed (Manual) + - id: 28098 + title: "Ensure systemd-journal-remote is installed." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralized log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to install systemd-journal-remote: # dnf install systemd-journal-remote." + compliance: + - cis: ["4.2.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-2", "AU-12", "SI-5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - "c:rpm -q systemd-journal-remote -> r:systemd-journal-remote-" + + # 4.2.2.1.2 Ensure systemd-journal-remote is configured (Manual) - Not implemented + + # 4.2.2.1.3 Ensure systemd-journal-remote is enabled (Manual) + - id: 28099 + title: "Ensure systemd-journal-remote is enabled." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralized log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to enable systemd-journal-remote: # systemctl --now enable systemd-journal-upload.service." + compliance: + - cis: ["4.2.2.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-2", "AU-12", "CM-7", "SI-5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-upload.service -> r:^enabled" + + # 4.2.2.1.4 Ensure journald is not configured to receive logs from a remote client (Automated) + - id: 28100 + title: "Ensure journald is not configured to receive logs from a remote client." + description: "Journald supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts. NOTE: - The same package, systemd-journal-remote, is used for both sending logs to remote hosts and receiving incoming logs. - With regards to receiving logs, there are two services; systemd-journal- remote.socket and systemd-journal-remote.service." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: "Run the following command to disable systemd-journal-remote.socket: # systemctl --now mask systemd-journal-remote.socket." + compliance: + - cis: ["4.2.2.1.4"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - nist_sp_800-53: ["AU-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6", "AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5", "10.2", "10.3"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - soc_2: ["CC6.3", "CC6.6"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-remote.socket -> r:^masked" + + # 4.2.2.2 Ensure journald service is enabled (Automated) + - id: 28101 + title: "Ensure journald service is enabled." + description: "Ensure that the systemd-journald service is enabled to allow capturing of logging events." + rationale: "If the systemd-journald service is not enabled to start on boot, the system will not capture logging events." + remediation: "By default the systemd-journald service does not have an [Install] section and thus cannot be enabled / disabled. It is meant to be referenced as Requires or Wants by other unit files. As such, if the status of systemd-journald is not static, investigate why." + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journald.service -> r:^static" + + # 4.2.2.3 Ensure journald is configured to compress large log files. (Automated) + - id: 28102 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes Restart the service: # systemctl restart systemd-journald.service." + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.3", "6.4"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - soc_2: ["A1.1"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1053"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Compress\s*=\s*yes' + + # 4.2.2.4 Ensure journald is configured to write logfiles to persistent disk (Automated) + - id: 28103 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss due to a reboot." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent Restart the service: # systemctl restart systemd-journald.service." + compliance: + - cis: ["4.2.2.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - nist_sp_800-53: ["AU-7"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Storage=persistent' + + # 4.2.2.5 Ensure journald is not configured to send logs to rsyslog (Manual) + - id: 28104 + title: "Ensure journald is not configured to send logs to rsyslog." + description: "Data from journald should be kept in the confines of the service and not forwarded on to other services." + rationale: "IF journald is the method for capturing logs, all logs of the system should be handled by journald and not forwarded to other logging mechanisms. Note: This recommendation only applies if journald is the chosen method for client side logging. Do not apply this recommendation if rsyslog is used." + remediation: "Edit the /etc/systemd/journald.conf file and ensure that ForwardToSyslog=yes is removed. Restart the service: # systemctl restart systemd-journald.service." + compliance: + - cis: ["4.2.2.5"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - iso_27001-2013: ["A.12.4.1"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3"] + - nist_sp_800-53: ["AU-7", "AU-6(3)"] + - soc_2: ["PL1.4"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006", "T1565"] + - mitre_tactics: ["TA0040"] + - mitre_mitigations: ["M1029"] + condition: all + rules: + - 'not f:/etc/systemd/journald.conf -> r:^\s*ForwardToSyslog' + + # 4.2.2.6 Ensure journald log rotation is configured per site policy (Manual) - Not implemented + # 4.2.2.7 Ensure journald default file permissions configured (Manual) - Not implemented + # 4.2.3 Ensure all logfiles have appropriate permissions and ownership (Automated) - Not Implemented + # 4.3 Ensure logrotate is configured (Manual) - Not implemented + ############################################### + # 5 Access, Authentication and Authorization + ############################################### + ############################################### + # 5.1 Configure time-based job schedulers + ############################################### + + # 5.1.1 Ensure cron daemon is enabled (Automated) + - id: 28105 + title: "Ensure cron daemon is enabled." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron : # systemctl --now enable crond." + compliance: + - cis: ["5.1.1"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - mitre_techniques: ["T1562", "T1562.001"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - "c:systemctl is-enabled crond -> r:^enabled" + + # 5.1.2 Ensure permissions on /etc/crontab are configured (Automated) + - id: 28106 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to this file could provide unprivileged users with the ability to elevate their privileges. Read access to this file could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab." + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Automated) + - id: 28107 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : # chown root:root /etc/cron.hourly # chmod og-rwx /etc/cron.hourly." + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured (Automated) + - id: 28108 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily." + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Automated) + - id: 28109 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : # chown root:root /etc/cron.weekly # chmod og-rwx /etc/cron.weekly." + compliance: + - cis: ["5.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Automated) + - id: 28110 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly." + compliance: + - cis: ["5.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured (Automated) + - id: 28111 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily, weekly and monthly jobs from /etc/crontab , but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d." + compliance: + - cis: ["5.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1053", "T1053.003"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.8 Ensure cron is restricted to authorized users (Automated) - Not implemented + # 5.1.9 Ensure at/cron is restricted to authorized users (Automated) - Not implemented + ############################################### + # 5.2 Configure SSH Server + ############################################### + + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured (Automated) + - id: 28112 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod u-x,go-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_techniques: ["T1098", "T1098.004", "T1543", "T1543.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.2.2 Ensure permissions on SSH private host key files are configured (Automated) - Not implemented + # 5.2.3 Ensure permissions on SSH public host key files are configured (Automated) - Not implemented + + # 5.2.4 Ensure SSH access is limited (Automated) + - id: 28113 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameters as follows: AllowUsers OR AllowGroups OR DenyUsers OR DenyGroups ." + compliance: + - cis: ["5.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["4.3"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1021", "T1021.004"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1018"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowUsers\s+\w*|^\s*AllowGroups\s+\w*|^\s*DenyUsers\s+\w*|^\s*DenyGroups\s+\w*' + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowUsers\s+\w*|^\s*AllowGroups\s+\w*|^\s*DenyUsers\s+\w*|^\s*DenyGroups\s+\w*' + + # 5.2.5 Ensure SSH LogLevel is appropriate (Automated) + - id: 28114 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE OR LogLevel INFO." + references: + - https://www.ssh.com/ssh/sshd_config/ + compliance: + - cis: ["5.2.5"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - nist_sp_800-53: ["AU-2", "AU-12", "SI-5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["5.3.4", "6.4.1", "6.4.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0005"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*LogLevel\s+VERBOSE|^\s*LogLevel\s+INFO' + - "f:/etc/ssh/sshd_config -> r:loglevel" + + # 5.2.6 Ensure SSH PAM is enabled (Automated) + - id: 28115 + title: "Ensure SSH PAM is enabled." + description: "UsePAM Enables the Pluggable Authentication Module interface. If set to 'yes' this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types." + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + impact: "If UsePAM is enabled, you will not be able to run sshd(8) as a non-root user." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes." + compliance: + - cis: ["5.2.6"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1021", "T1021.004"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1035"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*usepam\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\sUsePAM\s+no' + + # 5.2.7 Ensure SSH root login is disabled (Automated) + - id: 28116 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no." + compliance: + - cis: ["5.2.7"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_techniques: ["T1078"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitRootLogin\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitRootLogin\s+yes' + + # 5.2.8 Ensure SSH HostbasedAuthentication is disabled (Automated) + - id: 28117 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no." + compliance: + - cis: ["5.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*HostbasedAuthentication\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sHostbasedAuthentication\s+yes' + + # 5.2.9 Ensure SSH PermitEmptyPasswords is disabled (Automated) + - id: 28118 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no." + compliance: + - cis: ["5.2.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1021"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitEmptyPasswords\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitEmptyPasswords\s+yes' + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled (Automated) + - id: 28119 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no." + compliance: + - cis: ["5.2.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1021"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitUserEnvironment\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitUserEnvironment\s+yes' + + # 5.2.11 Ensure SSH IgnoreRhosts is enabled (Automated) + - id: 28120 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes." + compliance: + - cis: ["5.2.11"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:\s*ignorerhosts\s*yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*ignorerhosts\s+no' + + # 5.2.12 Ensure SSH X11 forwarding is disabled (Automated) + - id: 28121 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no." + compliance: + - cis: ["5.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-7"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1210"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*X11Forwarding\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*x11forwarding\s+yes' + + # 5.2.13 Ensure SSH AllowTcpForwarding is disabled (Automated) + - id: 28122 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments that employ mainframe systems as their application backends. In those environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no." + references: + - https://www.ssh.com/ssh/tunneling/example + compliance: + - cis: ["5.2.13"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_techniques: ["T1048", "T1048.002", "T1572"] + - mitre_tactics: ["TA0008"] + - mitre_mitigations: ["M1042"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*AllowTcpForwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*AllowTcpForwarding\s+yes' + + # 5.2.14 Ensure system-wide crypto policy is not over-ridden (Automated) + - id: 28123 + title: "Ensure system-wide crypto policy is not over-ridden." + description: "System-wide Crypto policy can be over-ridden or opted out of for openSSH." + rationale: "Over-riding or opting out of the system-wide crypto policy could allow for the use of less secure Ciphers, MACs, KexAlgorithms and GSSAPIKexAlgorithm." + remediation: "Run the following commands: # sed -ri \"s/^\\s*(CRYPTO_POLICY\\s*=.*)$/# \\1/\" /etc/sysconfig/sshd; # systemctl reload sshd." + compliance: + - cis: ["5.2.14"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - nist_sp_800-53: ["SC-8"] + - cmmc_v2.0: ["AC.L2-3.1.17", "AC.L2-3.1.13", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.8", "SC.L2-3.13.15"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - pci_dss_3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + - iso_27001-2013: ["A.13.1.1", "A.10.1.1"] + condition: all + rules: + - 'not f:/etc/sysconfig/sshd -> r:^\s*CRYPTO_POLICY=' + + # 5.2.15 Ensure SSH warning banner is configured (Automated) + - id: 28124 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.2.15"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_tactics: ["TA0001", "TA0007"] + - mitre_mitigations: ["M1035"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*Banner\s*/\w+' + + # 5.2.16 Ensure SSH MaxAuthTries is set to 4 or less (Automated) + - id: 28125 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4." + compliance: + - cis: ["5.2.16"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - soc_2: ["CC5.2", "CC7.2"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1036"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'f:/etc/ssh/sshd_config -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.2.17 Ensure SSH MaxStartups is configured (Automated) + - id: 28126 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxStartups 10:30:60." + compliance: + - cis: ["5.2.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1499", "T1499.002"] + - mitre_tactics: ["TA0040"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + + # 5.2.18 Ensure SSH MaxSessions is set to 10 or less (Automated) + - id: 28127 + title: "Ensure SSH MaxSessions is set to 10 or less." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10." + compliance: + - cis: ["5.2.18"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - soc_2: ["CC7.1", "CC8.1"] + - mitre_techniques: ["T1499", "T1499.002"] + - mitre_tactics: ["TA0040"] + condition: any + rules: + - 'c:sshd -T -C user=root -> n:^\s*MaxSessions\s+(\d+) compare <= 10' + - 'not f:/etc/ssh/sshd_config -> n:^\s*MaxSessions\s+(\d+) compare > 10' + + # 5.2.19 Ensure SSH LoginGraceTime is set to one minute or less (Automated) + - id: 28128 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60." + compliance: + - cis: ["5.2.19"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003", "T1110.004"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1036"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60 && n:^\s*LoginGraceTime\s*\t*(\d+) compare > 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60 && n:^\s*LoginGraceTime\s*\t*(\d+) compare > 0' + + # 5.2.20 Ensure SSH Idle Timeout Interval is configured (Automated) + - id: 28129 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "NOTE: To clarify, the two settings described below are only meant for idle connections from a protocol perspective and not meant to check if the user is active or not. An idle user does not mean an idle connection. SSH does not, and never had, intentionally the capability to drop idle users. In SSH versions before 8.2p1 there was a bug that caused these values to behave in such a manner that they were abused to disconnect idle users. This bug has been resolved in 8.2p1 and thus may no longer be abused disconnect idle users. The two options ClientAliveInterval and ClientAliveCountMax control the timeout of SSH sessions. Taken directly from man 5 sshd_config: - ClientAliveInterval Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax Sets the number of client alive messages which may be sent without sshd(8) receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. It is important to note that the use of client alive messages is very different from TCPKeepAlive. The client alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The client alive mechanism is valuable when the client or server depend on knowing when a connection has become unresponsive. The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds. Setting a zero ClientAliveCountMax disables connection termination." + rationale: "In order to prevent resource exhaustion, appropriate values should be set for both ClientAliveInterval and ClientAliveCountMax. Specifically, looking at the source code, ClientAliveCountMax must be greater than zero in order to utilize the ability of SSH to drop idle connections. If connections are allowed to stay open indefinitely, this can potentially be used as a DDOS attack or simple resource exhaustion could occur over unreliable networks. The example set here is a 45 second timeout. Consult your site policy for network timeouts and apply as appropriate." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy. Example: ClientAliveInterval 15 ClientAliveCountMax 3." + references: + - "https://man.openbsd.org/sshd_config" + - "https://bugzilla.redhat.com/show_bug.cgi?id=1873547" + - "https://github.com/openssh/openssh-portable/blob/V_8_9/serverloop.c#L137" + compliance: + - cis: ["5.2.20"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare > 0' + - 'c:sshd -T -C user=root -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare > 0' + + ############################################################ + # 5.3 Configure privilege escalation + ############################################################ + + # 5.3.1 Ensure sudo is installed (Automated) + - id: 28130 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plug-in architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plug-ins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers and any entries in /etc/sudoers.d. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo. # dnf install sudo." + compliance: + - cis: ["5.3.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + - iso_27001-2013: ["A.9.2.3"] + condition: all + rules: + - "c:rpm -q sudo -> r:sudo-" + + # 5.3.2 Ensure sudo commands use pty (Automated) + - id: 28131 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo terminal (pseudo-pty)." + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: "Edit the file /etc/sudoers with visudo or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["5.3.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["5.1"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1078", "T1078.003", "T1548", "T1548.003"] + - mitre_tactics: ["TA0001", "TA0003"] + - mitre_mitigations: ["M1026", "M1038"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s+use_pty' + - 'd:/etc/sudoers.d -> r:\. -> r:^\s*Defaults\s+use_pty' + + # 5.3.3 Ensure sudo log file exists (Automated) + - id: 28132 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files. Creation of additional log files can cause disk space exhaustion if not correctly managed. You should configure logrotate to manage the sudo log in accordance with your local policy." + remediation: 'Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile="" Example: Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["5.3.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - soc_2: ["CC5.2", "CC7.2"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_techniques: ["T1562", "T1562.006"] + - mitre_tactics: ["TA0004"] + - mitre_mitigations: ["M1026"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^Defaults logfile="' + - 'd:/etc/sudoers.d -> r:\. -> r:^Defaults\s+logfile="' + + # 5.3.4 Ensure users must provide password for escalation (Automated) + - id: 28133 + title: "Ensure users must provide password for escalation." + description: "The operating system must be configured so that users must provide a password for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + impact: "This will prevent automated processes from being able to elevate privileges. To include Ansible and AWS builds." + remediation: "Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any line with occurrences of NOPASSWD tags in the file." + compliance: + - cis: ["5.3.4"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - soc_2: ["CC6.1", "CC6.3"] + - iso_27001-2013: ["A.9.2.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*# && r:NOPASSWD' + - 'd:/etc/sudoers.d -> r:\. -> !r:^\s*# && r:NOPASSWD' + + # 5.3.5 Ensure re-authentication for privilege escalation is not disabled globally (Automated) + - id: 28134 + title: "Ensure re-authentication for privilege escalation is not disabled globally." + description: "The operating system must be configured so that users must re-authenticate for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + remediation: "Configure the operating system to require users to reauthenticate for privilege escalation. Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any occurrences of !authenticate tags in the file(s)." + compliance: + - cis: ["5.3.5"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - soc_2: ["CC6.1", "CC6.3"] + - iso_27001-2013: ["A.9.2.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*# && r:!authenticate' + - 'd:/etc/sudoers.d -> r:\. -> !r:^\s*# && r:!authenticate' + + # 5.3.6 Ensure sudo authentication timeout is configured correctly (Automated) + - id: 28135 + title: "Ensure sudo authentication timeout is configured correctly." + description: "sudo caches used credentials for a default of 5 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized privileged access to another user." + remediation: "If the currently configured timeout is larger than 15 minutes, edit the file listed in the audit section with visudo -f and modify the entry timestamp_timeout= to 15 minutes or less as per your site policy. The value is in minutes. This particular entry may appear on its own, or on the same line as env_reset. See the following two examples: Defaults env_reset, timestamp_timeout=15 Defaults timestamp_timeout=15 Defaults env_reset." + references: + - https://www.sudo.ws/man/1.9.0/sudoers.man.html + compliance: + - cis: ["5.3.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - soc_2: ["CC6.1", "CC6.3"] + - iso_27001-2013: ["A.9.2.3"] + condition: all + rules: + - 'not f:/etc/sudoers -> !r:^\s*\t*# && r:timestamp_timeout\s*\t*=\s*\t*-1' + - 'not d:/etc/sudoers.d -> r:\.+ -> !r:^\s*\t*# && r:timestamp_timeout\s*\t*=\s*\t*-1' + - 'not f:/etc/sudoers -> !r:^\s*\t*# && n:timestamp_timeout\s*\t*=\s*\t*(\d+) compare > 15' + - 'not d:/etc/sudoers.d -> r:\.+ -> !r:^\s*\t*# && n:timestamp_timeout\s*\t*=\s*\t*(\d+) compare > 15' + + # 5.3.7 Ensure access to the su command is restricted (Automated) + - id: 28136 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup. Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.3.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1078"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - 'f:/etc/pam.d/su -> r:^auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + ############################################### + # 5.4 Configure authselect + ############################################### + # 5.4.1 Ensure custom authselect profile is used (Manual) + - id: 28137 + title: "Ensure custom authselect profile is used." + description: "A custom profile can be created by copying and customizing one of the default profiles. The default profiles include: sssd, winbind, or the nis. This profile can then be customized to follow site specific requirements. You can select a profile for the authselect utility for a specific host. The profile will be applied to every user logging into the host." + rationale: "A custom profile is required to customize many of the pam options. When you deploy a profile, the profile is applied to every user logging into the given host." + remediation: "Run the following command to create a custom authselect profile: # authselect create-profile Example: # authselect create-profile custom-profile -b sssd --symlink-meta Run the following command to select a custom authselect profile: # authselect select custom/ {with-} Example: # authselect select custom/custom-profile with-sudo with-faillock without-nullok." + compliance: + - cis: ["5.4.1"] + - cis_csc_v8: ["16.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - pci_dss_3.2.1: ["6.3.2"] + - pci_dss_4.0: ["6.3.1"] + - iso_27001-2013: ["A.9.2.6"] + condition: all + rules: + - 'c:authselect list -> r:^\w*\s*custom' + - "f:/etc/authselect/authselect.conf -> r:custom" + + # 5.4.2 Ensure authselect includes with-faillock (Automated) + - id: 28138 + title: "Ensure authselect includes with-faillock." + description: "The pam_faillock.so module maintains a list of failed authentication attempts per user during a specified interval and locks the account in case there were more than the configured number of consecutive failed authentications (this is defined by the deny parameter in the faillock configuration). It stores the failure records into per-user files in the tally directory." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Run the following commands to include the with-faillock option to the current authselect profile: # authselect enable-feature with-faillock # authselect apply-changes." + compliance: + - cis: ["5.4.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.7"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.9.2.6"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:required && r:pam_faillock.so" + - "f:/etc/pam.d/system-auth -> r:required && r:pam_faillock.so" + + ############################################### + # 5.5 Configure PAM + ############################################### + # 5.5.1 Ensure password creation requirements are configured (Automated) + - id: 28139 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. - minlen=14 - password must be 14 characters or more. Either of the following can be used to enforce complex passwords: - minclass=4 - provide at least four classes of characters for the new password. OR - dcredit=-1 - provide at least one digit. - ucredit=-1 - provide at least one uppercase character. - ocredit=-1 - provide at least one special character. - lcredit=-1 - provide at least one lowercase character. - The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy: minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy: minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1. Run the following script to update the system-auth and password-auth files: #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+.*enforce_for_r oot\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 enforce_for_root/' \"$file\" fi if grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=([4-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then sed -ri '/pwquality/s/retry=\\S+/retry=3/' \"$file\" elif ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 retry=3/' \"$file\" fi done authselect apply-changes." + compliance: + - cis: ["5.5.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.002", "T1110.003", "T1178.001", "T1178.002", "T1178.003", "T1178.004"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - "f:/etc/pam.d/system-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s+\t*=\s+\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> r:^\s*minclass|^\s*\Scredit' + + # 5.5.2 Ensure lockout for failed password attempts is configured (Automated) + - id: 28140 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. - deny= - Number of attempts before the account is locked. - unlock_time= - Time in seconds before the account is unlocked. Note: The maximum configurable value for unlock_time is 604800." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + impact: "Use of unlock_time=0 may allow an attacker to cause denial of service to legitimate users." + remediation: "Set password lockouts and unlock times to conform to site policy. deny should be greater than 0 and no greater than 5. unlock_time should be 0 (never), or 900 seconds or greater. Edit /etc/security/faillock.conf and update or add the following lines: deny = 5 unlock_time = 900." + compliance: + - cis: ["5.5.2"] + - cis_csc_v8: ["6.2"] + - cis_csc_v7: ["16.7"] + - nist_sp_800-53: ["AC-2(1)"] + - cmmc_v2.0: ["AC.L1-3.1.1"] + - hipaa: ["164.308(a)(3)(ii)(C)"] + - pci_dss_3.2.1: ["8.1.3"] + - pci_dss_4.0: ["8.2.4", "8.2.5"] + - soc_2: ["CC6.2", "CC6.3"] + - iso_27001-2013: ["A.9.2.6"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:deny\s*\t*=\s*\t*(\d+) compare <= 5' + - 'not f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:unlock_time\s*\t*=\s*\t*(\d+) compare > 0 && n:unlock_time\s*\t*=\s*\t*(\d+) compare < 900' + + # 5.5.3 Ensure password reuse is limited (Automated) + - id: 28141 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. remember=<5> - Number of old passwords to remember." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note: These change only apply to accounts configured on the local system." + remediation: "Set remembered password history to conform to site policy. Run the following script to add or modify the pam_pwhistory.so and pam_unix.so lines to include the remember option: #!/usr/bin/env bash { file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/system-auth\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\r]+\\h+)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\r]+\\h+)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so\\s+([^#\\n\\r]+\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file elif grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\r]+\\h+)?.*$' \"$file\"; then sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so/ s/$/ remember=5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/i password required pam_pwhistory.so remember=5 use_authtok' $file fi fi if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h+)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so\\s+([^#\\n\\r] +\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/ s/$/ remember=5/' $file fi fi authselect apply-changes }." + compliance: + - cis: ["5.5.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - nist_sp_800-53: ["IA-5(1)"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.004"] + condition: all + rules: + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+requisite\.+pam_pwhistory\.so\.+ && n:remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so\.+ && n:remember=(\d+) compare >= 5' + + # 5.5.4 Ensure password hashing algorithm is SHA-512 or yescrypt (Automated) + - id: 28142 + title: "Ensure password hashing algorithm is SHA-512 or yescrypt." + description: "A cryptographic hash function converts an arbitrary-length input into a fixed length output. Password hashing performs a one-way transformation of a password, turning the password into another string, called the hashed password." + rationale: "The SHA-512 algorithm provides stronger hashing than other hashing algorithms used for password hashing with Linux, providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note: These changes only apply to accounts configured on the local system." + remediation: 'Set password hashing algorithm to sha512. Edit /etc/libuser.conf and edit of add the following line: crypt_style = sha512 Edit /etc/login.defs and edit or add the following line: ENCRYPT_METHOD SHA512 Run the following script to configure pam_unix.so to use the sha512 hashing algorithm: #!/usr/bin/env bash for fn in system-auth password-auth; do file="/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep ''custom/'')/$fn" if ! grep -Pq -- ''^\h*password\h+(requisite|required|sufficient)\h+pam_unix\.so(\h+[^#\n\r]+)? \h+sha512\b.*$'' "$file"; then if grep -Pq -- ''^\h*password\h+(requisite|required|sufficient)\h+pam_unix\.so(\h+[^#\n\r]+)? \h+(md5|blowfish|bigcrypt|sha256)\b.*$'' "$file"; then sed -ri ''s/(md5|blowfish|bigcrypt|sha256)/sha512/'' "$file" else sed -ri ''s/(^\s*password\s+(requisite|required|sufficient)\s+pam_unix.so\s+)(.*)$/\1s ha512 \3/'' $file fi fi done authselect apply-changes Note: This only effects local users and passwords created after updating the files to use sha512. If it is determined that the password algorithm being used is not SHA-512, once it is changed, it is recommended that all user ID''s be immediately expired and forced to change their passwords on next login.' + compliance: + - cis: ["5.5.4"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - nist_sp_800-53: ["IA-5(1)"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - pci_dss_3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1110", "T1110.002"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1041"] + condition: all + rules: + - 'f:/etc/libuser.conf -> r:^\s*\t*crypt_style\s*\t*=\s*\t*sha512|^\s*crypt_style\s*\t*=\s*\t*yescrypt' + - 'f:/etc/login.defs -> r:^\s*\t*ENCRYPT_METHOD SHA512|^\s*\t*ENCRYPT_METHOD YESCRYPT' + - 'f:/etc/pam.d/password-auth -> r:^\s*\t*password\.+sufficient\.+pam_unix\.so' + - 'f:/etc/pam.d/system-auth -> r:^\s*\t*password\.+sufficient\.+pam_unix\.so' + + ############################################### + # 5.6 User Accounts and Environment + ############################################### + ############################################### + # 5.6.1 Set Shadow Password Suite Parameters + ############################################### + # 5.6.1.1 Ensure password expiration is 365 days or less (Automated) + - id: 28143 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: chage --maxdays 365 ." + compliance: + - cis: ["5.6.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.001", "T1110.002", "T1110.003", "T1110.004"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:(\d+):\S*:\S*:\S*:\S* compare > 365' + + # 5.6.1.2 Ensure minimum days between password changes is configured (Automated) + - id: 28144 + title: "Ensure minimum days between password changes is configured." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 1 in /etc/login.defs: PASS_MIN_DAYS 1 and modify user parameters for all users with a password set to match: chage --mindays 1 ." + compliance: + - cis: ["5.6.1.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110.004"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 1' + - 'not f:/etc/shadow -> n:^\w+:\S*:\S*:(\d+):\S*:\S*:\S*:\S*:\S* compare < 1' + - 'not f:/etc/shadow -> r:^\w+:\S*:\S*::\S*:\S*:\S*:\S*:\S*' + + # 5.6.1.3 Ensure password expiration warning days is 7 or more (Automated) + - id: 28145 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 and modify user parameters for all users with a password set to match: chage --warndays 7 ." + compliance: + - cis: ["5.6.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078"] + - mitre_tactics: ["TA0006"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + - 'f:/etc/shadow -> n:^\w+:\S*:\S*:\S*:\S*:(\d+):\S*:\S*:\S* compare >= 7' + - 'not f:/etc/shadow -> r:^\w+:\S*:\S*:\S*:\S*::\S*:\S*:\S*' + + # 5.6.1.4 Ensure inactive password lock is 30 days or less (Automated) + - id: 28146 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: useradd -D -f 30 and modify user parameters for all users with a password set to match: chage --inactive 30 ." + compliance: + - cis: ["5.6.1.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.002", "T1078.003"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*\t*(\d+) compare <= 30' + - 'f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:\S*:\S*:(\d+):\S*:\S* compare <= 30' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && r:^\w+:\S*:\S*:\S*:\S*:\S*::\S*:\S*' + + # 5.6.1.5 Ensure all users last password change date is in the past (Automated) - Not implemented + # 5.6.2 Ensure system accounts are secured (Automated) - Not implemented + # 5.6.3 Ensure default user shell timeout is 900 seconds or less (Automated) - Not Implemented + + # 5.6.4 Ensure default group for the root account is GID 0 (Automated) + - id: 28147 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root account belongs to. This affects permissions of files that are created by the root account." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root account default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.6.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.2", "CM.L2-3.4.7"] + - pci_dss_3.2.1: ["2.2", "11.5"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.5.1", "1.2.7", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + - iso_27001-2013: ["A.8.1.3", "A.14.2.5"] + - mitre_techniques: ["T1548"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - "f:/etc/passwd -> r:^root:x:0:0" + + # 5.6.5 Ensure default user umask is 027 or more restrictive (Automated) - Not Implemented + + # 5.6.6 Ensure root password is set (Automated) + - id: 28148 + title: "Ensure root password is set." + description: "There are a number of methods to access the root account directly. Without a password set any user would be able to gain access and thus control over the entire system." + rationale: "Access to root should be secured at all times." + impact: "If there are any automated processes that relies on access to the root account without authentication, they will fail after remediation." + remediation: "Set the root password with: # passwd root." + compliance: + - cis: ["5.6.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - iso_27001-2013: ["A.9.1.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - soc_2: ["CC5.2", "CC6.1"] + - mitre_techniques: ["T1078"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1026"] + condition: all + rules: + - "c:passwd -S root -> r:Password set" + + ############################################### + # 6 System Maintenance + ############################################### + ############################################### + # 6.1 System File Permissions + ############################################### + # 6.1.1 Ensure permissions on /etc/passwd are configured (Automated) + - id: 28149 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd: # chmod u-x,go-wx /etc/passwd # chown root:root /etc/passwd." + compliance: + - cis: ["6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/passwd -> r:0/root 0/root && r:644|640|604|600' + + # 6.1.2 Ensure permissions on /etc/passwd- are configured (Automated) + - id: 28150 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd-: # chmod u-x,go-wx /etc/passwd- # chown root:root /etc/passwd-." + compliance: + - cis: ["6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/passwd- -> r:0/root 0/root && r:644|640|604|600' + + # 6.1.3 Ensure permissions on /etc/group are configured (Automated) + - id: 28151 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group: # chmod u-x,go-wx /etc/group # chown root:root /etc/group." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/group -> r:0/root 0/root && r:644|640|604|600' + + # 6.1.4 Ensure permissions on /etc/group- are configured (Automated) + - id: 28152 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group-: # chmod u-x,go-wx /etc/group- # chown root:root /etc/group-." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/group- -> r:0/root 0/root && r:644|640|604|600' + + # 6.1.5 Ensure permissions on /etc/shadow are configured (Automated) + - id: 28153 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following commands to set mode, owner, and group on /etc/shadow: # chown root:root /etc/shadow # chmod 0000 /etc/shadow." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/shadow -> r:\s0 0/root 0/root' + + # 6.1.6 Ensure permissions on /etc/shadow- are configured (Automated) + - id: 28154 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set mode, owner, and group on /etc/shadow-: # chown root:root /etc/shadow- # chmod 0000 /etc/shadow-." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/shadow- -> r:\s0 0/root 0/root' + + # 6.1.7 Ensure permissions on /etc/gshadow are configured (Automated) + - id: 28155 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run the following commands to set mode, owner, and group on /etc/gshadow: # chown root:root /etc/gshadow # chmod 0000 /etc/gshadow." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/gshadow -> r:\s0 0/root 0/root' + + # 6.1.8 Ensure permissions on /etc/gshadow- are configured (Automated) + - id: 28156 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set mode, owner, and group on /etc/gshadow-: # chown root:root /etc/gshadow- # chmod 0000 /etc/gshadow-." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.5", "AC.L2-3.1.3", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - mitre_tactics: ["TA0005"] + - mitre_mitigations: ["M1022"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u/%U %g/%G" /etc/gshadow- -> r:\s0 0/root 0/root' + + # 6.1.9 Ensure no world writable files exist (Automated) - Not implemented + # 6.1.10 Ensure no unowned files or directories exist (Automated) - Not implemented, requires manual operation. + # 6.1.11 Ensure no ungrouped files or directories exist (Automated) - Not implemented, requires manual operation. + # 6.1.12 Ensure sticky bit is set on all world-writable directories (Automated) - Not implemented, requires manual operation. + # 6.1.13 Audit SUID executables (Manual) - Not implemented, requires manual operation. + # 6.1.14 Audit SGID executables (Manual) - Not implemented, requires manual operation. + # 6.1.15 Audit system file permissions (Manual) - Not implemented, requires manual operation. + + ################################################ + # 6.2 Local User and Group Settings + ################################################ + # 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords (Automated) + - id: 28157 + title: "Ensure accounts in /etc/passwd use shadowed passwords." + description: "Local accounts can uses shadowed passwords. With shadowed passwords, the passwords are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. Accounts with a shadowed password have an x in the second field in /etc/passwd." + rationale: "The /etc/passwd file also contains information like user ID's and group ID's that are used by many system programs. Therefore, the /etc/passwd file must remain world readable. In spite of encoding the password with a randomly-generated one-way hash function, an attacker could still break the system if they got access to the /etc/passwd file. This can be mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. This helps mitigate the risk of an attacker gaining access to the encoded passwords with which to perform a dictionary attack. Note: - All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user. - A user account with an empty second field in /etc/passwd allows the account to be logged into by providing only the username." + remediation: "Run the following command to set accounts to use shadowed passwords: # sed -e 's/^\\([a-zA-Z0-9_]*\\):[^:]*:/\\1:x:/' -i /etc/passwd Investigate to determine if the account is logged in and what it is being used for, to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - pci_dss_3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_techniques: ["T1003", "T1003.008"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1027"] + condition: all + rules: + - 'not f:/etc/passwd -> !r:^\w+:x:' + + # 6.2.2 Ensure /etc/shadow password fields are not empty (Automated) + - id: 28158 + title: "Ensure /etc/shadow password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - mitre_tactics: ["TA0003"] + - mitre_mitigations: ["M1027"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + + # 6.2.3 Ensure all groups in /etc/passwd exist in /etc/group - Not implemented, requires manual operation. + # 6.2.4 Ensure no duplicate UIDs exist - Not implemented, requires manual operation. + # 6.2.5 Ensure no duplicate GIDs exist - Not implemented, requires manual operation. + # 6.2.6 Ensure no duplicate user names exist - Not implemented, requires manual operation. + # 6.2.7 Ensure no duplicate group names exist - Not implemented, requires manual operation. + # 6.2.8 Ensure root PATH Integrity - Not implemented, requires manual operation. + + # 6.2.9 Ensure root is the only UID 0 account (Automated) + - id: 28159 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.9"] + - mitre_techniques: ["T1548"] + - mitre_tactics: ["TA0001"] + - mitre_mitigations: ["M1026"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^\s*root && n:^\w+:\S*:(\d+):\S*:\S*:\S*:\S* compare == 0' + + # 6.2.10 Ensure local interactive users home directories exist - Not implemented, requires manual operation. + # 6.2.11 Ensure local interactive users own their home directories - Not implemented, requires manual operation. + # 6.2.12 Ensure local interactive users home directories are mode 750 or more restrictive - Not implemented, requires manual operation. + # 6.2.13 Ensure no local interactive users have .netrc files - Not implemented, requires manual operation. + # 6.2.14 Ensure no local interactive users have .forward files - Not implemented, requires manual operation. + # 6.2.15 Ensure no local interactive users have .rhosts files - Not implemented, requires manual operation. + # 6.2.16 Ensure local interactive user dot files are not group or world writable - Not implemented, requires manual operation. diff --git a/etc/ruleset/sca/rocky/cis_rocky_linux_8.yml b/etc/ruleset/sca/rocky/cis_rocky_linux_8.yml new file mode 100644 index 0000000000..2f7ee467e0 --- /dev/null +++ b/etc/ruleset/sca/rocky/cis_rocky_linux_8.yml @@ -0,0 +1,4183 @@ +# Security Configuration Assessment +# CIS Checks for Rocky Linux 8 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Rocky Linux 8 Benchmark v1.0.0 - 03-29-2022 + +policy: + id: "cis_rocky_linux_8" + file: "cis_rocky_linux_8.yml" + name: "CIS Rocky Linux 8 Benchmark v1.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Rocky Linux 8 systems running on x86_64 platforms.This document was tested against Rocky Linux 8." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check RL8 family platform." + description: "Requirements for running the policy against RL 8 family." + condition: any + rules: + - 'f:/etc/redhat-release -> r:^Rocky Linux && r:release 8\p*' + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + ############################################### + # 1 Initial setup + ############################################### + ############################################### + # 1.1 Filesystem Configuration + ############################################### + ############################################### + # 1.1.1 Disable unused filesystems + ############################################### + # 1.1.1.1 Ensure mounting of cramfs filesystems is disabled. (Automated) + - id: 30500 + title: "Ensure mounting of cramfs filesystems is disabled." + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf with a line that reads install cramfs /bin/false and a line the reads blacklist cramfs. Example: # printf "install cramfs /bin/false blacklist cramfs " >> /etc/modprobe.d/cramfs.conf Run the following command to unload the cramfs module: # modprobe -r cramfs.' + compliance: + - cis: ["1.1.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:install /bin/false|Module cramfs not found" + - "not c:lsmod -> r:cramfs" + - 'd:/etc/modprobe.d/ -> r:\.*.conf -> r:^blacklist\s+cramfs' + + # 1.1.1.2 Ensure mounting of squashfs filesystems is disabled. (Automated) + - id: 30501 + title: "Ensure mounting of squashfs filesystems is disabled." + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: 'As Snap packages utilizes squashfs as a compressed filesystem, disabling squashfs will cause Snap packages to fail. Snap application packages of software are self-contained and work across a range of Linux distributions. This is unlike traditional Linux package management approaches, like APT or RPM, which require specifically adapted packages per Linux distribution on an application update and delay therefore application deployment from developers to their software''s end-user. Snaps themselves have no dependency on any external store ("App store"), can be obtained from any source and can be therefore used for upstream software deployment.' + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf with the lines that reads install squashfs /bin/false and blacklist squashfs. Example: # printf "install squashfs /bin/false blacklist squashfs " >> /etc/modprobe.d/squashfs.conf Run the following command to unload the squashfs module: # modprobe -r squashfs.' + compliance: + - cis: ["1.1.1.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/false|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + - 'd:/etc/modprobe.d/ -> r:\.*.conf -> r:^blacklist\s+squashfs' + + # 1.1.1.3 Ensure mounting of udf filesystems is disabled. (Automated) + - id: 30502 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: "Microsoft Azure requires the usage of udf. udf should not be disabled on systems run on Microsoft Azure." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf with a line that reads install udf /bin/false. Example: # printf "install udf /bin/false blacklist udf " >> /etc/modprobe.d/udf.conf Run the following command to unload the udf module: # modprobe -r udf.' + compliance: + - cis: ["1.1.1.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v udf -> r:install /bin/false|Module udf not found" + - "not c:lsmod -> r:udf" + - 'd:/etc/modprobe.d/ -> r:\.*.conf -> r:^blacklist\s+udf' + + # 1.1.2.1 Ensure /tmp is a separate partition. (Automated) + - id: 30503 + title: "Ensure /tmp is a separate partition." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a configuration where /tmp is not a separate file system it will essentially have the whole disk available, as the default installation only creates a single / partition. On the other hand, a RAM-based /tmp (as with tmpfs) will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily. Another alternative is to create a dedicated partition for /tmp from a separate volume or disk. One of the downsides of a disk-based dedicated partition is that it will be slower than tmpfs which is RAM-based. /tmp utilizing tmpfs can be resized using the size={size} parameter in the relevant entry in /etc/fstab." + remediation: "First ensure that systemd is correctly configured to ensure that /tmp will be mounted at boot time. # systemctl unmask tmp.mount For specific configuration requirements of the /tmp mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs /tmp 0 tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 Example of using a volume or disk with specific mount options. The source location of the volume or disk will vary depending on your environment. /tmp defaults,nodev,nosuid,noexec 0 0." + references: + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + - "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html" + compliance: + - cis: ["1.1.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s' + - "c:systemctl is-enabled tmp.mount -> r:enabled|static|generated" + + # 1.1.2.2 Ensure nodev option set on /tmp partition. (Automated) + - id: 30504 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nodev" + + # 1.1.2.3 Ensure noexec option set on /tmp partition. (Automated) + - id: 30505 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:noexec" + + # 1.1.2.4 Ensure nosuid option set on /tmp partition. (Automated) + - id: 30506 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nosuid" + + ############################################### + # 1.1.3 Configure /var + ############################################### + # 1.1.3.1 Ensure separate partition exists for /var. (Automated) + - id: 30507 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "The reasoning for mounting /var on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behaviour. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s' + + # 1.1.3.2 Ensure nodev option set on /var partition. (Automated) + - id: 30508 + title: "Ensure nodev option set on /var partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:nodev" + + # 1.1.3.3 Ensure noexec option set on /var partition. (Automated) + - id: 30509 + title: "Ensure noexec option set on /var partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot run executable binaries from /var." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:noexec" + + # 1.1.3.4 Ensure nosuid option set on /var partition. (Automated) + - id: 30510 + title: "Ensure nosuid option set on /var partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nosuid" + + ############################################### + # 1.1.4 Configure /var/tmp + ############################################### + # 1.1.4.1 Ensure separate partition exists for /var/tmp. (Automated) + - id: 30511 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications. Temporary file residing in /var/tmp is to be preserved between reboots." + rationale: "The reasoning for mounting /var/tmp on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/tmp directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/tmp and cause the potential disruption to daemons as the disk is full. Fine grained control over the mount Configuring /var/tmp as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var/tmp may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s' + + # 1.1.4.2 Ensure noexec option set on /var/tmp partition. (Automated) + - id: 30512 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:noexec" + + # 1.1.4.3 Ensure nosuid option set on /var/tmp partition. (Automated) + - id: 30513 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nosuid" + + # 1.1.4.4 Ensure nodev option set on /var/tmp partition. (Automated) + - id: 30514 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nodev" + + ############################################### + # 1.1.5 Configure /var/log + ############################################### + # 1.1.5.1 Ensure separate partition exists for /var/log. (Automated) + - id: 30515 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "The reasoning for mounting /var/log on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log directory contain the log files that can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. Fine grained control over the mount Configuring /var/log as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of log data As /var/log contains log files, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.5.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s' + + # 1.1.5.2 Ensure nodev option set on /var/log partition. (Automated) + - id: 30516 + title: "Ensure nodev option set on /var/log partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:nodev" + + # 1.1.5.3 Ensure noexec option set on /var/log partition. (Automated) + - id: 30517 + title: "Ensure noexec option set on /var/log partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot run executable binaries from /var/log." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:noexec" + + # 1.1.5.4 Ensure nosuid option set on /var/log partition. (Automated) + - id: 30518 + title: "Ensure nosuid option set on /var/log partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot create setuid files in /var/log." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:nosuid" + + ############################################### + # 1.1.6 Configure /var/log/audit + ############################################### + # 1.1.6.1 Ensure separate partition exists for /var/log/audit. (Automated) + - id: 30519 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "The reasoning for mounting /var/log/audit on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log/audit directory contain the audit.log file that can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/log/audit and cause auditd to trigger it's space_left_action as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var/log/audit as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of audit data As /var/log/audit contains audit logs, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.6.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s' + + # 1.1.6.2 Ensure noexec option set on /var/log/audit partition. (Automated) + - id: 30520 + title: "Ensure noexec option set on /var/log/audit partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log/audit filesystem is only intended for audit logs, set this option to ensure that users cannot run executable binaries from /var/log/audit." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:noexec" + + # 1.1.6.3 Ensure nodev option set on /var/log/audit partition. (Automated) + - id: 30521 + title: "Ensure nodev option set on /var/log/audit partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log/audit filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:nodev" + + # 1.1.6.4 Ensure nosuid option set on /var/log/audit partition. (Automated) + - id: 30522 + title: "Ensure nosuid option set on /var/log/audit partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log/audit filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:nosuid" + + ############################################### + # 1.1.7 Configure /home + ############################################### + # 1.1.7.1 Ensure separate partition exists for /home. (Automated) + - id: 30523 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "The reasoning for mounting /home on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /home directory contains user generated data, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /home and impact all local users. Fine grained control over the mount Configuring /home as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. In the case of /home options such as usrquota/grpquota may be considered to limit the impact that users can have on each other with regards to disk resource exhaustion. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of user data As /home contains user data, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.7.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s' + + # 1.1.7.2 Ensure nodev option set on /home partition. (Automated) + - id: 30524 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /home filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:nodev" + + # 1.1.7.3 Ensure nosuid option set on /home partition. (Automated) + - id: 30525 + title: "Ensure nosuid option set on /home partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /home filesystem is only intended for user file storage, set this option to ensure that users cannot create setuid files in /home." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:nosuid" + + # 1.1.7.4 Ensure usrquota option set on /home partition. (Automated) + - id: 30526 + title: "Ensure usrquota option set on /home partition." + description: "The usrquota mount option allows for the filesystem to have disk quotas configured." + rationale: "To ensure the availability of disk space on /home, it is important to limit the impact a single user or group can cause for other users (or the wider system) by accidentally filling up the partition. Quotas can also be applied to inodes for filesystems where inode exhaustion is a concern." + remediation: "Edit the /etc/fstab file and add usrquota to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,usrquota,grpquota,nodev,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home Create the quota database. This example will ignore any existing quota files. # quotacheck -cugv /home quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. quotacheck: Scanning /dev/sdb [/home] done quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Checked 8 directories and 0 files quotacheck: Old file not found. quotacheck: Old file not found. Restore SELinux context on the quota database files. Order of operations is important as quotaon will set the immutable attribute on the files and thus restorecon will fail. # restorecon /home/aquota.user Enable quotas on the partition: # quotaon -vug /home /dev/sdb [/home]: group quotas turned on /dev/sdb [/home]: user quotas turned on." + compliance: + - cis: ["1.1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:usrquota" + - "c:quotaon -p /home -> r:user quota" + + # 1.1.7.5 Ensure grpquota option set on /home partition. (Automated) + - id: 30527 + title: "Ensure grpquota option set on /home partition." + description: "The grpquota mount option allows for the filesystem to have disk quotas configured." + rationale: "To ensure the availability of disk space on /home, it is important to limit the impact a single user or group can cause for other users (or the wider system) by accidentally filling up the partition. Quotas can also be applied to inodes for filesystems where inode exhaustion is a concern." + remediation: "Edit the /etc/fstab file and add grpquota to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,usrquota,grpquota,nodev,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home Create the quota database. This example will ignore any existing quota files. # quotacheck -cugv /home quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. quotacheck: Scanning /dev/sdb [/home] done quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. quotacheck: Checked 8 directories and 0 files quotacheck: Old file not found. quotacheck: Old file not found. Restore SELinux context on the quota database files. Order of operations is important as quotaon will set the immutable attribute on the files and thus restorecon will fail. # restorecon /home/aquota.group Enable quotas on the partition: # quotaon -vug /home /dev/sdb [/home]: group quotas turned on /dev/sdb [/home]: user quotas turned on." + compliance: + - cis: ["1.1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:grpquota" + - "c:quotaon -p /home -> r:user quota" + + ############################################### + # 1.1.8 Configure /dev/shm + ############################################### + # 1.1.8.1 Ensure nodev option set on /dev/shm partition. (Automated) + - id: 30528 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + - "c:findmnt --kernel /dev/shm -> r:nodev" + + # 1.1.8.2 Ensure noexec option set on /dev/shm partition. (Automated) + - id: 30529 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Example: /dev/shm defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm NOTE It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + - "c:findmnt --kernel /dev/shm -> r:noexec" + + # 1.1.8.3 Ensure nosuid option set on /dev/shm partition. (Automated) + - id: 30530 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + - "c:findmnt --kernel /dev/shm -> r:nosuid" + + # 1.1.9 Disable Automounting. (Automated) + - id: 30531 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "If there are no other packages that depends on autofs, remove the package with: # dnf remove autofs Run the following command to disable autofs if it is required: # systemctl --now disable autofs." + compliance: + - cis: ["1.1.9"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + - nist_sp_800-53: ["SC-18(4)"] + condition: all + rules: + - "c:systemctl is-enabled autofs -> r:Failed to get unit file state for autofs.service" + - "not c:systemctl is-enabled autofs -> r:enabled" + + # 1.1.10 Disable USB Storage. (Automated) + - id: 30532 + title: "Disable USB Storage." + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/usb_storage.conf and add the following line: install usb-storage /bin/true Run the following command to unload the usb-storage module: rmmod usb-storage." + compliance: + - cis: ["1.1.10"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["13.7"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.8.3.1"] + - nist_sp_800-53: ["SC-18(4)"] + condition: all + rules: + - "c:modprobe -n -v usb-storage -> r:install /bin/true" + - "not c:lsmod -> r:usb-storage" + + ############################################### + # 1.2 Configure Software Updates + ############################################### + # 1.2.1 Ensure GPG keys are configured (Manual) - Not Implemented + # 1.2.2 Ensure gpgcheck is globally activated. (Automated) + - id: 30533 + title: "Ensure gpgcheck is globally activated." + description: "The gpgcheck option, found in the main section of the /etc/dnf/dnf.conf and individual /etc/yum.repos.d/* files, determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/dnf/dnf.conf and set gpgcheck=1 in the [main] section. Example: # sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' /etc/dnf/dnf.conf Edit any failing files in /etc/yum.repos.d/* and set all instances starting with gpgcheck to 1. Example: # find /etc/yum.repos.d/ -name \"*.repo\" -exec echo \"Checking:\" {} \\; -exec sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' {} \\;." + compliance: + - cis: ["1.2.2"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'f:/etc/dnf/dnf.conf -> r:^\s*gpgcheck\s*=\s*1' + - 'not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck\s*=\s*0' + + # 1.2.3 Ensure package manager repositories are configured. (Manual) - Not Implemented + ############################################### + # 1.3 Filesystem Integrity Checking + ############################################### + # 1.3.1 Ensure AIDE is installed. (Automated) + - id: 30534 + title: "Ensure AIDE is installed." + description: "Advanced Intrusion Detection Environment (AIDE) is a intrusion detection tool that uses predefined rules to check the integrity of files and directories in the Linux operating system. AIDE has its own database to check the integrity of files and directories. AIDE takes a snapshot of files and directories including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # dnf install aide Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: Run the following commands: # aide --init # mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz." + references: + - "http://aide.sourceforge.net/stable/manual.html" + compliance: + - cis: ["1.3.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-2"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:rpm -q aide -> r:aide-" + + # 1.3.2 Ensure filesystem integrity is regularly checked. (Automated) + - id: 30535 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check OR if aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + references: + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service" + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer" + compliance: + - cis: ["1.3.2"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-2"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:systemctl is-enabled aidecheck.service -> r:enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:enabled" + - "c:systemctl status aidecheck.timer -> r:active" + + ############################################### + # 1.4 Secure Boot Settings + ############################################### + # 1.4.1 Ensure bootloader password is set. (Automated) - Not Implemented + # 1.4.2 Ensure permissions on bootloader config are configured. (Automated) - Not Implemented + # 1.4.3 Ensure authentication is required when booting into rescue mode. (Automated) + - id: 30536 + title: "Ensure authentication is required when booting into rescue mode." + description: "Rescue mode (former single user mode) is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in rescue mode (former single user mode) prevents an unauthorized user from rebooting the system into rescue mode to gain root privileges without credentials." + remediation: "The systemd drop-in files must be created if it is necessary to change the default settings: Create the file /etc/systemd/system/rescue.service.d/00-require-auth.conf which contains only the configuration to be overridden: [Service] ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue." + compliance: + - cis: ["1.4.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "f:/usr/lib/systemd/system/rescue.service -> r:ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue" + - 'd:/etc/systemd/system/rescue.service.d/ -> r:\.*.conf -> r:ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue' + + ############################################### + # 1.5 Additional Process Hardening + ############################################### + # 1.5.1 Ensure core dump storage is disabled. (Automated) + - id: 30537 + title: "Ensure core dump storage is disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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." + remediation: "Edit /etc/systemd/coredump.conf and edit or add the following line: Storage=none." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*Storage\s*=\s*none' + + # 1.5.2 Ensure core dump backtraces are disabled. (Automated) + - id: 30538 + title: "Ensure core dump backtraces are disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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, increasing the risk to the system." + remediation: "Edit or add the following line in /etc/systemd/coredump.conf: ProcessSizeMax=0." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.2"] + - nist_sp_800-53: ["CM-6b"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*ProcessSizeMax\s*=\s*0' + + # 1.5.3 Ensure address space layout randomization (ASLR) is enabled. (Automated) - Not Implemented + ############################################### + # 1.6 Mandatory Access Control + ############################################### + ############################################### + # 1.6.1 Configure SELinux + ############################################### + # 1.6.1.1 Ensure SELinux is installed. (Automated) + - id: 30539 + title: "Ensure SELinux is installed." + description: "SELinux provides Mandatory Access Control." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install SELinux: # dnf install libselinux." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:rpm -q libselinux -> r:^libselinux-" + + # 1.6.1.2 Ensure SELinux is not disabled in bootloader configuration. (Automated) + - id: 30540 + title: "Ensure SELinux is not disabled in bootloader configuration." + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + impact: "Files created while SELinux is disabled are not labeled at all. This behavior causes problems when changing to enforcing mode because files are labeled incorrectly or are not labeled at all. To prevent incorrectly labeled and unlabeled files from causing problems, file systems are automatically relabeled when changing from the disabled state to permissive or enforcing mode. This can be a long running process that should be accounted for as it may extend downtime during initial re-boot." + remediation: "Run the following command to remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: grubby --update-kernel ALL --remove-args 'selinux=0 enforcing=0'." + compliance: + - cis: ["1.6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + - 'f:/boot/grub2/grub.cfg -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + + # 1.6.1.3 Ensure SELinux policy is configured. (Automated) + - id: 30541 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+targeted$|^Loaded policy name:\s+mls$' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Ensure the SELinux mode is not disabled. (Automated) + - id: 30542 + title: "Ensure the SELinux mode is not disabled." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes" + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$|^Permissive$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing|\s*SELINUX\s*=\s*permissive' + + # 1.6.1.5 Ensure the SELinux mode is enforcing. (Automated) + - id: 30543 + title: "Ensure the SELinux mode is enforcing." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode the system not only avoids enforcing the SELinux poli cy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future. Running SELinux in Permissive mode, though helpful for developing SELinux policy, only logs access denial entries, but does not deny any operations." + remediation: "Run the following command to set SELinux's running mode: # setenforce 1 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/selinux_users_and_administrators_guide/sect-security-enhanced_linux-introduction-selinux_modes" + compliance: + - cis: ["1.6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + # 1.6.1.6 Ensure no unconfined services exist. (Automated) + - id: 30544 + title: "Ensure no unconfined services exist." + description: "Unconfined processes run in unconfined domains." + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules - it does not replace them." + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:ps -eZ -> r:unconfined_service_t" + + # 1.6.1.7 Ensure SETroubleshoot is not installed. (Automated) + - id: 30545 + title: "Ensure SETroubleshoot is not installed." + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # dnf remove setroubleshoot." + compliance: + - cis: ["1.6.1.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -qa setroubleshoot -> r:setroubleshoot" + + # 1.6.1.8 Ensure the MCS Translation Service (mcstrans) is not installed. (Automated) + - id: 30546 + title: "Ensure the MCS Translation Service (mcstrans) is not installed." + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf." + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # dnf remove mcstrans." + compliance: + - cis: ["1.6.1.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -qa mcstrans -> r:mcstrans" + + ############################################### + # 1.7 Command Line Warning Banners + ############################################### + # 1.7.1 Ensure message of the day is configured properly. (Automated) + - id: 30547 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s|rocky' + + # 1.7.2 Ensure local login warning banner is configured properly. (Automated) + - id: 30548 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.7.2"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|rocky' + + # 1.7.3 Ensure remote login warning banner is configured properly. (Automated) + - id: 30549 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|rocky' + + # 1.7.4 Ensure permissions on /etc/motd are configured. (Automated) + - id: 30550 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd : # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.5 Ensure permissions on /etc/issue are configured. (Automated) + - id: 30551 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue : # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured. (Automated) + - id: 30552 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + ############################################### + # 1.8 GNOME Display Manager + ############################################### + # 1.8.1 Ensure GNOME Display Manager is removed. (Manual) + - id: 30553 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + impact: "Removing the GNOME Display manager will remove the GUI from the system." + remediation: "Run the following command to remove the gdm package # dnf remove gdm." + references: + - "https://wiki.gnome.org/Projects/GDM" + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q gdm -> r:is not installed" + + # 1.8.2 Ensure GDM login banner is configured. (Automated) + - id: 30554 + title: "Ensure GDM login banner is configured." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Note: If a graphical login is not required, it should be removed to reduce the attack surface of the system." + remediation: "Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/01-banner-message) [org/gnome/login-screen] banner-message-enable=true banner-message-text='' Example Banner Text: 'Authorized users only. All activity may be monitored and reported.' Run the following command to update the system databases: # dconf update." + compliance: + - cis: ["1.8.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/dconf/profile/gdm -> r:^user-db:user\s*system-db:gdm\s*file-db:/usr/share/gdm/greeter-dconf-defaults$' + - 'd:/etc/dconf/db/gdm.d/ -> r:\.* -> r:s*\[org/gnome/login-screen\]\s*banner-message-enable=true\s*banner-message-text=\w+' + + # 1.8.3 Ensure last logged in user display is disabled. (Automated) + - id: 30555 + title: "Ensure last logged in user display is disabled." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Displaying the last logged in user eliminates half of the Userid/Password equation that an unauthorized person would need to log on. Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Notes: - - If a graphical login is not required, it should be removed to reduce the attack surface of the system. If a different GUI login service is in use and required on the system, consult your documentation to disable displaying the last logged on user." + remediation: "Edit or create the file /etc/dconf/profile/gdm and add the following: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Edit or create the file /etc/dconf/db/gdm.d/ and add the following: (This is typically /etc/dconf/db/gdm.d/00-login-screen) [org/gnome/login-screen] # Do not show the user list disable-user-list=true Run the following command to update the system databases: # dconf update." + compliance: + - cis: ["1.8.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/dconf/profile/gdm -> r:^user-db:user\s*system-db:gdm\s*file-db:/usr/share/gdm/greeter-dconf-defaults$' + - 'd:/etc/dconf/db/gdm.d/ -> r:\.* -> r:s*\[org/gnome/login-screen\]\s*disable-user-list=true' + + # 1.8.4 Ensure XDMCP is not enabled. (Automated) + - id: 30556 + title: "Ensure XDMCP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. - XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user - XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server." + remediation: "Edit the file /etc/gdm/custom.conf and remove the line Enable=true." + references: + - "https://help.gnome.org/admin/gdm/2.32/configuration.html.en" + compliance: + - cis: ["1.8.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - 'f:/etc/gdm/custom.conf -> r:^\s*Enable\s*=\s*true' + + # 1.8.5 Ensure automatic mounting of removable media is disabled. (Automated) + - id: 30557 + title: "Ensure automatic mounting of removable media is disabled." + description: "By default GNOME automatically mounts removable media when inserted as a convenience to the user." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "Ensure that automatic mounting of media is disabled for all GNOME users: # cat << EOF >> /etc/dconf/db/local.d/00-media-automount [org/gnome/desktop/media-handling] automount=false automount-open=false EOF Apply the changes with: # dconf update." + references: + - "https://access.redhat.com/solutions/20107" + compliance: + - cis: ["1.8.5"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - "c:gsettings get org.gnome.desktop.media-handling automount -> r:false" + + # 1.9 Ensure updates, patches, and additional security software are installed. (Manual) + - id: 30558 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available updates: # dnf update." + compliance: + - cis: ["1.9"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'not c:sh -c "dnf check-update | egrep -v \"Updating|Last metadata|^$\"" -> r:^\w' + + # 1.10 Ensure system-wide crypto policy is not legacy. (Automated) + - id: 30559 + title: "Ensure system-wide crypto policy is not legacy." + description: "The system-wide crypto-policies followed by the crypto core components allow consistently deprecating and disabling algorithms system-wide. The individual policy levels (DEFAULT, LEGACY, FUTURE, and FIPS) are included in the crypto-policies(7) package." + rationale: "If the Legacy system-wide crypto policy is selected, it includes support for TLS 1.0, TLS 1.1, and SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are allowed, while RSA and Diffie-Hellman parameters are accepted if larger than 1023-bits. These legacy protocols and algorithms can make the system vulnerable to attacks, including those listed in RFC 7457." + impact: "Environments that require compatibility with older insecure protocols may require the use of the less secure LEGACY policy level." + remediation: "Run the following command to change the system-wide crypto policy # update-crypto-policies --set Example: # update-crypto-policies --set DEFAULT Run the following to make the updated system-wide crypto policy active # update-crypto-policies." + references: + - "https://access.redhat.com/articles/3642912#what-polices-are-provided-1" + compliance: + - cis: ["1.10"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["SC-8"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: none + rules: + - 'f:/etc/crypto-policies/config -> r:^\s*LEGACY' + + ############################################### + # 2 Services + ############################################### + ############################################### + # 2.1 Time Synchronization + ############################################### + # 2.1.1 Ensure time synchronization is in use. (Automated) + - id: 30560 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them. Note: If another method for time synchronization is being used, this section may be skipped." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Run the following command to install chrony: # dnf install chrony." + compliance: + - cis: ["2.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:rpm -q chrony -> r:^chrony-" + + # 2.1.2 Ensure chrony is configured. (Automated) + - id: 30561 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: 'Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include ''-u chrony'': OPTIONS="-u chrony".' + compliance: + - cis: ["2.1.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "f:/etc/chrony.conf" + - 'f:/etc/chrony.conf -> r:^\s*\t*server|^\s*\t*pool' + - 'f:/etc/sysconfig/chronyd -> r:^\s*\t*OPTIONS\.*-u chrony' + + ############################################### + # 2.2 Special Purpose Services + ############################################### + # 2.2.1 Ensure xinetd is not installed. (Automated) + - id: 30562 + title: "Ensure xinetd is not installed." + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed to reduce the attack surface are of the system. Note: If an xinetd service or services are required, ensure that any xinetd service not required is stopped and disabled." + remediation: "Run the following command to remove xinetd: # dnf remove xinetd." + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q xinetd -> r:^package xinetd is not installed" + + # 2.2.2 Ensure xorg-x11-server-common is not installed. (Automated) + - id: 30563 + title: "Ensure xorg-x11-server-common is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: 'Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime.' + remediation: "Run the following command to remove the X Windows Server packages: # dnf remove xorg-x11-server-common." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q xorg-x11-server-common -> r:^package xorg-x11-server-common is not installed" + + # 2.2.3 Ensure Avahi Server is not installed. (Automated) + - id: 30564 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to stop, mask and remove avahi-autoipd and avahi: # systemctl stop avahi-daemon.socket avahi-daemon.service # dnf remove avahi-autoipd avahi." + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q avahi-autoipd -> r:^package avahi-autoipd is not installed" + - "c:rpm -q avahi -> r:^package avahi is not installed" + + # 2.2.4 Ensure CUPS is not installed. (Automated) + - id: 30565 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface. Note: Removing CUPS will prevent printing from the system." + impact: "Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to remove cups: # dnf remove cups." + references: + - "http://www.cups.org." + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q cups -> r:^package cups is not installed" + + # 2.2.5 Ensure DHCP Server is not installed. (Automated) + - id: 30566 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that the rpm -q dhcp-server package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcp: # dnf remove dhcp-server." + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dhcp-server -> r:^package dhcp-server is not installed" + + # 2.2.6 Ensure DNS Server is not installed. (Automated) + - id: 30567 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove bind: # dnf remove bind." + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q bind -> r:^package bind is not installed" + + # 2.2.7 Ensure FTP Server is not installed. (Automated) + - id: 30568 + title: "Ensure FTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove ftp: # dnf remove ftp." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ftp -> r:^package ftp is not installed" + + # 2.2.8 Ensure VSFTP Server is not installed. (Automated) + - id: 30569 + title: "Ensure VSFTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "Unless there is a need to run the system as a FTP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # dnf remove vsftpd." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q vsftpd -> r:^package vsftpd is not installed" + + # 2.2.9 Ensure TFTP Server is not installed. (Automated) + - id: 30570 + title: "Ensure TFTP Server is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + remediation: "Run the following command to remove tftp-server: # dnf remove tftp-server." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp-server -> r:^package tftp-server is not installed" + + # 2.2.10 Ensure a web server is not installed. (Automated) + - id: 30571 + title: "Ensure a web server is not installed." + description: "Web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the packages be removed to reduce the potential attack surface. Note: Several http servers exist. They should also be audited, and removed, if not required." + remediation: "Run the following command to remove httpd and nginx: # dnf remove httpd nginx." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nginx -> r:^package nginx is not installed" + - "c:rpm -q httpd -> r:^package httpd is not installed" + + # 2.2.11 Ensure IMAP and POP3 server is not installed. (Automated) + - id: 30572 + title: "Ensure IMAP and POP3 server is not installed." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface. Note: Several IMAP/POP3 servers exist and can use other service names. These should also be audited and the packages removed if not required." + remediation: "Run the following command to remove dovecot and cyrus-imapd: # dnf remove dovecot cyrus-imapd." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dovecot -> r:^package dovecot is not installed" + - "c:rpm -q cyrus-imapd -> r:^package cyrus-imapd is not installed" + + # 2.2.12 Ensure Samba is not installed. (Automated) + - id: 30573 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # dnf remove samba." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q samba -> r:^package samba is not installed" + + # 2.2.13 Ensure HTTP Proxy Server is not installed. (Automated) + - id: 30574 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "Unless a system is specifically set up to act as a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface. Note: Several HTTP proxy servers exist. These should be checked and removed unless required." + remediation: "Run the following command to remove the squid package: # dnf remove squid." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q squid -> r:^package squid is not installed" + + # 2.2.14 Ensure net-snmp is not installed. (Automated) + - id: 30575 + title: "Ensure net-snmp is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. If SNMP v2 is absolutely necessary, modify the community strings' values. -." + remediation: "Run the following command to remove net-snmpd: # dnf remove net-snmp." + compliance: + - cis: ["2.2.14"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q net-snmp -> r:^package net-snmp is not installed" + + # 2.2.15 Ensure NIS server is not installed. (Automated) + - id: 30576 + title: "Ensure NIS server is not installed." + description: "The ypserv package provides the Network Information Service (NIS). This service, formally known as Yellow Pages, is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the ypserv package be removed, and if required a more secure services be used." + remediation: "Run the following command to remove ypserv: # dnf remove ypserv." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ypserv -> r:^package ypserv is not installed" + + # 2.2.16 Ensure telnet-server is not installed. (Automated) + - id: 30577 + title: "Ensure telnet-server is not installed." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to remove the telnet-server package: # dnf remove telnet-server." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet-server -> r:^package telnet-server is not installed" + + # 2.2.17 Ensure mail transfer agent is configured for local-only mode. (Automated) + - id: 30578 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Notes: - This recommendation is designed around the postfix mail server. - Depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.17"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not c:ss -lntu -> r:\s*127.0.0.1:25\s*|\s*::1:25\s*' + + # 2.2.18 Ensure nfs-utils is not installed or the nfs-server service is masked. (Automated) + - id: 30579 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not require network shares, it is recommended that the nfs-utils package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization are dependent on the nfs-utils package. If the nfs-package is required as a dependency, the nfs-server should be disabled and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove nfs-utils OR If the nfs-package is required as a dependency, run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server." + compliance: + - cis: ["2.2.18"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q nfs-utils -> r:^package nfs-utils is not installed" + - "c:systemctl is-enabled nfs-server -> r:masked|No such file or directory" + + # 2.2.19 Ensure rpcbind is not installed or the rpcbind services are masked. (Automated) + - id: 30580 + title: "Ensure rpcbind is not installed or the rpcbind services are masked." + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening." + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization, and the nfs-utils package used for The Network File System (NFS), are dependent on the rpcbind package. If the rpcbind package is required as a dependency, the services rpcbind.service and rpcbind.socket should be stopped and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove rpcbind OR If the rpcbind package is required as a dependency, run the following commands to stop and mask the rpcbind and rpcbind.socket services: # systemctl --now mask rpcbind # systemctl --now mask rpcbind.socket." + compliance: + - cis: ["2.2.19"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rpcbind -> r:^package rpcbind is not installed" + - "not c:systemctl status rpcbind rpcbind.socket -> r:Loaded: && !r: masked" + + # 2.2.20 Ensure rsync is not installed or the rsyncd service is masked. (Automated) + - id: 30581 + title: "Ensure rsync is not installed or the rsyncd service is masked." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication. Note: If a required dependency exists for the rsync package, but the rsyncd service is not required, the service should be masked." + impact: "There are packages that are dependent on the rsync package. If the rsync package is removed, these packages will be removed as well. Before removing the rsync package, review any dependent packages to determine if they are required on the system. If a dependent package is required, mask the rsyncd service and leave the rsync package installed." + remediation: "Run the following command to remove the rsync package: # dnf remove rsync OR Run the following command to mask the rsyncd service: # systemctl --now mask rsyncd." + compliance: + - cis: ["2.2.20"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rsync -> r:^package rsync is not installed" + - "c:systemctl is-enabled rsyncd -> r:masked|No such file or directory" + + # 2.3.1 Ensure NIS Client is not installed. (Automated) + - id: 30582 + title: "Ensure NIS Client is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the ypbind package: # dnf remove ypbind." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ypbind -> r:^package ypbind is not installed" + + # 2.3.2 Ensure rsh client is not installed. (Automated) + - id: 30583 + title: "Ensure rsh client is not installed." + description: "The rsh package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the rsh package: # dnf remove rsh." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q rsh -> r:^package rsh is not installed" + + # 2.3.3 Ensure talk client is not installed. (Automated) + - id: 30584 + title: "Ensure talk client is not installed." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the talk package: # dnf remove talk." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q talk -> r:^package talk is not installed" + + # 2.3.4 Ensure telnet client is not installed. (Automated) + - id: 30585 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the telnet package: # dnf remove telnet." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet -> r:^package telnet is not installed" + + # 2.3.5 Ensure LDAP client is not installed. (Automated) + - id: 30586 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Run the following command to remove the openldap-clients package: # dnf remove openldap-clients." + compliance: + - cis: ["2.3.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q openldap-clients -> r:^package openldap-clients is not installed" + + # 2.3.6 Ensure TFTP client is not installed. (Automated) + - id: 30587 + title: "Ensure TFTP client is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + remediation: "Run the following command to remove tftp: # dnf remove tftp." + compliance: + - cis: ["2.3.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp -> r:^package tftp is not installed" + + # 2.4 Ensure nonessential services are removed or masked. (Manual) - Not Implemented + ############################################### + # 3 Network Configuration + ############################################### + ############################################### + # 3.1 Disable unused network protocols and devices + ############################################### + # 3.1.1 Verify if IPv6 is enabled on the system. (Manual) - Not Implemented + # 3.1.2 Ensure SCTP is disabled. (Automated) + - id: 30588 + title: "Ensure SCTP is disabled." + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: printf " install sctp /bin/true " >> /etc/modprobe.d/sctp.conf.' + compliance: + - cis: ["3.1.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v sctp -> r:install /bin/true" + - "not c:lsmod -> r:sctp" + + # 3.1.3 Ensure DCCP is disabled. (Automated) + - id: 30589 + title: "Ensure DCCP is disabled." + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in-sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: 'Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: printf " install dccp /bin/true " >> /etc/modprobe.d/dccp.conf.' + compliance: + - cis: ["3.1.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v dccp -> r:install /bin/true" + - "not c:lsmod -> r:dccp" + + # 3.1.4 Ensure wireless interfaces are disabled. (Automated) - Not Implemented + ############################################### + # 3.2 Network Parameters (Host Only) + ############################################### + # 3.2.1 Ensure IP forwarding is disabled. (Automated) - Not Implemented + # 3.2.2 Ensure packet redirect sending is disabled. (Automated) - Not Implemented + ############################################### + # 3.3 Network Parameters (Host and Router) + ############################################### + # 3.3.1 Ensure source routed packets are not accepted. (Automated) - Not Implemented + # 3.3.2 Ensure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.3 Ensure secure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.4 Ensure suspicious packets are logged. (Automated) - Not Implemented + # 3.3.5 Ensure broadcast ICMP requests are ignored. (Automated) - Not Implemented + # 3.3.6 Ensure bogus ICMP responses are ignored. (Automated) - Not Implemented + # 3.3.7 Ensure Reverse Path Filtering is enabled. (Automated) - Not Implemented + # 3.3.8 Ensure TCP SYN Cookies is enabled. (Automated) - Not Implemented + # 3.3.9 Ensure IPv6 router advertisements are not accepted. (Automated) - Not Implemented + ############################################### + # 3.4 Firewall Configuration + ############################################### + ############################################### + # 3.4.1 Configure firewalld + ############################################### + # 3.4.1.1 Ensure firewalld is installed. (Automated) + - id: 30590 + title: "Ensure firewalld is installed." + description: "firewalld is a firewall management tool for Linux operating systems. It provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the iptables backend or provides firewall features by acting as a front-end for the Linux kernel's netfilter framework via the nftables utility. firewalld replaces iptables as the default firewall management tool. Use the firewalld utility to configure a firewall for less complex firewalls. The utility is easy to use and covers the typical use cases scenario. FirewallD supports both IPv4 and IPv6 networks and can administer separate firewall zones with varying degrees of trust as defined in zone profiles. Note: Starting in v0.6.0, FirewallD added support for acting as a front-end for the Linux kernel's netfilter framework via the nftables userspace utility, acting as an alternative to the nft command line program." + rationale: "A firewall utility is required to configure the Linux kernel's netfilter framework via the iptables or nftables back-end. The Linux kernel's netfilter framework host-based firewall can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host. Note: Only one firewall utility should be installed and configured. FirewallD is dependent on the iptables package." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install FirewallD and iptables: # dnf install firewalld iptables." + compliance: + - cis: ["3.4.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:rpm -q firewalld iptables -> r:firewalld\w*|iptables\w*' + + # 3.4.1.2 Ensure iptables-services not installed with firewalld. (Automated) + - id: 30591 + title: "Ensure iptables-services not installed with firewalld." + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both firewalld and the services included in the iptables-services package may lead to conflict." + impact: "Running both firewalld and iptables/ip6tables service may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package # systemctl stop iptables # systemctl stop ip6tables # dnf remove iptables-services." + compliance: + - cis: ["3.4.1.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9", "CM-7"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q iptables-services -> r:^package iptables-services is not installed" + + # 3.4.1.3 Ensure nftables either not installed or masked with firewalld. (Automated) + - id: 30592 + title: "Ensure nftables either not installed or masked with firewalld." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables." + rationale: "Running both firewalld and nftables may lead to conflict. Note: - Support for using nftables as the back-end for firewalld was added in release v0.6.0 firewalld may be configured as the front-end to nftables. If this case, nftables should - be stopped and masked instead of removed." + remediation: 'Run the following command to remove nftables: # dnf remove nftables OR Run the following command to stop and mask nftables" systemctl --now mask nftables.' + compliance: + - cis: ["3.4.1.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q nftables -> r:^package nftables is not installed" + - "c:systemctl is-active nftables -> r:inactive" + - "c:systemctl is-enabled nftables -> r:masked" + + # 3.4.1.4 Ensure firewalld service enabled and running. (Automated) + - id: 30593 + title: "Ensure firewalld service enabled and running." + description: "firewalld.service enables the enforcement of firewall rules configured through firewalld." + rationale: "Ensure that the firewalld.service is enabled and running to enforce firewall rules configured through firewalld." + impact: "Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following command to unmask firewalld # systemctl unmask firewalld Run the following command to enable and start firewalld # systemctl --now enable firewalld." + compliance: + - cis: ["3.4.1.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled firewalld -> r:enabled" + - "c:firewall-cmd --state -> r:running" + + # 3.4.1.5 Ensure firewalld default zone is set. (Automated) - Not Implemented + # 3.4.1.6 Ensure network interfaces are assigned to appropriate zone. (Manual) - Not Implemented + # 3.4.1.7 Ensure firewalld drops unnecessary services and ports. (Manual) - Not Implemented + ############################################### + # 3.4.2 Configure firewall rules + ############################################### + # 3.4.2.1 Ensure nftables is installed. (Automated) + - id: 30594 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem. Note: - nftables is available in Linux kernel 3.13 and newer. - Only one firewall utility should be installed and configured." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install nftables # dnf install nftables." + compliance: + - cis: ["3.4.2.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:nftables-" + + # 3.4.2.2 Ensure firewalld is either not installed or masked with nftables. (Automated) + - id: 30595 + title: "Ensure firewalld is either not installed or masked with nftables." + description: 'firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with support for network/firewall "zones" to assign a level of trust to a network and its associated connections, interfaces or sources. It has support for IPv4, IPv6, Ethernet bridges and also for IPSet firewall settings. There is a separation of the runtime and permanent configuration options.' + rationale: "Running both nftables.service and firewalld.service may lead to conflict and unexpected results." + remediation: "Run the following command to remove firewalld # dnf remove firewalld OR Run the following command to stop and mask firewalld # systemctl --now mask firewalld." + compliance: + - cis: ["3.4.2.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q firewalld package -> r:firewalld is not installed" + - "c:firewall-cmd --state -> r:^running" + - "c:systemctl is-enabled firewalld -> r:masked" + + # 3.4.2.3 Ensure iptables-services not installed with nftables. (Automated) + - id: 30596 + title: "Ensure iptables-services not installed with nftables." + description: "The iptables-services package contains the iptables.service and ip6tables.service. These services allow for management of the Host Based Firewall provided by the iptables package." + rationale: "iptables.service and ip6tables.service are still supported and can be installed with the iptables-services package. Running both nftables and the services included in the iptables-services package may lead to conflict." + remediation: "Run the following commands to stop the services included in the iptables-services package and remove the iptables-services package # systemctl stop iptables # systemctl stop ip6tables # dnf remove iptables-services." + compliance: + - cis: ["3.4.2.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9", "CM-7"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q iptables-services package -> r:iptables-services is not installed" + + # 3.4.2.4 Ensure iptables are flushed with nftables. (Manual) + - id: 30597 + title: "Ensure iptables are flushed with nftables." + description: "nftables is a replacement for iptables, ip6tables, ebtables and arptables." + rationale: "It is possible to mix iptables and nftables. However, this increases complexity and also the chance to introduce errors. For simplicity flush out all iptables rules, and ensure it is not loaded." + remediation: "Run the following commands to flush iptables: For iptables: # iptables -F For ip6tables: # ip6tables -F." + compliance: + - cis: ["3.4.2.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: none + rules: + - "not c:iptables -L --state -> r:w*" + - "not c:ip6tables -L --state -> r:w*" + # 3.4.2.5 Ensure an nftables table exists. (Automated) + - id: 30598 + title: "Ensure an nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + impact: "Adding rules to a running nftables can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example: # nft create table inet filter." + compliance: + - cis: ["3.4.2.5"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list tables -> r:^table" + - "c:rpm -q nftables -> r:^nftables-" + + # 3.4.2.6 Ensure nftables base chains exist. (Automated) + - id: 30599 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.4.2.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^nftables-" + - "c:nft list ruleset -> r:filter hook input" + - "c:nft list ruleset -> r:filter hook forward" + - "c:nft list ruleset -> r:filter hook output" + + # 3.4.2.7 Ensure nftables loopback traffic is configured. (Automated) - Not Implemented + # 3.4.2.8 Ensure nftables outbound and established connections are configured. (Manual) - Not Implemented + # 3.4.2.9 Ensure nftables default deny firewall policy. (Automated) + - id: 30600 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue traversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over the network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; } # nft chain inet filter output { policy drop \\; }." + compliance: + - cis: ["3.4.2.9"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^nftables-" + - "c:nft list ruleset -> r:policy drop" + - "c:nft list ruleset -> r:policy drop" + - "c:nft list ruleset -> r:policy drop" + + # 3.4.2.10 Ensure nftables service is enabled. (Automated) + - id: 30601 + title: "Ensure nftables service is enabled." + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables." + compliance: + - cis: ["3.4.2.10"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled nftables -> r:enabled" + + # 3.4.2.11 Ensure nftables rules are permanent. (Automated) + - id: 30602 + title: "Ensure nftables rules are permanent." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames. The nftables service reads the /etc/sysconfig/nftables.conf file for a nftables file or files to include in the nftables ruleset. A nftables ruleset containing the input, forward, and output base chains allow network traffic to be filtered." + rationale: "Changes made to nftables ruleset only affect the live system, you will also need to configure the nftables ruleset to apply on boot." + remediation: 'Edit the /etc/sysconfig/nftables.conf file and un-comment or add a line with include for each nftables file you want included in the nftables ruleset on boot: Example: include "/etc/nftables/nftables.rules".' + compliance: + - cis: ["3.4.2.11"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "f:/etc/sysconfig/nftables.conf -> r:^include" + + ############################################################ + # 3.4.3 Configure iptables. + ############################################################ + ############################################################ + # 3.4.3.1 Configure iptables software. + ############################################################ + # 3.4.3.1.1 Ensure iptables packages are installed. (Automated) + - id: 30603 + title: "Ensure iptables packages are installed." + description: "iptables is a utility program that allows a system administrator to configure the tables provided by the Linux kernel firewall, implemented as different Netfilter modules, and the chains and rules it stores. Different kernel modules and programs are used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames." + rationale: "A method of configuring and maintaining firewall rules is necessary to configure a Host Based Firewall." + remediation: "Run the following command to install iptables and iptables-services # dnf install iptables iptables-services." + compliance: + - cis: ["3.4.3.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:rpm -q iptables iptables-services -> r:/iptables\w*|iptables-services\w*' + + # 3.4.3.1.2 Ensure nftables is not installed with iptables. (Automated) + - id: 30604 + title: "Ensure nftables is not installed with iptables." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables." + rationale: "Running both iptables and nftables may lead to conflict." + remediation: "Run the following command to remove nftables: # dnf remove nftables." + compliance: + - cis: ["3.4.3.1.2"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9", "CM-7"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^package nftables is not installed" + + # 3.4.3.1.3 Ensure firewalld is either not installed or masked with iptables. (Automated) + - id: 30605 + title: "Ensure firewalld is either not installed or masked with iptables." + description: 'firewalld (Dynamic Firewall Manager) provides a dynamically managed firewall with support for network/firewall "zones" to assign a level of trust to a network and its associated connections, interfaces or sources. It has support for IPv4, IPv6, Ethernet bridges and also for IPSet firewall settings. There is a separation of the runtime and permanent configuration options.' + rationale: "Running iptables.service and\\or ip6tables.service with firewalld.service may lead to conflict and unexpected results." + remediation: "Run the following command to remove firewalld # yum remove firewalld OR Run the following command to stop and mask firewalld # systemctl --now mask firewalld." + compliance: + - cis: ["3.4.3.1.3"] + - cis_csc_v8: ["4.4", "4.8"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.1.6", "1.2.1", "1.3.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.1", "1.2.5", "1.4.1", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q firewalld -> r:^package firewalld is not installed" + - "not c:systemctl status firewalld -> r:active (running)" + - "c:systemctl is-enabled firewalld -> r:masked" + + ############################################################ + # 3.4.3.2 Configure IPv4 iptables + ############################################################ + # 3.4.3.2.1 Ensure iptables loopback traffic is configured. (Automated) + - id: 30606 + title: "Ensure iptables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP." + compliance: + - cis: ["3.4.3.2.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:iptables -L INPUT -v -n -> r:chain input" + - "c:iptables -L OUTPUT -v -n -> r:chain output" + + # 3.4.3.2.2 Ensure iptables outbound and established connections are configured. (Manual) - Not Implemented + # 3.4.3.2.3 Ensure iptables rules exist for all open ports. (Automated) - Not implemented + # 3.4.3.2.4 Ensure iptables default deny firewall policy. (Automated) + - id: 30607 + title: "Ensure iptables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP." + compliance: + - cis: ["3.4.3.2.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:iptables -L -> r:INPUT && r:policy DROP" + - "c:iptables -L -> r:FORWARD && r:policy DROP" + - "c:iptables -L -> r:OUTPUT && r:policy DROP" + + # 3.4.3.2.5 Ensure iptables rules are saved. (Automated) - Not Implemented + # 3.4.3.2.6 Ensure iptables is enabled and active. (Automated) + - id: 30608 + title: "Ensure iptables is enabled and active." + description: "iptables.service is a utility for configuring and maintaining iptables." + rationale: "iptables.service will load the iptables rules saved in the file /etc/sysconfig/iptables at boot, otherwise the iptables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start iptables: # systemctl --now enable iptables." + compliance: + - cis: ["3.4.3.2.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled iptables -> r:enabled" + - "c:systemctl is-active iptables -> r:active" + + ############################################### + # 3.4.3.3 Configure IPv6 ip6tables + ############################################### + # 3.4.3.3.1 Ensure ip6tables loopback traffic is configured. (Automated) + - id: 30609 + title: "Ensure ip6tables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP." + compliance: + - cis: ["3.4.3.3.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:ACCEPT && r:all && r:lo\s*\t**' + - 'c:ip6tables -L INPUT -v -n -> r:DROP && r:all && r:*\s*\t** && r:::1' + - 'c:ip6tables -L OUTPUT -v -n -> r:ACCEPT && r:all && r:*\s*\t*lo' + + # 3.4.3.3.2 Ensure ip6tables outbound and established connections are configured. (Manual) - Not Implemented + # 3.4.3.3.3 Ensure ip6tables firewall rules exist for all open ports. (Automated) - Not Implemented + # 3.4.3.3.4 Ensure ip6tables default deny firewall policy. (Automated) + - id: 30610 + title: "Ensure ip6tables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP." + compliance: + - cis: ["3.4.3.3.4"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:ip6tables -L -> r:INPUT && r:policy DROP" + - "c:ip6tables -L -> r:FORWARD && r:policy DROP" + - "c:ip6tables -L -> r:OUTPUT && r:policy DROP" + + # 3.4.3.3.5 Ensure ip6tables rules are saved. (Automated) - Not Implemented + # 3.4.3.3.6 Ensure ip6tables is enabled and active. (Automated) + - id: 30611 + title: "Ensure ip6tables is enabled and active." + description: "ip6tables.service is a utility for configuring and maintaining ip6tables." + rationale: "ip6tables.service will load the iptables rules saved in the file /etc/sysconfig/ip6tables at boot, otherwise the ip6tables rules will be cleared during a re-boot of the system." + remediation: "Run the following command to enable and start ip6tables: # systemctl --now start ip6tables." + compliance: + - cis: ["3.4.3.3.6"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled ip6tables -> r:enabled" + - "c:systemctl is-active ip6tables -> r:active" + + ############################################################ + # 4 Logging and Auditing. + ############################################################ + ############################################################ + # 4.1 Configure System Accounting (auditd). + ############################################################ + ############################################################ + # 4.1.1 Ensure auditing is enabled. + ############################################################ + # 4.1.1.1 Ensure auditd is installed. (Automated) + - id: 30612 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # dnf install audit." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v8: ["8.2", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "AU-3", "AU-3(1)", "SI-5"] + - pci_dss_v3.2.1: ["10.1", "10.2", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:rpm -q audit -> r:^audit-" + + # 4.1.1.2 Ensure auditd service is enabled. (Automated) + - id: 30613 + title: "Ensure auditd service is enabled." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:enabled" + + # 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled. (Automated) + - id: 30614 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd , so that potential malicious activity cannot go undetected." + remediation: "Run the following command to add audit=1 to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit=1'." + compliance: + - cis: ["4.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:grubby --info=ALL -> r:audit=1" + + # 4.1.1.4 Ensure audit_backlog_limit is sufficient. (Automated) + - id: 30615 + title: "Ensure audit_backlog_limit is sufficient." + description: "The backlog limit has a default setting of 64." + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more that 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected." + remediation: "Run the following command to add audit_backlog_limit= to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit_backlog_limit=' Example: # grubby --update-kernel ALL --args 'audit_backlog_limit=8192'." + compliance: + - cis: ["4.1.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:grubby --info=ALL -> n:^args=\.*\saudit_backlog_limit=(\d+) compare >= 8192' + + ############################################################ + # 4.1.2 Configure Data Retention + ############################################################ + # 4.1.2.1 Ensure audit log storage size is configured. (Automated) + - id: 30616 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file\s*=\s*\d+' + + # 4.1.2.2 Ensure audit logs are not automatically deleted. (Automated) + - id: 30617 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file_action\s*=\s*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full. (Automated) + - id: 30618 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full. The admin_space_left_action parameter tells the system what action to take when the system has detected that it is low on disk space. Valid values are ignore, syslog, suspend, single, and halt. - ignore, the audit daemon does nothing - Syslog, the audit daemon will issue a warning to syslog - Suspend, the audit daemon will stop writing records to the disk - single, the audit daemon will put the computer system in single user mode - halt, the audit daemon will shutdown the system." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + impact: "If the admin_space_left_action parameter is set to halt the audit daemon will shutdown the system when the disk partition containing the audit logs becomes full." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root Set admin_space_left_action to either halt or single in /etc/audit/auditd.conf. Example: admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - nist_sp_800-53: ["AU-12", "AU-2", "AU-8", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt|^\s*admin_space_left_action\s*=\s*single' + + ############################################# + # 4.1.3 Configure auditd rules + ############################################# + # 4.1.3.1 Ensure changes to system administration scope (sudoers) is collected. (Automated) + - id: 30619 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers, or files in /etc/sudoers.d, will be written to when the file(s) or related attributes have changed. The audit records will be tagged with the identifier "scope".' + rationale: "Changes in the /etc/sudoers and /etc/sudoers.d files can indicate that an unauthorized change has been made to the scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor scope changes for system administrators. Example: # printf \" -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d -p wa -k scope \" >> /etc/audit/rules.d/50-scope.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - d:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers -p wa -k scope|-w /etc/sudoers -p wa key=scope + - d:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers.d -p wa -k scope|-w /etc/sudoers.d -p wa key=scope + - c:auditctl -l -> r:-w /etc/sudoers -p wa -k scope|-w /etc/sudoers -p wa key=scope + - c:auditctl -l -> r:-w /etc/sudoers.d -p wa -k scope|-w /etc/sudoers.d -p wa key=scope + + # 4.1.3.2 Ensure actions as another user are always logged. (Automated) - Not Implemented + # 4.1.3.3 Ensure events that modify the sudo log file are collected. (Automated) - Not Implemented + # 4.1.3.4 Ensure events that modify date and time information are collected. (Automated) - Not Implemented + # 4.1.3.5 Ensure events that modify the system's network environment are collected. (Automated) - Not Implemented + # 4.1.3.6 Ensure use of privileged commands are collected. (Automated) - Not Implemented + # 4.1.3.7 Ensure unsuccessful file access attempts are collected. (Automated) - Not Implemented + # 4.1.3.8 Ensure events that modify user/group information are collected. (Automated) - Not Implemented + # 4.1.3.9 Ensure discretionary access control permission modification events are collected. (Automated) - Not Implemented + # 4.1.3.10 Ensure successful file system mounts are collected. (Automated) - Not Implemented + # 4.1.3.11 Ensure session initiation information is collected. (Automated) - Not Implemented + # 4.1.3.12 Ensure login and logout events are collected. (Automated) - Not Implemented + # 4.1.3.13 Ensure file deletion events by users are collected. (Automated) - Not Implemented + # 4.1.3.14 Ensure events that modify the system's Mandatory Access Controls are collected. (Automated) - Not Implemented + # 4.1.3.15 Ensure successful and unsuccessful attempts to use the chcon command are recorded. (Automated) - Not Implemented + # 4.1.3.16 Ensure successful and unsuccessful attempts to use the setfacl command are recorded. (Automated) - Not Implemented + # 4.1.3.17 Ensure successful and unsuccessful attempts to use the chacl command are recorded. (Automated) - Not Implemented + # 4.1.3.18 Ensure successful and unsuccessful attempts to use the usermod command are recorded. (Automated) - Not Implemented + # 4.1.3.19 Ensure kernel module loading unloading and modification is collected. (Automated) - Not Implemented + # 4.1.3.20 Ensure the audit configuration is immutable. (Automated) + - id: 30620 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: This setting will require the system to be rebooted to update the active auditd configuration settings.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line -e 2 at the end of the file: Example: # printf -- \"-e 2\" >> /etc/audit/rules.d/99-finalize.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.20"] + - cis_csc_v8: ["3.3", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AC-3", "AU-3", "AU-3(1)", "MP-2"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "7.1", "9.4.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + condition: any + rules: + - "f:/etc/audit/audit.rules -> r:^-e 2" + - 'd:/etc/audit/rules.d -> r:\.*.rules -> r:^-e 2' + + # 4.1.3.21 Ensure the running and on disk configuration is the same. (Manual) + - id: 30621 + title: "Ensure the running and on disk configuration is the same." + description: "The Audit system have both on disk and running configuration. It is possible for these configuration settings to differ. Note: Due to the limitations of augenrules and auditctl, it is not absolutely guaranteed that loading the rule sets via augenrules --load will result in all rules being loaded or even that the user will be informed if there was a problem loading the rules." + rationale: "Configuration differences between what is currently running and what is on disk could cause unexpected problems or may give a false impression of compliance requirements." + remediation: 'If the rules are not aligned across all three () areas, run the following command to merge and load all rules: # augenrules --load Check if reboot is required. if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then echo "Reboot required to load rules"; fi.' + compliance: + - cis: ["4.1.3.21"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:augenrules --check -> r:No change$" + + ############################################### + # 4.2 Configure Logging + ############################################### + # 4.2.1 Configure rsyslog + ############################################### + # 4.2.1.1 Ensure rsyslog is installed. (Automated) + - id: 30622 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is recommended in environments where journald does not meet operation requirements." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # dnf install rsyslog." + compliance: + - cis: ["4.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q rsyslog -> r:^rsyslog-" + + # 4.2.1.2 Ensure rsyslog service is enabled. (Automated) + - id: 30623 + title: "Ensure rsyslog service is enabled." + description: "Once the rsyslog package is installed, ensure that the service is enabled." + rationale: "If the rsyslog service is not enabled to start on boot, the system will not capture logging events." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:^enabled" + + # 4.2.1.3 Ensure journald is configured to send logs to rsyslog. (Manual) + - id: 30624 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the RSyslog service provides a consistent means of log collection and export." + rationale: "IF RSyslog is the preferred method for capturing logs, all logs of the system should be sent to it for further processing." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.3"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AC-3", "AU-12", "AU-2", "AU-4", "MP-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*ForwardToSyslog=yes' + + # 4.2.1.4 Ensure rsyslog default file permissions are configured. (Automated) + - id: 30625 + title: "Ensure rsyslog default file permissions are configured." + description: "RSyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + impact: "The systems global umask could override, but only making the file permissions stricter, what is configured in RSyslog with the FileCreateMode directive. RSyslog also has it's own $umask directive that can alter the intended file creation mode. In addition, consideration should be given to how FileCreateMode is used. Thus it is critical to ensure that the intended file creation mode is not overridden with less restrictive settings in /etc/rsyslog.conf, /etc/rsyslog.d/*conf files and that FileCreateMode is set before any file is created." + remediation: "Edit either /etc/rsyslog.conf or a dedicated .conf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640 Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.4"] + - cis_csc_v8: ["3.3", "8.2"] + - cis_csc_v7: ["5.1", "6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)", "164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0' + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d20|^\$FileCreateMode 0\d00' + + # 4.2.1.5 Ensure logging is configured. (Manual) - Not Implemented + # 4.2.1.6 Ensure rsyslog is configured to send logs to a remote log host. (Manual) + - id: 30626 + title: "Ensure rsyslog is configured to send logs to a remote log host." + description: "RSyslog supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). The target directive may either be a fully qualified domain name or an IP address. *.* action(type="omfwd" target="192.168.2.100" port="514" protocol="tcp" action.resumeRetryCount="100" queue.type="LinkedList" queue.size="1000") Run the following command to reload the rsyslogd configuration: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.6"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> !r:# && r:^*.* @@\.+' + - 'f:/etc/rsyslog.conf -> !r:# && r:^*.* action && r:target="' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:# && r:^*.* @@\.+' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:# && r:^*.* action && r:target="' + + # 4.2.1.7 Ensure rsyslog is not configured to receive logs from a remote client. (Automated) + - id: 30627 + title: "Ensure rsyslog is not configured to receive logs from a remote client." + description: "RSyslog supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: 'Should there be any active log server configuration found in the auditing section, modify those file and remove the specific lines highlighted by the audit. Ensure none of the following entries are present in any of /etc/rsyslog.conf or /etc/rsyslog.d/*.conf. Old format $ModLoad imtcp $InputTCPServerRun New format module(load="imtcp") input(type="imtcp" port="514") Restart the service: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.7"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - 'f:/etc/rsyslog.conf -> !r:^\s*# && r:ModLoad imtcp|InputTCPServerRun|load="imtcp"|type="imtcp"' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:\s*# && r:ModLoad imtcp|InputTCPServerRun|load="imtcp"|type="imtcp"' + + ############################################### + # 4.2.2 Configure journald + ############################################### + ############################################### + # 4.2.2.1 Ensure journald is configured to send logs to a remote log host + ############################################### + # 4.2.2.1.1 Ensure systemd-journal-remote is installed. (Manual) + - id: 30628 + title: "Ensure systemd-journal-remote is installed." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to install systemd-journal-remote: # dnf install systemd-journal-remote." + compliance: + - cis: ["4.2.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q systemd-journal-remote -> r:systemd-journal-remote-" + + # 4.2.2.1.2 Ensure systemd-journal-remote is configured. (Manual) - Not Implemented + # 4.2.2.1.3 Ensure systemd-journal-remote is enabled. (Manual) + - id: 30629 + title: "Ensure systemd-journal-remote is enabled." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to enable systemd-journal-remote: # systemctl --now enable systemd-journal-upload.service." + compliance: + - cis: ["4.2.2.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "CM-7", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-upload.service -> r:^enabled" + + # 4.2.2.1.4 Ensure journald is not configured to receive logs from a remote client. (Automated) + - id: 30630 + title: "Ensure journald is not configured to receive logs from a remote client." + description: "Journald supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts. NOTE: - The same package, systemd-journal-remote, is used for both sending logs to remote hosts and receiving incoming logs. - With regards to receiving logs, there are two services; systemd-journal- remote.socket and systemd-journal-remote.service." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: "Run the following command to disable systemd-journal-remote.socket: # systemctl --now mask systemd-journal-remote.socket." + compliance: + - cis: ["4.2.2.1.4"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-remote.socket -> r:^masked" + + # 4.2.2.2 Ensure journald service is enabled. (Automated) + - id: 30631 + title: "Ensure journald service is enabled." + description: "Ensure that the systemd-journald service is enabled to allow capturing of logging events." + rationale: "If the systemd-journald service is not enabled to start on boot, the system will not capture logging events." + remediation: "By default the systemd-journald service does not have an [Install] section and thus cannot be enabled / disabled. It is meant to be referenced as Requires or Wants by other unit files. As such, if the status of systemd-journald is not static, investigate why." + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journald.service -> r:^static" + + # 4.2.2.3 Ensure journald is configured to compress large log files. (Automated) + - id: 30632 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.3", "6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Compress\s*=\s*yes' + + # 4.2.2.4 Ensure journald is configured to write logfiles to persistent disk. (Automated) + - id: 30633 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss due to a reboot." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Storage=persistent' + + # 4.2.2.5 Ensure journald is not configured to send logs to rsyslog. (Manual) + - id: 30634 + title: "Ensure journald is not configured to send logs to rsyslog." + description: "Data from journald should be kept in the confines of the service and not forwarded on to other services." + rationale: "IF journald is the method for capturing logs, all logs of the system should be handled by journald and not forwarded to other logging mechanisms." + remediation: "Edit the /etc/systemd/journald.conf file and ensure that ForwardToSyslog=yes is removed. Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["4.2.2.5"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'not f:/etc/systemd/journald.conf -> r:^\s*ForwardToSyslog' + + # 4.2.2.6 Ensure journald log rotation is configured per site policy. (Manual) - Not Implemented + # 4.2.2.7 Ensure journald default file permissions configured. (Manual) - Not Implemented + # 4.2.3 Ensure permissions on all logfiles are configured. (Automated) - Not Implemented + # 4.3 Ensure logrotate is configured. (Manual) - Not Implemented + ############################################### + # 5 Access, Authentication and Authorization + ############################################### + ############################################### + # 5.1 Configure time-based job schedulers + ############################################### + # 5.1.1 Ensure cron daemon is enabled. (Automated) + - id: 30635 + title: "Ensure cron daemon is enabled." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: # systemctl --now enable crond." + compliance: + - cis: ["5.1.1"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - "c:systemctl is-enabled crond -> r:^enabled" + + # 5.1.2 Ensure permissions on /etc/crontab are configured. (Automated) + - id: 30636 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab." + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured. (Automated) + - id: 30637 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : # chown root:root /etc/cron.hourly # chmod og-rwx /etc/cron.hourly." + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured. (Automated) + - id: 30638 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily." + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured. (Automated) + - id: 30639 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : # chown root:root /etc/cron.weekly # chmod og-rwx /etc/cron.weekly." + compliance: + - cis: ["5.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured. (Automated) + - id: 30640 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly." + compliance: + - cis: ["5.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured. (Automated) + - id: 30641 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab , but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d." + compliance: + - cis: ["5.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.8 Ensure cron is restricted to authorized users. (Automated) - Not Implemented + # 5.1.9 Ensure at is restricted to authorized users. (Automated) - Not Implemented + ############################################### + # 5.2 Configure SSH Server + ############################################### + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured. (Automated) + - id: 30642 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.2.2 Ensure permissions on SSH private host key files are configured. (Automated) - Not Implemented + # 5.2.3 Ensure permissions on SSH public host key files are configured. (Automated) - Not Implemented + # 5.2.4 Ensure SSH access is limited. (Automated) + - id: 30643 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: o The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: o The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: o The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: o The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers OR AllowGroups OR DenyUsers OR DenyGroups ." + compliance: + - cis: ["5.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowUsers\s+\w*|^\s*AllowGroups\s+\w*|^\s*DenyUsers\s+\w*|^\s*DenyGroups\s+\w*' + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowUsers\s+\w*|^\s*AllowGroups\s+\w*|^\s*DenyUsers\s+\w*|^\s*DenyGroups\s+\w*' + + # 5.2.5 Ensure SSH LogLevel is appropriate. (Automated) + - id: 30644 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE OR LogLevel INFO." + references: + - "https://www.ssh.com/ssh/sshd_config/" + compliance: + - cis: ["5.2.5"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*LogLevel\s+VERBOSE|^\s*LogLevel\s+INFO' + - "f:/etc/ssh/sshd_config -> r:loglevel" + + # 5.2.6 Ensure SSH PAM is enabled. (Automated) + - id: 30645 + title: "Ensure SSH PAM is enabled." + description: 'UsePAM Enables the Pluggable Authentication Module interface. If set to "yes" this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types.' + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + impact: "If UsePAM is enabled, you will not be able to run sshd(8) as a non-root user." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes." + compliance: + - cis: ["5.2.6"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*usepam\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\sUsePAM\s+no' + + # 5.2.7 Ensure SSH root login is disabled. (Automated) + - id: 30646 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no." + compliance: + - cis: ["5.2.7"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitRootLogin\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitRootLogin\s+yes' + + # 5.2.8 Ensure SSH HostbasedAuthentication is disabled. (Automated) + - id: 30647 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no." + compliance: + - cis: ["5.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*HostbasedAuthentication\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sHostbasedAuthentication\s+yes' + + # 5.2.9 Ensure SSH PermitEmptyPasswords is disabled. (Automated) + - id: 30648 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no." + compliance: + - cis: ["5.2.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitEmptyPasswords\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitEmptyPasswords\s+yes' + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled. (Automated) + - id: 30649 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no." + compliance: + - cis: ["5.2.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitUserEnvironment\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitUserEnvironment\s+yes' + + # 5.2.11 Ensure SSH IgnoreRhosts is enabled. (Automated) + - id: 30650 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes." + compliance: + - cis: ["5.2.11"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:\s*ignorerhosts\s*yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*ignorerhosts\s+no' + + # 5.2.12 Ensure SSH X11 forwarding is disabled. (Automated) + - id: 30651 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no." + compliance: + - cis: ["5.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*X11Forwarding\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*x11forwarding\s+yes' + + # 5.2.13 Ensure SSH AllowTcpForwarding is disabled. (Automated) + - id: 30652 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments that employ mainframe systems as their application backends. In those environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no." + references: + - "https://www.ssh.com/ssh/tunneling/example" + compliance: + - cis: ["5.2.13"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*AllowTcpForwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*AllowTcpForwarding\s+yes' + + # 5.2.14 Ensure system-wide crypto policy is not over-ridden. (Automated) + - id: 30653 + title: "Ensure system-wide crypto policy is not over-ridden." + description: "System-wide Crypto policy can be over-ridden or opted out of for openSSH." + rationale: "Over-riding or opting out of the system-wide crypto policy could allow for the use of less secure Ciphers, MACs, KexAlgorithms and GSSAPIKexAlgorithm." + remediation: "Run the following commands: # sed -ri \"s/^\\s*(CRYPTO_POLICY\\s*=.*)$/# \\1/\" /etc/sysconfig/sshd # systemctl reload sshd." + compliance: + - cis: ["5.2.14"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["SC-8"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'not f:/etc/sysconfig/sshd -> r:^\s*CRYPTO_POLICY=' + + # 5.2.15 Ensure SSH warning banner is configured. (Automated) + - id: 30654 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.2.15"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*Banner\s*/\w+' + + # 5.2.16 Ensure SSH MaxAuthTries is set to 4 or less. (Automated) + - id: 30655 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4." + compliance: + - cis: ["5.2.16"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'f:/etc/ssh/sshd_config -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.2.17 Ensure SSH MaxStartups is configured. (Automated) + - id: 30656 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: maxstartups 10:30:60." + compliance: + - cis: ["5.2.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + + # 5.2.18 Ensure SSH MaxSessions is set to 10 or less. (Automated) + - id: 30657 + title: "Ensure SSH MaxSessions is set to 10 or less." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10." + compliance: + - cis: ["5.2.18"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'c:sshd -T -C user=root -> n:^\s*MaxSessions\s+(\d+) compare <= 10' + - 'not f:/etc/ssh/sshd_config -> n:^\s*MaxSessions\s+(\d+) compare > 10' + + # 5.2.19 Ensure SSH LoginGraceTime is set to one minute or less. (Automated) + - id: 30658 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60." + compliance: + - cis: ["5.2.19"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60 && n:^\s*LoginGraceTime\s*\t*(\d+) compare > 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60 && n:^\s*LoginGraceTime\s*\t*(\d+) compare > 0' + + # 5.2.20 Ensure SSH Idle Timeout Interval is configured. (Automated) + - id: 30659 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. - ClientAliveInterval sets 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 default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax sets the number of client alive messages which may be sent without sshd receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. The default value is 3. o The client alive messages are sent through the encrypted channel o Setting ClientAliveCountMax to 0 disables connection termination Example: The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value reduces this risk. - The recommended ClientAliveInterval setting is no greater than 900 seconds (15 minutes) - The recommended ClientAliveCountMax setting is 0 - At the 15 minute interval, if the ssh session is inactive, the session will be terminated." + impact: "In some cases this setting may cause termination of long-running scripts over SSH or remote automation tools which rely on SSH. In developing the local site policy, the requirements of such scripts should be considered and appropriate ServerAliveInterval and ClientAliveInterval settings should be calculated to insure operational continuity." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy. This should include ClientAliveInterval between 1 and 900 and ClientAliveCountMax of 0: ClientAliveInterval 900 ClientAliveCountMax 0." + references: + - "https://man.openbsd.org/sshd_config" + compliance: + - cis: ["5.2.20"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare > 0 && n:^\s*ClientAliveInterval\s*\t*(\d+) compare <= 900' + - 'c:sshd -T -C user=root -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare == 0' + + ############################################################ + # 5.3 Configure privilege escalation + ############################################################ + # 5.3.1 Ensure sudo is installed. (Automated) + - id: 30660 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plug-in architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plug-ins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers and any entries in /etc/sudoers.d. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo # dnf install sudo." + compliance: + - cis: ["5.3.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - "c:rpm -q sudo -> r:sudo-" + + # 5.3.2 Ensure sudo commands use pty. (Automated) + - id: 30661 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo terminal (pseudo-pty)." + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: "Edit the file /etc/sudoers with visudo or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["5.3.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s+use_pty' + - 'd:/etc/sudoers.d -> r:\. -> r:^\s*Defaults\s+use_pty' + + # 5.3.3 Ensure sudo log file exists. (Automated) + - id: 30662 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: 'Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile="" Example Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["5.3.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^Defaults logfile="' + - 'd:/etc/sudoers.d -> r:\. -> r:^Defaults\s+logfile="' + + # 5.3.4 Ensure users must provide password for escalation. (Automated) + - id: 30663 + title: "Ensure users must provide password for escalation." + description: "The operating system must be configured so that users must provide a password for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + impact: "This will prevent automated processes from being able to elevate privileges. To include Ansible and AWS builds." + remediation: "Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any line with occurrences of NOPASSWD tags in the file." + compliance: + - cis: ["5.3.4"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*# && r:NOPASSWD' + - 'd:/etc/sudoers.d -> r:\. -> !r:^\s*# && r:NOPASSWD' + + # 5.3.5 Ensure re-authentication for privilege escalation is not disabled globally. (Automated) + - id: 30664 + title: "Ensure re-authentication for privilege escalation is not disabled globally." + description: "The operating system must be configured so that users must re-authenticate for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + remediation: "Configure the operating system to require users to reauthenticate for privilege escalation. Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any occurrences of !authenticate tags in the file(s)." + compliance: + - cis: ["5.3.5"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*# && r:!authenticate' + - 'd:/etc/sudoers.d -> r:\. -> !r:^\s*# && r:!authenticate' + + # 5.3.6 Ensure sudo authentication timeout is configured correctly. (Automated) + - id: 30665 + title: "Ensure sudo authentication timeout is configured correctly." + description: "sudo caches used credentials for a default of 5 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized privileged access to another user." + remediation: "If the currently configured timeout is larger than 15 minutes, edit the file listed in the audit section with visudo -f and modify the entry timestamp_timeout= to 15 minutes or less as per your site policy. The value is in minutes. This particular entry may appear on its own, or on the same line as env_reset. See the following two examples: Defaults env_reset, timestamp_timeout=15 Defaults timestamp_timeout=15 Defaults env_reset." + references: + - "https://www.sudo.ws/man/1.9.0/sudoers.man.html" + compliance: + - cis: ["5.3.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'not f:/etc/sudoers -> !r:^\s*\t*# && r:timestamp_timeout\s*\t*=\s*\t*-1' + - 'not d:/etc/sudoers.d -> r:\.+ -> !r:^\s*\t*# && r:timestamp_timeout\s*\t*=\s*\t*-1' + - 'not f:/etc/sudoers -> !r:^\s*\t*# && n:timestamp_timeout\s*\t*=\s*\t*(\d+) compare > 15' + - 'not d:/etc/sudoers.d -> r:\.+ -> !r:^\s*\t*# && n:timestamp_timeout\s*\t*=\s*\t*(\d+) compare > 15' + + # 5.3.7 Ensure access to the su command is restricted. (Automated) + - id: 30666 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.3.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/su -> r:^auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + ############################################### + # 5.4 Configure authselect + ############################################### + # 5.4.1 Ensure custom authselect profile is used. (Manual) + - id: 30667 + title: "Ensure custom authselect profile is used." + description: "A custom profile can be created by copying and customizing one of the default profiles. The default profiles include: sssd, winbind, or the nis. This profile can then be customized to follow site specific requirements. You can select a profile for the authselect utility for a specific host. The profile will be applied to every user logging into the host." + rationale: "A custom profile is required to customize many of the pam options. When you deploy a profile, the profile is applied to every user logging into the given host." + remediation: "Run the following command to create a custom authselect profile: # authselect create-profile Example: # authselect create-profile custom-profile -b sssd --symlink-meta Run the following command to select a custom authselect profile: # authselect select custom/ {with-} Example: # authselect select custom/custom-profile with-sudo with-faillock without-nullok." + compliance: + - cis: ["5.4.1"] + - cis_csc_v8: ["16.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - iso_27001-2013: ["A.9.2.6"] + - pci_dss_v3.2.1: ["6.3.2"] + - pci_dss_v4.0: ["6.3.1"] + condition: all + rules: + - 'c:authselect list -> r:^\w*\s*custom' + - "f:/etc/authselect/authselect.conf -> r:custom" + + # 5.4.2 Ensure authselect includes with-faillock. (Automated) + - id: 30668 + title: "Ensure authselect includes with-faillock." + description: "The pam_faillock.so module maintains a list of failed authentication attempts per user during a specified interval and locks the account in case there were more than deny consecutive failed authentications. It stores the failure records into per-user files in the tally directory." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Run the following commands to include the with-faillock option to the current authselect profile: # authselect enable-feature with-faillock # authselect apply-changes." + compliance: + - cis: ["5.4.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:required && r:pam_faillock.so" + - "f:/etc/pam.d/system-auth -> r:required && r:pam_faillock.so" + + ############################################### + # 5.5 Configure PAM + ############################################### + # 5.5.1 Ensure password creation requirements are configured. (Automated) + - id: 30669 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. - minlen=14 - password must be 14 characters or more ** Either of the following can be used to enforce complex passwords:** - minclass=4 - provide at least four classes of characters for the new password OR - dcredit=-1 - provide at least one digit - ucredit=-1 - provide at least one uppercase character - ocredit=-1 - provide at least one special character - lcredit=-1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Run the following script to update the system-auth and password-auth files #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+.*enforce_for_r oot\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 enforce_for_root/' \"$file\" fi if grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=([4- 9]|[1-9][0-9]+)\\b.*$' \"$file\"; then sed -ri '/pwquality/s/retry=\\S+/retry=3/' \"$file\" elif ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 retry=3/' \"$file\" fi done authselect apply-changes." + compliance: + - cis: ["5.5.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - "f:/etc/pam.d/system-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s+\t*=\s+\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> r:^\s*minclass|^\s*\Scredit' + + # 5.5.2 Ensure lockout for failed password attempts is configured. (Automated) + - id: 30670 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. - deny= - Number of attempts before the account is locked - unlock_time= - Time in seconds before the account is unlocked Note: The maximum configurable value for unlock_time is 604800." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Set password lockouts and unlock times to conform to site policy. deny should be not greater than 5 and unlock_time should be 0 (never), or 900 seconds or greater. Depending on the version you are running, follow one of the two methods bellow. Versions 8.2 and later: Edit /etc/security/faillock.conf and update or add the following lines: deny = 5 unlock_time = 900 Versions 8.0 and 8.1: Run the following script to update the system-auth and password-auth files. This script will update/add the deny=5 and unlock_time=900 options. This script should be modified as needed to follow local site policy. #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if grep -Pq -- '^\\h*auth\\h+required\\h+pam_faillock\\.so(\\h+[^#\\n\\r]+)?\\h+deny=(0|[6-9]|[1- 9][0-9]+)\\b.*$' \"$file\"; then sed -ri '/pam_faillock.so/s/deny=\\S+/deny=5/g' \"$file\" elif ! grep -Pq -- '^\\h*auth\\h+required\\h+pam_faillock\\.so(\\h+[^#\\n\\r]+)?\\h+deny=\\d*\\b.*$' \"$file\"; then sed -r 's/^\\s*(auth\\s+required\\s+pam_faillock\\.so\\s+)([^{}#\\n\\r]+)?\\s*(\\{.*\\})?(.*)$ /\\1\\2\\3 deny=5 \\4/' $file fi if grep -P -- '^\\h*(auth\\h+required\\h+pam_faillock\\.so\\h+)([^#\\n\\r]+)?\\h+unlock_time=([1- 9]|[1-9][0-9]|[1-8][0-9][0-9])\\b.*$' \"$file\"; then sed -ri '/pam_faillock.so/s/unlock_time=\\S+/unlock_time=900/g' \"$file\" elif ! grep -Pq -- '^\\h*auth\\h+required\\h+pam_faillock\\.so(\\h+[^#\\n\\r]+)?\\h+unlock_time=\\d*\\b.*$ ' \"$file\"; then sed -ri 's/^\\s*(auth\\s+required\\s+pam_faillock\\.so\\s+)([^{}#\\n\\r]+)?\\s*(\\{.*\\})?(.*)$ /\\1\\2\\3 unlock_time=900 \\4/' \"$file\" fi done authselect apply-changes." + compliance: + - cis: ["5.5.2"] + - cis_csc_v8: ["6.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1"] + - hipaa: ["164.308(a)(3)(ii)(C)"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["AC-2(1)"] + - pci_dss_v3.2.1: ["8.1.3"] + - pci_dss_v4.0: ["8.2.4", "8.2.5"] + - soc_2: ["CC6.2", "CC6.3"] + condition: all + rules: + - 'f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:deny\s*\t*=\s*\t*(\d+) compare <= 5' + - 'not f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:unlock_time\s*\t*=\s*\t*(\d+) compare > 0 && n:unlock_time\s*\t*=\s*\t*(\d+) compare < 900' + + # 5.5.3 Ensure password reuse is limited. (Automated) + - id: 30671 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. - remember=<5> - Number of old passwords to remember." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note: These change only apply to accounts configured on the local system." + remediation: "Set remembered password history to conform to site policy. Run the following script to add or modify the pam_pwhistory.so and pam_unix.so lines to include the remember option: #!/usr/bin/env bash { file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/system-auth\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so\\s+([^# \\n\\r]+\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file elif grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?.*$' \"$file\"; then sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so/ s/$/ remember=5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/i password required pam_pwhistory.so remember=5 use_authtok' $file fi fi if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so\\s+([^#\\n\\r] +\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/ s/$/ remember=5/' $file fi fi authselect apply-changes }." + compliance: + - cis: ["5.5.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+requisite\.+pam_pwhistory\.so\.+ && n:remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so\.+ && n:remember=(\d+) compare >= 5' + + # 5.5.4 Ensure password hashing algorithm is SHA-512. (Automated) + - id: 30672 + title: "Ensure password hashing algorithm is SHA-512." + description: "A cryptographic hash function converts an arbitrary-length input into a fixed length output. Password hashing performs a one-way transformation of a password, turning the password into another string, called the hashed password." + rationale: "The SHA-512 algorithm provides stronger hashing than other hashing algorithms used for password hashing with Linux, providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note: These changes only apply to accounts configured on the local system." + remediation: "Set password hashing algorithm to sha512. Edit /etc/libuser.conf and edit of add the following line: crypt_style = sha512 Edit /etc/login.defs and edit or add the following line: ENCRYPT_METHOD SHA512 Run the following script to configure pam_unix.so to use the sha512 hashing algorithm: #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+sha512\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+(md5|blowfish|bigcrypt|sha256)\\b.*$' \"$file\"; then sed -ri 's/(md5|blowfish|bigcrypt|sha256)/sha512/' \"$file\" else sed -ri 's/(^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix.so\\s+)(.*)$/\\1s ha512 \\3/' $file fi fi done authselect apply-changes Note: This only effects local users and passwords created after updating the files to use sha512. If it is determined that the password algorithm being used is not SHA-512, once it is changed, it is recommended that all user ID's be immediately expired and forced to change their passwords on next login." + compliance: + - cis: ["5.5.4"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/libuser.conf -> r:^\s*\t*crypt_style\s*\t*=\s*\t*sha512' + - 'f:/etc/login.defs -> r:^\s*\t*ENCRYPT_METHOD SHA512' + - 'f:/etc/pam.d/password-auth -> r:^\s*\t*password\.+sufficient\.+pam_unix\.so' + - 'f:/etc/pam.d/system-auth -> r:^\s*\t*password\.+sufficient\.+pam_unix\.so' + + ############################################### + # 5.6 User Accounts and Environment + ############################################### + ############################################### + # 5.6.1 Set Shadow Password Suite Parameters + ############################################### + # 5.6.1.1 Ensure password expiration is 365 days or less. (Automated) + - id: 30673 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + compliance: + - cis: ["5.6.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:(\d+):\S*:\S*:\S*:\S* compare > 365' + + # 5.6.1.2 Ensure minimum days between password changes is 7 or more. (Automated) + - id: 30674 + title: "Ensure minimum days between password changes is 7 or more." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs : PASS_MIN_DAYS 7 Modify user parameters for all users with a password set to match: # chage --mindays 7 ." + compliance: + - cis: ["5.6.1.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + - 'not f:/etc/shadow -> n:^\w+:\S*:\S*:(\d+):\S*:\S*:\S*:\S*:\S* compare < 7' + - 'not f:/etc/shadow -> r:^\w+:\S*:\S*::\S*:\S*:\S*:\S*:\S*' + + # 5.6.1.3 Ensure password expiration warning days is 7 or more. (Automated) + - id: 30675 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs : PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["5.6.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + - 'f:/etc/shadow -> n:^\w+:\S*:\S*:\S*:\S*:(\d+):\S*:\S*:\S* compare >= 7' + - 'not f:/etc/shadow -> r:^\w+:\S*:\S*:\S*:\S*::\S*:\S*:\S*' + + # 5.6.1.4 Ensure inactive password lock is 30 days or less. (Automated) + - id: 30676 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["5.6.1.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*\t*(\d+) compare <= 30' + - 'f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:\S*:\S*:(\d+):\S*:\S* compare <= 30' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && r:^\w+:\S*:\S*:\S*:\S*:\S*::\S*:\S*' + + # 5.6.1.5 Ensure all users last password change date is in the past. (Automated) - Not Implemented + # 5.6.2 Ensure system accounts are secured. (Automated) - Not Implemented + # 5.6.3 Ensure default user shell timeout is 900 seconds or less. (Automated) - Not Implemented + # 5.6.4 Ensure default group for the root account is GID 0. (Automated) + - id: 30677 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root account belongs to. This affects permissions of files that are created by the root account." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root account default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.6.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/passwd -> r:^root:x:0:0" + + # 5.6.5 Ensure default user umask is 027 or more restrictive. (Automated) - Not Implemented + ############################################### + # 6 System Maintenance + ############################################### + ############################################### + # 6.1 System File Permissions + ############################################### + # 6.1.1 Audit system file permissions. (Manual) - Not Implemented + # 6.1.2 Ensure sticky bit is set on all world-writable directories. (Automated) - Not Implemented + # 6.1.3 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 30678 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.4 Ensure permissions on /etc/shadow are configured. (Automated) + - id: 30679 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following commands to set owner, group, and permissions on /etc/shadow: # chown root:root /etc/shadow # chmod 0000 /etc/shadow." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.5 Ensure permissions on /etc/group are configured. (Automated) + - id: 30680 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following commands to set owner, group, and permissions on /etc/group: # chown root:root /etc/group # chmod u-x,g-wx,o-wx /etc/group." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.6 Ensure permissions on /etc/gshadow are configured. (Automated) + - id: 30681 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run the following commands to set owner, group, and permissions on /etc/gshadow # chown root:root /etc/gshadow # chmod 0000 /etc/gshadow." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.7 Ensure permissions on /etc/passwd- are configured. (Automated) + - id: 30682 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod chmod u-x,go-wx /etc/passwd-." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.8 Ensure permissions on /etc/shadow- are configured. (Automated) + - id: 30683 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/shadow- : # chown root:root /etc/shadow- # chmod 0000 /etc/shadow-." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.9 Ensure permissions on /etc/group- are configured. (Automated) + - id: 30684 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/group-: # chown root:root /etc/group- # chmod u-x,go-wx /etc/group-." + compliance: + - cis: ["6.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0644/-rw-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.10 Ensure permissions on /etc/gshadow- are configured. (Automated) + - id: 30685 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set owner, group, and permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chmod 0000 /etc/gshadow-." + compliance: + - cis: ["6.1.10"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.11 Ensure no world writable files exist. (Automated) - Not Implemented + # 6.1.12 Ensure no unowned files or directories exist. (Automated) - Not Implemented + # 6.1.13 Ensure no ungrouped files or directories exist. (Automated) - Not Implemented + # 6.1.14 Audit SUID executables. (Manual) - Not Implemented + # 6.1.15 Audit SGID executables. (Manual) - Not Implemented + ################################################ + # 6.2 User and Group Settings + ################################################ + # 6.2.1 Ensure password fields are not empty. (Automated) + - id: 30686 + title: "Ensure password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> !r:^# && r:^\w+::' + + # 6.2.2 Ensure all groups in /etc/passwd exist in /etc/group. (Automated) - Not Implemented + # 6.2.3 Ensure no duplicate UIDs exist. (Automated) - Not Implemented + # 6.2.4 Ensure no duplicate GIDs exist. (Automated) - Not Implemented + # 6.2.5 Ensure no duplicate user names exist. (Automated) - Not Implemented + # 6.2.6 Ensure no duplicate group names exist. (Automated) - Not Implemented + # 6.2.7 Ensure root PATH Integrity. (Automated) - Not Implemented + # 6.2.8 Ensure root is the only UID 0 account. (Automated) + - id: 30687 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: 'This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in recommendation "Ensure access to the su command is restricted".' + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^\s*root && n:^\w+:\S*:(\d+):\S*:\S*:\S*:\S* compare == 0' + + # 6.2.9 Ensure all users' home directories exist. (Automated) - Not Implemented + # 6.2.10 Ensure users own their home directories. (Automated) - Not Implemented + # 6.2.11 Ensure users' home directories permissions are 750 or more restrictive. (Automated) - Not Implemented + # 6.2.12 Ensure users' dot files are not group or world writable. (Automated) - Not Implemented + # 6.2.13 Ensure users' .netrc Files are not group or world accessible. (Automated) - Not Implemented + # 6.2.14 Ensure no users have .forward files. (Automated) - Not Implemented + # 6.2.15 Ensure no users have .netrc files. (Automated) - Not Implemented + # 6.2.16 Ensure no users have .rhosts files. (Automated) - Not Implemented diff --git a/etc/ruleset/sca/rocky/cis_rocky_linux_9.yml b/etc/ruleset/sca/rocky/cis_rocky_linux_9.yml new file mode 100644 index 0000000000..2ce971b06c --- /dev/null +++ b/etc/ruleset/sca/rocky/cis_rocky_linux_9.yml @@ -0,0 +1,4129 @@ +# Security Configuration Assessment +# CIS Checks for Rocky Linux 9 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Rocky Linux 9 Benchmark v1.0.0 - 03-29-2022 + +policy: + id: "cis_rocky_linux_9" + file: "cis_rocky_linux_9.yml" + name: "CIS Rocky Linux 9 Benchmark v1.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Rocky Linux 9 systems running on x86_64 platforms.This document was tested against Rocky Linux 9." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check RL9 family platform." + description: "Requirements for running the policy against Rocky Linux 9 family." + condition: any + rules: + - 'f:/etc/redhat-release -> r:^Rocky Linux && r:release 9\p*' + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # 1.1.1.1 Ensure mounting of squashfs filesystems is disabled. (Automated) + - id: 31500 + title: "Ensure mounting of squashfs filesystems is disabled." + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: 'As Snap packages utilizes squashfs as a compressed filesystem, disabling squashfs will cause Snap packages to fail. Snap application packages of software are self-contained and work across a range of Linux distributions. This is unlike traditional Linux package management approaches, like APT or RPM, which require specifically adapted packages per Linux distribution on an application update and delay therefore application deployment from developers to their software''s end-user. Snaps themselves have no dependency on any external store ("App store"), can be obtained from any source and can be therefore used for upstream software deployment.' + remediation: "Run the following script to disable squashfs: #!/usr/bin/env bash { l_mname=\"squashfs\" # set module name # Check if the module exists on the system if [ -z \"$(modprobe -n -v \"$l_mname\" 2>&1 | grep -Pi -- \"\\h*modprobe:\\h+FATAL:\\h+Module\\h+$l_mname\\h+not\\h+found\\h+in\\h+directory\")\" ]; then # Remediate loadable l_loadable=\"$(modprobe -n -v \"$l_mname\")\" [ \"$(wc -l <<< \"$l_loadable\")\" -gt \"1\" ] && l_loadable=\"$(grep -P -- \"(^\\h*install|\\b$l_mname)\\b\" <<< \"$l_loadable\")\" if ! grep -Pq -- '^\\h*install \\/bin\\/(true|false)' <<< \"$l_loadable\"; then echo -e \" - setting module: \\\"$l_mname\\\" to be not loadable\" echo -e \"install $l_mname /bin/false\" >> /etc/modprobe.d/\"$l_mname\".conf fi # Remediate loaded if lsmod | grep \"$l_mname\" > /dev/null 2>&1; then echo -e \" - unloading module \\\"$l_mname\\\"\" modprobe -r \"$l_mname\" fi # Remediate deny list if ! modprobe --showconfig | grep -Pq -- \"^\\h*blacklist\\h+$l_mname\\b\"; then echo -e \" - deny listing \\\"$l_mname\\\"\" echo -e \"blacklist $l_mname\" >> /etc/modprobe.d/\"$l_mname\".conf fi else echo -e \" - Nothing to remediate\\n - Module \\\"$l_mname\\\" doesn't exist on the system\" fi }." + compliance: + - cis: ["1.1.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1050"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1005"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/false|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + - 'd:/etc/modprobe.d/ -> r:\.*.conf -> r:^blacklist\s+squashfs' + + # 1.1.1.2 Ensure mounting of udf filesystems is disabled. (Automated) + - id: 31501 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + impact: "Microsoft Azure requires the usage of udf. udf should not be disabled on systems run on Microsoft Azure." + remediation: "Run the following script to disable the udf filesystem: #!/usr/bin/env bash { l_mname=\"udf\" # set module name # Check if the module exists on the system if [ -z \"$(modprobe -n -v \"$l_mname\" 2>&1 | grep -Pi -- \"\\h*modprobe:\\h+FATAL:\\h+Module\\h+$l_mname\\h+not\\h+found\\h+in\\h+directory\")\" ]; then # Remediate loadable l_loadable=\"$(modprobe -n -v \"$l_mname\")\" [ \"$(wc -l <<< \"$l_loadable\")\" -gt \"1\" ] && l_loadable=\"$(grep -P -- \"(^\\h*install|\\b$l_mname)\\b\" <<< \"$l_loadable\")\" if ! grep -Pq -- '^\\h*install \\/bin\\/(true|false)' <<< \"$l_loadable\"; then echo -e \" - setting module: \\\"$l_mname\\\" to be not loadable\" echo -e \"install $l_mname /bin/false\" >> /etc/modprobe.d/\"$l_mname\".conf fi # Remediate loaded if lsmod | grep \"$l_mname\" > /dev/null 2>&1; then echo -e \" - unloading module \\\"$l_mname\\\"\" modprobe -r \"$l_mname\" fi # Remediate deny list if ! modprobe --showconfig | grep -Pq -- \"^\\h*blacklist\\h+$l_mname\\b\"; then echo -e \" - deny listing \\\"$l_mname\\\"\" echo -e \"blacklist $l_mname\" >> /etc/modprobe.d/\"$l_mname\".conf fi else echo -e \" - Nothing to remediate\\n - Module \\\"$l_mname\\\" doesn't exist on the system\" fi }." + compliance: + - cis: ["1.1.1.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1050"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1005"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:modprobe -n -v udf -> r:install /bin/false|Module udf not found" + - "not c:lsmod -> r:udf" + - 'd:/etc/modprobe.d/ -> r:\.*.conf -> r:^blacklist\s+udf' + + # 1.1.2.1 Ensure /tmp is a separate partition. (Automated) + - id: 31502 + title: "Ensure /tmp is a separate partition." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "By design files saved to /tmp should have no expectation of surviving a reboot of the system. tmpfs is ram based and all files stored to tmpfs will be lost when the system is rebooted. If files need to be persistent through a reboot, they should be saved to /var/tmp not /tmp. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a configuration where /tmp is not a separate file system it will essentially have the whole disk available, as the default installation only creates a single / partition. On the other hand, a RAM-based /tmp (as with tmpfs) will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily. Another alternative is to create a dedicated partition for /tmp from a separate volume or disk. One of the downsides of a disk-based dedicated partition is that it will be slower than tmpfs which is RAM-based." + remediation: "First ensure that systemd is correctly configured to ensure that /tmp will be mounted at boot time. # systemctl unmask tmp.mount For specific configuration requirements of the /tmp mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs /tmp 0 tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 Example of using a volume or disk with specific mount options. The source location of the volume or disk will vary depending on your environment. /tmp defaults,nodev,nosuid,noexec 0 0." + references: + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + - "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html" + compliance: + - cis: ["1.1.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:^/tmp\s' + - "c:systemctl is-enabled tmp.mount -> r:enabled|static|generated" + + # 1.1.2.2 Ensure nodev option set on /tmp partition. (Automated) + - id: 31503 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nodev" + + # 1.1.2.3 Ensure noexec option set on /tmp partition. (Automated) + - id: 31504 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:noexec" + + # 1.1.2.4 Ensure nosuid option set on /tmp partition. (Automated) + - id: 31505 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nosuid" + + ############################################### + # 1.1.3 Configure /var + ############################################### + + # 1.1.3.1 Ensure separate partition exists for /var. (Automated) + - id: 31506 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "The reasoning for mounting /var on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:^/var\s' + + # 1.1.3.2 Ensure nodev option set on /var partition. (Automated) + - id: 31507 + title: "Ensure nodev option set on /var partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:nodev" + + # 1.1.3.3 Ensure nosuid option set on /var partition. (Automated) + - id: 31508 + title: "Ensure nosuid option set on /var partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nosuid" + + ############################################### + # 1.1.4 Configure /var/tmp + ############################################### + + # 1.1.4.1 Ensure separate partition exists for /var/tmp. (Automated) + - id: 31509 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications. Temporary files residing in /var/tmp are to be preserved between reboots." + rationale: "The reasoning for mounting /var/tmp on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/tmp directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/tmp and cause potential disruption to daemons as the disk is full. Fine grained control over the mount Configuring /var/tmp as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var/tmp may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:^/var/tmp\s' + + # 1.1.4.2 Ensure noexec option set on /var/tmp partition. (Automated) + - id: 31510 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:noexec" + + # 1.1.4.3 Ensure nosuid option set on /var/tmp partition. (Automated) + - id: 31511 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nosuid" + + # 1.1.4.4 Ensure nodev option set on /var/tmp partition. (Automated) + - id: 31512 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nodev" + + ############################################### + # 1.1.5 Configure /var/log + ############################################### + + # 1.1.5.1 Ensure separate partition exists for /var/log. (Automated) + - id: 31513 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "The reasoning for mounting /var/log on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log directory contains log files which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. Fine grained control over the mount Configuring /var/log as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of log data As /var/log contains log files, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.5.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_techniques: ["T0005", "T1499", "T1499.001"] + - pci_dss_3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:^/var/log\s' + + # 1.1.5.2 Ensure nodev option set on /var/log partition. (Automated) + - id: 31514 + title: "Ensure nodev option set on /var/log partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:nodev" + + # 1.1.5.3 Ensure noexec option set on /var/log partition. (Automated) + - id: 31515 + title: "Ensure noexec option set on /var/log partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot run executable binaries from /var/log." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:noexec" + + # 1.1.5.4 Ensure nosuid option set on /var/log partition. (Automated) + - id: 31516 + title: "Ensure nosuid option set on /var/log partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot create setuid files in /var/log." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log -> r:nosuid" + + ############################################### + # 1.1.6 Configure /var/log/audit + ############################################### + + # 1.1.6.1 Ensure separate partition exists for /var/log/audit. (Automated) + - id: 31517 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "The reasoning for mounting /var/log/audit on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log/audit directory contains the audit.log file which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/log/audit and cause auditd to trigger it's space_left_action as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var/log/audit as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of audit data As /var/log/audit contains audit logs, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.6.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - pci_dss_3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:^/var/log/audit\s' + + # 1.1.6.2 Ensure noexec option set on /var/log/audit partition. (Automated) + - id: 31518 + title: "Ensure noexec option set on /var/log/audit partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log/audit filesystem is only intended for audit logs, set this option to ensure that users cannot run executable binaries from /var/log/audit." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:noexec" + + # 1.1.6.3 Ensure nodev option set on /var/log/audit partition. (Automated) + - id: 31519 + title: "Ensure nodev option set on /var/log/audit partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log/audit filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:nodev" + + # 1.1.6.4 Ensure nosuid option set on /var/log/audit partition. (Automated) + - id: 31520 + title: "Ensure nosuid option set on /var/log/audit partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log/audit filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var/log/audit." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/log/audit -> r:nosuid" + + ############################################### + # 1.1.7 Configure /home + ############################################### + + # 1.1.7.1 Ensure separate partition exists for /home. (Automated) + - id: 31521 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "The reasoning for mounting /home on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /home directory contains user generated data, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /home and impact all local users. Fine grained control over the mount Configuring /home as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limit an attacker's ability to create exploits on the system. In the case of /home options such as usrquota/grpquota may be considered to limit the impact that users can have on each other with regards to disk resource exhaustion. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of user data As /home contains user data, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.7.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:^/home\s' + + # 1.1.7.2 Ensure nodev option set on /home partition. (Automated) + - id: 31522 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /home filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:nodev" + + # 1.1.7.3 Ensure nosuid option set on /home partition. (Automated) + - id: 31523 + title: "Ensure nosuid option set on /home partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /home filesystem is only intended for user file storage, set this option to ensure that users cannot create setuid files in /home." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /home -> r:nosuid" + + ############################################### + # 1.1.8 Configure /dev/shm + ############################################### + + # 1.1.8.1 Ensure /dev/shm is a separate partition. (Automated) + - id: 31524 + title: "Ensure /dev/shm is a separate partition." + description: "The /dev/shm directory is a world-writable directory that can function as shared memory that facilitates inter process communication (IPC)." + rationale: "Making /dev/shm its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /dev/shm useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by mounting tmpfs to /dev/shm." + impact: "Since the /dev/shm directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. /dev/shm utilizing tmpfs can be resized using the size={size} parameter in the relevant entry in /etc/fstab." + remediation: "For specific configuration requirements of the /dev/shm mount for your environment, modify /etc/fstab. Example of using tmpfs with specific mount options: tmpfs /dev/shm defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 0 tmpfs." + references: + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + - "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html" + compliance: + - cis: ["1.1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + + # 1.1.8.2 Ensure nodev option set on /dev/shm partition. (Automated) + - id: 31525 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + - "c:findmnt --kernel /dev/shm -> r:nodev" + + # 1.1.8.3 Ensure noexec option set on /dev/shm partition. (Automated) + - id: 31526 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Example: /dev/shm defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm NOTE It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + - "c:findmnt --kernel /dev/shm -> r:noexec" + + # 1.1.8.4 Ensure nosuid option set on /dev/shm partition. (Automated) + - id: 31527 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:^/dev/shm\s' + - "c:findmnt --kernel /dev/shm -> r:nosuid" + + # 1.1.9 Disable USB Storage. (Automated) + - id: 31528 + title: "Disable USB Storage." + description: "USB storage provides a means to transfer and store files ensuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Run the following script to disable usb-storage: #!/usr/bin/env bash { l_mname=\"usb-storage\" # set module name # Check if the module exists on the system if [ -z \"$(modprobe -n -v \"$l_mname\" 2>&1 | grep -Pi -- \"\\h*modprobe:\\h+FATAL:\\h+Module\\h+$l_mname\\h+not\\h+found\\h+in\\h+directory\")\" ]; then # Remediate loadable l_loadable=\"$(modprobe -n -v \"$l_mname\")\" [ \"$(wc -l <<< \"$l_loadable\")\" -gt \"1\" ] && l_loadable=\"$(grep -P -- \"(^\\h*install|\\b$l_mname)\\b\" <<< \"$l_loadable\")\" if ! grep -Pq -- '^\\h*install \\/bin\\/(true|false)' <<< \"$l_loadable\"; then echo -e \" - setting module: \\\"$l_mname\\\" to be not loadable\" echo -e \"install $l_mname /bin/false\" >> /etc/modprobe.d/\"$l_mname\".conf fi # Remediate loaded if lsmod | grep \"$l_mname\" > /dev/null 2>&1; then echo -e \" - unloading module \\\"$l_mname\\\"\" modprobe -r \"$l_mname\" fi # Remediate deny list if ! modprobe --showconfig | grep -Pq -- \"^\\h*blacklist\\h+$(tr '-' '_' <<< \"$l_mname\")\\b\"; then echo -e \" - deny listing \\\"$l_mname\\\"\" echo -e \"blacklist $l_mname\" >> /etc/modprobe.d/\"$l_mname\".conf fi else echo -e \" - Nothing to remediate\\n - Module \\\"$l_mname\\\" doesn't exist on the system\" fi }." + compliance: + - cis: ["1.1.9"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["13.7"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.8.3.1"] + - mitre_mitigations: ["M1034"] + - mitre_tactics: ["TA0001", "TA0010"] + - mitre_techniques: ["T1091"] + - nist_sp_800-53: ["SC-18(4)"] + condition: all + rules: + - "c:modprobe -n -v usb-storage -> r:install /bin/true" + - "not c:lsmod -> r:usb-storage" + + ############################################### + # 1.2 Configure Software Updates + ############################################### + + # 1.2.1 Ensure GPG keys are configured. (Manual) - Not Implemented + + # 1.2.2 Ensure gpgcheck is globally activated. (Automated) + - id: 31529 + title: "Ensure gpgcheck is globally activated." + description: "The gpgcheck option, found in the main section of the /etc/dnf/dnf.conf and individual /etc/yum.repos.d/* files, determines if an RPM package's signature is checked prior to its installation." + rationale: "It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source." + remediation: "Edit /etc/dnf/dnf.conf and set gpgcheck=1 in the [main] section. Example: # sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' /etc/dnf/dnf.conf Edit any failing files in /etc/yum.repos.d/* and set all instances starting with gpgcheck to 1. Example: # find /etc/yum.repos.d/ -name \"*.repo\" -exec echo \"Checking:\" {} \\; -exec sed -i 's/^gpgcheck\\s*=\\s*.*/gpgcheck=1/' {} \\;." + compliance: + - cis: ["1.2.2"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1195", "T1195.001"] + - nist_sp_800-53: ["SI-2"] + - pci_dss_3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'f:/etc/dnf/dnf.conf -> r:^\s*gpgcheck\s*=\s*1' + - 'not c:grep -Rh ^gpgcheck /etc/yum.repos.d/ -> r:gpgcheck\s*=\s*0' + + # 1.2.3 Ensure package manager repositories are configured. (Manual) - Not Implemented + # 1.2.4 Ensure repo_gpgcheck is globally activated. (Manual) - Not Implemented + + ############################################### + # 1.3 Filesystem Integrity Checking + ############################################### + + # 1.3.1 Ensure AIDE is installed. (Automated) + - id: 31530 + title: "Ensure AIDE is installed." + description: "Advanced Intrusion Detection Environment (AIDE) is a intrusion detection tool that uses predefined rules to check the integrity of files and directories in the Linux operating system. AIDE has its own database to check the integrity of files and directories. AIDE takes a snapshot of files and directories including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # dnf install aide Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: Run the following commands: # aide --init # mv /var/lib/aide/aide.db.new.gz /var/lib/aide/aide.db.gz." + references: + - "http://aide.sourceforge.net/stable/manual.html" + compliance: + - cis: ["1.3.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1565", "T1565.001"] + - nist_sp_800-53: ["AU-2"] + - pci_dss_3.2.1: ["10.2.1", "11.5"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:rpm -q aide -> r:aide-" + + # 1.3.2 Ensure filesystem integrity is regularly checked. (Automated) + - id: 31531 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/sbin/aide --check OR if aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/sbin/aide --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + references: + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service" + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer" + compliance: + - cis: ["1.3.2"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1036", "T1036.005"] + - nist_sp_800-53: ["AU-2"] + - pci_dss_3.2.1: ["10.2.1", "11.5"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:systemctl is-enabled aidecheck.service -> r:enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:enabled" + - "c:systemctl status aidecheck.timer -> r:active" + + # 1.3.3 Ensure cryptographic mechanisms are used to protect the integrity of audit tools. (Automated) + - id: 31532 + title: "Ensure cryptographic mechanisms are used to protect the integrity of audit tools." + description: "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." + rationale: "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. Attackers may replace the audit tools or inject code into the existing tools with the purpose of providing the capability to hide or erase system activity from the audit logs. Audit tools should be cryptographically signed in order 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." + remediation: "Add or update the following selection lines for to a file ending in .conf in the /etc/aide.conf.d/ directory or to /etc/aide.conf to protect the integrity of the audit tools: # Audit Tools /sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512." + compliance: + - cis: ["1.3.3"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + condition: all + rules: + - "f:/etc/aide/aide.conf" + - 'f:/etc/aide/aide.conf -> r:/sbin/auditctl\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/auditd\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/ausearch\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/aureport\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/autrace\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/augenrules\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + + ############################################### + # 1.4 Secure Boot Settings + ############################################### + # 1.4.1 Ensure bootloader password is set. (Automated) - Not Implemented + # 1.4.2 Ensure permissions on bootloader config are configured. (Automated) - Not Implemented + + ############################################### + # 1.5 Additional Process Hardening + ############################################### + + # 1.5.1 Ensure core dump storage is disabled. (Automated) + - id: 31533 + title: "Ensure core dump storage is disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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." + remediation: "Edit /etc/systemd/coredump.conf and edit or add the following line: Storage=none." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1005"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*Storage\s*=\s*none' + + # 1.5.2 Ensure core dump backtraces are disabled. (Automated) + - id: 31534 + title: "Ensure core dump backtraces are disabled." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file." + rationale: "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, increasing the risk to the system." + remediation: "Edit or add the following line in /etc/systemd/coredump.conf: ProcessSizeMax=0." + references: + - "https://www.freedesktop.org/software/systemd/man/coredump.conf.html" + compliance: + - cis: ["1.5.2"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1005"] + - nist_sp_800-53: ["CM-6b"] + condition: all + rules: + - 'f:/etc/systemd/coredump.conf -> r:^\s*ProcessSizeMax\s*=\s*0' + + # 1.5.3 Ensure address space layout randomization (ASLR) is enabled. (Automated) - Not Implemented + + ############################################### + # 1.6 Mandatory Access Control + ############################################### + ############################################### + # 1.6.1 Configure SELinux + ############################################### + + # 1.6.1.1 Ensure SELinux is installed. (Automated) + - id: 31535 + title: "Ensure SELinux is installed." + description: "SELinux provides Mandatory Access Control." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run the following command to install SELinux: # dnf install libselinux." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1068"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:rpm -q libselinux -> r:^libselinux-" + + # 1.6.1.2 Ensure SELinux is not disabled in bootloader configuration. (Automated) + - id: 31536 + title: "Ensure SELinux is not disabled in bootloader configuration." + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + impact: "Files created while SELinux is disabled are not labeled at all. This behavior causes problems when changing to enforcing mode because files are labeled incorrectly or are not labeled at all. To prevent incorrectly labeled and unlabeled files from causing problems, file systems are automatically relabeled when changing from the disabled state to permissive or enforcing mode. This can be a long running process that should be accounted for as it may extend downtime during initial re-boot." + remediation: "Run the following command to remove the selinux=0 and enforcing=0 parameters: grubby --update-kernel ALL --remove-args \"selinux=0 enforcing=0\" Run the following command to remove the selinux=0 and enforcing=0 parameters if they were created by the deprecated grub2-mkconfig command: # grep -Prsq -- '\\h*([^#\\n\\r]+\\h+)?kernelopts=([^#\\n\\r]+\\h+)?(selinux|enforcing)=0\\b' /boot/grub2 /boot/efi && grub2-mkconfig -o \"$(grep -Prl -- '\\h*([^#\\n\\r]+\\h+)?kernelopts=([^#\\n\\r]+\\h+)?(selinux|enforcing)=0\\b' /boot/grub2 /boot/efi)\"." + compliance: + - cis: ["1.6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1068"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'f:/boot/grub2/grubenv -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + - 'f:/boot/grub2/grub.cfg -> r:kernelopts=\.*selinux=0|kernelopts=\.*enforcing=0' + + # 1.6.1.3 Ensure SELinux policy is configured. (Automated) + - id: 31537 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=targeted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1068"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+targeted$|^Loaded policy name:\s+mls$' + - 'f:/etc/selinux/config -> r:^\s*SELINUXTYPE\s*=\s*targeted|^\s*SELINUXTYPE\s*=\s*mls' + + # 1.6.1.4 Ensure the SELinux mode is not disabled. (Automated) + - id: 31538 + title: "Ensure the SELinux mode is not disabled." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future." + remediation: "Run one of the following commands to set SELinux's running mode: To set SELinux mode to Enforcing: # setenforce 1 OR To set SELinux mode to Permissive: # setenforce 0 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing OR For Permissive mode: SELINUX=permissive." + references: + - "https://access.redhat.com/documentation/en-" + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$|^Permissive$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing|\s*SELINUX\s*=\s*permissive' + + # 1.6.1.5 Ensure the SELinux mode is enforcing. (Automated) + - id: 31539 + title: "Ensure the SELinux mode is enforcing." + description: "SELinux can run in one of three modes: disabled, permissive, or enforcing: - Enforcing - Is the default, and recommended, mode of operation; in enforcing mode SELinux operates normally, enforcing the loaded security policy on the entire system. - Permissive - The system acts as if SELinux is enforcing the loaded security policy, including labeling objects and emitting access denial entries in the logs, but it does not actually deny any operations. While not recommended for production systems, permissive mode can be helpful for SELinux policy development. - Disabled - Is strongly discouraged; not only does the system avoid enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future Note: you can set individual domains to permissive mode while the system runs in enforcing mode. For example, to make the httpd_t domain permissive: # semanage permissive -a httpd_t." + rationale: "Running SELinux in disabled mode the system not only avoids enforcing the SELinux policy, it also avoids labeling any persistent objects such as files, making it difficult to enable SELinux in the future. Running SELinux in Permissive mode, though helpful for developing SELinux policy, only logs access denial entries, but does not deny any operations." + remediation: "Run the following command to set SELinux's running mode: # setenforce 1 Edit the /etc/selinux/config file to set the SELINUX parameter: For Enforcing mode: SELINUX=enforcing." + references: + - "https://access.redhat.com/documentation/en-" + compliance: + - cis: ["1.6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:getenforce -> r:^Enforcing$" + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + # 1.6.1.6 Ensure no unconfined services exist. (Automated) + - id: 31540 + title: "Ensure no unconfined services exist." + description: "Unconfined processes run in unconfined domains." + rationale: "For unconfined processes, SELinux policy rules are applied, but policy rules exist that allow processes running in unconfined domains almost all access. Processes running in unconfined domains fall back to using DAC rules exclusively. If an unconfined process is compromised, SELinux does not prevent an attacker from gaining access to system resources and data, but of course, DAC rules are still used. SELinux is a security enhancement on top of DAC rules - it does not replace them." + remediation: "Investigate any unconfined processes found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:ps -eZ -> r:unconfined_service_t" + + # 1.6.1.7 Ensure SETroubleshoot is not installed. (Automated) + - id: 31541 + title: "Ensure SETroubleshoot is not installed." + description: "The SETroubleshoot service notifies desktop users of SELinux denials through a user-friendly interface. The service provides important information around configuration errors, unauthorized intrusions, and other potential errors." + rationale: "The SETroubleshoot service is an unnecessary daemon to have running on a server, especially if X Windows is disabled." + remediation: "Run the following command to uninstall setroubleshoot: # dnf remove setroubleshoot." + compliance: + - cis: ["1.6.1.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1543", "T1543.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -qa setroubleshoot -> r:setroubleshoot" + + # 1.6.1.8 Ensure the MCS Translation Service (mcstrans) is not installed. (Automated) + - id: 31542 + title: "Ensure the MCS Translation Service (mcstrans) is not installed." + description: "The mcstransd daemon provides category label information to client processes requesting information. The label translations are defined in /etc/selinux/targeted/setrans.conf." + rationale: "Since this service is not used very often, remove it to reduce the amount of potentially vulnerable code running on the system." + remediation: "Run the following command to uninstall mcstrans: # dnf remove mcstrans." + compliance: + - cis: ["1.6.1.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1543", "T1543.002"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - "c:rpm -qa mcstrans -> r:mcstrans" + + ############################################### + # 1.7 Command Line Warning Banners + ############################################### + + # 1.7.1 Ensure message of the day is configured properly. (Automated) + - id: 31543 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s|rocky' + + # 1.7.2 Ensure local login warning banner is configured properly. (Automated) + - id: 31544 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.7.2"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|rocky' + + # 1.7.3 Ensure remote login warning banner is configured properly. (Automated) + - id: 31545 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1018", "T1082", "T1592", "T1592.004"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|rocky' + + # 1.7.4 Ensure permissions on /etc/motd are configured. (Automated) + - id: 31546 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd : # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.5 Ensure permissions on /etc/issue are configured. (Automated) + - id: 31547 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue : # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured. (Automated) + - id: 31548 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + ############################################### + # 1.8 GNOME Display Manager + ############################################### + + # 1.8.1 Ensure GNOME Display Manager is removed. (Automated) + - id: 31549 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + impact: "Removing the GNOME Display manager will remove the Graphical User Interface (GUI) from the system." + remediation: "Run the following command to remove the gdm package # dnf remove gdm." + references: + - "https://wiki.gnome.org/Projects/GDM" + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1543", "T1543.002"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q gdm -> r:is not installed" + + # 1.8.2 Ensure GDM login banner is configured. (Automated) + - id: 31550 + title: "Ensure GDM login banner is configured." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Run the following script to verify that the banner message is enabled and set: #!/usr/bin/env bash { l_pkgoutput=\"\" if command -v dpkg-query > /dev/null 2>&1; then l_pq=\"dpkg-query -W\" elif command -v rpm > /dev/null 2>&1; then l_pq=\"rpm -q\" fi l_pcl=\"gdm gdm3\" # Space seporated list of packages to check for l_pn in $l_pcl; do $l_pq \"$l_pn\" > /dev/null 2>&1 && l_pkgoutput=\"$l_pkgoutput\\n - Package: \\\"$l_pn\\\" exists on the system\\n - checking configuration\" done if [ -n \"$l_pkgoutput\" ]; then l_gdmprofile=\"gdm\" # Set this to desired profile name IaW Local site policy l_bmessage=\"'Authorized uses only. All activity may be monitored and reported'\" # Set to desired banner message if [ ! -f \"/etc/dconf/profile/$l_gdmprofile\" ]; then echo \"Creating profile \\\"$l_gdmprofile\\\"\" echo -e \"user-db:user\\nsystem-db:$l_gdmprofile\\nfile- db:/usr/share/$l_gdmprofile/greeter-dconf-defaults\" > /etc/dconf/profile/$l_gdmprofile fi if [ ! -d \"/etc/dconf/db/$l_gdmprofile.d/\" ]; then echo \"Creating dconf database directory \\\"/etc/dconf/db/$l_gdmprofile.d/\\\"\" mkdir /etc/dconf/db/$l_gdmprofile.d/ fi if ! grep -Piq '^\\h*banner-message-enable\\h*=\\h*true\\b' /etc/dconf/db/$l_gdmprofile.d/*; then echo \"creating gdm keyfile for machine-wide settings\" if ! grep -Piq -- '^\\h*banner-message-enable\\h*=\\h*' /etc/dconf/db/$l_gdmprofile.d/*; then l_kfile=\"/etc/dconf/db/$l_gdmprofile.d/01-banner-message\" echo -e \"\\n[org/gnome/login-screen]\\nbanner-message-enable=true\" >> \"$l_kfile\" else l_kfile=\"$(grep -Pil -- '^\\h*banner-message-enable\\h*=\\h*' /etc/dconf/db/$l_gdmprofile.d/*)\" ! grep -Pq '^\\h*\\[org\\/gnome\\/login-screen\\]' \"$l_kfile\" && sed -ri '/^\\s*banner- message-enable/ i\\[org/gnome/login-screen]' \"$l_kfile\" ! grep -Pq '^\\h*banner-message-enable\\h*=\\h*true\\b' \"$l_kfile\" && sed -ri 's/^\\s*(banner-message-enable\\s*=\\s*)(\\S+)(\\s*.*$)/\\1true \\3//' \"$l_kfile\" # sed -ri '/^\\s*\\[org\\/gnome\\/login-screen\\]/ a\\\\nbanner-message-enable=true' \"$l_kfile\" fi fi if ! grep -Piq \"^\\h*banner-message-text=[\\'\\\"]+\\S+\" \"$l_kfile\"; then sed -ri \"/^\\s*banner-message-enable/ a\\banner-message-text=$l_bmessage\" \"$l_kfile\" fi dconf update else echo -e \"\\n\\n - GNOME Desktop Manager isn't installed\\n - Recommendation is Not Applicable\\n - No remediation required\\n\" fi } Note: - There is no character limit for the banner message. gnome-shell autodetects longer stretches of text and enters two column mode. - The banner message cannot be read from an external file. OR Run the following command to remove the gdm package: # dnf remove gdm." + references: + - "https://help.gnome.org/admin/system-admin-guide/stable/login-banner.html.en" + compliance: + - cis: ["1.8.2"] + - mitre_tactics: ["TA0007"] + condition: all + rules: + - 'f:/etc/dconf/profile/gdm -> r:^user-db:user\s*system-db:gdm\s*file-db:/usr/share/gdm/greeter-dconf-defaults$' + - 'd:/etc/dconf/db/gdm.d/ -> r:\.* -> r:s*\[org/gnome/login-screen\]\s*banner-message-enable=true\s*banner-message-text=\w+' + + # 1.8.3 Ensure GDM disable-user-list option is enabled. (Automated) - Not Implemented + # 1.8.4 Ensure GDM screen locks when the user is idle. (Automated) - Not Implemented + # 1.8.5 Ensure GDM screen locks cannot be overridden. (Automated) - Not Implemented + # 1.8.6 Ensure GDM automatic mounting of removable media is disabled. (Automated) - Not Implemented + # 1.8.7 Ensure GDM disabling automatic mounting of removable media is not overridden. (Automated) - Not Implemented + # 1.8.8 Ensure GDM autorun-never is enabled. (Automated) - Not Implemented + # 1.8.9 Ensure GDM autorun-never is not overridden. (Automated) - Not Implemented + + # 1.8.10 Ensure XDCMP is not enabled. (Automated) + - id: 31551 + title: "Ensure XDCMP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. - XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user - XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server." + remediation: "Edit the file /etc/gdm/custom.conf and remove the line: Enable=true." + compliance: + - cis: ["1.8.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1050"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1040", "T1056", "T1056.001", "T1557"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "not f:/etc/gdm3" + - 'not f:/etc/gdm3/custom.conf -> r:^\s*Enable\s*=\s*true' + + # 1.9 Ensure updates, patches, and additional security software are installed. (Manual) + - id: 31552 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. The following command will install all available updates: # dnf update Once the update process is complete, verify if reboot is required to load changes. dnf needs-restarting -r." + compliance: + - cis: ["1.9"] + - cis_csc_v8: ["7.3", "7.4"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - mitre_mitigations: ["M1051"] + - mitre_tactics: ["TA0004", "TA0008"] + - mitre_techniques: ["T1211"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'not c:sh -c "dnf check-update | egrep -v \"Updating|Last metadata|^$\"" -> r:^\w' + + # 1.10 Ensure system-wide crypto policy is not legacy. (Automated) + - id: 31553 + title: "Ensure system-wide crypto policy is not legacy." + description: "The system-wide crypto-policies followed by the crypto core components allow consistently deprecating and disabling algorithms system-wide. The individual policy levels (DEFAULT, LEGACY, FUTURE, and FIPS) are included in the crypto-policies(7) package." + rationale: "If the Legacy system-wide crypto policy is selected, it includes support for TLS 1.0, TLS 1.1, and SSH2 protocols or later. The algorithms DSA, 3DES, and RC4 are allowed, while RSA and Diffie-Hellman parameters are accepted if larger than 1023-bits. These legacy protocols and algorithms can make the system vulnerable to attacks, including those listed in RFC 7457." + impact: "Environments that require compatibility with older insecure protocols may require the use of the less secure LEGACY policy level." + remediation: "Run the following command to change the system-wide crypto policy # update-crypto-policies --set Example: # update-crypto-policies --set DEFAULT Run the following to make the updated system-wide crypto policy active # update-crypto-policies." + references: + - "https://access.redhat.com/articles/3642912#what-polices-are-provided-1" + compliance: + - cis: ["1.10"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["SC-8"] + - pci_dss_3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: none + rules: + - 'f:/etc/crypto-policies/config -> r:^\s*LEGACY' + + ############################################### + # 2 Services + ############################################### + ############################################### + # 2.1 Time Synchronization + ############################################### + + # 2.1.1 Ensure time synchronization is in use. (Automated) + - id: 31554 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them. Note: If another method for time synchronization is being used, this section may be skipped." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "Run the following command to install chrony: # dnf install chrony." + compliance: + - cis: ["2.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_3.2.1: ["10.4"] + - pci_dss_4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:rpm -q chrony -> r:^chrony-" + + # 2.1.2 Ensure chrony is configured. (Automated) + - id: 31555 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: 'Add or edit server or pool lines to /etc/chrony.conf as appropriate: server Add or edit the OPTIONS in /etc/sysconfig/chronyd to include ''-u chrony'': OPTIONS="-u chrony".' + compliance: + - cis: ["2.1.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1070", "T1070.002"] + - nist_sp_800-53: ["AU-12", "AU-3"] + - pci_dss_3.2.1: ["10.4"] + - pci_dss_4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "f:/etc/chrony.conf" + - 'f:/etc/chrony.conf -> r:^\s*\t*server|^\s*\t*pool' + - 'f:/etc/sysconfig/chronyd -> r:^\s*\t*OPTIONS\.*-u chrony' + + ############################################### + # 2.2 Special Purpose Services + ############################################### + + # 2.2.1 Ensure xorg-x11-server-common is not installed. (Automated) + - id: 31556 + title: "Ensure xorg-x11-server-common is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: 'Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime.' + remediation: "Run the following command to remove the X Windows Server packages: # dnf remove xorg-x11-server-common." + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q xorg-x11-server-common -> r:^package xorg-x11-server-common is not installed" + + # 2.2.2 Ensure Avahi Server is not installed. (Automated) + - id: 31557 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to stop, mask and remove avahi: # systemctl stop avahi-daemon.socket avahi-daemon.service # dnf remove avahi." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q avahi-autoipd -> r:^package avahi-autoipd is not installed" + - "c:rpm -q avahi -> r:^package avahi is not installed" + + # 2.2.3 Ensure CUPS is not installed. (Automated) + - id: 31558 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface. Note: Removing CUPS will prevent printing from the system." + impact: "Disabling CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run the following command to remove cups: # dnf remove cups." + references: + - "http://www.cups.org." + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q cups -> r:^package cups is not installed" + + # 2.2.4 Ensure DHCP Server is not installed. (Automated) + - id: 31559 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that the dhcp-server package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dhcp: # dnf remove dhcp-server." + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dhcp-server -> r:^package dhcp-server is not installed" + + # 2.2.5 Ensure DNS Server is not installed. (Automated) + - id: 31560 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove bind: # dnf remove bind." + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q bind -> r:^package bind is not installed" + + # 2.2.6 Ensure VSFTP Server is not installed. (Automated) + - id: 31561 + title: "Ensure VSFTP Server is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "Unless there is a need to run the system as a FTP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # dnf remove vsftpd." + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q vsftpd -> r:^package vsftpd is not installed" + + # 2.2.7 Ensure TFTP Server is not installed. (Automated) + - id: 31562 + title: "Ensure TFTP Server is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "Unless there is a need to run the system as a TFTP server, it is recommended that the package be removed to reduce the potential attack surface. TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + impact: "TFTP is often used to provide files for network booting such as for PXE based installation of servers." + remediation: "Run the following command to remove tftp-server: # dnf remove tftp-server." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp-server -> r:^package tftp-server is not installed" + + # 2.2.8 Ensure a web server is not installed. (Automated) + - id: 31563 + title: "Ensure a web server is not installed." + description: "Web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the packages be removed to reduce the potential attack surface. Note: Several http servers exist. They should also be audited, and removed, if not required." + remediation: "Run the following command to remove httpd and nginx: # dnf remove httpd nginx." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q nginx -> r:^package nginx is not installed" + - "c:rpm -q httpd -> r:^package httpd is not installed" + + # 2.2.9 Ensure IMAP and POP3 server is not installed. (Automated) + - id: 31564 + title: "Ensure IMAP and POP3 server is not installed." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface. Note: Several IMAP/POP3 servers exist and can use other service names. These should also be audited and the packages removed if not required." + remediation: "Run the following command to remove dovecot and cyrus-imapd: # dnf remove dovecot cyrus-imapd." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q dovecot -> r:^package dovecot is not installed" + - "c:rpm -q cyrus-imapd -> r:^package cyrus-imapd is not installed" + + # 2.2.10 Ensure Samba is not installed. (Automated) + - id: 31565 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this package can be removed to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # dnf remove samba." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1005", "T1039", "T1083", "T1135", "T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q samba -> r:^package samba is not installed" + + # 2.2.11 Ensure HTTP Proxy Server is not installed. (Automated) + - id: 31566 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "Unless a system is specifically set up to act as a proxy server, it is recommended that the squid package be removed to reduce the potential attack surface. Note: Several HTTP proxy servers exist. These should be checked and removed unless required." + remediation: "Run the following command to remove the squid package: # dnf remove squid." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q squid -> r:^package squid is not installed" + + # 2.2.12 Ensure net-snmp is not installed. (Automated) + - id: 31567 + title: "Ensure net-snmp is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. If SNMP v2 is absolutely necessary, modify the community strings' values. -." + remediation: "Run the following command to remove net-snmpd: # dnf remove net-snmp." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q net-snmp -> r:^package net-snmp is not installed" + + # 2.2.13 Ensure telnet-server is not installed. (Automated) + - id: 31568 + title: "Ensure telnet-server is not installed." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to remove the telnet-server package: # dnf remove telnet-server." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6", "9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2", "A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet-server -> r:^package telnet-server is not installed" + + # 2.2.14 Ensure dnsmasq is not installed. (Automated) + - id: 31569 + title: "Ensure dnsmasq is not installed." + description: "dnsmasq is a lightweight tool that provides DNS caching, DNS forwarding and DHCP (Dynamic Host Configuration Protocol) services." + rationale: "Unless a system is specifically designated to act as a DNS caching, DNS forwarding and/or DHCP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dnsmasq: # dnf remove dnsmasq." + compliance: + - cis: ["2.2.14"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + condition: all + rules: + - "c:rpm -q dnsmasq -> r:^package dnsmasq is not installed" + + # 2.2.15 Ensure mail transfer agent is configured for local-only mode. (Automated) + - id: 31570 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Note: - This recommendation is designed around the postfix mail server. - Depending on your environment you may have an alternative MTA installed such as sendmail. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1018", "T1210"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not c:ss -lntu -> r:\s*127.0.0.1:25\s*|\s*::1:25\s*' + + # 2.2.16 Ensure nfs-utils is not installed or the nfs-server service is masked. (Automated) + - id: 31571 + title: "Ensure nfs-utils is not installed or the nfs-server service is masked." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not require network shares, it is recommended that the nfs-utils package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization are dependent on the nfs-utils package. If the nfs-utils package is required as a dependency, the nfs-server service should be disabled and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove nfs-utils OR If the nfs-utils package is required as a dependency, run the following command to stop and mask the nfs-server service: # systemctl --now mask nfs-server." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1005", "T1039", "T1083", "T1135", "T1210"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q nfs-utils -> r:^package nfs-utils is not installed" + - "c:systemctl is-enabled nfs-server -> r:masked|No such file or directory" + + # 2.2.17 Ensure rpcbind is not installed or the rpcbind services are masked. (Automated) + - id: 31572 + title: "Ensure rpcbind is not installed or the rpcbind services are masked." + description: "The rpcbind utility maps RPC services to the ports on which they listen. RPC processes notify rpcbind when they start, registering the ports they are listening on and the RPC program numbers they expect to serve. The client system then contacts rpcbind on the server with a particular RPC program number. The rpcbind service redirects the client to the proper port number so it can communicate with the requested service Portmapper is an RPC service, which always listens on tcp and udp 111, and is used to map other RPC services (such as nfs, nlockmgr, quotad, mountd, etc.) to their corresponding port number on the server. When a remote host makes an RPC call to that server, it first consults with portmap to determine where the RPC server is listening." + rationale: "A small request (~82 bytes via UDP) sent to the Portmapper generates a large response (7x to 28x amplification), which makes it a suitable tool for DDoS attacks. If rpcbind is not required, it is recommended that the rpcbind package be removed to reduce the attack surface of the system." + impact: "Many of the libvirt packages used by Enterprise Linux virtualization, and the nfs-utils package used for The Network File System (NFS), are dependent on the rpcbind package. If the rpcbind package is required as a dependency, the services rpcbind.service and rpcbind.socket should be stopped and masked to reduce the attack surface of the system." + remediation: "Run the following command to remove nfs-utils: # dnf remove rpcbind OR If the rpcbind package is required as a dependency, run the following commands to stop and mask the rpcbind.service and rpcbind.socket systemd units: # systemctl --now mask rpcbind.service # systemctl --now mask rpcbind.socket." + compliance: + - cis: ["2.2.17"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1498", "T1498.002", "T1543", "T1543.002"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rpcbind -> r:^package rpcbind is not installed" + - "not c:systemctl status rpcbind rpcbind.socket -> r:Loaded: && !r: masked" + + # 2.2.18 Ensure rsync-daemon is not installed or the rsyncd service is masked. (Automated) + - id: 31573 + title: "Ensure rsync-daemon is not installed or the rsyncd service is masked." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "Unless required, the rsync-daemon package should be removed to reduce the attack surface area of the system. The rsyncd service presents a security risk as it uses unencrypted protocols for communication. Note: If a required dependency exists for the rsync-daemon package, but the rsyncd service is not required, the service should be masked." + impact: "There are packages that are dependent on the rsync package. If the rsync package is removed, these packages will be removed as well. Before removing the rsync-daemon package, review any dependent packages to determine if they are required on the system. If a dependent package is required, mask the rsyncd service and leave the rsync-daemon package installed." + remediation: "Run the following command to remove the rsync package: # dnf remove rsync-daemon OR Run the following command to mask the rsyncd service: # systemctl --now mask rsyncd." + compliance: + - cis: ["2.2.18"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1105", "T1203", "T1210", "T1543", "T1543.002", "T1570"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:rpm -q rsync -> r:^package rsync is not installed" + - "c:systemctl is-enabled rsyncd -> r:masked|No such file or directory" + + # 2.3.1 Ensure telnet client is not installed. (Automated) + - id: 31574 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Run the following command to remove the telnet package: # dnf remove telnet." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_mitigations: ["M1041", "M1042"] + - mitre_tactics: ["TA0006", "TA0008"] + - mitre_techniques: ["T1040", "T1203", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q telnet -> r:^package telnet is not installed" + + # 2.3.2 Ensure LDAP client is not installed. (Automated) + - id: 31575 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Run the following command to remove the openldap-clients package: # dnf remove openldap-clients." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q openldap-clients -> r:^package openldap-clients is not installed" + + # 2.3.3 Ensure TFTP client is not installed. (Automated) + - id: 31576 + title: "Ensure TFTP client is not installed." + description: "Trivial File Transfer Protocol (TFTP) is a simple protocol for exchanging files between two TCP/IP machines. TFTP servers allow connections from a TFTP Client for sending and receiving files." + rationale: "TFTP does not have built-in encryption, access control or authentication. This makes it very easy for an attacker to exploit TFTP to gain access to files." + remediation: "Run the following command to remove tftp: # dnf remove tftp." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q tftp -> r:^package tftp is not installed" + + # 2.3.4 Ensure FTP client is not installed. (Automated) + - id: 31577 + title: "Ensure FTP client is not installed." + description: "FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring files between a server and clients over a network, especially where no authentication is necessary (permits anonymous users to connect to a server)." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove ftp: # dnf remove ftp." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:rpm -q ftp -> r:^package ftp is not installed" + + # 2.4 Ensure nonessential services listening on the system are removed or masked. (Manual) - Not Implemented + + ############################################### + # 3 Network Configuration + ############################################### + ############################################### + # 3.1 Disable unused network protocols and devices + ############################################### + + # 3.1.1 Ensure IPv6 status is identified. (Manual) - Not Implemented + # 3.1.2 Ensure wireless interfaces are disabled. (Automated) - Not Implemented + + # 3.1.3 Ensure TIPC is disabled. (Automated) + - id: 31578 + title: "Ensure TIPC is disabled." + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Run the following script to disable tipc: #!/usr/bin/env bash { l_mname=\"tipc\" # set module name # Check if the module exists on the system if [ -z \"$(modprobe -n -v \"$l_mname\" 2>&1 | grep -Pi -- \"\\h*modprobe:\\h+FATAL:\\h+Module\\h+$l_mname\\h+not\\h+found\\h+in\\h+directory\")\" ]; then # Remediate loadable l_loadable=\"$(modprobe -n -v \"$l_mname\")\" [ \"$(wc -l <<< \"$l_loadable\")\" -gt \"1\" ] && l_loadable=\"$(grep -P -- \"(^\\h*install|\\b$l_mname)\\b\" <<< \"$l_loadable\")\" if ! grep -Pq -- '^\\h*install \\/bin\\/(true|false)' <<< \"$l_loadable\"; then echo -e \" - setting module: \\\"$l_mname\\\" to be not loadable\" echo -e \"install $l_mname /bin/false\" >> /etc/modprobe.d/\"$l_mname\".conf fi # Remediate loaded if lsmod | grep \"$l_mname\" > /dev/null 2>&1; then echo -e \" - unloading module \\\"$l_mname\\\"\" modprobe -r \"$l_mname\" fi # Remediate deny list if ! modprobe --showconfig | grep -Pq -- \"^\\h*blacklist\\h+$l_mname\\b\"; then echo -e \" - deny listing \\\"$l_mname\\\"\" echo -e \"blacklist $l_mname\" >> /etc/modprobe.d/\"$l_mname\".conf fi else echo -e \" - Nothing to remediate\\n - Module \\\"$l_mname\\\" doesn't exist on the system\" fi }." + compliance: + - cis: ["3.1.3"] + - cis_csc_v7: ["9.2", "9.1"] + - iso_27001-2013: ["A.13.1.2", "A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1068", "T1210"] + condition: all + rules: + - "c:modprobe -n -v tipc -> r:install /bin/true" + - "not c:lsmod -> r:tipc" + + ############################################### + # 3.2 Network Parameters (Host Only) + ############################################### + + # 3.2.1 Ensure IP forwarding is disabled. (Automated) - Not Implemented + # 3.2.2 Ensure packet redirect sending is disabled. (Automated) - Not Implemented + + ############################################### + # 3.3 Network Parameters (Host and Router) + ############################################### + + # 3.3.1 Ensure source routed packets are not accepted. (Automated) - Not Implemented + # 3.3.2 Ensure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.3 Ensure secure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.4 Ensure suspicious packets are logged. (Automated) - Not Implemented + # 3.3.5 Ensure broadcast ICMP requests are ignored. (Automated) Not Implemented + # 3.3.6 Ensure bogus ICMP responses are ignored. (Automated) - Not Implemented + # 3.3.7 Ensure Reverse Path Filtering is enabled. (Automated) - Not Implemented + # 3.3.8 Ensure TCP SYN Cookies is enabled. (Automated) - Not Implemented + # 3.3.9 Ensure IPv6 router advertisements are not accepted. (Automated) - Not Implemented + + ############################################### + # 3.4 Firewall Configuration + ############################################### + ############################################### + # 3.4.1 Configure firewalld + ############################################### + + # 3.4.1.1 Ensure nftables is installed. (Automated) + - id: 31579 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + impact: "Changing firewall settings while connected over the network can result in being locked out of the system." + remediation: "Run the following command to install nftables # dnf install nftables." + compliance: + - cis: ["3.4.1.1"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:nftables-" + + # 3.4.1.2 Ensure a single firewall configuration utility is in use. (Automated) + - id: 31580 + title: "Ensure a single firewall configuration utility is in use." + description: "FirewallD - Is a firewall service daemon that provides a dynamic customizable host-based firewall with a D-Bus interface. Being dynamic, it enables creating, changing, and deleting the rules without the necessity to restart the firewall daemon each time the rules are changed NFTables - Includes the nft utility for configuration of the nftables subsystem of the Linux kernel Note: firewalld with nftables backend does not support passing custom nftables rules to firewalld, using the --direct option." + rationale: "In order to configure firewall rules for nftables, a firewall utility needs to be installed and active of the system. The use of more than one firewall utility may produce unexpected results." + remediation: "Run the following script to ensure that a single firewall utility is in use on the system: #!/usr/bin/env bash { l_output=\"\" l_output2=\"\" l_fwd_status=\"\" l_nft_status=\"\" l_fwutil_status=\"\" # Determine FirewallD utility Status rpm -q firewalld > /dev/null 2>&1 && l_fwd_status=\"$(systemctl is-enabled firewalld.service):$(systemctl is-active firewalld.service)\" # Determine NFTables utility Status rpm -q nftables > /dev/null 2>&1 && l_nft_status=\"$(systemctl is-enabled nftables.service):$(systemctl is-active nftables.service)\" l_fwutil_status=\"$l_fwd_status:$l_nft_status\" case $l_fwutil_status in enabled:active:masked:inactive|enabled:active:disabled:inactive) echo -e \"\\n - FirewallD utility is in use, enabled and active\\n - NFTables utility is correctly disabled or masked and inactive\\n - no remediation required\" ;; masked:inactive:enabled:active|disabled:inactive:enabled:active) echo -e \"\\n - NFTables utility is in use, enabled and active\\n - FirewallD utility is correctly disabled or masked and inactive\\n - no remediation required\" ;; enabled:active:enabled:active) echo -e \"\\n - Both FirewallD and NFTables utilities are enabled and active\\n - stopping and masking NFTables utility\" systemctl stop nftables && systemctl --now mask nftables ;; enabled:*:enabled:*) echo -e \"\\n - Both FirewallD and NFTables utilities are enabled\\n - remediating\" if [ \"$(awk -F: '{print $2}' <<< \"$l_fwutil_status\")\" = \"active\" ] && [ \"$(awk -F: '{print $4}' <<< \"$l_fwutil_status\")\" = \"inactive\" ]; then echo \" - masking NFTables utility\" systemctl stop nftables && systemctl --now mask nftables elif [ \"$(awk -F: '{print $4}' <<< \"$l_fwutil_status\")\" = \"active\" ] && [ \"$(awk -F: '{print $2}' <<< \"$l_fwutil_status\")\" = \"inactive\" ]; then echo \" - masking FirewallD utility\" systemctl stop firewalld && systemctl --now mask firewalld fi ;; *:active:*:active) echo -e \"\\n - Both FirewallD and NFTables utilities are active\\n - remediating\" if [ \"$(awk -F: '{print $1}' <<< \"$l_fwutil_status\")\" = \"enabled\" ] && [ \"$(awk -F: '{print $3}' <<< \"$l_fwutil_status\")\" != \"enabled\" ]; then echo \" - stopping and masking NFTables utility\" systemctl stop nftables && systemctl --now mask nftables elif [ \"$(awk -F: '{print $3}' <<< \"$l_fwutil_status\")\" = \"enabled\" ] && [ \"$(awk -F: '{print $1}' <<< \"$l_fwutil_status\")\" != \"enabled\" ]; then echo \" - stopping and masking FirewallD utility\" systemctl stop firewalld && systemctl --now mask firewalld fi ;; :enabled:active) echo -e \"\\n - NFTables utility is in use, enabled, and active\\n - FirewallD package is not installed\\n - no remediation required\" ;; :) echo -e \"\\n - Neither FirewallD or NFTables is installed.\\n - remediating\\n - installing NFTables\" dnf -q install nftables ;; *:*:) echo -e \"\\n - NFTables package is not installed on the system\\n - remediating\\n - installing NFTables\" dnf -q install nftables ;; *) echo -e \"\\n - Unable to determine firewall state\" ;; esac }." + references: + - "https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-" + compliance: + - cis: ["3.4.1.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - "c:rpm -q firewalld -> r:^package firewalld is not installed" + - "not c:firewall-cmd --state -> r:^running" + - "c:systemctl is-enabled firewalld -> r:^masked" + + # 3.4.2.1 Ensure firewalld default zone is set. (Automated) - Not Implemented + + # 3.4.2.2 Ensure at least one nftables table exists. (Automated) + - id: 31581 + title: "Ensure at least one nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "Without a table, nftables will not filter network traffic." + impact: "Adding or modifying firewall rules can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example if FirewallD is not in use on the system: # nft create table inet filter Note: FirewallD uses the table inet firewalld NFTables table that is created when FirewallD is installed." + compliance: + - cis: ["3.4.2.2"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list tables -> r:^table" + + # 3.4.2.3 Ensure nftables base chains exist. (Automated) + - id: 31582 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.4.2.3"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^nftables-" + - "c:nft list ruleset -> r:filter hook input" + - "c:nft list ruleset -> r:filter hook forward" + - "c:nft list ruleset -> r:filter hook output" + + # 3.4.2.4 Ensure host based firewall loopback traffic is configured. (Automated) - Not Implemented + # 3.4.2.5 Ensure firewalld drops unnecessary services and ports. (Manual) - Not Implemented + # 3.4.2.6 Ensure nftables established connections are configured. (Manual) - Not Implemented + + # 3.4.2.7 Ensure nftables default deny firewall policy. (Automated) + - id: 31583 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue traversing the network stack. It is easier to explicitly permit acceptable usage than to deny unacceptable usage. Note: Changing firewall settings while connected over the network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "If NFTables utility is in use on your system: Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; }." + compliance: + - cis: ["3.4.2.7"] + - cis_csc_v8: ["4.4"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["CA-9"] + - pci_dss_3.2.1: ["1.1.4", "1.3.1"] + - pci_dss_4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:rpm -q nftables -> r:^nftables-" + - "c:nft list ruleset -> r:policy drop" + - "c:nft list ruleset -> r:policy drop" + - "c:nft list ruleset -> r:policy drop" + + ############################################################ + # 4 Logging and Auditing. + ############################################################ + ############################################################ + # 4.1 Configure System Accounting (auditd). + ############################################################ + ############################################################ + # 4.1.1 Ensure auditing is enabled. + ############################################################ + + # 4.1.1.1 Ensure auditd is installed. (Automated) + - id: 31584 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # dnf install audit." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v8: ["8.2", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-2", "AU-3", "AU-3(1)", "SI-5"] + - pci_dss_3.2.1: ["10.1", "10.2", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["10.2", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:rpm -q audit -> r:^audit-" + + # 4.1.1.2 Ensure auditing for processes that start prior to auditd is enabled. (Automated) + - id: 31585 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd , so that potential malicious activity cannot go undetected." + remediation: "Run the following command to update the grub2 configuration with audit=1: # grubby --update-kernel ALL --args 'audit=1'." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:grubby --info=ALL -> r:audit=1" + + # 4.1.1.3 Ensure audit_backlog_limit is sufficient. (Automated) + - id: 31586 + title: "Ensure audit_backlog_limit is sufficient." + description: "The backlog limit has a default setting of 64." + rationale: "During boot if audit=1, then the backlog will hold 64 records. If more that 64 records are created during boot, auditd records will be lost and potential malicious activity could go undetected." + remediation: "Run the following command to add audit_backlog_limit= to GRUB_CMDLINE_LINUX: # grubby --update-kernel ALL --args 'audit_backlog_limit=' Example: # grubby --update-kernel ALL --args 'audit_backlog_limit=8192'." + compliance: + - cis: ["4.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:grubby --info=ALL -> n:^args=\.*\saudit_backlog_limit=(\d+) compare >= 8192' + + # 4.1.1.4 Ensure auditd service is enabled. (Automated) + - id: 31587 + title: "Ensure auditd service is enabled." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:enabled" + + ############################################################ + # 4.1.2 Configure Data Retention + ############################################################ + + # 4.1.2.1 Ensure audit log storage size is configured. (Automated) + - id: 31588 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1053"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file\s*=\s*\d+' + + # 4.1.2.2 Ensure audit logs are not automatically deleted. (Automated) + - id: 31589 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-8"] + - pci_dss_3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file_action\s*=\s*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full. (Automated) + - id: 31590 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full. The admin_space_left_action parameter tells the system what action to take when the system has detected that it is low on disk space. Valid values are ignore, syslog, suspend, single, and halt. - ignore, the audit daemon does nothing - Syslog, the audit daemon will issue a warning to syslog - Suspend, the audit daemon will stop writing records to the disk - single, the audit daemon will put the computer system in single user mode - halt, the audit daemon will shut down the system." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + impact: "If the admin_space_left_action parameter is set to halt the audit daemon will shutdown the system when the disk partition containing the audit logs becomes full." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root set admin_space_left_action to either halt or single in /etc/audit/auditd.conf. Example: admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-12", "AU-2", "AU-8", "SI-5"] + - pci_dss_3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt|^\s*admin_space_left_action\s*=\s*single' + + ############################################# + # 4.1.3 Configure auditd rules + ############################################# + + # 4.1.3.1 Ensure changes to system administration scope (sudoers) is collected. (Automated) + - id: 31591 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers, or files in /etc/sudoers.d, will be written to when the file(s) or related attributes have changed. The audit records will be tagged with the identifier "scope".' + rationale: "Changes in the /etc/sudoers and /etc/sudoers.d files can indicate that an unauthorized change has been made to the scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor scope changes for system administrators. Example: # printf \" -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d -p wa -k scope \" >> /etc/audit/rules.d/50-scope.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - d:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers -p wa -k scope|-w /etc/sudoers -p wa key=scope + - d:/etc/audit/rules.d/ -> r:\.*.rules -> r:-w /etc/sudoers.d -p wa -k scope|-w /etc/sudoers.d -p wa key=scope + - c:auditctl -l -> r:-w /etc/sudoers -p wa -k scope|-w /etc/sudoers -p wa key=scope + - c:auditctl -l -> r:-w /etc/sudoers.d -p wa -k scope|-w /etc/sudoers.d -p wa key=scope + + # 4.1.3.2 Ensure actions as another user are always logged. (Automated) - Not Implemented + # 4.1.3.3 Ensure events that modify the sudo log file are collected. (Automated) - Not Implemented + # 4.1.3.4 Ensure events that modify date and time information are collected. (Automated) - Not Implemented + # 4.1.3.5 Ensure events that modify the system's network environment are collected. (Automated) - Not Implemented + # 4.1.3.6 Ensure use of privileged commands are collected. (Automated) - Not Implemented + # 4.1.3.7 Ensure unsuccessful file access attempts are collected. (Automated) - Not Implemented + # 4.1.3.8 Ensure events that modify user/group information are collected. (Automated) - Not Implemented + # 4.1.3.9 Ensure discretionary access control permission modification events are collected. (Automated) - Not Implemented + # 4.1.3.10 Ensure successful file system mounts are collected. (Automated) - Not Implemented + # 4.1.3.11 Ensure session initiation information is collected. (Automated) - Not Implemented + # 4.1.3.12 Ensure login and logout events are collected. (Automated) - Not Implemented + # 4.1.3.13 Ensure file deletion events by users are collected. (Automated) - Not Implemented + # 4.1.3.14 Ensure events that modify the system's Mandatory Access Controls are collected. (Automated) - Not Implemented + # 4.1.3.15 Ensure successful and unsuccessful attempts to use the chcon command are recorded. (Automated) - Not Implemented + # 4.1.3.16 Ensure successful and unsuccessful attempts to use the setfacl command are recorded. (Automated) - Not Implemented + # 4.1.3.17 Ensure successful and unsuccessful attempts to use the chacl command are recorded. (Automated) - Not Implemented + # 4.1.3.18 Ensure successful and unsuccessful attempts to use the usermod command are recorded. (Automated) - Not Implemented + # 4.1.3.19 Ensure kernel module loading unloading and modification is collected. (Automated) - Not Implemented + # 4.1.3.20 Ensure the audit configuration is immutable. (Automated) - Not Implemented + + # 4.1.3.21 Ensure the running and on disk configuration is the same. (Manual) + - id: 31592 + title: "Ensure the running and on disk configuration is the same." + description: "The Audit system have both on disk and running configuration. It is possible for these configuration settings to differ. Note: Due to the limitations of augenrules and auditctl, it is not absolutely guaranteed that loading the rule sets via augenrules --load will result in all rules being loaded or even that the user will be informed if there was a problem loading the rules." + rationale: "Configuration differences between what is currently running and what is on disk could cause unexpected problems or may give a false impression of compliance requirements." + remediation: 'If the rules are not aligned across all three () areas, run the following command to merge and load all rules: # augenrules --load Check if reboot is required. if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then echo "Reboot required to load rules"; fi.' + compliance: + - cis: ["4.1.3.21"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:augenrules --check -> r:No change$" + + # 4.1.4.1 Ensure audit log files are mode 0640 or less permissive. (Automated) - Not Implemented + # 4.1.4.2 Ensure only authorized users own audit log files. (Automated) - Not Implemented + # 4.1.4.3 Ensure only authorized groups are assigned ownership of audit log files. (Automated) + - id: 31593 + title: "Ensure only authorized groups are assigned ownership of audit log files." + description: "Audit log files contain information about the system and system activity." + rationale: "Access to audit records can reveal system and configuration data to attackers, potentially compromising its confidentiality." + remediation: "Run the following command to configure the audit log files to be owned by adm group: # find $(dirname $(awk -F\"=\" '/^\\s*log_file\\s*=\\s*/ {print $2}' /etc/audit/auditd.conf | xargs)) -type f \\( ! -group adm -a ! -group root \\) -exec chgrp adm {} + Run the following command to configure the audit log files to be owned by the adm group: # chgrp adm /var/log/audit/ Run the following command to set the log_group parameter in the audit configuration file to log_group = adm: # sed -ri 's/^\\s*#?\\s*log_group\\s*=\\s*\\S+(\\s*#.*)?.*$/log_group = adm\\1/' /etc/audit/auditd.conf Run the following command to restart the audit daemon to reload the configuration file: # systemctl restart auditd." + compliance: + - cis: ["4.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'f:/etc/audit/auditd.conf -> r:log_group\s*\t*= && !r:adm|root' + + # 4.1.4.4 Ensure the audit log directory is 0750 or more restrictive. (Automated) - Not Implemented + + # 4.1.4.5 Ensure audit configuration files are 640 or more restrictive. (Automated) + - id: 31594 + title: "Ensure audit configuration files are 640 or more restrictive." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to remove more permissive mode than 0640 from the audit configuration files: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) -exec chmod u-x,g-wx,o-rwx {} +." + compliance: + - cis: ["4.1.4.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) -exec stat -Lc \"%n %a\" {} + -> r:\\w+ -> !r:000|040|200|400|600|240|440|640" + + # 4.1.4.6 Ensure audit configuration files are owned by root. (Automated) + - id: 31595 + title: "Ensure audit configuration files are owned by root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change ownership to root user: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -user root -exec chown root {} +." + compliance: + - cis: ["4.1.4.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:find /etc/audit/ -type f \\( -name '*.rules' -o -name '*.conf' \\) -exec stat -Lc \"%U\" {} + -> !r:root|\\s*" + + # 4.1.4.7 Ensure audit configuration files belong to group root. (Automated) + - id: 31596 + title: "Ensure audit configuration files belong to group root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change group to root: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -group root -exec chgrp root {} +." + compliance: + - cis: ["4.1.4.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) -exec stat -Lc \"%U\" {} + -> !r:root|\\s*" + + # 4.1.4.8 Ensure audit tools are 755 or more restrictive. (Automated) + - id: 31597 + title: "Ensure audit tools are 755 or more restrictive." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:stat -c "%n %a" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:\w+ && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + + # 4.1.4.9 Ensure audit tools are owned by root. (Automated) + - id: 31598 + title: "Ensure audit tools are owned by root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to change the owner of the audit tools to the root user: # chown root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:stat -c "%n %U" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> !r:root|\\s*' + + # 4.1.4.10 Ensure audit tools belong to group root. (Automated) + - id: 31599 + title: "Ensure audit tools belong to group root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules Run the following command to change owner and group of the audit tools to root user and group: # chown root:root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.10"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755 && r:\s*\t*root\s*\t*root' + + ############################################### + # 4.2 Configure Logging + ############################################### + # 4.2.1 Configure rsyslog + ############################################### + + # 4.2.1.1 Ensure rsyslog is installed. (Automated) + - id: 31600 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is recommended in environments where journald does not meet operation requirements." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # dnf install rsyslog." + compliance: + - cis: ["4.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1005", "T1070", "T1070.002"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q rsyslog -> r:^rsyslog-" + + # 4.2.1.2 Ensure rsyslog service is enabled. (Automated) + - id: 31601 + title: "Ensure rsyslog service is enabled." + description: "Once the rsyslog package is installed, ensure that the service is enabled." + rationale: "If the rsyslog service is not enabled to start on boot, the system will not capture logging events." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1211", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:^enabled" + + # 4.2.1.3 Ensure journald is configured to send logs to rsyslog. (Manual) + - id: 31602 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the RSyslog service provides a consistent means of log collection and export." + rationale: "IF RSyslog is the preferred method for capturing logs, all logs of the system should be sent to it for further processing. Note: This recommendation only applies if rsyslog is the chosen method for client side logging. Do not apply this recommendation if journald is used." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.3"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006", "T1565"] + - nist_sp_800-53: ["AC-3", "AU-12", "AU-2", "AU-4", "MP-2", "SI-5"] + - pci_dss_3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*ForwardToSyslog=yes' + + # 4.2.1.4 Ensure rsyslog default file permissions are configured. (Automated) + - id: 31603 + title: "Ensure rsyslog default file permissions are configured." + description: "RSyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + impact: "The systems global umask could override, but only making the file permissions stricter, what is configured in RSyslog with the FileCreateMode directive. RSyslog also has its own $umask directive that can alter the intended file creation mode. In addition, consideration should be given to how FileCreateMode is used. Thus it is critical to ensure that the intended file creation mode is not overridden with less restrictive settings in /etc/rsyslog.conf, /etc/rsyslog.d/*conf files and that FileCreateMode is set before any file is created." + remediation: "Edit either /etc/rsyslog.conf or a dedicated .conf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640 Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.1.4"] + - cis_csc_v8: ["3.3", "8.2"] + - cis_csc_v7: ["5.1", "6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)", "164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.14.2.5", "A.8.1.3"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-7"] + - pci_dss_3.2.1: ["10.2", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0' + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d20|^\$FileCreateMode 0\d00' + + # 4.2.1.5 Ensure logging is configured. (Manual) - Not Implemented + + # 4.2.1.6 Ensure rsyslog is configured to send logs to a remote log host. (Manual) + - id: 31604 + title: "Ensure rsyslog is configured to send logs to a remote log host." + description: "RSyslog supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralized log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host). The target directive may either be a fully qualified domain name or an IP address. *.* action(type="omfwd" target="192.168.2.100" port="514" protocol="tcp" action.resumeRetryCount="100" queue.type="LinkedList" queue.size="1000") Run the following command to reload the rsyslogd configuration: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.6"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> !r:# && r:^*.* @@\.+' + - 'f:/etc/rsyslog.conf -> !r:# && r:^*.* action && r:target="' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:# && r:^*.* @@\.+' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:# && r:^*.* action && r:target="' + + # 4.2.1.7 Ensure rsyslog is not configured to receive logs from a remote client. (Automated) + - id: 31605 + title: "Ensure rsyslog is not configured to receive logs from a remote client." + description: "RSyslog supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside its operational boundary." + remediation: 'Should there be any active log server configuration found in the auditing section, modify those files and remove the specific lines highlighted by the audit. Ensure none of the following entries are present in any of /etc/rsyslog.conf or /etc/rsyslog.d/*.conf. New format module(load="imtcp") input(type="imtcp" port="514") -OR- Old format $ModLoad imtcp $InputTCPServerRun Restart the service: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.1.7"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - 'f:/etc/rsyslog.conf -> !r:^\s*# && r:ModLoad imtcp|InputTCPServerRun|load="imtcp"|type="imtcp"' + - 'd:/etc/rsyslog.d/ -> r:*.conf -> !r:\s*# && r:ModLoad imtcp|InputTCPServerRun|load="imtcp"|type="imtcp"' + + ############################################### + # 4.2.2 Configure journald + ############################################### + ############################################### + # 4.2.2.1 Ensure journald is configured to send logs to a remote log host + ############################################### + + # 4.2.2.1.1 Ensure systemd-journal-remote is installed. (Manual) + - id: 31606 + title: "Ensure systemd-journal-remote is installed." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralized log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to install systemd-journal-remote: # dnf install systemd-journal-remote." + compliance: + - cis: ["4.2.2.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:rpm -q systemd-journal-remote -> r:systemd-journal-remote-" + + # 4.2.2.1.2 Ensure systemd-journal-remote is configured. (Manual) - Not Implemented + + # 4.2.2.1.3 Ensure systemd-journal-remote is enabled. (Manual) + - id: 31607 + title: "Ensure systemd-journal-remote is enabled." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralized log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to enable systemd-journal-remote: # systemctl --now enable systemd-journal-upload.service." + compliance: + - cis: ["4.2.2.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-12", "AU-2", "CM-7", "SI-5"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-upload.service -> r:^enabled" + + # 4.2.2.1.4 Ensure journald is not configured to receive logs from a remote client. (Automated) + - id: 31608 + title: "Ensure journald is not configured to receive logs from a remote client." + description: "Journald supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts. NOTE: - The same package, systemd-journal-remote, is used for both sending logs to remote hosts and receiving incoming logs. - With regards to receiving logs, there are two services; systemd-journal- remote.socket and systemd-journal-remote.service." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: "Run the following command to disable systemd-journal-remote.socket: # systemctl --now mask systemd-journal-remote.socket." + compliance: + - cis: ["4.2.2.1.4"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-remote.socket -> r:^masked" + + # 4.2.2.2 Ensure journald service is enabled. (Automated) + - id: 31609 + title: "Ensure journald service is enabled." + description: "Ensure that the systemd-journald service is enabled to allow capturing of logging events." + rationale: "If the systemd-journald service is not enabled to start on boot, the system will not capture logging events." + remediation: "By default the systemd-journald service does not have an [Install] section and thus cannot be enabled / disabled. It is meant to be referenced as Requires or Wants by other unit files. As such, if the status of systemd-journald is not static, investigate why." + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journald.service -> r:^static" + + # 4.2.2.3 Ensure journald is configured to compress large log files. (Automated) + - id: 31610 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes Restart the service: # systemctl restart systemd-journald.service." + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.3", "6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1053"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Compress\s*=\s*yes' + + # 4.2.2.4 Ensure journald is configured to write logfiles to persistent disk. (Automated) + - id: 31611 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss due to a reboot." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent Restart the service: # systemctl restart systemd-journald.service." + compliance: + - cis: ["4.2.2.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*Storage=persistent' + + # 4.2.2.5 Ensure journald is not configured to send logs to rsyslog. (Manual) + - id: 31612 + title: "Ensure journald is not configured to send logs to rsyslog." + description: "Data from journald should be kept in the confines of the service and not forwarded on to other services." + rationale: "IF journald is the method for capturing logs, all logs of the system should be handled by journald and not forwarded to other logging mechanisms. Note: This recommendation only applies if journald is the chosen method for client side logging. Do not apply this recommendation if rsyslog is used." + remediation: "Edit the /etc/systemd/journald.conf file and ensure that ForwardToSyslog=yes is removed. Restart the service: # systemctl restart systemd-journald.service." + compliance: + - cis: ["4.2.2.5"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006", "T1565"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'not f:/etc/systemd/journald.conf -> r:^\s*ForwardToSyslog' + + # 4.2.2.6 Ensure journald log rotation is configured per site policy. (Manual) - Not Implemented + # 4.2.2.7 Ensure journald default file permissions configured. (Manual) - Not Implemented + # 4.2.3 Ensure all logfiles have appropriate permissions and ownership. (Automated) - Not Implemented + # 4.3 Ensure logrotate is configured. (Manual) - Not Implemented + + ############################################### + # 5 Access, Authentication and Authorization + ############################################### + ############################################### + # 5.1 Configure time-based job schedulers + ############################################### + + # 5.1.1 Ensure cron daemon is enabled. (Automated) + - id: 31613 + title: "Ensure cron daemon is enabled." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: # systemctl --now enable crond." + compliance: + - cis: ["5.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - "c:systemctl is-enabled crond -> r:^enabled" + + # 5.1.2 Ensure permissions on /etc/crontab are configured. (Automated) + - id: 31614 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to this file could provide unprivileged users with the ability to elevate their privileges. Read access to this file could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab." + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured. (Automated) + - id: 31615 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : # chown root:root /etc/cron.hourly # chmod og-rwx /etc/cron.hourly." + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured. (Automated) + - id: 31616 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : # chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily." + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured. (Automated) + - id: 31617 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : # chown root:root /etc/cron.weekly # chmod og-rwx /etc/cron.weekly." + compliance: + - cis: ["5.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured. (Automated) + - id: 31618 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : # chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly." + compliance: + - cis: ["5.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured. (Automated) + - id: 31619 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily, weekly and monthly jobs from /etc/crontab , but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.d : # chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d." + compliance: + - cis: ["5.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access: \(0700/drwx------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.1.8 Ensure cron is restricted to authorized users. (Automated) - Not Implemented + # 5.1.9 Ensure at is restricted to authorized users. (Automated) - Not Implemented + + ############################################### + # 5.2 Configure SSH Server + ############################################### + + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured. (Automated) + - id: 31620 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod u-x,go-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1098", "T1098.004", "T1543", "T1543.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access: \(0600/-rw-------\)\s*Uid: \(\s*0/\s*root\)\s*Gid: \(\s*0/\s*root\)$' + + # 5.2.2 Ensure permissions on SSH private host key files are configured. (Automated) - Not Implemented + # 5.2.3 Ensure permissions on SSH public host key files are configured. (Automated) - Not Implemented + + # 5.2.4 Ensure SSH access is limited. (Automated) + - id: 31621 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: o The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: o The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: o The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: o The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set one or more of the parameters as follows: AllowUsers -OR- AllowGroups -OR- DenyUsers -OR- DenyGroups ." + compliance: + - cis: ["5.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021", "T1021.004"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowUsers\s+\w*|^\s*AllowGroups\s+\w*|^\s*DenyUsers\s+\w*|^\s*DenyGroups\s+\w*' + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowUsers\s+\w*|^\s*AllowGroups\s+\w*|^\s*DenyUsers\s+\w*|^\s*DenyGroups\s+\w*' + + # 5.2.5 Ensure SSH LogLevel is appropriate. (Automated) + - id: 31622 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the LogLevel parameter as follows: LogLevel VERBOSE OR LogLevel INFO Run the following command to comment out any LogLevel parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than VERBOSE or INFO: # grep -Pi '^\\h*LogLevel\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi '(VERBOSE|INFO)' | while read -r l_out; do sed -ri \"/^\\s*LogLevel\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + references: + - "https://www.ssh.com/ssh/sshd_config/" + compliance: + - cis: ["5.2.5"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-12", "AU-2", "SI-5"] + - pci_dss_3.2.1: ["10.2", "10.3"] + - pci_dss_4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*LogLevel\s+VERBOSE|^\s*LogLevel\s+INFO' + - "f:/etc/ssh/sshd_config -> r:loglevel" + + # 5.2.6 Ensure SSH PAM is enabled. (Automated) + - id: 31623 + title: "Ensure SSH PAM is enabled." + description: "UsePAM Enables the Pluggable Authentication Module interface. If set to 'yes' this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types." + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + impact: "If UsePAM is enabled, you will not be able to run sshd as a non-root user." + remediation: "Edit or create a file in the directory /etc/ssh/sshd_config.d/ ending in *.conf or the /etc/ssh/sshd_config file and set the parameter as follows: UsePAM yes Run the following command to comment out any UsePAM parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than yes # grep -Pi '^\\h*UsePAM\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'yes' | while read -r l_out; do sed -ri \"/^\\s*UsePAM\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.6"] + - mitre_mitigations: ["M1035"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1021", "T1021.004"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*usepam\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\sUsePAM\s+no' + + # 5.2.7 Ensure SSH root login is disabled. (Automated) + - id: 31624 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the PermitRootLogin parameter as follows: PermitRootLogin no Run the following command to comment out any PermitRootLogin parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi '^\\h*PermitRootLogin\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*PermitRootLogin\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.7"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitRootLogin\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitRootLogin\s+yes' + + # 5.2.8 Ensure SSH HostbasedAuthentication is disabled. (Automated) + - id: 31625 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the HostbasedAuthentication parameter as follows: HostbasedAuthentication no Run the following command to comment out any HostbasedAuthentication parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no: # grep -Pi '^\\h*HostbasedAuthentication\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*HostbasedAuthentication\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_3.2.1: ["11.5", "2.2"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*HostbasedAuthentication\s*\t*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sHostbasedAuthentication\s+yes' + + # 5.2.9 Ensure SSH PermitEmptyPasswords is disabled. (Automated) + - id: 31626 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the PermitEmptyPasswords parameter as follows: PermitEmptyPasswords no Run the following command to comment out any PermitEmptyPasswords parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi '^\\h*PermitEmptyPasswords\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*PermitEmptyPasswords\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.9"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitEmptyPasswords\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitEmptyPasswords\s+yes' + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled. (Automated) + - id: 31627 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the PermitUserEnvironment parameter as follows: PermitUserEnvironment no Run the following command to comment out any PermitUserEnvironment parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi '^\\h*PermitUserEnvironment\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*PermitUserEnvironment\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_3.2.1: ["11.5", "2.2"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*PermitUserEnvironment\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\sPermitUserEnvironment\s+yes' + + # 5.2.11 Ensure SSH IgnoreRhosts is enabled. (Automated) + - id: 31628 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the IgnoreRhosts parameter as follows: IgnoreRhosts yes Run the following command to comment out any IgnoreRhosts parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than yes # grep -Pi '^\\h*IgnoreRhosts\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'yes' | while read -r l_out; do sed -ri \"/^\\s*IgnoreRhosts\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.11"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:\s*ignorerhosts\s*yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*ignorerhosts\s+no' + + # 5.2.12 Ensure SSH X11 forwarding is disabled. (Automated) + - id: 31629 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the X11Forwarding parameter as follows: X11Forwarding no Run the following command to comment out any X11Forwarding parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no # grep -Pi '^\\h*X11Forwarding\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*X11Forwarding\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1210"] + - nist_sp_800-53: ["CM-7"] + - pci_dss_3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*X11Forwarding\s*no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*x11forwarding\s+yes' + + # 5.2.13 Ensure SSH AllowTcpForwarding is disabled. (Automated) + - id: 31630 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments that employ mainframe systems as their application backends. In those environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the AllowTcpForwarding parameter as follows: AllowTcpForwarding no Run the following command to comment out any AllowTcpForwarding parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting other than no: # grep -Pi '^\\h*AllowTcpForwarding\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | grep -Evi 'no' | while read -r l_out; do sed -ri \"/^\\s*AllowTcpForwarding\\s+/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + references: + - "https://www.ssh.com/ssh/tunneling/example" + compliance: + - cis: ["5.2.13"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1048", "T1048.002", "T1572"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_3.2.1: ["11.5", "2.2"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*AllowTcpForwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*AllowTcpForwarding\s+yes' + + # 5.2.14 Ensure system-wide crypto policy is not over-ridden. (Automated) + - id: 31631 + title: "Ensure system-wide crypto policy is not over-ridden." + description: "System-wide Crypto policy can be over-ridden or opted out of for openSSH." + rationale: "Over-riding or opting out of the system-wide crypto policy could allow for the use of less secure Ciphers, MACs, KexAlgorithms and GSSAPIKexAlgorithm." + remediation: "Run the following commands: # sed -ri \"s/^\\s*(CRYPTO_POLICY\\s*=.*)$/# \\1/\" /etc/sysconfig/sshd /etc/ssh/sshd_config.d/*.conf # systemctl reload sshd." + compliance: + - cis: ["5.2.14"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["SC-8"] + - pci_dss_3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'not f:/etc/sysconfig/sshd -> r:^\s*CRYPTO_POLICY=' + + # 5.2.15 Ensure SSH warning banner is configured. (Automated) + - id: 31632 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the Banner parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.2.15"] + - mitre_mitigations: ["M1035"] + - mitre_tactics: ["TA0001", "TA0007"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - 'c:sshd -T -C user=root -> r:^\s*Banner\s*/\w+' + + # 5.2.16 Ensure SSH MaxAuthTries is set to 4 or less. (Automated) + - id: 31633 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the MaxAuthTries parameter as follows: MaxAuthTries 4 Run the following command to comment out any MaxAuthTries parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting greater than 4: # grep -Pi '^\\h*maxauthtries\\h+([5-9]|[1-9][0-9]+)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*maxauthtries\\s+([5-9]|[1-9][0-9]+)/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.16"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - mitre_mitigations: ["M1036"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'f:/etc/ssh/sshd_config -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.2.17 Ensure SSH MaxStartups is configured. (Automated) + - id: 31634 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the MaxStartups parameter as follows: MaxStartups 10:30:60 Run the following command to comment out any MaxStartups parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting greater than 10:30:60: # grep -Pi '^\\s*maxstartups\\s+(((1[1-9]|[1-9][0-9][0-9]+):([0-9]+):([0- 9]+))|(([0-9]+):(3[1-9]|[4-9][0-9]|[1-9][0-9][0-9]+):([0-9]+))|(([0-9]+):([0- 9]+):(6[1-9]|[7-9][0-9]|[1-9][0-9][0-9]+)))' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*MaxStartups\\s+(((1[1-9]|[1-9][0-9][0-9]+):([0-9]+):([0-9]+))|(([0- 9]+):(3[1-9]|[4-9][0-9]|[1-9][0-9][0-9]+):([0-9]+))|(([0-9]+):([0-9]+):(6[1- 9]|[7-9][0-9]|[1-9][0-9][0-9]+)))/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1499", "T1499.002"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_3.2.1: ["11.5", "2.2"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'c:sshd -T -C user=root -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30' + - 'f:/etc/ssh/sshd_config -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60' + + # 5.2.18 Ensure SSH MaxSessions is set to 10 or less. (Automated) + - id: 31635 + title: "Ensure SSH MaxSessions is set to 10 or less." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the MaxSessions parameter as follows: MaxSessions 10 Run the following command to comment out any MaxSessions parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting greater than 10 # grep -Pi '^\\s*MaxSessions\\s+(1[1-9]|[2-9][0-9]|[1-9][0-9][0-9]+)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*MaxSessions\\s+(1[1-9]|[2-9][0-9]|[1-9][0-9][0-9]+)/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.18"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1499", "T1499.002"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: any + rules: + - 'c:sshd -T -C user=root -> n:^\s*MaxSessions\s+(\d+) compare <= 10' + - 'not f:/etc/ssh/sshd_config -> n:^\s*MaxSessions\s+(\d+) compare > 10' + + # 5.2.19 Ensure SSH LoginGraceTime is set to one minute or less. (Automated) + - id: 31636 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60 Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the LoginGraceTime parameter as follows: LoginGraceTime 60 -or- LoginGraceTime 1m Run the following command to comment out any LoginGraceTime parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include any setting equal to 0 or greater than 60 seconds: # grep -Pi '^\\s*LoginGraceTime\\s+(0|6[1-9]|[7-9][0-9]|[1-9][0-9][0- 9]+|[^1]m)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read - r l_out; do sed -ri \"/^\\s*LoginGraceTime\\s+(0|6[1-9]|[7-9][0-9]|[1-9][0-9][0- 9]+|[^1]m)/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + compliance: + - cis: ["5.2.19"] + - mitre_mitigations: ["M1036"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003", "T1110.004"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60 && n:^\s*LoginGraceTime\s*\t*(\d+) compare > 0' + - 'f:/etc/ssh/sshd_config -> n:^\s*LoginGraceTime\s*\t*(\d+) compare <= 60 && n:^\s*LoginGraceTime\s*\t*(\d+) compare > 0' + + # 5.2.20 Ensure SSH Idle Timeout Interval is configured. (Automated) + - id: 31637 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "NOTE: To clarify, the two settings described below are only meant for idle connections from a protocol perspective and not meant to check if the user is active or not. An idle user does not mean an idle connection. SSH does not, and never had, intentionally the capability to drop idle users. In SSH versions before 8.2p1 there was a bug that caused these values to behave in such a manner that they were abused to disconnect idle users. This bug has been resolved in 8.2p1 and thus may no longer be abused to disconnect idle users. The two options ClientAliveInterval and ClientAliveCountMax control the timeout of SSH sessions. Taken directly from man 5 sshd_config: - ClientAliveInterval Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax Sets the number of client alive messages which may be sent without sshd(8) receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. It is important to note that the use of client alive messages is very different from TCPKeepAlive. The client alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The client alive mechanism is valuable when the client or server depend on knowing when a connection has become unresponsive. The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds. Setting a zero ClientAliveCountMax disables connection termination." + rationale: "In order to prevent resource exhaustion, appropriate values should be set for both ClientAliveInterval and ClientAliveCountMax. Specifically, looking at the source code, ClientAliveCountMax must be greater than zero in order to utilize the ability of SSH to drop idle connections. If connections are allowed to stay open indefinitely, this can potentially be used as a DDOS attack or simple resource exhaustion could occur over unreliable networks. The example set here is a 45 second timeout. Consult your site policy for network timeouts and apply as appropriate." + remediation: "Edit or create a file ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file and set the ClientAliveInterval and ClientAliveCountMax parameters according to site policy. Example: ClientAliveInterval 15 ClientAliveCountMax 3 Edit files ending in *.conf in the /etc/ssh/sshd_config.d/ directory and the /etc/ssh/sshd_config file and remove occurrences of the ClientAliveInterval and ClientAliveCountMax parameters not in accordence with local site policy. Run the following command to comment out any ClientAliveCountMax parameter entries in files ending in *.conf in the /etc/ssh/sshd_config.d/ directory or the /etc/ssh/sshd_config file that include the setting of 0 \"disabled\": # grep -Pi '^\\h*ClientAliveCountMax\\h+0\\b' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf | while read -r l_out; do sed -ri \"/^\\s*ClientAliveCountMax\\s+0/s/^/# /\" \"$(awk -F: '{print $1}' <<< $l_out)\";done." + references: + - "https://man.openbsd.org/sshd_config" + compliance: + - cis: ["5.2.20"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + condition: all + rules: + - 'c:sshd -T -C user=root -> n:^\s*ClientAliveInterval\s*\t*(\d+) compare > 0 && n:^\s*ClientAliveInterval\s*\t*(\d+) compare <= 900' + - 'c:sshd -T -C user=root -> n:^\s*ClientAliveCountMax\s*\t*(\d+) compare == 0' + + ############################################################ + # 5.3 Configure privilege escalation + ############################################################ + + # 5.3.1 Ensure sudo is installed. (Automated) + - id: 31638 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plug-in architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plug-ins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers and any entries in /etc/sudoers.d. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Run the following command to install sudo # dnf install sudo." + compliance: + - cis: ["5.3.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - "c:rpm -q sudo -> r:sudo-" + + # 5.3.2 Ensure sudo commands use pty. (Automated) + - id: 31639 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo terminal (pseudo-pty)." + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: "Edit the file /etc/sudoers with visudo or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["5.3.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1026", "M1038"] + - mitre_tactics: ["TA0001", "TA0003"] + - mitre_techniques: ["T1078", "T1078.003", "T1548", "T1548.003"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*Defaults\s+use_pty' + - 'd:/etc/sudoers.d -> r:\. -> r:^\s*Defaults\s+use_pty' + + # 5.3.3 Ensure sudo log file exists. (Automated) + - id: 31640 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files. Creation of additional log files can cause disk space exhaustion if not correctly managed. You should configure logrotate to manage the sudo log in accordance with your local policy." + remediation: 'Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Defaults logfile="" Example Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["5.3.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^Defaults logfile="' + - 'd:/etc/sudoers.d -> r:\. -> r:^Defaults\s+logfile="' + + # 5.3.4 Ensure users must provide password for escalation. (Automated) + - id: 31641 + title: "Ensure users must provide password for escalation." + description: "The operating system must be configured so that users must provide a password for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + impact: "This will prevent automated processes from being able to elevate privileges. To include Ansible and AWS builds." + remediation: "Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any line with occurrences of NOPASSWD tags in the file." + compliance: + - cis: ["5.3.4"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*# && r:NOPASSWD' + - 'd:/etc/sudoers.d -> r:\. -> !r:^\s*# && r:NOPASSWD' + + # 5.3.5 Ensure re-authentication for privilege escalation is not disabled globally. (Automated) + - id: 31642 + title: "Ensure re-authentication for privilege escalation is not disabled globally." + description: "The operating system must be configured so that users must re-authenticate for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + remediation: "Configure the operating system to require users to reauthenticate for privilege escalation. Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any occurrences of !authenticate tags in the file(s)." + compliance: + - cis: ["5.3.5"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^\s*# && r:!authenticate' + - 'd:/etc/sudoers.d -> r:\. -> !r:^\s*# && r:!authenticate' + + # 5.3.6 Ensure sudo authentication timeout is configured correctly. (Automated) + - id: 31643 + title: "Ensure sudo authentication timeout is configured correctly." + description: "sudo caches used credentials for a default of 5 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized privileged access to another user." + remediation: "If the currently configured timeout is larger than 15 minutes, edit the file listed in the audit section with visudo -f and modify the entry timestamp_timeout= to 15 minutes or less as per your site policy. The value is in minutes. This particular entry may appear on its own, or on the same line as env_reset. See the following two examples: Defaults env_reset, timestamp_timeout=15 Defaults timestamp_timeout=15 Defaults env_reset." + references: + - "https://www.sudo.ws/man/1.9.0/sudoers.man.html" + compliance: + - cis: ["5.3.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'not f:/etc/sudoers -> !r:^\s*\t*# && r:timestamp_timeout\s*\t*=\s*\t*-1' + - 'not d:/etc/sudoers.d -> r:\.+ -> !r:^\s*\t*# && r:timestamp_timeout\s*\t*=\s*\t*-1' + - 'not f:/etc/sudoers -> !r:^\s*\t*# && n:timestamp_timeout\s*\t*=\s*\t*(\d+) compare > 15' + - 'not d:/etc/sudoers.d -> r:\.+ -> !r:^\s*\t*# && n:timestamp_timeout\s*\t*=\s*\t*(\d+) compare > 15' + + # 5.3.7 Ensure access to the su command is restricted. (Automated) + - id: 31644 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.3.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1078"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/su -> r:^auth\s*\t*required\s*\t*pam_wheel.so\s*\t*use_uid' + + ############################################### + # 5.4 Configure authselect + ############################################### + + # 5.4.1 Ensure custom authselect profile is used. (Manual) + - id: 31645 + title: "Ensure custom authselect profile is used." + description: "A custom profile can be created by copying and customizing one of the default profiles. The default profiles include: sssd, winbind, or the nis. This profile can then be customized to follow site specific requirements. You can select a profile for the authselect utility for a specific host. The profile will be applied to every user logging into the host." + rationale: "A custom profile is required to customize many of the pam options. When you deploy a profile, the profile is applied to every user logging into the given host." + remediation: "Run the following command to create a custom authselect profile: # authselect create-profile Example: # authselect create-profile custom-profile -b sssd --symlink-meta Run the following command to select a custom authselect profile: # authselect select custom/ {with-} Example: # authselect select custom/custom-profile with-sudo with-faillock without-nullok." + compliance: + - cis: ["5.4.1"] + - cis_csc_v8: ["16.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - iso_27001-2013: ["A.9.2.6"] + - pci_dss_3.2.1: ["6.3.2"] + - pci_dss_4.0: ["6.3.1"] + condition: all + rules: + - 'c:authselect list -> r:^\w*\s*custom' + - "f:/etc/authselect/authselect.conf -> r:custom" + + # 5.4.2 Ensure authselect includes with-faillock. (Automated) + - id: 31646 + title: "Ensure authselect includes with-faillock." + description: "The pam_faillock.so module maintains a list of failed authentication attempts per user during a specified interval and locks the account in case there were more than the configured number of consecutive failed authentications (this is defined by the deny parameter in the faillock configuration). It stores the failure records into per-user files in the tally directory." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Run the following commands to include the with-faillock option to the current authselect profile: # authselect enable-feature with-faillock # authselect apply-changes." + compliance: + - cis: ["5.4.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.2.6"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_3.2.1: ["11.5", "2.2"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:required && r:pam_faillock.so" + - "f:/etc/pam.d/system-auth -> r:required && r:pam_faillock.so" + + ############################################### + # 5.5 Configure PAM + ############################################### + + # 5.5.1 Ensure password creation requirements are configured. (Automated) + - id: 31647 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options. - try_first_pass - retrieve the password from a previous stacked PAM module. If not available, then prompt the user for a password. - retry=3 - Allow 3 tries before sending back a failure. - minlen=14 - password must be 14 characters or more Either of the following can be used to enforce complex passwords: - minclass=4 - provide at least four classes of characters for the new password OR - dcredit=-1 - provide at least one digit - ucredit=-1 - provide at least one uppercase character - ocredit=-1 - provide at least one special character - lcredit=-1 - provide at least one lowercase character The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy minclass = 4 OR dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Run the following script to update the system-auth and password-auth files #!/usr/bin/env bash for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+.*enforce_for_r oot\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 enforce_for_root/' \"$file\" fi if grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=([4- 9]|[1-9][0-9]+)\\b.*$' \"$file\"; then sed -ri '/pwquality/s/retry=\\S+/retry=3/' \"$file\" elif ! grep -Pq -- '^\\h*password\\h+requisite\\h+pam_pwquality.so(\\h+[^#\\n\\r]+)?\\h+retry=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+requisite\\s+pam_pwquality.so\\s+)(.*)$/\\1\\2 retry=3/' \"$file\" fi done authselect apply-changes." + compliance: + - cis: ["5.5.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.002", "T1110.003", "T1178.001", "T1178.002", "T1178.003", "T1178.004"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "f:/etc/pam.d/password-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - "f:/etc/pam.d/system-auth -> r:pam_pwquality.so && r:try_first_pass && r:retry=" + - 'f:/etc/security/pwquality.conf -> n:^\s*minlen\s+\t*=\s+\t*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> r:^\s*minclass|^\s*\Scredit' + + # 5.5.2 Ensure lockout for failed password attempts is configured. (Automated) + - id: 31648 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. - deny= - Number of attempts before the account is locked - unlock_time= - Time in seconds before the account is unlocked Note: The maximum configurable value for unlock_time is 604800." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + impact: "Use of unlock_time=0 may allow an attacker to cause denial of service to legitimate users." + remediation: "Set password lockouts and unlock times to conform to site policy. deny should be greater than 0 and no greater than 5. unlock_time should be 0 (never), or 900 seconds or greater. Edit /etc/security/faillock.conf and update or add the following lines: deny = 5 unlock_time = 900." + compliance: + - cis: ["5.5.2"] + - cis_csc_v8: ["6.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1"] + - hipaa: ["164.308(a)(3)(ii)(C)"] + - iso_27001-2013: ["A.9.2.6"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - nist_sp_800-53: ["AC-2(1)"] + - pci_dss_3.2.1: ["8.1.3"] + - pci_dss_4.0: ["8.2.4", "8.2.5"] + - soc_2: ["CC6.2", "CC6.3"] + condition: all + rules: + - 'f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:deny\s*\t*=\s*\t*(\d+) compare <= 5' + - 'not f:/etc/security/faillock.conf -> !r:^\s*\t*# && n:unlock_time\s*\t*=\s*\t*(\d+) compare > 0 && n:unlock_time\s*\t*=\s*\t*(\d+) compare < 900' + + # 5.5.3 Ensure password reuse is limited. (Automated) + - id: 31649 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords. - remember=<5> - Number of old passwords to remember." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note: These change only apply to accounts configured on the local system." + remediation: "Set remembered password history to conform to site policy. Run the following script to add or modify the pam_pwhistory.so and pam_unix.so lines to include the remember option: #!/usr/bin/env bash { file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/system-auth\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so\\s+([^# \\n\\r]+\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file elif grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_pwhistory\\.so\\h+([^#\\n\\ r]+\\h+)?.*$' \"$file\"; then sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_pwhistory\\.so/ s/$/ remember=5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/i password required pam_pwhistory.so remember=5 use_authtok' $file fi fi if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=([5-9]|[1-9][0-9]+)\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so\\h+([^#\\n\\r]+\\h +)?remember=\\d+\\b.*$' \"$file\"; then sed -ri 's/^\\s*(password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so\\s+([^#\\n\\r] +\\s+)?)(remember=\\S+\\s*)(\\s+.*)?$/\\1 remember=5 \\5/' $file else sed -ri '/^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix\\.so/ s/$/ remember=5/' $file fi fi authselect apply-changes }." + compliance: + - cis: ["5.5.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.004"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+requisite\.+pam_pwhistory\.so\.+ && n:remember=(\d+) compare >= 5' + - 'f:/etc/pam.d/system-auth -> r:^\s*password\.+sufficient\.+pam_unix\.so\.+ && n:remember=(\d+) compare >= 5' + + # 5.5.4 Ensure password hashing algorithm is SHA-512 or yescrypt. (Automated) + - id: 31650 + title: "Ensure password hashing algorithm is SHA-512 or yescrypt." + description: "A cryptographic hash function converts an arbitrary-length input into a fixed length output. Password hashing performs a one-way transformation of a password, turning the password into another string, called the hashed password." + rationale: "The SHA-512 algorithm provides stronger hashing than other hashing algorithms used for password hashing with Linux, providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note: These changes only apply to accounts configured on the local system." + remediation: "Set password hashing algorithm to sha512. Edit /etc/libuser.conf and edit of add the following line: crypt_style = sha512 Edit /etc/login.defs and edit or add the following line: ENCRYPT_METHOD SHA512 Run the following script to configure pam_unix.so to use the sha512 hashing algorithm: #!/usr/bin/env bash { for fn in system-auth password-auth; do file=\"/etc/authselect/$(head -1 /etc/authselect/authselect.conf | grep 'custom/')/$fn\" if ! grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+sha512\\b.*$' \"$file\"; then if grep -Pq -- '^\\h*password\\h+(requisite|required|sufficient)\\h+pam_unix\\.so(\\h+[^#\\n\\r]+)? \\h+(md5|blowfish|bigcrypt|sha256|yescrypt)\\b.*$' \"$file\"; then sed -ri 's/(md5|blowfish|bigcrypt|sha256|yescrypt)/sha512/' \"$file\" else sed -ri 's/(^\\s*password\\s+(requisite|required|sufficient)\\s+pam_unix.so\\s+)(.*)$/\\1s ha512 \\3/' \"$file\" fi fi done authselect apply-changes } Note: This only effects local users and passwords created after updating the files to use sha512. If it is determined that the password algorithm being used is not SHA-512, once it is changed, it is recommended that all user ID's be immediately expired and forced to change their passwords on next login." + compliance: + - cis: ["5.5.4"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1041"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1003", "T1003.008", "T1110", "T1110.002"] + - nist_sp_800-53: ["IA-5(1)"] + - pci_dss_3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/libuser.conf -> r:^\s*\t*crypt_style\s*\t*=\s*\t*sha512' + - 'f:/etc/login.defs -> r:^\s*\t*ENCRYPT_METHOD SHA512' + - 'f:/etc/pam.d/password-auth -> r:^\s*\t*password\.+sufficient\.+pam_unix\.so' + - 'f:/etc/pam.d/system-auth -> r:^\s*\t*password\.+sufficient\.+pam_unix\.so' + + ############################################### + # 5.6 User Accounts and Environment + ############################################### + ############################################### + # 5.6.1 Set Shadow Password Suite Parameters + ############################################### + + # 5.6.1.1 Ensure password expiration is 365 days or less. (Automated) + - id: 31651 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + compliance: + - cis: ["5.6.1.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.001", "T1110.002", "T1110.003", "T1110.004"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_3.2.1: ["11.5", "2.2"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:(\d+):\S*:\S*:\S*:\S* compare > 365' + + # 5.6.1.2 Ensure minimum days between password changes is configured. (Automated) + - id: 31652 + title: "Ensure minimum days between password changes is configured." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 1 in /etc/login.defs: PASS_MIN_DAYS 1 Modify user parameters for all users with a password set to match: # chage --mindays 1 ." + compliance: + - cis: ["5.6.1.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110.004"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS^\s*\t*(\d+) compare >=1' + - 'f:/etc/shadow -> !r:^\w+:\p: && n:^\w+:\S*:\d*:(\d+): compare < 1' + + # 5.6.1.3 Ensure password expiration warning days is 7 or more. (Automated) + - id: 31653 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs : PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["5.6.1.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1078"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_3.2.1: ["11.5", "2.2"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + - 'f:/etc/shadow -> n:^\w+:\S*:\S*:\S*:\S*:(\d+):\S*:\S*:\S* compare >= 7' + - 'not f:/etc/shadow -> r:^\w+:\S*:\S*:\S*:\S*::\S*:\S*:\S*' + + # 5.6.1.4 Ensure inactive password lock is 30 days or less. (Automated) + - id: 31654 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["5.6.1.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.002", "T1078.003"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^\s*INACTIVE\s*=\s*\t*(\d+) compare <= 30' + - 'f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && n:^\w+:\S*:\S*:\S*:\S*:\S*:(\d+):\S*:\S* compare <= 30' + - 'not f:/etc/shadow -> !r:^\w+:!|^\w+:\p: && r:^\w+:\S*:\S*:\S*:\S*:\S*::\S*:\S*' + + # 5.6.1.5 Ensure all users last password change date is in the past. (Automated) - Not Implemented + # 5.6.2 Ensure system accounts are secured. (Automated) - Not Implemented + # 5.6.3 Ensure default user shell timeout is 900 seconds or less. (Automated) - Not Implemented + + # 5.6.4 Ensure default group for the root account is GID 0. (Automated) + - id: 31655 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root account belongs to. This affects permissions of files that are created by the root account." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root account default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.6.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548"] + - nist_sp_800-53: ["CM-1", "CM-2", "CM-6", "CM-7", "IA-5"] + - pci_dss_3.2.1: ["11.5", "2.2"] + - pci_dss_4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/passwd -> r:^root:x:0:0" + + # 5.6.5 Ensure default user umask is 027 or more restrictive. (Automated) - Not Implemented + # 5.6.6 Ensure root password is set. (Automated) - Not Implemented + + ############################################### + # 6 System Maintenance + ############################################### + ############################################### + # 6.1 System File Permissions + ############################################### + + # 6.1.1 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 31656 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd: # chmod u-x,go-wx /etc/passwd # chown root:root /etc/passwd." + compliance: + - cis: ["6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.2 Ensure permissions on /etc/passwd- are configured. (Automated) + - id: 31657 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd-: # chmod u-x,go-wx /etc/passwd- # chown root:root /etc/passwd-." + compliance: + - cis: ["6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.3 Ensure permissions on /etc/group are configured. (Automated) + - id: 31658 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group: # chmod u-x,go-wx /etc/group # chown root:root /etc/group." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.4 Ensure permissions on /etc/group- are configured. (Automated) + - id: 31659 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group-: # chmod u-x,go-wx /etc/group- # chown root:root /etc/group-." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0644/-rw-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.5 Ensure permissions on /etc/shadow are configured. (Automated) + - id: 31660 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the following commands to set mode, owner, and group on /etc/shadow: # chown root:root /etc/shadow # chmod 0000 /etc/shadow." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.6 Ensure permissions on /etc/shadow- are configured. (Automated) + - id: 31661 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set mode, owner, and group on /etc/shadow-: # chown root:root /etc/shadow- # chmod 0000 /etc/shadow-." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.7 Ensure permissions on /etc/gshadow are configured. (Automated) + - id: 31662 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run the following commands to set mode, owner, and group on /etc/gshadow: # chown root:root /etc/gshadow # chmod 0000 /etc/gshadow." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-3", "MP-2"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.8 Ensure permissions on /etc/gshadow- are configured. (Automated) + - id: 31663 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set mode, owner, and group on /etc/gshadow-: # chown root:root /etc/gshadow- # chmod 0000 /etc/gshadow-." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0000/----------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.9 Ensure no world writable files exist. (Automated) - Not Implemented + # 6.1.10 Ensure no unowned files or directories exist. (Automated) - Not Implemented + # 6.1.11 Ensure no ungrouped files or directories exist. (Automated) - Not Implemented + # 6.1.12 Ensure sticky bit is set on all world-writable directories. (Automated) - Not Implemented + # 6.1.13 Audit SUID executables. (Manual) - Not Implemented + # 6.1.14 Audit SGID executables. (Manual) - Not Implemented + # 6.1.15 Audit system file permissions. (Manual) - Not Implemented + + ################################################ + # 6.2 User and Group Settings + ################################################ + + # 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords. (Automated) + - id: 31664 + title: "Ensure accounts in /etc/passwd use shadowed passwords." + description: "Local accounts can use shadowed passwords. With shadowed passwords, the passwords are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. Accounts with a shadowed password have an x in the second field in /etc/passwd." + rationale: "The /etc/passwd file also contains information like user ID's and group ID's that are used by many system programs. Therefore, the /etc/passwd file must remain world readable. In spite of encoding the password with a randomly-generated one-way hash function, an attacker could still break the system if they got access to the /etc/passwd file. This can be mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. This helps mitigate the risk of an attacker gaining access to the encoded passwords with which to perform a dictionary attack. Note: - All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user. - A user account with an empty second field in /etc/passwd allows the account to be logged into by providing only the username." + remediation: "Run the following command to set accounts to use shadowed passwords: # sed -e 's/^\\([a-zA-Z0-9_]*\\):[^:]*:/\\1:x:/' -i /etc/passwd Investigate to determine if the account is logged in and what it is being used for, to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1003", "T1003.008"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^\w+:x:' + + # 6.2.2 Ensure /etc/shadow password fields are not empty. (Automated) + - id: 31665 + title: "Ensure /etc/shadow password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - pci_dss_4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + # 6.2.3 Ensure all groups in /etc/passwd exist in /etc/group. (Automated) - Not Implemented + # 6.2.4 Ensure no duplicate UIDs exist. (Automated) - Not Implemented + # 6.2.5 Ensure no duplicate GIDs exist. (Automated) - Not Implemented + # 6.2.6 Ensure no duplicate user names exist. (Automated) - Not Implemented + # 6.2.7 Ensure no duplicate group names exist. (Automated) - Not Implemented + # 6.2.8 Ensure root PATH Integrity. (Automated) - Not Implemented + + # 6.2.9 Ensure root is the only UID 0 account. (Automated) + - id: 31666 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.9"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1548"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^\s*root && n:^\w+:\S*:(\d+):\S*:\S*:\S*:\S* compare == 0' + + # 6.2.10 Ensure local interactive user home directories exist. (Automated) - Not Implemented + # 6.2.11 Ensure local interactive users own their home directories. (Automated) - Not Implemented + # 6.2.12 Ensure local interactive user home directories are mode 750 or more restrictive. (Automated) - Not Implemented + # 6.2.13 Ensure no local interactive user has .netrc files. (Automated) - Not Implemented + # 6.2.14 Ensure no local interactive user has .forward files. (Automated) - Not Implemented + # 6.2.15 Ensure no local interactive user has .rhosts files. (Automated) - Not Implemented + # 6.2.16 Ensure local interactive user dot files are not group or world writable. (Automated) - Not Implemented diff --git a/etc/ruleset/sca/sles/11/cis_sles11_linux.yml b/etc/ruleset/sca/sles/11/cis_sles11_linux.yml new file mode 100644 index 0000000000..ae3b3d1105 --- /dev/null +++ b/etc/ruleset/sca/sles/11/cis_sles11_linux.yml @@ -0,0 +1,931 @@ +# Security Configuration Assessment +# CIS Checks for SUSE SLES 11 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# CIS Benchmark for SUSE Linux Enterprise Server 11 v2.1.0 - 08-13-2020 + +policy: + id: "cis_sles11_linux" + file: "cis_sles11_linux.yml" + name: "CIS SUSE Linux Enterprise 11 Benchmark v2.1.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for SUSE Linux Enterprise 11 systems running on x86 and x64 platforms. This document was tested against SUSE Linux Enterprise Server 11 SP4." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Suse 11 version" + description: "Requirements for running the SCA scan against SUSE Linux Enterprise Server 11" + condition: any + rules: + - "f:/etc/os-release -> r:SUSE Linux Enterprise Server 11" + - "f:/etc/SuSE-release -> r:SUSE Linux Enterprise Server 11" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # Section 1.1 - Filesystem Configuration + - id: 7000 + title: "Ensure separate partition exists for /tmp" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + - id: 7001 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + - id: 7002 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,nosuid /tmp" + compliance: + - cis: ["1.1.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + # 1.1.5 /tmp: noexec + - id: 7003 + title: "Ensure noexec option set on /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + # 1.1.6 Build considerations - Partition scheme. + - id: 7004 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + - id: 7005 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + # 1.1.12 /var/log/audit: partition + - id: 7006 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog ) consume space in the same partition as auditd, it may not perform as desired." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + # 1.1.13 /home: partition + - id: 7007 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.13"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + - id: 7008 + title: "Ensure nodev option set on /home partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. See the fstab(5) manual page for more information. # mount -o remount,nodev /home. Notes: The actions in this recommendation refer to the /home partition, which is the default user partition that is defined. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." + compliance: + - cis: ["1.1.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + # 1.1.15 /dev/shm: nodev + - id: 7009 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm : # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + # 1.1.16 /dev/shm: nosuid + - id: 7010 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm : # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + # 1.1.17 /dev/shm: noexec + - id: 7011 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm : # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.17"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + ############################################### + # 1.4 Secure Boot Settings + ############################################### + # 1.4.2 Set Boot Loader Password (Scored) + - id: 7012 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: "Create an encrypted password with grub-md5-crypt : # grub-md5-crypt. The result is an . Copy and paste the into the global section of /boot/grub/menu.lst: password --md5 Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + compliance: + - cis: ["1.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - "f:/boot/grub/menu.lst -> r:^password --md5" + + ############################################### + # 1.5 Additional Process Hardening + ############################################### + # 1.5.1 Restrict Core Dumps (Scored) + - id: 7013 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to the /etc/security/limits.conf file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0. Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0." + compliance: + - cis: ["1.5.1"] + - cis_csc: ["13"] + condition: all + rules: + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:^fs.suid_dumpable\s*=\s*0\s*$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + + # 1.5.3 Enable Randomized Virtual Memory Region Placement (Scored) + - id: 7014 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2. Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["8.4"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^\s*kernel.randomize_va_space\s*=\s*2' + + ############################################### + # 2 OS Services + ############################################### + ############################################### + # 2.1 Remove Legacy Services + ############################################### + # Section 2.1 - inetd Services + - id: 7015 + title: "Ensure chargen services are not enabled" + description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable chargen and chargen-udp : # chkconfig chargen off # chkconfig chargen-udp off" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:chkconfig --list -> r:chargen:|chargen-udp: && r::on" + + - id: 7016 + title: "Ensure daytime services are not enabled" + description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable daytime - and daytime-udp: # chkconfig daytime-off # chkconfig daytime-udp off" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:chkconfig --list -> r:daytime:|daytime-udp: && r::on" + + - id: 7017 + title: "Ensure discard services are not enabled" + description: "discard is a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable discard and discard-udp: # chkconfig discard off # chkconfig discard-udp off" + compliance: + - cis: ["2.1.3"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:chkconfig --list -> r:discard:|discard-udp: && r::on" + + - id: 7018 + title: "Ensure echo services are not enabled" + description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable echo and echo-udp: # chkconfig echo off # chkconfig echo-udp off" + compliance: + - cis: ["2.1.4"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:chkconfig --list -> r:echo:|echo-udp: && r::on" + + - id: 7019 + title: "Ensure time services are not enabled" + description: "timeis a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable time and time-udp: # chkconfig time off # chkconfig time-udp off" + compliance: + - cis: ["2.1.5"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:chkconfig --list -> r:time:|time-udp: && r::on" + + - id: 7020 + title: "Ensure rsh server is not enabled" + description: "The Berkeley rsh-server ( rsh , rlogin , rexec ) package contains legacy services that exchange credentials in clear-text." + rationale: "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." + remediation: "Run the following commands to disable rsh , rlogin , and rexec : # chkconfig rexec off # chkconfig rlogin off # chkconfig rsh off" + compliance: + - cis: ["2.1.6"] + - cis_csc: ["3.4", "9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:rexec:|rlogin:|rsh: && r::on" + + - id: 7021 + title: "Ensure talk server is not enabled" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable talk: # chkconfig talk off" + compliance: + - cis: ["2.1.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:talk: && r::on" + + - id: 7022 + title: "Ensure telnet server is not enabled" + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to disable telnet: # chkconfig telnet off" + compliance: + - cis: ["2.1.8"] + - cis_csc: ["3.4", "9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:telnet: && r::on" + + - id: 7023 + title: "Ensure tftp server is not enabled" + description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package atftp is used to define and support a TFTP server." + rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." + remediation: "Run the following command to disable tftp: # chkconfig tftp off" + compliance: + - cis: ["2.1.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:tftp: && r::on" + + - id: 7024 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsyncd : # chkconfig rsyncd off" + compliance: + - cis: ["2.1.10", "2.2.17"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:rsync: && r::on" + + ############################################### + # 2 Special Purpose Services + ############################################### + - id: 7025 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://tools.ietf.org/html/rfc958. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod limited nomodify notrap nopeer noquery restrict -6 default kod limited nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Add or edit the NTPD_OPTIONS in /etc/sysconfig/ntp to include '-u ntp:ntp': NTPD_OPTIONS='-u ntp:ntp'" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: any + rules: + - "f:/etc/ntp.conf -> r:restrict -4 default && r:kod && r:limited && r:nomodify && r:notrap && r:nopeer && r:noquery" + - "f:/etc/ntp.conf -> r:restrict -6 default && r:kod && r:limited && r:nomodify && r:notrap && r:nopeer && r:noquery" + - "f:/etc/ntp.conf -> r:^server|^pool" + - "f:/etc/sysconfig/ntp -> r:NTPD_OPTIONS= && r:-u && r:ntp:ntp" + + # 2.2.2 Remove X Windows (Scored) + - id: 7026 + title: "Ensure X Window System is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: # zypper remove xorg-x11*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:rpm -qa xorg-x11* -> r:^xorg-x11" + + # 2.2.3 Disable Avahi Server (Scored) + - id: 7027 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface." + remediation: "Run the following command to disable avahi-daemon : # chkconfig avahi-daemon off" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:avahi-daemon && r::on" + + - id: 7028 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dhcpd : # chkconfig dhcpd off" + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:chkconfig --list -> r:dhcpd && r::on" + + # 2.2.7 Disable NFS and RPC (Not Scored) + - id: 7029 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs and rpcbind : # chkconfig nfs off # chkconfig rpcbind off" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:nfs|rpcbind && r::on" + + - id: 7030 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable named : # chkconfig named off" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:named && r::on" + + - id: 7031 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd : # chkconfig vsftpd off Notes: Additional FTP servers also exist and should be audited." + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:vsftpd && r::on" + + # 2.2.10 Remove HTTP Server (Not Scored) + - id: 7032 + title: "Ensure HTTP server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the service be disabled to reduce the potential attack surface. Notes: Several httpd servers exist and can use other service names. apache, apache2, lighttpd, and nginx are example services that provide an HTTP server. These and other services should also be audited." + remediation: "Run the following command to disable apache2 : # chkconfig apache2 off" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:chkconfig --list -> r:apache2 && r::on" + + - id: 7033 + title: "Ensure IMAP and POP3 server is not enabled" + description: "cyrus is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cyrus : # chkconfig cyrus off Notes: Several IMAP/POP3 servers exist and can use other service names. dovecot is an example service that provides an IMAP/POP3 server. These and other services should also be audited." + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:cyrus && r::on" + + # 2.2.12 Remove Samba (Not Scored) + - id: 7034 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable smb : # chkconfig smb off" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:smb && r::on" + + - id: 7035 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable squid : # chkconfig squid off" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:squid && r::on" + + - id: 7036 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # chkconfig snmpd off Notes: Additional methods of disabling a service exist. Consult your distribution documentation for appropriate methods." + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:snmpd && r::on" + + - id: 7037 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used." + remediation: "Run the following command to disable ypserv : # chkconfig ypserv off" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:ypserv && r::on" + + # Section 2.3 - Service Clients + - id: 7038 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Run the following command to uninstall ypbind : # zypper remove ypbind" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:rpm -qa ypbind -> r:ypbind" + + ############################################### + # 3 Network Configuration and Firewalls + ############################################### + ############################################### + # 3.1 Modify Network Parameters (Host Only) + ############################################### + # 3.1.1 Disable IP Forwarding (Scored) + - id: 7039 + title: "Ensure IPv4 forwarding is disabled" + description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." + rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.ip_forward -> r:=\s*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*0$' + + # 3.1.2 Disable Send Packet Redirects (Scored) + - id: 7040 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:/sbin/sysctl net.ipv4.conf.all.send_redirects -> r:=\s*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.send_redirects -> r:=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:=\s*0$' + + ############################################### + # 3.2 Modify Network Parameters (Host and Router) + ############################################### + # 3.2.1 Disable Source Routed Packet Acceptance (Scored) + - id: 7041 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*0$' + - 'c:/sbin/sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*0$' + + # 3.2.2 Disable ICMP Redirect Acceptance (Scored) + - id: 7042 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.2.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*0$' + - 'c:/sbin/sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*0$' + + # 3.2.3 Disable Secure ICMP Redirect Acceptance (Scored) + - id: 7043 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.2.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*0$' + - 'c:/sbin/sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*0$' + - 'c:/sbin/sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*0$' + + - id: 7044 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*1$' + - 'c:/sbin/sysctl net.ipv4.conf.all.log_martians -> r:=\s*1$' + - 'c:/sbin/sysctl net.ipv4.conf.default.log_martians -> r:=\s*1$' + + # 3.2.5 Enable Ignore Broadcast Requests (Scored) + - id: 7045 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.2.5"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*1$' + - 'c:/sbin/sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*1$' + + # 3.2.6 Enable Bad Error Message Protection (Scored) + - id: 7046 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.2.6"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*1$' + - 'c:/sbin/sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*1$' + + # 3.2.7 Ensure Reverse Path Filtering is enabled (Scored) + - id: 7047 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*1$' + - 'c:/sbin/sysctl net.ipv4.conf.all.rp_filter -> r:=\s*1$' + - 'c:/sbin/sysctl net.ipv4.conf.default.rp_filter -> r:=\s*1$' + + # 3.2.8 Enable TCP SYN Cookies (Scored) + - id: 7048 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d/ -> r:=\s*1$' + - 'c:/sbin/sysctl net.ipv4.tcp_syncookies -> r:=\s*1$' + + ############################################### + # 5 System Access, Authentication and Authorization + ############################################### + ############################################### + # 5.2 Configure SSH + ############################################### + # 5.2.2 Set SSH Protocol to 2 (Scored) + - id: 7049 + title: "Ensure SSH Protocol is set to 2" + description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:^\s*\t*Protocol\s*\t*2' + + # 5.2.3 Set LogLevel to INFO (Scored) + - id: 7050 + title: "Ensure SSH LogLevel is set to INFO" + description: "The INFO parameter specifies that login and logout activity will be logged." + rationale: "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 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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:LogLevel\.+INFO' + + # 5.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) + - id: 7051 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.5"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'f:$sshd_file -> n:^MaxAuthTries\s+(\d+) compare <= 4' + + # 5.2.6 Set SSH IgnoreRhosts to Yes (Scored) + - id: 7052 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^# && r:IgnoreRhosts\.+yes' + + # 5.2.7 Set SSH HostbasedAuthentication to No (Scored) + - id: 7053 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv , along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*\t*HostbasedAuthentication\.+no' + + # 5.2.8 Disable SSH Root Login (Scored) + - id: 7054 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no. Rationale: Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["5.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*\t*PermitRootLogin\.+no' + + # 5.2.9 Set SSH PermitEmptyPasswords to No (Scored) + - id: 7055 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> r:^\s*\t*PermitEmptyPasswords\.+no' + + ############################################### + # 6 System Maintenance + ############################################### + ############################################### + # 6.2 Review User and Group Settings + ############################################### + # 6.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) + - id: 7056 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' + + - id: 7057 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["16"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' diff --git a/etc/ruleset/sca/sles/12/cis_sles12_linux.yml b/etc/ruleset/sca/sles/12/cis_sles12_linux.yml new file mode 100644 index 0000000000..916783fccc --- /dev/null +++ b/etc/ruleset/sca/sles/12/cis_sles12_linux.yml @@ -0,0 +1,926 @@ +# Security Configuration Assessment +# CIS Checks for SUSE SLES 12 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# CIS Benchmark for SUSE Linux Enterprise 12 v2.1.0 - 12-28-2017 + +policy: + id: "cis_sles12_linux" + file: "cis_sles12_linux.yml" + name: "CIS SUSE Linux Enterprise 12 Benchmark v2.1.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for SUSE Linux Enterprise 12 systems running on x86 and x64 platforms. This document was tested against SUSE Linux Enterprise Server 12 SP3." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Suse 12 version" + description: "Requirements for running the SCA scan against SUSE Linux Enterprise Server 12" + condition: all + rules: + - "f:/etc/os-release -> r:SUSE Linux Enterprise Server 12" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # Section 1.1 - Filesystem Configuration + - id: 7500 + title: "Ensure separate partition exists for /tmp" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /tmp. For systems that were previously installed, create a new partition and configure /etc/fstab or the systemd tmp.mount service as appropriate." + compliance: + - cis: ["1.1.2"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + - id: 7501 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + - id: 7502 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,nosuid /tmp" + compliance: + - cis: ["1.1.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + # 1.1.5 /tmp: noexec + - id: 7503 + title: "Ensure noexec option set on /tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp : # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + # 1.1.6 Build considerations - Partition scheme. + - id: 7504 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + - id: 7505 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + # 1.1.12 /var/log/audit: partition + - id: 7506 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd , stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog ) consume space in the same partition as auditd, it may not perform as desired." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + # 1.1.13 /home: partition + - id: 7507 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.13"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + # 1.1.14 /home: nodev + - id: 7508 + title: "Ensure nodev option set on /home partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. See the fstab(5) manual page for more information. # mount -o remount,nodev /home. Notes: The actions in this recommendation refer to the /home partition, which is the default user partition that is defined. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." + compliance: + - cis: ["1.1.14"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + # 1.1.15 /dev/shm: nodev + - id: 7509 + title: "Ensure nodev option set on /dev/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm : # mount -o remount,nodev /dev/shm Notes: /dev/shm is not specified in /etc/fstab despite being mounted by default. The following line will implement the recommended /dev/shm mount options in /etc/fstab: tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0. Notes: /dev/shm is not specified in /etc/fstab despite being mounted by default. The following line will implement the recommended /dev/shm mount options in /etc/fstab: tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0" + compliance: + - cis: ["1.1.15"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + # 1.1.16 /dev/shm: nosuid + - id: 7510 + title: "Ensure nosuid option set on /dev/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm : # mount -o remount,nosuid /dev/shm Notes: /dev/shm is not specified in /etc/fstab despite being mounted by default. The following line will implement the recommended /dev/shm mount options in /etc/fstab: tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0. Notes: /dev/shm is not specified in /etc/fstab despite being mounted by default. The following line will implement the recommended /dev/shm mount options in /etc/fstab: tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0" + compliance: + - cis: ["1.1.16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + # 1.1.17 /dev/shm: noexec + - id: 7511 + title: "Ensure noexec option set on /dev/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm : # mount -o remount,noexec /dev/shm Notes: /dev/shm is not specified in /etc/fstab despite being mounted by default. The following line will implement the recommended /dev/shm mount options in /etc/fstab: tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0. Notes: /dev/shm is not specified in /etc/fstab despite being mounted by default. The following line will implement the recommended /dev/shm mount options in /etc/fstab: tmpfs /dev/shm tmpfs defaults,nodev,nosuid,noexec 0 0" + compliance: + - cis: ["1.1.17"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + ############################################### + # 1.5 Additional Process Hardening + ############################################### + # 1.5.1 Restrict Core Dumps (Scored) + - id: 7512 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0. Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file:fs.suid_dumpable = 0. Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["13"] + condition: all + rules: + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:\s0$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + + # 1.5.3 Enable Randomized Virtual Memory Region Placement (Scored) + - id: 7513 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2. Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["8.4"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'c:sysctl kernel.randomize_va_space -> r:\s2$|\t2$' + + ############################################### + # 2 OS Services + ############################################### + ############################################### + # 2.1 Remove Legacy Services + ############################################### + # Section 2.1 - inetd Services + - id: 7514 + title: "Ensure chargen services are not enabled" + description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable chargen and chargen-udp : # chkconfig chargen off # chkconfig chargen-udp off" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:chkconfig --list -> r:chargen:|chargen-udp: && r::on" + + - id: 7515 + title: "Ensure daytime services are not enabled" + description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable daytime and daytime-udp: # chkconfig daytime off # chkconfig daytime-udp off" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:chkconfig --list -> r:daytime:|daytime-udp && r::on" + + - id: 7516 + title: "Ensure discard services are not enabled" + description: "discard is a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable discard and discard-udp: # chkconfig discard off # chkconfig discard-udp off" + compliance: + - cis: ["2.1.3"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:chkconfig --list -> r:discard:|discard-udp: && r::on" + + - id: 7517 + title: "Ensure echo services are not enabled" + description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable echo and echo-udp: # chkconfig echo off # chkconfig echo-udp off" + compliance: + - cis: ["2.1.4"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:chkconfig --list -> r:echo:|echo-udp: && r::on" + + - id: 7518 + title: "Ensure time services are not enabled" + description: "timeis a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Run the following commands to disable time and time-udp: # chkconfig time off # chkconfig time-udp off" + compliance: + - cis: ["2.1.5"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:chkconfig --list -> r:time:|time-udp && r::on" + + - id: 7519 + title: "Ensure rsh server is not enabled" + description: "The Berkeley rsh-server (rsh, rlogin, rexec) package contains legacy services that exchange credentials in clear-text." + rationale: "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package." + remediation: "Run the following commands to disable rsh , rlogin , and rexec : # chkconfig rexec off # chkconfig rlogin off # chkconfig rsh off" + compliance: + - cis: ["2.1.6"] + - cis_csc: ["3.4", "9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:rexec:|rlogin:|rsh: && r::on" + + - id: 7520 + title: "Ensure talk server is not enabled" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable talk: # chkconfig talk off" + compliance: + - cis: ["2.1.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:talk: && r::on" + + - id: 7521 + title: "Ensure telnet server is not enabled" + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Run the following command to disable telnet: # chkconfig telnet off" + compliance: + - cis: ["2.1.8"] + - cis_csc: ["3.4", "9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:telnet: && r::on" + + - id: 7522 + title: "Ensure tftp server is not enabled" + description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The package atftp is used to define and support a TFTP server." + rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specific need for TFTP. In that case, extreme caution must be used when configuring the services." + remediation: "Run the following command to disable tftp: # systemctl disable atftpd" + compliance: + - cis: ["2.1.9", "2.2.17"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:tftp: && r::on" + + - id: 7523 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsyncd: # systemctl disable rsyncd" + compliance: + - cis: ["2.1.10", "2.2.18"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:chkconfig --list -> r:rsync: && r::on" + + - id: 7524 + title: "Ensure xinetd is not enabled" + description: "The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the daemon be disabled." + remediation: "Run the following command to disable xinetd : # systemctl disable xinetd" + compliance: + - cis: ["2.1.11"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:systemctl is-enabled xinetd -> r:enabled" + + ############################################### + # 2 Special Purpose Services + ############################################### + - id: 7525 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at https://tools.ietf.org/html/rfc958. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod limited nomodify notrap nopeer noquery restrict -6 default kod limited nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Add or edit the NTPD_OPTIONS in /etc/sysconfig/ntp to include '-u ntp:ntp': NTPD_OPTIONS='-u ntp:ntp'" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod && r:\s+nomodify && r:\s+notrap && r:\s+nopeer && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod && r:\s+nomodify && r:\s+notrap && r:\s+nopeer && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+$|^pool\.+$' + - "f:/etc/sysconfig/ntp -> r:NTPD_OPTIONS= && r:-u && r:ntp:ntp" + + # 2.2.2 Remove X Windows (Scored) + - id: 7526 + title: "Ensure X Window System is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: # zypper remove xorg-x11*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:rpm -qa xorg-x11* -> r:^xorg-x11" + + # 2.2.3 Disable Avahi Server (Scored) + - id: 7527 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface." + remediation: "Run the following command to disable avahi-daemon : # systemctl disable avahi-daemon" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled avahi-daemon -> r:enabled" + + - id: 7528 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dhcpd : # systemctl disable dhcpd" + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:systemctl is-enabled dhcpd -> r:enabled" + + # 2.2.7 Disable NFS and RPC (Not Scored) + - id: 7529 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs and rpcbind : # systemctl disable nfs # systemctl disable rpcbind" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled nfs -> r:enabled" + - "c:systemctl is-enabled rpcbind -> r:enabled" + + - id: 7530 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable named : # systemctl disable named" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled named -> r:enabled" + + - id: 7531 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd : # systemctl disable vsftpd Notes: Additional FTP servers also exist and should be audited." + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled vsftpd -> r:enabled" + + # 2.2.10 Remove HTTP Server (Not Scored) + - id: 7532 + title: "Ensure HTTP server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable apache2 : # systemctl disable apache2 Notes: Several httpd servers exist and can use other service names. apache, apache2, lighttpd, and nginx are example services that provide an HTTP server. These and other services should also be audited." + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.1"] + condition: none + rules: + - "c:systemctl is-enabled apache2 -> r:enabled" + + - id: 7533 + title: "Ensure IMAP and POP3 server is not enabled" + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable dovecot : # systemctl disable dovecot Notes: Several IMAP/POP3 servers exist and can use other service names. cyrus-imap is an example service that provides an IMAP/POP3 server. These and other services should also be audited." + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled dovecot -> r:enabled" + + # 2.2.12 Remove Samba (Not Scored) + - id: 7534 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable smb : # systemctl disable smb" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled smb -> r:enabled" + + - id: 7535 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable squid : # systemctl disable squid Notes: Several HTTP proxy servers exist. These and other services should be checked." + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled squid -> r:enabled" + + - id: 7536 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # systemctl disable snmpd Notes: Additional methods of disabling a service exist. Consult your distribution documentation for appropriate methods." + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled snmpd -> r:enabled" + + - id: 7537 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable ypserv : # systemctl disable ypserv" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled ypserv -> r:enabled" + + # Section 2.3 - Service Clients + - id: 7538 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client ( ypbind ) was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Run the following command to uninstall ypbind : # zypper remove ypbind" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:rpm -qa ypbind -> r:ypbind" + + ############################################### + # 3 Network Configuration and Firewalls + ############################################### + ############################################### + # 3.1 Modify Network Parameters (Host Only) + ############################################### + # 3.1.1 Disable IP Forwarding (Scored) + - id: 7539 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." + rationale: "Setting the flag to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:\s0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + + # 3.1.2 Disable Send Packet Redirects (Scored) + - id: 7540 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + ############################################### + # 3.2 Modify Network Parameters (Host and Router) + ############################################### + # 3.2.1 Disable Source Routed Packet Acceptance (Scored) + - id: 7541 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route and net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + + # 3.2.2 Disable ICMP Redirect Acceptance (Scored) + - id: 7542 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.2.2"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + + # 3.2.3 Disable Secure ICMP Redirect Acceptance (Scored) + - id: 7543 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.2.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + - id: 7544 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + # 3.2.5 Enable Ignore Broadcast Requests (Scored) + - id: 7545 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.2.5"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + # 3.2.6 Enable Bad Error Message Protection (Scored) + - id: 7546 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1." + compliance: + - cis: ["3.2.6"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + # 3.2.7 Ensure Reverse Path Filtering is enabled (Scored) + - id: 7547 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + # 3.2.8 Enable TCP SYN Cookies (Scored) + - id: 7548 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'c:/sbin/sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + ############################################### + # 5 System Access, Authentication and Authorization + ############################################### + ############################################### + # 5.2 Configure SSH + ############################################### + # 5.2.2 Set SSH Protocol to 2 (Scored) + - id: 7549 + title: "Ensure SSH Protocol is set to 2" + description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^\s*\t*# && r:Protocol\s*\t*2$' + + # 5.2.3 Set LogLevel to INFO (Scored) + - id: 7550 + title: "Ensure SSH LogLevel is set to INFO" + description: "The INFO parameter specifies that login and logout activity will be logged." + rationale: "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 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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^\s*\t*# && r:LogLevel\s*\t*INFO' + + # 5.2.5 Set SSH MaxAuthTries to 4 or Less (Scored) + - id: 7551 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.5"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - 'f:$sshd_file -> !r:^\s*\t*# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.2.6 Set SSH IgnoreRhosts to Yes (Scored) + - id: 7552 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^\s*\t*# && r:IgnoreRhosts\s*\t*yes' + + # 5.2.7 Set SSH HostbasedAuthentication to No (Scored) + - id: 7553 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv , along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^\s*\t*# && r:HostbasedAuthentication\s*\t*no' + + # 5.2.8 Disable SSH Root Login (Scored) + - id: 7554 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["5.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^\s*\t*# && r:PermitRootLogin\s*\t*no' + + # 5.2.9 Set SSH PermitEmptyPasswords to No (Scored) + - id: 7555 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^\s*\t*# && r:PermitEmptyPasswords\s*\t*no' + + ############################################### + # 6 System Maintenance + ############################################### + ############################################### + # 6.2 Review User and Group Settings + ############################################### + # 6.2.5 Verify No UID 0 Accounts Exist Other Than root (Scored) + - id: 7556 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^\s*\t*# && !r:^\s*\t*root: && r:^\w+:\w+:0:' + + - id: 7557 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["16"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' diff --git a/etc/ruleset/sca/sles/15/cis_sles15_linux.yml b/etc/ruleset/sca/sles/15/cis_sles15_linux.yml new file mode 100644 index 0000000000..ffa0ae2947 --- /dev/null +++ b/etc/ruleset/sca/sles/15/cis_sles15_linux.yml @@ -0,0 +1,3904 @@ +# Security Configuration Assessment +# CIS Checks for SUSE SLES 15 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# CIS Benchmark for SUSE Linux Enterprise 15 v1.1.0 - 09-17-2021 + +policy: + id: "cis_sles15_linux" + file: "cis_sles15_linux.yml" + name: "CIS SUSE Linux Enterprise 15 Benchmark v1.1.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for SUSE Linux Enterprise 12 systems running on x86 and x64 platforms. This document was tested against SUSE Linux Enterprise Server 15 SP1." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check SUSE 15 version" + description: "Requirements for running the SCA scan against SUSE Linux Enterprise Server 15" + condition: all + rules: + - "f:/etc/os-release -> r:SUSE Linux Enterprise Server 15" + +variables: + $sshd_file: /etc/ssh/sshd_config + +checks: + # Section 1.1 - Filesystem Configuration + + # 1.1.1.1 Ensure mounting of squashfs filesystems is disabled + - id: 21000 + title: Ensure mounting of squashfs filesystems is disabled. + description: > + The squashfs filesystem type is a compressed read-only Linux filesystem embedded in + small footprint systems (similar to cramfs ). A squashfs image can be used without having + to first decompress the image. + rationale: > + Removing support for unneeded filesystem types reduces the local attack surface of the + system. If this filesystem type is not needed, disable it. + remediation: > + Edit or create a file in the /etc/modprobe.d/ directory ending in .conf + Example: vi /etc/modprobe.d/squashfs.conf + and add the following line: + install squashfs /bin/true + + Run the following command to unload the squashfs module: + # modprobe -r squashfs + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["5.1"] + condition: any + rules: + - "c:modprobe -n -v squashfs -> r:install" + - "c:modprobe -n -v squashfs -> r:squashfs" + + # 1.1.1.2 Ensure mounting of udf filesystems is disabled + - id: 21001 + title: Ensure mounting of udf filesystems is disabled. + description: > + The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and + ECMA-167 specifications. This is an open vendor filesystem type for data storage on a + broad range of media. This filesystem type is necessary to support writing DVDs and newer + optical disc formats. + rationale: > + Removing support for unneeded filesystem types reduces the local attack surface of the + system. If this filesystem type is not needed, disable it. + remediation: > + Edit or create a file in the /etc/modprobe.d/ directory ending in .conf + Example: vi /etc/modprobe.d/udf.conf + and add the following line: + install udf /bin/true + + Run the following command to unload the udf module: + # modprobe -r udf + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["5.1"] + condition: any + rules: + - "c:modprobe -n -v udf -> r:install" + - "c:modprobe -n -v udf -> r:udf" + + # 1.1.1.3 Ensure mounting of FAT filesystems is limited - Not implemented + # 1.1.2 Ensure /tmp is configured - Not implemented + + # 1.1.3 Ensure noexec option set on /tmp partition - Not implemented + - id: 21002 + title: Ensure noexec option set on /tmp partition. + description: The noexec mount option specifies that the filesystem cannot contain executable binaries. + rationale: > + Since the /tmp filesystem is only intended for temporary file storage, set this option to + ensure that users cannot run executable binaries from /tmp . + remediation: > + Edit the /etc/fstab file OR the /etc/systemd/system/localfs.target.wants/tmp.mount file: + + IF /etc/fstab is used to mount /tmp + Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp + partition. See the fstab(5) manual page for more information. + Run the following command to remount /tmp : + + # mount -o remount,noexec /tmp + + OR + IF systemd is used to mount /tmp: + Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp + mount options: + + [Mount] + Options=mode=1777,strictatime,noexec,nodev,nosuid + + Run the following command to restart the systemd daemon: + # systemctl daemon-reload + + Run the following command to restart tmp.mount + # systemctl restart tmp.mount + compliance: + - cis: ["1.1.3"] + - cis_csc: ["2.6"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + # 1.1.4 Ensure nodev option set on /tmp partition + - id: 21003 + title: Ensure nodev option set on /tmp partition. + description: The nodev mount option specifies that the filesystem cannot contain special devices. + rationale: > + Since the /tmp filesystem is not intended to support devices, set this option to ensure that + users cannot attempt to create block or character special devices in /tmp . + remediation: > + Edit the /etc/fstab file OR the /etc/systemd/system/localfs.target.wants/tmp.mount file: + IF /etc/fstab is used to mount /tmp: + Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp + partition. See the fstab(5) manual page for more information. + Run the following command to remount /tmp : + # mount -o remount,nodev /tmp + OR + IF systemd is used to mount /tmp: + Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp + mount options: + [Mount] + Options=mode=1777,strictatime,noexec,nodev,nosuid + Run the following command to restart the systemd daemon: + # systemctl daemon-reload + + Run the following command to restart tmp.mount + # systemctl restart tmp.mount + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + # 1.1.5 Ensure nosuid option set on /tmp partition + - id: 21004 + title: Ensure nosuid option set on /tmp partition. + description: The nosuid mount option specifies that the filesystem cannot contain setuid files. + rationale: > + Since the /tmp filesystem is only intended for temporary file storage, set this option to + ensure that users cannot create setuid files in /tmp. + remediation: > + IF /etc/fstab is used to mount /tmp + Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp + partition. See the fstab(5) manual page for more information. + Run the following command to remount /tmp : + # mount -o remount,nosuid /tmp + + OR + IF systemd is used to mount /tmp: + Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuid to the /tmp + mount options: + [Mount] + Options=mode=1777,strictatime,noexec,nodev,nosuid + + Run the following command to restart the systemd daemon: + # systemctl daemon-reload + + Run the following command to restart tmp.mount: + # systemctl restart tmp.mount + compliance: + - cis: ["1.1.5"] + - cis_csc: ["5.1", "13"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + # 1.1.6 Ensure /dev/shm is configured + - id: 21005 + title: Ensure /dev/shm is configured. + description: > + /dev/shm is a traditional shared memory concept. One program will create a memory + portion, which other processes (if permitted) can access. If /dev/shm is not configured, + tmpfs will be mounted to /dev/shm by systemd. + + Notes: + - An entry for /dev/shm in /etc/fstab will take precedence. + - tmpfs can be resized using the size={size} parameter in /etc/fstab. If we don't specify + the size, it will be half the RAM. + + Resize tmpfs example: + tmpfs /dev/shm tmpfs defaults,noexec,nodev,nosuid,size=2G 0 0 + rationale: > + Any user can upload and execute files inside the /dev/shm similar to the /tmp partition. + Configuring /dev/shm allows an administrator to set the noexec option on the mount, + making /dev/shm useless for an attacker to install executable code. It would also prevent an + attacker from establishing a hardlink to a system setuid program and wait for it to be + updated. Once the program was updated, the hardlink would be broken and the attacker + would have his own copy of the program. If the program happened to have a security + vulnerability, the attacker could continue to exploit the known flaw. + remediation: > + Edit /etc/fstab and add or edit the following line: + tmpfs /dev/shm tmpfs defaults,noexec,nodev,nosuid 0 0 + + Run the following command to remount /dev/shm: + # mount -o remount,noexec,nodev,nosuid /dev/shm + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.1", "13"] + condition: all + rules: + - 'c:mount -> r:\.+\s+/dev/shm\s+' + - 'f:/etc/fstab -> r:\.+\s+/dev/shm\s+' + + # 1.1.7 Ensure noexec option set on /dev/shm partition + - id: 21006 + title: Ensure noexec option set on /dev/shm partition. + description: > + The noexec mount option specifies that the filesystem cannot contain executable binaries. + Note: /dev/shm is mounted automatically by systemd. /dev/shm needs to be added to + /etc/fstab to add mount options even though it is already being mounted on boot. + rationale: > + Setting this option on a file system prevents users from executing programs from shared + memory. This deters users from introducing potentially malicious software on the system. + remediation: > + Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the + /dev/shm partition. See the fstab(5) manual page for more information. + + Run the following command to remount /dev/shm: + # mount -o remount,noexec,nodev,nosuid /dev/shm + compliance: + - cis: ["1.1.7"] + - cis_csc: ["2.6", "13"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + # 1.1.8 Ensure nodev option set on /dev/shm partition - Not implemented + + # 1.1.9 Ensure nosuid option set on /dev/shm partition + - id: 21007 + title: Ensure nosuid option set on /dev/shm partition. + description: > + The nosuid mount option specifies that the filesystem cannot contain setuid files. + Note: /dev/shm is mounted automatically by systemd. /dev/shm needs to be added to + /etc/fstab to add mount options even though it is already being mounted on boot. + rationale: > + Setting this option on a file system prevents users from introducing privileged programs + onto the system and allowing non-root users to execute them. + remediation: > + Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the + /dev/shm partition. See the fstab(5) manual page for more information. + + Run the following command to remount /dev/shm: + # mount -o remount,noexec,nodev,nosuid /dev/shm + compliance: + - cis: ["1.1.9"] + - cis_csc: ["5.1", "13"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + # 1.1.10 Ensure separate partition exists for /var + - id: 21008 + title: Ensure separate partition exists for /var. + description: > + The /var directory is used by daemons and other system services to temporarily store + dynamic data. Some directories created by these processes may be world-writable. + + Note: When modifying /var it is advisable to bring the system to emergency mode (so auditd + is not running), rename the existing directory, mount the new file system, and migrate the + data over before returning to multiuser mode. + rationale: > + Since the /var directory may contain world-writable files and directories, there is a risk of + resource exhaustion if it is not bound to a separate partition. + remediation: > + For new installations, during installation create a custom partition setup and specify a + separate partition for /var . + For systems that were previously installed, create a new partition and configure + /etc/fstab as appropriate. + compliance: + - cis: ["1.1.10"] + - cis_csc: ["5.1"] + references: + - AJ Lewis, "LVM HOWTO", http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + # 1.1.11 Ensure separate partition exists for /var/tmp + - id: 21009 + title: Ensure separate partition exists for /var/tmp. + description: > + The /var/tmp directory is a world-writable directory used for temporary storage by all + users and some applications and is intended for temporary files that are preserved across + reboots. + + Note: tmpfs should not be used for /var/tmp/. tmpfs is a temporary filesystem that resides in + memory and/or swap partition(s). Files in tmpfs are automatically cleared at each bootup. + rationale: > + Since the /var/tmp directory is intended to be world-writable, there is a risk of resource + exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own + file system allows an administrator to set the noexec option on the mount, making + /var/tmp useless for an attacker to install executable code. It would also prevent an + attacker from establishing a hardlink to a system setuid program and wait for it to be + updated. Once the program was updated, the hardlink would be broken and the attacker + would have his own copy of the program. If the program happened to have a security + vulnerability, the attacker could continue to exploit the known flaw. + remediation: > + For new installations, during installation create a custom partition setup and specify a + separate partition for /var/tmp . + For systems that were previously installed, create a new partition and configure + /etc/fstab as appropriate. + compliance: + - cis: ["1.1.11"] + - cis_csc: ["5.1", "13"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + # 1.1.12 Ensure noexec option set on /var/tmp partition + - id: 21010 + title: Ensure noexec option set on /var/tmp partition. + description: The noexec mount option specifies that the filesystem cannot contain executable binaries. + rationale: > + Since the /var/tmp filesystem is only intended for temporary file storage, set this option to + ensure that users cannot run executable binaries from /var/tmp . + remediation: > + Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the + /var/tmp partition. See the fstab(5) manual page for more information. + + Run the following command to remount /var/tmp : + # mount -o remount,noexec /var/tmp + compliance: + - cis: ["1.1.12"] + - cis_csc: ["2.6"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + # 1.1.13 Ensure nodev option set on /var/tmp partition + - id: 21011 + title: Ensure nodev option set on /var/tmp partition. + description: The nodev mount option specifies that the filesystem cannot contain special devices. + rationale: > + Since the /var/tmp filesystem is not intended to support devices, set this option to ensure + that users cannot attempt to create block or character special devices in /var/tmp . + remediation: > + Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the + /var/tmp partition. See the fstab(5) manual page for more information. + + Run the following command to remount /var/tmp : + # mount -o remount,nodev /var/tmp + compliance: + - cis: ["1.1.13"] + - cis_csc: ["5.1", "13"] + condition: all + rules: + - 'c:mount -> r:\s+/var/tmp\s+ && r:nodev' + + # 1.1.14 Ensure nosuid option set on /var/tmp partition + - id: 21012 + title: Ensure nosuid option set on /var/tmp partition. + description: The nosuid mount option specifies that the filesystem cannot contain setuid files. + rationale: > + Since the /var/tmp filesystem is only intended for temporary file storage, set this option to + ensure that users cannot create setuid files in /var/tmp + remediation: > + Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the + /var/tmp partition. See the fstab(5) manual page for more information. + + Run the following command to remount /var/tmp : + # mount -o remount,nosuid /var/tmp + compliance: + - cis: ["1.1.14"] + - cis_csc: ["5.1", "13"] + condition: all + rules: + - 'c:mount -> r:\s+/var/tmp\s+ && r:nosuid' + + # 1.1.15 Ensure separate partition exists for /var/log + - id: 21013 + title: Ensure separate partition exists for /var/log. + description: The /var/log directory is used by system services to store log data. + rationale: > + There are two important reasons to ensure that system logs are stored on a separate + partition: protection against resource exhaustion (since logs can grow quite large) and + protection of audit data. + + Note: When modifying /var/log it is advisable to bring the system to emergency mode (so + auditd is not running), rename the existing directory, mount the new file system, and migrate + the data over before returning to multiuser mode. + remediation: > + For new installations, during installation create a custom partition setup and specify a + separate partition for /var/log . + For systems that were previously installed, create a new partition and configure + /etc/fstab as appropriate. + compliance: + - cis: ["1.1.15"] + - cis_csc: ["6.4"] + references: + - AJ Lewis, "LVM HOWTO", http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + # 1.1.16 Ensure separate partition exists for /var/log/audit + - id: 21014 + title: Ensure separate partition exists for /var/log/audit. + description: > + The auditing daemon, auditd , stores log data in the /var/log/audit directory. + + Note: When modifying /var/log/audit it is advisable to bring the system to emergency mode + (so auditd is not running), rename the existing directory, mount the new file system, and + migrate the data over before returning to multiuser mode. + rationale: > + There are two important reasons to ensure that data gathered by auditd is stored on a + separate partition: protection against resource exhaustion (since the audit.log file can + grow quite large) and protection of audit data. The audit daemon calculates how much free + space is left and performs actions based on the results. If other processes (such as syslog ) + consume space in the same partition as auditd , it may not perform as desired. + remediation: > + For new installations, during installation create a custom partition setup and specify a + separate partition for /var/log/audit . + For systems that were previously installed, create a new partition and configure + /etc/fstab as appropriate. + compliance: + - cis: ["1.1.16"] + - cis_csc: ["6.4"] + references: + - AJ Lewis, "LVM HOWTO", http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + # 1.1.17 Ensure separate partition exists for /home + - id: 21015 + title: Ensure separate partition exists for /home. + description: The /home directory is used to support disk storage needs of local users. + rationale: > + If the system is intended to support local users, create a separate partition for the /home + directory to protect against resource exhaustion and restrict the type of files that can be + stored under /home . + remediation: > + For new installations, during installation create a custom partition setup and specify a + separate partition for /home . + For systems that were previously installed, create a new partition and configure + /etc/fstab as appropriate. + compliance: + - cis: ["1.1.17"] + - cis_csc: ["5.1", "13"] + references: + - AJ Lewis, "LVM HOWTO", http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + # 1.1.18 Ensure nodev option set on /home partition + - id: 21016 + title: Ensure nodev option set on /home partition. + description: > + The nodev mount option specifies that the filesystem cannot contain special devices. + Note: The actions in this recommendation refer to the /home partition, which is the default + user partition. If you have created other user partitions, it is recommended that the + Remediation and Audit steps be applied to these partitions as well. + rationale: > + Since the user partitions are not intended to support devices, set this option to ensure that + users cannot attempt to create block or character special devices. + remediation: > + Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home + partition. See the fstab(5) manual page for more information. + + Run the following command to remount /home/ with the nodev mount option: + # mount -o remount,nodev /home + compliance: + - cis: ["1.1.18"] + - cis_csc: ["5.1", "13"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + # 1.1.19 Ensure noexec option set on removable media partitions - Not implemented + # 1.1.20 Ensure nodev option set on removable media partitions - Not implemented + # 1.1.21 Ensure nosuid option set on removable media partitions - Not implemented + # 1.1.22 Ensure sticky bit is set on all world-writable directories - Not implemented + + # 1.1.23 Disable Automounting + - id: 21017 + title: Disable Automounting. + description: > + autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives. + Notes: + - Additional methods of disabling a service exist. Consult your distribution + documentation for appropriate methods. + - This control should align with the tolerance of the use of portable drives and optical + media in the organization. + - On a server requiring an admin to manually mount media can be part of + defense-in-depth to reduce the risk of unapproved software or information + being introduced or proprietary software or information being exfiltrated. + - If admins commonly use flash drives and Server access has sufficient physical + controls, requiring manual mounting may not increase security. + rationale: > + With automounting enabled anyone with physical access could attach a USB drive or disc + and have its contents available in system even if they lacked permissions to mount it + themselves. + remediation: > + Run the following command to mask autofs: + # systemctl --now mask autofs + compliance: + - cis: ["1.1.23"] + - cis_csc: ["8.4", "8.5"] + condition: none + rules: + - "c:systemctl is-enabled autofs -> r:enabled" + + # 1.2.1 Ensure GPG keys are configured - Not implemented + # 1.2.2 Ensure package manager repositories are configured - Not implemented + # 1.2.3 Ensure gpgcheck is globally activated - Not implemented + + # 1.3.1 Ensure sudo is installed + - id: 21018 + title: Ensure sudo is installed. + description: > + sudo allows a permitted user to execute a command as the superuser or another user, as + specified by the security policy. The invoking user's real (not effective) user ID is used to + determine the user name with which to query the security policy. + rationale: > + sudo supports a plugin architecture for security policies and input/output logging. Third + parties can develop and distribute their own policy and I/O logging plugins to work + seamlessly with the sudo front end. The default security policy is sudoers, which is + configured via the file /etc/sudoers. + + The security policy determines what privileges, if any, a user has to run sudo. The policy + may require that users authenticate themselves with a password or another authentication + mechanism. If authentication is required, sudo will exit if the user's password is not + entered within a configurable time limit. This limit is policy-specific. + remediation: > + Run the following command to install sudo. + # zypper install sudo + compliance: + - cis: ["1.3.1"] + - cis_csc: ["4"] + references: + - SUDO(8) + condition: none + rules: + - "c:rpm -q sudo -> r:not installed" + + # 1.3.2 Ensure sudo commands use pty + - id: 21019 + title: Ensure sudo commands use pty. + description: > + sudo can be configured to run only from a pseudo-pty + + Note: visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the + sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks for + parse errors. If the sudoers file is currently being edited you will receive a message to try + again later. The -f option allows you to tell visudo which file to edit. + rationale: > + Attackers can run a malicious program using sudo, which would again fork a background + process that remains even when the main program has finished executing. + This can be mitigated by configuring sudo to run other commands only from a pseudo-pty, + whether I/O logging is turned on or not. + remediation: > + Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: + + Defaults use_pty + compliance: + - cis: ["1.3.2"] + - cis_csc: ["4"] + references: + - SUDO(8) + condition: all + rules: + - 'c:grep -REsih "^Defaults" /etc/sudoers /etc/sudoers.d -> r:^\wefaults\s+use_pty' + + # 1.3.3 Ensure sudo log file exists + - id: 21020 + title: Ensure sudo log file exists. + description: > + sudo can use a custom log file + + Note: visudo edits the sudoers file in a safe fashion, analogous to vipw(8). visudo locks the + sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks + for parse errors. If the sudoers file is currently being edited you will receive a message to + try again later. The -f option allows you to tell visudo which file to edit. + rationale: A sudo log file simplifies auditing of sudo commands + remediation: > + edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: + Defaults logfile="" + + Example + Defaults logfile="/var/log/sudo.log" + compliance: + - cis: ["1.3.3"] + - cis_csc: ["6.3"] + references: + - SUDO(8) + - VISUDO(8) + condition: all + rules: + - 'c:grep -REsih "^Defaults" /etc/sudoers /etc/sudoers.d -> r:^\wefaults\s+logfile="\.+"' + + # 1.4.1 Ensure AIDE is installed + - id: 21021 + title: Ensure AIDE is installed. + description: > + AIDE takes a snapshot of filesystem state including modification times, permissions, and + file hashes which can then be used to compare against the current state of the filesystem to + detect modifications to the system. + + Note: The prelinking feature can interfere with AIDE because it alters binaries to speed up + their start up times. Run prelink -ua to restore the binaries to their prelinked state, thus + avoiding false positives from AIDE. + rationale: > + By monitoring the filesystem state compromised files can be detected to prevent or limit + the exposure of accidental or malicious misconfigurations or modified binaries. + remediation: > + Configure AIDE as appropriate for your environment. Consult the AIDE documentation for + options. + Run the following command to install AIDE: + # zypper install aide + + Run the following commands to initialize AIDE: + # aide --init + # mv /var/lib/aide/aide.db.new /var/lib/aide/aide.db + compliance: + - cis: ["1.4.1"] + - cis_csc: ["14.9"] + references: + - AIDE stable manual: http://aide.sourceforge.net/stable/manual.html + condition: none + rules: + - "c:rpm -q aide -> r:not installed" + + # 1.4.2 Ensure filesystem integrity is regularly checked - Not implemented + + # 1.5.1 Ensure bootloader password is set + - id: 21022 + title: Ensure bootloader password is set. + description: > + Setting the boot loader password will require that anyone rebooting the system must enter + a password before being able to set command line boot parameters + + Notes: + - This recommendation is designed around the grub2 bootloader, if LILO or another + bootloader is in use in your environment enact equivalent settings. Replace + `/boot/grub2/grub.cfg with the appropriate grub configuration file for your + environment + - The information can be placed in any /etc/grub.d file as long as that file is + incorporated into grub.cfg + - The superuser/user information and password should not be contained in the + /etc/grub.d/00_header file. + - A custom file, such as /etc/grub.d/40_custom should be used so it is not + overwritten should the Grub package be updated. + rationale: > + Requiring a boot password upon execution of the boot loader will prevent an unauthorized + user from entering boot parameters or changing the boot partition. This prevents users + from weakening security (e.g. turning off SELinux at boot time). + remediation: > + Create an encrypted password with grub2-mkpasswd-pbkdf2: + # grub2-mkpasswd-pbkdf2 + Enter password: + Reenter password: + Your PBKDF2 is + + Add the following into /etc/grub.d/40_custom + set superusers="" + password_pbkdf2 + + Run the following command to update the grub2 configuration: + # grub2-mkconfig -o /boot/grub2/grub.cfg + compliance: + - cis: ["1.5.1"] + - cis_csc: ["5.1"] + references: + - https://documentation.suse.com/sles/15-SP1/html/SLES-all/cha-grub2.html + condition: all + rules: + - 'f:/boot/grub2/grub.cfg -> r:^\s*set superusers' + - 'f:/boot/grub2/grub.cfg -> r:^\s*password' + + # 1.5.2 Ensure permissions on bootloader config are configured + - id: 21023 + title: Ensure permissions on bootloader config are configured. + description: > + The grub configuration file contains information on boot settings and passwords for + unlocking boot options. The grub2 configuration is usually grub.cfg stored in + /boot/grub2/. + + Notes: + - This recommendation is designed around the grub2 bootloader. + - If LILO or another bootloader is in use in your environment: + - Enact equivalent settings + - Replace /boot/grub2/grub.cfg and /boot/grub2/user.cfg with the + appropriate boot configuration files for your environment + rationale: > + Setting the permissions to read and write for root only prevents non-root users from + seeing the boot parameters or changing them. Non-root users who read the boot + parameters may be able to identify weaknesses in security upon boot and be able to exploit + them. + remediation: > + Run the following commands to set ownership and permissions on your grub + configuration: + # chown root:root /boot/grub2/grub.cfg + # chmod og-rwx /boot/grub2/grub.cfg + compliance: + - cis: ["1.5.2"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:stat -L /boot/grub2/grub.cfg -> r:^Access:\s*\(0600/-rw-------\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 1.5.3 Ensure authentication required for single user mode + - id: 21024 + title: Ensure authentication required for single user mode. + description: > + Single user mode (rescue mode) is used for recovery when the system detects an issue + during boot or by manual selection from the bootloader. + rationale: > + Requiring authentication in single user mode (rescue mode) prevents an unauthorized user + from rebooting the system into single user to gain root privileges without credentials. + remediation: > + Edit /usr/lib/systemd/system/rescue.service and add/modify the following line: + ExecStart=-/usr/lib/systemd/systemd-sulogin-shell rescue + + Edit /usr/lib/systemd/system/emergency.service and add/modify the following line: + ExecStart=-/usr/lib/systemd/systemd-sulogin-shell emergency + compliance: + - cis: ["1.5.3"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'f:/usr/lib/systemd/system/rescue.service -> r:^ExecStart=\.*/systemd/systemd-sulogin-shell\s+rescue' + - 'f:/usr/lib/systemd/system/emergency.service -> r:^ExecStart=\.*/systemd/systemd-sulogin-shell\s+emergency' + + # 1.6.1 Ensure core dumps are restricted + - id: 21025 + title: Ensure core dumps are restricted. + description: > + A core dump is the memory of an executable program. It is generally used to determine + why a program aborted. It can also be used to glean confidential information from a core + file. The system provides the ability to set a soft limit for core dumps, but this can be + overridden by the user. + rationale: > + Setting a hard limit on core dumps prevents users from overriding the soft variable. If core + dumps are required, consider setting limits for user groups (see limits.conf(5) ). In + addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from + dumping core. + remediation: > + Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* + file: + * hard core 0 + + Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: + fs.suid_dumpable = 0 + + Run the following command to set the active kernel parameter: + # sysctl -w fs.suid_dumpable=0 + + If systemd-coredump is installed: + edit /etc/systemd/coredump.conf and add/modify the following lines: + Storage=none + ProcessSizeMax=0 + + Run the command: + systemctl daemon-reload + compliance: + - cis: ["1.6.1"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + - 'c:sysctl fs.suid_dumpable -> r:\s0$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> r:^\s*fs.suid_dumpable\s*=\s*0\s*$' + + # 1.6.2 Ensure XD/NX support is enabled + - id: 21026 + title: Ensure XD/NX support is enabled. + description: > + Recent processors in the x86 family support the ability to prevent code execution on a per + memory page basis. Generically and on AMD processors, this ability is called No Execute + (NX), while on Intel processors it is called Execute Disable (XD). This ability can help + prevent exploitation of buffer overflow vulnerabilities and should be activated whenever + possible. Extra steps must be taken to ensure that this protection is enabled, particularly on + 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such + support since inception and the standard kernel for those platforms supports the feature. + rationale: > + Enabling any feature that can protect against buffer overflow attacks enhances the security + of the system. + + Note: Ensure your system supports the XD or NX bit and has PAE support before implementing + this recommendation as this may prevent it from booting if these are not supported by your + hardware. + remediation: > + On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit + systems: + If necessary configure your bootloader to load the new kernel and reboot the system. + You may need to enable NX or XD support in your bios. + compliance: + - cis: ["1.6.2"] + - cis_csc: ["8.3"] + condition: all + rules: + - 'c:sh -c "journalctl | grep \"protection: active\"" -> r:\.*kernel: NX \(Execute Disable\) protection:\s*active' + + # 1.6.3 Ensure address space layout randomization (ASLR) is enabled + - id: 21027 + title: Ensure address space layout randomization (ASLR) is enabled. + description: > + Address space layout randomization (ASLR) is an exploit mitigation technique which + randomly arranges the address space of key data areas of a process. + rationale: > + Randomly placing virtual memory regions will make it difficult to write memory page + exploits as the memory placement will be consistently shifting. + remediation: > + Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: + kernel.randomize_va_space = 2 + + Run the following command to set the active kernel parameter: + # sysctl -w kernel.randomize_va_space=2 + compliance: + - cis: ["1.6.3"] + - cis_csc: ["8.3"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:^\s*kernel.randomize_va_space\s*=\s*2$' + - 'c:sysctl kernel.randomize_va_space -> r:\s2$|\t2$' + + # 1.6.4 Ensure prelink is disabled + - id: 21028 + title: Ensure prelink is disabled. + description: > + prelinkis a program that modifies ELF shared libraries and ELF dynamically linked + binaries in such a way that the time needed for the dynamic linker to perform relocations + at startup significantly decreases. + rationale: > + The prelinking feature can interfere with the operation of AIDE, because it changes + binaries. Prelinking can also increase the vulnerability of the system if a malicious user is + able to compromise a common library such as libc. + remediation: > + Run the following command to restore binaries to normal: + # prelink -ua + + Run the following command to uninstall prelink: + # zypper remove prelink + compliance: + - cis: ["1.6.4"] + - cis_csc: ["14.9"] + condition: all + rules: + - "c:rpm -q prelink -> r:not installed" + + # 1.7.1.1 Ensure AppArmor is installed + - id: 21029 + title: Ensure AppArmor is installed. + description: AppArmor provides Mandatory Access Controls. + rationale: > + Without a Mandatory Access Control system installed only the default Discretionary Access + Control system will be available. + remediation: > + Run the following command to install AppArmor: + # zypper install -t pattern apparmor + compliance: + - cis: ["1.7.1.1"] + - cis_csc: ["14.6"] + condition: none + rules: + - "c:rpm -q apparmor-docs -> r:not installed" + - "c:rpm -q apparmor-parser -> r:not installed" + - "c:rpm -q apparmor-profiles -> r:not installed" + - "c:rpm -q apparmor-utils -> r:not installed" + - "c:rpm -q libapparmor1 -> r:not installed" + + # 1.7.1.2 Ensure AppArmor is enabled in the bootloader configuration - Not implemented + # 1.7.1.3 Ensure all AppArmor Profiles are in enforce or complain mode - Not implemented + # 1.7.1.4 Ensure all AppArmor Profiles are enforcing - Not implemented + + # 1.8.1.1 Ensure message of the day is configured properly + - id: 21030 + title: Ensure message of the day is configured properly. + description: > + The contents of the /etc/motd file are displayed to users after login and function as a + message of the day for authenticated users. + + Unix-based systems have typically displayed information about the OS release and patch + level upon logging in to the system. This information can be useful to developers who are + developing software for a particular OS platform. If mingetty(8) supports the following + options, they display operating system information: \m - machine architecture \r - + operating system release \s - operating system name \v - operating system version + rationale: > + Warning messages inform users who are attempting to login to the system of their legal + status regarding the system and must include the name of the organization that owns the + system and any monitoring policies that are in place. Displaying OS and patch level + information in login banners also has the side effect of providing detailed system + information to attackers attempting to target specific exploits of a system. Authorized users + can easily get this information by running the " uname -a " command once they have logged + in. + remediation: > + Edit the /etc/motd file with the appropriate contents according to your site policy, remove + any instances of \m , \r , \s , \v or references to the OS platform + + OR + + If the motd is not used, this file can be removed. + Run the following command to remove the motd file: + # rm /etc/motd + compliance: + - cis: ["1.8.1.1"] + - cis_csc: ["5.1"] + condition: none + rules: + - 'f:/etc/motd -> r:\\m' + - 'f:/etc/motd -> r:\\r' + - 'f:/etc/motd -> r:\\s' + - 'f:/etc/motd -> r:\\v' + + # 1.8.1.2 Ensure local login warning banner is configured properly + - id: 21031 + title: Ensure local login warning banner is configured properly. + description: > + The contents of the /etc/issue file are displayed to users prior to login for local terminals. + Unix-based systems have typically displayed information about the OS release and patch + level upon logging in to the system. This information can be useful to developers who are + developing software for a particular OS platform. If mingetty(8) supports the following + options, they display operating system information: \m - machine architecture \r - + operating system release \s - operating system name \v - operating system version - or the + operating system's name + rationale: > + Warning messages inform users who are attempting to login to the system of their legal + status regarding the system and must include the name of the organization that owns the + system and any monitoring policies that are in place. Displaying OS and patch level + information in login banners also has the side effect of providing detailed system + information to attackers attempting to target specific exploits of a system. Authorized users + can easily get this information by running the " uname -a " command once they have logged + in. + remediation: > + Edit the /etc/issue file with the appropriate contents according to your site policy, + remove any instances of \m , \r , \s , \v or references to the OS platform + # echo "Authorized uses only. All activity may be monitored and reported." > + /etc/issue + compliance: + - cis: ["1.8.1.2"] + - cis_csc: ["5.1"] + condition: none + rules: + - 'f:/etc/issue -> r:\\m' + - 'f:/etc/issue -> r:\\r' + - 'f:/etc/issue -> r:\\s' + - 'f:/etc/issue -> r:\\v' + + # 1.8.1.3 Ensure remote login warning banner is configured properly + - id: 21032 + title: Ensure remote login warning banner is configured properly. + description: > + The contents of the /etc/issue.net file are displayed to users prior to login for remote + connections from configured services. + Unix-based systems have typically displayed information about the OS release and patch + level upon logging in to the system. This information can be useful to developers who are + developing software for a particular OS platform. If mingetty(8) supports the following + options, they display operating system information: \m - machine architecture \r - + operating system release \s - operating system name \v - operating system version + rationale: > + Warning messages inform users who are attempting to login to the system of their legal + status regarding the system and must include the name of the organization that owns the + system and any monitoring policies that are in place. Displaying OS and patch level + information in login banners also has the side effect of providing detailed system + information to attackers attempting to target specific exploits of a system. Authorized users + can easily get this information by running the " uname -a " command once they have logged + in. + remediation: > + Edit the /etc/issue.net file with the appropriate contents according to your site policy, + remove any instances of \m , \r , \s , \v or references to the OS platform + # echo "Authorized uses only. All activity may be monitored and reported." > + /etc/issue.net + compliance: + - cis: ["1.8.1.3"] + - cis_csc: ["5.1"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\m' + - 'f:/etc/issue.net -> r:\\r' + - 'f:/etc/issue.net -> r:\\s' + - 'f:/etc/issue.net -> r:\\v' + + # 1.8.1.4 Ensure permissions on /etc/motd are configured + - id: 21033 + title: Ensure permissions on /etc/motd are configured. + description: > + The contents of the /etc/motd file are displayed to users after login and function as a + message of the day for authenticated users. + rationale: > + If the /etc/motd file does not have the correct ownership it could be modified by + unauthorized users with incorrect or misleading information. + remediation: > + Run the following commands to set permissions on /etc/motd : + # chown root:root /etc/motd + # chmod u-x,go-wx /etc/motd + compliance: + - cis: ["1.8.1.4"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/motd -> r:^Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 1.8.1.5 Ensure permissions on /etc/issue are configured + - id: 21034 + title: Ensure permissions on /etc/issue are configured. + description: > + The contents of the /etc/issue file are displayed to users prior to login for local terminals. + rationale: > + If the /etc/issue file does not have the correct ownership it could be modified by + unauthorized users with incorrect or misleading information. + remediation: > + Run the following commands to set permissions on /etc/issue: + # chown root:root /etc/issue + # chmod u-x,go-wx /etc/issue + compliance: + - cis: ["1.8.1.5"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/issue -> r:^Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 1.8.1.6 Ensure permissions on /etc/issue.net are configured + - id: 21035 + title: Ensure permissions on /etc/issue.net are configured. + description: > + The contents of the /etc/issue.net file are displayed to users prior to login for remote + connections from configured services. + rationale: > + If the /etc/issue.net file does not have the correct ownership it could be modified by + unauthorized users with incorrect or misleading information. + remediation: > + Run the following commands to set permissions on /etc/issue.net: + # chown root:root /etc/issue.net + # chmod u-x,go-wx /etc/issue.net + compliance: + - cis: ["1.8.1.6"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/issue.net -> r:^Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 1.9 Ensure updates, patches, and additional security software are installed - Not implemented + # 1.10 Ensure GDM is removed or login is configured - Not implemented + + # 2.1.1 Ensure xinetd is not installed + - id: 21036 + title: Ensure xinetd is not installed. + description: > + The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced + the original inetd daemon. The xinetd daemon listens for well known services and + dispatches the appropriate daemon to properly respond to service requests. + rationale: > + If there are no xinetd services required, it is recommended that the package be removed to + reduce the attack surface are of the system. + + Note: If an xinetd service or services are required, ensure that any xinetd service not required + is stopped and disabled + remediation: > + Run the following command to remove xinetd: + # zypper remove xinetd + compliance: + - cis: ["2.1.1"] + - cis_csc: ["2.6", "9.2"] + condition: all + rules: + - "c:rpm -q xinetd -> r:not installed" + + # 2.2.1.1 Ensure time synchronization is in use - Not implemented + # 2.2.1.2 Ensure systemd-timesyncd is configured - Not implemented + + # 2.2.1.3 Ensure chrony is configured + - id: 21037 + title: Ensure chrony is configured. + description: > + chrony is a daemon which implements the Network Time Protocol (NTP) and is designed to + synchronize system clocks across a variety of systems and use a source that is highly + accurate. More information on chrony can be found at: http://chrony.tuxfamily.org/. + chrony can be configured to be a client and/or a server. + rationale: > + If chrony is in use on the system proper configuration is vital to ensuring time + synchronization is working properly. + + Note: This recommendation only applies if chrony is in use on the system. If another method of + time synchronization is in use on the system, this recommendation can be skipped. + remediation: > + Add or edit server or pool lines to /etc/chrony.conf as appropriate: + server + + Add or edit the OPTIONS in /etc/sysconfig/chronyd to include '-u chrony': + OPTIONS="-u chrony" + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^\s*server\s+\.+' + - 'f:/etc/sysconfig/chronyd -> r:^\s*OPTIONS\s*=\s*"-u\s*chrony"' + + # 2.2.2 Ensure X11 Server components are not installed + - id: 21038 + title: Ensure X11 Server components are not installed. + description: > + The X Window System provides a Graphical User Interface (GUI) where users can have + multiple windows in which to run programs and various add on. The X Windows system is + typically used on workstations where users login, but not on servers where users typically + do not login. + rationale: > + Unless your organization specifically requires graphical login access via X Windows, + remove it to reduce the potential attack surface. + remediation: > + Run the following command to remove the X Windows Server packages: + # zypper remove xorg-x11-server* + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2.6"] + condition: none + rules: + - "c:rpm -qa -> r:^xorg-x11" + + # 2.2.3 Ensure Avahi Server is not installed + - id: 21039 + title: Ensure Avahi Server is not installed. + description: > + Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD + service discovery. Avahi allows programs to publish and discover services and hosts + running on a local network with no specific configuration. For example, a user can plug a + computer into a network and Avahi automatically finds printers to print to, files to look at + and people to talk to, as well as network services running on the machine. + rationale: > + Automatic discovery of network services is not normally required for system functionality. + It is recommended to remove this package to reduce the potential attack surface. + remediation: > + Run the following commands to stop, mask and remove avahi-autoipd and avahi: + # systemctl stop avahi-daemon.socket avahi-daemon.service + # zypper remove avahi-autoipd avahi + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.2"] + condition: all + rules: + - "c:rpm -q avahi -> r:not installed" + - "c:rpm -q avahi-autoipd -> r:not installed" + + # 2.2.4 Ensure CUPS is not installed + - id: 21040 + title: Ensure CUPS is not installed. + description: > + The Common Unix Print System (CUPS) provides the ability to print to both local and + network printers. A system running CUPS can also accept print jobs from remote systems + and print them to local printers. It also provides a web based remote administration + capability. + rationale: > + If the system does not need to print jobs or accept print jobs from other systems, it is + recommended that CUPS be removed to reduce the potential attack surface. + + Note: Removing CUPS will prevent printing from the system + remediation: > + Run the following command to remove cups: + # zypper remove cups + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.2"] + references: + - http://www.cups.org + condition: all + rules: + - "c:rpm -q cups -> r:not installed" + + # 2.2.5 Ensure DHCP Server is not installed + - id: 21041 + title: Ensure DHCP Server is not installed. + description: > + The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be + dynamically assigned IP addresses. + rationale: > + Unless a system is specifically set up to act as a DHCP server, it is recommended that the + dhcp package be removed to reduce the potential attack surface. + remediation: > + Run the following command to remove dhcp: + # zypper remove dhcp + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.2"] + references: + - dhcpd(8) + condition: all + rules: + - "c:rpm -q dhcp -> r:not installed" + + # 2.2.6 Ensure LDAP server is not installed + - id: 21042 + title: Ensure LDAP server is not installed + description: > + The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for + NIS/YP. It is a service that provides a method for looking up information from a central + database. + rationale: > + If the system will not need to act as an LDAP server, it is recommended that the software be + removed to reduce the potential attack surface. + remediation: > + Run the following command to remove openldap-servers: + # zypper remove openldap2 + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.2"] + references: + - http://www.openldap.org + condition: all + rules: + - "c:rpm -q openldap2 -> r:not installed" + + # 2.2.7 Ensure nfs-utils is not installed or the nfs-server service is masked - Not implemented + # 2.2.8 Ensure rpcbind is not installed or the rpcbind services are masked - Not implemented + + # 2.2.9 Ensure DNS Server is not installed + - id: 21043 + title: Ensure DNS Server is not installed. + description: > + The Domain Name System (DNS) is a hierarchical naming system that maps names to IP + addresses for computers, services and other resources connected to a network. + rationale: > + Unless a system is specifically designated to act as a DNS server, it is recommended that the + package be removed to reduce the potential attack surface. + remediation: > + Run the following command to remove bind: + # zypper remove bind + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.2"] + condition: all + rules: + - "c:rpm -q bind -> r:not installed" + + # 2.2.10 Ensure FTP Server is not installed + - id: 21044 + title: Ensure FTP Server is not installed. + description: > + FTP (File Transfer Protocol) is a traditional and widely used standard tool for transferring + files between a server and clients over a network, especially where no authentication is + necessary (permits anonymous users to connect to a server). + rationale: > + FTP does not protect the confidentiality of data or authentication credentials. It is + recommended SFTP be used if file transfer is required. Unless there is a need to run the + system as a FTP server (for example, to allow anonymous downloads), it is recommended + that the package be removed to reduce the potential attack surface. + + Note: Additional FTP servers also exist and should be removed if not required. + remediation: > + Run the following command to remove vsftpd: + # zypper remove vsftpd + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.2"] + condition: all + rules: + - "c:rpm -q vsftpd -> r:not installed" + + # 2.2.11 Ensure HTTP server is not installed + - id: 21045 + title: Ensure HTTP server is not installed. + description: HTTP or web servers provide the ability to host web site content. + rationale: > + Unless there is a need to run the system as a web server, it is recommended that the + package be removed to reduce the potential attack surface. + + Notes: + - Several http servers exist. apache, apache2, lighttpd, and nginx are example + packages that provide an HTTP server + - These and other packages should also be audited, and removed if not required + remediation: > + Run the following command to remove apache2: + # zypper remove apache2 + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.2"] + condition: all + rules: + - "c:rpm -q apache2 -> r:not installed" + + # 2.2.12 Ensure IMAP and POP3 server is not installed + - id: 21046 + title: Ensure IMAP and POP3 server is not installed. + description: dovecot is an open source IMAP and POP3 server for Linux based systems. + rationale: > + Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended + that the package be removed to reduce the potential attack surface. + + Notes: + - Several IMAP/POP3 servers exist and can use other service names. courier-imap and + cyrus-imap are example services that provide a mail server. + - These and other services should also be audited and the packages removed if not + required. + remediation: > + Run the following command to remove dovecot: + # zypper remove dovecot + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.2"] + condition: all + rules: + - "c:rpm -q dovecot -> r:not installed" + + # 2.2.13 Ensure Samba is not installed + - id: 21047 + title: Ensure Samba is not installed. + description: > + The Samba daemon allows system administrators to configure their Linux systems to share + file systems and directories with Windows desktops. Samba will advertise the file systems + and directories via the Server Message Block (SMB) protocol. Windows desktop users will + be able to mount these directories and file systems as letter drives on their systems. + rationale: > + If there is no need to mount directories and file systems to Windows systems, then this + package can be removed to reduce the potential attack surface. + remediation: > + Run the following command to remove samba: + # zypper remove samba + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.2"] + condition: all + rules: + - "c:rpm -q samba -> r:not installed" + + # 2.2.14 Ensure HTTP Proxy Server is not installed + - id: 21048 + title: Ensure HTTP Proxy Server is not installed. + description: Squid is a standard proxy server used in many distributions and environments. + rationale: > + Unless a system is specifically set up to act as a proxy server, it is recommended that the + squid package be removed to reduce the potential attack surface. + + Note: Several HTTP proxy servers exist. These should be checked and removed unless required. + remediation: > + Run the following command to remove the squid package: + # zypper remove squid + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.2"] + condition: all + rules: + - "c:rpm -q squid -> r:not installed" + + # 2.2.15 Ensure net-snmp is not installed + - id: 21049 + title: Ensure net-snmp is not installed. + description: > + Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the + health and welfare of network equipment, computer equipment and devices like UPSs. + - Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), + SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and + IPv6. + - Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was + dropped with the 4.0 release of the UCD-snmp package. + - The Simple Network Management Protocol (SNMP) server is used to listen for SNMP + commands from an SNMP management system, execute the commands or collect the + information and then send results back to the requesting system. + rationale: > + The SNMP server can communicate using SNMPv1, which transmits data in the clear and + does not require authentication to execute commands. SNMPv3 replaces the simple/clear + text password sharing used in SNMPv2 with more securely encoded parameters. If the the + SNMP service is not required, the net-snmp package should be removed to reduce the + attack surface of the system. + + Note: If SNMP is required: + - The server should be configured for SNMP v3 only. User Authentication and Message + Encryption should be configured. + - If SNMP v2 is absolutely necessary, modify the community strings' values. + remediation: > + Run the following command to remove net-snmpd: + # zypper remove net-snmp + compliance: + - cis: ["2.2.15"] + - cis_csc: ["2.6", "9.2"] + condition: all + rules: + - "c:rpm -q net-snmp -> r:not installed" + + # 2.2.16 Ensure mail transfer agent is configured for local-only mode + - id: 21050 + title: Ensure mail transfer agent is configured for local-only mode. + description: > + Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming + mail and transfer the messages to the appropriate user or mail server. If the system is not + intended to be a mail server, it is recommended that the MTA be configured to only process + local mail. + rationale: > + The software for all Mail Transfer Agents is complex and most have a long history of + security issues. While it is important to ensure that the system can process local mail + messages, it is not necessary to have the MTA's daemon listening on a port unless the + server is intended to be a mail server that receives and processes mail from other systems. + Notes: + - This recommendation is designed around the postfix mail server. + - Depending on your environment you may have an alternative MTA installed such as + sendmail. If this is the case consult the documentation for your installed MTA to + configure the recommended state. + remediation: > + Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If + the line already exists, change it to look like the line below: + inet_interfaces = loopback-only + + Run the folloing command to restart postfix: + # systemctl restart postfix + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.2"] + condition: all + rules: + - 'f:/etc/postfix/main.cf -> r:^\s*inet_interfaces\s*=\s*loopback-only' + + # 2.2.17 Ensure rsync is not installed or the rsyncd service is masked + - id: 21051 + title: Ensure rsync is not installed or the rsyncd service is masked. + description: The rsyncd service can be used to synchronize files between systems over network links. + rationale: > + Unless required, the rsync package should be removed to reduce the attack surface area of + the system. + + The rsyncd service presents a security risk as it uses unencrypted protocols for + communication. + + Note: If a required dependency exists for the rsync package, but the rsyncd service is not + required, the service should be masked. + remediation: > + Run the following command to remove the rsync package: + # zypper remove rsync + + OR + + Run the following command to mask the rsyncd service: + # systemctl --now mask rsyncd + compliance: + - cis: ["2.2.17"] + - cis_csc: ["9.2"] + condition: any + rules: + - "c:rpm -q rsync -> r:not installed" + - "c:systemctl is-enabled rsyncd -> r:^masked" + + # 2.2.18 Ensure NIS server is not installed + - id: 21052 + title: Ensure NIS server is not installed. + description: > + The ypserv package provides the Network Information Service (NIS). This service, formally + known as Yellow Pages, is a client-server directory service protocol for distributing system + configuration files. The NIS server is a collection of programs that allow for the distribution + of configuration files. + rationale: > + The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, + buffer overflows and has poor authentication for querying NIS maps. NIS generally has + been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is + recommended that the ypserv package be removed, and if required a more secure services + be used. + remediation: > + Run the following command to remove ypserv: + # zypper remove ypserv + compliance: + - cis: ["2.2.18"] + - cis_csc: ["2.6", "9.2"] + condition: all + rules: + - "c:rpm -q ypserv -> r:not installed" + + # 2.2.19 Ensure telnet-server is not installed + - id: 21053 + title: Ensure telnet-server is not installed. + description: > + The telnet package contains the telnet daemon, which accepts connections from users + from other systems via the telnet protocol. + rationale: > + The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission + medium could allow a user with access to sniff network traffic the ability to steal + credentials. The ssh package provides an encrypted session and stronger security. + remediation: > + Run the following command to remove the telnet-server package: + # zypper remove telnet + compliance: + - cis: ["2.2.19"] + - cis_csc: ["2.6", "9.2"] + condition: all + rules: + - "c:rpm -q telnet -> r:not installed" + + # 2.3.1 Ensure NIS Client is not installed + - id: 21054 + title: Ensure NIS Client is not installed. + description: > + The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server + directory service protocol used to distribute system configuration files. The NIS client ( + ypbind ) was used to bind a machine to an NIS server and receive the distributed + configuration files. + rationale: > + The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, + buffer overflows and has poor authentication for querying NIS maps. NIS generally has + been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is + recommended that the service be removed. + remediation: > + Run the following command to remove the ypbind package: + # zypper remove ypbind + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2.6"] + condition: all + rules: + - "c:rpm -q ypbind -> r:not installed" + + # 2.3.2 Ensure rsh client is not installed + - id: 21055 + title: Ensure rsh client is not installed. + description: The rsh package contains the client commands for the rsh services. + rationale: > + These legacy clients contain numerous security exposures and have been replaced with the + more secure SSH package. Even if the server is removed, it is best to ensure the clients are + also removed to prevent users from inadvertently attempting to use these commands and + therefore exposing their credentials. Note that removing the rsh package removes the + clients for rsh , rcp and rlogin. + remediation: > + Run the following command to remove the rsh package: + # zypper remove rsh + compliance: + - cis: ["2.3.2"] + - cis_csc: ["2.6"] + condition: all + rules: + - "c:rpm -q rsh -> r:not installed" + + # 2.3.3 Ensure talk client is not installed + - id: 21056 + title: Ensure talk client is not installed. + description: > + The talk software makes it possible for users to send and receive messages across systems + through a terminal session. The talk client, which allows initialization of talk sessions, is + installed by default. + rationale: > + The software presents a security risk as it uses unencrypted protocols for communication. + remediation: > + Run the following command to remove the talk package: + # zypper remove talk + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2.6"] + condition: all + rules: + - "c:rpm -q talk -> r:not installed" + + # 2.3.4 Ensure telnet client is not installed + - id: 21057 + title: Ensure telnet client is not installed. + description: > + The telnet package contains the telnet client, which allows users to start connections to + other systems via the telnet protocol. + rationale: > + The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission + medium could allow an unauthorized user to steal credentials. The ssh package provides + an encrypted session and stronger security and is included in most Linux distributions. + remediation: > + Run the following command to remove the telnet package: + # zypper remove telnet + compliance: + - cis: ["2.3.4"] + - cis_csc: ["2.6"] + condition: all + rules: + - "c:rpm -q telnet -> r:not installed" + + # 2.3.5 Ensure LDAP client is not installed + - id: 21058 + title: Ensure LDAP client is not installed. + description: > + The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for + NIS/YP. It is a service that provides a method for looking up information from a central + database. + rationale: > + If the system will not need to act as an LDAP client, it is recommended that the software be + removed to reduce the potential attack surface. + remediation: > + Run the following command to remove the openldap-clients package: + # zypper remove openldap2-clients + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2.6"] + condition: all + rules: + - "c:rpm -q openldap2-clients -> r:not installed" + + # 2.4 Ensure nonessential services are removed or masked - Not implemented + # 3.1.1 Disable IPv6 - Not implemented + # 3.1.2 Ensure wireless interfaces are disabled - Not implemented + # 3.2.1 Ensure IP forwarding is disabled - Not implemented + + # 3.2.2 Ensure packet redirect sending is disabled + - id: 21059 + title: Ensure packet redirect sending is disabled + description: > + ICMP Redirects are used to send routing information to other hosts. As a host itself does + not act as a router (in a host only configuration), there is no need to send redirects. + rationale: > + An attacker could use a compromised host to send invalid ICMP redirects to other router + devices in an attempt to corrupt routing and have users access a system set up by the + attacker as opposed to a valid system. + remediation: > + Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: + net.ipv4.conf.all.send_redirects = 0 + net.ipv4.conf.default.send_redirects = 0 + + Run the following commands to set the active kernel parameters: + # sysctl -w net.ipv4.conf.all.send_redirects=0 + # sysctl -w net.ipv4.conf.default.send_redirects=0 + # sysctl -w net.ipv4.route.flush=1 + compliance: + - cis: ["3.2.2"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + # 3.3.1 Ensure source routed packets are not accepted - Not implemented + # 3.3.2 Ensure ICMP redirects are not accepted - Not implemented + + #3.3.3 Ensure secure ICMP redirects are not accepted + - id: 21060 + title: Ensure secure ICMP redirects are not accepted. + description: > + Secure ICMP redirects are the same as ICMP redirects, except they come from gateways + listed on the default gateway list. It is assumed that these gateways are known to your + system, and that they are likely to be secure. + rationale: > + It is still possible for even known gateways to be compromised. Setting + net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table + updates by possibly compromised known gateways. + remediation: > + Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: + net.ipv4.conf.all.secure_redirects = 0 + net.ipv4.conf.default.secure_redirects = 0 + + Run the following commands to set the active kernel parameters: + # sysctl -w net.ipv4.conf.all.secure_redirects=0 + # sysctl -w net.ipv4.conf.default.secure_redirects=0 + # sysctl -w net.ipv4.route.flush=1 + compliance: + - cis: ["3.3.3"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + # 3.3.4 Ensure suspicious packets are logged + - id: 21061 + title: Ensure suspicious packets are logged. + description: > + When enabled, this feature logs packets with un-routable source addresses to the kernel + log. + rationale: > + Enabling this feature and logging these packets allows an administrator to investigate the + possibility that an attacker is sending spoofed packets to their system. + remediation: > + Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: + net.ipv4.conf.all.log_martians = 1 + net.ipv4.conf.default.log_martians = 1 + + Run the following commands to set the active kernel parameters: + # sysctl -w net.ipv4.conf.all.log_martians=1 + # sysctl -w net.ipv4.conf.default.log_martians=1 + # sysctl -w net.ipv4.route.flush=1 + compliance: + - cis: ["3.3.4"] + - cis_csc: ["6.2", "6.3"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + # 3.3.5 Ensure broadcast ICMP requests are ignored + - id: 21062 + title: Ensure broadcast ICMP requests are ignored + description: > + Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all + ICMP echo and timestamp requests to broadcast and multicast addresses. + rationale: > + Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for + your network could be used to trick your host into starting (or participating) in a Smurf + attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast + messages with a spoofed source address. All hosts receiving this message and responding + would send echo-reply messages back to the spoofed address, which is probably not + routable. If many hosts respond to the packets, the amount of traffic on the network could + be significantly multiplied. + remediation: > + Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: + net.ipv4.icmp_echo_ignore_broadcasts = 1 + + Run the following commands to set the active kernel parameters: + # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 + # sysctl -w net.ipv4.route.flush=1 + compliance: + - cis: ["3.3.5"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + # 3.3.6 Ensure bogus ICMP responses are ignored + - id: 21063 + title: Ensure bogus ICMP responses are ignored. + description: > + Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus + responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from + filling up with useless log messages. + rationale: > + Some routers (and some attackers) will send responses that violate RFC-1122 and attempt + to fill up a log file system with many useless error messages. + remediation: > + Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: + net.ipv4.icmp_ignore_bogus_error_responses = 1 + + Run the following commands to set the active kernel parameters: + # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 + # sysctl -w net.ipv4.route.flush=1 + compliance: + - cis: ["3.3.6"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + # 3.3.7 Ensure Reverse Path Filtering is enabled + - id: 21064 + title: Ensure Reverse Path Filtering is enabled. + description: > + Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces + the Linux kernel to utilize reverse path filtering on a received packet to determine if the + packet was valid. Essentially, with reverse path filtering, if the return packet does not go + out the same interface that the corresponding source packet came from, the packet is + dropped (and logged if log_martians is set). + rationale: > + Setting these flags is a good way to deter attackers from sending your system bogus + packets that cannot be responded to. One instance where this feature breaks down is if + asymmetrical routing is employed. This would occur when using dynamic routing protocols + (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you + will not be able to enable this feature without breaking the routing. + remediation: > + Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: + net.ipv4.conf.all.rp_filter = 1 + net.ipv4.conf.default.rp_filter = 1 + + Run the following commands to set the active kernel parameters: + # sysctl -w net.ipv4.conf.all.rp_filter=1 + # sysctl -w net.ipv4.conf.default.rp_filter=1 + # sysctl -w net.ipv4.route.flush=1 + compliance: + - cis: ["3.3.7"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + # 3.3.8 Ensure TCP SYN Cookies is enabled + - id: 21065 + title: Ensure TCP SYN Cookies is enabled + description: > + When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the + half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN + cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the + SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that + encodes the source and destination IP address and port number and the time the packet + was sent. A legitimate connection would send the ACK packet of the three way handshake + with the specially crafted sequence number. This allows the system to verify that it has + received a valid response to a SYN cookie and allow the connection, even though there is no + corresponding SYN in the queue. + rationale: > + Attackers use SYN flood attacks to perform a denial of service attacked on a system by + sending many SYN packets without completing the three way handshake. This will quickly + use up slots in the kernel's half-open connection queue and prevent legitimate connections + from succeeding. SYN cookies allow the system to keep accepting valid connections, even if + under a denial of service attack. + remediation: > + Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: + net.ipv4.tcp_syncookies = 1 + + Run the following commands to set the active kernel parameters: + # sysctl -w net.ipv4.tcp_syncookies=1 + # sysctl -w net.ipv4.route.flush=1 + compliance: + - cis: ["3.3.8"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + - 'c:/sbin/sysctl net.ipv4.tcp_syncookies -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + # 3.3.9 Ensure IPv6 router advertisements are not accepted + - id: 21066 + title: Ensure IPv6 router advertisements are not accepted + description: This setting disables the system's ability to accept IPv6 router advertisements. + rationale: > + It is recommended that systems do not accept router advertisements as they could be + tricked into routing traffic to compromised machines. Setting hard routes within the + system (usually a single default route to a trusted router) protects the system from bad + routes. + remediation: > + IF IPv6 is enabled: + + Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: + net.ipv6.conf.all.accept_ra = 0 + net.ipv6.conf.default.accept_ra = 0 + + Run the following commands to set the active kernel parameters: + # sysctl -w net.ipv6.conf.all.accept_ra=0 + # sysctl -w net.ipv6.conf.default.accept_ra=0 + # sysctl -w net.ipv6.route.flush=1 + compliance: + - cis: ["3.3.9"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:\s*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:\s*0$' + - 'c:grep -Rh "net\.ipv6\.conf\.all\.accept_ra" /etc/sysctl.conf /etc/sysctl.d -> r:^\s*net.ipv6.conf.all.accept_ra\s*=\s*0' + - 'c:grep -Rh "net\.ipv6\.conf\.default\.accept_ra" /etc/sysctl.conf /etc/sysctl.d -> r:^\s*net.ipv6.conf.default.accept_ra\s*=\s*0' + + # 3.4.1 Ensure DCCP is disabled + - id: 21067 + title: Ensure DCCP is disabled + description: > + The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that + supports streaming media and telephony. DCCP provides a way to gain access to + congestion control, without having to do it at the application layer, but does not provide + insequence delivery. + rationale: > + If the protocol is not required, it is recommended that the drivers not be installed to reduce + the potential attack surface. + remediation: > + Edit or create a file in the /etc/modprobe.d/ directory ending in .conf + Example: vim /etc/modprobe.d/dccp.conf + and add the following line: + + install dccp /bin/true + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + condition: all + rules: + - 'c:grep -R dccp /etc/modprobe.d -> r:^/etc/modprobe.d/\.+.conf:\s*install\s+dccp\s+/bin/true' + + # 3.4.2 Ensure SCTP is disabled + - id: 21068 + title: Ensure SCTP is disabled + description: > + The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to + support message oriented communication, with several streams of messages in one + connection. It serves a similar function as TCP and UDP, incorporating features of both. It is + message-oriented like UDP, and ensures reliable in-sequence transport of messages with + congestion control like TCP. + rationale: > + If the protocol is not being used, it is recommended that kernel module not be loaded, + disabling the service to reduce the potential attack surface. + remediation: > + Edit or create a file in the /etc/modprobe.d/ directory ending in .conf + Example: vim /etc/modprobe.d/sctp.conf + and add the following line: + + install sctp /bin/true + compliance: + - cis: ["3.4.2"] + - cis_csc: ["9.2"] + condition: all + rules: + - 'c:grep -R sctp /etc/modprobe.d -> r:^/etc/modprobe.d/\.+.conf:\s*install\s+sctp\s+/bin/true' + + # 3.5.1.1 Ensure FirewallD is installed + - id: 21069 + title: Ensure FirewallD is installed + description: > + firewalld is a firewall management tool for Linux operating systems. It provides firewall + features by acting as a front-end for the Linux kernel's netfilter framework via the iptables + backend or provides firewall features by acting as a front-end for the Linux kernel's + netfilter framework via the nftables utility. + + FirewallD replaces iptables as the default firewall management tool. Use the firewalld + utility to configure a firewall for less complex firewalls. The utility is easy to use and covers + the typical use cases scenario. FirewallD supports both IPv4 and IPv6 networks and can + administer separate firewall zones with varying degrees of trust as defined in zone profiles. + + Note: Starting in v0.6.0, FirewallD added support for acting as a front-end for the Linux + kernel's netfilter framework via the nftables userspace utility, acting as an alternative to the + nft command line program. + rationale: > + A firewall utility is required to configure the Linux kernel's netfilter framework via the + iptables or nftables back-end. + + The Linux kernel's netfilter framework host-based firewall can protect against threats + originating from within a corporate network to include malicious mobile code and poorly + configured software on a host. + + Note: Only one firewall utility should be installed and configured. FirewallD is dependent on + the iptables package. + remediation: > + Run the following command to install FirewallD and iptables: + # zypper install firewalld iptables + compliance: + - cis: ["3.5.1.1"] + - cis_csc: ["9.4"] + condition: none + rules: + - "c:rpm -q firewalld -> r:not installed" + - "c:rpm -q iptables -> r:not installed" + + # 3.5.1.2 Ensure nftables is not installed or stopped and masked - Not implemented + + # 3.5.1.3 Ensure firewalld service is enabled and running + - id: 21070 + title: Ensure firewalld service is enabled and running + description: > + firewalld.service enables the enforcement of firewall rules configured through + firewalld + rationale: > + Ensure that the firewalld.service is enabled and running to enforce firewall rules + configured through firewalld + remediation: > + Run the following command to unmask firewalld + # systemctl unmask firewalld + + Run the following command to enable and start firewalld + # systemctl --now enable firewalld + compliance: + - cis: ["3.5.1.3"] + - cis_csc: ["9.4"] + condition: all + rules: + - "c:systemctl is-enabled firewalld -> r:^enabled" + - "c:firewall-cmd --state -> r:^running" + + # 3.5.1.4 Ensure default zone is set - Not implemented + # 3.5.1.5 Ensure network interfaces are assigned to appropriate zone - Not implemented + # 3.5.1.6 Ensure unnecessary services and ports are not accepted - Not implemented + + # 3.5.2.1 Ensure nftables is installed + - id: 21071 + title: Ensure nftables is installed + description: > + nftables provides a new in-kernel packet classification framework that is based on a + network-specific Virtual Machine (VM) and a new nft userspace command line tool. + nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, + the connection tracking system, NAT, userspace queuing and logging subsystem. + Notes: + - nftables is available in Linux kernel 3.13 and newer. + - Only one firewall utility should be installed and configured. + rationale: > + nftables is a subsystem of the Linux kernel that can protect against threats originating from + within a corporate network to include malicious mobile code and poorly configured + software on a host. + remediation: > + Run the following command to install nftables + # zypper install nftables + compliance: + - cis: ["3.5.2.1"] + - cis_csc: ["9.4"] + condition: none + rules: + - "c:rpm -q nftables -> r:not installed" + + # 3.5.2.2 Ensure firewalld is not installed or stopped and masked - Not implemented + # 3.5.2.3 Ensure iptables are flushed - Not implemented + + # 3.5.2.4 Ensure a table exists + - id: 21072 + title: Ensure a table exists. + description: > + Tables hold chains. Each table only has one address family and only applies to packets of + this family. Tables can have one of five families. + rationale: > + nftables doesn't have any default tables. Without a table being build, nftables will not filter + network traffic. + remediation: > + Run the following command to create a table in nftables + # nft create table inet
+ compliance: + - cis: ["3.5.2.4"] + - cis_csc: ["9.4"] + condition: all + rules: + - 'c:nft list tables -> r:^table inet\s+\.+' + + # 3.5.2.5 Ensure base chains exist + - id: 21073 + title: Ensure base chains exist. + description: > + Chains are containers for rules. They exist in two kinds, base chains and regular chains. A + base chain is an entry point for packets from the networking stack, a regular chain may be + used as jump target and is used for better rule organization. + rationale: > + If a base chain doesn't exist with a hook for input, forward, and delete, packets that would + flow through those chains will not be touched by nftables. + remediation: > + Run the following command to create the base chains: + # nft create chain inet
{ type filter hook + <(input|forward|output)> priority 0 \; } + compliance: + - cis: ["3.5.2.5"] + - cis_csc: ["9.4"] + condition: all + rules: + - 'c:nft list ruleset -> !r:^# && r:type hook input\s+\.+' + - 'c:nft list ruleset -> !r:^# && r:type hook forward\s+\.+' + - 'c:nft list ruleset -> !r:^# && r:type hook output\s+\.+' + + # 3.5.2.6 Ensure loopback traffic is configured + # 3.5.2.7 Ensure outbound and established connections are configured + + # 3.5.2.8 Ensure default deny firewall policy + - id: 21074 + title: Ensure default deny firewall policy. + description: > + Base chain policy is the default verdict that will be applied to packets reaching the end of + the chain. + rationale: > + There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall + will accept any packet that is not configured to be denied and the packet will continue + transversing the network stack. + It is easier to white list acceptable usage than to black list unacceptable usage. + + Note: Changing firewall settings while connected over network can result in being locked + out of the system. + remediation: > + Run the following command for the base chains with the input, forward, and output hooks + to implement a default DROP policy: + # nft chain
{ policy drop \; } + + Example: + # nft chain inet filter input { policy drop \; } + # nft chain inet filter forward { policy drop \; } + # nft chain inet filter output { policy drop \; } + compliance: + - cis: ["3.5.2.8"] + - cis_csc: ["9.4"] + references: + - Manual Page nft + condition: all + rules: + - 'c:nft list ruleset -> !r:^# && r:type hook input\s+\.+policy\s+drop' + - 'c:nft list ruleset -> !r:^# && r:type hook forward\s+\.+policy\s+drop' + - 'c:nft list ruleset -> !r:^# && r:type hook output\s+\.+policy\s+drop' + + # 3.5.2.9 Ensure nftables service is enabled + - id: 21075 + title: Ensure nftables service is enabled + description: > + The nftables service allows for the loading of nftables rulesets during boot, or starting on + the nftables service + rationale: > + The nftables service restores the nftables rules from the rules files referenced in the + /etc/sysconfig/nftables.conf file during boot or the starting of the nftables service + remediation: > + Run the following command to enable the nftables service: + # systemctl enable nftables + compliance: + - cis: ["3.5.2.9"] + - cis_csc: ["9.4"] + condition: all + rules: + - "c:systemctl is-enabled nftables -> r:^enabled" + + # 3.5.2.10 Ensure nftables rules are permanent - Not implemented + # 3.5.3.1.1 Ensure iptables package is installed - Not implemented + + # 3.5.3.1.2 Ensure nftables is not installed - Not implemented + - id: 21076 + title: Ensure nftables is not installed + description: > + nftables is a subsystem of the Linux kernel providing filtering and classification of network + packets/datagrams/frames and is the successor to iptables. + rationale: > + Running both iptables and nftables may lead to conflict. + remediation: > + Run the following command to remove nftables: + # zypper remove nftables + compliance: + - cis: ["3.5.3.1.2"] + - cis_csc: ["9.4"] + condition: all + rules: + - "c:rpm -q nftables -> r:not installed" + + # 3.5.3.1.3 Ensure firewalld is not installed or stopped and masked - Not implemented + + # 3.5.3.2.1 Ensure default deny firewall policy + - id: 21077 + title: Ensure default deny firewall policy + description: > + A default deny all policy on connections ensures that any unconfigured network usage will + be rejected. + rationale: > + With a default accept policy the firewall will accept any packet that is not configured to be + denied. It is easier to white list acceptable usage than to black list unacceptable usage. + + Note: Changing firewall settings while connected over network can result in being locked + out of the system. + remediation: > + Run the following commands to implement a default DROP policy: + # iptables -P INPUT DROP + # iptables -P OUTPUT DROP + # iptables -P FORWARD DROP + compliance: + - cis: ["3.5.3.2.1"] + - cis_csc: ["9.4"] + condition: all + rules: + - 'c:iptables -L -> r:^Chain INPUT \(policy DROP\)' + - 'c:iptables -L -> r:^Chain FORWARD \(policy DROP\)' + - 'c:iptables -L -> r:^Chain OUTPUT \(policy DROP\)' + + # 3.5.3.2.2 Ensure loopback traffic is configured + - id: 21078 + title: Ensure loopback traffic is configured + description: > + Configure the loopback interface to accept traffic. Configure all other interfaces to deny + traffic to the loopback network (127.0.0.0/8). + rationale: > + Loopback traffic is generated between processes on machine and is typically critical to + operation of the system. The loopback interface is the only place that loopback network + (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this + network as an anti-spoofing measure. + + Note: Changing firewall settings while connected over network can result in being locked + out of the system. + remediation: > + Run the following commands to implement the loopback rules: + # iptables -A INPUT -i lo -j ACCEPT + # iptables -A OUTPUT -o lo -j ACCEPT + # iptables -A INPUT -s 127.0.0.0/8 -j DROP + compliance: + - cis: ["3.5.3.2.2"] + - cis_csc: ["9.4"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:^\s*\d+\s+\d+\s+ACCEPT\s+all\s+--\s+lo\s+*\s+0.0.0.0/0\s+0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:^\s*\d+\s+\d+\s+DROP\s+all\s+--\s+*\s+*\s+127.0.0.0/8\s+0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:^\s*\d+\s+\d+\s+ACCEPT\s+all\s+--\s+*\s+lo\s+0.0.0.0/0\s+0.0.0.0/0' + + # 3.5.3.2.3 Ensure outbound and established connections are configured - Not implemented + # 3.5.3.2.4 Ensure firewall rules exist for all open ports - Not implemented + # 3.5.3.3.1 Ensure IPv6 default deny firewall policy - Not implemented + # 3.5.3.3.2 Ensure IPv6 loopback traffic is configured - Not implemented + # 3.5.3.3.3 Ensure IPv6 outbound and established connections are configured - Not implemented + # 3.5.3.3.4 Ensure IPv6 firewall rules exist for all open ports - Not implemented + + # 4.1.1.1 Ensure auditd is installed + - id: 21079 + title: Ensure auditd is installed + description: > + auditd is the userspace component to the Linux Auditing System. It's responsible for + writing audit records to the disk + rationale: > + The capturing of system events provides system administrators with information to allow + them to determine if unauthorized access to their system is occurring. + remediation: > + Run the following command to Install auditd + # zypper install audit + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - "c:rpm -q audit -> r:not installed" + + # 4.1.1.2 Ensure auditd service is enabled and running + - id: 21080 + title: Ensure auditd service is enabled and running + description: Turn on the auditd daemon to record system events. + rationale: > + The capturing of system events provides system administrators with information to allow + them to determine if unauthorized access to their system is occurring. + remediation: > + Run the following command to enable and start auditd: + # systemctl --now enable auditd + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.2", "6.3"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:^enabled" + - 'c:systemctl status auditd -> r:^\s*Active: active \(running\) since \.+' + + # 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled - Not implemented + + # 4.1.2.1 Ensure audit log storage size is configured + - id: 21081 + title: Ensure audit log storage size is configured. + description: > + Configure the maximum size of the audit log file. Once the log reaches the maximum size, it + will be rotated and a new log file will be started. + + Notes: + - The max_log_file parameter is measured in megabytes. + - Other methods of log rotation may be appropriate based on site policy. One example is + time-based rotation strategies which don't have native support in auditd + configurations. Manual audit of custom configurations should be evaluated for + effectiveness and completeness. + rationale: > + It is important that an appropriate size is determined for log files so that they do not impact + the system and audit data is not lost. + remediation: > + Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: + max_log_file = + compliance: + - cis: ["4.1.2.1"] + - cis_csc: ["6.4"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file\s*=\s*\d+' + + # 4.1.2.2 Ensure audit logs are not automatically deleted + - id: 21082 + title: Ensure audit logs are not automatically deleted. + description: > + The max_log_file_action setting determines how to handle the audit log file reaching the + max file size. A value of keep_logs will rotate the logs but never delete old logs. + rationale: > + In high security contexts, the benefits of maintaining a long audit history exceed the cost of + storing the audit history. + remediation: > + Set the following parameter in /etc/audit/auditd.conf: + max_log_file_action = keep_logs + compliance: + - cis: ["4.1.2.2"] + - cis_csc: ["6.2", "6.4"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*max_log_file_action\s*=\s*keep_logs' + + # 4.1.2.3 Ensure system is disabled when audit logs are full + - id: 21083 + title: Ensure system is disabled when audit logs are full. + description: The auditd daemon can be configured to halt the system when the audit logs are full. + rationale: > + In high security contexts, the risk of detecting unauthorized access or nonrepudiation + exceeds the benefit of the system's availability. + remediation: > + Set the following parameters in /etc/audit/auditd.conf: + space_left_action = email + action_mail_acct = root + admin_space_left_action = halt + compliance: + - cis: ["4.1.2.3"] + - cis_csc: ["6.2", "6.4"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt' + + # 4.1.2.4 Ensure audit_backlog_limit is sufficient - Not implemented + # 4.1.3 Ensure events that modify date and time information are collected - Not implemented + + # 4.1.4 Ensure events that modify user/group information are collected + - id: 21084 + title: Ensure events that modify user/group information are collected. + description: > + Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or + /etc/security/opasswd (old passwords, based on remember parameter in the PAM + configuration) files. The parameters in this section will watch the files to see if they have + been opened for write or have had attribute changes (e.g. permissions) and tag them with + the identifier "identity" in the audit log file. + + Note: Reloading the auditd config to set active settings may require a system reboot. + rationale: > + Unexpected changes to these files could be an indication that the system has been + compromised and that an unauthorized user is attempting to hide their activities or + compromise additional accounts. + remediation: > + Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules + Example: vi /etc/audit/rules.d/identity.rules + and add the following lines: + + -w /etc/group -p wa -k identity + -w /etc/passwd -p wa -k identity + -w /etc/gshadow -p wa -k identity + -w /etc/shadow -p wa -k identity + -w /etc/security/opasswd -p wa -k identity + compliance: + - cis: ["4.1.4"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'c:grep -R identity /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/etc/group\s+-p\s+wa\s+-k\s+identity' + - 'c:grep -R identity /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/etc/passwd\s+-p\s+wa\s+-k\s+identity' + - 'c:grep -R identity /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/etc/gshadow\s+-p\s+wa\s+-k\s+identity' + - 'c:grep -R identity /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/etc/shadow\s+-p\s+wa\s+-k\s+identity' + - 'c:grep -R identity /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/etc/security/opasswd\s+-p\s+wa\s+-k\s+identity' + - 'c:sh -c "auditctl -l | grep identity" -> r:^\s*-w\s+/etc/group\s+-p\s+wa\s+-k\s+identity' + - 'c:sh -c "auditctl -l | grep identity" -> r:^\s*-w\s+/etc/passwd\s+-p\s+wa\s+-k\s+identity' + - 'c:sh -c "auditctl -l | grep identity" -> r:^\s*-w\s+/etc/gshadow\s+-p\s+wa\s+-k\s+identity' + - 'c:sh -c "auditctl -l | grep identity" -> r:^\s*-w\s+/etc/shadow\s+-p\s+wa\s+-k\s+identity' + - 'c:sh -c "auditctl -l | grep identity" -> r:^\s*-w\s+/etc/security/opasswd\s+-p\s+wa\s+-k\s+identity' + + # 4.1.5 Ensure events that modify the system's network environment are collected - Not implemented + + # 4.1.6 Ensure events that modify the system's Mandatory Access Controls are collected + - id: 21085 + title: Ensure events that modify the system's Mandatory Access Controls are collected. + description: > + Monitor SELinux mandatory access controls. The parameters below monitor any write + access (potential additional, deletion or modification of files in the directory) or attribute + changes to the /etc/selinux/ and /usr/share/selinux/ directories. + + Notes: + - If a different Mandatory Access Control method is used, changes to the corresponding + directories should be audited. + - Reloading the auditd config to set active settings requires the auditd service to be + restarted, and may require a system reboot. + rationale: > + Changes to files in the /etc/selinux/ and /usr/share/selinux/ directories could indicate + that an unauthorized user is attempting to modify access controls and change security + contexts, leading to a compromise of the system. + remediation: > + Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules + Example: vi /etc/audit/rules.d/MAC_policy.rules + and add the following lines: + + -w /etc/selinux/ -p wa -k MAC-policy + -w /usr/share/selinux/ -p wa -k MAC-policy + compliance: + - cis: ["4.1.6"] + - cis_csc: ["5.5"] + condition: all + rules: + - 'c:grep -R MAC-policy /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/etc/selinux/\s+-p\s+wa\s+-k\s+MAC-policy' + - 'c:grep -R MAC-policy /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/usr/share/selinux/\s+-p\s+wa\s+-k\s+MAC-policy' + - 'c:sh -c "auditctl -l | grep MAC-policy" -> r:^\s*-w\s+/etc/selinux/\s+-p\s+wa\s+-k\s+MAC-policy' + - 'c:sh -c "auditctl -l | grep MAC-policy" -> r:^\s*-w\s+/usr/share/selinux/\s+-p\s+wa\s+-k\s+MAC-policy' + + # 4.1.7 Ensure login and logout events are collected + - id: 21086 + title: Ensure login and logout events are collected. + description: > + Monitor login and logout events. The parameters below track changes to files associated + with login/logout events. + - The file /var/log/faillog tracks failed events from login. + - The file /var/log/lastlog maintain records of the last time a user successfully + logged in. + - The file /var/log/tallylog maintains records of failures via the pam_tally2 + module + Note: Reloading the auditd config to set active settings requires the auditd service to be + restarted, and may require a system reboot. + rationale: > + Monitoring login/logout events could provide a system administrator with information + associated with brute force attacks against user logins. + remediation: > + Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules + Example: vi /etc/audit/rules.d/logins.rules + and add the following lines: + + -w /var/log/faillog -p wa -k logins + -w /var/log/lastlog -p wa -k logins + -w /var/log/tallylog -p wa -k logins + compliance: + - cis: ["4.1.7"] + - cis_csc: ["4.9", "16.11", "16.13"] + condition: all + rules: + - 'c:grep -R logins /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/var/log/faillog\s+-p\s+wa\s+-k\s+logins' + - 'c:grep -R logins /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/var/log/lastlog\s+-p\s+wa\s+-k\s+logins' + - 'c:grep -R logins /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/var/log/tallylog\s+-p\s+wa\s+-k\s+logins' + - 'c:sh -c "auditctl -l | grep logins" -> r:^\s*-w\s+/var/log/faillog\s+-p\s+wa\s+-k\s+logins' + - 'c:sh -c "auditctl -l | grep logins" -> r:^\s*-w\s+/var/log/lastlog\s+-p\s+wa\s+-k\s+logins' + - 'c:sh -c "auditctl -l | grep logins" -> r:^\s*-w\s+/var/log/tallylog\s+-p\s+wa\s+-k\s+logins' + + # 4.1.8 Ensure session initiation information is collected + - id: 21087 + title: Ensure session initiation information is collected. + description: > + Monitor session initiation events. The parameters in this section track changes to the files + associated with session events. The file /var/run/utmp tracks all currently logged in users. + All audit records will be tagged with the identifier "session." The /var/log/wtmp file tracks + logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed + login attempts and can be read by entering the command /usr/bin/last -f + /var/log/btmp . All audit records will be tagged with the identifier "logins." + + Notes: + - The last command can be used to read /var/log/wtmp (last with no parameters) + and /var/run/utmp (last -f /var/run/utmp) + - Reloading the auditd config to set active settings requires the auditd service to be + restarted, and may require a system reboot. + rationale: > + Monitoring these files for changes could alert a system administrator to logins occurring at + unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when + they do not normally log in). + remediation: > + Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules + Example: vi /etc/audit/rules.d/session.rules + and add the following lines: + + -w /var/run/utmp -p wa -k session + -w /var/log/wtmp -p wa -k logins + -w /var/log/btmp -p wa -k logins + compliance: + - cis: ["4.1.8"] + - cis_csc: ["4.9", "16.11", "16.13"] + condition: all + rules: + - 'c:grep -RE "(session|logins)" /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/var/run/utmp\s+-p\s+wa\s+-k\s+session' + - 'c:grep -RE "(session|logins)" /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/var/log/wtmp\s+-p\s+wa\s+-k\s+logins' + - 'c:grep -RE "(session|logins)" /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/var/log/btmp\s+-p\s+wa\s+-k\s+logins' + - 'c:sh -c "auditctl -l | grep -E \"(session|logins)\"" -> r:^\s*-w\s+/var/run/utmp\s+-p\s+wa\s+-k\s+session' + - 'c:sh -c "auditctl -l | grep -E \"(session|logins)\"" -> r:^\s*-w\s+/var/log/wtmp\s+-p\s+wa\s+-k\s+logins' + - 'c:sh -c "auditctl -l | grep -E \"(session|logins)\"" -> r:^\s*-w\s+/var/log/btmp\s+-p\s+wa\s+-k\s+logins' + + # 4.1.9 Ensure discretionary access control permission modification events are collected - Not implemented + # 4.1.10 Ensure unsuccessful unauthorized file access attempts are collected - Not implemented + # 4.1.11 Ensure use of privileged commands is collected - Not implemented + # 4.1.12 Ensure successful file system mounts are collected - Not implemented + # 4.1.13 Ensure file deletion events by users are collected - Not implemented + + # 4.1.14 Ensure changes to system administration scope (sudoers) is collected + - id: 21088 + title: Ensure changes to system administration scope (sudoers) is collected + description: > + Monitor scope changes for system administrators. If the system has been properly + configured to force system administrators to log in as themselves first and then use the + sudo command to execute privileged commands, it is possible to monitor changes in scope. + The file /etc/sudoers or a file in the /etc/sudoers.d directory will be written to when the + file or its attributes have changed. + + Notes: Reloading the auditd config to set active settings may require a system reboot. + rationale: > + Changes in the /etc/sudoers file, or a file in the /etc/sudoers.d/ directory can indicate + that an unauthorized change has been made to scope of system administrator activity. + remediation: > + Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules + Example: vi /etc/audit/rules.d/scope.rules + and add the following lines: + + -w /etc/sudoers -p wa -k scope + -w /etc/sudoers.d/ -p wa -k scope + compliance: + - cis: ["4.1.14"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'c:grep -R scope /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/etc/sudoers\s+-p\s+wa\s+-k\s+scope' + - 'c:grep -R scope /etc/audit/rules.d/ -> r:^/etc/audit/rules.d/\.+.rules:\s*-w\s+/etc/sudoers.d/\s+-p\s+wa\s+-k\s+scope' + - 'c:sh -c "auditctl -l | grep scope" -> r:^\s*-w\s+/etc/sudoers\s+-p\s+wa\s+-k\s+scope' + - 'c:sh -c "auditctl -l | grep scope" -> r:^\s*-w\s+/etc/sudoers.d/\s+-p\s+wa\s+-k\s+scope' + + # 4.1.15 Ensure system administrator actions (sudolog) are collected - Not implemented + # 4.1.16 Ensure kernel module loading and unloading is collected - Not implemented + + # 4.1.17 Ensure the audit configuration is immutable + - id: 21089 + title: Ensure the audit configuration is immutable. + description: > + Set system audit so that audit rules cannot be modified with auditctl . Setting the flag "-e + 2" forces audit to be put in immutable mode. Audit changes can only be made on system + reboot. + + Note: This setting will require the system to be rebooted to update the active auditd + configuration settings. + rationale: > + In immutable mode, unauthorized users cannot execute changes to the audit system to + potentially hide malicious activity and then put the audit rules back. Users would most + likely notice a system reboot and that could alert administrators of an attempt to make + unauthorized audit changes. + remediation: > + Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the following line + at the end of the file: + + -e 2 + compliance: + - cis: ["4.1.17"] + - cis_csc: ["6.2", "6.3"] + condition: all + rules: + - 'c:sh -c "grep -R \"^\s*[^#]\" /etc/audit/rules.d/ | tail -1" -> r:^/etc/audit/rules.d/\.+.rules:\s*-e\s+2\s*$' + + # 4.2.1.1 Ensure rsyslog is installed + - id: 21090 + title: Ensure rsyslog is installed. + description: > + The rsyslog software is a recommended replacement to the original syslogd daemon. + rsyslog provides improvements over syslogd, including: + - connection-oriented (i.e. TCP) transmission of logs + - The option to log to database formats + - Encryption of log data en route to a central logging server + rationale: > + The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission + of logs, the option to log to database formats, and the encryption of log data en route to a + central logging server) justify installing and configuring the package. + remediation: > + Run the following command to install rsyslog: + # zypper install rsyslog + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2", "6.3"] + condition: none + rules: + - "c:rpm -q rsyslog -> r:not installed" + + # 4.2.1.2 Ensure rsyslog Service is enabled and running + - id: 21091 + title: Ensure rsyslog Service is enabled and running. + description: rsyslog needs to be enabled and running to perform logging + rationale: > + If the rsyslog service is not activated the system may default to the syslogd service or lack + logging instead. + remediation: > + Run the following command to enable and start rsyslog: + # systemctl --now enable rsyslog + compliance: + - cis: ["4.2.1.2"] + - cis_csc: ["6.2", "6.3"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:^enabled" + - 'c:systemctl status rsyslog -> r:^\s*Active: active \(running\) since \.+' + + # 4.2.1.3 Ensure rsyslog default file permissions configured + - id: 21092 + title: Ensure rsyslog default file permissions configured. + description: > + rsyslog will create logfiles that do not already exist on the system. This setting controls + what permissions will be applied to these newly created files. + The $FileCreateMode parameter specifies the file creation mode with which rsyslogd + creates new files. If not specified, the value 0644 is used. + Notes: + - The value given must always be a 4-digit octal number, with the initial digit being + zero. + - This setting can be overridden by a less restrictive setting in any file ending in .conf in + the /etc/rsyslog.d/ directory + rationale: > + It is important to ensure that log files have the correct permissions to ensure that sensitive + data is archived and protected. + remediation: > + Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to + 0640 or more restrictive: + + $FileCreateMode 0640 + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + references: + - See the rsyslog.conf(5) man page for more information. + condition: all + rules: + - 'c:grep -Rh ^\$FileCreateMode /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$FileCreateMode\s+0640' + + # 4.2.1.4 Ensure logging is configured - Not implemented + # 4.2.1.5 Ensure rsyslog is configured to send logs to a remote log host - Not implemented + # 4.2.1.6 Ensure remote rsyslog messages are only accepted on designated log hosts - Not implemented + + # 4.2.2.1 Ensure journald is configured to send logs to rsyslog + - id: 21093 + title: Ensure journald is configured to send logs to rsyslog. + description: > + Data from journald may be stored in volatile memory or persisted locally on the server. + Utilities exist to accept remote export of journald logs, however, use of the rsyslog service + provides a consistent means of log collection and export. + + Notes: + - This recommendation assumes that recommendation 4.2.1.5, "Ensure rsyslog is + configured to send logs to a remote log host" has been implemented. + - The main configuration file /etc/systemd/journald.conf is read before any of the + custom *.conf files. If there are custom configs present, they override the main + configuration parameters + - As noted in the journald man pages: journald logs may be exported to rsyslog either + through the process mentioned here, or through a facility like systemdjournald.service. There are trade-offs involved in each implementation, where + ForwardToSyslog will immediately capture all events (and forward to an external log + server, if properly configured), but may not capture all boot-up activities. Mechanisms + such as systemd-journald.service, on the other hand, will record bootup events, but + may delay sending the information to rsyslog, leading to the potential for log + manipulation prior to export. Be aware of the limitations of all tools employed to + secure a system. + rationale: > + Storing log data on a remote host protects log integrity from local attacks. If an attacker + gains root access on the local system, they could tamper with or remove log data that is + stored on the local system. + remediation: > + Edit the /etc/systemd/journald.conf file and add the following line: + ForwardToSyslog=yes + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.5"] + references: + - https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf + condition: all + rules: + - "f:/etc/systemd/journald.conf -> r:^ForwardToSyslog=yes" + + # 4.2.2.2 Ensure journald is configured to compress large log files + - id: 21094 + title: Ensure journald is configured to compress large log files. + description: > + The journald system includes the capability of compressing overly large files to avoid filling + up the system with logs or making the log's size unmanageable. + + Note: The main configuration file /etc/systemd/journald.conf is read before any of the + custom *.conf files. If there are custom configs present, they override the main configuration + parameters + rationale: > + Uncompressed large files may unexpectedly fill a filesystem leading to resource + unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem + impacts. + remediation: > + Edit the /etc/systemd/journald.conf file and add the following line: + Compress=yes + compliance: + - cis: ["4.2.2.2"] + - cis_csc: ["6.4"] + references: + - https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf + condition: all + rules: + - "f:/etc/systemd/journald.conf -> r:^Compress=yes" + + # 4.2.2.3 Ensure journald is configured to write logfiles to persistent disk + - id: 21095 + title: Ensure journald is configured to write logfiles to persistent disk. + description: > + Data from journald may be stored in volatile memory or persisted locally on the server. + Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the + server they are protected from loss. + + Note: The main configuration file /etc/systemd/journald.conf is read before any of the + custom *.conf files. If there are custom configs present, they override the main configuration + parameters + rationale: > + Writing log data to disk will provide the ability to forensically reconstruct events which + may have impacted the operations or security of a system even after a system crash or + reboot. + remediation: > + Edit the /etc/systemd/journald.conf file and add the following line: + Storage=persistent + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["6.2", "6.3"] + references: + - https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf + condition: all + rules: + - "f:/etc/systemd/journald.conf -> r:^Storage=persistent" + + # 4.2.3 Ensure permissions on all logfiles are configured - Not implemented + # 4.2.4 Ensure logrotate is configured - Not implemented + + # 5.1.1 Ensure cron daemon is enabled and running + - id: 21096 + title: Ensure cron daemon is enabled and running + description: The cron daemon is used to execute batch jobs on the system. + rationale: > + While there may not be user jobs that need to be run on the system, the system does have + maintenance jobs that may include security monitoring that have to run. If another method + for scheduling tasks is not being used, cron is used to execute them, and needs to be + enabled and running. + remediation: > + Run the following command to enable and start cron: + # systemctl --now enable cron + + OR + + Run the following command to remove cron: + # zypper remove cronie + compliance: + - cis: ["5.1.1"] + - cis_csc: ["5.1"] + condition: all + rules: + - "c:systemctl is-enabled cron -> r:^enabled" + - 'c:systemctl status cron -> r:^\s*Active: active \(running\) since \.+' + + # 5.1.2 Ensure permissions on /etc/crontab are configured + - id: 21097 + title: Ensure permissions on /etc/crontab are configured. + description: > + The /etc/crontab file is used by cron to control its own jobs. The commands in this item + make sure that root is the user and group owner of the file and that only the owner can + access the file. + rationale: > + This file contains information on what system jobs are run by cron. Write access to these + files could provide unprivileged users with the ability to elevate their privileges. Read + access to these files could provide users with the ability to gain insight on system jobs that + run on the system and could provide them a way to gain unauthorized privileged access. + remediation: > + Run the following commands to set ownership and permissions on /etc/crontab: + # chown root:root /etc/crontab + # chmod u-x,og-rwx /etc/crontab + + OR + + Run the following command to remove cron: + # zypper remove cronie + compliance: + - cis: ["5.1.2"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/crontab -> r:^Access:\s*\(0600/-rw-------\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured + - id: 21098 + title: Ensure permissions on /etc/cron.hourly are configured. + description: > + This directory contains system cron jobs that need to run on an hourly basis. The files in + this directory cannot be manipulated by the crontab command, but are instead edited by + system administrators using a text editor. The commands below restrict read/write and + search access to user and group root, preventing regular users from accessing this + directory. + rationale: > + Granting write access to this directory for non-privileged users could provide them the + means for gaining unauthorized elevated privileges. Granting read access to this directory + could give an unprivileged user insight in how to gain elevated privileges or circumvent + auditing controls. + remediation: > + Run the following commands to set ownership and permissions on the /etc/cron.hourly/ + directory: + # chown root:root /etc/cron.hourly/ + # chmod og-rwx /etc/cron.hourly/ + + OR + + Run the following command to remove cron + # zypper remove cronie + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:stat -L /etc/cron.hourly/ -> r:^Access:\s*\(0700/drwx------\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured + - id: 21099 + title: Ensure permissions on /etc/cron.daily are configured. + description: > + The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. + The files in this directory cannot be manipulated by the crontab command, but are instead + edited by system administrators using a text editor. The commands below restrict + read/write and search access to user and group root, preventing regular users from + accessing this directory. + rationale: > + Granting write access to this directory for non-privileged users could provide them the + means for gaining unauthorized elevated privileges. Granting read access to this directory + could give an unprivileged user insight in how to gain elevated privileges or circumvent + auditing controls. + remediation: > + Run the following commands to set ownership and permissions on /etc/cron.daily + directory: + # chown root:root /etc/cron.daily + # chmod og-rwx /etc/cron.daily + + OR + + Run the following command to remove cron: + # zypper remove cronie + compliance: + - cis: ["5.1.4"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/cron.daily/ -> r:^Access:\s*\(0700/drwx------\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured + - id: 21100 + title: Ensure permissions on /etc/cron.weekly are configured. + description: > + The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly + basis. The files in this directory cannot be manipulated by the crontab command, but are + instead edited by system administrators using a text editor. The commands below restrict + read/write and search access to user and group root, preventing regular users from + accessing this directory. + rationale: > + Granting write access to this directory for non-privileged users could provide them the + means for gaining unauthorized elevated privileges. Granting read access to this directory + could give an unprivileged user insight in how to gain elevated privileges or circumvent + auditing controls. + remediation: > + Granting write access to this directory for non-privileged users could provide them the + means for gaining unauthorized elevated privileges. Granting read access to this directory + could give an unprivileged user insight in how to gain elevated privileges or circumvent + auditing controls. + compliance: + - cis: ["5.1.5"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/cron.weekly -> r:^Access:\s*\(0700/drwx------\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured + - id: 21101 + title: Ensure permissions on /etc/cron.monthly are configured. + description: > + The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly + basis. The files in this directory cannot be manipulated by the crontab command, but are + instead edited by system administrators using a text editor. The commands below restrict + read/write and search access to user and group root, preventing regular users from + accessing this directory. + rationale: > + Granting write access to this directory for non-privileged users could provide them the + means for gaining unauthorized elevated privileges. Granting read access to this directory + could give an unprivileged user insight in how to gain elevated privileges or circumvent + auditing controls. + remediation: > + Run the following commands to set ownership and permissions on /etc/cron.monthly + directory: + # chown root:root /etc/cron.monthly + # chmod og-rwx /etc/cron.monthly + + OR + + Run the following command to remove cron: + # zypper remove cronie + compliance: + - cis: ["5.1.6"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/cron.monthly/ -> r:^Access:\s*\(0700/drwx------\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured + - id: 21102 + title: Ensure permissions on /etc/cron.d are configured. + description: > + The /etc/cron.d/ directory contains system cron jobs that need to run in a similar manner + to the hourly, daily weekly and monthly jobs from /etc/crontab , but require more + granular control as to when they run. The files in this directory cannot be manipulated by + the crontab command, but are instead edited by system administrators using a text editor. + The commands below restrict read/write and search access to user and group root, + preventing regular users from accessing this directory. + rationale: > + Granting write access to this directory for non-privileged users could provide them the + means for gaining unauthorized elevated privileges. Granting read access to this directory + could give an unprivileged user insight in how to gain elevated privileges or circumvent + auditing controls. + remediation: > + Run the following commands to set ownership and permissions on /etc/cron.d directory: + # chown root:root /etc/cron.d + # chmod og-rwx /etc/cron.d + + OR + + Run the following command to remove cron: + # zypper remove cronie + compliance: + - cis: ["5.1.7"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/cron.d -> r:^Access:\s*\(0700/drwx------\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 5.1.8 Ensure cron is restricted to authorized users + - id: 21103 + title: Ensure cron is restricted to authorized users. + description: > + If cron is installed in the system, configure /etc/cron.allow to allow specific users to use + these services. If /etc/cron.allow does not exist, then /etc/cron.deny is checked. Any + user not specifically defined in those files is allowed to use cron. By removing the file, only + users in /etc/cron.allow are allowed to use cron. + + Note: Even though a given user is not listed in cron.allow, cron jobs can still be run as that + user. The cron.allow file only controls administrative access to the crontab command for + scheduling and modifying cron jobs. + rationale: > + On many systems, only the system administrator is authorized to schedule cron jobs. Using + the cron.allow file to control who can run cron jobs enforces this policy. It is easier to + manage an allow list than a deny list. In a deny list, you could potentially add a user ID to + the system and forget to add it to the deny files. + remediation: > + Run the following command to remove /etc/cron.deny: + # rm /etc/cron.deny + + Run the following command to create /etc/cron.allow + # touch /etc/cron.allow + + Run the following commands to set the owner and permissions on /etc/cron.allow: + # chown root:root /etc/cron.allow + # chmod u-x,og-rwx /etc/cron.allow + + OR + + Run the following command to remove cron + # zypper remove cronie + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + condition: all + rules: + - "not f:/etc/cron.deny" + - 'c:stat -L /etc/cron.allow -> r:^Access:\s*\(0600/-rw-------\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 5.1.9 Ensure at is restricted to authorized users + - id: 21104 + title: Ensure at is restricted to authorized users. + description: > + If at is installed in the system, configure /etc/at.allow to allow specific users to use these + services. If /etc/at.allow does not exist, then /etc/at.deny is checked. Any user not + specifically defined in those files is allowed to use at. By removing the file, only users in + /etc/at.allow are allowed to use at. + + Note: Even though a given user is not listed in at.allow, at jobs can still be run as that user. + The at.allow file only controls administrative access to the at command for scheduling and + modifying at jobs. + rationale: > + On many systems, only the system administrator is authorized to schedule at jobs. Using + the at.allow file to control who can run at jobs enforces this policy. It is easier to manage + an allow list than a deny list. In a deny list, you could potentially add a user ID to the system + and forget to add it to the deny files. + remediation: > + Run the following command to remove /etc/at.deny: + # rm /etc/at.deny + + Run the following command to create /etc/at.allow + # touch /etc/at.allow + + Run the following commands to set the owner and permissions on /etc/at.allow: + # chown root:root /etc/at.allow + # chmod u-x,og-rwx /etc/at.allow + + OR + + Run the following command to remove at: + # zypper remove at + compliance: + - cis: ["5.1.9"] + - cis_csc: ["16"] + condition: all + rules: + - "not f:/etc/at.deny" + - 'c:stat -L /etc/at.allow -> r:^Access:\s*\(0600/-rw-------\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured + - id: 21114 + title: Ensure permissions on /etc/ssh/sshd_config are configured + description: > + The /etc/ssh/sshd_config file contains configuration specifications for sshd. The + command below sets the owner and group of the file to root. + rationale: > + The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by nonprivileged users. + remediation: > + Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: + + # chown root:root /etc/ssh/sshd_config + # chmod og-rwx /etc/ssh/sshd_config + compliance: + - cis: ["5.2.1"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/ssh/sshd_config -> r:^Access:\s*\(0600/-rw-------\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 5.2.2 Ensure permissions on SSH private host key files are configured - Not implemented + # 5.2.3 Ensure permissions on SSH public host key files are configured - Not implemented + + # 5.2.4 Ensure SSH access is limited + - id: 21115 + title: Ensure SSH access is limited. + description: > + There are several options available to limit which users and group can access the system + via SSH. It is recommended that at least one of the following options be leveraged: + - AllowUsers: + - The AllowUsers variable gives the system administrator the option of + allowing specific users to ssh into the system. The list consists of space + separated user names. Numeric user IDs are not recognized with this + variable. If a system administrator wants to restrict user access further by + only allowing the allowed users to log in from a particular host, the entry can + be specified in the form of user@host. + - AllowGroups: + - The AllowGroups variable gives the system administrator the option of + allowing specific groups of users to ssh into the system. The list consists of + space separated group names. Numeric group IDs are not recognized with + this variable. + - DenyUsers: + - The DenyUsers variable gives the system administrator the option of denying + specific users to ssh into the system. The list consists of space separated user + names. Numeric user IDs are not recognized with this variable. If a system + administrator wants to restrict user access further by specifically denying a + user's access from a particular host, the entry can be specified in the form of + user@host. + - DenyGroups: + - The DenyGroups variable gives the system administrator the option of + denying specific groups of users to ssh into the system. The list consists of + space separated group names. Numeric group IDs are not recognized with + this variable. + rationale: > + Restricting which users can remotely access the system via SSH will help ensure that only + authorized users access the system. + remediation: > + Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: + AllowUsers + + OR + AllowGroups + + OR + DenyUsers + + OR + DenyGroups + compliance: + - cis: ["5.2.4"] + - cis_csc: ["4.3"] + condition: any + rules: + - 'c:sshd -T -> r:^\s*allowusers\s+\S+' + - 'c:sshd -T -> r:^\s*allowgroups\s+\S+' + - 'c:sshd -T -> r:^\s*denyusers\s+\S+' + - 'c:sshd -T -> r:^\s*denygroups\s+\S+' + + # 5.2.5 Ensure SSH LogLevel is appropriate + - id: 21116 + title: Ensure SSH LogLevel is appropriate. + description: > + INFO 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. + + VERBOSE level specifies that login and logout activity as well as the key fingerprint for any + SSH key used for login will be logged. This information is important for SSH key + management, especially in legacy environments. + rationale: > + 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. + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + LogLevel VERBOSE + OR + LogLevel INFO + compliance: + - cis: ["5.2.5"] + - cis_csc: ["6.2", "6.3"] + references: + - https://www.ssh.com/ssh/sshd_config/ + condition: any + rules: + - 'f:$sshd_file -> !r:^\s*\t*# && r:LogLevel\s*\t*VERBOSE' + - 'f:$sshd_file -> !r:^\s*\t*# && r:LogLevel\s*\t*INFO' + + # 5.2.6 Ensure SSH X11 forwarding is disabled + - id: 21117 + title: Ensure SSH X11 forwarding is disabled. + description: > + The X11Forwarding parameter provides the ability to tunnel X11 traffic through the + connection to enable remote graphic connections. + rationale: > + Disable X11 forwarding unless there is an operational requirement to use X11 applications + directly. There is a small risk that the remote X11 servers of users who are logged in via + SSH with X11 forwarding could be compromised by other users on the X11 server. Note + that even if X11 forwarding is disabled, users can always install their own forwarders. + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + X11Forwarding no + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*x11forwarding\s+no' + + # 5.2.7 Ensure SSH MaxAuthTries is set to 4 or less + - id: 21118 + title: Ensure SSH MaxAuthTries is set to 4 or less. + description: > + The MaxAuthTries parameter specifies the maximum number of authentication attempts + permitted per connection. When the login failure count reaches half the number, error + messages will be written to the syslog file detailing the login failure. + rationale: > + Setting the MaxAuthTries parameter to a low number will minimize the risk of successful + brute force attacks to the SSH server. While the recommended setting is 4, set the number + based on site policy. + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + MaxAuthTries 4 + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16.13"] + condition: all + rules: + - 'f:$sshd_file -> !r:^\s*\t*# && n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.2.8 Ensure SSH IgnoreRhosts is enabled + - id: 21119 + title: Ensure SSH IgnoreRhosts is enabled. + description: > + The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in + RhostsRSAAuthentication or HostbasedAuthentication. + rationale: Setting this parameter forces users to enter a password when authenticating with ssh. + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + IgnoreRhosts yes + compliance: + - cis: ["5.2.8"] + - cis_csc: ["9.2"] + condition: all + rules: + - 'f:$sshd_file -> !r:^\s*\t*# && r:IgnoreRhosts\s*\t*yes' + + # 5.2.9 Ensure SSH HostbasedAuthentication is disabled + - id: 21120 + title: Ensure SSH HostbasedAuthentication is disabled. + description: > + The HostbasedAuthentication parameter specifies if authentication is allowed through + trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public + key client host authentication. This option only applies to SSH Protocol Version 2. + rationale: > + Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, + disabling the ability to use .rhosts files in SSH provides an additional layer of protection. + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + HostbasedAuthentication no + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16.3"] + condition: all + rules: + - 'f:$sshd_file -> !r:^\s*\t*# && r:HostbasedAuthentication\s*\t*no' + + # 5.2.10 Ensure SSH root login is disabled + - id: 21121 + title: Ensure SSH root login is disabled. + description: > + The PermitRootLogin parameter specifies if the root user can log in using ssh. The default + is no. + rationale: > + Disallowing root logins over SSH requires system admins to authenticate using their own + individual account, then escalating to root via sudo or su. This in turn limits opportunity for + non-repudiation and provides a clear audit trail in the event of a security incident. + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + PermitRootLogin no + compliance: + - cis: ["5.2.10"] + - cis_csc: ["4.3"] + condition: all + rules: + - 'f:$sshd_file -> !r:^\s*\t*# && r:PermitRootLogin\s*\t*no' + + # 5.2.11 Ensure SSH PermitEmptyPasswords is disabled + - id: 21122 + title: Ensure SSH PermitEmptyPasswords is disabled. + description: > + The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts + with empty password strings. + rationale: > + Disallowing remote shell access to accounts that have an empty password reduces the + probability of unauthorized access to the system + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + PermitEmptyPasswords no + compliance: + - cis: ["5.2.11"] + - cis_csc: ["16.3"] + condition: all + rules: + - 'f:$sshd_file -> !r:^\s*\t*# && r:PermitEmptyPasswords\s*\t*no' + + # 5.2.12 Ensure SSH PermitUserEnvironment is disabled + - id: 21123 + title: Ensure SSH PermitUserEnvironment is disabled. + description: > + The PermitUserEnvironment option allows users to present environment options to the + ssh daemon. + rationale: > + Permitting users the ability to set environment variables through the SSH daemon could + potentially allow users to bypass security controls (e.g. setting an execution path that has + ssh executing a Trojan’s programs) + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + PermitUserEnvironment no + compliance: + - cis: ["5.2.12"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*permituserenvironment\s+no' + + # 5.2.13 Ensure only strong Ciphers are used + - id: 21124 + title: Ensure only strong Ciphers are used. + description: > + This variable limits the ciphers that SSH can use during communication. + Notes: + - Some organizations may have stricter requirements for approved ciphers. Ensure that + ciphers used are in compliance with site policy + - The only "strong" ciphers currently FIPS 140-2 compliant are: aes256-ctr,aes192- + ctr,aes128-ctr + - CVE-2013-4548 referenced bellow applies to OpenSSH versions 6.2 and 6.3. If running + these versions of Open SSH, Please upgrade to version 6.4 or later to fix the + vulnerability, or disable AES-GCM in the server configuration + + The Following are the supported ciphers in openSSH 7.9: + 3des-cbc + aes128-cbc + aes192-cbc + aes256-cbc + aes128-ctr + aes192-ctr + aes256-ctr + aes128-gcm@openssh.com + aes256-gcm@openssh.com + chacha20-poly1305@openssh.com + rationale: > + Weak ciphers that are used for authentication to the cryptographic module cannot be relied + upon to provide confidentiality or integrity, and system data may be compromised. + - The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of + approximately four billion blocks, which makes it easier for remote attackers to + obtain cleartext data via a birthday attack against a long-duration encrypted session, + aka a "Sweet32" attack + - The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly + combine state data with key data during the initialization phase, which makes it + easier for remote attackers to conduct plaintext-recovery attacks against the initial + bytes of a stream by sniffing network traffic that occasionally relies on keys affected + by the Invariance Weakness, and then using a brute-force approach involving LSB + values, aka the "Bar Mitzvah" issue + - The passwords used during an SSH session encrypted with RC4 can be recovered by + an attacker who is able to capture and replay the session + - Error handling in the SSH protocol; Client and Server, when using a block cipher + algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote + attackers to recover certain plaintext data from an arbitrary block of ciphertext in + an SSH session via unknown vectors + - The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher + is used, does not properly initialize memory for a MAC context data structure, which + allows remote authenticated users to bypass intended ForceCommand and loginshell restrictions via packet data that provides a crafted callback address + remediation: > + Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma + separated list of the site approved ciphers + + Example: + Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128- + gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr + compliance: + - cis: ["5.2.13"] + - cis_csc: ["14.4"] + references: + - https://nvd.nist.gov/vuln/detail/CVE-2016-2183 + - https://nvd.nist.gov/vuln/detail/CVE-2015-2808 + - https://www.kb.cert.org/vuls/id/565052 + - https://www.openssh.com/txt/cbc.adv + - https://nvd.nist.gov/vuln/detail/CVE-2008-5161 + - https://nvd.nist.gov/vuln/detail/CVE-2013-4548 + - https://www.kb.cert.org/vuls/id/565052 + - https://www.openssh.com/txt/cbc.adv + - SSHD_CONFIG(5) + condition: none + rules: + - 'c:sshd -T -> r:^ciphers\s+ && r:3des-cbc' + - 'c:sshd -T -> r:^ciphers\s+ && r:aes128-cbc' + - 'c:sshd -T -> r:^ciphers\s+ && r:aes192-cbc' + - 'c:sshd -T -> r:^ciphers\s+ && r:aes256-cbc' + + # 5.2.14 Ensure only strong MAC algorithms are used + - id: 21125 + title: Ensure only strong MAC algorithms are used. + description: > + This variable limits the types of MAC algorithms that SSH can use during communication. + Notes: + - Some organizations may have stricter requirements for approved MACs. Ensure that + MACs used are in compliance with site policy + - The only "strong" MACs currently FIPS 140-2 approved are hmac-sha2-256 and hmacsha2-512 + + The Supported MACs are: + hmac-md5 + hmac-md5-96 + hmac-sha1 + hmac-sha1-96 + hmac-sha2-256 + hmac-sha2-512 + umac-64@openssh.com + umac-128@openssh.com + hmac-md5-etm@openssh.com + hmac-md5-96-etm@openssh.com + hmac-sha1-etm@openssh.com + hmac-sha1-96-etm@openssh.com + hmac-sha2-256-etm@openssh.com + hmac-sha2-512-etm@openssh.com + umac-64-etm@openssh.com + umac-128-etm@openssh.com + rationale: > + MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase + exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of + attention as a weak spot that can be exploited with expanded computing power. An + attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the + SSH tunnel and capture credentials and information + remediation: > + Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma + separated list of the site approved MACs + + Example: + MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2- + 512,hmac-sha2-256 + compliance: + - cis: ["5.2.14"] + - cis_csc: ["14.4", "16.5"] + references: + - http://www.mitls.org/pages/attacks/SLOTH + - SSHD_CONFIG(5) + condition: none + rules: + - 'c:sshd -T -> r:^macs\s+ && r:hmac-md5' + - 'c:sshd -T -> r:^macs\s+ && r:hmac-md5-96' + - 'c:sshd -T -> r:^macs\s+ && r:hmac-ripemd160' + - 'c:sshd -T -> r:^macs\s+ && r:hmac-sha1' + - 'c:sshd -T -> r:^macs\s+ && r:hmac-sha1-96' + - 'c:sshd -T -> r:^macs\s+ && r:umac-64@openssh.com' + - 'c:sshd -T -> r:^macs\s+ && r:umac-128@openssh.com' + - 'c:sshd -T -> r:^macs\s+ && r:hmac-md5-etm@openssh.com' + - 'c:sshd -T -> r:^macs\s+ && r:hmac-md5-96-etm@openssh.com' + - 'c:sshd -T -> r:^macs\s+ && r:hmac-ripemd160-etm@openssh.com' + - 'c:sshd -T -> r:^macs\s+ && r:hmac-sha1-etm@openssh.com' + - 'c:sshd -T -> r:^macs\s+ && r:hmac-sha1-96-etm@openssh.com' + - 'c:sshd -T -> r:^macs\s+ && r:umac-64-etm@openssh.com' + - 'c:sshd -T -> r:^macs\s+ && r:umac-128-etm@openssh.com' + + # 5.2.15 Ensure only strong Key Exchange algorithms are used + - id: 21126 + title: Ensure only strong Key Exchange algorithms are used. + description: > + Key exchange is any method in cryptography by which cryptographic keys are exchanged + between two parties, allowing use of a cryptographic algorithm. If the sender and receiver + wish to exchange encrypted messages, each must be equipped to encrypt messages to be + sent and decrypt messages received + + Notes: + Kex algorithms have a higher preference the earlier they appear in the list + - Some organizations may have stricter requirements for approved Key exchange + algorithms. Ensure that Key exchange algorithms used are in compliance with site + policy. + - The only Key Exchange Algorithms currently FIPS 140-2 approved are: ecdh-sha2- + nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchangesha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffiehellman-group14-sha256 + + The Key Exchange algorithms supported by OpenSSH 7.9 are: + curve25519-sha256 + curve25519-sha256@libssh.org + diffie-hellman-group1-sha1 + diffie-hellman-group14-sha1 + diffie-hellman-group14-sha256 + diffie-hellman-group16-sha512 + diffie-hellman-group18-sha512 + diffie-hellman-group-exchange-sha1 + diffie-hellman-group-exchange-sha256 + ecdh-sha2-nistp256 + ecdh-sha2-nistp384 + ecdh-sha2-nistp521 + rationale: > + Key exchange methods that are considered weak should be removed. A key exchange + method may be weak because too few bits are used, or the hashing algorithm is considered + too weak. Using weak algorithms could expose connections to man-in-the-middle attacks + remediation: > + Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma + separated list of the site approved key exchange algorithms + + Example + KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellmangroup14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18- + sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffiehellman-group-exchange-sha256 + compliance: + - cis: ["5.2.15"] + - cis_csc: ["14.4"] + condition: none + rules: + - 'c:sshd -T -> r:^kexalgorithms\s+ && r:diffie-hellman-group1-sha1' + - 'c:sshd -T -> r:^kexalgorithms\s+ && r:diffie-hellman-group14-sha1' + - 'c:sshd -T -> r:^kexalgorithms\s+ && r:diffie-hellman-group-exchange-sha1' + + # 5.2.16 Ensure SSH Idle Timeout Interval is configured + - id: 21127 + title: Ensure SSH Idle Timeout Interval is configured + description: > + The two options ClientAliveInterval and ClientAliveCountMax control the timeout of + ssh sessions. + - ClientAliveInterval sets 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 default is 0, indicating that these + messages will not be sent to the client. + - ClientAliveCountMax sets the number of client alive messages which may be sent + without sshd receiving any messages back from the client. If this threshold is + reached while client alive messages are being sent, sshd will disconnect the client, + terminating the session. The default value is 3. + - The client alive messages are sent through the encrypted channel + - Setting ClientAliveCountMax to 0 disables connection termination + + Example: If the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is + set to 3, the client ssh session will be terminated after 45 seconds of idle time. + rationale: > + Having no timeout value associated with a connection could allow an unauthorized user + access to another user's ssh session (e.g. user walks away from their computer and doesn't + lock the screen). Setting a timeout value reduces this risk. +  The recommended ClientAliveInterval setting is 300 seconds (5 minutes) +  The recommended ClientAliveCountMax setting is 3 +  The ssh session would send three keep alive messages at 5 minute intervals. If no + response is received after the third keep alive message, the ssh session would be + terminated after 15 minutes. + remediation: > + Having no timeout value associated with a connection could allow an unauthorized user + access to another user's ssh session (e.g. user walks away from their computer and doesn't + lock the screen). Setting a timeout value reduces this risk. + - The recommended ClientAliveInterval setting is 300 seconds (5 minutes) + - The recommended ClientAliveCountMax setting is 3 + - The ssh session would send three keep alive messages at 5 minute intervals. If no + response is received after the third keep alive message, the ssh session would be + terminated after 15 minutes. + compliance: + - cis: ["5.2.16"] + - cis_csc: ["16.11"] + references: + - https://man.openbsd.org/sshd_config + condition: all + rules: + - 'c:sshd -T -> n:^clientaliveinterval\s+(\d+) compare >= 1' + - 'c:sshd -T -> n:^clientaliveinterval\s+(\d+) compare <= 300' + - 'c:sshd -T -> n:^ClientAliveCountMax\s+(\d+) compare <= 3' + + # 5.2.17 Ensure SSH LoginGraceTime is set to one minute or less + - id: 21128 + title: Ensure SSH LoginGraceTime is set to one minute or less. + description: > + The LoginGraceTime parameter specifies the time allowed for successful authentication to + the SSH server. The longer the Grace period is the more open unauthenticated connections + can exist. Like other session controls in this session the Grace Period should be limited to + appropriate organizational limits to ensure the service is available for needed access. + rationale: > + Setting the LoginGraceTime parameter to a low number will minimize the risk of successful + brute force attacks to the SSH server. It will also limit the number of concurrent + unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set + the number based on site policy. + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + LoginGraceTime 60 + compliance: + - cis: ["5.2.17"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sshd -T -> n:^logingracetime\s+(\d+) compare >= 1' + - 'c:sshd -T -> n:^logingracetime\s+(\d+) compare <= 60' + + # 5.2.18 Ensure SSH warning banner is configured + - id: 21129 + title: Ensure SSH warning banner is configured. + description: > + The Banner parameter specifies a file whose contents must be sent to the remote user + before authentication is permitted. By default, no banner is displayed. + rationale: > + Banners are used to warn connecting users of the particular site's policy regarding + connection. Presenting a warning message prior to the normal user login may assist the + prosecution of trespassers on the computer system. + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + + Banner /etc/issue.net + compliance: + - cis: ["5.2.18"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sshd -T -> r:^banner\s+/etc/issue.net' + + # 5.2.19 Ensure SSH PAM is enabled + - id: 21130 + title: Ensure SSH PAM is enabled. + description: > + UsePAM Enables the Pluggable Authentication Module interface. If set to “yes” this will + enable PAM authentication using ChallengeResponseAuthentication and + PasswordAuthentication in addition to PAM account and session module processing for all + authentication types + rationale: > + When usePAM is set to yes, PAM runs through account and session types properly. This is + important if you want to restrict access to services based off of IP, time or other factors of + the account. Additionally, you can make sure users inherit certain environment variables + on login or disallow access to the server + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + + UsePAM yes + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sshd -T -> r:^usepam\s+yes' + + # 5.2.20 Ensure SSH AllowTcpForwarding is disabled + - id: 21131 + title: Ensure SSH AllowTcpForwarding is disabled. + description: > + SSH port forwarding is a mechanism in SSH for tunneling application ports from the client + to the server, or servers to clients. It can be used for adding encryption to legacy + applications, going through firewalls, and some system administrators and IT professionals + use it for opening backdoors into the internal network from their home machines + rationale: > + Leaving port forwarding enabled can expose the organization to security risks and backdoors. + + SSH connections are protected with strong encryption. This makes their contents invisible + to most deployed network monitoring and traffic filtering solutions. This invisibility carries + considerable risk potential if it is used for malicious purposes such as data exfiltration. + Cybercriminals or malware could exploit SSH to hide their unauthorized communications, + or to exfiltrate stolen data from the target network + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + + AllowTcpForwarding no + compliance: + - cis: ["5.2.20"] + - cis_csc: ["9.2"] + references: + - https://www.ssh.com/ssh/tunneling/example + condition: all + rules: + - 'c:sshd -T -> r:^allowtcpforwarding\s+no' + + # 5.2.21 Ensure SSH MaxStartups is configured + - id: 21132 + title: Ensure SSH MaxStartups is configured. + description: > + The MaxStartups parameter specifies the maximum number of concurrent unauthenticated + connections to the SSH daemon. + rationale: > + To protect a system from denial of service due to a large number of pending authentication + connection attempts, use the rate limiting function of MaxStartups to protect availability of + sshd logins and prevent overwhelming the daemon. + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + + maxstartups 10:30:60 + compliance: + - cis: ["5.2.21"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sshd -T -> r:^maxstartups\s+10:30:60\s*$' + + # 5.2.22 Ensure SSH MaxSessions is limited + - id: 21133 + title: Ensure SSH MaxSessions is limited. + description: > + The MaxSessions parameter specifies the maximum number of open sessions permitted + from a given connection. + rationale: > + To protect a system from denial of service due to a large number of concurrent sessions, + use the rate limiting function of MaxSessions to protect availability of sshd logins and + prevent overwhelming the daemon. + remediation: > + Edit the /etc/ssh/sshd_config file to set the parameter as follows: + + MaxSessions 10 + compliance: + - cis: ["5.2.22"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sshd -T -> n:^maxsessions\s+(\d+) compare <= 10' + + # 5.3.1 Ensure password creation requirements are configured - Not implemented + # 5.3.2 Ensure lockout for failed password attempts is configured - Not implemented + + # 5.3.3 Ensure password reuse is limited + - id: 21134 + title: Ensure password reuse is limited. + description: > + The /etc/security/opasswd file stores the users' old passwords and can be checked to + ensure that users are not recycling recent passwords. + + Notes: + - Additional module options may be set, recommendation only covers those listed here. + - This setting only applies to local accounts. + - This option is configured with the remember=n module option in /etc/pam.d/commonpassword + rationale: > + Forcing users not to reuse their past passwords make it less likely that an attacker will be + able to guess the password. + remediation: > + Run the following command: + # pam-config -a --pwhistory --pwhistory-remember=5 + + OR + + Edit the file /etc/pam.d/common-password to include the remember= option and conform to + site policy as shown: + password required pam_pwhistory.so remember=5 + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + condition: any + rules: + - 'f:/etc/pam.d/common-password -> n:^\s*password\t+requisite\t+pam_pwhistory\.so\t+remember\s*=\s*(\d+) compare >= 5' + - 'f:/etc/pam.d/common-password -> n:^\s*password\t+required\t+pam_pwhistory\.so\t+remember\s*=\s*(\d+) compare >= 5' + + # 5.4.1.1 Ensure password hashing algorithm is SHA-512 + - id: 21135 + title: Ensure password hashing algorithm is SHA-512. + description: > + Login passwords are hashed and stored in the /etc/shadow file. + + Note: These changes only apply to accounts configured on the local system. + rationale: > + The SHA-512 algorithm provides much stronger hashing than MD5, thus providing + additional protection to the system by increasing the level of effort for an attacker to + successfully determine passwords. + remediation: > + Edit the /etc/login.defs file and modify ENCRYPT_METHOD to SHA512: + ENCRYPT_METHOD sha512 + + Notes: + - Any system accounts that need to be expired should be carefully done separately by the + system administrator to prevent any potential problems + - If it is determined that the password algorithm being used is not SHA-512, once it is + changed, it is recommended that all user ID's be immediately expired and forced to + change their passwords on next login, In accordance with local site policies + - To accomplish this, the following command can be used + # awk -F: '( $3<'"$(awk '/^\s*UID_MIN/{print $2}' /etc/login.defs)"' && + $1 != "nfsnobody" ) { print $1 }' /etc/passwd | xargs -n 1 chage -d 0 + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["16.4"] + condition: all + rules: + - 'f:/etc/login.defs -> r:^\s*ENCRYPT_METHOD\s+SHA512' + + # 5.4.1.2 Ensure password expiration is 365 days or less - Not implemented + # 5.4.1.3 Ensure minimum days between password changes is configured - Not implemented + # 5.4.1.4 Ensure password expiration warning days is 7 or more - Not implemented + # 5.4.1.5 Ensure inactive password lock is 30 days or less - Not implemented + # 5.4.1.6 Ensure all users last password change date is in the past - Not implemented + # 5.4.2 Ensure system accounts are secured - Not implemented + + # 5.4.3 Ensure default group for the root account is GID 0 + - id: 21136 + title: Ensure default group for the root account is GID 0 + description: > + The usermod command can be used to specify which group the root user belongs to. This + affects permissions of files that are created by the root user. + rationale: > + Using GID 0 for the root account helps prevent root -owned files from accidentally + becoming accessible to non-privileged users. + remediation: > + Run the following command to set the root user default group to GID 0 : + # usermod -g 0 root + compliance: + - cis: ["5.4.3"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\S+:\S+:0:' + + # 5.4.4 Ensure default user shell timeout is configured - Not implemented + # 5.4.5 Ensure default user umask is configured - Not implemented + # 5.5 Ensure root login is restricted to system console - Not implemented + # 5.6 Ensure access to the su command is restricted - Not implemented + # 6.1.1 Audit system file permissions + + # 6.1.2 Ensure permissions on /etc/passwd are configured + - id: 21137 + title: Ensure permissions on /etc/passwd are configured. + description: > + The /etc/passwd file contains user account information that is used by many system + utilities and therefore must be readable for these utilities to operate. + rationale: > + It is critical to ensure that the /etc/passwd file is protected from unauthorized write + access. Although it is protected by default, the file permissions could be changed either + inadvertently or through malicious actions. + remediation: > + Run the following commands to set owner, group, and permissions on /etc/passwd: + + # chown root:root /etc/passwd + # chmod u-x,g-wx,o-wx /etc/passwd + compliance: + - cis: ["6.1.2"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/passwd -> r:^Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 6.1.3 Ensure permissions on /etc/shadow are configured + - id: 21138 + title: Ensure permissions on /etc/shadow are configured. + description: > + The /etc/shadow file is used to store the information about user accounts that is critical to + the security of those accounts, such as the hashed password and other security + information. + rationale: > + If attackers can gain read access to the /etc/shadow file, they can easily run a password + cracking program against the hashed password to break it. Other security information that + is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the + user accounts. + remediation: > + Run the following commands to set owner, group, and permissions on /etc/shadow: + + # chown root:root /etc/shadow + # chmod u-x,g-wx,o-rwx /etc/shadow + compliance: + - cis: ["6.1.3"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/shadow -> r:^Access:\s*\(0640/-rw-r-----\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*15/\s*shadow\)' + + # 6.1.4 Ensure permissions on /etc/group are configured + - id: 21139 + title: Ensure permissions on /etc/group are configured. + description: > + The /etc/group file contains a list of all the valid groups defined in the system. The + command below allows read/write access for root and read access for everyone else. + rationale: > + The /etc/group file needs to be protected from unauthorized changes by non-privileged + users, but needs to be readable as this information is used with many non-privileged + programs. + remediation: > + Run the following commands to set owner, group, and permissions on /etc/group : + + # chown root:root /etc/group + # chmod u-x,g-wx,o-wx /etc/group + compliance: + - cis: ["6.1.4"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/group -> r:^Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 6.1.5 Ensure permissions on /etc/passwd- are configured + - id: 21140 + title: Ensure permissions on /etc/passwd- are configured. + description: The /etc/passwd- file contains backup user account information. + rationale: > + It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. + Although it is protected by default, the file permissions could be changed either + inadvertently or through malicious actions. + remediation: > + Run the following commands to set owner, group, and permissions on /etc/passwd- : + + # chown root:root /etc/passwd- + # chmod u-x,go-wx /etc/passwd + compliance: + - cis: ["6.1.5"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/passwd -> r:^Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 6.1.6 Ensure permissions on /etc/shadow- are configured + - id: 21141 + title: Ensure permissions on /etc/shadow- are configured + description: > + The /etc/shadow- file is used to store backup information about user accounts that is + critical to the security of those accounts, such as the hashed password and other security + information. + rationale: > + It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. + Although it is protected by default, the file permissions could be changed either + inadvertently or through malicious actions. + remediation: > + Run the following commands to set owner, group, and permissions on /etc/shadow-: + + # chown root:shadow /etc/shadow- + # chmod u-x,g-wx,o-rwx /etc/shadow + compliance: + - cis: ["6.1.6"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/shadow- -> r:^Access:\s*\(0640/-rw-r-----\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*15/\s*shadow\)' + + # 6.1.7 Ensure permissions on /etc/group- are configured + - id: 21142 + title: Ensure permissions on /etc/group- are configured. + description: The /etc/group- file contains a backup list of all the valid groups defined in the system. + rationale: > + It is critical to ensure that the /etc/group- file is protected from unauthorized access. + Although it is protected by default, the file permissions could be changed either + inadvertently or through malicious actions. + remediation: > + Run the following commands to set owner, group, and permissions on /etc/group-: + + # chown root:root /etc/group- + # chmod u-x,go-wx /etc/group- + compliance: + - cis: ["6.1.7"] + - cis_csc: ["14.6"] + condition: all + rules: + - 'c:stat -L /etc/group- -> r:^Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*Gid:\s*\(\s*0/\s*root\)' + + # 6.1.8 Ensure no world writable files exist - Not implemented + # 6.1.9 Ensure no unowned files or directories exist - Not implemented + # 6.1.10 Ensure no ungrouped files or directories exist - Not implemented + # 6.1.11 Audit SUID executables - Not implemented + # 6.1.12 Audit SGID executables - Not implemented + + # 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords + - id: 21143 + title: Ensure accounts in /etc/passwd use shadowed passwords. + description: > + Local accounts can uses shadowed passwords. With shadowed passwords, The passwords + are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. + Accounts with a shadowed password have an x in the second field in /etc/passwd. + rationale: > + The /etc/passwd file also contains information like user ID's and group ID's that are used + by many system programs. Therefore, the /etc/passwd file must remain world readable. In + spite of encoding the password with a randomly-generated one-way hash function, an + attacker could still break the system if they got access to the /etc/passwd file. This can be + mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd + file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. + This helps mitigate the risk of an attacker gaining access to the encoded passwords with + which to perform a dictionary attack. + + Notes: + - All accounts must have passwords or be locked to prevent the account from being used + by an unauthorized user. + - A user account with an empty second field in /etc/passwd allows the account to be + logged into by providing only the username. + remediation: > + If any accounts in the /etc/passwd file do not have a single x in the password field, run the + following command to set these accounts to use shadowed passwords: + + # sed -e 's/^\([a-zA-Z0-9_]*\):[^:]*:/\1:x:/' -i /etc/passwd + + Investigate to determine if the account is logged in and what it is being used for, to + determine if it needs to be forced off. + compliance: + - cis: ["6.2.1"] + - cis_csc: ["4.4"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^\.+:x:' + + # 6.2.2 Ensure /etc/shadow password fields are not empty + - id: 21144 + title: Ensure /etc/shadow password fields are not empty. + description: > + An account with an empty password field means that anybody may log in as that user + without providing a password. + rationale: > + All accounts must have passwords or be locked to prevent the account from being used by + an unauthorized user. + remediation: > + If any accounts in the /etc/shadow file do not have a password, run the following command + to lock the account until it can be determined why it does not have a password: + + # passwd -l + + Also, check to see if the account is logged in and investigate what it is being used for to + determine if it needs to be forced off. + compliance: + - cis: ["6.2.2"] + - cis_csc: ["4.4"] + condition: none + rules: + - "c:grep -E ^[^:]+:: /etc/shadow -> r:::" + + # 6.2.3 Ensure root is the only UID 0 account + - id: 21145 + title: Ensure root is the only UID 0 account. + description: Any account with UID 0 has superuser privileges on the system. + rationale: > + This access must be limited to only the default root account and only from the system + console. Administrative access must be through an unprivileged account using an approved + mechanism as noted in Item 5.6 Ensure access to the su command is restricted. + remediation: > + Remove any users other than root with UID 0 or assign them a new UID if appropriate. + compliance: + - cis: ["6.2.3"] + - cis_csc: ["5.1"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^\s*\t*# && !r:^\s*\t*root: && r:^\w+:\w+:0:' +# 6.2.4 Ensure root PATH Integrity - Not implemented +# 6.2.5 Ensure all users' home directories exist - Not implemented +# 6.2.6 Ensure users' home directories permissions are 750 or more restrictive - Not implemented +# 6.2.7 Ensure users own their home directories - Not implemented +# 6.2.8 Ensure users' dot files are not group or world writable - Not implemented +# 6.2.9 6.2.9 Ensure no users have .forward files - Not implemented +# 6.2.10 Ensure no users have .netrc files - Not implemented +# 6.2.11 Ensure users' .netrc Files are not group or world accessible - Not implemented +# 6.2.12 Ensure no users have .rhosts files - Not implemented +# 6.2.13 Ensure all groups in /etc/passwd exist in /etc/group - Not implemented +# 6.2.14 Ensure no duplicate UIDs exist - Not implemented +# 6.2.15 Ensure no duplicate GIDs exist - Not implemented +# 6.2.16 Ensure no duplicate user names exist - Not implemented +# 6.2.17 Ensure no duplicate group names exist - Not implemented +# 6.2.18 Ensure shadow group is empty - Not implemented diff --git a/etc/ruleset/sca/sunos/cis_solaris11.4.yml b/etc/ruleset/sca/sunos/cis_solaris11.4.yml new file mode 100644 index 0000000000..6718dc58c4 --- /dev/null +++ b/etc/ruleset/sca/sunos/cis_solaris11.4.yml @@ -0,0 +1,983 @@ +# Security Configuration Assessment +# CIS Checks for Oracle Solaris 11.4 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for Oracle Solaris 11.4 Benchmark v1.0.0 - 01-02-2020 + +policy: + id: "cis_solaris11.4" + file: "cis_solaris11.4.yml" + name: "CIS Benchmark for Oracle Solaris 11.4 v1.0.0" + description: "This document, CIS Oracle Solaris 11.4 Benchmark v1.0.0, provides prescriptive guidance for establishing a secure configuration posture for Oracle Solaris 11.4 on both x86 and SPARC platforms. This guide was tested against Solaris 11.4 release, updated to the Software Repository Update 5 (SRU5). As of the publication of this document, Solaris 11.4 SRU5 is the latest available support update for the Solaris 11 OS. The recommendations included in this document may need to beadjusted for future Solaris 11 updates." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Solaris version." + description: "Requirements for running the CIS benchmark against Solaris 11" + condition: all + rules: + - 'f:/etc/release -> r:^\s*Oracle\s+Solaris\s+11.4\s+' + +checks: + # 2 Disable Unnecessary Services + - id: 23500 + title: "Configure TCP Wrappers." + description: "TCP Wrappers is a host-based access control system that allows administrators to control who has access to various network services based on the IP address of the remote end of the connection. TCP Wrappers also provide logging information via syslog about both successful and unsuccessful connections." + rationale: "TCP Wrappers provides granular control over what services can be accessed over the network. Its logs show attempted access to services from non-authorized systems,which can help identify unauthorized access attempts." + remediation: 'To disable this service, run the following commands: # inetadm -M tcp_wrappers=TRUE && echo "ALL: /, , …" > /etc/hosts.allow\ && echo "ALL: ALL" >/etc/hosts.deny' + compliance: + - cis: ["2.1"] + condition: all + rules: + - "c:inetadm -p -> r:^tcp_wrappers=TRUE" + - "f:/etc/hosts.deny" + - "f:/etc/hosts.allow" + + - id: 23501 + title: "Disable Local-only Graphical Login Environment." + description: "The graphical login service provides the capability of logging into the system using an X- windows type interface from the console. If graphical login access for the console is required, leave the service in local-only mode." + rationale: "This service should be disabled if it is not required." + remediation: "To disable this service, run the following command: # svcadm disablesvc:/application/graphical-login/gdm:default" + compliance: + - cis: ["2.2"] + condition: all + rules: + - 'c:svcs -xv svc:/application/graphical-login/gdm:default -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + + - id: 23502 + title: "Configure sendmail Service for Local-Only Mode." + description: "In Solaris 11, the sendmail service is set to local only mode by default. This means that users on remote systems cannot connect to the sendmail service, eliminating the possibility of a remote exploit attack against some future sendmail vulnerability. Leaving sendmail in local-only mode permits mail to be sent out from the local system. If the localsystem will not be processing or sending any mail, this service can be disabled. However, if sendmail is disabled completely,emailmessages sent to the root account (such as cron job output or audit service warnings) will fail to be delivered. Analternative approach is to disable the sendmail service and create a cron job to process all mail that is queued on the localsystem, sending it to a relay host defined in the sendmail.cf file. It is recommended that sendmail be left in local-only modeunless there is a specific requirement to completely disable it." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While itis important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listeningon a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Run the following to set sendmail to listen only local interfaces: # svccfg -v -s svc:/network/smtp:sendmail setprop config/local_only=false # svcadm refresh sendmail # svcadm restart sendmail" + compliance: + - cis: ["2.3"] + condition: none + rules: + - 'c:netstat -an -> r:.25\s*\t*|:25\s*\t* && !r:127.0.0.1|::1' + + - id: 23503 + title: "Disable RPC Encryption Key." + description: 'The keyserv service is only required for sites that are using the Secure RPC mechanism. The most common use for Secure RPC on Solaris machines is "secure NFS", which uses the Secure RPC mechanism to provide higher levels of securitythan the standard NFS protocols. ("Secure NFS" is unrelated to Kerberos authentication as a mechanism for providing higherlevels of NFS security. "Kerberized" NFS does not require the keyserv service to be running.)' + rationale: "This service should be disabled if it is not required." + remediation: "To disable this service, run the following command: # svcadm disable svc:/network/rpc/keyserv" + compliance: + - cis: ["2.4"] + condition: all + rules: + - 'c:svcs -xv svc:/network/rpc/keyserv -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + + - id: 23504 + title: "Disable Generic Security Services (GSS)." + description: "The GSS API is a security abstraction layer that is designed to make it easier for developers to integrate with different authentication schemes. It is most commonly used in applications for sites that use Kerberos for network authentication, though it can also allow applications to interoperate with other authentication schemes." + rationale: "GSS does not expose anything external to the system as it is configured to use TLI (protocol = ticotsord) by default. This service should be disabled if it is not required." + remediation: "To disable this service, run the following command: # svcadm disable svc:/network/rpc/gss" + compliance: + - cis: ["2.5"] + condition: all + rules: + - "c:svcs -Ho state svc:/network/rpc/gss -> r:disabled|uninitialized|error" + + - id: 23505 + title: "Disable Apache Service." + description: "The Apache service provides an instance of the Apache web server." + rationale: "This service should be disabled if it is not required." + remediation: "To disable this service, run the following command: # svcadm disable svc:/network/http:apache24" + compliance: + - cis: ["2.6"] + condition: all + rules: + - "c:svcs -Ho state svc:/network/http:apache24 -> r:disabled|error" + + - id: 23506 + title: "Disable Kerberos TGT Expiration Warning." + description: "The Kerberos TGT warning service is used to warn users when their Kerberos tickets are about expire or to renew those tickets before they expire. This service is not used if Kerberos has not been configured. This service is configured to be local only by default." + rationale: "This service should be disabled if it is not required." + remediation: "To disable this service, run the following command: # svcadm disable svc:/network/security/ktkt_warn" + compliance: + - cis: ["2.7"] + condition: all + rules: + - "c:svcs -Ho state svc:/network/security/ktkt_warn -> r:disabled|uninitialized|error" + + - id: 23507 + title: "Disable NIS Client Services." + description: "If the local site is not using the NIS naming service to distribute system and user configuration information, this service may be disabled. This service is disabled by default unless the NIS service has been installed and configured on the system." + rationale: "As RPC-based services such as NIS may use non-secure authentication and share sensitive network object information with systems and applications using RPC-based service, NIS client daemons should be disabled. Users are encouraged to use LDAP as a name service in place of NIS." + remediation: "To disable this service, run the following commands: # svcadm disable svc:/network/nis/client. If LDAP is not in use also disable nis/domain: # svcadm disable svc:/network/nis/domain" + compliance: + - cis: ["2.8"] + condition: all + rules: + - "c:svcs -Ho state svc:/network/nis/client -> r:disabled|error" + + - id: 23508 + title: "Disable NIS Client Services (Domain - Scored)." + description: "If the local site is not using the NIS naming service to distribute system and user configuration information, this service may be disabled. This service is disabled by default unless the NIS service has been installed and configured on the system." + rationale: "As RPC-based services such as NIS may use non-secure authentication and share sensitive network object information with systems and applications using RPC-based service, NIS client daemons should be disabled. Users are encouraged to use LDAP as a name service in place of NIS." + remediation: "To disable this service, run the following commands: # svcadm disable svc:/network/nis/client. If LDAP is not in use also disable nis/domain: # svcadm disable svc:/network/nis/domain" + compliance: + - cis: ["2.8-2.9"] + condition: all + rules: + - "c:svcs -Ho state svc:/network/nis/domain -> r:disabled|error" + + - id: 23509 + title: "Disable NIS Server Services." + description: "The NIS server software is not installed by default and is only required on systems that are acting as an NIS server for the local site. Typically there are only a small number of NIS servers on any given network. These services are disabled by default unless the system has been previously configured to act as a NIS server." + rationale: "As RPC-based services such as NIS may use non-secure authentication and share sensitive network object information with systems and applications using RPC-based services, this service should be disabled. Users are encouraged to use LDAP as a name service in place of NIS." + remediation: "To disable this service, run the following commands: # svcadm disable svc:/network/nis/server. If LDAP is not in use also disable nis/domain: # svcadm disable svc:/network/nis/domain" + compliance: + - cis: ["2.9"] + condition: all + rules: + - "c:svcs -Ho state svc:/network/nis/server -> r:disabled|error" + + - id: 23510 + title: "Disable Removable Volume Manager (rmvolmgr - Scored)." + description: "The HAL-aware removable volume manager in the Solaris 11 OS automatically mounts external devices for users whenever the device is attached to the system. These devices include CD-R, CD-RW, floppies, DVD, USB and 1394 mass storage devices. See the rmvolmgr(1M) manual page for more details." + rationale: "Allowing users to mount and access data from removable media devices makes it easier for malicious programs and data to be imported onto the network. It also introduces the risk that sensitive data may be transferred off the system without a log record. By adding rmvolmgr to the .xinitrc file, user-isolated instances of rmvolmgr can be run via a session startup script. In such cases, the rmvolmgr instance will not allow management of volumes that belong to other than the owner of the startup script. When a user logs onto the workstation console (/dev/console), any instance of user-initiated rmvolmgr will only own locally connected devices, such as CD-ROMs or flash memory hardware, locally connected to USB or FireWire ports." + remediation: "To disable this service, run the following commands: # svcadm disable svc:/system/filesystem/rmvolmgr # svcadm disable svc:/network/rpc/smserver" + compliance: + - cis: ["2.10"] + condition: all + rules: + - "c:svcs -Ho state svc:/system/filesystem/rmvolmgr -> r:disabled|error" + + - id: 23511 + title: "Disable Removable Volume Manager." + description: "The HAL-aware removable volume manager in the Solaris 11 OS automatically mounts external devices for users whenever the device is attached to the system. These devices include CD-R, CD-RW, floppies, DVD, USB and 1394 mass storage devices. See the rmvolmgr(1M) manual page for more details." + rationale: "Allowing users to mount and access data from removable media devices makes it easier for malicious programs and data to be imported onto the network. It also introduces the risk that sensitive data may be transferred off the system without a log record. By adding rmvolmgr to the .xinitrc file, user-isolated instances of rmvolmgr can be run via a session startup script. In such cases, the rmvolmgr instance will not allow management of volumes that belong to other than the owner of the startup script. When a user logs onto the workstation console (/dev/console), any instance of user-initiated rmvolmgr will only own locally connected devices, such as CD-ROMs or flash memory hardware, locally connected to USB or FireWire ports." + remediation: "To disable this service, run the following commands: # svcadm disable svc:/system/filesystem/rmvolmgr # svcadm disable svc:/network/rpc/smserver" + compliance: + - cis: ["2.10"] + condition: all + rules: + - "c:svcs -Ho state svc:/network/rpc/smserver -> r:disabled|error" + + - id: 23512 + title: "Disable automount Service." + description: "The automount daemon is normally used to automatically mount NFS file systems from remote file servers when needed. However, the automount daemon can also be configured to mount local (loopback) file systems as well, which may include local user home directories, depending on the system configuration." + rationale: "This service should be disabled if it is not required." + remediation: "To disable this service, run the following command: # svcadm disable svc:/system/filesystem/autofs" + compliance: + - cis: ["2.11"] + condition: all + rules: + - "c:svcs -Ho state svc:/system/filesystem/autofs -> r:disabled|error" + + - id: 23513 + title: "Disable Telnet Service." + description: "The telnet daemon, which accepts connections from users from other systems via the telnet protocol and can be used for remote shell access." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh protocol provides an encrypted session and stronger security." + remediation: "Disable telnet server if enabled: # svcadm disable svc:/network/telnet" + compliance: + - cis: ["2.12"] + condition: all + rules: + - "c:svcs -Ho state svc:/network/telnet -> r:disabled|error" + + # 3 Kernel Tuning + - id: 23514 + title: "Disable Response to Broadcast ICMPv4 Echo Request." + description: "This setting controls whether Solaris responds to broadcast ICMPv4 echo requests." + rationale: "Reduce attack surface by restricting this vector used for host discovery and to prevent denial of service attacks." + remediation: "To enforce this setting, use the command: # ipadm set-prop -p _respond_to_echo_broadcast=0 ip" + compliance: + - cis: ["3.1"] + condition: all + rules: + - "c:ipadm show-prop -p _respond_to_echo_broadcast -co current ip -> r:0" + - "c:ipadm show-prop -p _respond_to_echo_broadcast -co persistent ip -> r:0" + + - id: 23515 + title: "Disable Response to ICMP Broadcast Netmask Requests." + description: "This setting controls whether Solaris will respond to ICMP broadcast netmask requests." + rationale: "Reduce attack surface by restricting this vector used for host and network discovery and to prevent denial of service attacks." + remediation: "To enforce this setting, use the command: # ipadm set-prop -p _respond_to_address_mask_broadcast=0 ip" + compliance: + - cis: ["3.2"] + condition: all + rules: + - "c:ipadm show-prop -p _respond_to_address_mask_broadcast -co current ip -> r:0" + - "c:ipadm show-prop -p _respond_to_address_mask_broadcast -co persistent ip -> r:0" + + - id: 23516 + title: "Enable Strong TCP Sequence Number Generation." + description: "The variable TCP_STRONG_ISS defines the mechanism used for TCP initial sequence number generation. If an attacker can predict the next sequence number, it is possible to inject fraudulent packets into the data stream to hijack the session." + rationale: "The RFC 1948 method is widely accepted as the strongest mechanism for TCP packet generation. This makes remote session hijacking attacks more difficult, as well as any other network-based attack that relies on predicting TCP sequence number information. It is theoretically possible that there may be a small performance hit in connection setup time when this setting is used, but there are no publicly available benchmarks that establish this." + remediation: "To set the TCP_STRONG_ISS parameter on a running system, use the command: # ipadm set-prop -p _strong_iss=2 tcp" + compliance: + - cis: ["3.3"] + condition: all + rules: + - "c:grep ^TCP_STRONG_ISS= /etc/default/inetinit -> r:2" + + - id: 23517 + title: "Disable Response to ICMP Broadcast Timestamp Requests." + description: "This setting controls whether Solaris will respond to ICMP broadcast timestamp requests." + rationale: "Reduce attack surface by restricting this vector used for host discovery and to prevent denial of service attacks." + remediation: "To enforce this setting, use the command: # ipadm set-prop -p _respond_to_timestamp_broadcast=0 ip" + compliance: + - cis: ["3.4"] + condition: all + rules: + - "c:ipadm show-prop -p _respond_to_timestamp_broadcast -co current ip -> r:0" + - "c:ipadm show-prop -p _respond_to_timestamp_broadcast -co persistent ip -> r:0" + + - id: 23518 + title: "Disable Source Packet Forwarding." + description: "This setting controls whether the IPv4 or IPv6 configuration will forward packets with IPv4 routing options or IPv6 routing headers." + rationale: "Keep this parameter disabled to prevent denial of service attacks through spoofed packets." + remediation: "To enforce this setting for IPv4 packets, use the command: # ipadm set-prop -p _forward_src_routed=0 ipv4. To enforce this setting for IPv6 packets, use the command: # ipadm set-prop -p _forward_src_routed=0 ipv6" + compliance: + - cis: ["3.5"] + condition: all + rules: + - "c:ipadm show-prop -p _forward_src_routed -co current ipv4 -> r:0" + - "c:ipadm show-prop -p _forward_src_routed -co persistent ipv4 -> r:0" + - "c:ipadm show-prop -p _forward_src_routed -co current ipv6 -> r:0" + - "c:ipadm show-prop -p _forward_src_routed -co persistent ipv6 -> r:0" + + - id: 23519 + title: "Disable Directed Broadcast Packet Forwarding." + description: "This setting controls whether Solaris forwards broadcast packets for a specific network if it is directly connected to the machine." + rationale: "Keep this parameter disabled to prevent denial of service attacks." + remediation: "To enforce this setting, use the command: # ipadm set-prop -p _forward_directed_broadcasts=0 ip" + compliance: + - cis: ["3.6"] + condition: all + rules: + - "c:ipadm show-prop -p _forward_directed_broadcasts -co current ip -> r:0" + - "c:ipadm show-prop -p _forward_directed_broadcasts -co persistent ip -> r:0" + + - id: 23520 + title: "Enable Stack Protection." + description: "Buffer overflow exploits have been the basis for many highly publicized compromises and defacements of large numbers of Internet connected systems. Many of the automated tools in use by system attackers exploit well-known buffer overflow problems in vendor-supplied and third party software." + rationale: "Enabling stack protection prevents certain classes of buffer overflow attacks and is a significant security enhancement. However, this does not protect against buffer overflow attacks that do not execute code on the stack (such as return-to-libc exploits). While most of the Solaris OS is already configured to employ a non-executable stack, this setting is still recommended to provide a more comprehensive solution for both Solaris and other software that may be installed." + remediation: "To enable stack protection and block stack-smashing attacks, run the following: # sxadm delcust nxheap # sxadm delcust nxstack" + compliance: + - cis: ["3.7"] + condition: all + rules: + - "c:sxadm status -po extension,status,configuration nxheap -> r:nxheap:enabled.tagged-files:default.default" + - "c:sxadm status -po extension,status,configuration nxstack -> r:nxstack:enabled.all:default.default" + + - id: 23521 + title: "Restrict Core Dumps to Protected Directory." + description: "The action described in this section creates a protected directory to store core dumps and also causes the system to create a log entry whenever a regular process dumps core." + rationale: "Core dumps, particularly those from set-UID and set-GID processes, may contain sensitive data." + remediation: "To implement the recommendation, run the commands: # chmod 700 /var/share/cores # coreadm -g /var/share/cores/core_%n_%f_%u_%g_%t_%p \ -e log -e global -e global-setid \ -d process -d proc-setid If the local site chooses, dumping of core files can be completely disabled with the following command: # coreadm -d global -d global-setid -d process -d proc-setid" + compliance: + - cis: ["3.8"] + condition: all + rules: + - "c:coreadm -> r:global core file content: default" + - "c:coreadm -> r:init core file pattern: core" + - "c:coreadm -> r:init core file content: default" + - "c:coreadm -> r:global core dumps: disabled" + - "c:coreadm -> r:kernel zone core dumps: disabled" + - "c:coreadm -> r:per-process core dumps: enabled" + - "c:coreadm -> r:global setid core dumps: disabled" + - "c:coreadm -> r:per-process setid core dumps: disabled" + - "c:coreadm -> r:global core dump logging: disabled" + - "c:coreadm -> r:diagnostic core dumps: enabled" + - "c:coreadm -> r:retention policy: summary" + - "c:coreadm -> r:core diagnostic alert: enabled" + - 'c:stat -c%u-%g-%a /var/share/cores -> r:^\d-\d-700' + + - id: 23522 + title: "Disable Response to ICMP Timestamp Requests." + description: "This setting controls whether Solaris will respond to ICMP timestamp requests." + rationale: "Reduce attack surface by restricting this vector used for host discovery." + remediation: "To enforce this setting, use the command: # ipadm set-prop -p _respond_to_timestamp=0 ip" + compliance: + - cis: ["3.9"] + condition: all + rules: + - "c:ipadm show-prop -p _respond_to_timestamp -co current ip -> r:0" + - "c:ipadm show-prop -p _respond_to_timestamp -co persistent ip -> r:0" + + - id: 23523 + title: "Disable Response to Multicast Echo Request." + description: "These settings control whether Solaris responds to multicast IPv4 and IPv6 echo requests." + rationale: "Reduce attack surface by restricting this vector used for host discovery and to prevent denial of service attacks." + remediation: "To enforce this setting for IPv4 packets, use the command: # ipadm set-prop -p _respond_to_echo_multicast=0 ipv4. To enforce this setting for IPv6 packets, use the command: # ipadm set-prop -p _respond_to_echo_multicast=0 ipv6" + compliance: + - cis: ["3.10"] + condition: all + rules: + - "c:ipadm show-prop -p _respond_to_echo_multicast -co current ipv4 -> r:0" + - "c:ipadm show-prop -p _respond_to_echo_multicast -co persistent ipv4 -> r:0" + - "c:ipadm show-prop -p _respond_to_echo_multicast -co current ipv6 -> r:0" + - "c:ipadm show-prop -p _respond_to_echo_multicast -co persistent ipv6 -> r:0" + + - id: 23524 + title: "Ignore ICMP Redirect Messages." + description: "These settings control whether Solaris will ignore ICMP redirect messages." + rationale: "IP redirects should not be necessary in a well-designed and maintained network. Set to a value of 1 if there is a high risk for a DoS attack. Otherwise, the default value of 0 is sufficient." + remediation: "To enforce this setting for IPv4 packets, use the command: # ipadm set-prop -p _ignore_redirect=1 ipv4. To enforce this setting for IPv6 packets, use the command: # ipadm set-prop -p _ignore_redirect=1 ipv6" + compliance: + - cis: ["3.11"] + condition: all + rules: + - "c:ipadm show-prop -p _ignore_redirect -co current ipv4 -> r:1" + - "c:ipadm show-prop -p _ignore_redirect -co persistent ipv4 -> r:1" + - "c:ipadm show-prop -p _ignore_redirect -co current ipv6 -> r:1" + - "c:ipadm show-prop -p _ignore_redirect -co persistent ipv6 -> r:1" + + - id: 23525 + title: "Set Strict Multihoming." + description: "These settings control whether a packet arriving on a non-forwarding interface can be accepted for an IP address that is not explicitly configured on that interface." + rationale: "Enable this setting for systems that have interfaces that cross strict networking domains (for example, a firewall or a VPN node)." + remediation: "To enforce this setting for IPv4 packets, use the command: # ipadm set-prop -p _strict_dst_multihoming=1 ipv4. To enforce this setting for IPv6 packets, use the command: # ipadm set-prop -p _strict_dst_multihoming=1 ipv6" + compliance: + - cis: ["3.12"] + condition: all + rules: + - "c:ipadm show-prop -p _strict_dst_multihoming -co current ipv4 -> r:1" + - "c:ipadm show-prop -p _strict_dst_multihoming -co persistent ipv4 -> r:1" + - "c:ipadm show-prop -p _strict_dst_multihoming -co current ipv6 -> r:1" + - "c:ipadm show-prop -p _strict_dst_multihoming -co persistent ipv6 -> r:1" + + - id: 23526 + title: "Disable ICMP Redirect Messages." + description: "These setting controls whether Solaris sends ICMPv4 and ICMPv6 redirect messages." + rationale: "A malicious user can exploit the ability of the system to send ICMP redirects by continually sending packets to the system, forcing the system to respond with ICMP redirect messages, resulting in an adverse impact on the CPU performance of the system." + remediation: "To enforce this setting for IPv4 packets, use the command: # ipadm set-prop -p send_redirects=off ipv4. To enforce this setting for IPv6 packets, use the command: # ipadm set-prop -p send_redirects=off ipv6" + compliance: + - cis: ["3.13"] + condition: all + rules: + - "c:ipadm show-prop -p send_redirects -co current ipv4 -> r:off" + - "c:ipadm show-prop -p send_redirects -co persistent ipv4 -> r:off" + - "c:ipadm show-prop -p send_redirects -co current ipv6 -> r:off" + - "c:ipadm show-prop -p send_redirects -co persistent ipv6 -> r:off" + + - id: 23527 + title: "Disable TCP Reverse IP Source Routing." + description: "This setting controls whether TCP reverses the IP source routing option for incoming connections." + rationale: "If IP source routing is needed for diagnostic purposes, enable it. Otherwise disable it." + remediation: "To enforce this setting, use the command: # ipadm set-prop -p _rev_src_routes=0 tcp" + compliance: + - cis: ["3.14"] + condition: all + rules: + - "c:ipadm show-prop -p _rev_src_routes -co current tcp -> r:0" + - "c:ipadm show-prop -p _rev_src_routes -co persistent tcp -> r:0" + + - id: 23528 + title: "Set Maximum Number of Half-open TCP Connections." + description: "This setting controls how many half-open connections can exist for a TCP port." + rationale: "It is necessary to control the number of completed connections to the system to provide some protection against Denial of Service attacks. Note that the value of 4096 is a minimum to establish a good security posture for this setting. In environments where connections numbers are high, such as a busy webserver, this value may need to be increased." + remediation: "To enforce this setting, use the command: # ipadm set-prop -p _conn_req_max_q0=4096 tcp" + compliance: + - cis: ["3.15"] + condition: all + rules: + - "c:ipadm show-prop -p _conn_req_max_q0 -co current tcp -> r:4096" + - "c:ipadm show-prop -p _conn_req_max_q0 -co persistent tcp -> r:4096" + + - id: 23529 + title: "Set Maximum Number of Incoming Connections." + description: "This setting controls the maximum number of incoming connections that can be accepted on a TCP port." + rationale: "Note that the value of 1024 is a minimum to establish a good security posture for this setting. In environments where connections numbers are high, such as a busy webserver, this value may need to be increased." + remediation: "To enforce this setting, use the command: # ipadm set-prop -p _conn_req_max_q=1024 tcp" + compliance: + - cis: ["3.16"] + condition: all + rules: + - "c:ipadm show-prop -p _conn_req_max_q -co current tcp -> r:1024" + - "c:ipadm show-prop -p _conn_req_max_q -co persistent tcp -> r:1024" + + - id: 23530 + title: "Disable Network Routing." + description: "The network routing daemon, in.routed, manages network routing tables. If enabled, it periodically supplies copies of the system's routing tables to any directly connected hosts and networks and picks up routes supplied to it from other networks and hosts." + rationale: "Routing Internet Protocol (RIP) is a legacy protocol with a number of security weaknesses including a lack of authentication, zoning, pruning, etc." + remediation: "To enforce this setting and disable IPv4 routing, use the command: # routeadm -d ipv4-forwarding -d ipv4-routing. To enforce this setting and disable IPv6 routing, use the command: # routeadm -d ipv6-forwarding -d ipv6-routing" + compliance: + - cis: ["3.17"] + condition: all + rules: + - 'c:routeadm -p -> r:ipv4-routing persistent=disabled \S+ current=disabled' + - 'c:routeadm -p -> r:ipv6-routing persistent=disabled \S+ current=disabled' + - 'c:routeadm -p -> r:ipv4-forwarding persistent=disabled \S+ current=disabled' + - 'c:routeadm -p -> r:ipv6-forwarding persistent=disabled \S+ current=disabled' + + # 4 Auditing and Logging + - id: 23531 + title: "Create CIS Audit Class." + description: "To group a set of related audit events, the Solaris Audit service provides the ability for sites to define their own audit classes that contain just those events that the site wants to audit." + rationale: "To simplify administration, a CIS specific audit class should be created." + remediation: "To create the CIS audit class, edit the /etc/security/audit_class file and add the following entry before the last line of the file: 0x0100000000000000:cis:CIS Solaris Benchmark" + compliance: + - cis: ["4.1"] + condition: all + rules: + - "c:grep :CIS /etc/security/audit_class -> r:0x0100000000000000:cis:CIS Solaris Benchmark" + + - id: 23532 + title: "Enable Auditing of Incoming Network Connections." + description: "The Solaris Audit service can be configured to record incoming network connections to any listening service running on the system." + rationale: "This recommendation will provide an audit trail that contains information related to incoming network connections. While this functionality can be enabled using service-specific mechanisms, using the Solaris Audit service provides a more centralized and complete window into incoming network activity." + remediation: "To enforce this setting, use the commands to modify the /etc/security/audit_event file and add the cis audit class to the following audit events: # cp /etc/security/audit_event /etc/security/audit_event.orig # awk 'BEGIN{FS=:; OFS=:} {if ($2 ~ /AUE_ACCEPT|AUE_CONNECT|AUE_SOCKACCEPT|AUE_SOCKCONNECT|AUE_inetd_connect/) $4=$4,cis;} {print} ' etc/security/audit_event > /etc/security/audit_event.out # cp /etc/security/audit_event.out /etc/security/audit_event" + compliance: + - cis: ["4.2"] + condition: all + rules: + - 'c:grep AUE_ACCEPT /etc/security/audit_event -> r:^\d+:AUE_ACCEPT:' + - 'c:grep AUE_CONNECT /etc/security/audit_event -> r:^\d+:AUE_CONNECT:' + - 'c:grep AUE_SOCKACCEPT /etc/security/audit_event -> r:^\d+:AUE_SOCKACCEPT:' + - 'c:grep AUE_SOCKCONNECT /etc/security/audit_event -> r:^\d+:AUE_SOCKCONNECT:' + - 'c:grep AUE_inetd_connect /etc/security/audit_event -> r:^\d+:AUE_inetd_connect:' + + - id: 23533 + title: "Enable Auditing of File Metadata Modification Events." + description: "The Solaris Audit service can be configured to record file metadata modification events for every process running on the system. This will allow the auditing service to determine when file ownership, permissions and related information is changed." + rationale: "This recommendation will provide an audit trail that contains information related to changes of file metadata. The Solaris Audit service is used to provide a more centralized and complete window into activities such as these." + remediation: "To enforce this setting, use the commands to modify the /etc/security/audit_event file and add the cis audit class to the following audit events: # awk 'BEGIN{FS=:; OFS=:} {if ($2 ~ /AUE_CHMOD|AUE_CHOWN|AUE_FCHOWN|AUE_FCHMOD|AUE_LCHOWN|AUE_ACLSET|AUE_FACLSET/) $4=$4,cis;} {print} ' /etc/security/audit_event > /etc/security/audit_event.CIS # cp /etc/security/audit_event.CIS /etc/security/audit_event" + compliance: + - cis: ["4.3"] + condition: all + rules: + - 'c:grep AUE_CHMOD /etc/security/audit_event -> r:^\d+:AUE_CHMOD:' + - 'c:grep AUE_CHOWN /etc/security/audit_event -> r:^\d+:AUE_CHOWN:' + - 'c:grep AUE_FCHOWN /etc/security/audit_event -> r:^\d+:AUE_FCHOWN:' + - 'c:grep AUE_FCHMOD /etc/security/audit_event -> r:^\d+:AUE_FCHMOD:' + - 'c:grep AUE_LCHOWN /etc/security/audit_event -> r:^\d+:AUE_LCHOWN:' + - 'c:grep AUE_ACLSET /etc/security/audit_event -> r:^\d+:AUE_ACLSET:' + - 'c:grep AUE_FACLSET /etc/security/audit_event -> r:^\d+:AUE_FACLSET:' + + - id: 23534 + title: "Enable Auditing of Process and Privilege Events." + description: "The Solaris Audit service can be configured to record the use of privileges by processes running on the system. This will capture events such as the setting of UID and GID values, setting of privileges, as well as the use of functionality such as chroot(2)." + rationale: "This recommendation will provide an audit trail that contains information related to the use of privileges by processes running on the system. The Solaris Audit service is used to provide a more centralized and complete window into activities such as these." + remediation: "To enforce this setting, use the commands to modify the /etc/security/audit_event file and add the cis audit class to the following audit events: # awk 'BEGIN{FS=:; OFS=:} {if ($2 ~ /AUE_CHROOT|AUE_SETREUID|AUE_SETREGID|AUE_FCHROOT|AUE_PFEXEC|AUE_SETUID|AUE_NICE|AUE_SETGID|AUE_PRIOCNTLSYS|AUE_SETEGID|AUE_SETEUID|AUE_SETPPRIV|AUE_SETSID|AUE_SETPGID/)$4=$4,cis;} {print} ' /etc/security/audit_event > /etc/security/audit_event.CIS # cp /etc/security/audit_event.CIS /etc/security/audit_event" + compliance: + - cis: ["4.4"] + condition: all + rules: + - 'c:grep AUE_CHROOT /etc/security/audit_event -> r:^\d+:AUE_CHROOT:' + - 'c:grep AUE_SETREUID /etc/security/audit_event -> r:^\d+:AUE_SETREUID:' + - 'c:grep AUE_SETREGID /etc/security/audit_event -> r:^\d+:AUE_SETREGID:' + - 'c:grep AUE_FCHROOT /etc/security/audit_event -> r:^\d+:AUE_FCHROOT:' + - 'c:grep AUE_PFEXEC /etc/security/audit_event -> r:^\d+:AUE_PFEXEC:' + - 'c:grep AUE_SETUID /etc/security/audit_event -> r:^\d+:AUE_SETUID:' + - 'c:grep AUE_NICE /etc/security/audit_event -> r:^\d+:AUE_NICE:' + - 'c:grep AUE_SETGID /etc/security/audit_event -> r:^\d+:AUE_SETGID:' + - 'c:grep AUE_PRIOCNTLSYS /etc/security/audit_event -> r:^\d+:AUE_PRIOCNTLSYS:' + - 'c:grep AUE_SETEGID /etc/security/audit_event -> r:^\d+:AUE_SETEGID:' + - 'c:grep AUE_SETEUID /etc/security/audit_event -> r:^\d+:AUE_SETEUID:' + - 'c:grep AUE_SETPPRIV /etc/security/audit_event -> r:^\d+:AUE_SETPPRIV:' + - 'c:grep AUE_SETSID /etc/security/audit_event -> r:^\d+:AUE_SETSID:' + - 'c:grep AUE_SETPGID /etc/security/audit_event -> r:^\d+:AUE_SETPGID:' + + - id: 23535 + title: "Configure Solaris Auditing." + description: "Solaris auditing service keeps a record of how a system is being used. Solaris auditing can be configured to record different classes of events based upon site policy. This recommendation will set and verify a consensus-developed auditing policy. That said, all organizations are encouraged to tailor this policy based upon their specific needs. For more information on the Solaris auditing service including how to filter and view events, see the Oracle Solaris product documentation. The cis class is a custom class that CIS recommends creating that includes specifically those events that are of interest (defined in the sections above). In addition to those events, this recommendation also includes auditing of login and logout (lo) events, administrative (ad) events, file transfer (ft) events, and command execution (ex) events. This recommendation also configures the Solaris auditing service to capture and report command line arguments (for command execution events) and the zone name in which a command was executed (for global and non-global zones). Further, this recommendation sets a disk utilization threshold of 1%. If this threshold is crossed (for the volume that includes /var/shares/audit), then a warning e-mail will be sent to advise the system administrators that audit events may be lost if the disk becomes full. Finally, this recommendation will also ensure that new audit trails are created at the start of each new day (to help keep the size of the files small to facilitate analysis)." + rationale: "The consensus settings described in this section are an effort to log interesting system events without consuming excessive amounts of resources logging significant but usually uninteresting system calls." + remediation: "To enforce this setting, use the commands: # auditconfig -conf # auditconfig -setflags lo,ad,ft,ex,cis #auditconfig -setnaflags lo # auditconfig -setpolicy cnt,argv,zonename # auditconfig -setplugin audit_binfile active p_minfree=1 # audit -s # usermod -K audit_flags=lo,ad,ft,ex,cis:no root # EDITOR=ed crontab -e root 0 0 * * * /usr/sbin/audit -n # chown root:root /var/shares/audit # chmod 750 /var/shares/audit" + compliance: + - cis: ["4.5"] + condition: all + rules: + - "c:auditconfig -getcond -> r:audit condition = auditing" + - "c:auditconfig -getpolicy -> r:configured audit policies = argv,cnt,zonename" + - "c:auditconfig -getpolicy -> r:active audit policies = argv,cnt,zonename" + - "c:auditconfig -getflags -> r:configured user default audit flags = ad,ft,lo,ex,cis" + - "c:auditconfig -getflags -> r:active user default audit flags = ad,ft,lo,ex,cis" + - "c:auditconfig -getnaflags -> r:configured non-attributable audit flags = lo" + - "c:auditconfig -getnaflags -> r:active non-attributable audit flags = lo" + - 'c:auditconfig -getplugin audit_binfile -> r:Plugin: audit_binfile \(active\)' + - "c:auditconfig -getplugin audit_binfile -> r:Attributes: p_age=0h;p_dir=/var/audit;p_flags=all;p_fsize=0;p_minfree=1" + - "c:userattr audit_flags root -> r:lo,ad,ft,ex,cis:no" + - "c:ls -l /var/share/audit/*.not_terminated.* -> r:.not_terminated." + + # 5 File/Directory Permissions/Access + - id: 23536 + title: "Set Sticky Bit on World Writable Directories." + description: "When the so-called sticky bit (set with chmod +t) is set on a directory, then only the owner of a file may remove that file from the directory (as opposed to the usual behavior where anybody with write access to that directory may remove the file)." + rationale: "Files in directories that have had the 'sticky bit' set, can only be deleted by users that have both write permissions for the directory in which the file resides, as well as ownership of the file or directory, or has sufficient privilege. As this prevents users from overwriting each other's files, whether it be accidental or malicious, it is generally appropriate for most world-writable directories (e.g., /tmp). However, consult appropriate vendor documentation before blindly applying the sticky bit to any world writable directories found, in order to avoid breaking any application dependencies on a given directory." + remediation: "To set the sticky bit on a directory, run the following command: # chmod +t [directory name]" + compliance: + - cis: ["5.1"] + condition: all + rules: + - 'c:find / \( -fstype nfs -o -fstype cachefs -o -fstype autofs -o -fstype ctfs -o -fstype mntfs -o -fstype objfs -o -fstype proc \) -prune -o -type d \( -perm -0002 -a ! -perm -1000 \) -ls -> r:^$' + + # 6 System Access, Authentication, and Authorization + - id: 23537 + title: "Disable login: Services on Serial Ports." + description: "The svccfg command provides service administration for the lower level of the Service Access Facility hierarchy and can be used to disable the ability to login on a particular port." + rationale: "Login services should not be enabled on any serial ports that are not strictly required to support the mission of the system. This action can be safely performed even when console access is provided using a serial port." + remediation: "Perform the following to implement the recommended state: # svcadm disable svc:/system/console-login:terma #svcadm disable svc:/system/console-login:termb" + compliance: + - cis: ["6.1"] + condition: all + rules: + - "c:svcs -Ho state svc:/system/console-login:terma -> r:disabled" + - "c:svcs -Ho state svc:/system/console-login:termb -> r:disabled" + + - id: 23539 + title: "Restrict at/cron to Authorized Users." + description: "The cron.allow and at.allow files contain a list of users who are allowed to run the crontab and at commands to submit jobs to be run at scheduled intervals." + rationale: "On many systems, only the system administrator needs the ability to schedule jobs. Even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs. Much more effective access controls for the cron system can be obtained by using Role-Based Access Controls (RBAC)." + remediation: "Perform the following to implement the recommended state: # mv /etc/cron.d/cron.deny /etc/cron.d/cron.deny.cis # mv /etc/cron.d/at.deny /etc/cron.d/at.deny.cis # echo root > /etc/cron.d/cron.allow # cp /dev/null /etc/cron.d/at.allow # chown root:root /etc/cron.d/cron.allow /etc/cron.d/at.allow # chmod 400 /etc/cron.d/cron.allow /etc/cron.d/at.allow" + compliance: + - cis: ["6.3"] + condition: all + rules: + - "not f:/etc/cron.d/cron.deny" + - "not f:/etc/cron.d/at.deny" + - "c:cat /etc/cron.d/cron.allow -> r:root" + - "c:wc -l /etc/cron.d/at.allow -> r:0" + + - id: 23540 + title: "Set Default Screen Lock for GNOME Users." + description: "The timeout parameter dictates the invocation of a password-protected screen saver after a specified time of keyboard and mouse inactivity, specific to the xscreensaver application used in the GNOME windowing environment." + rationale: "As a screensaver timeout provides protection for a desktop that has not been locked by the user upon his/her departure, to help prevent session hijacking, this value should be set as appropriate to the needs of the user." + remediation: "Perform the following to implement the recommended state: # cd /usr/share/X11/app-defaults # cp XScreenSaver XScreenSaver.orig # vi XScreenSaver: timeout: 0:10:00, lockTimeout: 0:00:00, lock: True # mv xScreenSaver.CIS xScreenSaver" + compliance: + - cis: ["6.4"] + condition: all + rules: + - "c:grep *timeout: /usr/share/X11/app-defaults/XScreenSaver -> r:0:10:00" + - "c:grep *lockTimeout: /usr/share/X11/app-defaults/XScreenSaver -> r:0:00:00" + - "c:grep *lock: /usr/share/X11/app-defaults/XScreenSaver -> r:True" + + - id: 23541 + title: "Remove Autologin Capabilities from the GNOME desktop." + description: "The GNOME Display Manager is used for login session management. See the manual page gdm(1) for more information. By default, GNOME automatic login is defined in /etc/pam.d/gdm-autologin to allow users to access the system without a password." + rationale: "As automatic logins are a known security risk for other than kiosk types of systems, GNOME automatic login should be disabled in /etc/pam.d/gdm-autologin." + remediation: "Comment out or remove all lines from /etc/pam.d/gdm-autologin" + compliance: + - cis: ["6.5"] + condition: all + rules: + - "c:grep -vc ^# /etc/pam.d/gdm-autologin -> r:0" + + - id: 23542 + title: "Set Delay between Failed Login Attempts to 4." + description: "The SLEEPTIME variable in the /etc/default/login file controls the number of seconds to wait before printing the login incorrect message when a bad password is provided. The default value for SLEEPTIME is 4 seconds." + rationale: "As an immediate return of an error message, coupled with the capability to try again may facilitate automatic and rapid-fire brute-force password attacks by a malicious user, this delay time should be set as appropriate to the needs of the user." + remediation: "Perform the following to implement the recommended state: # cd /etc/default # cp login login.orig # nano login SLEEPTIME=4" + compliance: + - cis: ["6.6"] + condition: all + rules: + - "c:grep SLEEPTIME= /etc/default/login -> r:SLEEPTIME=4|#SLEEPTIME=4" + + - id: 23543 + title: "Disable Rhost-based Authentication for SSH." + description: "The IgnoreRhosts parameter specifies that existing .rhosts and .shosts files, which may apply to application rather than user logins, will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with SSH." + remediation: "Perform the following to implement the recommended state: # nano /etc/ssh/sshd_config - IgnoreRhosts yes" + compliance: + - cis: ["6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\s+yes' + + - id: 23545 + title: "Disable root login for SSH." + description: "The PermitRootLogin value (in /etc/ssh/sshd_config) allows for direct root login by a remote user/application to resources on the local host." + rationale: "By default, it is not possible for the root account to log directly into the system console because the account is configured as a role. This setting therefore does not significantly alter the security posture of the system unless the root account is changed from this default and configured to be a normal user." + remediation: "Perform the following to implement the recommended state: # nano /etc/ssh/sshd_config - PermitRootLogin no" + compliance: + - cis: ["6.9"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\s+no' + + - id: 23546 + title: "Disable Host-based Authentication for Login-based Services." + description: "The .rhosts files are used for automatic login to remote hosts and contain username and hostname combinations. The .rhosts files are unencrypted (usually group- or world-readable) and present a serious risk in that a malicious user could use the information within to gain access to a remote host with the privileges of the original application or user." + rationale: "The use of .rhosts authentication is an old and insecure protocol and can be replaced with public-key authentication using Secure Shell. As automatic authentication settings in the .rhosts files can provide a malicious user with sensitive system credentials, the use of .rhosts files should be disabled. It should be noted that by default the Solaris services that use this file, including rsh and rlogin, are disabled by default." + remediation: "Edit /etc/pam.conf and any /etc/pam.d/* results from audit procedure and comment out or remove any pam_rhosts_auth lines: #rlogin auth sufficient pam_rhosts_auth.so.1 #rsh auth sufficient pam_rhosts_auth.so.1" + compliance: + - cis: ["6.10"] + condition: all + rules: + - 'c:grep pam_rhosts_auth /etc/pam.conf -> !r:\.+' + - "c:grep pam_rhosts_auth /etc/pam.d/rlogin -> r:^#" + - "c:grep pam_rhosts_auth.so.1 /etc/pam.d/rsh -> r:^#" + + - id: 23547 + title: "Blocking Authentication Using Empty/Null Passwords for SSH." + description: "The PermitEmptyPasswords value allows for direct login through SSH without a password by a remote user/application to resources on the local host in the same way a standard remote login would." + rationale: "Permitting login without a password is inherently risky." + remediation: "Perform the following to implement the recommended state: Edit /etc/ssh/sshd_config - PermitEmptyPasswords no # svcadm restart svc:/network/ssh" + compliance: + - cis: ["6.11"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitEmptyPasswords\s+no' + + - id: 23548 + title: "Limit Consecutive Login Attempts for SSH." + description: "The 'MaxAuthTries' parameter in the /etc/ssh/sshd_config file specifies the maximum number of authentication attempts permitted per connection. By restricting the number of failed authentication attempts before the server terminates the connection, malicious users are blocked from gaining access to the host by using repetitive brute-force login exploits." + rationale: "By setting the authentication login limit to a low value this will disconnect the attacker and force a reconnect, which severely limits the speed of such brute force attacks." + remediation: "Edit /etc/ssh/sshd_config - MaxAuthTries 6 # svcadm restart svc:/network/ssh" + compliance: + - cis: ["6.12"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && n:^MaxAuthTries\s*\t*(\d+) compare <= 6' + + - id: 23549 + title: "Disable X11 Forwarding for SSH." + description: "The X11 Forwarding parameter defined within the /etc/ssh/sshd_config file specifies whether or not X11 Forwarding via SSH is enabled on the server: The Secure Shell service provides an encrypted 'tunnel' for the data traffic passing through it. While commonly used to substitute for clear-text, CLI-based remote connections such as telnet, Secure Shell can be used to forward an 'X Window' session through the encrypted tunnel, allowing the remote user to have a GUI interface." + rationale: "As enabling X11Forwarding on the host can permit a malicious user to secretly open another X11 connection to another remote client during the session and perform unobtrusive activities such as keystroke monitoring, if the X11 services are not required for the system's intended function, it should be disabled or restricted as appropriate to the user's needs." + remediation: "Perform the following to implement the recommended state: Edit /etc/ssh/sshd_config - X11Forwarding no # svcadm restart svc:/network/ssh" + compliance: + - cis: ["6.13"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:X11Forwarding\s+no' + + - id: 23550 + title: 'Disable ."nobody" Access for RPC Encryption Key Storage Service' + description: "This action listed prevents keyserv from using default keys for the nobody user, effectively stopping the nobody user from accessing information via Secure RPC." + rationale: "If login by the user nobody is allowed for secure RPC, there is an increased risk of system compromise. If keyserv holds a private key for the nobody user, it will be used by key_encryptsession to compute a magic phrase which can be easily recovered by a malicious user." + remediation: "Perform the following to implement the recommended state: Edit /etc/default/keyserv - ENABLE NOBODY KEYS=NO or comment the line" + compliance: + - cis: ["6.14"] + condition: all + rules: + - "c:grep ENABLE_NOBODY_KEYS= /etc/default/keyserv -> r:=NO|^#|error" + + - id: 23551 + title: "Secure the GRUB Menu (Intel)." + description: "GRUB is a boot loader for x64 based systems that permits loading an OS image from any location. Oracle x64 systems support the use of a GRUB Menu password for the console." + rationale: "The flexibility that GRUB provides creates a security risk if its configuration is modified by an unauthorized user. The failsafe menu entry needs to be secured in the same environments that require securing the systems firmware to avoid unauthorized removable media boots. Setting the GRUB Menu password helps prevent attackers with physical access to the system console from booting off some external device (such as a CD-ROM or floppy) and subverting the security of the system. The actions described in this section will ensure you cannot get to failsafe or any of the GRUB command line options without first entering the password." + remediation: "Run the following command to generate your password hash: # /usr/lib/grub2/bios/bin/grub-mkpasswd-pbkdf2 Enter password: Reenter password: PBKDF2 hash of your password is Create the file /usr/lib/grub2/bios/etc/grub.d/01\_password: #!/bin/sh /usr/bin/cat > /rpool/boot/grub/password.cfg< EOF /usr/bin/chmod 600 /rpool/boot/grub/password.cfg /usr/bin/echo 'source /@/boot/grub/password.cfg' Run the following to finalize the password configuration and set menu timeout: # /usr/bin/chmod 700 /usr/lib/grub2/bios/etc/grub.d/01_password # /usr/sbin/bootadm set-menu timeout=30 Changes will take effect on the next reboot." + compliance: + - cis: ["6.15"] + condition: all + rules: + - "c:psrinfo -pv -> r:GenuineIntel" + - "c:grep password.cfg /rpool/boot/grub/grub.cfg -> r:source /@/boot/grub/password.cfg" + + - id: 23552 + title: "Restrict root Login to System Console." + description: "Privileged access to the system via root must be accountable to a particular user." + rationale: "Use an authorized mechanism such as RBAC and the su command to provide administrative access to unprivileged accounts. These mechanisms provide an audit trail in the event of problems." + remediation: "Edit /etc/default/login - CONSOLE=/dev/console" + compliance: + - cis: ["6.16"] + condition: all + rules: + - "c:grep CONSOLE=/dev/console /etc/default/login -> r:^CONSOLE=/dev/console" + + - id: 23553 + title: "Set Retry Limit for Account Lockout." + description: "The RETRIES parameter is the number of failed login attempts a user is allowed before being disconnected from the system and forced to reconnect. When LOCK_AFTER_RETRIES is set in /etc/security/policy.conf, then the user's account is locked after this many failed retries (the account can only be unlocked by the administrator using the command: passwd -u . The account lockout threshold (RETRIES parameter) restricts the number of failed login attempts allowed before requiring the offending account be locked. The lockout requirement will help block malicious users from gaining access to the host via automated, repetitive brute-force login exploits--trying different passwords until one fits a user name." + rationale: "Setting the failed login limit to an appropriate value locks the user account, which will severely limit the speed of such attacks, making it much more likely that the attacker's pattern will be noticed and the offending source address and/or port blocked, so this should be set according to the needs of the user." + remediation: "Perform the following to implement the recommended state: edit /etc/default/login - RETRIES=3, edit /etc/security/policy.conf - LOCK_AFTER_RETRIES=YES. Be careful when enabling these settings as they can create a denial-of-service situation for legitimate users and applications. Account lockout can be disabled for specific users via the usermod command. For example, the following command disables account lock specifically for the oracle account: # usermod -K lock_after_retries=no oracle Note: The root role is configured in this manner by default to prevent accidental lock out." + compliance: + - cis: ["6.17"] + condition: all + rules: + - "c:grep RETRIES= /etc/default/login -> r:=3" + - "c:grep LOCK_AFTER_RETRIES= /etc/security/policy.conf -> r:=YES" + + # 7 User Accounts and Environment + - id: 23554 + title: "Set Password Expiration Parameters on Active Accounts." + description: "The characteristics of an operating system that make 'user identification' via password a secure and workable solution is the combination of settings chosen. By requiring that a series of password-choices be security-centric, it reduces the risk of a malicious user breaking the password through dictionary/brute force attacks or fortuitous guessing based upon 'social engineering.' A basic password security strategy is requiring a new password to be chosen every 45-90 days, so that repeated attempts to gain entry by brute-force tactics will fail when a new password is chosen, which requires starting over again to break the new password" + rationale: "The commands for this item set all active accounts (except the root account) to force password changes every 91 days (13 weeks), and then prevent password changes for seven days (one week), thereafter. Users will begin receiving warnings 7 days (1 week) before their password expires. Sites also have the option of expiring idle accounts after a certain number of days (see the on-line manual page for the usermod command, particularly the -f option)." + remediation: "Perform the following to implement the recommended state: Edit /etc/default/passwd - MAXWEEKS=13 MINWEEKS=1 WARNWEEKS=1" + compliance: + - cis: ["7.1"] + condition: all + rules: + - 'f:/etc/default/passwd -> !r:^# && r:MAXWEEKS && n:=\s*\t*(\d+) compare <= 13' + - 'f:/etc/default/passwd -> !r:^# && r:MINWEEKS && n:=\s*\t*(\d+) compare == 1' + - 'f:/etc/default/passwd -> !r:^# && r:WARNWEEKS && n:=\s*\t*(\d+) compare == 4' + + - id: 23555 + title: "Set Strong Password Creation Policies." + description: "The variables in the /etc/default/passwd file indicate various strategies for creating differences required between an old and a new password. As requiring users to select a specific numbers of differences between the characters in the existing password and the new one can strengthen the password by increasing the symbol-set space, to further increase the difficulty of breaking any password by brute-force attacks, these values should be set as appropriate to the needs of the user." + rationale: "Administrators may wish to add site-specific dictionaries to the DICTIONLIST parameter." + remediation: "Edit /etc/default/passwd with these values: PASSLENGTH=14 NAMECHECK=YES HISTORY=10 MINDIFF=3 MINUPPER=1 MINLOWER=1 MINSPECIAL=1 MINDIGIT=1 MAXREPEATS=1 WHITESPACE=YES DICTIONDBDIR=/var/passwd DICTIONLIST=/usr/share/lib/dict/words" + compliance: + - cis: ["7.2"] + condition: all + rules: + - 'f:/etc/default/passwd -> !r:^# && r:PASSLENGTH && n:=\s*\t*(\d) compare == 14' + - 'f:/etc/default/passwd -> !r:^# && r:NAMECHECK && r:=\s*\t*yes' + - 'f:/etc/default/passwd -> !r:^# && r:HISTORY && n:=\s*\t*(\d+) compare == 10' + - 'f:/etc/default/passwd -> !r:^# && r:MINDIFF && n:=\s*\t*(\d+) compare == 3' + - 'f:/etc/default/passwd -> !r:^# && r:MINUPPER && n:=\s*\t*(\d+) compare == 1' + - 'f:/etc/default/passwd -> !r:^# && r:MINLOWER && n:=\s*\t*(\d+) compare == 1' + - 'f:/etc/default/passwd -> !r:^# && r:MINSPECIAL && n:=\s*\t*(\d+) compare == 1' + - 'f:/etc/default/passwd -> !r:^# && r:MINDIGIT && n:=\s*\t*(\d+) compare == 1' + - 'f:/etc/default/passwd -> !r:^# && r:MAXREPEATS && n:=\s*\t*(\d+) compare == 1' + - 'f:/etc/default/passwd -> !r:^# && r:WHITESPACE && r:=\s*\t*yes' + - 'f:/etc/default/passwd -> !r:^# && r:DICTIONDBDIR && r:=\s*\t*/var/passwd' + - 'f:/etc/default/passwd -> !r:^# && r:DICTIONLIST && r:=\s*\t*/usr/share/lib/dict/words' + + - id: 23556 + title: "Set Default umask for users." + description: "The default umask(1) determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod(1) command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umaskby inserting the umaskcommand into the standard shell configuration files (.profile, .cshrc, etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would allow files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit /etc/default/login - UMASK=027" + compliance: + - cis: ["7.3"] + condition: all + rules: + - "c:grep ^UMASK= /etc/default/login -> r:027" + + - id: 23557 + title: "Default File Creation Mask for FTP Users." + description: "If FTP is permitted, set a strong, default file creation mask to apply to files created by the FTP server." + rationale: "Many users assume that the FTP server will use their system file creation mask; generally it does not. This setting ensures that files transmitted over FTP use a strong file creation mask." + remediation: "Edit /etc/proftpd.conf - Umask 027" + compliance: + - cis: ["7.4"] + condition: all + rules: + - "c:grep ^Umask /etc/proftpd.conf -> r:027" + + - id: 23558 + title: "Set mesg n as Default for All Users." + description: "The mesg n command blocks attempts to use the write or talk commands to contact users at their terminals, but has the side effect of slightly strengthening permissions on the users tty device." + rationale: "Since write and talk are no longer widely used at most sites, the incremental security increase is worth the loss of functionality." + remediation: "Refer to documentation to execute a script to set mesg n" + compliance: + - cis: ["7.5"] + condition: all + rules: + - "c:grep ^mesg /etc/.login -> r:mesg n" + - "c:grep ^mesg /etc/profile -> r:mesg n" + + # 8 Warning Banners + - id: 23560 + title: "Create Warnings for Standard Login Services." + description: "The contents of the /etc/issue file are displayed prior to the login prompt on the systems console and serial devices and also prior to logins via telnet and Secure Shell. The contents of the /etc/motd file are generally displayed after all successful logins, regardless from where the user is logging in." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. As implementing a logon banner to deter inappropriate use and can provide a foundation for legal action against abuse, this warning content should be set as appropriate. Consult with your organizations legal counsel for the appropriate wording as the examples below are for demonstration purposes only." + remediation: "Perform the following to implement the recommended state: # echo Authorized users only. All activity may be monitored and reported. > /etc/motd # echo Authorized users only. All activity may be monitored and reported. > /etc/issue # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["8.1"] + condition: all + rules: + - "c:cat /etc/motd -> r:Authorized users only. All activity may be monitored and reported" + - 'c:ls -l /etc/motd -> r:^-rw-r--r--\s+1\s+root\s+sys' + - "c:cat /etc/issue -> r:Authorized users only. All activity may be monitored and reported" + - 'c:ls -l /etc/issue -> r:^-rw-r--r--\s+1\s+root\s+root' + + - id: 23561 + title: "Enable a Warning Banner for the FTP service." + description: "The action for this item sets a warning message for FTP users before they log in." + rationale: "If FTP is permitted for use in your environment, it is important to ensure that Warning Banners inform users who are attempting to access the system of their legal status regarding using the system. The text below is a generic sample only, so consult with your organization's legal counsel for the appropriate wording." + remediation: "Perform the following to implement the recommended state: # echo DisplayConnect /etc/issue >> /etc/proftpd.conf # svcadm restart ftp" + compliance: + - cis: ["8.2"] + condition: all + rules: + - 'c:grep DisplayConnect /etc/proftpd.conf -> r:^DisplayConnect\.+/etc/issue' + + - id: 23562 + title: "Enable a Warning Banner for the SSH Service." + description: "The contents of the Banner string in the /etc/ssh/sshd_config file are sent to the remote user before authentication is allowed, requiring that the user read the legal caution." + rationale: "Performing these steps will ensure the appropriate legal caution is displayed to any user accessing the system via SSH." + remediation: "Edit /etc/ssh/sshd_config - Banner /etc/issue" + compliance: + - cis: ["8.3"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Banner\s*/etc/issue' + + - id: 23563 + title: "Enable a Warning Banner for the GNOME Service." + description: "The GNOME Display Manager is used for login session management. See the manual page gdm(1) for more information on configuration of the settings, which can be user or group specific." + rationale: "The remediation action for this item sets a pre-login warning message for GDM users. Additional methods can be employed to display a similar message to a user post-authentication. For more information, see the Oracle Solaris 11 Security Guidelines document." + remediation: "Perform the following to implement the recommended state: Edit the /etc/gdm/Init/Default file to add the following content before the last line of the file. /usr/bin/zenity --text-info --width=800 --height=300 --title=Security Message --filename=/etc/issue" + compliance: + - cis: ["8.4"] + condition: all + rules: + - 'c:grep Security /etc/gdm/Init/Default -> r:--title="Security Message" --filename=/etc/issue' + + - id: 23564 + title: "Check that the Banner Setting for telnet is Null." + description: "The BANNER variable in the file /etc/default/telnetd can be used to display text before the telnet login prompt. Traditionally, it has been used to display the OS level of the target system." + rationale: "The warning banner provides information that can be used in reconnaissance for an attack. By default, this file is distributed with the BANNER variable set to null. It is not necessary to create a separate warning banner for telnet if a warning is set in the /etc/issue file. As telnet is an insecure protocol, it should be disabled and all remote administrative/user connections take place by Secure Shell." + remediation: "Perform the following to implement the recommended state: edit /etc/default/telnetd - BANNER=" + compliance: + - cis: ["8.5"] + condition: all + rules: + - "c:grep ^BANNER /etc/default/telnetd -> r:^BANNER=$" + + # 9 System Maintenance + - id: 23565 + title: "Check for Remote Consoles." + description: "The consadm command can be used to select or display alternate console devices." + rationale: "Since the system console has special properties to handle emergency situations, it is important to ensure that the console is in a physically secure location and that unauthorized consoles have not been defined. The consadm -p command displays any alternate consoles that have been defined as auxiliary across reboots. If no remote consoles have been defined, there will be no output from this command." + remediation: "Perform the following to implement the recommended state: # /usr/sbin/consadm [-d device...]" + compliance: + - cis: ["9.1"] + condition: all + rules: + - "c:/usr/sbin/consadm -p -> r:^$" + + - id: 23568 + title: "Verify System Account Default Passwords." + description: "There are a number of accounts provided with the Solaris OS that are used to manage applications and are not intended to provide an interactive shell. These accounts are delivered either in a locked or non-login state. Oracle does not support nor recommend changing the passwords associated with these accounts." + rationale: "System accounts, such as bin, lpd, and sys have special purposes and privileges. By default, these accounts are configured as either locked or non-login. This status should be verified to ensure that these accounts have not accidentally or intentionally been enabled." + remediation: "To lock a single account, use the command: # passwd -d [username] # passwd -l [username] To configure a single account to be non-login, use the command: # passwd -d [username] # passwd -N [username]" + compliance: + - cis: ["9.4"] + condition: all + rules: + - "f:/etc/shadow -> r:^daemon: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^lp: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^adm: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^bin: && !r::NL:|:NP:" + - 'f:/etc/shadow -> r:^gdm: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^noaccess: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^nobody: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^nobody4: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^openldap: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^unknown: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^webservd: && !r::\p*LK\p*:' + - "f:/etc/shadow -> r:^mysql: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^postgres: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^smmsp: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^sys: && !r::NL:|:NP:" + - 'f:/etc/shadow -> r:^aiuser: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^dhcpserv: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^dladm: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^ftp: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^netadm: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^netcfg: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^pkg5srv: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^svctag: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^xvm: && !r::\p*LK\p*:' + - "f:/etc/shadow -> r:^upnp: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^zfssnap: && !r::NL:|:NP:" + + - id: 23569 + title: "Verify System File Permissions." + description: "The pkg verify and command checks the accuracy of installed directory structures and files." + rationale: "It is important to ensure that system files and directories are maintained with the permissions they were intended to have from the OS vendor (Oracle)." + remediation: "Correct or justify any items discovered in the Audit step. Perform the following to set correct any identified package errors: # pkg fix. Exercise caution in running this command as it may reverse modifications implemented previously including some of those recommended by this document. Rather than use this command broadly, it is recommended that it be used more tactically to correct specific package problems when possible." + compliance: + - cis: ["9.5"] + condition: all + rules: + - "c:pkg verify -> !r:ERROR" + + - id: 23570 + title: "Ensure Password Fields are Not Empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password at all (assuming that the value PASSREQ=NO is set in /etc/default/login)." + rationale: "All accounts must have passwords, be configured as Non-login, or be locked." + remediation: "Use the passwd -l command to lock accounts that are not permitted to execute commands . Use the passwd -N command to set accounts to be non-login." + compliance: + - cis: ["9.6"] + condition: all + rules: + - "c:logins -p -> r:^$" + + - id: 23571 + title: "Verify No UID 0 Accounts Exist Other than root." + description: "Any account with UID 0 has superuser rights on the system." + rationale: "This access must be limited to only the default root role and be made accessible from the system console only. Administrative access granted to an unprivileged account should use an approved mechanism such as RBAC." + remediation: "Disable or delete any other 0 UID entries that are displayed; there should be only one root account. Finer granularity access control for administrative access can be obtained by using the Solaris Role-Based Access Control (RBAC) mechanism. RBAC configurations should be monitored via user_attr(4) to make sure that privileges are managed appropriately." + compliance: + - cis: ["9.7"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' + + - id: 23572 + title: "Ensure root PATH Integrity." + description: "The root user can execute any command on the system and could be tricked into executing programs if the PATH is not set correctly." + rationale: "Including the current working directory (.) or any other writable directory in root's executable path makes it likely that an attacker can gain superuser access by forcing an administrator operating as root to execute a malcode, such as a Trojan horse program." + remediation: "Correct or justify any items discovered in the Audit step." + compliance: + - cis: ["9.8"] + condition: all + rules: + - "f:/etc/profile -> r::." + - "f:/root/.profile -> r::." + - "f:/root/.bashrc -> r::." + - "f:/etc/profile -> r:::" + - "f:/root/.profile -> r:::" + - "f:/root/.bashrc -> r:::" + - "f:/etc/profile -> r::$" + - "f:/root/.profile -> r::$" + - "f:/root/.bashrc -> r::$" + + - id: 23578 + title: "Check That Users Are Assigned Home Directories." + description: "passwd defines a home directory that each user is placed in upon login. If there is no defined home directory, a user will be placed in / and will not be able to write any files or have local environment variables set." + rationale: "All users must be assigned a home directory in passwd." + remediation: "Correct or justify any items discovered in the Audit step. Determine if there exists any users who are in passwd but do not have a home directory, and work with those users to determine the best course of action in accordance with site policy." + compliance: + - cis: ["9.14"] + condition: all + rules: + - 'f:/etc/passwd -> r:\w+:\.*:\d*:\d*:\.*::\.*' + + - id: 23580 + title: "Check for Duplicate UIDs." + description: "Although the useradd program will not let you create a duplicate User ID (UID), it is possible for an administrator to manually modify passwd and change the UID field." + rationale: "Users must be assigned unique UIDs for accountability and to ensure appropriate access protections." + remediation: "Correct or justify any items discovered in the Audit step. Determine if there exists any users who share a common UID, and work with those users to determine the best course of action in accordance with site policy." + compliance: + - cis: ["9.16"] + condition: all + rules: + - "c:logins -d -> r:^$" + + - id: 23585 + title: "Find World Writable Files." + description: "Unix-based systems support variable settings to control access to files. World-writable files are the least secure. See the chmod man page for more information." + rationale: "Data in world-writable files can be read, modified, and potentially compromised by any user on the system. World-writable files may also indicate an incorrectly written script or program that could potentially be the cause of a larger compromise to the system integrity." + remediation: "Correct or justify any items discovered in the Audit step. Determine the existence of any write access given for the other category (chmod o-w filename), and work with the owner to determine the best course of action in accordance with site policy." + compliance: + - cis: ["9.21"] + condition: all + rules: + - 'c:find / \( -fstype nfs -o -fstype cachefs -o -fstype autofs -o -fstype ctfs -o -fstype mntfs -o -fstype objfs -o -fstype proc \) -prune -o -type f -perm -0002 -print -> r:^$' + + - id: 23586 + title: "Find SUID/SGID System Executables." + description: "The owner of a file can set the file permissions to run with the owner or group permissions, even if the user running the program is not the owner or a member of the group. The most common reason for a SUID/SGID program is to enable users to perform functions (such as changing their password), which requires root privileges." + rationale: "There are valid reasons for SUID/SGID programs, but it is important to identify and review such programs to ensure they are legitimate." + remediation: "Correct or justify any items discovered in the Audit step. Determine the existence of any set-UID programs that do not belong on the system, and work with the owner (or system administrator) to determine the best course of action in accordance with site policy. Digital signatures on the Solaris Set-UID binaries can be verified with the elfsign utility, such as this example: # elfsign verify -e /usr/bin/su elfsign: verification of /usr/bin/su passed." + compliance: + - cis: ["9.22"] + condition: all + rules: + - "c:elfsign verify -e /usr/bin/su -> r:passed." + + - id: 23587 + title: "Find Un-owned Files and Directories." + description: "Sometimes when administrators delete users from the password file they neglect to remove all files owned by those users from the system." + rationale: "A new user who is assigned the deleted user's user ID or group ID may then end up owning these files, and thus have more access on the system than was intended." + remediation: "Correct or justify any items discovered in the Audit step. Determine the existence of any files that are not attributed to current users or groups on the system, and determine the best course of action in accordance with site policy. Note that the Solaris OS is shipped with all files appropriately owned." + compliance: + - cis: ["9.23"] + condition: all + rules: + - 'c:find / \( -fstype nfs -o -fstype cachefs -o -fstype autofs -o -fstype ctfs -o -fstype mntfs -o -fstype objfs -o -fstype proc \) -prune -o \( -nouser -o -nogroup \) -ls -> r:^$' + + - id: 23588 + title: "Find Files and Directories with Extended Attributes." + description: "Extended attributes are implemented as files in a shadow file system that is not generally visible via normal administration commands without special arguments." + rationale: "Attackers or malicious users could hide information, exploits, etc. in extended attribute areas. Since extended attributes are rarely used, it is important to find files with extended attributes set." + remediation: "Correct or justify any items discovered in the Audit step. Determine the existence of any files having extended file attributes, and determine the best course of action in accordance with site policy. Note that the Solaris OS does not ship with files that have extended attributes." + compliance: + - cis: ["9.24"] + condition: all + rules: + - 'c:find / \( -fstype nfs -o -fstype cachefs -o -fstype autofs -o -fstype ctfs\ -o -fstype mntfs -o -fstype objfs -o -fstype proc \) -prune -o -xattr -ls -> r:^$' diff --git a/etc/ruleset/sca/sunos/cis_solaris11.yml b/etc/ruleset/sca/sunos/cis_solaris11.yml new file mode 100644 index 0000000000..142b2c17bf --- /dev/null +++ b/etc/ruleset/sca/sunos/cis_solaris11.yml @@ -0,0 +1,703 @@ +# Security Configuration Assessment +# CIS Checks for Oracle Solaris 11 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for Oracle Solaris 11 Benchmark v1.1.0 - 09-30-2013 + +policy: + id: "cis_solaris11" + file: "cis_solaris11.yml" + name: "CIS Benchmark for Oracle Solaris 11 v1.1.0" + description: "This document, CIS Oracle Solaris 11 Benchmark v1.1.0, provides prescriptive guidance for establishing a secure configuration posture for Oracle Solaris 11 on both x86 and SPARC platforms. This guide was tested against Solaris 11 11/11 release, updated to the Software Repository Update 5 (SRU5). As of the publication of this document, Solaris 11 11/11 SRU5 is the latest available support update for the Solaris 11 OS. The recommendations included in this document may need to be adjusted for future Solaris 11 updates." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Solaris version" + description: "Requirements for running the CIS benchmark against Solaris 11" + condition: all + rules: + - 'f:/etc/release -> r:^\s*Oracle\s+Solaris\s+11\p' + +checks: + # 2 Disable Unnecessary Services + - id: 8000 + title: "Disable Local-only Graphical Login Environment" + description: "The graphical login service provides the capability of logging into the system using an X- windows type interface from the console. If graphical login access for the console is required, leave the service in local-only mode." + rationale: "This service should be disabled if it is not required." + remediation: "To disable this service, run the following command: # svcadm disable svc:/application/graphical-login/gdm:default" + compliance: + - cis: ["2.1"] + condition: all + rules: + - 'c:svcs -xv svc:/application/graphical-login/gdm:default -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + + - id: 8001 + title: "Configure sendmail Service for Local-Only Mode" + description: "In Solaris 11, the sendmail service is set to local only mode by default. This means that users on remote systems cannot connect to the sendmail service, eliminating the possibility of a remote exploit attack against some future sendmail vulnerability. Leaving sendmail in local-only mode permits mail to be sent out from the local system. If the local system will not be processing or sending any mail, this service can be disabled. However, if sendmail is disabled completely, email messages sent to the root account (such as cron job output or audit service warnings) will fail to be delivered. An alternative approach is to disable the sendmail service and create a cron job to process all mail that is queued on the local system, sending it to a relay host defined in the sendmail.cf file. It is recommended that sendmail be left in local-only mode unless there is a specific requirement to completely disable it." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Run the following to set sendmail to listen only local interfaces: # svccfg -v -s svc:/network/smtp:sendmail setprop config/local_only=false # svcadm refresh sendmail # svcadm restart sendmail" + compliance: + - cis: ["2.2"] + condition: none + rules: + - 'c:netstat -an -> r:.25\s*\t*|:25\s*\t* && !r:127.0.0.1|::1' + + - id: 8002 + title: "Disable RPC Encryption Key" + description: 'The keyserv service is only required for sites that are using the Secure RPC mechanism. The most common use for Secure RPC on Solaris machines is "secure NFS", which uses the Secure RPC mechanism to provide higher levels of security than the standard NFS protocols. ("Secure NFS" is unrelated to Kerberos authentication as a mechanism for providing higher levels of NFS security. "Kerberized" NFS does not require the keyserv service to be running.)' + rationale: "This service should be disabled if it is not required." + remediation: "To disable this service, run the following command: # svcadm disable svc:/network/rpc/keyserv" + compliance: + - cis: ["2.3"] + condition: all + rules: + - 'c:svcs -xv svc:/network/rpc/keyserv -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + + - id: 8003 + title: "Disable NIS Server Services" + description: "The NIS server software is not installed by default and is only required on systems that are acting as an NIS server for the local site. Typically there are only a small number of NIS servers on any given network. These services are disabled by default unless the system has been previously configured to act as a NIS server." + rationale: "As RPC-based services such as NIS may use non-secure authentication and share sensitive network object information with systems and applications using RPC-based services, this service should be disabled. Users are encouraged to use LDAP as a name service in place of NIS." + remediation: "To disable this service, run the following commands: # svcadm disable svc:/network/nis/server # svcadm disable svc:/network/nis/domain" + compliance: + - cis: ["2.4"] + condition: all + rules: + - 'c:svcs -xv svc:/network/nis/server -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + - 'c:svcs -xv svc:/network/nis/domain -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + + - id: 8004 + title: "Disable NIS Client Services" + description: "If the local site is not using the NIS naming service to distribute system and user configuration information, this service may be disabled. This service is disabled by default unless the NIS service has been installed and configured on the system." + rationale: "As RPC-based services such as NIS may use non-secure authentication and share sensitive network object information with systems and applications using RPC-based service, NIS client daemons should be disabled. Users are encouraged to use LDAP as a name service in place of NIS." + remediation: "To disable this service, run the following commands: # svcadm disable svc:/network/nis/client # svcadm disable svc:/network/nis/domain" + compliance: + - cis: ["2.5"] + condition: all + rules: + - 'c:svcs -xv svc:/network/nis/client -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + - 'c:svcs -xv svc:/network/nis/domain -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + + - id: 8005 + title: "Disable Kerberos TGT Expiration Warning" + description: 'The Kerberos TGT warning service is used to warn users when their Kerberos tickets are about expire or to renew those tickets before they expire. This service is not used if Kerberos has not been configured. This service is configured to be "local only" by default.' + rationale: "This service should be disabled if it is not required." + remediation: "To disable this service, run the following command: # svcadm disable svc:/network/security/ktkt_warn" + compliance: + - cis: ["2.6"] + condition: all + rules: + - 'c:svcs -xv svc:/network/security/ktkt_warn -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + + - id: 8006 + title: "Disable Generic Security Services (GSS)" + description: "The GSS API is a security abstraction layer that is designed to make it easier for developers to integrate with different authentication schemes. It is most commonly used in applications for sites that use Kerberos for network authentication, though it can also allow applications to interoperate with other authentication schemes." + rationale: "GSS does not expose anything external to the system as it is configured to use TLI (protocol = ticotsord) by default. This service should be disabled if it is not required." + remediation: "To disable this service, run the following command: # svcadm disable svc:/network/rpc/gss" + compliance: + - cis: ["2.7"] + condition: all + rules: + - 'c:svcs -xv svc:/network/rpc/gss -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + + - id: 8007 + title: "Disable Removable Volume Manager" + description: "The HAL-aware removable volume manager in the Solaris 11 OS automatically mounts external devices for users whenever the device is attached to the system. These devices include CD-R, CD-RW, floppies, DVD, USB and 1394 mass storage devices. See the rmvolmgr(1M) manual page for more details." + rationale: "Allowing users to mount and access data from removable media devices makes it easier for malicious programs and data to be imported onto the network. It also introduces the risk that sensitive data may be transferred off the system without a log record. By adding rmvolmgr to the .xinitrc file, user-isolated instances of rmvolmgr can be run via a session startup script. In such cases, the rmvolmgr instance will not allow management of volumes that belong to other than the owner of the startup script. When a user logs onto the workstation console (/dev/console), any instance of user-initiated rmvolmgr will only own locally connected devices, such as CD-ROMs or flash memory hardware, locally connected to USB or FireWire ports." + remediation: "To disable this service, run the following commands: # svcadm disable svc:/system/filesystem/rmvolmgr # svcadm disable svc:/network/rpc/smserver" + compliance: + - cis: ["2.8"] + condition: all + rules: + - 'c:svcs -xv svc:/system/filesystem/rmvolmgr -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + - 'c:svcs -xv svc:/network/rpc/smserver -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + + - id: 8008 + title: "Disable automount Service" + description: "The automount daemon is normally used to automatically mount NFS file systems from remote file servers when needed. However, the automount daemon can also be configured to mount local (loopback) file systems as well, which may include local user home directories, depending on the system configuration." + rationale: "This service should be disabled if it is not required." + remediation: "To disable this service, run the following command: # svcadm disable svc:/system/filesystem/autofs" + compliance: + - cis: ["2.9"] + condition: all + rules: + - 'c:svcs -xv svc:/system/filesystem/autofs -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + + - id: 8009 + title: "Disable Apache Service" + description: "The Apache service provides an instance of the Apache web server." + rationale: "This service should be disabled if it is not required." + remediation: "To disable this service, run the following command: # svcadm disable svc:/network/http:apache22" + compliance: + - cis: ["2.10"] + references: + - https://httpd.apache.org/docs/2.0/misc/security_tips.html + condition: all + rules: + - 'c:svcs -xv svc:/network/http:apache22 -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + + - id: 8010 + title: "Disable Local-only RPC Port Mapping Service" + description: "Remote Procedure Call (RPC) is used by many services within the Solaris 11 operating system. Some of these services allow external connections to use the service (e.g. NFS, NIS). By default, the Solaris 11 OS configures this service to be local only." + rationale: "RPC-based services typically have weak or non-existent authentication and yet may share very sensitive information, which is vulnerable to network traffic sniffers. Unless one of these services is required on this host, RPC-based tools should be fully disabled." + remediation: "To disable this service, run the following command: # svcadm disable svc:/network/rpc/bind. If the goal is to restrict access to this service, but not disable it completely, consider using a host-based firewall such as ipfilter(5) to control what hosts are allowed to access this service. Alternatively, TCP Wrappers support, which controls host access and connection auditing, can be enabled. TCP Wrappers is discussed in the next section." + compliance: + - cis: ["2.11"] + condition: all + rules: + - 'c:svcs -xv svc:/network/rpc/bind -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + + - id: 8011 + title: "Configure TCP Wrappers" + description: "TCP Wrappers is a host-based access control system that allows administrators to control who has access to various network services based on the IP address of the remote end of the connection. TCP Wrappers also provide logging information via syslog about both successful and unsuccessful connections." + rationale: "TCP Wrappers provides granular control over what services can be accessed over the network. Its logs show attempted access to services from non-authorized systems, which can help identify unauthorized access attempts." + remediation: 'To enable TCP Wrappers, run the following commands: 1. Create and customize your policy in /etc/hosts.allow: # echo "ALL: /, , ..." > /etc/hosts.allow. Where each / combination (for example, the Class C address block "192.168.1.0/255.255.255.0") can represent one network block in use by your organization that requires access to this system. 2) Create a default deny policy in /etc/hosts.deny: # echo "ALL: ALL" >/etc/hosts.deny. 3) Enable TCP Wrappers for all services started by inetd: # inetadm -M tcp_wrappers=TRUE - To protect only specific inetd services, use the command: # inetadm -m [FMRI] tcp_wrappers=TRUE. To enable TCP Wrappers for the RPC port mapping service, use the commands: # svccfg -s rpc/bind setprop config/enable_tcpwrappers=true # svcadm refresh rpc/bind. The versions of SSH and sendmail that ship with Solaris 11 will automatically use TCP Wrappers to filter access if a hosts.allow or hosts.deny file exists. To protect UDP and RPC-based services that are spawned from inetd, consider implementing a host-based firewall such as Solaris IP Filter. See ipfilter(5) for more information.' + compliance: + - cis: ["2.12"] + references: + - ipfilter(5) man page + condition: all + rules: + - "c:inetadm -p -> r:tcp_wrappers=TRUE" + - "f:/etc/hosts.allow" + - "f:/etc/hosts.deny" + + - id: 8012 + title: "Disable Telnet Service" + description: "The telnet daemon, which accepts connections from users from other systems via the telnet protocol and can be used for remote shell access." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh protocol provides an encrypted session and stronger security." + remediation: "Disable telnet server if enabled: # svcadm disable svc:/network/telnet" + compliance: + - cis: ["2.13"] + condition: all + rules: + - 'c:svcs -xv svc:/network/telnet -> r:State:\sdisabled|State:\s-$|match\sany\sinstances' + + # 3 Kernel Tuning + - id: 8013 + title: "Restrict Core Dumps to Protected Directory" + description: "The action described in this section creates a protected directory to store core dumps and also causes the system to create a log entry whenever a regular process dumps core." + rationale: "Core dumps, particularly those from set-UID and set-GID processes, may contain sensitive data." + remediation: "To implement the recommendation, run the commands: # chmod 700 /var/cores # coreadm -g /var/cores/core_%n_%f_%u_%g_%t_%p -e log -e global -e global-setid -d process -d proc-setid If the local site chooses, dumping of core files can be completely disabled with the following command: # coreadm -d global -d global-setid -d process -d proc-setid" + compliance: + - cis: ["3.1"] + condition: all + rules: + - "c:coreadm" + - "c:coreadm -> r:per-process core dumps: disabled" + - "c:coreadm -> r:per-process setid core dumps: disabled" + - 'c:stat -L -c%u-%g-%a /var/cores -> r:^\d-\d-700' + + - id: 8014 + title: "Enable Stack Protection" + description: "Buffer overflow exploits have been the basis for many highly publicized compromises and defacements of large numbers of Internet connected systems. Many of the automated tools in use by system attackers exploit well-known buffer overflow problems in vendor- supplied and third party software." + rationale: "Enabling stack protection prevents certain classes of buffer overflow attacks and is a significant security enhancement. However, this does not protect against buffer overflow attacks that do not execute code on the stack (such as return-to-libc exploits). While most of the Solaris OS is already configured to employ a non-executable stack, this setting is still recommended to provide a more comprehensive solution for both Solaris and other software that may be installed." + remediation: 'To enable stack protection and block stack-smashing attacks, run the following to edit the /etc/system file: # if [ ! "`grep noexec_user_stack= /etc/system`" ]; then cat <>/etc/system set noexec_user_stack=1 set noexec_user_stack_log=1 END_CFG fi' + compliance: + - cis: ["3.2"] + condition: all + rules: + - "f:/etc/system" + - 'f:/etc/system -> r:\s*\t*noexec_user_stack\s*\t*=\s*\t*1' + - 'f:/etc/system -> r:\s*\t*noexec_user_stack_log\s*\t*=\s*\t*1' + + - id: 8015 + title: "Enable Strong TCP Sequence Number Generation" + description: "The variable TCP_STRONG_ISS defines the mechanism used for TCP initial sequence number generation. If an attacker can predict the next sequence number, it is possible to inject fraudulent packets into the data stream to hijack the session." + rationale: "The RFC 1948 method is widely accepted as the strongest mechanism for TCP packet generation. This makes remote session hijacking attacks more difficult, as well as any other network-based attack that relies on predicting TCP sequence number information. It is theoretically possible that there may be a small performance hit in connection setup time when this setting is used, but there are no publicly available benchmarks that establish this." + remediation: 'Run the following commands to set the TCP_STRONG_ISS parameter to use RFC 1948 sequence number generation in the /etc/default/inetinit file: # cd /etc/default # awk ''/TCP_STRONG_ISS=/ { $1 = "TCP_STRONG_ISS=2" }; { print }'' inetinit > inetinit.CIS # mv inetinit.CIS inetinit To set the TCP_STRONG_ISS parameter on a running system, use the command: # ipadm set-prop -p _strong_iss=2 tcp' + compliance: + - cis: ["3.3"] + condition: all + rules: + - 'f:/etc/default/inetinit -> r:^TCP_STRONG_ISS\s*\t*=\s*\t*2' + - "c:ipadm show-prop -p _strong_iss -co current tcp -> r:2" + + # 4 Auditing and Logging + - id: 8016 + title: "Create CIS Audit Class" + description: "To group a set of related audit events, the Solaris Audit service provides the ability for sites to define their own audit classes that contain just those events that the site wants to audit." + rationale: "To simplify administration, a CIS specific audit class should be created." + remediation: "To create the CIS audit class, edit the /etc/security/audit_class file and add the following entry before the last line of the file: 0x0100000000000000:cis:CIS Solaris Benchmark" + compliance: + - cis: ["4.1"] + condition: all + rules: + - "f:/etc/security/audit_class -> 0x0100000000000000:cis:CIS Solaris Benchmark" + + - id: 8017 + title: "Enable Auditing of Incoming Network Connections" + description: "The Solaris Audit service can be configured to record incoming network connections to any listening service running on the system." + rationale: "This recommendation will provide an audit trail that contains information related to incoming network connections. While this functionality can be enabled using service- specific mechanisms, using the Solaris Audit service provides a more centralized and complete window into incoming network activity." + remediation: "To enforce this setting, edit the /etc/security/audit_event file and add the cis audit class to the following audit events: AUE_ACCEPT AUE_CONNECT AUE_SOCKACCEPT AUE_SOCKCONNECT AUE_inetd_connect" + compliance: + - cis: ["4.2"] + condition: all + rules: + - 'f:/etc/security/audit_event -> r:^\d+:AUE_ACCEPT:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_CONNECT:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_SOCKACCEPT:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_SOCKCONNECT:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_inetd_connect:\.+cis\.*' + + - id: 8018 + title: "Enable Auditing of File Metadata Modification Events" + description: "The Solaris Audit service can be configured to record file metadata modification events for every process running on the system. This will allow the auditing service to determine when file ownership, permissions and related information is changed." + rationale: "This recommendation will provide an audit trail that contains information related to changes of file metadata. The Solaris Audit service is used to provide a more centralized and complete window into activities such as these." + remediation: "To enforce this setting, edit the /etc/security/audit_event file and add the cis audit class to the following audit events: AUE_CHMOD AUE_CHOWN AUE_FCHOWN AUE_FCHMOD AUE_LCHOWN AUE_ACLSET AUE_FACLSET" + compliance: + - cis: ["4.3"] + condition: all + rules: + - 'f:/etc/security/audit_event -> r:^\d+:AUE_CHMOD:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_CHOWN:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_FCHOWN:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_FCHMOD:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_LCHOWN:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_ACLSET:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_FACLSET:\.+cis\.*' + + - id: 8019 + title: "Enable Auditing of Process and Privilege Events" + description: "The Solaris Audit service can be configured to record the use of privileges by processes running on the system. This will capture events such as the setting of UID and GID values, setting of privileges, as well as the use of functionality such as chroot(2)." + rationale: "This recommendation will provide an audit trail that contains information related to the use of privileges by processes running on the system. The Solaris Audit service is used to provide a more centralized and complete window into activities such as these." + remediation: "To enforce this setting, edit the /etc/security/audit_event file and add the cis audit class to the following audit events: AUE_CHROOT AUE_SETREUID AUE_SETREGID AUE_FCHROOT AUE_PFEXEC AUE_SETUID AUE_NICE AUE_SETGID AUE_PRIOCNTLSYS AUE_SETEGID AUE_SETEUID AUE_SETPPRIV AUE_SETSID AUE_SETPGID" + compliance: + - cis: ["4.4"] + condition: all + rules: + - 'f:/etc/security/audit_event -> r:^\d+:AUE_CHROOT:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_SETREUID:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_SETREGID:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_FCHROOT:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_PFEXEC:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_SETUID:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_NICE:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_SETGID:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_PRIOCNTLSYS:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_SETEGID:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_SETEUID:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_SETPPRIV:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_SETSID:\.+cis\.*' + - 'f:/etc/security/audit_event -> r:^\d+:AUE_SETPGID:\.+cis\.*' + + - id: 8020 + title: "Configure Solaris Auditing" + description: 'Solaris auditing service keeps a record of how a system is being used. Solaris auditing can be configured to record different classes of events based upon site policy. This recommendation will set and verify a consensus-developed auditing policy. That said, all organizations are encouraged to tailor this policy based upon their specific needs. For more information on the Solaris auditing service including how to filter and view events, see the Oracle Solaris product documentation. The "cis" class is a "custom class" that CIS recommends creating that includes specifically those events that are of interest (defined in the sections above). In addition to those events, this recommendation also includes auditing of login and logout (lo) events, administrative (ad) events, file transfer (ft) events, and command execution (ex) events. This recommendation also configures the Solaris auditing service to capture and report command line arguments (for command execution events) and the zone name in which a command was executed (for global and non-global zones). Further, this recommendation sets a disk utilization threshold of 1%. If this threshold is crossed (for the volume that includes /var/audit), then a warning e-mail will be sent to advise the system administrators that audit events may be lost if the disk becomes full. Finally, this recommendation will also ensure that new audit trails are created at the start of each new day (to help keep the size of the files small to facilitate analysis).' + rationale: "The consensus settings described in this section are an effort to log interesting system events without consuming excessive amounts of resources logging significant but usually uninteresting system calls." + remediation: "To enforce this setting, use the command: # auditconfig -conf # auditconfig -setflags lo,ad,ft,ex,cis # auditconfig -setnaflags lo # auditconfig -setpolicy cnt,argv,zonename # auditconfig -setplugin audit_binfile active p_minfree=1 # audit -s # rolemod -K audit_flags=lo,ad,ft,ex,cis:no root # EDITOR=ed crontab -e root << END_CRON $ a 0 * * * * /usr/sbin/audit -n . w q END_CRON # chown root:root /var/audit # chmod 750 /var/audit" + compliance: + - cis: ["4.5"] + condition: all + rules: + - "c:auditconfig -getcond -> audit condition = auditing" + - "c:auditconfig -getpolicy -> r:active audit policies = argv,cnt,zonename" + - 'c:auditconfig -getflags -> r:active user default audit flags = cis,ex,aa,ua,as,ss,lo,ft\(0x1000000800f1080,0x1000000800f1080\)' + - 'c:auditconfig -getnaflags -> r:active non-attributable audit flags = lo\(0x1000,0x1000\)' + - 'c:auditconfig -getplugin audit_binfile -> r:audit_binfile \(active\)' + - "c:userattr audit_flags root -> r:lo,ad,ft,ex,cis:no" + - "f:/var/spool/cron/crontabs/root -> r:/usr/sbin/audit -n" + + # 5 File/Directory Permissions/Access + - id: 8021 + title: "Default Service File Creation Mask" + description: "The default system file creation mask applies to processes that are started by init - including most system services. To ensure that files are not created with write access to anyone other than their owner, the default file creation mask should be set to 022. Some sites with more stringent security requirements may prefer to set this value to 077 to eliminate all permissions for group and world. Note that changing this value from the Solaris default of 022 may negatively impact services that may not be able to operate with a stricter setting." + rationale: "The default file creation mask should be set to 022 to avoid unnecessarily giving files write access to group or world." + remediation: 'Perform the following to implement the recommended state: # svccfg -s svc:/system/environment:init setprop umask/umask = astring: "022"' + compliance: + - cis: ["5.1"] + condition: all + rules: + - "c:svcprop -p umask/umask svc:/system/environment:init -> 022" + + # 6 System Access, Authentication, and Authorization + - id: 8022 + title: 'Disable "nobody" Access for RPC Encryption Key Storage Service' + description: "This action listed prevents keyserv from using default keys for the nobody user, effectively stopping the nobody user from accessing information via Secure RPC." + rationale: "If login by the user nobody is allowed for secure RPC, there is an increased risk of system compromise. If keyserv holds a private key for the nobody user, it will be used by key_encryptsession to compute a magic phrase which can be easily recovered by a malicious user." + remediation: 'Perform the following to implement the recommended state: # cd /etc/default # awk ''/ENABLE_NOBODY_KEYS=/ { $1 = "ENABLE_NOBODY_KEYS=NO" } { print }'' keyserv > keyserv.CIS # mv keyserv.CIS keyserv' + compliance: + - cis: ["6.2"] + condition: all + rules: + - "f:/etc/default/keyserv" + - 'f:/etc/default/keyserv -> !r:^# && r:ENABLE_NOBODY_KEYS\s*\t*=\s*\t*NO' + + - id: 8023 + title: "Disable X11 Forwarding for SSH" + description: "The 'X11 Forwarding' parameter defined within the /etc/ssh/sshd_config file specifies whether or not X11 Forwarding via SSH is enabled on the server: The Secure Shell service provides an encrypted 'tunnel' for the data traffic passing through it. While commonly used to substitute for clear-text, CLI-based remote connections such as telnet, Secure Shell can be used to forward an 'X Window' session through the encrypted tunnel, allowing the remote user to have a GUI interface." + rationale: "As enabling X11Forwarding on the host can permit a malicious user to secretly open another X11 connection to another remote client during the session and perform unobtrusive activities such as keystroke monitoring, if the X11 services are not required for the system's intended function, it should be disabled or restricted as appropriate to the user's needs." + remediation: 'Perform the following to implement the recommended state: # awk ''/^X11Forwarding / { $2 = "no" } { print }'' /etc/ssh/sshd_config > /etc/ssh/sshd_config.CIS # mv /etc/ssh/sshd_config.CIS /etc/ssh/sshd_config # svcadm restart svc:/network/ssh' + compliance: + - cis: ["6.3"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:X11Forwarding\s+no' + + - id: 8024 + title: "Limit Consecutive Login Attempts for SSH" + description: "The 'MaxAuthTries' parameter in the /etc/ssh/sshd_config file specifies the maximum number of authentication attempts permitted per connection. By restricting the number of failed authentication attempts before the server terminates the connection, malicious users are blocked from gaining access to the host by using repetitive brute-force login exploits." + rationale: "By setting the authentication login limit to a low value this will disconnect the attacker and force a reconnect, which severely limits the speed of such brute force attacks." + remediation: 'Perform the following to implement the recommended state: # awk ''/^MaxAuthTries/ { $2 = "3" } { print }'' /etc/ssh/sshd_config > /etc/ssh/sshd_config.CIS # mv /etc/ssh/sshd_config.CIS /etc/ssh/sshd_config # svcadm restart svc:/network/ssh' + compliance: + - cis: ["6.4"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && n:MaxAuthTries\s*\t*(\d+) compare <= 3' + + - id: 8025 + title: "Disable Rhost-based Authentication for SSH" + description: "The IgnoreRhosts parameter specifies that existing .rhosts and .shosts files, which may apply to application rather than user logins, will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with SSH." + remediation: 'Perform the following to implement the recommended state: # awk ''/^IgnoreRhosts/ { $2 = "yes" } { print }'' /etc/ssh/sshd_config > /etc/ssh/sshd_config.CIS # mv /etc/ssh/sshd_config.CIS /etc/ssh/sshd_config # svcadm restart svc:/network/ssh This action will only set the IgnoreRhosts line if it already exists in the file to ensure that it is set to the proper value. If the IgnoreRhosts line does not exist in the file, the default setting of Yes is automatically used, so no additional changes are needed.' + compliance: + - cis: ["6.5"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:IgnoreRhosts\s+yes' + + - id: 8026 + title: "Disable root login for SSH" + description: "The PermitRootLogin value (in /etc/ssh/sshd_config) allows for direct root login by a remote user/application to resources on the local host." + rationale: "By default, it is not possible for the root account to log directly into the system console because the account is configured as a role. This setting therefore does not significantly alter the security posture of the system unless the root account is changed from this default and configured to be a normal user." + remediation: 'Perform the following to implement the recommended state: # awk ''/^PermitRootLogin/ { $2 = "no" } { print }'' /etc/ssh/sshd_config > /etc/ssh/sshd_config.CIS # mv /etc/ssh/sshd_config.CIS /etc/ssh/sshd_config # svcadm restart svc:/network/ssh' + compliance: + - cis: ["6.6"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitRootLogin\s+no' + + - id: 8027 + title: "Blocking Authentication Using Empty/Null Passwords for SSH" + description: "The PermitEmptyPasswords value allows for direct login through SSH without a password by a remote user/application to resources on the local host in the same way a standard remote login would." + rationale: "Permitting login without a password is inherently risky." + remediation: 'Perform the following to implement the recommended state: # awk ''/^PermitEmptyPasswords/ { $2 = "no" } { print }'' /etc/ssh/sshd_config > /etc/ssh/sshd_config.CIS # mv /etc/ssh/sshd_config.CIS /etc/ssh/sshd_config # svcadm restart svc:/network/ssh' + compliance: + - cis: ["6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:PermitEmptyPasswords\s+no' + + - id: 8028 + title: "Disable Host-based Authentication for Login-based Services" + description: "The .rhosts files are used for automatic login to remote hosts and contain username and hostname combinations. The .rhosts files are unencrypted (usually group- or world- readable) and present a serious risk in that a malicious user could use the information within to gain access to a remote host with the privileges of the original application or user." + rationale: "The use of .rhosts authentication is an old and insecure protocol and can be replaced with public-key authentication using Secure Shell. As automatic authentication settings in the .rhosts files can provide a malicious user with sensitive system credentials, the use of .rhosts files should be disabled. It should be noted that by default the Solaris services that use this file, including rsh and rlogin, are disabled by default." + remediation: "Perform the following to implement the recommended state: # cd /etc # cp pam.conf pam.conf.pre-CIS # sed -e 's/^.*pam_rhosts_auth/#&/' < /etc/pam.conf > pam.conf.CIS # mv pam.conf.CIS pam.conf" + compliance: + - cis: ["6.8"] + condition: all + rules: + - 'f:/etc/pam.conf -> r:^#\s*\t*rlogin && r:auth && r:sufficient && r:pam_rhosts_auth.so.1' + - 'f:/etc/pam.conf -> r:^#\s*\t*rsh && r:auth && r:sufficient && r:pam_rhosts_auth.so.1' + + - id: 8029 + title: "Set Delay between Failed Login Attempts to 4" + description: 'The SLEEPTIME variable in the /etc/default/login file controls the number of seconds to wait before printing the "login incorrect" message when a bad password is provided.' + rationale: "As an immediate return of an error message, coupled with the capability to try again may facilitate automatic and rapid-fire brute-force password attacks by a malicious user, this delay time should be set as appropriate to the needs of the user." + remediation: 'Perform the following to implement the recommended state: # cd /etc/default # awk ''/SLEEPTIME=/ { $1 = "SLEEPTIME=4" } { print }'' login > login.CIS # mv login.CIS login' + compliance: + - cis: ["6.10"] + condition: all + rules: + - 'f:/etc/default/login -> !r:^# && n:^SLEEPTIME\s*\t*=\s*\t*(\d+) compare >= 4' + + - id: 8030 + title: "Remove Autologin Capabilities from the GNOME desktop" + description: "The GNOME Display Manager is used for login session management. See the manual page gdm(1) for more information. By default, GNOME automatic login is defined in pam.conf(4) to allow users to access the system without a password." + rationale: 'As automatic logins are a known security risk for other than "kiosk" types of systems, GNOME automatic login should be disabled in pam.conf(4).' + remediation: 'Perform the following to implement the recommended state: # cd /etc # awk ''/^gdm-autologin/ { $1=" #gdm-autologin" } { print }'' /etc/pam.conf > /etc/pam.conf.CIS # mv pam.conf.CIS pam.conf' + compliance: + - cis: ["6.11"] + condition: none + rules: + - "f:/etc/pam.conf -> !r:^# && r:gdm-autologin" + + - id: 8031 + title: "Set Default Screen Lock for GNOME Users" + description: "The timeout parameter dictates the invocation of a password-protected screen saver after a specified time of keyboard and mouse inactivity, specific to the xscreensaver application used in the GNOME windowing environment." + rationale: "As a screensaver timeout provides protection for a desktop that has not been locked by the user upon his/her departure, to help prevent session hijacking, this value should be set as appropriate to the needs of the user." + remediation: "Perform the following to implement the recommended state: # cd /usr/share/X11/app-defaults # cp XScreenSaver XScreenSaver.orig # awk '/^\\*timeout:/ { $2 = \"0:10:00\" } /^\\*lockTimeout:/ { $2 = \"0:00:00\" } /^\\*lock:/ { $2 = \"True\" } { print }' xScreenSaver > xScreenSaver.CIS # mv xScreenSaver.CIS xScreenSaver" + compliance: + - cis: ["6.12"] + condition: all + rules: + - "f:/usr/share/X11/app-defaults/XScreensaver" + - 'f:/usr/share/X11/app-defaults/XScreensaver -> r:^*timeout:\s*\t*\d+:\d+:\d+' + - 'f:/usr/share/X11/app-defaults/XScreensaver -> r:^*locktimeout:\s*\t*\d+:\d+:\d+' + - 'f:/usr/share/X11/app-defaults/XScreensaver -> r:^*lock:\s*\t*true' + + - id: 8032 + title: "Restrict at/cron to Authorized Users" + description: "The cron.allow and at.allow files contain a list of users who are allowed to run the crontab and at commands to submit jobs to be run at scheduled intervals." + rationale: "On many systems, only the system administrator needs the ability to schedule jobs. Even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs. Much more effective access controls for the cron system can be obtained by using Role-Based Access Controls (RBAC)." + remediation: "Perform the following to implement the recommended state: # cd /etc/cron.d # mv cron.deny cron.deny.cis # mv at.deny at.deny.cis # echo root > cron.allow # cp /dev/null at.allow # chown root:root cron.allow at.allow # chmod 400 cron.allow at.allow" + compliance: + - cis: ["6.13"] + condition: all + rules: + - "not f:/etc/cron.d/cron.deny" + - "not f:/etc/cron.d/at.deny" + - "f:/etc/cron.d/cron.allow" + - "f:/etc/cron.d/cron.allow -> r:^root$" + - "f:/etc/cron.d/at.allow" + - 'c:wc -l /etc/cron.d/at.allow -> r:\s*0\s' + + - id: 8033 + title: "Restrict root Login to System Console" + description: "Privileged access to the system via root must be accountable to a particular user." + rationale: "Use an authorized mechanism such as RBAC and the su command to provide administrative access to unprivileged accounts. These mechanisms provide an audit trail in the event of problems." + remediation: 'Perform the following to implement the recommended state: # cd /etc/default # awk ''/CONSOLE=/ { print "CONSOLE=/dev/console"; next }; { print }'' login > login.CIS # mv login.CIS login' + compliance: + - cis: ["6.14"] + condition: all + rules: + - 'f:/etc/default/login -> !r:^# && r:CONSOLE|console && r:=\s*\t*/dev/console' + + - id: 8034 + title: "Set Retry Limit for Account Lockout" + description: "The RETRIES parameter is the number of failed login attempts a user is allowed before being disconnected from the system and forced to reconnect. When LOCK_AFTER_RETRIES is set in /etc/security/policy.conf, then the user's account is locked after this many failed retries (the account can only be unlocked by the administrator using the command: passwd -u ). The account lockout threshold (RETRIES parameter) restricts the number of failed login attempts allowed before requiring the offending account be locked. The lockout requirement will help block malicious users from gaining access to the host via automated, repetitive brute-force login exploits--trying different passwords until one fits a user name." + rationale: "Setting the failed login limit to an appropriate value locks the user account, which will severely limit the speed of such attacks, making it much more likely that the attacker's pattern will be noticed and the offending source address and/or port blocked, so this should be set according to the needs of the user." + remediation: 'Perform the following to implement the recommended state: # cd /etc/default # awk ''/RETRIES=/ { $1 = "RETRIES=3" } { print }'' login >login.CIS # mv login.CIS login # cd /etc/security # awk ''/LOCK_AFTER_RETRIES=/ { $1 = "LOCK_AFTER_RETRIES=YES" } { print }'' policy.conf > policy.conf.CIS # mv policy.conf.CIS policy.conf # svcadm restart svc:/system/name-service/cache Be careful when enabling these settings as they can create a denial-of-service situation for legitimate users and applications. Account lockout can be disabled for specific users via the usermod command. For example, the following command disables account lock specifically for the oracle account: # usermod -K lock_after_retries=no oracle' + compliance: + - cis: ["6.15"] + condition: all + rules: + - 'f:/etc/default/login -> !r:^# && r:retries|RETRIES && n:=\s*\t*(\d+) compare <=3' + - 'f:/etc/security/policy.conf -> !r:^# && r:LOCK_AFTER_RETRIES|lock_after_retries && r:=\s*\t*yes' + + - id: 8035 + title: "Secure the GRUB Menu (Intel)" + description: "GRUB is a boot loader for x64 based systems that permits loading an OS image from any location. Oracle x64 systems support the use of a GRUB Menu password for the console." + rationale: "The flexibility that GRUB provides creates a security risk if its configuration is modified by an unauthorized user. The failsafe menu entry needs to be secured in the same environments that require securing the systems firmware to avoid unauthorized removable media boots. Setting the GRUB Menu password helps prevent attackers with physical access to the system console from booting off some external device (such as a CD- ROM or floppy) and subverting the security of the system. The actions described in this section will ensure you cannot get to failsafe or any of the GRUB command line options without first entering the password." + remediation: "Perform the following to implement the recommended state: # /boot/grub/bin/grub grub> md5crypt Password: [enter desired boot loader password] Encrypted: [enter md5 password string] grub> [enter control-C (^C)] The actual menu.lst file for Solaris 11 x64 is the /rpool/boot/grub/menu.lst. First, ensure the menu.lst file can only be read by the root user: # chmod 600 /rpool/boot/grub/menu.lst Next, add the following line to the menu.lst file above the entries added by bootadm: password --md5 [enter md5 password string generated above] Finally, add the keyword lock to the Solaris failsafe boot entry as in the following example (as well as to any other entries that you want to protect): title Solaris failsafe lock" + compliance: + - cis: ["6.17"] + condition: all + rules: + - "f:/rpool/boot/grub/menu.lst" + - 'f:/rpool/boot/grub/menu.lst -> r:^password\s*--md5' + + # 7 User Accounts and Environment + - id: 8036 + title: "Set Password Expiration Parameters on Active Accounts" + description: "The characteristics of an operating system that make 'user identification' via password a secure and workable solution is the combination of settings chosen. By requiring that a series of password-choices be security-centric, it reduces the risk of a malicious user breaking the password through dictionary/brute force attacks or fortuitous guessing based upon 'social engineering.' A basic password security strategy is requiring a new password to be chosen every 45-90 days, so that repeated attempts to gain entry by brute-force tactics will fail when a new password is chosen, which requires starting over again to break the new password." + rationale: "The commands for this item set all active accounts (except the root account) to force password changes every 91 days (13 weeks), and then prevent password changes for seven days (one week), thereafter. Users will begin receiving warnings 28 days (4 weeks) before their password expires. Sites also have the option of expiring idle accounts after a certain number of days (see the on-line manual page for the usermod command, particularly the -f option)." + remediation: 'Perform the following to implement the recommended state: # logins -ox | awk -F: ''($1 == "root" || $8 == "LK" || $8 == "NL") { next } ; { $cmd = "passwd" } ; ($11 91) { $cmd = $cmd " -x 91" } ($10 < 7) { $cmd = $cmd " -n 7" } ($12 < 28) { $cmd = $cmd " -w 28" } ($cmd != "passwd") { print $cmd " " $1 }'' > /etc/CISupd_accounts # /sbin/sh /etc/CISupd_accounts # rm -f /etc/CISupd_accounts # cd /etc/default # grep -v WEEKS passwd > passwd.CIS # cat <> passwd.CIS MAXWEEKS=13 MINWEEKS=1 WARNWEEKS=4 EODefaults # mv passwd.CIS passwd' + compliance: + - cis: ["7.1"] + condition: all + rules: + - 'f:/etc/default/passwd -> !r:^# && r:maxweeks|MAXWEEKS && n:=\s*\t*(\d+) compare <= 13' + - 'f:/etc/default/passwd -> !r:^# && r:minweeks|MINWEEKS && n:=\s*\t*(\d+) compare == 1' + - 'f:/etc/default/passwd -> !r:^# && r:warnweeks|WARNWEEKS && n:=\s*\t*(\d+) compare == 4' + + - id: 8037 + title: "Set Strong Password Creation Policies" + description: "The variables in the /etc/default/passwd file indicate various strategies for creating differences required between an old and a new password. As requiring users to select a specific numbers of differences between the characters in the existing password and the new one can strengthen the password by increasing the symbol-set space, to further increase the difficulty of breaking any password by brute-force attacks, these values should be set as appropriate to the needs of the user." + rationale: "Administrators may wish to add site-specific dictionaries to the DICTIONLIST parameter. Warning: Sites often have differing opinions on the optimal value of the HISTORY parameter (how many previous passwords to remember per user in order to prevent re- use). The values specified here are in compliance with NSA/DISA requirements. If this is too restrictive for your site, you may wish to set a HISTORY value of 4 and a MAXREPEATS of 2. Consult your local security rules for guidance." + remediation: 'Perform the following to implement the recommended state: # cd /etc/default # awk ''/PASSLENGTH=/ { $1 = "PASSLENGTH=8" }; /NAMECHECK=/ { $1 = "NAMECHECK=YES" }; /HISTORY=/ { $1 = "HISTORY=10" }; /MINDIFF=/ { $1 = "MINDIFF=3" }; /MINALPHA=/ { $1 = "MINALPHA=2" }; /MINUPPER=/ { $1 = "MINUPPER=1" }; /MINLOWER=/ { $1 = "MINLOWER=1" }; /MINNONALPHA=/ { $1 = "MINNONALPHA=1" }; /MAXREPEATS=/ { $1 = "MAXREPEATS=0" }; /WHITESPACE=/ { $1 = "WHITESPACE=YES" }; /DICTIONDBDIR=/ { $1 = "DICTIONDBDIR=/var/passwd" }; /DICTIONLIST=/ { $1 = "DICTIONLIST=/usr/share/lib/dict/words" }; { print }'' passwd > passwd.CIS # mv passwd.CIS passwd' + compliance: + - cis: ["7.2"] + condition: all + rules: + - 'f:/etc/default/passwd -> !r:^# && r:passlength|PASSLENGTH && n:=\s*\t*(\d) compare <= 8' + - 'f:/etc/default/passwd -> !r:^# && r:namecheck|NAMECHECK && r:=\s*\t*yes' + - 'f:/etc/default/passwd -> !r:^# && r:history|HISTORY && n:=\s*\t*(\d+) compare >= 10' + - 'f:/etc/default/passwd -> !r:^# && r:mindiff|MINDIFF && n:=\s*\t*(\d+) compare >= 3' + - 'f:/etc/default/passwd -> !r:^# && r:minalpha|MINALPHA && n:=\s*\t*(\d+) compare >= 2' + - 'f:/etc/default/passwd -> !r:^# && r:minupper|MINUPPER && n:=\s*\t*(\d+) compare >= 1' + - 'f:/etc/default/passwd -> !r:^# && r:minlower|MINLOWER && n:=\s*\t*(\d+) compare >= 1' + - 'f:/etc/default/passwd -> !r:^# && r:minnonalpha|MINNONALPHA && n:=\s*\t*(\d+) compare >= 1' + - 'f:/etc/default/passwd -> !r:^# && r:maxrepeats|MAXREPEATS && r:=\s*\t*0' + - 'f:/etc/default/passwd -> !r:^# && r:whitespace|WHITESPACE && r:=\s*\t*yes' + - 'f:/etc/default/passwd -> !r:^# && r:dictiondbdir|DICTIONDBDIR && r:=\s*\t*/var/passwd' + - 'f:/etc/default/passwd -> !r:^# && r:dictionlist|DICTIONLIST && r:=\s*\t*/usr/share/lib/dict/words' + + - id: 8038 + title: "Set Default umask for users" + description: "The default umask(1) determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod(1) command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files (.profile, .cshrc, etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would allow files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: 'Perform the following to implement the recommended state: # cd /etc/default # awk ''/#UMASK=/ { $1 = "UMASK=027" } { print }'' login > login.CIS # mv login.CIS login' + compliance: + - cis: ["7.3"] + condition: all + rules: + - 'f:/etc/default/login -> !r:^# && r:UMASK|umask && r:=\s*\t*027' + + - id: 8039 + title: "Set Default File Creation Mask for FTP Users" + description: "If FTP is permitted, set a strong, default file creation mask to apply to files created by the FTP server." + rationale: "Many users assume that the FTP server will use their system file creation mask; generally it does not. This setting ensures that files transmitted over FTP use a strong file creation mask." + remediation: 'Perform the following to implement the recommended state: # cd /etc # if [ "`grep ''^Umask'' proftpd.conf`" ]; then awk ''/^Umask/ { $2 = "027" } { print }'' proftpd.conf > proftpd.conf.CIS mv proftpd.conf.CIS proftpd.conf else echo "Umask 027" >> proftpd.conf fi' + compliance: + - cis: ["7.4"] + condition: all + rules: + - 'f:/etc/proftpd.conf -> !r:^# && r:Umask && r:\s*\t*027' + + - id: 8040 + title: 'Set "mesg n" as Default for All Users' + description: 'The "mesg n" command blocks attempts to use the write or talk commands to contact users at their terminals, but has the side effect of slightly strengthening permissions on the user''s tty device.' + rationale: "Since write and talk are no longer widely used at most sites, the incremental security increase is worth the loss of functionality." + remediation: 'Perform the following to implement the recommended state: # cd /etc # for file in profile .login ; do if [ "`grep mesg $file`" ]; then awk ''$1 == "mesg" { $2 = "n" } { print }'' $file > $file.CIS mv $file.CIS $file else echo mesg n >> $file fi done' + compliance: + - cis: ["7.5"] + condition: all + rules: + - 'f:/etc/.login -> r:^mesg\s*\t*n' + - 'f:/etc/profile -> r:^mesg\s*\t*n' + + # 8 Warning Banners + - id: 8041 + title: "Create Warnings for Standard Login Services" + description: "The contents of the /etc/issue file are displayed prior to the login prompt on the system's console and serial devices and also prior to logins via telnet and Secure Shell. The contents of the /etc/motd file are generally displayed after all successful logins, regardless from where the user is logging in." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. As implementing a logon banner to deter inappropriate use and can provide a foundation for legal action against abuse, this warning content should be set as appropriate. Consult with your organization's legal counsel for the appropriate wording as the examples below are for demonstration purposes only." + remediation: 'Perform the following to implement the recommended state: # echo "Authorized users only. All activity may be monitored and reported." > /etc/motd # echo "Authorized users only. All activity may be monitored and reported." > /etc/issue # chown root:root /etc/issue # chmod 644 /etc/issue' + compliance: + - cis: ["8.1"] + condition: all + rules: + - "f:/etc/issue -> r:Authorized users only. All activity may be monitored and reported" + - "f:/etc/motd -> r:Authorized users only. All activity may be monitored and reported" + - "c:stat -L -c%u-%g-%a /etc/issue -> r:^0-0-644" + + - id: 8042 + title: "Enable a Warning Banner for the SSH Service" + description: "The contents of the Banner string in the /etc/ssh/sshd_config file are sent to the remote user before authentication is allowed, requiring that the user read the legal caution." + remediation: 'Perform the following to implement the recommended state: # awk ''/^#Banner/ { $1 = "Banner" } { print }'' /etc/ssh/sshd_config > /etc/ssh/sshd_config.CIS # mv /etc/ssh/sshd_config.CIS /etc/ssh/sshd_config # svcadm restart svc:/network/ssh' + compliance: + - cis: ["8.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Banner\s*/etc/issue' + + - id: 8043 + title: "Enable a Warning Banner for the GNOME Service" + description: "The GNOME Display Manager is used for login session management. See the manual page gdm(1) for more information on configuration of the settings, which can be user- or group specific." + rationale: "The remediation action for this item sets a pre-login warning message for GDM users. Additional methods can be employed to display a similar message to a user post- authentication. For more information, see the Oracle Solaris 11 Security Guidelines document." + remediation: 'Perform the following to implement the recommended state: Edit the /etc/gdm/Init/Default file to add the following content before the last line of the file. /usr/bin/zenity --text-info --width=800 --height=300 --title="Security Message" --filename=/etc/issue' + compliance: + - cis: ["8.3"] + condition: all + rules: + - "f:/etc/gdm/Init/Default" + - 'f:/etc/gdm/Init/Default -> r:^/usr/bin/zenity\s\.' + + - id: 8044 + title: "Enable a Warning Banner for the FTP service" + description: "The action for this item sets a warning message for FTP users before they log in." + rationale: "Warning Banners inform users who are attempting to access the system of their legal status regarding using the system. The text below is a generic sample only, so consult with your organization's legal counsel for the appropriate wording." + remediation: 'Perform the following to implement the recommended state: # echo "DisplayConnect /etc/issue" >> /etc/proftpd.conf # svcadm restart ftp' + compliance: + - cis: ["8.4"] + condition: all + rules: + - 'f:/etc/proftpd.conf -> !r:^# && r:DisplayConnect\s*\t*/etc/issue' + + - id: 8045 + title: "Check that the Banner Setting for telnet is Null" + description: "The BANNER variable in the file /etc/default/telnetd can be used to display text before the telnet login prompt. Traditionally, it has been used to display the OS level of the target system." + rationale: "The warning banner provides information that can be used in reconnaissance for an attack. By default, this file is distributed with the BANNER variable set to null. It is not necessary to create a separate warning banner for telnet if a warning is set in the /etc/issue file. As telnet is an insecure protocol, it is strongly recommend that it be disabled and all remote administrative/user connections take place by Secure Shell." + remediation: 'Perform the following to implement the recommended state: # cd /etc/default # awk ''/^BANNER=/ { $1 = "BANNER=" }; { print }'' telnetd > telnetd.CIS # mv telnetd.CIS telnetd' + compliance: + - cis: ["8.5"] + condition: none + rules: + - 'f:/etc/default/telnetd -> !r:^# && r:BANNER\s*\t*=\s*\t*\.' + + # 9 System Maintenance + - id: 8046 + title: "Verify System Account Default Passwords" + description: "There are a number of accounts provided with the Solaris OS that are used to manage applications and are not intended to provide an interactive shell. These accounts are delivered either in a locked or non-login state. Oracle does not support nor recommend changing the passwords associated with these accounts." + rationale: "System accounts, such as bin, lpd, and sys have special purposes and privileges. By default, these accounts are configured as either locked or non-login. This status should be verified to ensure that these accounts have not accidentally or intentionally been enabled." + remediation: "To lock a single account, use the command: # passwd -d [username] # passwd -l [username] To configure a single account to be non-login, use the command: # passwd -d [username] # passwd -N [username]" + compliance: + - cis: ["9.3"] + condition: none + rules: + - "f:/etc/shadow -> r:^daemon: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^lp: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^adm: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^bin: && !r::NL:|:NP:" + - 'f:/etc/shadow -> r:^gdm: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^noaccess: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^nobody: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^nobody4: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^openldap: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^unknown: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^webservd: && !r::\p*LK\p*:' + - "f:/etc/shadow -> r:^mysql: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^nuuc: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^postgres: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^smmsp: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^sys: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^uucp: && !r::NL:|:NP:" + - 'f:/etc/shadow -> r:^aiuser: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^dhcpserv: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^dladm: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^ftp: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^netadm: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^netcfg: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^pkg5srv: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^svctag: && !r::\p*LK\p*:' + - 'f:/etc/shadow -> r:^xvm: && !r::\p*LK\p*:' + - "f:/etc/shadow -> r:^upnp: && !r::NL:|:NP:" + - "f:/etc/shadow -> r:^zfssnap: && !r::NL:|:NP:" + + - id: 8047 + title: "Ensure Password Fields are Not Empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password at all (assuming that the value PASSREQ=NO is set in /etc/default/login)." + rationale: 'All accounts must have passwords, be configured as "Non-login," or be locked.' + remediation: "Use the passwd -l command to lock accounts that are not permitted to execute commands . Use the passwd -N command to set accounts to be non-logini." + compliance: + - cis: ["9.4"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + - id: 8048 + title: "Verify No UID 0 Accounts Exist Other than root" + description: "Any account with UID 0 has superuser rights on the system." + rationale: "This access must be limited to only the default root role and be made accessible from the system console only. Administrative access granted to an unprivileged account should use an approved mechanism such as RBAC." + remediation: "Disable or delete any other 0 UID entries that are displayed; there should be only one root account. Finer granularity access control for administrative access can be obtained by using the Solaris Role-Based Access Control (RBAC) mechanism. RBAC configurations should be monitored via user_attr(4) to make sure that privileges are managed appropriately." + compliance: + - cis: ["9.5"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^\s*\t*root: && r:^\w+:\w+:0:' + + - id: 8049 + title: "Ensure root PATH Integrity" + description: "The root user can execute any command on the system and could be tricked into executing programs if the PATH is not set correctly." + rationale: "Including the current working directory (.) or any other writable directory in root's executable path makes it likely that an attacker can gain superuser access by forcing an administrator operating as root to execute a malcode, such as a Trojan horse program." + remediation: "Correct or justify any items discovered in the Audit step." + compliance: + - cis: ["9.6"] + condition: none + rules: + - "f:/etc/profile -> r::." + - "f:/root/.profile -> r::." + - "f:/root/.bashrc -> r::." + - "f:/etc/profile -> r:::" + - "f:/root/.profile -> r:::" + - "f:/root/.bashrc -> r:::" + - "f:/etc/profile -> r::$" + - "f:/root/.profile -> r::$" + - "f:/root/.bashrc -> r::$" + + - id: 8050 + title: "Check That Users Are Assigned Home Directories" + description: "passwd(4) defines a home directory that each user is placed in upon login. If there is no defined home directory, a user will be placed in / and will not be able to write any files or have local environment variables set." + rationale: "All users must be assigned a home directory in passwd(4)." + remediation: "Correct or justify any items discovered in the Audit step. Determine if there exists any users who are in passwd(4) but do not have a home directory, and work with those users to determine the best course of action in accordance with site policy." + compliance: + - cis: ["9.12"] + condition: none + rules: + - 'f:/etc/passwd -> r:\w+:\.*:\d*:\d*:\.*::\.*' diff --git a/etc/ruleset/sca/ubuntu/cis_ubuntu14_04.yml b/etc/ruleset/sca/ubuntu/cis_ubuntu14_04.yml new file mode 100644 index 0000000000..04a604af87 --- /dev/null +++ b/etc/ruleset/sca/ubuntu/cis_ubuntu14_04.yml @@ -0,0 +1,3046 @@ +# Security Configuration Assessment +# CIS Checks for Ubuntu Linux 14.04 LTS +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Ubuntu Linux 14.04 LTS Benchmark v2.1.0 - 12-28-2017 + +policy: + id: "cis_ubuntu14-04" + file: "cis_ubuntu14_04.yml" + name: "CIS Ubuntu Linux 14.04 LTS Benchmark v2.1.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Ubuntu Linux 14.04 LTS." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Ubuntu version" + description: "Requirements for running the SCA scan against Ubuntu." + condition: all + rules: + - "f:/etc/os-release -> r:Ubuntu" + - "f:/proc/sys/kernel/ostype -> Linux" + +checks: + # 1.1.1 Disable unused filesystems + - id: 19500 + title: "Ensure mounting of cramfs filesystems is disabled" + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install cramfs /bin/true. 2) Run the following command to unload the cramfs module: # rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:^install /bin/true" + - "not c:lsmod -> r:cramfs" + + - id: 19501 + title: "Ensure mounting of freevxfs filesystems is disabled" + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/freevxfs.conf and add the following line: install freevxfs /bin/true Run the following command to unload the freevxfs module: # rmmod freevxfs" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v freevxfs -> r:^install /bin/true" + - "not c:lsmod -> r:freevxfs" + + - id: 19502 + title: "Ensure mounting of jffs2 filesystems is disabled" + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/jffs2.conf and add the following line: install jffs2 /bin/true Run the following command to unload the jffs2 module: # rmmod jffs2" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v jffs2 -> r:^install /bin/true" + - "not c:lsmod -> r:jffs2" + + - id: 19503 + title: "Ensure mounting of hfs filesystems is disabled" + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/hfs.conf and add the following line: install hfs /bin/true Run the following command to unload the hfs module: # rmmod hfs" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v hfs -> r:^install /bin/true" + - "not c:lsmod -> r:hfs" + + - id: 19504 + title: "Ensure mounting of hfsplus filesystems is disabled" + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .confExample: vim /etc/modprobe.d/hfsplus.conf and add the following line: install hfsplus /bin/true Run the following command to unload the hfsplus module: # rmmod hfsplus" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v hfsplus -> r:^install /bin/true" + - "not c:lsmod -> r:hfsplus" + + - id: 19505 + title: "Ensure mounting of udf filesystems is disabled" + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/udf.conf and add the following line: install udf /bin/true Run the following command to unload the udf module: # rmmod udf" + compliance: + - cis: ["1.1.1.6"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v udf -> r:^install /bin/true" + - "not c:lsmod -> r:udf" + + # 1.1.2 Filesystem Configuration + - id: 19506 + title: "Ensure separate partition exists for /tmp" + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + - id: 19507 + title: "Ensure nodev option set on /tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodevto the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + - id: 19508 + title: "Ensure nosuid option set on /tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + - id: 19509 + title: "Ensure separate partition exists for /var" + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + - id: 19510 + title: "Ensure separate partition exists for /var/tmp" + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + - id: 19511 + title: "Ensure nodev option set on /var/tmp partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,nodev /var/tmp" + compliance: + - cis: ["1.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + + - id: 19512 + title: "Ensure nosuid option set on /var/tmp partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" + compliance: + - cis: ["1.1.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + - id: 19513 + title: "Ensure noexec option set on /var/tmp partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" + compliance: + - cis: ["1.1.9"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + - id: 19514 + title: "Ensure separate partition exists for /var/log" + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.10"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + - id: 19515 + title: "Ensure separate partition exists for /var/log/audit" + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + - id: 19516 + title: "Ensure separate partition exists for /home" + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + - id: 19517 + title: "Ensure nodev option set on /home partition" + description: "When set on a file system, this option prevents character and block special devices from being defined, or if they exist, from being used as character and block special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. See the fstab(5) manual page for more information. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + - id: 19518 + title: "Ensure nodev option set on /run/shm partition" + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /run/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /run/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /run/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /run/shm: # mount -o remount,nodev /run/shm" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/run/shm\s && r:nodev' + + - id: 19519 + title: "Ensure nosuid option set on /run/shm partition" + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /run/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /run/shm: # mount -o remount,nosuid /run/shm" + compliance: + - cis: ["1.1.15"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/run/shm\s && r:nosuid' + + - id: 19520 + title: "Ensure noexec option set on /run/shm partition" + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /run/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /run/shm: # mount -o remount,noexec /run/shm" + compliance: + - cis: ["1.1.16"] + - cis_csc: ["2.6", "8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/run/shm\s && r:noexec' + + - id: 19521 + title: "Disable Automounting" + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." + remediation: "Remove or comment out start lines in /etc/init/autofs.conf: # start on runlevel [2345]" + compliance: + - cis: ["1.1.21"] + - cis_csc: ["8.4", "8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:initctl show-config autofs -> r:^autofs" + + # 1.3 Filesystem Integrity Checking + - id: 19522 + title: "Ensure AIDE is installed" + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # apt-get install aide aide-common. Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: # aideinit" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + reference: + - "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: all + rules: + - "c:dpkg -s aide -> r:install ok installed" + + - id: 19523 + title: "Ensure filesystem integrity is regularly checked" + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/bin/aide.wrapper --config /etc/aide/aide.conf --check" + compliance: + - cis: ["1.3.2"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:grep -Rh aide /etc/cron.d /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly /etc/crontab -> r:\.+' + - "c:crontab -u root -l -> !r:^# && r:/usr/bin/aide && r:--check" + + # 1.4 Secure Boot Settings + - id: 19524 + title: "Ensure permissions on bootloader config are configured" + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually grub.cfg stored in /boot/grub." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: chown root:root /boot/grub/grub.cfg, chmod og-rwx /boot/grub/grub.cfg" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub/grub.cfg -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 19525 + title: "Ensure bootloader password is set" + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: 'Create an encrypted password with grub-mkpasswd-pbkdf2: # grub-mkpasswd-pbkdf2 Add the following into /etc/grub.d/00_header or a custom /etc/grub.d configuration file: cat < EOF Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["1.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + - id: 19526 + title: "Ensure authentication required for single user mode" + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" + compliance: + - cis: ["1.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/shadow -> r:^root:*:|^root:!:" + + # 1.5 Additional Process Hardening + - id: 19527 + title: "Ensure core dumps are restricted" + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl fs.suid_dumpable -> r:=\s*\t*0$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> !r:^# && r:=\s*\t*0$' + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + + - id: 19528 + title: "Ensure XD/NX support is enabled" + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.5.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:dmesg -> r:NX \(Execute Disable\) protection: active' + + - id: 19529 + title: "Ensure address space layout randomization (ASLR) is enabled" + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:\s*\t*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' + + - id: 19530 + title: "Ensure prelink is disabled" + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal and uninstall prelink: prelink -ua && yum remove prelink" + compliance: + - cis: ["1.5.4"] + - cis_csc: ["14.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s prelink -> r:install ok installed" + + # 1.6 Configure SELinux + - id: 19531 + title: "Ensure SELinux is not disabled in bootloader configuration" + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/gruband remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX="" Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["1.6.1.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && r:selinux=0' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && r:enforcing=0' + + - id: 19532 + title: "Ensure the SELinux state is enforcing" + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing " + compliance: + - cis: ["1.6.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s*enabled$' + - 'c:sestatus -> r:^Current mode:\s*enforcing$' + - 'c:sestatus -> r:^Mode from config file:\s*enforcing$' + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + - id: 19533 + title: "Ensure SELinux policy is configured" + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=ubuntu" + compliance: + - cis: ["1.6.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+ubuntu|^Loaded policy name:\s+default|^Loaded policy name:\s+mls' + - 'f:/etc/selinux/config -> r:^Loaded policy name:\s+ubuntu|^\s*SELINUXTYPE\s*=\s*default|^\s*SELINUXTYPE\s*=\s*mls' + + - id: 19534 + title: "Ensure no unconfined daemons exist" + description: "Daemons that are not defined in SELinux policy will inherit the security context of their parent process." + rationale: "Since daemons are launched and descend from the init process, they will inherit the security context label initrc_t . This could cause the unintended consequence of giving the process more permission than it requires." + remediation: "Investigate any unconfined daemons found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:ps -eZ -> r:initrc && !r:tr|ps|egrep|bash|awk" + + - id: 19535 + title: "Ensure AppArmor is not disabled in bootloader configuration" + description: "Configure AppArmor to be enabled at boot time and verify that it has not been overwrittenby the bootloader boot parameters." + rationale: "AppArmor must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/grub and remove all instances of apparmor=0 from all CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX=""Run the following command to pdate the grub2 configuration: # update-grub' + compliance: + - cis: ["1.6.2.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && r:apparmor=0' + + - id: 19536 + title: "Ensure all AppArmor Profiles are enforcing" + description: "AppArmor profiles define what resources applicatons are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.6.2.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:apparmor status -> r:0 profiles are in complain mode" + - "c:apparmor status -> r:0 processes are unconfined" + - 'c:apparmor status -> n:(\d+) profiles are loaded compare > 0' + + - id: 19537 + title: "Ensure SELinux or AppArmor are installed" + description: "SELinux and AppArmor provide Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run one of the following commands to install SELinux or apparmor: # apt-get install selinux Or: # apt-get install apparmor" + compliance: + - cis: ["1.6.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - "c:dpkg -s selinux-basics -> r:install ok installed" + - "c:dpkg -s apparmor -> r:install ok installed" + + # 1.7 Warning Banners + - id: 19538 + title: "Ensure message of the day is configured properly" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v." + compliance: + - cis: ["1.7.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + + - id: 19539 + title: "Ensure local login warning banner is configured properly" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.7.1.2"] + - cis_csc: ["5.1"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + + - id: 19540 + title: "Ensure remote login warning banner is configured properly" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.7.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + + - id: 19541 + title: "Ensure permissions on /etc/motd are configured" + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 19542 + title: "Ensure permissions on /etc/issue are configured" + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 19543 + title: "Ensure permissions on /etc/issue.net are configured" + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 19544 + title: "Ensure GDM login banner is configured" + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Create the /etc/dconf/profile/gdm file with the following contents: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Create or edit the banner-message-enable and banner-message-text options in /etc/dconf/db/gdm.d/01-banner-message: [org/gnome/login-screen] banner-message-enable=true banner-message-text='Authorized uses only. All activity may be monitored and reported.' Run the following command to update the system databases: # dconf update" + compliance: + - cis: ["1.7.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm -> r:^user-db:user" + - "f:/etc/dconf/profile/gdm -> r:^system-db:gdm" + - "f:/etc/dconf/profile/gdm -> r:^file-db:/usr/share/gdm/greeter-dconf-defaults" + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:^[org/gnome/login-screen]' + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:^banner-message-enable=true' + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:^banner-message-text=\.+' + + - id: 19545 + title: "Ensure updates, patches, and additional security software are installed" + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. Notes: Site policy may mandate a testing period before install onto production systems for available updates." + compliance: + - cis: ["1.8"] + - cis_csc: ["3.4", "3.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6", "SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: none + rules: + - "c:apt-get -s upgrade -> r:^The following packages will be upgraded" + + # 2 Services + + - id: 19546 + title: "Ensure chargen services are not enabled" + description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Comment out or remove any lines starting with chargen from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all chargen services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^chargen" + - 'd:/etc/inetd.d -> r:\. -> r:^chargen' + + - id: 19547 + title: "Ensure daytime services are not enabled" + description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Comment out or remove any lines starting with daytime from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all daytime services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^daytime" + - 'd:/etc/inetd.d/ -> r:\. -> r:^daytime' + + - id: 19548 + title: "Ensure discard services are not enabled" + description: "discard is a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Comment out or remove any lines starting with discard from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all discard services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^discard" + - 'd:/etc/inetd.d/ -> r:\. -> r:^discard' + + - id: 19549 + title: "Ensure echo services are not enabled" + description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Comment out or remove any lines starting with echo from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all echo services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^echo" + - 'd:/etc/inetd.d/ -> r:\. -> r:^echo' + + - id: 19550 + title: "Ensure time services are not enabled" + description: "time is a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled" + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Comment out or remove any lines starting with time from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all time services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^time" + - 'd:/etc/inetd.d/ -> r:\. -> r:^time' + + - id: 19551 + title: "Ensure rsh server is not enabled" + description: "The Berkeley rsh-server (rsh, rlogin, rexec) package contains legacy services that exchange credentials in clear-text." + rationale: "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package" + remediation: "Comment out or remove any lines starting with shell, login or exec from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all shell, login or exec services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^shell" + - 'd:/etc/inetd.d/ -> r:\. -> r:^shell' + - "f:/etc/inetd.conf -> r:^login" + - 'd:/etc/inetd.d/ -> r:\. -> r:^login' + - "f:/etc/inetd.conf -> r:^exec" + - 'd:/etc/inetd.d/ -> r:\. -> r:^exec' + + - id: 19552 + title: "Ensure talk server is not enabled" + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Comment out or remove any lines starting with talk or ntalk from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all talk or ntalk services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^talk" + - 'd:/etc/inetd.d/ -> r:\. -> r:^talk' + - "f:/etc/inetd.conf -> r:^ntalk" + - 'd:/etc/inetd.d/ -> r:\. -> r:^ntalk' + + - id: 19553 + title: "Ensure telnet server is not enabled" + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecureand unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Comment out or remove any lines starting with telnet from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all telnet services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^telnet" + - 'd:/etc/inetd.d/ -> r:\. -> r:^telnet' + + - id: 19554 + title: "Ensure tftp server is not enabled" + description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The packages tftpd and atftp are both used to define and support a TFTP server." + rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specificneed for TFTP. In that case, extreme caution must be used when configuring the services." + remediation: "Comment out or remove any lines starting with tftp from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all tftp services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^tftp" + - 'd:/etc/inetd.d/ -> r:\. -> r:^tftp' + + - id: 19555 + title: "Ensure xinetd is not enabled" + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetddaemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed." + remediation: "Remove or comment out start lines in /etc/init/xinetd.conf: # start on runlevel [2345]" + compliance: + - cis: ["2.1.10"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:initctl show-config xinetd -> r:^xinetd" + + - id: 19556 + title: "Ensure openbsd-inetd is not installed" + description: "The inetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no inetd services required, it is recommended that the daemon be removed." + remediation: "Run the following command to uninstall openbsd-inetd: apt-get remove openbsd-inetd" + compliance: + - cis: ["2.1.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s openbsd-inetd -> r:install ok installed" + + - id: 19557 + title: "Ensure time synchronization is in use" + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems or virtual systems where host based time synchronization is not available install NTP or chrony using one of the following commands: # apt-get install ntp # apt-get install chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization." + compliance: + - cis: ["2.2.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "c:dpkg -s ntp -> r:install ok installed" + - "c:dpkg -s chrony -> r:install ok installed" + + - id: 19558 + title: "Ensure ntp is configured" + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file: RUNASUSER=ntp" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://www.ntp.org/ + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/init.d/ntp -> r:^RUNASUSER\s*\t*=\s*\t*ntp' + + - id: 19559 + title: "Ensure chrony is configured" + description: "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system." + remediation: "Add or edit server or pool lines to /etc/chrony/chrony.conf as appropriate: server " + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\.+|^pool\.+' + + # 2.2.2 Ensure the X Window system is not installed (Scored) + - id: 19560 + title: "Ensure the X Window system is not installed" + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: apt-get remove xserver-xorg*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:dpkg -l xserver-xorg-core* -> r:^\wi\s*xserver-xorg' + + - id: 19561 + title: "Ensure Avahi Server is not enabled" + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attach surface." + remediation: "Remove or comment out start lines in /etc/init/avahi-daemon.conf: #start on runlevel [2345]" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:initctl show-config avahi-daemon -> r:^avahi-daemon" + + - id: 19562 + title: "Ensure CUPS is not enabled" + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Remove or comment out start lines in /etc/init/cups.conf: #start on runlevel [2345]" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.cups.org + condition: all + rules: + - "c:initctl show-config cups -> r:^cups" + + - id: 19563 + title: "Ensure DHCP Server is not enabled" + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be deleted to reduce the potential attack surface." + remediation: "Remove or comment out start lines in /etc/init/isc-dhcp-server.conf and /etc/init/isc-dhcp-server6.conf: #start on runlevel [2345]" + references: + - https://www.isc.org/dhcp/ + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:initctl show-config isc-dhcp-server -> r:^isc-dhcp-server" + - "c:initctl show-config isc-dhcp-server6 -> r:^isc-dhcp-server6" + + - id: 19564 + title: "Ensure LDAP server is not enabled" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # update-rc.d slapd disable" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.openldap.org + condition: all + rules: + - 'c:ls /etc/rc*.d/S*slapd -> !r:\.+|No such file or directory' + + - id: 19565 + title: "Ensure NFS and RPC are not enabled" + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Remove or comment out start lines in /etc/init/rpcbind.conf: # start on start-rpcbind Run the following command to disable nfs-kernel-server: # update-rc.d nfs-kernel-server disable" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:ls /etc/rc*.d/S*nfs-kernel-serverr -> !r:\.+|No such file or directory' + - "c:initctl show-config rpcbind -> r:^rpcbind" + + - id: 19566 + title: "Ensure DNS Server is not enabled" + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable bind9: # update-rc.d bind9 disable" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c: ls /etc/rc*.d/S*bind9 -> !r:\.+|No such file or directory' + + - id: 19567 + title: "Ensure FTP Server is not enabled" + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Remove or comment out start lines in /etc/init/vsftpd.conf: # start on runlevel [2345] or net-device-up IFACE!=lo" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:initctl show-config vsftpd -> r:^vsftpd" + + - id: 19568 + title: "Ensure HTTP Server is not enabled" + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable apache2: # update-rc.d apache2 disable" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:ls /etc/rc*.d/S*apache2 -> !r:\.+|No such file or directory' + + - id: 19569 + title: "Ensure IMAP and POP3 server is not enabled" + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be deleted to reduce the potential attack surface." + remediation: "Remove or comment out start lines in /etc/init/dovecot.conf: # start on runlevel [2345]" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:initctl show-config dovecot -> r:^dovecot" + + - id: 19570 + title: "Ensure Samba is not enabled" + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." + remediation: "Remove or comment out start lines in /etc/init/smbd.conf: # start on (local-filesystems and net-device-up)" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:initctl show-config smbd -> r:^smbd" + + - id: 19571 + title: "Ensure HTTP Proxy Server is not enabled" + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Remove or comment out start lines in /etc/init/squid3.conf: # start on runlevel [2345]" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:initctl show-config squid3 -> r:^squid3" + + - id: 19572 + title: "Ensure SNMP Server is not enabled" + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # update-rc.d snmpd disable" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:ls /etc/rc*.d/S*snmpd -> !r:\.+|No such file or directory' + + - id: 19573 + title: "Ensure mail transfer agent is configured for local-only mode" + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only . Restart postfix: # service postfix restart" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - tsc: ["CC5.2", "CC6.4", "CC6.6", "CC6.7"] + condition: none + rules: + - 'c:netstat -an -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.*LISTEN' + + - id: 19574 + title: "Ensure rsync service is not enabled" + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Edit the /etc/default/rsync file and set RSYNC_ENABLE to false :RSYNC_ENABLE=false" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: all + rules: + - "f:/etc/default/rsync -> r:^RSYNC_ENABLE=false" + + - id: 19575 + title: "Ensure NIS Server is not enabled" + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Remove or comment out start lines in /etc/init/ypserv.conf: #start on (started portmap ON_BOOT= #or (started portmap ON_BOOT=y #and ((filesystem and static-network-up) or failsafe-boot)))" + compliance: + - cis: ["2.2.17"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:initctl show-config ypserv -> r:^ypserv" + + - id: 19576 + title: "Ensure NIS Client is not installed" + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Uninstall the nis package: # apt-get remove nis" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s nis -> r:install ok installed" + + - id: 19577 + title: "Ensure rsh client is not installed" + description: "The rshpackage contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rshpackage removes the clients for rsh, rcpand rlogin." + remediation: "Run the following command to uninstall rsh: apt-get remove rsh-client rsh-redone-client" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["2.6", "4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s rsh-client -> r:install ok installed" + - "c:dpkg -s rsh-redone-client -> r:install ok installed" + + - id: 19578 + title: "Ensure talk client is not installed" + description: "The talksoftware makes it possible for users to send and receive messages across systems through a terminal session. The talkclient, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk: apt-get remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s talk -> r:install ok installed" + + - id: 19579 + title: "Ensure telnet client is not installed" + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet: # apt-get remove telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["2.6", "4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s telnet -> r:install ok installed" + + - id: 19580 + title: "Ensure LDAP client is not installed" + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients : # apt-get remove ldap-utils" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s ldap-utils -> r:install ok installed" + + ############################ + # 3 Network Configuration # + ############################ + + - id: 19581 + title: "Ensure IP forwarding is disabled" + description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." + rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # s # sysctl -w net.ipv4.route.flush=1 " + compliance: + - cis: ["3.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + + - id: 19582 + title: "Ensure packet redirect sending is disabled" + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the net.ipv4.conf.all.send_redirects and net.ipv4.conf.default.send_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.send_redirects=0 net.ipv4.conf.default.send_redirects=0 Modify active kernel parameters to match: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + - id: 19583 + title: "Ensure source routed packets are not accepted" + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 . Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1 " + compliance: + - cis: ["3.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + + - id: 19584 + title: "Ensure ICMP redirects are not accepted" + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 . Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1 " + compliance: + - cis: ["3.2.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + + - id: 19585 + title: "Ensure secure ICMP redirects are not accepted" + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + - id: 19586 + title: "Ensure suspicious packets are logged" + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + - id: 19587 + title: "Ensure broadcast ICMP requests are ignored" + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + - id: 19588 + title: "Ensure bogus ICMP responses are ignored" + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + - id: 19589 + title: "Ensure Reverse Path Filtering is enabled" + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing. + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + - id: 19590 + title: "Ensure TCP SYN Cookies is enabled" + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + - id: 19591 + title: "Ensure IPv6 router advertisements are not accepted" + description: "This setting disables the systems ability to accept router advertisements" + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + + - id: 19592 + title: "Ensure IPv6 redirects are not accepted" + description: "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic." + rationale: "It is recommended that systems not accept ICMP redirets as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + + - id: 19593 + title: "Ensure IPv6 is disabled" + description: "Although IPv6 has many advantages over IPv4, few organizations have implemented IPv6." + rationale: "If IPv6 is not to be used, it is recommended that it be disabled to reduce the attack surface of the system." + remediation: 'Edit /etc/default/grub and add ''``ipv6.disable=1'' to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX="ipv6.disable=1" Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["3.3.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*linux && !r:ipv6.disable=1' + + - id: 19594 + title: "Install TCP Wrappers" + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Install tcpd : # apt-get install tcpd To verify if a service supports TCP Wrappers, run the following command: # ldd | grep libwrap.so If there is any output, then the service supports TCP Wrappers." + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "c:dpkg -s tcpd -> r:install ok installed" + + - id: 19595 + title: "Ensure /etc/hosts.allow is configured" + description: "The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." + remediation: 'Run the following command to create /etc/hosts.allow: # echo "ALL: /, /, ..." >/etc/hosts.allow. Where each / combination (for example, "192.168.1.0/255.255.255.0") represents one network block in use by your organization that requires access to this system.' + compliance: + - cis: ["3.4.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "f:/etc/hosts.allow" + + - id: 19596 + title: "Ensure /etc/hosts.deny is configured" + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the server." + remediation: 'Run the following command to create /etc/hosts.deny: # echo "ALL: ALL" >> /etc/hosts.deny' + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "f:/etc/hosts.deny" + - 'f:/etc/hosts.deny -> r:^ALL:\s*ALL' + + - id: 19597 + title: "Verify permissions on /etc/hosts.allow" + description: "The /etc/hosts.allow file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.allow : # chown root:root /etc/hosts.allow # chmod 644 /etc/hosts.allow" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/hosts.allow -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + + - id: 19598 + title: "Verify permissions on /etc/hosts.deny" + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.deny : # chown root:root /etc/hosts.deny # chmod 644 /etc/hosts.deny" + compliance: + - cis: ["3.4.5"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/hosts.deny -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + + - id: 19599 + title: "Ensure DCCP is disabled" + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in- sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.5.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v dccp -> r:install /bin/true" + - "c:lsmod -> r:dccp" + + - id: 19600 + title: "Ensure SCTP is disabled" + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.5.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v sctp -> r:install /bin/true" + - "c:lsmod -> r:sctp" + + - id: 19601 + title: "Ensure RDS is disabled" + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.5.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v rds -> r:install /bin/true" + - "c:lsmod -> r:rds" + + - id: 19602 + title: "Ensure TIPC is disabled" + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.5.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v tipc -> r:install /bin/true" + - "c:lsmod -> r:tipc" + + # 3.5 Firewall configuration + + - id: 19603 + title: "Ensure default deny firewall policy" + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + compliance: + - cis: ["3.6.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:iptables -L -> r:^Chain INPUT && r:policy DROP" + - "c:iptables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:iptables -L -> r:^Chain OUTPUT && r:policy DROP" + + - id: 19604 + title: "Ensure loopback traffic is configured" + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.6.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + ######################################### + # 4 Logging and Auditing + ######################################### + + - id: 19605 + title: "Ensure audit log storage size is configured" + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = Notes: The max_log_file parameter is measured in megabytes." + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.4"] + condition: all + rules: + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' + + - id: 19606 + title: "Ensure system is disabled when audit logs are full" + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.4"] + condition: all + rules: + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*\t*=\s*\t*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*\t*=\s*\t*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*\t*=\s*\t*halt' + + - id: 19607 + title: "Ensure audit logs are not automatically deleted" + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.4"] + condition: all + rules: + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' + + - id: 19608 + title: "Ensure auditd service is enabled" + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # update-rc.d auditd enable" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1", "10.7"] + - tsc: [CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:ls /etc/rc*.d/S*auditd -> r:/etc/rc2.d/S37auditd && r:/etc/rc3.d/S37auditd && r:/etc/rc4.d/S37auditd && r:/etc/rc5.d/S37auditd" + + - id: 19609 + title: "Ensure auditing for processes that start prior to auditd is enabled" + description: "Configure grub or lilo so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: '1) Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX="audit=1" 2) Run the following command to update the grub2 configuration: # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings.' + compliance: + - cis: ["4.1.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.2.6", "10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:audit=1' + + - id: 19610 + title: "Ensure events that modify date and time information are collected" + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier "time-change"' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time- change | -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change. For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change | -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change | -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.3", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change" + + - id: 19611 + title: "Ensure events that modify user/group information are collected" + description: 'Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/group -p wa -k identity | -w /etc/passwd -p wa -k identity | -w /etc/gshadow -p wa -k identity | -w /etc/shadow -p wa -k identity | -w /etc/security/opasswd -p wa -k identity Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.5"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/group && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity" + + - id: 19612 + title: "Ensure events that modify the system's network environment are collected" + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre- login), /etc/hosts (file containing host names and associated IP addresses) and /etc/sysconfig/network (directory containing network interface scripts and configurations) files." + rationale: 'Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier "system-locale."' + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale | -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale | -w /etc/issue -p wa -k system-locale | -w /etc/issue.net -p wa -k system-locale | -w /etc/hosts -p wa -k system-locale | -w /etc/sysconfig/network -p wa -k system-locale Notes: /etc/sysconfig/network is common to Red Hat and SUSE based distributions. You should expand or replace this coverage to any network configuration files on your system such as /etc/network on Debian based distributions. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.6"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale" + + - id: 19613 + title: "Ensure events that modify the system's Mandatory Access Controls are collected" + description: "Monitor SELinux/AppArmor mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux or /etc/apparmor and /etc/apparmor.d directories." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "On systems using SELinux add the following line to the /etc/audit/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy | -w /usr/share/selinux/ -p wa -k MAC-policy On systems using AppArmor add the following line to the /etc/audit/audit.rules file: -w /etc/apparmor/ -p wa -k MAC-policy | -w /etc/apparmor.d/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/selinux/|/etc/apparmor/ && r:-p wa && r:-k MAC-policy" + - "f:/etc/audit/audit.rules -> r:^-w && r:/usr/share/selinux/|/etc/apparmor.d/ && r:-p wa && r:-k MAC-policy" + + - id: 19614 + title: "Ensure login and logout events are collected" + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/faillog -p wa -k logins | -w /var/log/lastlog -p wa -k logins | -w /var/log/tallylog -p wa -k logins. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.8"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/faillog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/tallylog && r:-p wa && r:-k logins" + + - id: 19615 + title: "Ensure session initiation information is collected" + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier "session." The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier "logins."' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/run/utmp -p wa -k session | -w /var/log/wtmp -p wa -k logins | -w /var/log/btmp -p wa -k logins. Notes: The last command can be used to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.9"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k logins" + + - id: 19616 + title: "Ensure discretionary access control permission modification events are collected" + description: 'Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier "perm_mod."' + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.10"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + + - id: 19617 + title: "Ensure unsuccessful unauthorized file access attempts are collected" + description: 'Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier "access."' + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.11"] + - cis_csc: ["14.9"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access" + + - id: 19618 + title: "Ensure successful file system mounts are collected" + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts | -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts" + + - id: 19619 + title: "Ensure file deletion events by users are collected" + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete | -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.14"] + - cis_csc: ["6,2", "13"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete" + + - id: 19620 + title: "Ensure changes to system administration scope (sudoers) is collected" + description: 'Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier "scope."' + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope | -w /etc/sudoers.d/ -p wa -k scope. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.15"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers.d/ && r:-p wa && r:-k scope" + + - id: 19621 + title: "Ensure system administrator actions (sudolog) are collected" + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions. Notes: The system must be configured with sudisabled (See Item 5.6 Ensure access to the su command is restricted) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.16"] + - cis_csc: ["4.9"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14", "AC.6", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/sudo.log && r:-p wa && r:-k actions" + + - id: 19622 + title: "Ensure kernel module loading and unloading is collected" + description: 'Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of "modules".' + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b64 -S init_module -S delete_module -k modules. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.17"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "f:/etc/audit/audit.rules -> r:^-w && r:/sbin/insmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/sbin/rmmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/sbin/modprobe && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32|-F arch=b64 && r:-S init_module && r:-S delete_module && r:-k modules" + + - id: 19623 + title: "Ensure the audit configuration is immutable" + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following line to the end of the /etc/audit/audit.rules file: -e 2. Notes: This setting will ensure reloading the auditd config to set active settings requires a system reboot." + compliance: + - cis: ["4.1.18"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.5"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2"] + condition: all + rules: + - "c:tail -1 /etc/audit/audit.rules -> -e 2" + + - id: 19624 + title: "Ensure rsyslog Service is enabled" + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system will not have a syslog service running." + remediation: "Set the proper start conditions in /etc/init/rsyslog.conf: start on filesystem" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "c:initctl show-config rsyslog -> r:^rsyslog" + - "c:initctl show-config rsyslog -> r:start on filesystem" + + # 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 19625 + title: "Ensure rsyslog default file permissions configured" + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1", "10.5.2"] + - nist_800_53: ["CM.1", "AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\. -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + - id: 19626 + title: "Ensure rsyslog is configured to send logs to a remote log host" + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host): *.* @@loghost.example.com. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - rsyslog.conf(5) man page + condition: all + rules: + - 'c:grep -Rh ^*.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^*.* @@\.+' + + - id: 19627 + title: "Ensure remote rsyslog messages are only accepted on designated log hosts" + description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." + rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." + remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines:$ModLoad imtcp & $InputTCPServerRun 514. For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["9.2"] + - pci_dss: ["10.5.1"] + references: + - rsyslog.conf(8) man page + condition: all + rules: + - 'c:grep -Rh ^\$ModLoad[[:space:]]*imtcp /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$ModLoad\s*\t*imtcp' + - 'c:grep -Rh ^\$InputTCPServerRun /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$InputTCPServerRun\s*\t*514' + + # 4.2.2.1 Ensure syslog-ng service is enabled (Scored) + - id: 19628 + title: "Ensure syslog-ng service is enabled" + description: "Once the syslog-ng package is installed it needs to be activated." + rationale: "If the syslog-ng service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable rsyslog : # update-rc.d syslog-ng enable" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "c:ls /etc/rc*.d/S*syslog-ng > r:/etc/rc2.d/S10syslog-ng && r:/etc/rc3.d/S10syslog-ng && r:/etc/rc4.d/S10syslog-ng && r:/etc/rc5.d/S10syslog-ng" + + # 4.2.2.3 Ensure syslog-ng default file permissions configured (Scored) + - id: 19629 + title: "Ensure syslog-ng default file permissions configured" + description: "syslog-ng will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive syslog-ng data is archived and protected." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf and set perm option to 0640 or more restrictive: options { chain_hostnames(off); flush_lines(0); perm(0640); stats_freq(3600); threaded(yes); };" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1", "10.5.2"] + - nist_800_53: ["CM.1", "AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:^options && r:perm\(06\d0\)|perm\(04\d0\)|perm\(02\d0\)|perm\(00\d0\) && r:perm\(0\d40\)|perm\(0\d00\)' + + # 4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host (Not Scored) + - id: 19630 + title: "Ensure syslog-ng is configured to send logs to a remote log host" + description: "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp("logfile.example.com" port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the rsyslogd configuration: # pkill -HUP syslog-ng' + compliance: + - cis: ["4.2.2.4"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/syslog-ng/syslog-ng.conf -> r:destination logserver" + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:log\.+source\.+destination' + + # 4.2.3 Ensure rsyslog or syslog-ng is installed (Scored) + - id: 19631 + title: "Ensure rsyslog or syslog-ng is installed" + description: "The rsyslog and syslog-ng software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog or syslog-ng using one of the following commands: # apt-get install rsyslog # apt-get install syslog-ng" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: any + rules: + - "c:dpkg -s rsyslog -> r:install ok installed" + - "c:dpkg -s syslog-ng -> r:install ok installed" + + ######################################### + # 5 Access, Authentication and Authorization + ######################################### + + - id: 19632 + title: "Ensure cron daemon is enabled" + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Edit start lines in /etc/init/cron.conf to match the following: start on runlevel [2345]" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:initctl show-config cron -> r:^cron" + - "c:initctl show-config cron -> r:start on runlevel [2345]" + + # 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 19633 + title: "Ensure permissions on /etc/crontab are configured" + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0\d00/\w\w\w-------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 19634 + title: "Ensure permissions on /etc/cron.hourly are configured" + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 19635 + title: "Ensure permissions on /etc/cron.daily are configured" + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 19636 + title: "Ensure permissions on /etc/cron.weekly are configured" + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 19637 + title: "Ensure permissions on /etc/cron.monthly are configured" + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 19638 + title: "Ensure permissions on /etc/cron.d are configured" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + - id: 19639 + title: "Ensure at/cron is restricted to authorized users" + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/cron.allow" + - "f:/etc/at.allow" + - "not f:/etc/cron.deny" + - "not f:/etc/at.deny" + - 'c:stat /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2 SSH Server Configuration + + - id: 19640 + title: "Ensure permissions on /etc/ssh/sshd_config are configured" + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non- privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + - id: 19641 + title: "Ensure SSH Protocol is set to 2" + description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2. Notes: This command not longer exists in newer versions of SSH. This check is still being included for systems that may be running an older version of SSH. As of openSSH version 7.4 this parameter will not cause an issue when included." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\s*\t*2' + + - id: 19642 + title: "Ensure SSH LogLevel is set to INFO" + description: "The INFO parameter specifies that login and logout activity will be logged." + rationale: "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 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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + references: + - https://www.ssh.com/ssh/sshd_config/ + compliance: + - cis: ["5.2.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*LogLevel\s+INFO' + + - id: 19643 + title: "Ensure SSH X11 forwarding is disabled" + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_configfile to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.2.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*X11Forwarding\s+no' + + - id: 19644 + title: "Ensure SSH MaxAuthTries is set to 4 or less" + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.5"] + - cis_csc: ["16.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + + - id: 19645 + title: "Ensure SSH IgnoreRhosts is enabled" + description: "The IgnoreRhosts parameter specifies that .rhostsand .shostsfiles will not be used in RhostsRSAAuthenticationor HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*IgnoreRhosts\s+yes' + + - id: 19646 + title: "Ensure SSH HostbasedAuthentication is disabled" + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*HostbasedAuthentication\s+no' + + - id: 19647 + title: "Ensure SSH root login is disabled" + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["4.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*PermitRootLogin\s+no' + + - id: 19648 + title: "Ensure SSH PermitEmptyPasswords is disabled" + description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*PermitEmptyPasswords\s+no' + + - id: 19649 + title: "Ensure SSH PermitUserEnvironment is disabled" + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["5.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*PermitUserEnvironment\s+no' + + - id: 19650 + title: "Ensure only approved MAC algorithms are used" + description: "This variable limits the types of MAC algorithms that SSH can use during communication." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information" + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2- 512,hmac-sha2-256" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["14.4", "16.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - "http://www.mitls.org/pages/attacks/SLOTH" + condition: none + rules: + - "c:sshd -T -> r:MACs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com" + + - id: 19651 + title: "Ensure SSH Idle Timeout Interval is configured" + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 ClientAliveCountMax 0" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> n:ClientAliveInterval\s*\t*(\d+) compare <= 300 && n:ClientAliveInterval\s*\t*(\d+) compare != 0' + - 'f:/etc/ssh/sshd_config -> n:ClientAliveCountMax\s*\t*(\d+) compare <= 3' + + - id: 19652 + title: "Ensure SSH LoginGraceTime is set to one minute or less" + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["5.1"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> n:LoginGraceTime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + + - id: 19653 + title: "Ensure SSH access is limited" + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " + compliance: + - cis: ["5.2.14"] + - cis_csc: ["5.1"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:AllowUsers\s+\w+|AllowGroups\s+\w+|DenyUsers\s+\w+|DenyGroups\s+\w+' + + - id: 19654 + title: "Ensure SSH warning banner is configured" + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:Banner\s*\t*/etc/issue.net' + + # 5.3 Configure PAM + + - id: 19655 + title: "Ensure password creation requirements are configured" + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options: - retry=3 (Allow 3 tries before sending back a failure). The following options are set in the /etc/security/pwquality.conf file: - minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 (The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies.)" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "1) Run the following command to install the pam_pwquality module: apt-get install libpam-pwquality 2) Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so retry=3 3) Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1. Notes: Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more. Settings in /etc/security/pwquality.conf must use spaces around the = symbol." + compliance: + - cis: ["5.3.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.3"] + condition: all + rules: + - "c:dpkg -s libpam-pwquality -> r:install ok installed" + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*requisite\s*\t*pam_pwquality.so\s*\t*retry=\d' + - 'f:/etc/security/pwquality.conf -> !r:^# && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + + - id: 19656 + title: "Ensure lockout for failed password attempts is configured" + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Edit the /etc/pam.d/common-auth file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900. " + compliance: + - cis: ["5.3.2"] + - cis_csc: ["16.7"] + - pci_dss: ["8.2.5"] + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d+ && r:unlock_time\s*=\s*\d+' + + - id: 19657 + title: "Ensure password reuse is limited" + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown: password required pam_pwhistory.so remember=5. Notes: Additional module options may be set, recommendation only covers those listed here." + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare < 5' + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && !r:remember' + + # 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 19658 + title: "Ensure password hashing algorithm is SHA-512" + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the sha512 option for pam_unix.so as shown: password [success=1 default=ignore] pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.4"] + - pci_dss: ["3.6.1"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> r:^password\.+pam_unix.so && !r:sha512' + + # 5.4 User Accounts and Environment + + - id: 19659 + title: "Ensure password expiration is 365 days or less" + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs: PASS_MAX_DAYS 90. Modify user parameters for all users with a password set to match: # chage --maxdays 90 . Notes: You can also check this setting in /etc/shadow directly. The 5th field should be 365 or less for all users with a password. A value of -1 will disable password expiration. Additionally the password expiration must be greater than the minimum days between password changes or users will be unable to change their password." + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["8.2.4"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare < 0' + + - id: 19660 + title: "Ensure minimum days between password changes is 7 or more" + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7. Modify user parameters for all users with a password set to match: # chage --mindays 7 . Notes: You can also check this setting in /etc/shadow directly. The 4th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + + - id: 19661 + title: "Ensure password expiration warning days is 7 or more" + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7. Modify user parameters for all users with a password set to match: # chage --warndays 7 . Notes: You can also check this setting in /etc/shadow directly. The 6th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + - id: 19662 + title: "Ensure inactive password lock is 30 days or less" + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30. Modify user parameters for all users with a password set to match: # chage --inactive 30 . Notes: You can also check this setting in /etc/shadow directly. The 7th field should be 30 or less for all users with a password. A value of -1 would disable this setting." + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - 'not c:useradd -D -> n:^INACTIVE=(\d+) compare < 0' + + - id: 19663 + title: "Ensure default group for the root account is GID 0" + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: # usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' + + - id: 19664 + title: "Ensure default user umask is 027 or more restrictive" + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bash.bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["13"] + - pci_dss: ["3.6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + # 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 19665 + title: "Ensure default user shell timeout is 900 seconds or less" + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bashrc, /etc/profile files, and /etc/profile.d*.sh (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + - id: 19666 + title: "Ensure access to the su command is restricted" + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the wheel group to execute su." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "1) Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so 2) Create a comma separated list of users in the wheel statement in the /etc/group file: wheel:x:10:root, Notes: The use_uid option to pam_wheel.so is a no-op on debian based systems. It is acceptable but not required as these systems use its behavior as default." + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^# && r:auth\s*\t*required\s*\t*pam_wheel.so' + - 'f:/etc/group -> !r:^# && r:wheel:\w+:\d+:\.' + + ############################### + # 6 System Maintenance + ############################### + + - id: 19667 + title: "Ensure permissions on /etc/passwd are configured" + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 19668 + title: "Ensure permissions on /etc/shadow are configured" + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the one following commands to set permissions on /etc/shadow : # chown root:shadow /etc/shadow # chmod o-rwx,g-wx /etc/shadow" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 19669 + title: "Ensure permissions on /etc/group are configured" + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 19670 + title: "Ensure permissions on /etc/gshadow are configured" + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following commands to set permissions on /etc/gshadow : # chown root:shadow /etc/gshadow # chmod o-rwx,g-rw /etc/gshadow" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 19671 + title: "Ensure permissions on /etc/passwd- are configured" + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod 644 /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 19672 + title: "Ensure permissions on /etc/shadow- are configured" + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/shadow- : # chown root:root /etc/shadow- # chown root:shadow /etc/shadow- # chmod o-rwx,g-rw /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 19673 + title: "Ensure permissions on /etc/group- are configured" + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 19674 + title: "Ensure permissions on /etc/gshadow- are configured" + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "# chown root:root /etc/gshadow- # chown root:shadow /etc/gshadow- # chmod o-rwx,g-rw /etc/gshadow-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + # 6.2 User and Group Settings + + - id: 19675 + title: "Ensure password fields are not empty" + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + - id: 19676 + title: 'Ensure no legacy "+" entries exist in /etc/passwd' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/passwd -> !r:^# && r:^+:" + + - id: 19677 + title: 'Ensure no legacy "+" entries exist in /etc/shadow' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.3"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/shadow -> !r:^# && r:^+:" + + - id: 19678 + title: 'Ensure no legacy "+" entries exist in /etc/group' + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/group if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/group -> !r:^# && r:^+:" + + - id: 19679 + title: "Ensure root is the only UID 0 account" + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:' + + - id: 19680 + title: "Ensure shadow group is empty" + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." + compliance: + - cis: ["6.2.20"] + - cis_csc: ["16"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/etc/ruleset/sca/ubuntu/cis_ubuntu16_04.yml b/etc/ruleset/sca/ubuntu/cis_ubuntu16_04.yml new file mode 100644 index 0000000000..6baf0148d5 --- /dev/null +++ b/etc/ruleset/sca/ubuntu/cis_ubuntu16_04.yml @@ -0,0 +1,3076 @@ +# Security Configuration Assessment +# CIS Checks for Ubuntu Linux 16.04 LTS +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Ubuntu Linux 16.04 LTS Benchmark v1.1.0 - 09-08-2022 + +policy: + id: "cis_ubuntu16-04" + file: "cis_ubuntu16_04.yml" + name: "CIS Ubuntu Linux 16.04 LTS Benchmark v1.1.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Ubuntu Linux 16.04 LTS." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Ubuntu version." + description: "Requirements for running the SCA scan against Ubuntu." + condition: all + rules: + - "f:/etc/os-release -> r:Ubuntu" + - "f:/proc/sys/kernel/ostype -> Linux" + +checks: + # 1.1.1 Disable unused filesystems + + - id: 21500 + title: "Ensure mounting of cramfs filesystems is disabled." + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install cramfs /bin/true. 2) Run the following command to unload the cramfs module: # rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:^install /bin/true" + - "not c:lsmod -> r:cramfs" + + - id: 21501 + title: "Ensure mounting of freevxfs filesystems is disabled." + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/freevxfs.conf and add the following line: install freevxfs /bin/true Run the following command to unload the freevxfs module: # rmmod freevxfs" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v freevxfs -> r:^install /bin/true" + - "not c:lsmod -> r:freevxfs" + + - id: 21502 + title: "Ensure mounting of jffs2 filesystems is disabled." + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/jffs2.conf and add the following line: install jffs2 /bin/true Run the following command to unload the jffs2 module: # rmmod jffs2" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v jffs2 -> r:^install /bin/true" + - "not c:lsmod -> r:jffs2" + + - id: 21503 + title: "Ensure mounting of hfs filesystems is disabled." + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/hfs.conf and add the following line: install hfs /bin/true Run the following command to unload the hfs module: # rmmod hfs" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v hfs -> r:^install /bin/true" + - "not c:lsmod -> r:hfs" + + - id: 21504 + title: "Ensure mounting of hfsplus filesystems is disabled." + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .confExample: vim /etc/modprobe.d/hfsplus.conf and add the following line: install hfsplus /bin/true Run the following command to unload the hfsplus module: # rmmod hfsplus" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v hfsplus -> r:^install /bin/true" + - "not c:lsmod -> r:hfsplus" + + - id: 21505 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/udf.conf and add the following line: install udf /bin/true Run the following command to unload the udf module: # rmmod udf" + compliance: + - cis: ["1.1.1.6"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v udf -> r:^install /bin/true" + - "not c:lsmod -> r:udf" + + # 1.1.2 Filesystem Configuration + - id: 21506 + title: "Ensure separate partition exists for /tmp." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + - id: 21507 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodevto the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + - id: 21508 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + - id: 21509 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + - id: 21510 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + - id: 21511 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,nodev /var/tmp" + compliance: + - cis: ["1.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + + - id: 21512 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" + compliance: + - cis: ["1.1.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + - id: 21513 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" + compliance: + - cis: ["1.1.9"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + - id: 21514 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.10"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + - id: 21515 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + - id: 21516 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + - id: 21517 + title: "Ensure nodev option set on /home partition." + description: "When set on a file system, this option prevents character and block special devices from being defined, or if they exist, from being used as character and block special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. See the fstab(5) manual page for more information. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + - id: 21518 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /run/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + - id: 21519 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.15"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + - id: 21520 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.16"] + - cis_csc: ["2.6", "8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + - id: 21521 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run the following command to disable autofs: # systemctl disable autofs" + compliance: + - cis: ["1.1.21"] + - cis_csc: ["8.4", "8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled autofs -> r:^enabled" + + # 1.3 Filesystem Integrity Checking + - id: 21522 + title: "Ensure AIDE is installed." + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Run the following command to install AIDE: # apt-get install aide aide-common. Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: # aideinit" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + reference: + - "AIDE stable manual: http://aide.sourceforge.net/stable/manual.html" + condition: all + rules: + - "c:dpkg -s aide -> r:install ok installed" + + - id: 21523 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/bin/aide.wrapper --config /etc/aide/aide.conf --check" + compliance: + - cis: ["1.3.2"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:grep -Rh aide /etc/cron.d /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly /etc/crontab -> r:\.+' + - "c:crontab -u root -l -> !r:^# && r:/usr/bin/aide && r:--check" + + # 1.4 Secure Boot Settings + - id: 21524 + title: "Ensure permissions on bootloader config are configured." + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually grub.cfg stored in /boot/grub." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: chown root:root /boot/grub/grub.cfg, chmod og-rwx /boot/grub/grub.cfg" + compliance: + - cis: ["1.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub/grub.cfg -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 21525 + title: "Ensure bootloader password is set." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: 'Create an encrypted password with grub-mkpasswd-pbkdf2: # grub-mkpasswd-pbkdf2 Add the following into /etc/grub.d/00_header or a custom /etc/grub.d configuration file: cat < EOF Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["1.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + - id: 21526 + title: "Ensure authentication required for single user mode." + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" + compliance: + - cis: ["1.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/shadow -> r:^root:*:|^root:!:" + + # 1.5 Additional Process Hardening + - id: 21527 + title: "Ensure core dumps are restricted." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl fs.suid_dumpable -> r:=\s*\t*0$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> !r:^# && r:=\s*\t*0$' + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + + - id: 21528 + title: "Ensure XD/NX support is enabled." + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.5.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:dmesg -> r:NX \(Execute Disable\) protection: active' + + - id: 21529 + title: "Ensure address space layout randomization (ASLR) is enabled." + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:\s*\t*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' + + - id: 21530 + title: "Ensure prelink is disabled." + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following commands to restore binaries to normal and uninstall prelink: prelink -ua && yum remove prelink" + compliance: + - cis: ["1.5.4"] + - cis_csc: ["14.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s prelink -> r:install ok installed" + + # 1.6 Configure SELinux + + - id: 21531 + title: "Ensure SELinux is not disabled in bootloader configuration." + description: "Configure SELINUX to be enabled at boot time and verify that it has not been overwritten by the grub boot parameters." + rationale: "SELinux must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/gruband remove all instances of selinux=0 and enforcing=0 from all CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX="" Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["1.6.1.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && r:selinux=0' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && r:enforcing=0' + + - id: 21532 + title: "Ensure the SELinux state is enforcing." + description: "Set SELinux to enable when the system is booted." + rationale: "SELinux must be enabled at boot time in to ensure that the controls it provides are in effect at all times." + remediation: "Edit the /etc/selinux/config file to set the SELINUX parameter: SELINUX=enforcing " + compliance: + - cis: ["1.6.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^SELinux status:\s*enabled$' + - 'c:sestatus -> r:^Current mode:\s*enforcing$' + - 'c:sestatus -> r:^Mode from config file:\s*enforcing$' + - 'f:/etc/selinux/config -> r:^\s*SELINUX\s*=\s*enforcing' + + - id: 21533 + title: "Ensure SELinux policy is configured." + description: "Configure SELinux to meet or exceed the default targeted policy, which constrains daemons and system software only." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that at least the default recommendations are met." + remediation: "Edit the /etc/selinux/config file to set the SELINUXTYPE parameter: SELINUXTYPE=ubuntu" + compliance: + - cis: ["1.6.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sestatus -> r:^Loaded policy name:\s+ubuntu|^Loaded policy name:\s+default|^Loaded policy name:\s+mls' + - 'f:/etc/selinux/config -> r:^Loaded policy name:\s+ubuntu|^\s*SELINUXTYPE\s*=\s*default|^\s*SELINUXTYPE\s*=\s*mls' + + - id: 21534 + title: "Ensure no unconfined daemons exist." + description: "Daemons that are not defined in SELinux policy will inherit the security context of their parent process." + rationale: "Since daemons are launched and descend from the init process, they will inherit the security context label initrc_t . This could cause the unintended consequence of giving the process more permission than it requires." + remediation: "Investigate any unconfined daemons found during the audit action. They may need to have an existing security context assigned to them or a policy built for them." + compliance: + - cis: ["1.6.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:ps -eZ -> r:initrc && !r:tr|ps|egrep|bash|awk" + + - id: 21535 + title: "Ensure AppArmor is not disabled in bootloader configuration." + description: "Configure AppArmor to be enabled at boot time and verify that it has not been overwrittenby the bootloader boot parameters." + rationale: "AppArmor must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/grub and remove all instances of apparmor=0 from all CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX_DEFAULT="quiet" GRUB_CMDLINE_LINUX=""Run the following command to pdate the grub2 configuration: # update-grub' + compliance: + - cis: ["1.6.2.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && r:apparmor=0' + + - id: 21536 + title: "Ensure all AppArmor Profiles are enforcing." + description: "AppArmor profiles define what resources applicatons are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.6.2.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:apparmor status -> r:0 profiles are in complain mode" + - "c:apparmor status -> r:0 processes are unconfined" + - 'c:apparmor status -> n:(\d+) profiles are loaded compare > 0' + + - id: 21537 + title: "Ensure SELinux or AppArmor are installed." + description: "SELinux and AppArmor provide Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Run one of the following commands to install SELinux or apparmor: # apt-get install selinux Or: # apt-get install apparmor" + compliance: + - cis: ["1.6.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - "c:dpkg -s selinux-basics -> r:install ok installed" + - "c:dpkg -s apparmor -> r:install ok installed" + + # 1.7 Warning Banners + - id: 21538 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v." + compliance: + - cis: ["1.7.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/motd -> r:\\v|\\r|\\m|\\s' + + - id: 21539 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.7.1.2"] + - cis_csc: ["5.1"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s' + + - id: 21540 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.7.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s' + + - id: 21541 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod 644 /etc/motd" + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 21542 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod 644 /etc/issue" + compliance: + - cis: ["1.7.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 21543 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod 644 /etc/issue.net" + compliance: + - cis: ["1.7.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 21544 + title: "Ensure GDM login banner is configured." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Create the /etc/dconf/profile/gdm file with the following contents: user-db:user system-db:gdm file-db:/usr/share/gdm/greeter-dconf-defaults Create or edit the banner-message-enable and banner-message-text options in /etc/dconf/db/gdm.d/01-banner-message: [org/gnome/login-screen] banner-message-enable=true banner-message-text='Authorized uses only. All activity may be monitored and reported.' Run the following command to update the system databases: # dconf update" + compliance: + - cis: ["1.7.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/dconf/profile/gdm -> r:^user-db:user" + - "f:/etc/dconf/profile/gdm -> r:^system-db:gdm" + - "f:/etc/dconf/profile/gdm -> r:^file-db:/usr/share/gdm/greeter-dconf-defaults" + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:^[org/gnome/login-screen]' + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:^banner-message-enable=true' + - 'd:/etc/dconf/db/gdm.d/ -> r:\. -> r:^banner-message-text=\.+' + + - id: 21545 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. Notes: Site policy may mandate a testing period before install onto production systems for available updates." + compliance: + - cis: ["1.8"] + - cis_csc: ["3.4", "3.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6", "SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: none + rules: + - "c:apt-get -s upgrade -> r:^The following packages will be upgraded" + + # 2 Services + + - id: 21546 + title: "Ensure chargen services are not enabled." + description: "chargen is a network service that responds with 0 to 512 ASCII characters for each connection it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Comment out or remove any lines starting with chargen from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all chargen services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^chargen" + - 'd:/etc/inetd.d -> r:\. -> r:^chargen' + + - id: 21547 + title: "Ensure daytime services are not enabled." + description: "daytime is a network service that responds with the server's current date and time. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Comment out or remove any lines starting with daytime from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all daytime services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^daytime" + - 'd:/etc/inetd.d/ -> r:\. -> r:^daytime' + + - id: 21548 + title: "Ensure discard services are not enabled." + description: "discard is a network service that simply discards all data it receives. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Comment out or remove any lines starting with discard from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all discard services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^discard" + - 'd:/etc/inetd.d/ -> r:\. -> r:^discard' + + - id: 21549 + title: "Ensure echo services are not enabled." + description: "echo is a network service that responds to clients with the data sent to it by the client. This service is intended for debugging and testing purposes. It is recommended that this service be disabled." + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Comment out or remove any lines starting with echo from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all echo services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^echo" + - 'd:/etc/inetd.d/ -> r:\. -> r:^echo' + + - id: 21550 + title: "Ensure time services are not enabled." + description: "time is a network service that responds with the server's current date and time as a 32 bit integer. This service is intended for debugging and testing purposes. It is recommended that this service be disabled" + rationale: "Disabling this service will reduce the remote attack surface of the system." + remediation: "Comment out or remove any lines starting with time from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all time services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.5"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^time" + - 'd:/etc/inetd.d/ -> r:\. -> r:^time' + + - id: 21551 + title: "Ensure rsh server is not enabled." + description: "The Berkeley rsh-server (rsh, rlogin, rexec) package contains legacy services that exchange credentials in clear-text." + rationale: "These legacy services contain numerous security exposures and have been replaced with the more secure SSH package" + remediation: "Comment out or remove any lines starting with shell, login or exec from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all shell, login or exec services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.6"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^shell" + - 'd:/etc/inetd.d/ -> r:\. -> r:^shell' + - "f:/etc/inetd.conf -> r:^login" + - 'd:/etc/inetd.d/ -> r:\. -> r:^login' + - "f:/etc/inetd.conf -> r:^exec" + - 'd:/etc/inetd.d/ -> r:\. -> r:^exec' + + - id: 21552 + title: "Ensure talk server is not enabled." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client (allows initiate of talk sessions) is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Comment out or remove any lines starting with talk or ntalk from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all talk or ntalk services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.7"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^talk" + - 'd:/etc/inetd.d/ -> r:\. -> r:^talk' + - "f:/etc/inetd.conf -> r:^ntalk" + - 'd:/etc/inetd.d/ -> r:\. -> r:^ntalk' + + - id: 21553 + title: "Ensure telnet server is not enabled." + description: "The telnet-server package contains the telnet daemon, which accepts connections from users from other systems via the telnet protocol." + rationale: "The telnet protocol is insecureand unencrypted. The use of an unencrypted transmission medium could allow a user with access to sniff network traffic the ability to steal credentials. The ssh package provides an encrypted session and stronger security." + remediation: "Comment out or remove any lines starting with telnet from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all telnet services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.8"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^telnet" + - 'd:/etc/inetd.d/ -> r:\. -> r:^telnet' + + - id: 21554 + title: "Ensure tftp server is not enabled." + description: "Trivial File Transfer Protocol (TFTP) is a simple file transfer protocol, typically used to automatically transfer configuration or boot machines from a boot server. The packages tftpd and atftp are both used to define and support a TFTP server." + rationale: "TFTP does not support authentication nor does it ensure the confidentiality or integrity of data. It is recommended that TFTP be removed, unless there is a specificneed for TFTP. In that case, extreme caution must be used when configuring the services." + remediation: "Comment out or remove any lines starting with tftp from /etc/inetd.conf and /etc/inetd.d/*. Set disable = yes on all tftp services in /etc/xinetd.conf and /etc/xinetd.d/* " + compliance: + - cis: ["2.1.9"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/inetd.conf -> r:^tftp" + - 'd:/etc/inetd.d/ -> r:\. -> r:^tftp' + + - id: 21555 + title: "Ensure xinetd is not enabled." + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetddaemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed." + remediation: "Run the following commands to diable xinetd: # systemctl disable xinetd" + compliance: + - cis: ["2.1.10"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled xinetd -> r:^enabled" + + - id: 21556 + title: "Ensure openbsd-inetd is not installed." + description: "The inetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no inetd services required, it is recommended that the daemon be removed." + remediation: "Run the following command to uninstall openbsd-inetd: apt-get remove openbsd-inetd" + compliance: + - cis: ["2.1.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s openbsd-inetd -> r:install ok installed" + + - id: 21557 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems or virtual systems where host based time synchronization is not available install NTP or chrony using one of the following commands: # apt-get install ntp # apt-get install chrony On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization." + compliance: + - cis: ["2.2.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "c:dpkg -s ntp -> r:install ok installed" + - "c:dpkg -s chrony -> r:install ok installed" + + - id: 21558 + title: "Ensure ntp is configured." + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file: RUNASUSER=ntp" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://www.ntp.org/ + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/init.d/ntp -> r:^RUNASUSER\s*\t*=\s*\t*ntp' + + - id: 21559 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system." + remediation: "Add or edit server or pool lines to /etc/chrony/chrony.conf as appropriate: server " + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony.conf -> r:^server\.+|^pool\.+' + + # 2.2.2 Ensure the X Window system is not installed (Scored) + - id: 21560 + title: "Ensure the X Window system is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Run the following command to remove the X Windows System packages: apt-get remove xserver-xorg*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:dpkg -l xserver-xorg-core* -> r:^\wi\s*xserver-xorg' + + - id: 21561 + title: "Ensure Avahi Server is not enabled." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attach surface." + remediation: "Run the following command to disable avahi-daemon: # systemctl disable avahi-daemon" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled avahi-daemon -> enabled" + + - id: 21562 + title: "Ensure CUPS is not enabled." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups: # systemctl disable cups" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.cups.org + condition: none + rules: + - "c:systemctl is-enabled cups -> enabled" + + - id: 21563 + title: "Ensure DHCP Server is not enabled." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be deleted to reduce the potential attack surface." + remediation: "Run the following commands to disable dhcpd: # systemctl disable isc-dhcp-server # systemctl disable isc-dhcp-server6" + references: + - https://www.isc.org/dhcp/ + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled isc-dhcp-server -> enabled" + - "c:systemctl is-enabled isc-dhcp-server6 -> enabled" + + - id: 21564 + title: "Ensure LDAP server is not enabled." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # systemctl disable slapd" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.openldap.org + condition: none + rules: + - "c:systemctl is-enabled slapd -> enabled" + + - id: 21565 + title: "Ensure NFS and RPC are not enabled." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs and rpcbind: # systemctl disable nfs-server # systemctl disable rpcbind" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled nfs-server -> enabled" + - "c:systemctl is-enabled rpcbind -> enabled" + + - id: 21566 + title: "Ensure DNS Server is not enabled." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable named: # systemctl disable bind9" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled bind9 -> enabled" + + - id: 21567 + title: "Ensure FTP Server is not enabled." + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # systemctl disable vsftpd" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled vsftpd -> enabled" + + - id: 21568 + title: "Ensure HTTP Server is not enabled." + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable apache2: # systemctl disable apache2" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled apache2 -> enabled" + + - id: 21569 + title: "Ensure IMAP and POP3 server is not enabled." + description: "dovecot is an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the service be deleted to reduce the potential attack surface." + remediation: "Run the following commands to disable dovecot: # systemctl disable dovecot" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled dovecot -> r:^enabled" + + - id: 21570 + title: "Ensure Samba is not enabled." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable smbd: # systemctl disable smbd" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled smbd -> enabled" + + - id: 21571 + title: "Ensure HTTP Proxy Server is not enabled." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # systemctl disable squid" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled squid -> enabled" + + - id: 21572 + title: "Ensure SNMP Server is not enabled." + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # systemctl disable snmpd" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled snmpd -> enabled" + + - id: 21573 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only . Restart postfix: # systemctl restart postfix" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - tsc: ["CC5.2", "CC6.4", "CC6.6", "CC6.7"] + condition: none + rules: + - 'c:netstat -an -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.*LISTEN' + + - id: 21574 + title: "Ensure rsync service is not enabled." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # systemctl disable rsync" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled rsync -> enabled" + + - id: 21575 + title: "Ensure NIS Server is not enabled." + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable nis: # systemctl disable nis" + compliance: + - cis: ["2.2.17"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled nis -> enabled" + + - id: 21576 + title: "Ensure NIS Client is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Uninstall the nis package: # apt-get remove nis" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s nis -> r:install ok installed" + + - id: 21577 + title: "Ensure rsh client is not installed." + description: "The rshpackage contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rshpackage removes the clients for rsh, rcpand rlogin." + remediation: "Run the following command to uninstall rsh: apt-get remove rsh-client rsh-redone-client" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["2.6", "4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s rsh-client -> r:install ok installed" + - "c:dpkg -s rsh-redone-client -> r:install ok installed" + + - id: 21578 + title: "Ensure talk client is not installed." + description: "The talksoftware makes it possible for users to send and receive messages across systems through a terminal session. The talkclient, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to uninstall talk: apt-get remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s talk -> r:install ok installed" + + - id: 21579 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Run the following command to uninstall telnet: # apt-get remove telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["2.6", "4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s telnet -> r:install ok installed" + + - id: 21580 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run the following command to uninstall openldap-clients : # apt-get remove ldap-utils" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s ldap-utils -> r:install ok installed" + + ############################ + # 3 Network Configuration # + ############################ + + - id: 21581 + title: "Ensure IP forwarding is disabled." + description: "The net.ipv4.ip_forward flag is used to tell the system whether it can forward packets or not." + rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.ip_forward = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.ip_forward=0 # s # sysctl -w net.ipv4.route.flush=1 " + compliance: + - cis: ["3.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + + - id: 21582 + title: "Ensure packet redirect sending is disabled." + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the net.ipv4.conf.all.send_redirects and net.ipv4.conf.default.send_redirects parameters to 0 in /etc/sysctl.conf: net.ipv4.conf.all.send_redirects=0 net.ipv4.conf.default.send_redirects=0 Modify active kernel parameters to match: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + - id: 21583 + title: "Ensure source routed packets are not accepted." + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 . Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1 " + compliance: + - cis: ["3.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + + - id: 21584 + title: "Ensure ICMP redirects are not accepted." + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 . Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1 " + compliance: + - cis: ["3.2.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + + - id: 21585 + title: "Ensure secure ICMP redirects are not accepted." + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + - id: 21586 + title: "Ensure suspicious packets are logged." + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + - id: 21587 + title: "Ensure broadcast ICMP requests are ignored." + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + - id: 21588 + title: "Ensure bogus ICMP responses are ignored." + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + - id: 21589 + title: "Ensure Reverse Path Filtering is enabled." + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing. + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + - id: 21590 + title: "Ensure TCP SYN Cookies is enabled." + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + - id: 21591 + title: "Ensure IPv6 router advertisements are not accepted." + description: "This setting disables the systems ability to accept router advertisements" + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + + - id: 21592 + title: "Ensure IPv6 redirects are not accepted." + description: "This setting prevents the system from accepting ICMP redirects. ICMP redirects tell the system about alternate routes for sending traffic." + rationale: "It is recommended that systems not accept ICMP redirets as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.default.accept_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + + - id: 21593 + title: "Ensure IPv6 is disabled." + description: "Although IPv6 has many advantages over IPv4, few organizations have implemented IPv6." + rationale: "If IPv6 is not to be used, it is recommended that it be disabled to reduce the attack surface of the system." + remediation: 'Edit /etc/default/grub and add ''``ipv6.disable=1'' to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX="ipv6.disable=1" Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["3.3.3"] + - cis_csc: ["3", "11"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*linux && !r:ipv6.disable=1' + + - id: 21594 + title: "Install TCP Wrappers." + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Install tcpd : # apt-get install tcpd To verify if a service supports TCP Wrappers, run the following command: # ldd | grep libwrap.so If there is any output, then the service supports TCP Wrappers." + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "c:dpkg -s tcpd -> r:install ok installed" + + - id: 21595 + title: "Ensure /etc/hosts.allow is configured." + description: "The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." + remediation: 'Run the following command to create /etc/hosts.allow: # echo "ALL: /, /, ..." >/etc/hosts.allow. Where each / combination (for example, "192.168.1.0/255.255.255.0") represents one network block in use by your organization that requires access to this system.' + compliance: + - cis: ["3.4.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "f:/etc/hosts.allow" + + - id: 21596 + title: "Ensure /etc/hosts.deny is configured." + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the server." + remediation: 'Run the following command to create /etc/hosts.deny: # echo "ALL: ALL" >> /etc/hosts.deny' + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "f:/etc/hosts.deny" + - 'f:/etc/hosts.deny -> r:^ALL:\s*ALL' + + - id: 21597 + title: "Verify permissions on /etc/hosts.allow." + description: "The /etc/hosts.allow file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.allow : # chown root:root /etc/hosts.allow # chmod 644 /etc/hosts.allow" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/hosts.allow -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + + - id: 21598 + title: "Verify permissions on /etc/hosts.deny." + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.deny : # chown root:root /etc/hosts.deny # chmod 644 /etc/hosts.deny" + compliance: + - cis: ["3.4.5"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/hosts.deny -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + + - id: 21599 + title: "Ensure DCCP is disabled." + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in- sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.5.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v dccp -> r:install /bin/true" + - "c:lsmod -> r:dccp" + + - id: 21600 + title: "Ensure SCTP is disabled." + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.5.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v sctp -> r:install /bin/true" + - "c:lsmod -> r:sctp" + + - id: 21601 + title: "Ensure RDS is disabled." + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.5.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v rds -> r:install /bin/true" + - "c:lsmod -> r:rds" + + - id: 21602 + title: "Ensure TIPC is disabled." + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create the file /etc/modprobe.d/CIS.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.5.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v tipc -> r:install /bin/true" + - "c:lsmod -> r:tipc" + + # 3.5 Firewall configuration + + - id: 21603 + title: "Ensure default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + compliance: + - cis: ["3.6.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:iptables -L -> r:^Chain INPUT && r:policy DROP" + - "c:iptables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:iptables -L -> r:^Chain OUTPUT && r:policy DROP" + + - id: 21604 + title: "Ensure loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.6.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + ######################################### + # 4 Logging and Auditing + ######################################### + + - id: 21605 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = Notes: The max_log_file parameter is measured in megabytes." + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' + + - id: 21606 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*\t*=\s*\t*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*\t*=\s*\t*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*\t*=\s*\t*halt' + + - id: 21607 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' + + - id: 21608 + title: "Ensure auditd service is enabled." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl enable auditd" + compliance: + - cis: ["4.1.2"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1", "10.7"] + - tsc: [CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> enabled" + + - id: 21609 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub or lilo so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: '1) Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX="audit=1" 2) Run the following command to update the grub2 configuration: # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings.' + compliance: + - cis: ["4.1.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.2.6", "10.7"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:audit=1' + + - id: 21610 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier "time-change"' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time- change | -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change. For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change | -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change | -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.4"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.3", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change" + + - id: 21611 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /etc/group -p wa -k identity | -w /etc/passwd -p wa -k identity | -w /etc/gshadow -p wa -k identity | -w /etc/shadow -p wa -k identity | -w /etc/security/opasswd -p wa -k identity Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.5"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/group && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity" + + - id: 21612 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre- login), /etc/hosts (file containing host names and associated IP addresses) and /etc/sysconfig/network (directory containing network interface scripts and configurations) files." + rationale: 'Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/sysconfig/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier "system-locale."' + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale | -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale | -w /etc/issue -p wa -k system-locale | -w /etc/issue.net -p wa -k system-locale | -w /etc/hosts -p wa -k system-locale | -w /etc/sysconfig/network -p wa -k system-locale Notes: /etc/sysconfig/network is common to Red Hat and SUSE based distributions. You should expand or replace this coverage to any network configuration files on your system such as /etc/network on Debian based distributions. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.6"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/sysconfig/network && r:-p wa && r:-k system-locale" + + - id: 21613 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor SELinux/AppArmor mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/selinux or /etc/apparmor and /etc/apparmor.d directories." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "On systems using SELinux add the following line to the /etc/audit/audit.rules file: -w /etc/selinux/ -p wa -k MAC-policy | -w /usr/share/selinux/ -p wa -k MAC-policy On systems using AppArmor add the following line to the /etc/audit/audit.rules file: -w /etc/apparmor/ -p wa -k MAC-policy | -w /etc/apparmor.d/ -p wa -k MAC-policy" + compliance: + - cis: ["4.1.7"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/selinux/|/etc/apparmor/ && r:-p wa && r:-k MAC-policy" + - "f:/etc/audit/audit.rules -> r:^-w && r:/usr/share/selinux/|/etc/apparmor.d/ && r:-p wa && r:-k MAC-policy" + + - id: 21614 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/faillog -p wa -k logins | -w /var/log/lastlog -p wa -k logins | -w /var/log/tallylog -p wa -k logins. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.8"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/faillog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/tallylog && r:-p wa && r:-k logins" + + - id: 21615 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier "session." The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier "logins."' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/run/utmp -p wa -k session | -w /var/log/wtmp -p wa -k logins | -w /var/log/btmp -p wa -k logins. Notes: The last command can be used to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.9"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k logins" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k logins" + + - id: 21616 + title: "Ensure discretionary access control permission modification events are collected." + description: 'Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier "perm_mod."' + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.10"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod" + + - id: 21617 + title: "Ensure unsuccessful unauthorized file access attempts are collected." + description: 'Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier "access."' + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.11"] + - cis_csc: ["14.9"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access" + + - id: 21618 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts | -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts" + + - id: 21619 + title: "Ensure file deletion events by users are collected." + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete | -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.14"] + - cis_csc: ["6,2", "13"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete" + + - id: 21620 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier "scope."' + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope | -w /etc/sudoers.d/ -p wa -k scope. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.15"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope" + - "f:/etc/audit/audit.rules -> r:^-w && r:/etc/sudoers.d/ && r:-p wa && r:-k scope" + + - id: 21621 + title: "Ensure system administrator actions (sudolog) are collected." + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Add the following lines to the /etc/audit/audit.rules file: -w /var/log/sudo.log -p wa -k actions. Notes: The system must be configured with sudisabled (See Item 5.6 Ensure access to the su command is restricted) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.16"] + - cis_csc: ["4.9"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14", "AC.6", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/var/log/sudo.log && r:-p wa && r:-k actions" + + - id: 21622 + title: "Ensure kernel module loading and unloading is collected." + description: 'Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of "modules".' + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "For 64 bit systems add the following lines to the /etc/audit/audit.rules file: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b64 -S init_module -S delete_module -k modules. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.17"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/sbin/insmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/sbin/rmmod && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-w && r:/sbin/modprobe && r:-p x && r:-k modules" + - "f:/etc/audit/audit.rules -> r:^-a && r:always,exit|exit,always && r:-F arch=b32|-F arch=b64 && r:-S init_module && r:-S delete_module && r:-k modules" + + - id: 21623 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Add the following line to the end of the /etc/audit/audit.rules file: -e 2. Notes: This setting will ensure reloading the auditd config to set active settings requires a system reboot." + compliance: + - cis: ["4.1.18"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.5"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + - tsc: ["CC7.2"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/audit.rules" + - "c:tail -1 /etc/audit/audit.rules -> -e 2" + + - id: 21624 + title: "Ensure rsyslog Service is enabled." + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system will not have a syslog service running." + remediation: "Run the following command to enable rsyslog: # systemctl enable rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> enabled" + + # 4.2.1.3 Ensure rsyslog default file permissions configured (Scored) + - id: 21625 + title: "Ensure rsyslog default file permissions configured." + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1", "10.5.2"] + - nist_800_53: ["CM.1", "AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\. -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + - id: 21626 + title: "Ensure rsyslog is configured to send logs to a remote log host." + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add the following line (where loghost.example.com is the name of your central log host): *.* @@loghost.example.com. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - rsyslog.conf(5) man page + condition: all + rules: + - 'c:grep -Rh ^*.*[^I][^I]*@ /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^*.* @@\.+' + + - id: 21627 + title: "Ensure remote rsyslog messages are only accepted on designated log hosts." + description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." + rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." + remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines:$ModLoad imtcp & $InputTCPServerRun 514. For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["9.2"] + - pci_dss: ["10.5.1"] + references: + - rsyslog.conf(8) man page + condition: all + rules: + - 'c:grep -Rh ^\$ModLoad[[:space:]]*imtcp /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$ModLoad\s*\t*imtcp' + - 'c:grep -Rh ^\$InputTCPServerRun /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$InputTCPServerRun\s*\t*514' + + # 4.2.2.1 Ensure syslog-ng service is enabled (Scored) + - id: 21628 + title: "Ensure syslog-ng service is enabled." + description: "Once the syslog-ng package is installed it needs to be activated." + rationale: "If the syslog-ng service is not activated the system may default to the syslogd service or lack logging instead." + remediation: "Run the following command to enable rsyslog : # systemctl enable syslog-ng" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "c:systemctl is-enabled syslog-ng -> enabled" + + # 4.2.2.3 Ensure syslog-ng default file permissions configured (Scored) + - id: 21629 + title: "Ensure syslog-ng default file permissions configured." + description: "syslog-ng will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive syslog-ng data is archived and protected." + remediation: "Edit the /etc/syslog-ng/syslog-ng.conf and set perm option to 0640 or more restrictive: options { chain_hostnames(off); flush_lines(0); perm(0640); stats_freq(3600); threaded(yes); };" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1", "10.5.2"] + - nist_800_53: ["CM.1", "AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: all + rules: + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:^options && r:perm\(06\d0\)|perm\(04\d0\)|perm\(02\d0\)|perm\(00\d0\) && r:perm\(0\d40\)|perm\(0\d00\)' + + # 4.2.2.4 Ensure syslog-ng is configured to send logs to a remote log host (Not Scored) + - id: 21630 + title: "Ensure syslog-ng is configured to send logs to a remote log host." + description: "The syslog-ng utility supports the ability to send logs it gathers to a remote log host or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/syslog-ng/syslog-ng.conf file and add the following lines (where logfile.example.com is the name of your central log host). destination logserver { tcp("logfile.example.com" port(514)); }; log { source(src); destination(logserver); }; Run the following command to reload the rsyslogd configuration: # pkill -HUP syslog-ng' + compliance: + - cis: ["4.2.2.4"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/syslog-ng/syslog-ng.conf -> r:destination logserver" + - 'f:/etc/syslog-ng/syslog-ng.conf -> r:log\.+source\.+destination' + + # 4.2.3 Ensure rsyslog or syslog-ng is installed (Scored) + - id: 21631 + title: "Ensure rsyslog or syslog-ng is installed." + description: "The rsyslog and syslog-ng software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslog and syslog-ng such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog or syslog-ng using one of the following commands: # apt-get install rsyslog # apt-get install syslog-ng" + compliance: + - cis: ["4.2.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: any + rules: + - "c:dpkg -s rsyslog -> r:install ok installed" + - "c:dpkg -s syslog-ng -> r:install ok installed" + + ######################################### + # 5 Access, Authentication and Authorization + ######################################### + + - id: 21632 + title: "Ensure cron daemon is enabled." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: systemctl enable cron" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled cron -> enabled" + + # 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 21633 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0\d00/\w\w\w-------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 21634 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 21635 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 21636 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 21637 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 21638 + title: "Ensure permissions on /etc/cron.d are configured." + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + - id: 21639 + title: "Ensure at/cron is restricted to authorized users." + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["16"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/cron.allow" + - "f:/etc/at.allow" + - "not f:/etc/cron.deny" + - "not f:/etc/at.deny" + - 'c:stat /etc/cron.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2 SSH Server Configuration + + - id: 21640 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non- privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + - id: 21641 + title: "Ensure SSH Protocol is set to 2." + description: "SSH supports two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2. Notes: This command not longer exists in newer versions of SSH. This check is still being included for systems that may be running an older version of SSH. As of openSSH version 7.4 this parameter will not cause an issue when included." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> !r:^# && r:Protocol\s*\t*2' + + - id: 21642 + title: "Ensure SSH LogLevel is set to INFO." + description: "The INFO parameter specifies that login and logout activity will be logged." + rationale: "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 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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel INFO" + references: + - https://www.ssh.com/ssh/sshd_config/ + compliance: + - cis: ["5.2.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*LogLevel\s+INFO' + + - id: 21643 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_configfile to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.2.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*X11Forwarding\s+no' + + - id: 21644 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.5"] + - cis_csc: ["16.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> n:^\s*MaxAuthTries\s*\t*(\d+) compare <= 4' + + - id: 21645 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhostsand .shostsfiles will not be used in RhostsRSAAuthenticationor HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*IgnoreRhosts\s+yes' + + - id: 21646 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*HostbasedAuthentication\s+no' + + - id: 21647 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["4.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*PermitRootLogin\s+no' + + - id: 21648 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*PermitEmptyPasswords\s+no' + + - id: 21649 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["5.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:^\s*PermitUserEnvironment\s+no' + + - id: 21650 + title: "Ensure only approved MAC algorithms are used." + description: "This variable limits the types of MAC algorithms that SSH can use during communication." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information" + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2- 512,hmac-sha2-256" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["14.4", "16.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - "http://www.mitls.org/pages/attacks/SLOTH" + condition: none + rules: + - "c:sshd -T -> r:MACs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com" + + - id: 21651 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 ClientAliveCountMax 0" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> n:ClientAliveInterval\s*\t*(\d+) compare <= 300 && n:ClientAliveInterval\s*\t*(\d+) compare != 0' + - 'f:/etc/ssh/sshd_config -> n:ClientAliveCountMax\s*\t*(\d+) compare <= 3' + + - id: 21652 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["5.1"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> n:LoginGraceTime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + + - id: 21653 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " + compliance: + - cis: ["5.2.14"] + - cis_csc: ["5.1"] + - pci_dss: ["8.1"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:AllowUsers\s+\w+|AllowGroups\s+\w+|DenyUsers\s+\w+|DenyGroups\s+\w+' + + - id: 21654 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/ssh/sshd_config -> r:Banner\s*\t*/etc/issue.net' + + # 5.3 Configure PAM + + - id: 21655 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options: - retry=3 (Allow 3 tries before sending back a failure). The following options are set in the /etc/security/pwquality.conf file: - minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 (The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies.)" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "1) Run the following command to install the pam_pwquality module: apt-get install libpam-pwquality 2) Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so retry=3 3) Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1. Notes: Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more. Settings in /etc/security/pwquality.conf must use spaces around the = symbol." + compliance: + - cis: ["5.3.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.3"] + condition: all + rules: + - "c:dpkg -s libpam-pwquality -> r:install ok installed" + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*requisite\s*\t*pam_pwquality.so\s*\t*retry=\d' + - 'f:/etc/security/pwquality.conf -> !r:^# && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + + - id: 21656 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Edit the /etc/pam.d/common-auth file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900. " + compliance: + - cis: ["5.3.2"] + - cis_csc: ["16.7"] + - pci_dss: ["8.2.5"] + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d+ && r:unlock_time\s*=\s*\d+' + + - id: 21657 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown: password required pam_pwhistory.so remember=5. Notes: Additional module options may be set, recommendation only covers those listed here." + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare < 5' + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && !r:remember' + + # 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 21658 + title: "Ensure password hashing algorithm is SHA-512." + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the sha512 option for pam_unix.so as shown: password [success=1 default=ignore] pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.4"] + - pci_dss: ["3.6.1"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> r:^password\.+pam_unix.so && !r:sha512' + + # 5.4 User Accounts and Environment + + - id: 21659 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs: PASS_MAX_DAYS 90. Modify user parameters for all users with a password set to match: # chage --maxdays 90 . Notes: You can also check this setting in /etc/shadow directly. The 5th field should be 365 or less for all users with a password. A value of -1 will disable password expiration. Additionally the password expiration must be greater than the minimum days between password changes or users will be unable to change their password." + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["8.2.4"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare < 0' + + - id: 21660 + title: "Ensure minimum days between password changes is 7 or more." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7. Modify user parameters for all users with a password set to match: # chage --mindays 7 . Notes: You can also check this setting in /etc/shadow directly. The 4th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 7' + + - id: 21661 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7. Modify user parameters for all users with a password set to match: # chage --warndays 7 . Notes: You can also check this setting in /etc/shadow directly. The 6th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + - id: 21662 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30. Modify user parameters for all users with a password set to match: # chage --inactive 30 . Notes: You can also check this setting in /etc/shadow directly. The 7th field should be 30 or less for all users with a password. A value of -1 would disable this setting." + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - 'not c:useradd -D -> n:^INACTIVE=(\d+) compare < 0' + + - id: 21663 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: # usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["5.1"] + - pci_dss: ["3.6.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' + + - id: 21664 + title: "Ensure default user umask is 027 or more restrictive." + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bash.bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["13"] + - pci_dss: ["3.6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + # 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 21665 + title: "Ensure default user shell timeout is 900 seconds or less." + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bashrc, /etc/profile files, and /etc/profile.d*.sh (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: TMOUT=600" + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'f:/etc/bashrc -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> n:^\s*\t*TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + - id: 21666 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the wheel group to execute su." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "1) Add the following line to the /etc/pam.d/su file: auth required pam_wheel.so 2) Create a comma separated list of users in the wheel statement in the /etc/group file: wheel:x:10:root, Notes: The use_uid option to pam_wheel.so is a no-op on debian based systems. It is acceptable but not required as these systems use its behavior as default." + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^# && r:auth\s*\t*required\s*\t*pam_wheel.so' + - 'f:/etc/group -> !r:^# && r:wheel:\w+:\d+:\.' + + ############################### + # 6 System Maintenance + ############################### + + - id: 21667 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 21668 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the one following commands to set permissions on /etc/shadow : # chown root:shadow /etc/shadow # chmod o-rwx,g-wx /etc/shadow" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 21669 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 21670 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following commands to set permissions on /etc/gshadow : # chown root:shadow /etc/gshadow # chmod o-rwx,g-rw /etc/gshadow" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 21671 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod 644 /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 21672 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/shadow- : # chown root:root /etc/shadow- # chown root:shadow /etc/shadow- # chmod o-rwx,g-rw /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + - id: 21673 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod 644 /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0\d\d\d/-\w\w-\w--\w--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 21674 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "# chown root:root /etc/gshadow- # chown root:shadow /etc/gshadow- # chmod o-rwx,g-rw /etc/gshadow-" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + # 6.2 User and Group Settings + + - id: 21675 + title: "Ensure password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + - id: 21676 + title: "Ensure no legacy + entries exist in /etc/passwd." + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/passwd -> !r:^# && r:^+:" + + - id: 21677 + title: "Ensure no legacy + entries exist in /etc/shadow" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.3"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/shadow -> !r:^# && r:^+:" + + - id: 21678 + title: "Ensure no legacy + entries exist in /etc/group" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/group if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/group -> !r:^# && r:^+:" + + - id: 21679 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:' + + - id: 21680 + title: "Ensure shadow group is empty." + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." + compliance: + - cis: ["6.2.20"] + - cis_csc: ["16"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/etc/ruleset/sca/ubuntu/cis_ubuntu18_04.yml b/etc/ruleset/sca/ubuntu/cis_ubuntu18_04.yml new file mode 100644 index 0000000000..b44053cbde --- /dev/null +++ b/etc/ruleset/sca/ubuntu/cis_ubuntu18_04.yml @@ -0,0 +1,3486 @@ +# Security Configuration Assessment +# CIS Checks for Ubuntu Linux 18.04 LTS +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Ubuntu Linux 18.04 LTS Benchmark v2.0.1 - 01-03-2020 + +policy: + id: "cis_ubuntu18-04" + file: "cis_ubuntu18_04.yml" + name: "CIS Ubuntu Linux 18.04 LTS Benchmark v2.0.1" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Ubuntu Linux 18.04 LTS." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Ubuntu version." + description: "Requirements for running the SCA scan against Ubuntu Linux 18.04 LTS" + condition: all + rules: + - "f:/etc/os-release -> r:Ubuntu" + - "f:/proc/sys/kernel/ostype -> Linux" + +checks: + ############################################################ + # 1 Initial Setup + ############################################################ + + # 1.1 Filesystem configuration + + - id: 18500 + title: "Ensure mounting of cramfs filesystems is disabled." + description: "The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it." + remediation: "1) Edit or create a file in the /etc/modprobe.d/ directory ending in .conf and add the following line: install cramfs /bin/true. 2) Run the following command to unload the cramfs module: # rmmod cramfs" + compliance: + - cis: ["1.1.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:modprobe -n -v cramfs -> r:^install /bin/true" + - "not c:lsmod -> r:cramfs" + + - id: 18501 + title: "Ensure mounting of freevxfs filesystems is disabled." + description: "The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/freevxfs.conf and add the following line: install freevxfs /bin/true Run the following command to unload the freevxfs module: # rmmod freevxfs" + compliance: + - cis: ["1.1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:/sbin/modprobe -n -v freevxfs -> r:^install /bin/true" + - "not c:lsmod -> r:freevxfs" + + - id: 18502 + title: "Ensure mounting of jffs2 filesystems is disabled." + description: "The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/jffs2.conf and add the following line: install jffs2 /bin/true Run the following command to unload the jffs2 module: # rmmod jffs2" + compliance: + - cis: ["1.1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:/sbin/modprobe -n -v jffs2 -> r:^install /bin/true" + - "not c:lsmod -> r:jffs2" + + - id: 18503 + title: "Ensure mounting of hfs filesystems is disabled." + description: "The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/hfs.conf and add the following line: install hfs /bin/true Run the following command to unload the hfs module: # rmmod hfs" + compliance: + - cis: ["1.1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:/sbin/modprobe -n -v hfs -> r:^install /bin/true" + - "not c:lsmod -> r:hfs" + + - id: 18504 + title: "Ensure mounting of hfsplus filesystems is disabled." + description: "The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .confExample: vi /etc/modprobe.d/hfsplus.conf and add the following line: install hfsplus /bin/true Run the following command to unload the hfsplus module: # rmmod hfsplus" + compliance: + - cis: ["1.1.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:/sbin/modprobe -n -v hfsplus -> r:^install /bin/true" + - "not c:lsmod -> r:hfsplus" + + - id: 18505 + title: "Ensure mounting of squashfs filesystems is disabled." + description: "The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/squashfs.confand add the following line: install squashfs /bin/true Run the following command to unload the squashfsmodule: # rmmod squashfs" + compliance: + - cis: ["1.1.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe -n -v squashfs -> r:install /bin/true|Module squashfs not found" + - "not c:lsmod -> r:squashfs" + + - id: 18506 + title: "Ensure mounting of udf filesystems is disabled." + description: "The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/udf.conf and add the following line: install udf /bin/true Run the following command to unload the udf module: # rmmod udf" + compliance: + - cis: ["1.1.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:/sbin/modprobe -n -v udf -> r:^install /bin/true" + - "not c:lsmod -> r:udf" + + - id: 18507 + title: "Ensure mounting of FAT filesystems is disabled." + description: "The FAT filesystem format is primarily used on older windows systems and portable USB drives or flash modules. It comes in three types FAT12 , FAT16 , and FAT32 all of which are supported by the vfat kernel module." + rationale: "Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/vfat.conf: install vfat /bin/true. Run the following command to unload the vfat module: rmmod vfat" + compliance: + - cis: ["1.1.1.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - AJ Lewis, "LVM HOWTO", https://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - "c:modprobe --showconfig -> r:install vfat /bin/true|Module vfat not found" + - "not c:lsmod -> r:vfat" + + # 1.1.x Filesystem Configuration + - id: 18508 + title: "Ensure /tmp is configured." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + remediation: "Configure /etc/fstab as appropriate. Example: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 or Run the following commands to enable systemd /tmp mounting: systemctl unmask tmp.mount systemctl enable tmp.mount Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount: [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,noexec,nodev,nosuid" + compliance: + - cis: ["1.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + - https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/ + condition: all + rules: + - 'c:mount -> r:\s/tmp\s' + + - id: 18509 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nodev /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodevto the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp: # mount -o remount,nodev /tmp" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nodev' + + - id: 18510 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain set userid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,nosuid /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuidto the /tmp mount options:[Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp:# mount -o remount,nosuid /tmp" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:nosuid' + + - id: 18511 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create set userid files in /tmp." + remediation: "Edit the /etc/fstab file and add noexecto the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /tmp: # mount -o remount,noexec /tmp OR Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexecto the /tmp mount options: [Mount] Options=mode=1777,strictatime,noexec,nodev,nosuid Run the following command to remount /tmp: # mount -o remount,noexec /tmp" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/tmp\s && r:noexec' + + - id: 18512 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var\s' + + - id: 18513 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s' + + - id: 18514 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp : # mount -o remount,nodev /var/tmp" + compliance: + - cis: ["1.1.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nodev' + + - id: 18515 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,nosuid /var/tmp" + compliance: + - cis: ["1.1.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:nosuid' + + - id: 18516 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information. Run the following command to remount /var/tmp: # mount -o remount,noexec /var/tmp" + compliance: + - cis: ["1.1.10"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/var/tmp\s && r:noexec' + + - id: 18517 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.11"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log\s' + + - id: 18518 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog) consume space in the same partition as auditd, it may not perform as desired." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.12"] + - cis_csc: ["6.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/var/log/audit\s' + + - id: 18519 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + compliance: + - cis: ["1.1.13"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://tldp.org/HOWTO/LVM-HOWTO/ + condition: all + rules: + - 'c:mount -> r:\s/home\s' + + - id: 18520 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices. Note: The actions in the item refer to the /home partition, which is the default user partition that is defined in many distributions. If you have created other user partitions, it is recommended that the Remediation and Audit steps be applied to these partitions as well." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. See the fstab(5) manual page for more information. # mount -o remount,nodev /home" + compliance: + - cis: ["1.1.14"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/home\s && r:nodev' + + - id: 18521 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nodev /dev/shm" + compliance: + - cis: ["1.1.15"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nodev' + + - id: 18522 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,nosuid /dev/shm" + compliance: + - cis: ["1.1.16"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:nosuid' + + - id: 18523 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm: # mount -o remount,noexec /dev/shm" + compliance: + - cis: ["1.1.17"] + - cis_csc: ["2.6", "8"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:mount -> r:\s/dev/shm\s && r:noexec' + + - id: 18524 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have it's contents available in system even if they lacked permissions to mount it themselves." + remediation: "Run one of the following commands: Run the following command to disable autofs: # systemctl --now disable autofs OR Run the following command to remove autofs: # apt purge autofs" + compliance: + - cis: ["1.1.22"] + - cis_csc: ["8.4", "8.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled autofs -> enabled" + + - id: 18525 + title: "Disable USB Storage." + description: "USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment." + rationale: "Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vi /etc/modprobe.d/usb_storage.conf and add the following line: # install usb-storage /bin/true . Run the following command to unload the usb-storage module: # rmmod usb-storage" + compliance: + - cis: ["1.1.23"] + - cis_csc: ["8.4", "8.5"] + - pci_dss: ["2.2.5"] + - nist_800_53: ["CM.1"] + - tsc: ["CC6.3"] + condition: all + rules: + - "c:/sbin/modprobe -n -v usb-storage -> r:install /bin/true" + - "not c:lsmod -> r:usb-storage" + + # 1.3 Configure Sudo + + - id: 18526 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "Install sudo using the following command. # apt install sudo OR # apt install sudo-ldap" + compliance: + - cis: ["1.3.1"] + - cis_csc: ["4.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://www.sudo.ws/ + condition: any + rules: + - "c:dpkg -s sudo -> r:install ok installed" + - "c:dpkg -s sudo-ldap -> r:install ok installed" + + - id: 18527 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only froma pseudo-pty" + rationale: "Attackers can run a malicious program using sudo, which would again fork a background process that remains even when the main program has finished executing." + remediation: "edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty" + compliance: + - cis: ["1.3.2"] + - cis_csc: ["4.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*use_pty' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*use_pty' + + - id: 18528 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file" + rationale: "A sudo log file simplifies auditing of sudo commands" + remediation: 'edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults logfile="" Example Defaults logfile="/var/log/sudo.log"' + compliance: + - cis: ["1.3.3"] + - cis_csc: ["6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*logfile=' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*logfile=' + + # 1.4 Filesystem Integrity Checking + - id: 18529 + title: "Ensure AIDE is installed." + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Install AIDE: # apt install aide aide-common. Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Initialize AIDE: # aideinit . Notes: The prelinking feature can interfere with AIDE because it alters binaries to speed up their start up times. Run prelink -ua to restore the binaries to their prelinked state, thus avoiding false positives from AIDE." + compliance: + - cis: ["1.4.1"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:dpkg -s aide -> r:install ok installed" + + - id: 18530 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "Run the following commands: # cp ./config/aidecheck.service /etc/systemd/system/aidecheck.service # cp ./config/aidecheck.timer /etc/systemd/system/aidecheck.timer # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl reenable aidecheck.timer # systemctl restart aidecheck.timer # systemctl daemon-reload OR If cron will be used to schedule and run aide check, run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/bin/aide.wrapper --config /etc/aide/aide.conf --check" + compliance: + - cis: ["1.4.2"] + - cis_csc: ["14.9"] + - pci_dss: ["11.5"] + - tsc: ["PI1.4", "PI1.5", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: + - https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service + - https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer + condition: all + rules: + - 'c:grep -Rh aide /etc/cron.d /etc/cron.daily /etc/cron.hourly /etc/cron.monthly /etc/cron.weekly /etc/crontab -> r:\.+' + - "c:crontab -u root -l -> r:aide" + + # 1.5 Secure Boot Settings + - id: 18531 + title: "Ensure permissions on bootloader config are configured." + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually grub.cfg stored in /boot/grub." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: chown root:root /boot/grub/grub.cfg, chmod og-rwx /boot/grub/grub.cfg" + compliance: + - cis: ["1.5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /boot/grub/grub.cfg -> r:Access:\s*\(0\d00/-\w\w\w------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 18532 + title: "Ensure bootloader password is set." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off SELinux at boot time)." + remediation: 'Create an encrypted password with grub-mkpasswd-pbkdf2 : # grub-mkpasswd-pbkdf2 Enter password: Reenter password: PBKDF2 hash of your password is Add the following into a custom /etc/grub.d configuration file: cat < EOF The superuser/user information and password should not be contained in the /etc/grub.d/00_header file as this file could be overwritten in a package update. If there is a requirement to be able to boot/reboot without entering the password, edit /etc/grub.d/10_linux and add --unrestricted to the line CLASS= Example: CLASS="--class gnu-linux --class gnu --class os --unrestricted" Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["1.5.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + - id: 18533 + title: "Ensure authentication required for single user mode." + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root" + compliance: + - cis: ["1.5.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/shadow -> r:^root:*:|^root:!:" + + - id: 18534 + title: "Ensure interactive boot is not enabled." + description: "Interactive boot allows console users to interactively select which services start on boot. Not all distributions support this capability.The PROMPT_FOR_CONFIRM option provides console users the ability to interactively boot the system and select which services to start on boot ." + rationale: " Turn off the PROMPT_FOR_CONFIRMoption on the console to prevent console users from potentially overriding established security settings." + remediation: "If interactive boot is available disable it." + compliance: + - cis: ["1.5.4"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "f:/etc/shadow -> r:^root:*:|^root:!:" + + # 1.6 Additional Process Hardening + + - id: 18535 + title: "Ensure XD/NX support is enabled." + description: "Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature." + rationale: "Enabling any feature that can protect against buffer overflow attacks enhances the security of the system." + remediation: "On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems: If necessary configure your bootloader to load the new kernel and reboot the system. You may need to enable NX or XD support in your bios." + compliance: + - cis: ["1.6.1"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sh -c "journalctl | grep \"protection: active\"" -> r:NX \(Execute Disable\) protection: active' + + - id: 18536 + title: "Ensure address space layout randomization (ASLR) is enabled." + description: "Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process." + rationale: "Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: kernel.randomize_va_space = 2 Run the following command to set the active kernel parameter: # sysctl -w kernel.randomize_va_space=2" + compliance: + - cis: ["1.6.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:grep -Rh ^kernel\.randomize_va_space /etc/sysctl.conf /etc/sysctl.d -> r:\s*\t*2$' + - 'c:sysctl kernel.randomize_va_space -> r:^kernel.randomize_va_space\s*\t*=\s*\t*2' + + - id: 18537 + title: "Ensure prelink is disabled." + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following command to restore binaries to normal: # prelink -ua Uninstall prelink using the appropriate package manager or manual installation: # apt purge prelink" + compliance: + - cis: ["1.6.3"] + - cis_csc: ["14.9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s prelink -> r:install ok installed" + + - id: 18538 + title: "Ensure core dumps are restricted." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0" + compliance: + - cis: ["1.6.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl fs.suid_dumpable -> r:=\s*\t*0$' + - 'c:grep -Rh fs\.suid_dumpable /etc/sysctl.conf /etc/sysctl.d -> !r:^# && r:=\s*\t*0$' + - 'c:grep -Rh ^*[[:space:]]*hard[[:space:]][[:space:]]*core[[:space:]][[:space:]]* /etc/security/limits.conf /etc/security/limits.d -> r:\s*\t*0$' + + # 1.7 Mandatory Access Control + + - id: 18539 + title: "Ensure AppArmor is installed." + description: "AppArmor provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Install Apparmor. # apt install apparmor # apt install apparmor-utils" + compliance: + - cis: ["1.7.1.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - "c:dpkg -s apparmor-utils -> r:install ok installed" + - "c:dpkg -s apparmor -> r:install ok installed" + + - id: 18540 + title: "Ensure AppArmor is enabled in the bootloader configuration." + description: "Configure AppArmor to be enabled at boot time and verify that it has not been overwrittenby the bootloader boot parameters." + rationale: "AppArmor must be enabled at boot time in your grub configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/grub and add the apparmor=1 and security=apparmor parameters to the GRUB_CMDLINE_LINUX= line GRUB_CMDLINE_LINUX="apparmor=1 security=apparmor" Run the following command to update the grub2 configuration # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings.' + compliance: + - cis: ["1.7.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*linux && !r:apparmor=1 && !r:/boot/memtest86+.bin' + - 'f:/boot/grub/grub.cfg -> r:^\s*linux && !r:security=apparmor && !r:/boot/memtest86+.bin' + + - id: 18541 + title: "Ensure all AppArmor Profiles are in enforce or complain mode." + description: "AppArmor profiles define what resources applicatons are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* OR Run the following command to set all profiles to complain mode: # aa-complain /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.7.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:apparmor_status -> r:0 processes are unconfined" + + - id: 18542 + title: "Ensure all AppArmor Profiles are enforcing." + description: "AppArmor profiles define what resources applicatons are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.7.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:apparmor_status -> n:^(\d+)\s*profiles are loaded compare > 0' + - 'c:apparmor_status -> r:^0\s*profiles are in complain mode' + - 'c:apparmor_status -> r:^0\s*processes are unconfined' + + # 1.8 Warning Banners + - id: 18543 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd" + compliance: + - cis: ["1.8.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not f:/etc/motd -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + - "not f:/etc/motd" + + - id: 18544 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v , or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue" + compliance: + - cis: ["1.8.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + - id: 18545 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version" + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , or \\v or references to the OS platform: # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net" + compliance: + - cis: ["1.8.1.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + - id: 18546 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd: # chown root:root /etc/motd # chmod u-x,go-wx /etc/motd" + compliance: + - cis: ["1.8.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 18547 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root /etc/issue # chmod u-x,go-wx /etc/issue" + compliance: + - cis: ["1.8.1.5"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 18548 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net: # chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net" + compliance: + - cis: ["1.8.1.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + - id: 18549 + title: "Ensure GDM login banner is configured." + description: "GDM is the GNOME Display Manager which handles graphical login for GNOME based systems." + rationale: "Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place." + remediation: "Edit or create the file /etc/gdm3/greeter.dconf-defaults and add: [org/gnome/login-screen], banner-message-enable=true, banner-message-text='Authorized uses only. All activity may be monitored and reported.'" + compliance: + - cis: ["1.8.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/gdm3/greeter.dconf-defaults -> r:^[org/gnome/login-screen]" + - "f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-enable=true" + - 'f:/etc/gdm3/greeter.dconf-defaults -> r:^banner-message-text=\.+' + + - id: 18550 + title: "Ensure updates, patches, and additional security software are installed." + description: "Periodically patches are released for included software either due to security flaws or to include additional functionality." + rationale: "Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected." + remediation: "Use your package manager to update all packages on the system according to site policy. Notes: Site policy may mandate a testing period before install onto production systems for available updates." + compliance: + - cis: ["1.9"] + - cis_csc: ["3.4", "3.5"] + - pci_dss: ["5.2"] + - nist_800_53: ["AU.6", "SI.4"] + - gpg_13: ["4.2"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2"] + condition: none + rules: + - "c:apt -s upgrade -> r:^The following packages will be upgraded" + + ############################################################ + # 2 Services + ############################################################ + + - id: 18551 + title: "Ensure xinetd is not installed." + description: "The eXtended InterNET Daemon (xinetd) is an open source super daemon that replaced the original inetd daemon. The xinetddaemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no xinetd services required, it is recommended that the package be removed." + remediation: "Run the following command to remove xinetd: # apt purge xinetd" + compliance: + - cis: ["2.1.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s xinetd -> r:install ok installed" + + - id: 18552 + title: "Ensure openbsd-inetd is not installed." + description: "The inetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests." + rationale: "If there are no inetd services required, it is recommended that the daemon be removed." + remediation: "Run the following command to uninstall openbsd-inetd: apt-get remove openbsd-inetd" + compliance: + - cis: ["2.1.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s openbsd-inetd -> r:install ok installed" + + - id: 18553 + title: "Ensure time synchronization is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them." + rationale: "Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: 'On systems where host based time synchronization is not available, configure systemd-timesyncd. If "full featured" and/or encrypted time synchronization is required, install chrony or NTP. To install chrony: # apt install chrony To install ntp: # apt install ntp On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization.' + compliance: + - cis: ["2.2.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: any + rules: + - "c:dpkg -s ntp -> r:install ok installed" + - "c:dpkg -s chrony -> r:install ok installed" + - "c:systemctl is-enabled systemd-timescynd -> enabled" + + - id: 18554 + title: "Ensure systemd-timesyncd is configured." + description: 'systemd-timesyncd is a daemon that has been added for synchronizing the system clock across the network. It implements an SNTP client. In contrast to NTP implementations such as chrony or the NTP reference server this only implements a client side, and does not bother with the full NTP complexity, focusing only on querying time from one remote server and synchronizing the local clock to it. The daemon runs with minimal privileges, and has been hooked up with networkd to only operate when network connectivity is available. The daemon saves the current clock to disk every time a new NTP sync has been acquired, and uses this to possibly correct the system clock early at bootup, in order to accommodate for systems that lack an RTC such as the Raspberry Pi and embedded devices, and make sure that time monotonically progresses on these systems, even if it is not always correct. To make use of this daemon a new system user and group "systemd- timesync" needs to be created on installation of systemd. Note: The systemd-timesyncd service specifically implements only SNTP. This minimalistic service will set the system clock for large offsets or slowly adjust it for smaller deltas. More complex use cases are not covered by systemd-timesyncd. This recommendation only applies if timesyncd is in use on the system.' + rationale: "Proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if timesyncd is in use on the system." + remediation: "Run the following command to enable systemd-timesyncd # systemctl enable systemd-timesyncd.service || Edit the file /etc/systemd/timesyncd.conf and add/modify the following lines in accordance with local site policy: (1) NTP=0.ubuntu.pool.ntp.org 1.ubuntu.pool.ntp.org 2.ubuntu.pool.ntp.org (2) FallbackNTP=ntp.ubuntu.com 3.ubuntu.pool.ntp.org (3) RootDistanceMaxSec=1 || Run the following commands to start systemd-timesyncd.service # systemctl start systemd-timesyncd.service # timedatectl set-ntp true || Notes: Servers listed and RootDistanceMax should be In Accordance With Local Policy some versions of systemd have been compiled without systemd-timesycnd. On these distributions, chrony or NTP should be used instead of systemd-timesycnd. Not all options are available on all versions of systemd-timesyncd" + compliance: + - cis: ["2.2.1.2"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-timesyncd.service -> enabled" + + - id: 18555 + title: "Ensure chrony is configured." + description: "chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/. chrony can be configured to be a client and/or a server." + rationale: "If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly. This recommendation only applies if chrony is in use on the system." + remediation: "Add or edit server or pool lines to /etc/chrony/chrony.conf as appropriate: server Configure chrony to run as the chrony user by configuring the appropriate startup script for your distribution. Startup scripts are typically stored in /etc/init.d or /etc/systemd ." + compliance: + - cis: ["2.2.1.3"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'f:/etc/chrony/chrony.conf -> r:^server\.+|^pool\.+' + + - id: 18556 + title: "Ensure ntp is configured." + description: "ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org. ntp can be configured to be a client and/or a server. This recommendation only applies if ntp is in use on the system." + rationale: "If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery Add or edit server or pool lines to /etc/ntp.conf as appropriate: server Configure ntp to run as the ntp user by adding or editing the /etc/init.d/ntp file: RUNASUSER=ntp" + compliance: + - cis: ["2.2.1.4"] + - cis_csc: ["6.1"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - http://www.ntp.org/ + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s+-4\s+default|^restrict\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s+-6\s+default && r:\s+kod\s+ && r:\s+nomodify\s+ && r:\s+notrap\s+ && r:\s+nopeer\s+ && r:\s+noquery' + - 'f:/etc/ntp.conf -> r:^server\.+|^pool\.+' + - 'f:/etc/init.d/ntp -> r:^RUNASUSER\s*\t*=\s*\t*ntp' + + # 2.2.2 Ensure the X Window system is not installed (Scored) + - id: 18557 + title: "Ensure the X Window system is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + remediation: "Remove the X Windows System packages: apt purge xserver-xorg*" + compliance: + - cis: ["2.2.2"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.8", "CC7.1", "CC7.2", "CC8.1"] + condition: none + rules: + - 'c:dpkg -l xserver-xorg-core* -> r:^\wi\s*xserver-xorg' + + - id: 18558 + title: "Ensure Avahi Server is not enabled." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attach surface." + remediation: "Run the following command to disable avahi-daemon: # systemctl --now disable avahi-daemon" + compliance: + - cis: ["2.2.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled avahi-daemon -> enabled" + + - id: 18559 + title: "Ensure CUPS is not enabled." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable cups: # systemctl --now disable cups" + compliance: + - cis: ["2.2.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.cups.org + condition: none + rules: + - "c:systemctl is-enabled cups -> enabled" + + - id: 18560 + title: "Ensure DHCP Server is not enabled." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be disabled to reduce the potential attack surface." + remediation: "Run the following commands to disable dhcpd: # systemctl --now disable isc-dhcp-server # systemctl --now disable isc-dhcp-server6" + references: + - https://www.isc.org/dhcp/ + compliance: + - cis: ["2.2.5"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled isc-dhcp-server -> enabled" + - "c:systemctl is-enabled isc-dhcp-server6 -> enabled" + + - id: 18561 + title: "Ensure LDAP server is not enabled." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable slapd: # systemctl --now disable slapd" + compliance: + - cis: ["2.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - https://www.openldap.org + condition: none + rules: + - "c:systemctl is-enabled slapd -> enabled" + + - id: 18562 + title: "Ensure NFS and RPC are not enabled." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce remote attack surface." + remediation: "Run the following commands to disable nfs and rpcbind: # systemctl --now disable nfs-server # systemctl --now disable rpcbind" + compliance: + - cis: ["2.2.7"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled nfs-server -> enabled" + - "c:systemctl is-enabled rpcbind -> enabled" + + - id: 18563 + title: "Ensure DNS Server is not enabled." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable named: # systemctl --now disable bind9" + compliance: + - cis: ["2.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled bind9 -> enabled" + + - id: 18564 + title: "Ensure FTP Server is not enabled." + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended sftp be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable vsftpd: # systemctl --now disable vsftpd" + compliance: + - cis: ["2.2.9"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled vsftpd -> enabled" + + - id: 18565 + title: "Ensure HTTP Server is not enabled." + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable apache2: # systemctl --now disable apache2" + compliance: + - cis: ["2.2.10"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled apache2 -> enabled" + + - id: 18566 + title: "Ensure email services are not enabled." + description: "dovecot is an open source mail submission and transport server for Linux based systems." + rationale: "Unless mail transport services are to be provided by this system, it is recommended that the service be disabled or deleted to reduce the potential attack surface." + remediation: "Run one of the following commands to disable dovecot : # systemctl --now disable dovecot" + compliance: + - cis: ["2.2.11"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled dovecot -> enabled" + + - id: 18567 + title: "Ensure Samba is not enabled." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Small Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable smbd: # systemctl --now disable smbd" + compliance: + - cis: ["2.2.12"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled smbd -> enabled" + + - id: 18568 + title: "Ensure HTTP Proxy Server is not enabled." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Run the following command to disable squid: # systemctl --now disable squid" + compliance: + - cis: ["2.2.13"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled squid -> enabled" + + - id: 18569 + title: "Ensure SNMP Server is not enabled." + description: "The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system." + rationale: "The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1." + remediation: "Run the following command to disable snmpd: # systemctl --now disable snmpd" + compliance: + - cis: ["2.2.14"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled snmpd -> enabled" + + - id: 18570 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems." + remediation: "Edit /etc/postfix/main.cf and add thefollowing line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Restart postfix: # systemctl restart postfix" + compliance: + - cis: ["2.2.15"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1", "AC.4", "SC.7"] + - tsc: ["CC5.2", "CC6.4", "CC6.6", "CC6.7"] + condition: none + rules: + - 'c:ss -lntu -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.+LISTEN|::1:25\.*LISTEN' + + - id: 18571 + title: "Ensure rsync service is not enabled." + description: "The rsyncd service can be used to synchronize files between systems over network links." + rationale: "The rsyncd service presents a security risk as it uses unencrypted protocols for communication." + remediation: "Run the following command to disable rsync: # systemctl --now disable rsync" + compliance: + - cis: ["2.2.16"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + condition: none + rules: + - "c:systemctl is-enabled rsync -> enabled" + + - id: 18572 + title: "Ensure NIS Server is not enabled." + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used" + remediation: "Run the following command to disable nis: # systemctl --now disable nis" + compliance: + - cis: ["2.2.17"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:systemctl is-enabled nis -> enabled" + + - id: 18573 + title: "Ensure NIS Client is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + remediation: "Uninstall nis : apt purge nis" + compliance: + - cis: ["2.3.1"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s nis -> r:install ok installed" + + - id: 18574 + title: "Ensure rsh client is not installed." + description: "The rsh-client package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin ." + remediation: "Uninstall rsh : apt remove rsh-client" + compliance: + - cis: ["2.3.2"] + - cis_csc: ["4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s rsh-client -> r:install ok installed" + + - id: 18575 + title: "Ensure talk client is not installed." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talkclient, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + remediation: "Uninstall talk : apt remove talk" + compliance: + - cis: ["2.3.3"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s talk -> r:install ok installed" + + - id: 18576 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + remediation: "Uninstall telnet : # apt purge telnet" + compliance: + - cis: ["2.3.4"] + - cis_csc: ["4.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s telnet -> r:install ok installed" + + - id: 18577 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Uninstall ldap-utils : # apt purge ldap-utils" + compliance: + - cis: ["2.3.5"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "c:dpkg -s ldap-utils -> r:install ok installed" + + ############################################################ + # 3 Network Configuration + ############################################################ + + ########################################################## + # 3.1 Network Parameters + ########################################################## + # 3.1.1 Ensure packet redirect sending is disabled + - id: 18578 + title: "Ensure packet redirect sending is disabled." + description: "ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects." + rationale: "An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.send_redirects=0 # sysctl -w net.ipv4.conf.default.send_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.1.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.send_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.send_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.send_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.send_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.send_redirects\s*=\s*0$' + + # 3.1.2 Ensure IP forwarding is disabled + - id: 18579 + title: "Ensure IP forwarding is disabled." + description: "The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not." + rationale: "Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router." + remediation: "Run the following command to restore the default parameter and set the active kernel parameter: # grep -Els \"^\\s*net\\.ipv4\\.ip_forward\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv4\\.ip_forward\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv4.ip_forward=0; sysctl -w net.ipv4.route.flush=1 IF IPv6 is enabled: Run the following command to restore the default parameter and set the active kernel parameter: # grep -Els \"^\\s*net\\.ipv6\\.conf\\.all\\.forwarding\\s*=\\s*1\" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri \"s/^\\s*(net\\.ipv6\\.conf\\.all\\.forwarding\\s*)(=)(\\s*\\S+\\b).*$/# *REMOVED* \\1/\" $filename; done; sysctl -w net.ipv6.conf.all.forwarding=0; sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.1.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.ip_forward -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.ip_forward /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.ip_forward\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.forwarding -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.forwarding /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.forwarding\s*=\s*0$' + + ############################################################# + # 3.2 Network Parameters + ############################################################# + # 3.2.1 Ensure source routed packets are not accepted + - id: 18580 + title: "Ensure source routed packets are not accepted." + description: "In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used." + rationale: "Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_source_route = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv6.conf.all.accept_source_route = 0 net.ipv6.conf.default.accept_source_route = 0 || Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_source_route=0 # sysctl -w net.ipv4.conf.default.accept_source_route=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.conf.all.accept_source_route=0 # sysctl -w net.ipv6.conf.default.accept_source_route=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_source_route\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_source_route -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_source_route -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_source_route\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_source_route /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_source_route\s*=\s*0$' + + # 3.2.2 Ensure ICMP redirects are not accepted + - id: 18581 + title: "Ensure ICMP redirects are not accepted." + description: "ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables." + rationale: "Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.accept_redirects=0 # sysctl -w net.ipv4.conf.default.accept_redirects=0 # sysctl -w net.ipv4.route.flush=1 # sysctl -w net.ipv6.conf.all.accept_redirects=0 # sysctl -w net.ipv6.conf.default.accept_redirects=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.2.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.accept_redirects\s*=\s*0$' + - 'c:sysctl net.ipv6.conf.all.accept_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_redirects\s*=\s*0$' + + # 3.2.3 Ensure secure ICMP redirects are not accepted + - id: 18582 + title: "Ensure secure ICMP redirects are not accepted." + description: "Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure." + rationale: "It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.secure_redirects = 0 net.ipv4.conf.default.secure_redirects = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.secure_redirects=0 # sysctl -w net.ipv4.conf.default.secure_redirects=0 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.secure_redirects -> r:=\s*\t*0$' + - 'c:sysctl net.ipv4.conf.default.secure_redirects -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.secure_redirects\s*=\s*0$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.secure_redirects /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.secure_redirects\s*=\s*0$' + + # 3.2.4 Ensure suspicious packets are logged (Scored) + - id: 18583 + title: "Ensure suspicious packets are logged." + description: "When enabled, this feature logs packets with un-routable source addresses to the kernel log." + rationale: "Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their server." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.log_martians = 1 net.ipv4.conf.default.log_martians = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.log_martians=1 # sysctl -w net.ipv4.conf.default.log_martians=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.4"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.log_martians -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.log_martians -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.log_martians\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.log_martians /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.log_martians\s*=\s*1$' + + # 3.2.5 Ensure broadcast ICMP requests are ignored + - id: 18584 + title: "Ensure broadcast ICMP requests are ignored." + description: "Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses." + rationale: "Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_echo_ignore_broadcasts = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_echo_ignore_broadcasts -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_echo_ignore_broadcasts /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$' + + # 3.2.6 Ensure bogus ICMP responses are ignored (Scored) + - id: 18585 + title: "Ensure bogus ICMP responses are ignored." + description: "Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages." + rationale: "Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages." + remediation: "Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.icmp_ignore_bogus_error_responses = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.icmp_ignore_bogus_error_responses -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.icmp_ignore_bogus_error_responses /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$' + + # 3.2.7 Ensure Reverse Path Filtering is enabled (Scored) + - id: 18586 + title: "Ensure Reverse Path Filtering is enabled." + description: "Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set)." + rationale: "Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.conf.all.rp_filter = 1 net.ipv4.conf.default.rp_filter = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.conf.all.rp_filter -> r:=\s*\t*1$' + - 'c:sysctl net.ipv4.conf.default.rp_filter -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.conf\.all\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.all.rp_filter\s*=\s*1$' + - 'c:grep -Rh net\.ipv4\.conf\.default\.rp_filter /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.conf.default.rp_filter\s*=\s*1$' + + # 3.2.8 Ensure TCP SYN Cookies is enabled (Scored) + - id: 18587 + title: "Ensure TCP SYN Cookies is enabled." + description: "When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue." + rationale: "Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv4.tcp_syncookies = 1. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1" + compliance: + - cis: ["3.2.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv4.tcp_syncookies -> r:=\s*\t*1$' + - 'c:grep -Rh net\.ipv4\.tcp_syncookies /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv4.tcp_syncookies\s*=\s*1$' + + # 3.3.9 Ensure IPv6 router advertisements are not accepted (Scored) + - id: 18588 + title: "Ensure IPv6 router advertisements are not accepted." + description: "This setting disables the systems ability to accept router advertisements" + rationale: "It is recommended that systems not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes." + remediation: "Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file: net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.default.accept_ra = 0. Run the following commands to set the active kernel parameters: # sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1" + compliance: + - cis: ["3.3.9"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sysctl net.ipv6.conf.all.accept_ra -> r:=\s*\t*0$' + - 'c:sysctl net.ipv6.conf.default.accept_ra -> r:=\s*\t*0$' + - 'c:grep -Rh net\.ipv6\.conf\.all\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.all.accept_ra\s*=\s*0$' + - 'c:grep -Rh net\.ipv6\.conf\.default\.accept_ra /etc/sysctl.conf /etc/sysctl.d -> r:^net.ipv6.conf.default.accept_ra\s*=\s*0$' + + ##################################################################### + # 3.3 TCP Wrappers + ##################################################################### + + # 3.3.1 Ensure TCP Weappers is installed (Not Scored) + - id: 18589 + title: "Install TCP Wrappers." + description: "TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. In the past, services that were called from inetd and xinetd supported the use of tcp wrappers. As inetd and xinetd have been falling in disuse, any service that can support tcp wrappers will have the libwrap.so library attached to it." + rationale: "TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it." + remediation: "Install tcpd : # apt-get install tcpd To verify if a service supports TCP Wrappers, run the following command: # ldd | grep libwrap.so If there is any output, then the service supports TCP Wrappers." + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "c:dpkg -s tcpd -> r:install ok installed" + + - id: 18590 + title: "Ensure /etc/hosts.allow is configured." + description: "The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file." + rationale: "The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system." + remediation: 'Run the following command to create /etc/hosts.allow: # echo "ALL: /, /, ..." >/etc/hosts.allow. Where each / combination (for example, "192.168.1.0/255.255.255.0") represents one network block in use by your organization that requires access to this system.' + compliance: + - cis: ["3.3.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "f:/etc/hosts.allow" + + - id: 18591 + title: "Ensure /etc/hosts.deny is configured." + description: "The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file." + rationale: "The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the server." + remediation: 'Run the following command to create /etc/hosts.deny: # echo "ALL: ALL" >> /etc/hosts.deny' + compliance: + - cis: ["3.3.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - "f:/etc/hosts.deny" + - 'f:/etc/hosts.deny -> r:^ALL:\s*ALL' + + - id: 18592 + title: "Verify permissions on /etc/hosts.allow are configured." + description: "The /etc/hosts.allow file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.allow : # chown root:root /etc/hosts.allow # chmod 644 /etc/hosts.allow" + compliance: + - cis: ["3.3.4"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/hosts.allow -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + + - id: 18593 + title: "Verify permissions on /etc/hosts.deny are configured." + description: "The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate." + rationale: "It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/hosts.deny : # chown root:root /etc/hosts.deny # chmod 644 /etc/hosts.deny" + compliance: + - cis: ["3.3.5"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/hosts.deny -> r:^Access: \(0644/-rw-r--r--\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)$' + + ##################################################################### + # 3.4 Uncommon Network Protocols + ##################################################################### + # 3.4.1 Ensure DCCP is disabled (Scored) + - id: 18594 + title: "Ensure DCCP is disabled." + description: "The Datagram Congestion Control Protocol (DCCP) is a transport layer protocol that supports streaming media and telephony. DCCP provides a way to gain access to congestion control, without having to do it at the application layer, but does not provide in- sequence delivery." + rationale: "If the protocol is not required, it is recommended that the drivers not be installed to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/dccp.conf and add the following line: install dccp /bin/true" + compliance: + - cis: ["3.4.1"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v dccp -> r:install /bin/true" + - "c:lsmod -> r:dccp" + + # 3.4.2 Ensure SCTP is disabled (Scored) + - id: 18595 + title: "Ensure SCTP is disabled." + description: "The Stream Control Transmission Protocol (SCTP) is a transport layer protocol used to support message oriented communication, with several streams of messages in one connection. It serves a similar function as TCP and UDP, incorporating features of both. It is message-oriented like UDP, and ensures reliable in-sequence transport of messages with congestion control like TCP." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/sctp.conf and add the following line: install sctp /bin/true" + compliance: + - cis: ["3.4.2"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v sctp -> r:install /bin/true" + - "c:lsmod -> r:sctp" + + # 3.4.3 Ensure RDS is disabled (Scored) + - id: 18596 + title: "Ensure RDS is disabled." + description: "The Reliable Datagram Sockets (RDS) protocol is a transport layer protocol designed to provide low-latency, high-bandwidth communications between cluster nodes. It was developed by the Oracle Corporation." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/rds.conf and add the following line: install rds /bin/true" + compliance: + - cis: ["3.4.3"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v rds -> r:install /bin/true" + - "c:lsmod -> r:rds" + + # 3.4.4 Ensure TIPC is disabled (Scored) + - id: 18597 + title: "Ensure TIPC is disabled." + description: "The Transparent Inter-Process Communication (TIPC) protocol is designed to provide communication between cluster nodes." + rationale: "If the protocol is not being used, it is recommended that kernel module not be loaded, disabling the service to reduce the potential attack surface." + remediation: "Edit or create a file in the /etc/modprobe.d/ directory ending in .conf Example: vim /etc/modprobe.d/tipc.conf and add the following line: install tipc /bin/true" + compliance: + - cis: ["3.4.4"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: none + rules: + - "not c:modprobe -n -v tipc -> r:install /bin/true" + - "c:lsmod -> r:tipc" + + ################################################################# + # 3.5 Firewall configuration + ################################################################# + ################################################################# + # 3.5.1 Ensure Firewall software is installed + ################################################################# + # 3.5.1.1 Ensure a Firewall package is installed (Scored) + - id: 18598 + title: "Ensure a Firewall package is installed." + description: "A Firewall package should be selected. Most firewall configuration utilities operate as a front end to nftables or iptables." + rationale: "A Firewall package is required for firewall management and configuration." + remediation: "Run one of the following commands to install the Firewall package that follows local site policy: To install UFW , run the following command: # apt install ufw To install nftables , run the following command: # apt install nftables To install iptables , run the following command: # apt install iptables" + compliance: + - cis: ["3.5.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.1"] + - tsc: ["CC6.6"] + condition: any + rules: + - "c:dpkg -s ufw -> r:Status: install ok installed" + - "c:dpkg -s nftables -> r:Status: install ok installed" + - "c:dpkg -s iptables -> r:Status: install ok installed" + ################################################################# + # 3.5.2 Configure UncomplicatedFirewall + ################################################################# + # 3.5.2.1 Ensure ufw service is enabled (Scored) + - id: 18599 + title: "Ensure ufw service is enabled." + description: "UncomplicatedFirewall (ufw) is a frontend for iptables. ufw provides a framework for managing netfilter, as well as a command-line and available graphical user interface for manipulating the firewall. Ensure that the ufw service is enabled to protect your system." + rationale: "The ufw service must be enabled and running in order for ufw to protect the system" + remediation: "Run the following command to enable ufw: # ufw enable" + compliance: + - cis: ["3.5.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + reference: + - "http://manpages.ubuntu.com/manpages/precise/en/man8/ufw.8.html" + condition: all + rules: + - "c:systemctl is-enabled ufw -> enabled" + - "c:ufw status -> Status: active" + + # 3.5.2.2 Ensure default deny firewall policy (Scored) + - id: 18600 + title: "Ensure default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default deny policy: # ufw default deny incoming # ufw default deny outgoing # ufw default deny routed" + compliance: + - cis: ["3.5.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ufw status verbose -> r:^Default && r:deny\W+(incoming)|reject\W+(incoming)' + - 'c:ufw status verbose -> r:^Default && r:deny\W+(outgoing)|reject\W+(outgoing)' + - 'c:ufw status verbose -> r:^Default && r:deny\W+(routed)|reject\W+(routed)' + + # 3.5.2.3 Ensure loopback traffic is configured (Scored) + - id: 18601 + title: "Ensure loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8 for IPv4 and ::1/128 for IPv6)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ufw allow in on lo # ufw deny in from 127.0.0.0/8 # ufw deny in from ::1" + compliance: + - cis: ["3.5.2.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ufw status verbose -> r:Anywhere on lo\s*\t*ALLOW IN\s*\t*Anywhere' + - 'c:ufw status verbose -> r:Anywhere\s*\t*DENY IN\s*\t*127.0.0.0/8' + - 'c:ufw status verbose -> r:Anywhere \(v6\) on lo\s*\t*ALLOW IN\s*\t*Anywhere \(v6\)' + - 'c:ufw status verbose -> r:Anywhere \(v6\)\s*\t*DENY IN\s*\t*::1' + - 'c:ufw status verbose -> r:Anywhere\s*\t*ALLOW OUT\s*\t*Anywhere on lo' + - 'c:ufw status verbose -> r:Anywhere \(v6\)\s*\t*ALLOW OUT\s*\t*Anywhere \(v6\) on lo' + + ###################################################################### + # 3.5.3 Configure nftables + ###################################################################### + + # 3.5.3.2 Ensure a table exists (Scored) + - id: 18602 + title: "Ensure a table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + remediation: "Run the following command to create a table in nftables: # nft create table inet
.Example: # nft create table inet filter" + compliance: + - cis: ["3.5.3.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:nft list tables -> r:\w+' + + # 3.5.3.3 Ensure base chains exist (Scored) + - id: 18603 + title: "Ensure base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } . Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0\\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }" + compliance: + - cis: ["3.5.3.3"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input" + - "c:nft list ruleset -> r:hook forward" + - "c:nft list ruleset -> r:hook output" + + # 3.5.3.6 Ensure default deny firewall policy (Scored) + - id: 18604 + title: "Ensure default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept , the firewall will accept any packet that is not configured to be denied and the packet will continue transversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } . Example: # nft chain inet filter input { policy drop \\; } ; # nft chain inet filter forward { policy drop \\; } and # nft chain inet filter output { policy drop \\; }" + compliance: + - cis: ["3.5.3.6"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input && r:policy drop" + - "c:nft list ruleset -> r:hook forward && r:policy drop" + - "c:nft list ruleset -> r:hook output && r:policy drop" + + # 3.5.3.7 Ensure nftables service is enabled (Scored) + - id: 18605 + title: "Ensure nftables service is enabled." + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting of the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables" + compliance: + - cis: ["3.5.3.7"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2"] + - tsc: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled nftables -> enabled" + + ####################################################################### + # 3.5.4 Configure iptables + ####################################################################### + ####################################################################### + # 3.5.4.1 Configure IPv4 iptables + ####################################################################### + # 3.5.4.1.1 Ensure default deny firewall policy (Scored) + - id: 18606 + title: "Ensure default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP; # iptables -P OUTPUT DROP; # iptables -P FORWARD DROP" + compliance: + - cis: ["3.5.4.1.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)|Chain INPUT \(policy REJECT\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)|Chain FORWARD \(policy REJECT\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)|Chain OUTPUT \(policy REJECT\)' + + # 3.5.4.1.2 Ensure loopback traffic is configured (Scored) + - id: 18607 + title: "Ensure loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP" + compliance: + - cis: ["3.5.4.1.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + ######################################################################### + # 3.5.4.2 Configure IPv6 ip6tables + ######################################################################### + # 3.5.4.2.1 Ensure IPv6 default deny firewall policy (Scored) + - id: 18608 + title: "Ensure IPv6 default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP. Notes: Changing firewall settings while connected over network can result in being locked out of the system. Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + compliance: + - cis: ["3.5.4.2.1"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - "c:ip6tables -L -> r:^Chain INPUT && r:policy DROP" + - "c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP" + + # 3.5.4.2.2 Ensure IPv6 loopback traffic is configured (Scored) + - id: 18609 + title: "Ensure IPv6 loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP" + compliance: + - cis: ["3.5.4.2.2"] + - cis_csc: ["9.4"] + - pci_dss: ["1.2.1"] + - tsc: ["CC8.1"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + # 3.6 Ensure wireless interfaces are disabled (Scored) + - id: 18610 + title: "Ensure wireless interfaces are disabled." + description: "Wireless networking is used when wired networks are unavailable. Ubuntu contains a wireless tool kit to allow system administrators to configure and use wireless networks." + rationale: "If wireless is not to be used, wireless devices can be disabled to reduce the potential attack surface." + remediation: "Run the following command to disable any wireless interfaces: # nmcli radio all off" + compliance: + - cis: ["3.6"] + - cis_csc: ["15.4", "15.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.6"] + references: + - nmcli(1) - Linux man page + condition: all + rules: + - "c:nmcli radio wifi -> r:^disabled" + - "c:nmcli radio wwan -> r:^disabled" + + # 3.7 Disable IPv6 (Not Scored) + - id: 18611 + title: "Disable IPv6." + description: "Although IPv6 has many advantages over IPv4, not all organizations have IPv6 or dual stack configurations implemented." + rationale: "If IPv6 or dual stack is not to be used, it is recommended that IPv6 be disabled to reduce the attack surface of the system." + remediation: 'Edit /etc/default/grub and add ipv6.disable=1 to the GRUB_CMDLINE_LINUX parameters: GRUB_CMDLINE_LINUX="ipv6.disable=1" Run the following command to update the grub2 configuration: # update-grub' + compliance: + - cis: ["3.7"] + - cis_csc: ["9.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.6", "CC5.2"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:ipv6.disable=1' + + ############################################################ + # 4 Logging and Auditing + ############################################################ + + - id: 18612 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk" + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # apt install auditd audispd-plugins" + compliance: + - cis: ["4.1.1.1"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["AU.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:dpkg -s auditd -> r:install ok installed" + - "c:dpkg -s audispd-plugins -> r:install ok installed" + + - id: 18613 + title: "Ensure auditd service is enabled." + description: "Enable and start the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable auditd: # systemctl --now enable auditd" + compliance: + - cis: ["4.1.1.2"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1", "10.7"] + - nist_800_53: ["AU.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> enabled" + + - id: 18614 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd, so that potential malicious activity cannot go undetected." + remediation: 'Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: GRUB_CMDLINE_LINUX="audit=1" Run the following command to update the grub2 configuration: # update-grub Notes: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings.' + compliance: + - cis: ["4.1.1.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.2.6", "10.7"] + - nist_800_53: ["AU.2"] + - gpg_13: ["7.9"] + - gdpr_IV: ["35.7.d", "32.2"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: none + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:audit=1 && !r:/boot/memtest86+.bin' + + - id: 18615 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = Notes: The max_log_file parameter is measured in megabytes." + compliance: + - cis: ["4.1.2.1"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["AU.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' + + - id: 18616 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs" + compliance: + - cis: ["4.1.2.2"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' + + - id: 18617 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root admin_space_left_action = halt" + compliance: + - cis: ["4.1.2.3"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*action_mail_acct\s*\t*=\s*\t*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*space_left_action\s*\t*=\s*\t*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*admin_space_left_action\s*\t*=\s*\t*halt' + + - id: 18618 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the adjtimex (tune kernel clock), settimeofday (Set time, using timeval and timezone structures) stime (using seconds since 1/1/1970) or clock_settime (allows for the setting of several internal clocks and timers) system calls have been executed and always write an audit record to the /var/log/audit.log file upon exit, tagging the records with the identifier "time-change"' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time- change | -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change. For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S adjtimex -S settimeofday -k time-change | -a always,exit -F arch=b32 -S adjtimex -S settimeofday -S stime -k time-change | -a always,exit -F arch=b64 -S clock_settime -k time-change -a always,exit -F arch=b32 -S clock_settime -k time-change | -w /etc/localtime -p wa -k time-change" + compliance: + - cis: ["4.1.3"] + - cis_csc: ["5.5"] + - pci_dss: ["10.4.2", "10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S adjtimex && r:-S settimeofday && r:-S stime && r:-k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S clock_settime && r:-k time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change' + + - id: 18619 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the group , passwd (user IDs), shadow and gshadow (passwords) or /etc/security/opasswd (old passwords, based on remember parameter in the PAM configuration) files. The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /etc/group -p wa -k identity | -w /etc/passwd -p wa -k identity | -w /etc/gshadow -p wa -k identity | -w /etc/shadow -p wa -k identity | -w /etc/security/opasswd -p wa -k identity Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.4"] + - cis_csc: ["4.8"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/group && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity' + + - id: 18620 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitor the sethostname (set the systems host name) or setdomainname (set the systems domainname) system calls, and write an audit event on system call exit. The other parameters monitor the /etc/issue and /etc/issue.net files (messages displayed pre- login), /etc/hosts (file containing host names and associated IP addresses) and /etc/sysconfig/network (directory containing network interface scripts and configurations) files." + rationale: 'Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes in the file that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records will be tagged with the identifier "system-locale."' + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/system-locale.rules and add the following lines: -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale-w /etc/network -p wa -k system-locale For 64 bit systems Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules Example: vi /etc/audit/rules.d/system-locale.rules and add the following lines: -a always,exit -F arch=b64 -S sethostname -S setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname -S setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/network -p wa -k system-locale" + compliance: + - cis: ["4.1.5"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S sethostname && r:-S setdomainname && r:-k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/network && r:-p wa && r:-k system-locale' + + - id: 18621 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor AppArmor mandatory access control. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/apparmor and /etc/apparmor.d directories." + rationale: "Changes to files in these directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "On systems using AppArmor add the following line to the /etc/audit/audit.rules file: -w /etc/apparmor/ -p wa -k MAC-policy | -w /etc/apparmor.d/ -p wa -k MAC-policy. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.6"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor/ && r:-p wa && r:-k MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor.d/ && r:-p wa && r:-k MAC-policy' + + - id: 18622 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. The file /var/log/faillog tracks failed events from login. The file /var/log/lastlog maintain records of the last time a user successfully logged in. The file /var/log/tallylog maintains records of failures via the pam_tally2 module" + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /var/log/faillog -p wa -k logins | -w /var/log/lastlog -p wa -k logins | -w /var/log/tallylog -p wa -k logins. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.7"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.2.1", "10.2.4", "10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/faillog && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/tallylog && r:-p wa && r:-k logins' + + - id: 18623 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. The file /var/run/utmp file tracks all currently logged in users. All audit records will be tagged with the identifier "session." The /var/log/wtmp file tracks logins, logouts, shutdown, and reboot events. The file /var/log/btmp keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp . All audit records will be tagged with the identifier "logins."' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /var/run/utmp -p wa -k session | -w /var/log/wtmp -p wa -k logins | -w /var/log/btmp -p wa -k logins. Notes: The last command can be used to read /var/log/wtmp (last with no parameters) and /var/run/utmp (last -f /var/run/utmp). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.8"] + - cis_csc: ["4.9", "16.11", "16.13"] + - pci_dss: ["10.3"] + - nist_800_53: ["AC.7", "AU.14"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k logins' + + - id: 18624 + title: "Ensure discretionary access control permission modification events are collected." + description: 'Monitor changes to file permissions, attributes, ownership and group. The parameters in this section track changes for system calls that affect file permissions and attributes. The chmod , fchmod and fchmodat system calls affect the permissions associated with a file. The chown , fchown , fchownat and lchown system calls affect owner and group attributes on a file. The setxattr , lsetxattr , fsetxattr (set extended file attributes) and removexattr , lremovexattr , fremovexattr (remove extended file attributes) control extended file attributes. In all cases, an audit record will only be written for non-system user ids (auid >= 1000) and will ignore Daemon events (auid = 4294967295). All audit records will be tagged with the identifier "perm_mod."' + rationale: "Monitoring for changes in file attributes could alert a system administrator to activity that could indicate intruder activity or policy violation." + remediation: "For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chmod -S fchmod -S fchmodat -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S chown -S fchown -S fchownat -S lchown -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod | -a always,exit -F arch=b32 -S setxattr -S lsetxattr -S fsetxattr -S removexattr -S lremovexattr -S fremovexattr -F auid>=1000 -F auid!=4294967295 -k perm_mod. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.9"] + - cis_csc: ["5.5"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chmod && r:-S fchmod && r:-S fchmodat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S chown && r:-S fchown && r:-S fchownat && r:-S lchown && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S setxattr && r:-S lsetxattr && r:-S fsetxattr && r:-S removexattr && r:-S lremovexattr && r:-S fremovexattr && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k perm_mod' + + - id: 18625 + title: "Ensure unsuccessful unauthorized file access attempts are collected." + description: 'Monitor for unsuccessful attempts to access files. The parameters below are associated with system calls that control creation ( creat ), opening ( open , openat ) and truncation ( truncate , ftruncate ) of files. An audit log record will only be written if the user is a non- privileged user (auid > = 1000), is not a Daemon event (auid=4294967295) and if the system call returned EACCES (permission denied to the file) or EPERM (some other permanent error associated with the specific system call). All audit records will be tagged with the identifier "access."' + rationale: "Failed attempts to open, create or truncate files could be an indication that an individual or process is trying to gain unauthorized access to the system." + remediation: "For 32 bit systems Edit or create a file in the /etc/audit/rules.d/directory ending in .rules Example: vi /etc/audit/rules.d/audit.rules and add the following lines: -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access For 64 bit systems Edit or create a file in the /etc/audit/rules.d/directory ending in .rules Example: vi /etc/audit/rules.d/access.rules and add the following lines: -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EACCES -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b64 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access | -a always,exit -F arch=b32 -S creat -S open -S openat -S truncate -S ftruncate -F exit=-EPERM -F auid>=1000 -F auid!=4294967295 -k access Notes: Reloading the auditd config toset active settings requires the auditd service to be restarted, and may require a system reboot." + compliance: + - cis: ["4.1.10"] + - cis_csc: ["14.9"] + - pci_dss: ["10.2.4"] + - nist_800_53: ["AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EACCES && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S creat && r:-S open && r:-S openat && r:-S truncate && r:-F exit=-EPERM && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k access' + + - id: 18626 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount ) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open , creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts | -a always,exit -F arch=b32 -S mount -F auid>=1000 -F auid!=4294967295 -k mounts. Notes: This tracks successful and unsuccessful mount commands. File system mounts do not have to come from external media and this action still does not verify write (e.g. CD ROMS). Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.12"] + - cis_csc: ["13"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k mounts' + + - id: 18627 + title: "Ensure file deletion events by users are collected." + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for the unlink (remove a file), unlinkat (remove a file attribute), rename (rename a file) and renameat (rename a file attribute) system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -a always,exit -F arch=b64 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete | -a always,exit -F arch=b32 -S unlink -S unlinkat -S rename -S renameat -F auid>=1000 -F auid!=4294967295 -k delete. Notes: At a minimum, configure the audit system to collect file deletion events for all users and root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.13"] + - cis_csc: ["6.2", "13"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["PI1.4", "PI1.5", "CC7.1", "CC7.2", "CC7.3", "CC8.1"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S unlink && r:-S unlinkat && r:-S rename && r:-S renameat && r:-F auid>=1000 && r:-F auid!=4294967295 && r:-k delete' + + - id: 18628 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrations. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers will be written to when the file or its attributes have changed. The audit records will be tagged with the identifier "scope."' + rationale: "Changes in the /etc/sudoers file can indicate that an unauthorized change has been made to scope of system administrator activity." + remediation: "Add the following line to the /etc/audit/audit.rules file: -w /etc/sudoers -p wa -k scope | -w /etc/sudoers.d/ -p wa -k scope. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.14"] + - cis_csc: ["4.8"] + - pci_dss: ["10.5.5"] + - nist_800_53: ["AU.14"] + - hipaa: ["164.312.b"] + - tsc: ["PI1.4", "PI1.5", "CC7.1", "CC7.2", "CC7.3", "CC8.1"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers.d/ && r:-p wa && r:-k scope' + + - id: 18629 + title: "Ensure system administrator actions (sudolog) are collected." + description: "Monitor the sudo log file. If the system has been properly configured to disable the use of the su command and force all administrators to have to log in first and then use sudo to execute privileged commands, then all administrator commands will be logged to /var/log/sudo.log . Any time a command is executed, an audit event will be triggered as the /var/log/sudo.log file will be opened for write and the executed administration command will be written to the log." + rationale: "Changes in /var/log/sudo.log indicate that an administrator has executed a command or the log file itself has been tampered with. Administrators will want to correlate the events written to the audit trail with the records written to /var/log/sudo.log to verify if unauthorized commands have been executed." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w -p wa -k actions. Notes: The system must be configured with sudisabled (See Item 5.6 Ensure access to the su command is restricted) to force all command execution through sudo. This will not be effective on the console, as administrators can log in as root. Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.15"] + - cis_csc: ["4.9"] + - pci_dss: ["10.2.2"] + - nist_800_53: ["AU.14", "AC.6", "AC.7"] + - gpg_13: ["7.8"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w \.+ && r:-p wa && r:-k actions' + + - id: 18630 + title: "Ensure kernel module loading and unloading is collected." + description: 'Monitor the loading and unloading of kernel modules. The programs insmod (install a kernel module), rmmod (remove a kernel module), and modprobe (a more sophisticated program to load and unload modules, as well as some other features) control loading and unloading of modules. The init_module (load a module) and delete_module (delete a module) system calls control loading and unloading of modules. Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of "modules".' + rationale: "Monitoring the use of insmod, rmmod and modprobe could provide system administrators with evidence that an unauthorized user loaded or unloaded a kernel module, possibly compromising the security of the system. Monitoring of the init_module and delete_module system calls would reflect an unauthorized user attempting to use a different program to load and unload modules." + remediation: "For 32 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b32 -S init_module -S delete_module -k modules. For 64 bit systems edit or create a file in the /etc/audit/rules.d/ directory ending in .rules and add the following lines: -w /sbin/insmod -p x -k modules | -w /sbin/rmmod -p x -k modules | -w /sbin/modprobe -p x -k modules | -a always,exit -F arch=b64 -S init_module -S delete_module -k modules. Notes: Reloading the auditd config to set active settings may require a system reboot." + compliance: + - cis: ["4.1.16"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.7"] + - nist_800_53: ["AU.14", "AU.6"] + - gpg_13: ["7.9"] + - gdpr_IV: ["32.2", "35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - "d:/etc/audit" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/sbin/insmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/sbin/rmmod && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/sbin/modprobe && r:-p x && r:-k modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S init_module && r:-S delete_module && r:-k modules' + + - id: 18631 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line: -e 2. Notes: This setting will ensure reloading the auditd config to set active settings requires a system reboot." + compliance: + - cis: ["4.1.17"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.5"] + - nist_800_53: ["AU.9"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "d:/etc/audit" + - "d:/etc/audit/rules.d -> r:^99-finalize.rules$" + - 'd:/etc/audit/rules.d -> r:^99-finalize.rules$ -> r:^\s*\t*-e 2$' + + # 4.2,1 Configure rsyslog + - id: 18632 + title: "Ensure rsyslog is installed." + description: "The rsyslog software are recommended replacements to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server." + rationale: "The security enhancements of rsyslogsuch as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Install rsyslog: # apt install rsyslog" + compliance: + - cis: ["4.2.1.1"] + - cis_csc: ["6.2"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: any + rules: + - "c:dpkg -s rsyslog -> r:install ok installed" + - id: 18633 + title: "Ensure rsyslog Service is enabled." + description: "Once the rsyslog package is installed it needs to be activated." + rationale: "If the rsyslog service is not activated the system will not have a syslog service running." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog" + compliance: + - cis: ["4.2.1.2"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.1"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1", "CC6.2", "CC6.3", "CC7.2", "CC7.3", "CC7.4"] + - hipaa: ["164.312.b"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> enabled" + + - id: 18634 + title: "Ensure rsyslog default file permissions configured." + description: "rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + remediation: "Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640" + compliance: + - cis: ["4.2.1.4"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1", "10.5.2"] + - nist_800_53: ["CM.1", "AU.9"] + - tsc: ["CC5.2", "CC6.1", "CC7.2", "CC.7.3", "CC7.4"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\. -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + - id: 18635 + title: "Ensure rsyslog is configured to send logs to a remote log host." + description: "The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: 'Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add one of the following lines: Newer syntax: action(type="omfwd" target="" port="" protocol="tcp" ction.resumeRetryCount="" queue.type="linkList" queue.size=") Example: *.* action(type="omfwd" target="192.168.2.100" port"514" protocol="tcp" action.resumeRetryCount="100" queue.type="linkList" queue.size="1000") Older syntax: *.* @@' + compliance: + - cis: ["4.2.1.5"] + - cis_csc: ["6.6", "6.8"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - rsyslog.conf(5) man page + condition: all + rules: + - 'c:grep -Rh ^*.* /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^*.* action\.+target=' + + - id: 18636 + title: "Ensure remote rsyslog messages are only accepted on designated log hosts." + description: "By default, rsyslog does not listen for log messages coming in from remote systems. The ModLoad tells rsyslog to load the imtcp.so module so it can listen over a network via TCP. The InputTCPServerRun option instructs rsyslogd to listen on the specified TCP port." + rationale: "The guidance in the section ensures that remote log hosts are configured to only accept rsyslog data from hosts within the specified domain and that those systems that are not designed to be log hosts do not accept any remote rsyslog messages. This provides protection from spoofed log data and ensures that system administrators are reviewing reasonably complete syslog data in a central location." + remediation: "For hosts that are designated as log hosts, edit the /etc/rsyslog.conf file and un-comment or add the following lines: $ModLoad imtcp $InputTCPServerRun 514. For hosts that are not designated as log hosts, edit the /etc/rsyslog.conf file and comment or remove the following lines: # $ModLoad imtcp # $InputTCPServerRun 514. Run the following command to reload the rsyslogd configuration: # pkill -HUP rsyslogd" + compliance: + - cis: ["4.2.1.6"] + - cis_csc: ["9.2"] + - pci_dss: ["10.5.1"] + references: + - rsyslog.conf(8) man page + condition: all + rules: + - 'c:grep -Rh ^\$ModLoad[[:space:]]*imtcp /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$ModLoad\s*\t*imtcp' + - 'c:grep -Rh ^\$InputTCPServerRun /etc/rsyslog.conf /etc/rsyslog.d/ -> r:^\$InputTCPServerRun\s*\t*514' + + # 4.2.2.1 Ensure journald is configured to send logs to rsyslog (Scored) + - id: 18637 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the rsyslog service provides a consistent means of log collection and export." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes" + compliance: + - cis: ["4.2.2.1"] + - cis_csc: ["6.5"] + - pci_dss: ["10.5.3"] + - nist_800_53: ["CM.1", "AU.9", "AU.4"] + - tsc: ["CC5.2", "CC7.2"] + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf" + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + + # 4.2.2.2 Ensure journald is configured to compress large log files (Scored) + - id: 18638 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes" + compliance: + - cis: ["4.2.2.2"] + - cis_csc: ["6.4"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf" + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Compress\s*=\s*yes' + + # 4.2.2.3 Ensure journald is configured to write logfiles to persistent disk (Scored) + - id: 18639 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent" + compliance: + - cis: ["4.2.2.3"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["10.7"] + - nist_800_53: ["CM.1", "AU.4"] + - tsc: ["CC5.2"] + references: + - "https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf" + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*Storage\s*=\s*persistent' + + # 4.2.3 Ensure permissions on all logfiles are configured (Scored) + - id: 18640 + title: "Ensure permissions on all logfiles are configured." + description: "Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitivebdata is archived and protected." + remediation: 'Run the following command to set permissions on all existing log files: find /var/log -type f -exec chmod g-wx,o-rwx "{}" + -o -type d -exec chmod g-w,o-rwx "{}" +' + compliance: + - cis: ["4.2.3"] + - cis_csc: ["5.1"] + - pci_dss: ["10.5.1", "10.5.2"] + - nist_800_53: ["CM.1", "AU.9"] + - tsc: ["CC5.2", "CC7.2"] + condition: none + rules: + - 'c:find /var/log -type f -ls -> r:-\w\w\w\ww\w\w\w\w|-\w\w\w\w\wx\w\w\w|-\w\w\w\w\w\w\ww\w|-\w\w\w\w\w\wr\w\w|-\w\w\w\w\w\w\w\wx' + + ############################################################ + # 5 Access, Authentication and Authorization + ############################################################ + ############################################################ + # 5.1 Configure cron + ############################################################ + - id: 18641 + title: "Ensure cron daemon is enabled." + description: "The cron daemon is used to execute batch jobs on the system." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable cron: systemctl --now enable cron" + compliance: + - cis: ["5.1.1"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled cron -> enabled" + + # 5.1.2 Ensure permissions on /etc/crontab are configured (Scored) + - id: 18642 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : chown root:root /etc/crontab and chmod og-rwx /etc/crontab" + compliance: + - cis: ["5.1.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured (Scored) + - id: 18643 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.hourly : chown root:root /etc/cron.hourly and chmod og-rwx /etc/cron.hourly" + compliance: + - cis: ["5.1.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.hourly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured (Scored) + - id: 18644 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.daily : chown root:root /etc/cron.daily and chmod og-rwx /etc/cron.daily" + compliance: + - cis: ["5.1.4"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.daily -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured (Scored) + - id: 18645 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.weekly : chown root:root /etc/cron.weekly and chmod og-rwx /etc/cron.weekly" + compliance: + - cis: ["5.1.5"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.weekly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured (Scored) + - id: 18646 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on /etc/cron.monthly : chown root:root /etc/cron.monthly and chmod og-rwx /etc/cron.monthly" + compliance: + - cis: ["5.1.6"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.monthly -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured (Scored) + - id: 18647 + title: "Ensure permissions on /etc/cron.d are configured." + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: rm /etc/cron.deny;rm /etc/at.deny;touch /etc/cron.allow; touch /etc/at.allow; chmod og-rwx /etc/cron.allow; chmod og-rwx /etc/at.allow; chown root:root /etc/cron.allow and chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.7"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/cron.d -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.1.8 Ensure at/cron is restricted to authorized users (Scored) + - id: 18648 + title: "Ensure at/cron is restricted to authorized users." + description: "Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow, cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cronjobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow: # rm /etc/cron.deny # rm /etc/at.deny # touch /etc/cron.allow # touch /etc/at.allow # chmod og-rwx /etc/cron.allow # chmod og-rwx /etc/at.allow # chown root:root /etc/cron.allow # chown root:root /etc/at.allow" + compliance: + - cis: ["5.1.8"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - "f:/etc/cron.allow" + - "f:/etc/at.allow" + - "not f:/etc/cron.deny" + - "not f:/etc/at.deny" + - 'c:stat /etc/cron.allow -> r:^Access: \(0\d\d0/\w\w\w\w\w-----\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/at.allow -> r:^Access: \(0\d\d0/\w\w\w\w\w-----\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + ###################################################### + # 5.2 SSH Server Configuration + ###################################################### + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured + - id: 18649 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non- privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config" + compliance: + - cis: ["5.2.1"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:^Access: \(0\d00/\w\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2.2 Ensure permissions on SSH private host key files are configured (Scored) + - id: 18650 + title: "Ensure permissions on SSH private host key files are configured." + description: "An SSH private key is one of two files used in SSH public key authentication. In this authentication method, The possession of the private key is proof of identity. Only a private key that corresponds to a public key will be able to authenticate successfully. The private keys need to be stored and handled carefully, and no copies of the private key should be distributed." + rationale: "If an unauthorized user obtains the private SSH host key file, the host could be impersonated" + remediation: "Run the following commands to set ownership and permissions on the private SSH host key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chown root:root {} \\; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chmod 0600 {} \\;" + compliance: + - cis: ["5.2.2"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/ssh_host_rsa_key -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ecdsa_key -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ed25519_key -> r:^Access: \(0\d00/-\w\w\w------\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2.3 Ensure permissions on SSH public host key files are configured (Scored) + - id: 18651 + title: "Ensure permissions on SSH public host key files are configured." + description: "An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully." + rationale: "If a public host key file is modified by an unauthorized user, the SSH service may be compromised." + remediation: "Run the following commands to set permissions and ownership on the SSH host public key files: # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chmod 0644 {} \\; #find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chown root:root {} \\;" + compliance: + - cis: ["5.2.3"] + - cis_csc: ["14.6"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/ssh/ssh_host_rsa_key.pub -> r:^Access: \(0\d\d\d/-\w\w\w\w--\w--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ecdsa_key.pub -> r:^Access: \(0\d\d\d/-\w\w\w\w--\w--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + - 'c:stat /etc/ssh/ssh_host_ed25519_key.pub -> r:^Access: \(0\d\d\d/-\w\w\w\w--\w--\) Uid: \( 0/ root\) Gid: \( 0/ root\)$' + + # 5.2.4 Ensure SSH Protocol is not set to 1 (Scored) + - id: 18652 + title: "Ensure SSH Protocol is not set to 1." + description: "Older versions of SSH support two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure." + rationale: "SSH v1 suffers from insecurities that do not affect SSH v2. Notes: This command not longer exists in newer versions of SSH. This check is still being included for systems that may be running an older version of SSH. As of openSSH version 7.4 this parameter will not cause an issue when included." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Protocol 2" + compliance: + - cis: ["5.2.4"] + - cis_csc: ["4.5", "14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: none + rules: + - 'c:sshd -T -> r:Protocol\s*\t*1' + + # 5.2.5 Ensure SSH LogLevel is appropriate (Scored) + - id: 18653 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE or LogLevel INFO" + references: + - https://www.ssh.com/ssh/sshd_config/ + compliance: + - cis: ["5.2.5"] + - cis_csc: ["6.2", "6.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:LogLevel\s+INFO|LogLevel\s+VERBOSE' + + # 5.2.6 Ensure SSH X11 forwarding is disabled (Scored) + - id: 18654 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_configfile to set the parameter as follows: X11Forwarding no" + compliance: + - cis: ["5.2.6"] + - cis_csc: ["9.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: all + rules: + - 'c:sshd -T -> r:X11Forwarding\s+no' + + # 5.2.7 Ensure SSH MaxAuthTries is set to 4 or less (Scored) + - id: 18655 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4" + compliance: + - cis: ["5.2.7"] + - cis_csc: ["16.13"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + + # 5.2.8 Ensure SSH IgnoreRhosts is enabled (Scored) + - id: 18656 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhostsand .shostsfiles will not be used in RhostsRSAAuthenticationor HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with ssh." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes" + compliance: + - cis: ["5.2.8"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:IgnoreRhosts\s+yes' + + # 5.2.9 Ensure SSH HostbasedAuthentication is disabled (Scored) + - id: 18657 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication. This option only applies to SSH Protocol Version 2." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no" + compliance: + - cis: ["5.2.9"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:HostbasedAuthentication\s+no' + + # 5.2.10 Ensure SSH root login is disabled (Scored) + - id: 18658 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using ssh(1). The default is no." + rationale: "Disallowing root logins over SSH requires server admins to authenticate using their own individual account, then escalating to root via sudo or su. This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no" + compliance: + - cis: ["5.2.10"] + - cis_csc: ["4.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitRootLogin\s+no' + + # 5.2.11 Ensure SSH PermitEmptyPasswords is disabled (Scored) + - id: 18659 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no" + compliance: + - cis: ["5.2.11"] + - cis_csc: ["16.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7"] + condition: all + rules: + - 'c:sshd -T -> r:PermitEmptyPasswords\s+no' + + # 5.2.12 Ensure SSH PermitUserEnvironment is disabled (Scored) + - id: 18660 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the ssh daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)" + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no" + compliance: + - cis: ["5.2.12"] + - cis_csc: ["14.6"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -> r:PermitUserEnvironment\s+no' + + # 5.2.13 Ensure only strong Ciphers are used (Scored) + - id: 18661 + title: "Ensure only strong ciphers are used." + description: "This variable limits the ciphers that SSH can use during communication." + rationale: 'Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a "Sweet32" attack The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involving LSB values, aka the "Bar Mitzvah" issue The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher is used, does not properly initialize memory for a MAC context data structure, which allows remote authenticated users to bypass intended ForceCommand and login-shell restrictions via packet data that provides a crafted callback address' + remediation: "Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers Example: Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr" + compliance: + - cis: ["5.2.13"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - "https://nvd.nist.gov/vuln/detail/CVE-2016-2183" + - "https://nvd.nist.gov/vuln/detail/CVE-2015-2808" + - "https://www.kb.cert.org/vuls/id/565052" + - "https://www.openssh.com/txt/cbc.adv" + - "https://nvd.nist.gov/vuln/detail/CVE-2008-5161" + - "https://nvd.nist.gov/vuln/detail/CVE-2013-4548" + - "https://www.kb.cert.org/vuls/id/565052" + - "https://www.openssh.com/txt/cbc.adv" + condition: none + rules: + - "c:sshd -T -> r:ciphers && r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc|arcfour|arcfour128|arcfour256|blowfish-cbc|cast128-cbc|rijndael-cbc@lysator.liu.se" + + # 5.2.14 Ensure only strong MAC algorithms are used (Scored) + - id: 18662 + title: "Ensure only strong MAC algorithms are used." + description: "This variable limits the types of MAC algorithms that SSH can use during communication." + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information" + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256" + compliance: + - cis: ["5.2.14"] + - cis_csc: ["14.4", "16.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + reference: + - "http://www.mitls.org/pages/attacks/SLOTH" + condition: none + rules: + - "c:sshd -T -> r:MACs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com" + + # 5.2.15 Ensure only strong Key Exchange algorithms are used (Scored) + - id: 18663 + title: "Ensure only strong Key Exchange algorithms are used." + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received" + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks" + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms Example: KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256" + compliance: + - cis: ["5.2.15"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.7", "CC6.1", "CC7.2"] + condition: none + rules: + - "c:sshd -T -> r:kexalgorithms && r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1" + + # 5.2.16 Ensure SSH Idle Timeout Interval is configured (Scored) + - id: 18664 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time." + rationale: "Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening. While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy: ClientAliveInterval 300 ClientAliveCountMax 0" + compliance: + - cis: ["5.2.16"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'c:sshd -T -> n:ClientAliveInterval\s*\t*(\d+) compare <= 300 && n:ClientAliveInterval\s*\t*(\d+) compare != 0' + - 'c:sshd -T -> n:ClientAliveCountMax\s*\t*(\d+) compare <= 3' + + # 5.2.17 Ensure SSH LoginGraceTime is set to one minute or less (Scored) + - id: 18665 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60" + compliance: + - cis: ["5.2.17"] + - cis_csc: ["5.1"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:sshd -T -> n:LoginGraceTime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare >= 1' + + # 5.2.18 Ensure SSH access is limited (Scored) + - id: 18666 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: AllowUsers, AllowGroups, DenyUsers, DenyGroups." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows: AllowUsers AllowGroups DenyUsers DenyGroups " + compliance: + - cis: ["5.2.18"] + - cis_csc: ["4.3"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:sshd -T -> r:AllowUsers\s+\w+|AllowGroups\s+\w+|DenyUsers\s+\w+|DenyGroups\s+\w+' + + # 5.2.19 Ensure SSH warning banner is configured (Scored) + - id: 18667 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:Banner\s*\t*/etc/issue.net' + + # 5.2.20 Ensure SSH PAM is enabled (Scored) + - id: 18668 + title: "Ensure SSH PAM is enabled." + description: "UsePAM Enables the Pluggable Authentication Module interface. If set to “yes” this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types." + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes" + compliance: + - cis: ["5.2.20"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*usepam\s+yes' + + # 5.2.21 Ensure SSH AllowTcpForwarding is disabled (Scored) + - id: 18669 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and back-doors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no" + compliance: + - cis: ["5.2.21"] + - cis_csc: ["9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - https://www.ssh.com/ssh/tunneling/example + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowTcpForwarding\s+no' + + - id: 18670 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: maxstartups 10:30:60" + compliance: + - cis: ["5.2.22"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*maxstartups\s+10:30:60' + + # 5.2.23 Ensure SSH MaxSessions is set to 4 or less (Scored) + - id: 18671 + title: "Ensure SSH MaxSessions is set to 4 or less." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 4" + compliance: + - cis: ["5.2.19"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:sshd -T -> n:^MaxSessions\s+(\d+) compare <= 4' + + ###################################################### + # 5.3 Configure PAM + ###################################################### + # 5.3.1 Ensure password creation requirements are configured (Scored) + - id: 18672 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options: - retry=3 (Allow 3 tries before sending back a failure). The following options are set in the /etc/security/pwquality.conf file: - minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 (The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies.)" + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "1) Run the following command to install the pam_pwquality module: apt install libpam-pwquality 2) Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so retry=3 3) Edit /etc/security/pwquality.conf to add or update the following settings to conform to site policy: minlen = 14 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1. Notes: Additional module options may be set, recommendation requirements only cover including try_first_pass and minlen set to 14 or more. Settings in /etc/security/pwquality.conf must use spaces around the = symbol." + compliance: + - cis: ["5.3.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/security/pwquality.conf -> !r:^# && n:minlen\s*\t*=\s*\t*(\d+) compare >= 14' + - 'f:/etc/pam.d/common-password -> !r:^# && n:password\s*\t*requisite\s*\t*pam_pwquality.so\s*\t*retry=(\d+) compare <=3' + + # 5.3.2 Ensure lockout for failed password attempts is configured (Scored) + - id: 18673 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. Set the lockout number to the policy in effect at your site." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: 'Edit the /etc/pam.d/common-auth file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900. Edit the /etc/pam.d/common-account file and add the account lines below: account requisite pam_deny.so account required pam_tally2.so. Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u --reset. This command sets the failed count to 0, effectively unlocking the user. Notes:BUG In pam_tally2.so To work around this issue the addition of pam_tally2.so in the accounts section of the /etc/pam.d/common-account file has been added to the audit and remediation sections. pam_tally2 line must be added for the counter to reset to 0 when using sudo. Use of the "audit" keyword may log credentials in the case of user error during authentication. This risk should be evaluated in the context of the site policies of your organization.' + compliance: + - cis: ["5.3.2"] + - cis_csc: ["16.7"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d+ && r:unlock_time\s*=\s*\d+' + - 'f:/etc/pam.d/common-account -> !r:^# && r:account\s*\t*requisite\s*\t*pam_deny.so' + - 'f:/etc/pam.d/common-account -> !r:^# && r:account\s*\t*required\s*\t*pam_tally2.so' + + # 5.3.3 Ensure password reuse is limited (Scored) + - id: 18674 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown: password required pam_pwhistory.so remember=5. Notes: Additional module options may be set, recommendation only covers those listed here." + compliance: + - cis: ["5.3.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.5"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare < 5' + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && !r:remember' + + # 5.3.4 Ensure password hashing algorithm is SHA-512 (Scored) + - id: 18675 + title: "Ensure password hashing algorithm is SHA-512." + description: "The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note that these change only apply to accounts configured on the local system." + remediation: "Edit the /etc/pam.d/common-password file to include the sha512 option for pam_unix.so as shown: password [success=1 default=ignore] pam_unix.so sha512" + compliance: + - cis: ["5.3.4"] + - cis_csc: ["16.14"] + - pci_dss: ["3.6.1", "8.2.1"] + - tsc: ["CC6.1", "CC6.7"] + condition: none + rules: + - 'f:/etc/pam.d/common-password -> r:^password\.+pam_unix.so && !r:sha512' + + #################################################### + # 5.4 User Accounts and Environment + #################################################### + #################################################### + # 5.4.1 Set Shadow Password Suite Parameters + #################################################### + # 5.4.1.1 Ensure password expiration is 365 days or less (Scored) + - id: 18676 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs: PASS_MAX_DAYS 90. Modify user parameters for all users with a password set to match: # chage --maxdays 90 . Notes: You can also check this setting in /etc/shadow directly. The 5th field should be 365 or less for all users with a password. A value of -1 will disable password expiration. Additionally the password expiration must be greater than the minimum days between password changes or users will be unable to change their password." + compliance: + - cis: ["5.4.1.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'not f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare < 0' + + # 5.4.1.2 Ensure minimum days between password changes is configured + - id: 18677 + title: "Ensure minimum days between password changes is 7 or more." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 7 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 7 in /etc/login.defs: PASS_MIN_DAYS 7. Modify user parameters for all users with a password set to match: # chage --mindays 7 . Notes: You can also check this setting in /etc/shadow directly. The 4th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.2"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 1' + + # 5.4.1.3 Ensure password expiration warning days is 7 or more (Scored) + - id: 18678 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7. Modify user parameters for all users with a password set to match: # chage --warndays 7 . Notes: You can also check this setting in /etc/shadow directly. The 6th field should be 7 or more for all users with a password." + compliance: + - cis: ["5.4.1.3"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + + # 5.4.1.4 Ensure inactive password lock is 30 days or less (Scored) + - id: 18679 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30. Modify user parameters for all users with a password set to match: # chage --inactive 30 . Notes: You can also check this setting in /etc/shadow directly. The 7th field should be 30 or less for all users with a password. A value of -1 would disable this setting." + compliance: + - cis: ["5.4.1.4"] + - cis_csc: ["4.4", "16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - 'not c:useradd -D -> n:^INACTIVE=(\d+) compare < 0' + + # 5.4.3 Ensure default group for the root account is GID 0 (Scored) + - id: 18680 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root-owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0: # usermod -g 0 root" + compliance: + - cis: ["5.4.3"] + - cis_csc: ["14.6"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' + + # 5.4.4 Ensure default user umask is 027 or more restrictive (Scored) + - id: 18681 + title: "Ensure default user umask is 027 or more restrictive." + description: "The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories." + rationale: "Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system." + remediation: "Edit the /etc/bash.bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: umask 027" + compliance: + - cis: ["5.4.4"] + - cis_csc: ["14.6"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/bash.bashrc -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'f:/etc/profile -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'f:/etc/profile -> !r:^\s*\t*# && n:umask \d\d(\d) compare != 7' + - 'd:/etc/profile.d -> .sh -> !r:^\s*\t*# && r:umask \d0\d|umask \d1\d|umask \d4\d|umask \d5\d' + - 'd:/etc/profile.d -> .sh -> !r:^\s*t*# && n:umask \d\d(\d) compare != 7' + + # 5.4.5 Ensure default user shell timeout is 900 seconds or less (Scored) + - id: 18682 + title: "Ensure default user shell timeout is 900 seconds or less." + description: "The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds." + rationale: "Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening." + remediation: "Edit the /etc/bash.bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows: readonly TMOUT=900 ; export TMOUT . Note that setting the value to readonly prevents unwanted modification during runtime." + compliance: + - cis: ["5.4.5"] + - cis_csc: ["16.11"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'not d:/etc/profile.d -> .sh -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/bash.bashrc -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'not f:/etc/profile -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare > 900' + - 'd:/etc/profile.d -> .sh -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/bash.bashrc -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + - 'f:/etc/profile -> r:^\s*\t*readonly && n:TMOUT\s*\t*=\s*\t*(\d+) compare <= 900' + + # 5.6 Ensure access to the su command is restricted (Scored) + - id: 18683 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in the sudo group to execute su." + rationale: "Restricting the use of su, and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo, whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup" + compliance: + - cis: ["5.6"] + - cis_csc: ["5.1"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^# && r:auth\s*\t*required\s*\t*pam_wheel.so && r:use_uid && r:group=' + + ############################################################ + # 6 System Maintenance + ############################################################ + + ############################################################ + # 6.1 System File Permissions + ############################################################ + # 6.1.2 Ensure permissions on /etc/passwd are configured (Scored) + - id: 18684 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod 644 /etc/passwd" + compliance: + - cis: ["6.1.2"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.3 Ensure permissions on /etc/gshadow- are configured (Scored) + - id: 18685 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/gshadow- : # chown root:root /etc/gshadow- # chown root:shadow /etc/gshadow- # chmod o-rwx,g-wx /etc/gshadow-" + compliance: + - cis: ["6.1.3"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.4 Ensure permissions on /etc/shadow are configured (Scored) + - id: 18686 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run the one following commands to set permissions on /etc/shadow : # chown root:shadow /etc/shadow # chmod o-rwx,g-wx /etc/shadow" + compliance: + - cis: ["6.1.4"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + # 6.1.5 Ensure permissions on /etc/group are configured (Scored) + - id: 18687 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group: # chown root:root /etc/group # chmod 644 /etc/group" + compliance: + - cis: ["6.1.5"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.6 Ensure permissions on /etc/passwd- are configured (Scored) + - id: 18688 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd-: # chown root:root /etc/passwd- # chmod u-x,go-rwx /etc/passwd-" + compliance: + - cis: ["6.1.6"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.7 Ensure permissions on /etc/shadow- are configured (Scored) + - id: 18689 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to set permissions on /etc/shadow- : # chown root:shadow /etc/shadow- # chmod u-x,go-rwx /etc/shadow-" + compliance: + - cis: ["6.1.7"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/shadow- -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)|Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.8 Ensure permissions on /etc/group- are configured (Scored) + - id: 18690 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group-: # chown root:root /etc/group- # chmod u-x,go-rwx /etc/group-" + compliance: + - cis: ["6.1.8"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/group- -> r:Access:\s*\(0\d00/-\w\w-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.9 Ensure permissions on /etc/gshadow are configured (Scored) + - id: 18691 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group" + remediation: "Run the following commands to set permissions on /etc/gshadow : # chown root:shadow /etc/gshadow # chmod o-rwx,g-rw /etc/gshadow" + compliance: + - cis: ["6.1.9"] + - cis_csc: ["16.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'c:stat /etc/gshadow -> r:Access:\s*\(0\d\d0/-\w\w-\w-----\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + #################################################### + # 6.2 User and Group Settings + #################################################### + + # 6.2.1 Ensure password fields are not empty (Scored) + - id: 18692 + title: "Ensure password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l . Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc: ["4.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + # 6.2.2 Ensure no legacy "+" entries exist in /etc/passwd (Scored) + - id: 18693 + title: "Ensure no legacy + entries exist in /etc/passwd" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/passwd if they exist." + compliance: + - cis: ["6.2.2"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/passwd -> !r:^# && r:^+:" + + # 6.2.4 Ensure no legacy "+" entries exist in /etc/shadow (Scored) + - id: 18694 + title: "Ensure no legacy + entries exist in /etc/shadow" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/shadow if they exist." + compliance: + - cis: ["6.2.4"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/shadow -> !r:^# && r:^+:" + + # 6.2.5 Ensure no legacy "+" entries exist in /etc/group (Scored) + - id: 18695 + title: "Ensure no legacy + entries exist in /etc/group" + description: "The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms." + rationale: "These entries may provide an avenue for attackers to gain privileged access on the system." + remediation: "Remove any legacy + entries from /etc/group if they exist." + compliance: + - cis: ["6.2.5"] + - cis_csc: ["16.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + condition: none + rules: + - "f:/etc/group -> !r:^# && r:^+:" + + # 6.2.6 Ensure root is the only UID 0 account (Scored) + - id: 18696 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.6"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:' + + # 6.2.20 Ensure shadow group is empty (Scored) + - id: 18697 + title: "Ensure shadow group is empty." + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group." + compliance: + - cis: ["6.2.20"] + - pci_dss: ["10.2.5"] + - hipaa: ["164.312.b"] + - nist_800_53: ["AU.14", "AC.7"] + - tsc: ["CC7.2", "CC6.1", "CC6.8", "CC7.3", "CC7.4"] + - gpg_13: ["7.8"] + - gdpr_IV: ["35.7", "32.2"] + condition: none + rules: + - 'f:/etc/group -> !r:^# && r:shadow:\w*:\w*:\S+' diff --git a/etc/ruleset/sca/ubuntu/cis_ubuntu20_04.yml b/etc/ruleset/sca/ubuntu/cis_ubuntu20_04.yml new file mode 100644 index 0000000000..c22ce5e345 --- /dev/null +++ b/etc/ruleset/sca/ubuntu/cis_ubuntu20_04.yml @@ -0,0 +1,5128 @@ +# Security Configuration Assessment +# CIS Checks for Ubuntu Linux 20.04 LTS +# Copyright (C) 2023, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Ubuntu Linux 20.04 LTS Benchmark v2.0.0 - 05-30-2023 + +policy: + id: "cis_ubuntu20-04" + file: "cis_ubuntu20_04.yml" + name: "CIS Ubuntu Linux 20.04 LTS Benchmark v2.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Ubuntu Linux 20.04 LTS." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Ubuntu version." + description: "Requirements for running the SCA scan against Ubuntu Linux 20.04 LTS" + condition: all + rules: + - "f:/etc/os-release -> r:Ubuntu 20.04" + - "f:/proc/sys/kernel/ostype -> Linux" + +checks: + # 1.1.1.1 Ensure mounting of cramfs filesystems is disabled. (Automated) - Not Implemented + # 1.1.1.2 Ensure mounting of freevxfs filesystems is disabled. (Automated) - Not Implemented + # 1.1.1.4 Ensure mounting of hfs filesystems is disabled. (Automated) - Not Implemented + # 1.1.1.5 Ensure mounting of hfsplus filesystems is disabled. (Automated) - Not Implemented + # 1.1.1.6 Ensure mounting of squashfs filesystems is disabled. (Automated) - Not Implemented + # 1.1.1.7 Ensure mounting of udf filesystems is disabled. (Automated) - Not Implemented + + # 1.1.2.1 Ensure /tmp is a separate partition. (Automated) + - id: 19000 + title: "Ensure /tmp is a separate partition." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a configuration where /tmp is not a separate file system it will essentially have the whole disk available, as the default installation only creates a single / partition. On the other hand, a RAM-based /tmp (as with tmpfs) will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily. Another alternative is to create a dedicated partition for /tmp from a separate volume or disk. One of the downsides of a disk-based dedicated partition is that it will be slower than tmpfs which is RAM-based. /tmp utilizing tmpfs can be resized using the size={size} parameter in the relevant entry in /etc/fstab." + remediation: "For specific configuration requirements of the /tmp mount for your environment, modify /etc/fstab or tmp.mount unit file: Using /etc/fstab: Configure /etc/fstab as appropriate: Example: tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 -OR- Using a tmp.mount unit file: Run the following command to create the tmp.mount file is the correct location: # cp -v /usr/share/systemd/tmp.mount /etc/systemd/system/ Edit /etc/systemd/system/tmp.mount to configure the /tmp mount: Example: # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. [Unit] Description=Temporary Directory (/tmp) Documentation=https://systemd.io/TEMPORARY_DIRECTORIES Documentation=man:file-hierarchy(7) Documentation=https://www.freedesktop.org/wiki/Software/systemd/APIFileSystem s ConditionPathIsSymbolicLink=!/tmp DefaultDependencies=no Conflicts=umount.target Before=local-fs.target umount.target After=swap.target [Mount] What=tmpfs Where=/tmp Type=tmpfs Options=mode=1777,strictatime,nosuid,nodev,noexec [Install] WantedBy=local-fs.target Run the following command to reload the systemd daemon with the updated tmp.mount unit file: # systemctl daemon-reload Run the following command to enable and start tmp.mount # systemctl --now enable tmp.mount Note: A reboot may be required to transition to /tmp mounted to tmpfs." + references: + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + - "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html" + compliance: + - cis: ["1.1.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /tmp -> r:\s*/tmp\s' + + # 1.1.2.2 Ensure nodev option set on /tmp partition. (Automated) + - id: 19001 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot create block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /tmp -> r:\s*/tmp\s && r:nodev' + + # 1.1.2.3 Ensure noexec option set on /tmp partition. (Automated) + - id: 19002 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022", "M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /tmp -> r:\s*/tmp\s && r:noexec' + + # 1.1.2.4 Ensure nosuid option set on /tmp partition. (Automated) + - id: 19003 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022", "M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /tmp -> r:\s*/tmp\s && r:nosuid' + + # 1.1.3.1 Ensure separate partition exists for /var. (Automated) + - id: 19004 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "The reasoning for mounting /var on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behaviour. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /var -> r:\s*/var\s' + + # 1.1.3.2 Ensure nodev option set on /var partition. (Automated) + - id: 19005 + title: "Ensure nodev option set on /var partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var filesystem is not intended to support devices, set this option to ensure that users cannot create block or character special devices in /var." + remediation: "IF the /var partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /var -> r:\s*/var\s && r:nodev' + + # 1.1.3.3 Ensure nosuid option set on /var partition. (Automated) + - id: 19006 + title: "Ensure nosuid option set on /var partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var." + remediation: "IF the /var partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /var -> r:\s*/var\s && r:nosuid' + + # 1.1.4.1 Ensure separate partition exists for /var/tmp. (Automated) + - id: 19007 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications. Temporary files residing in /var/tmp are to be preserved between reboots." + rationale: "The reasoning for mounting /var/tmp on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/tmp directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/tmp and cause the potential disruption to daemons as the disk is full. Fine grained control over the mount Configuring /var/tmp as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var/tmp may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /var/tmp -> r:\s*/var/tmp\s' + + # 1.1.4.2 Ensure nodev option set on /var/tmp partition. (Automated) + - id: 19008 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot create block or character special devices in /var/tmp." + remediation: "IF the /var/tmp partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c: findmnt -kn /var/tmp -> r:\s*/var/tmp\s && r:nodev' + + # 1.1.4.3 Ensure noexec option set on /var/tmp partition. (Automated) + - id: 19009 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "IF the /var/tmp partition exists, edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022", "M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /var/tmp -> r:\s*/var/tmp\s && r:noexec' + + # 1.1.4.4 Ensure nosuid option set on /var/tmp partition. (Automated) + - id: 19010 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "IF the /var/tmp partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022", "M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /var/tmp -> r:\s*/var/tmp\s && r:nosuid' + + # 1.1.5.1 Ensure separate partition exists for /var/log. (Automated) + - id: 19011 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "The reasoning for mounting /var/log on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log directory contains log files which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. Fine grained control over the mount Configuring /var/log as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of log data As /var/log contains log files, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.5.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt -kn /var/log -> r:\s*/var/log\s' + + # 1.1.5.2 Ensure nodev option set on /var/log partition. (Automated) + - id: 19012 + title: "Ensure nodev option set on /var/log partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log filesystem is not intended to support devices, set this option to ensure that users cannot create block or character special devices in /var/log." + remediation: "IF the /var/log partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /var/log -> r:\s*/var/log\s && r:nodev' + + # 1.1.5.3 Ensure noexec option set on /var/log partition. (Automated) + - id: 19013 + title: "Ensure noexec option set on /var/log partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot run executable binaries from /var/log." + remediation: "IF the /var/log partition exists, edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /var/log -> r:\s*/var/log\s && r:noexec' + + # 1.1.5.4 Ensure nosuid option set on /var/log partition. (Automated) + - id: 19014 + title: "Ensure nosuid option set on /var/log partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot create setuid files in /var/log." + remediation: "IF the /var/log partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /var/log -> r:\s*/var/log\s && r:nosuid' + + # 1.1.6.1 Ensure separate partition exists for /var/log/audit. (Automated) + - id: 19015 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "The reasoning for mounting /var/log/audit on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log/audit directory contains the audit.log file which can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/log/audit and cause auditd to trigger it's space_left_action as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var/log/audit as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of audit data As /var/log/audit contains audit logs, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.6.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt -kn /var/log/audit -> r:\s*/var/log/audit\s' + + # 1.1.6.2 Ensure nodev option set on /var/log/audit partition. (Automated) + - id: 19016 + title: "Ensure nodev option set on /var/log/audit partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log/audit filesystem is not intended to support devices, set this option to ensure that users cannot create block or character special devices in /var/log/audit." + remediation: "IF the /var/log/audit partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /var/log/audit -> r:\s*/var/log/audit\s && r:nodev' + + # 1.1.6.3 Ensure noexec option set on /var/log/audit partition. (Automated) + - id: 19017 + title: "Ensure noexec option set on /var/log/audit partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log/audit filesystem is only intended for audit logs, set this option to ensure that users cannot run executable binaries from /var/log/audit." + remediation: "IF the /var/log/audit partition exists, edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /var/log/audit -> r:\s*/var/log/audit\s && r:noexec' + + # 1.1.6.4 Ensure nosuid option set on /var/log/audit partition. (Automated) + - id: 19018 + title: "Ensure nosuid option set on /var/log/audit partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log/audit filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var/log/audit." + remediation: "IF the /var/log/audit partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /var/log/audit -> r:\s*/var/log/audit\s && r:nosuid' + + # 1.1.7.1 Ensure separate partition exists for /home. (Automated) + - id: 19019 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "The reasoning for mounting /home on a separate partition is as follows. Protection from resource exhaustion The default installation only creates a single / partition. Since the /home directory contains user generated data, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /home and impact all local users. Fine grained control over the mount Configuring /home as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. In the case of /home options such as usrquota/grpquota may be considered to limit the impact that users can have on each other with regards to disk resource exhaustion. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of user data As /home contains user data, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.7.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /home -> r:\s*/home\s' + + # 1.1.7.2 Ensure nodev option set on /home partition. (Automated) + - id: 19020 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /home filesystem is not intended to support devices, set this option to ensure that users cannot create block or character special devices in /home." + remediation: "IF the /home partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /home -> r:\s*/home\s && r:nodev' + + # 1.1.7.3 Ensure nosuid option set on /home partition. (Automated) + - id: 19021 + title: "Ensure nosuid option set on /home partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /home filesystem is only intended for user file storage, set this option to ensure that users cannot create setuid files in /home." + remediation: "IF the /home partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /home -> r:\s*/home\s && r:nosuid' + + # 1.1.8.1 Ensure nodev option set on /dev/shm partition. (Automated) + - id: 19022 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Example: tmpfs /dev/shm tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm NOTE It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /dev/shm -> r:\s*/dev/shm\s && r:nodev' + + # 1.1.8.2 Ensure noexec option set on /dev/shm partition. (Automated) + - id: 19023 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Example: tmpfs /dev/shm tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm Note: It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /dev/shm -> r:\s*/dev/shm\s && r:noexec' + + # 1.1.8.3 Ensure nosuid option set on /dev/shm partition. (Automated) + - id: 19024 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Example: tmpfs /dev/shm tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm Note: It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt -kn /dev/shm -> r:\s*/dev/shm\s && r:nosuid' + + # 1.1.9 Disable Automounting. (Automated) + - id: 19025 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in the filesystem even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations are considered adequate there is little value add in turning off automounting." + remediation: "If there are no other packages that depends on autofs, remove the package with: # apt purge autofs -OR- if there are dependencies on the autofs package: Run the following commands to mask autofs: # systemctl stop autofs # systemctl mask autofs." + compliance: + - cis: ["1.1.9"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + - mitre_techniques: ["T1068", "T1203", "T1211", "T1212"] + condition: any + rules: + - "c: dpkg -s autofs -> r:package 'autofs' is not installed" + - "c: systemctl is-enabled autofs -> r:No such file or directory|disabled" + + # 1.1.10 Disable USB Storage. (Automated) - Not Implemented + + # 1.2.1 Ensure AIDE is installed. (Automated) + - id: 19026 + title: "Ensure AIDE is installed." + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Install AIDE using the appropriate package manager or manual installation: # apt install aide aide-common Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Run the following commands to initialize AIDE: # aideinit # mv /var/lib/aide/aide.db.new /var/lib/aide/aide.db." + compliance: + - cis: ["1.2.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_techniques: ["T1036", "T1036.002", "T1036.003", "T1036.004", "T1036.005", "T1565", "T1565.001"] + - nist_sp_800-53: ["AC-6(9)"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:dpkg -s aide -> r:install ok installed" + - "c:dpkg -s aide-common -> r:install ok installed" + + # 1.2.2 Ensure filesystem integrity is regularly checked. (Automated) + - id: 19027 + title: "Ensure filesystem integrity is regularly checked." + description: "Periodic checking of the filesystem integrity is needed to detect changes to the filesystem." + rationale: "Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion." + remediation: "If cron will be used to schedule and run aide check: Run the following command: # crontab -u root -e Add the following line to the crontab: 0 5 * * * /usr/bin/aide.wrapper --config /etc/aide/aide.conf --check OR If aidecheck.service and aidecheck.timer will be used to schedule and run aide check: Create or edit the file /etc/systemd/system/aidecheck.service and add the following lines: [Unit] Description=Aide Check [Service] Type=simple ExecStart=/usr/bin/aide.wrapper --config /etc/aide/aide.conf --check [Install] WantedBy=multi-user.target Create or edit the file /etc/systemd/system/aidecheck.timer and add the following lines: [Unit] Description=Aide check every day at 5AM [Timer] OnCalendar=*-*-* 05:00:00 Unit=aidecheck.service [Install] WantedBy=multi-user.target Run the following commands: # chown root:root /etc/systemd/system/aidecheck.* # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl daemon-reload # systemctl enable aidecheck.service # systemctl --now enable aidecheck.timer." + references: + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.service" + - "https://github.com/konstruktoid/hardening/blob/master/config/aidecheck.timer" + compliance: + - cis: ["1.2.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1036", "T1036.002", "T1036.003", "T1036.004", "T1036.005", "T1565", "T1565.001"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:systemctl is-enabled aidecheck.service -> r:enabled" + - "c:systemctl is-enabled aidecheck.timer -> r:enabled" + - "c:systemctl status aidecheck.timer -> r:Active: active" + + # 1.3.1 Ensure updates, patches, and additional security software are installed. (Manual) - Not Implemented + # 1.3.2 Ensure package manager repositories are configured. (Manual) - Not Implemented + # 1.3.3 Ensure GPG keys are configured. (Manual) Not Implemented + + # 1.4.1 Ensure bootloader password is set. (Automated) + - id: 19028 + title: "Ensure bootloader password is set." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off AppArmor at boot time)." + impact: 'If password protection is enabled, only the designated superuser can edit a GRUB 2 menu item by pressing "e" or access the GRUB 2 command line by pressing "c" If GRUB 2 is set up to boot automatically to a password-protected menu entry the user has no option to back out of the password prompt to select another menu entry. Holding the SHIFT key will not display the menu in this case. The user must enter the correct username and password. If unable to do so, the configuration files will have to be edited via a LiveCD or other means to fix the problem You can add --unrestricted to the menu entries to allow the system to boot without entering a password. A password will still be required to edit menu items. More Information: https://help.ubuntu.com/community/Grub2/Passwords.' + remediation: 'Create an encrypted password with grub-mkpasswd-pbkdf2: # grub-mkpasswd-pbkdf2 Enter password: Reenter password: PBKDF2 hash of your password is Add the following into a custom /etc/grub.d configuration file: cat < EOF The superuser/user information and password should not be contained in the /etc/grub.d/00_header file as this file could be overwritten in a package update. If there is a requirement to be able to boot/reboot without entering the password, edit /etc/grub.d/10_linux and add --unrestricted to the line CLASS= Example: CLASS="--class gnu-linux --class gnu --class os --unrestricted" Run the following command to update the grub2 configuration: # update-grub.' + compliance: + - cis: ["1.4.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1046"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1542"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*set superusers' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*password' + + # 1.4.2 Ensure permissions on bootloader config are configured. (Automated) + - id: 19029 + title: "Ensure permissions on bootloader config are configured." + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub/grub.cfg # chmod u-x,go-rwx /boot/grub/grub.cfg." + compliance: + - cis: ["1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005", "TA0007"] + - mitre_techniques: ["T1542"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'c:stat /boot/grub/grub.cfg -> r:Access:\s*\(0600/-r--------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat /boot/grub/grub.cfg -> r:Access:\s*\(0400/-r--------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.4.3 Ensure authentication required for single user mode. (Automated) + - id: 19030 + title: "Ensure authentication required for single user mode." + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root." + compliance: + - cis: ["1.4.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> r:^root:\p:' + + # 1.5.1 Ensure prelink is not installed. (Automated) + - id: 19031 + title: "Ensure prelink is not installed." + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following command to restore binaries to normal: # prelink -ua Uninstall prelink using the appropriate package manager or manual installation: # apt purge prelink." + compliance: + - cis: ["1.5.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1050"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1055", "T1055.009", "T1065", "T1065.001"] + - nist_sp_800-53: ["AC-6(9)"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:dpkg -s prelink -> r:package 'prelink' is not installed" + + # 1.5.2 Ensure address space layout randomization (ASLR) is enabled. (Automated) - Not Implemented + # 1.5.3 Ensure ptrace_scope is restricted. (Automated) - Not Implemented + + # 1.5.4 Ensure Automatic Error Reporting is not enabled. (Automated) + - id: 19032 + title: "Ensure Automatic Error Reporting is not enabled." + description: "The Apport Error Reporting Service automatically generates crash reports for debugging." + rationale: "Apport collects potentially sensitive data, such as core dumps, stack traces, and log files. They can contain passwords, credit card numbers, serial numbers, and other private material." + remediation: "Edit /etc/default/apport and add or edit the enabled parameter to equal 0: enabled=0 Run the following commands to stop and disable the apport service # systemctl stop apport.service # systemctl --now disable apport.service -- OR -- Run the following command to remove the apport package: # apt purge apport." + compliance: + - cis: ["1.5.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s apport -> !r:enabled" + - "c:systemctl is-active apport.service -> !r:active" + + # 1.5.5 Ensure core dumps are restricted. (Automated) - Not Implemented + + # 1.6.1.1 Ensure AppArmor is installed. (Automated) + - id: 19033 + title: "Ensure AppArmor is installed." + description: "AppArmor provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Install AppArmor. # apt install apparmor apparmor-utils." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:dpkg -s apparmor -> r:install ok installed" + + # 1.6.1.2 Ensure AppArmor is enabled in the bootloader configuration. (Automated) + - id: 19034 + title: "Ensure AppArmor is enabled in the bootloader configuration." + description: "Configure AppArmor to be enabled at boot time and verify that it has not been overwritten by the bootloader boot parameters. Note: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + rationale: "AppArmor must be enabled at boot time in your bootloader configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/grub and add the apparmor=1 and security=apparmor parameters to the GRUB_CMDLINE_LINUX= line GRUB_CMDLINE_LINUX="apparmor=1 security=apparmor" Run the following command to update the grub2 configuration: # update-grub.' + compliance: + - cis: ["1.6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && r:apparmor=1' + - 'f:/boot/grub/grub.cfg -> r:^\s*\t*linux && r:security=apparmor' + + # 1.6.1.3 Ensure all AppArmor Profiles are in enforce or complain mode. (Automated) + - id: 19035 + title: "Ensure all AppArmor Profiles are in enforce or complain mode." + description: "AppArmor profiles define what resources applications are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* OR Run the following command to set all profiles to complain mode: # aa-complain /etc/apparmor.d/* Note: Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:apparmor_status -> n:^(\d+)\s+profiles\s+are\s+loaded compare > 0' + - "c:apparmor_status -> r:0 processes are unconfined" + + # 1.6.1.4 Ensure all AppArmor Profiles are enforcing. (Automated) + - id: 19036 + title: "Ensure all AppArmor Profiles are enforcing." + description: "AppArmor profiles define what resources applications are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Note: Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:apparmor_status -> n:^(\d+)\s+profiles\s+are\s+loaded compare > 0' + - 'c:apparmor_status -> n:^(\d+)\s+profiles\s+are\s+in\s+enforce\s+mode compare > 0' + - 'c:apparmor_status -> r:^0\s*profiles\s+are\s+in\s+complain\s+mode' + - 'c:apparmor_status -> r:^0\s*processes\s+are\s+unconfined' + + # 1.7.1 Ensure message of the day is configured properly. (Automated) + - id: 19037 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform. Add or update the message text to follow local site policy. Example Text: # echo \"Authorized use only. All activity may be monitored and reported.\" > /etc/issue.net -- OR -- If the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + condition: any + rules: + - 'not f:/etc/motd -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + - "not f:/etc/motd" + + # 1.7.2 Ensure local login warning banner is configured properly. (Automated) + - id: 19038 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform. Add or update the message text to follow local site policy. Example Text: # echo \"Authorized use only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.2"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + # 1.7.3 Ensure remote login warning banner is configured properly. (Automated) + - id: 19039 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform. Add or update the message text to follow local site policy. Example Text: # echo \"Authorized use only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1018", "T1082", "T1592", "T1592.004"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + # 1.7.4 Ensure permissions on /etc/motd are configured. (Automated) + - id: 19040 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd : # chown root:root $(readlink -e /etc/motd) # chmod u-x,go-wx $(readlink -e /etc/motd) -- OR -- Run the following command to remove the /etc/motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - "not f:/etc/motd" + + # 1.7.5 Ensure permissions on /etc/issue are configured. (Automated) + - id: 19041 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue: # chown root:root $(readlink -e /etc/issue) # chmod u-x,go-wx $(readlink -e /etc/issue)." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured. (Automated) + - id: 19042 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root $(readlink -e /etc/issue.net) # chmod u-x,go-wx $(readlink -e /etc/issue.net)." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 1.8.1 Ensure GNOME Display Manager is removed. (Automated) + - id: 19043 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + impact: "Removing the GNOME Display manager will remove the Graphical User Interface (GUI) from the system." + remediation: "Run the following command to uninstall gdm3: # apt purge gdm3." + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg -s gdm3 -> r: package 'gdm3' is not installed" + + # 1.8.2 Ensure GDM login banner is configured. (Automated) - Not Implemented + # 1.8.3 Ensure GDM disable-user-list option is enabled. (Automated) - Not Implemented + # 1.8.4 Ensure GDM screen locks when the user is idle. (Automated) - Not Implemented + # 1.8.5 Ensure GDM screen locks cannot be overridden. (Automated) - Not Implemented + # 1.8.6 Ensure GDM automatic mounting of removable media is disabled. (Automated) - Not Implemented + # 1.8.7 Ensure GDM disabling automatic mounting of removable media is not overridden. (Automated) - Not Implemented + # 1.8.8 Ensure GDM autorun-never is enabled. (Automated) - Not Implemented + # 1.8.9 Ensure GDM autorun-never is not overridden. (Automated) - Not Implemented + + # 1.8.10 Ensure XDCMP is not enabled. (Automated) + - id: 19044 + title: "Ensure XDCMP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. - XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user - XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server." + remediation: "Edit the file /etc/gdm3/custom.conf and remove the line: Enable=true." + compliance: + - cis: ["1.8.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1050"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1040", "T1056", "T1056.001", "T1557"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not f:/etc/gdm3/custom.conf -> r:^\s*Enable\s*=\s*true' + + # 2.1.1.1 Ensure a single time synchronization daemon is in use. (Automated) + - id: 19045 + title: "Ensure a single time synchronization daemon is in use." + description: "System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them. Note: - On virtual systems where host based time synchronization is available consult your virtualization software documentation and verify that host based synchronization is in use and follows local site policy. In this scenario, this section should be skipped - Only one time synchronization method should be in use on the system. Configuring multiple time synchronization methods could lead to unexpected or unreliable results." + rationale: "Time synchronization is important to support time sensitive security mechanisms and ensures log files have consistent time records across the enterprise, which aids in forensic investigations." + remediation: "On physical systems, and virtual systems where host based time synchronization is not available. Select one of the three time synchronization daemons; chrony (1), systemd-timesyncd (2), or ntp (3), and following the remediation procedure for the selected daemon. Note: enabling more than one synchronization daemon could lead to unexpected or unreliable results: 1. chrony Run the following command to install chrony: # apt install chrony Run the following commands to stop and mask the systemd-timesyncd daemon: # systemctl stop systemd-timesyncd.service # systemctl --now mask systemd-timesyncd.service Run the following command to remove the ntp package: # apt purge ntp NOTE: - Subsection: Configure chrony should be followed - Subsections: Configure systemd-timesyncd and Configure ntp should be skipped 2. systemd-timesyncd Run the following command to remove the chrony package: # apt purge chrony Run the following command to remove the ntp package: # apt purge ntp NOTE: - Subsection: Configure systemd-timesyncd should be followed - Subsections: Configure chrony and Configure ntp should be skipped 3. ntp Run the following command to install ntp: # apt install ntp Run the following commands to stop and mask the systemd-timesyncd daemon: # systemctl stop systemd-timesyncd.service # systemctl --now mask systemd-timesyncd.service Run the following command to remove the chrony package: # apt purge chrony NOTE: - Subsection: Configure ntp should be followed - Subsections: Configure chrony and Configure systemd-timesyncd should be skipped." + compliance: + - cis: ["2.1.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: any + rules: + - "c:dpkg -s ntp -> r:install ok installed" + - "c:dpkg -s chrony -> r:install ok installed" + - "c:systemctl is-enabled systemd-timesyncd -> r:^enabled" + + # 2.1.2.1 Ensure chrony is configured with authorized timeserver. (Manual) + - id: 19046 + title: "Ensure chrony is configured with authorized timeserver." + description: "-> server - The server directive specifies an NTP server which can be used as a time source. The client-server relationship is strictly hierarchical: a client might synchronize its system time to that of the server, but the server's system time will never be influenced by that of a client. - This directive can be used multiple times to specify multiple servers. o The directive is immediately followed by either the name of the server, or its IP address. -> pool - The syntax of this directive is similar to that for the server directive, except that it is used to specify a pool of NTP servers rather than a single NTP server. The pool name is expected to resolve to multiple addresses which might change over time. - This directive can be used multiple times to specify multiple pools. - All options valid in the server directive can be used in this directive too." + rationale: "Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: "Edit /etc/chrony/chrony.conf or a file ending in .sources in /etc/chrony/sources.d/ and add or edit server or pool lines as appropriate according to local site policy: <[server|pool]> <[remote-server|remote-pool]> Examples: pool directive: pool time.nist.gov iburst maxsources 4 #The maxsources option is unique to the pool directive server directive: server time-a-g.nist.gov iburst server 132.163.97.3 iburst server time-d-b.nist.gov iburst Run one of the following commands to load the updated time sources into chronyd running config: # systemctl restart chronyd - OR if sources are in a .sources file - # chronyc reload sources OR If another time synchronization service is in use on the system, run the following command to remove chrony from the system: # apt purge chrony." + compliance: + - cis: ["2.1.2.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:ps -ef -> r:^_chrony && r:/chronyd" + - 'f:/etc/chrony/chrony.conf -> r:^server\.+|^pool\.+' + + # 2.1.2.2 Ensure chrony is running as user _chrony. (Automated) + - id: 19047 + title: "Ensure chrony is running as user _chrony." + description: "The chrony package is installed with a dedicated user account _chrony. This account is granted the access required by the chronyd service." + rationale: "The chronyd service should run with only the required privileges." + remediation: "Add or edit the user line to /etc/chrony/chrony.conf or a file ending in .conf in /etc/chrony/conf.d/: user _chrony OR If another time synchronization service is in use on the system, run the following command to remove chrony from the system: # apt purge chrony." + compliance: + - cis: ["2.1.2.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "f:/etc/chrony/chrony.conf -> r:^user _chrony" + + # 2.1.2.3 Ensure chrony is enabled and running. (Automated) + - id: 19048 + title: "Ensure chrony is enabled and running." + description: "chrony is a daemon for synchronizing the system clock across the network." + rationale: "chrony needs to be enabled and running in order to synchronize the system to a timeserver. Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: "IF chrony is in use on the system, run the following commands: Run the following command to unmask chrony.service: # systemctl unmask chrony.service Run the following command to enable and start chrony.service: # systemctl --now enable chrony.service OR If another time synchronization service is in use on the system, run the following command to remove chrony: # apt purge chrony." + compliance: + - cis: ["2.1.2.3"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled chrony.service -> r:^enabled" + - "c:systemctl is-active chrony.service -> r:^active" + + # 2.1.3.1 Ensure systemd-timesyncd configured with authorized timeserver. (Automated) + - id: 19049 + title: "Ensure systemd-timesyncd configured with authorized timeserver." + description: "NTP= - A space-separated list of NTP server host names or IP addresses. During runtime this list is combined with any per-interface NTP servers acquired from systemd-networkd.service(8). systemd-timesyncd will contact all configured system or per-interface servers in turn, until one responds. When the empty string is assigned, the list of NTP servers is reset, and all prior assignments will have no effect. This setting defaults to an empty list. FallbackNTP= - A space-separated list of NTP server host names or IP addresses to be used as the fallback NTP servers. Any per-interface NTP servers obtained from systemd-networkd.service(8) take precedence over this setting, as do any servers set via NTP= above. This setting is hence only relevant if no other NTP server information is known. When the empty string is assigned, the list of NTP servers is reset, and all prior assignments will have no effect. If this option is not given, a compiled-in list of NTP servers is used." + rationale: "Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: "Edit /etc/systemd/timesyncd.conf and add the NTP= and/or FallbackNTP= lines to the [Time] section: Example: [Time] NTP=time.nist.gov # Uses the generic name for NIST's time servers -AND/OR- FallbackNTP=time-a-g.nist.gov time-b-g.nist.gov time-c-g.nist.gov # Space separated list of NIST time servers Note: Servers added to these line(s) should follow local site policy. NIST servers are for example. Example script: The following example script will add the example NIST time servers to /etc/systemd/timesyncd.conf #!/usr/bin/env bash { l_ntp_ts=\"time.nist.gov\" l_ntp_fb=\"time-a-g.nist.gov time-b-g.nist.gov time-c-g.nist.gov\" l_conf_file=\"/etc/systemd/timesyncd.conf\" if ! grep -Ph '^\\h*NTP=\\H+' \"$l_conf_file\"; then ! grep -Pqs '^\\h*\\[Time\\]' \"$l_conf_file\" && echo \"[Time]\" >> \"$l_conf_file\" echo \"NTP=$l_ntp_ts\" >> \"$l_conf_file\" fi if ! grep -Ph '^\\h*FallbackNTP=\\H+' \"$l_conf_file\"; then ! grep -Pqs '^\\h*\\[Time\\]' \"$l_conf_file\" && echo \"[Time]\" >> \"$l_conf_file\" echo \"FallbackNTP=$l_ntp_fb\" >> \"$l_conf_file\" fi } Run the following command to reload the systemd-timesyncd configuration: # systemctl try-reload-or-restart systemd-timesyncd -OR- If another time synchronization service is in use on the system, run the following command to stop and mask systemd-timesyncd: # systemctl --now mask systemd-timesyncd." + references: + - "https://www.freedesktop.org/software/systemd/man/timesyncd.conf.html" + - "https://tf.nist.gov/tf-cgi/servers.cgi" + compliance: + - cis: ["2.1.3.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "d:/etc/systemd" + - 'd:/etc/systemd -> r:\.+.conf$' + - 'd:/etc/systemd -> r:\.+.conf$ -> r:^\s*NTP=|^\s*FallbackNTP=' + + # 2.1.3.2 Ensure systemd-timesyncd is enabled and running. (Manual) + - id: 19050 + title: "Ensure systemd-timesyncd is enabled and running." + description: "systemd-timesyncd is a daemon that has been added for synchronizing the system clock across the network." + rationale: "systemd-timesyncd needs to be enabled and running in order to synchronize the system to a timeserver. Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: "IF systemd-timesyncd is in use on the system, run the following commands: Run the following command to unmask systemd-timesyncd.service: # systemctl unmask systemd-timesyncd.service Run the following command to enable and start systemd-timesyncd.service: # systemctl --now enable systemd-timesyncd.service OR If another time synchronization service is in use on the system, run the following command to stop and mask systemd-timesyncd: # systemctl --now mask systemd-timesyncd.service." + compliance: + - cis: ["2.1.3.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-timesyncd.service -> r:^enabled" + - "c:systemctl is-active systemd-timesyncd.service -> r:^active" + + # 2.1.4.1 Ensure ntp access control is configured. (Automated) + - id: 19051 + title: "Ensure ntp access control is configured." + description: 'ntp Access Control Commands: restrict address [mask mask] [ippeerlimit int] [flag ...] The address argument expressed in dotted-quad form is the address of a host or network. Alternatively, the address argument can be a valid host DNS name. The mask argument expressed in dotted-quad form defaults to 255.255.255.255, meaning that the address is treated as the address of an individual host. A default entry (address 0.0.0.0, mask 0.0.0.0) is always included and is always the first entry in the list. Note: the text string default, with no mask option, may be used to indicate the default entry. The ippeerlimit directive limits the number of peer requests for each IP to int, where a value of -1 means "unlimited", the current default. A value of 0 means "none". There would usually be at most 1 peering request per IP, but if the remote peering requests are behind a proxy there could well be more than 1 per IP. In the current implementation, flag always restricts access, i.e., an entry with no flags indicates that free access to the server is to be given. The flags are not orthogonal, in that more restrictive flags will often make less restrictive ones redundant. The flags can generally be classed into two categories, those which restrict time service and those which restrict informational queries and attempts to do run-time reconfiguration of the server. One or more of the following flags may be specified: - kod - If this flag is set when an access violation occurs, a kiss-o''-death (KoD) packet is sent. KoD packets are rate limited to no more than one per second. If another KoD packet occurs within one second after the last one, the packet is dropped. - limited - Deny service if the packet spacing violates the lower limits specified in the discard command. A history of clients is kept using the monitoring capability of ntpd. Thus, monitoring is always active as long as there is a restriction entry with the limited flag. - lowpriotrap - Declare traps set by matching hosts to be low priority. The number of traps a server can maintain is limited (the current limit is 3). Traps are usually assigned on a first come, first served basis, with later trap requestors being denied service. This flag modifies the assignment algorithm by allowing low priority traps to be overridden by later requests for normal priority traps. - noepeer - Deny ephemeral peer requests, even if they come from an authenticated source. Note that the ability to use a symmetric key for authentication may be restricted to one or more IPs or subnets via the third field of the ntp.keys file. This restriction is not enabled by default, to maintain backward compatibility. Expect noepeer to become the default in ntp-4.4. - nomodify - Deny ntpq and ntpdc queries which attempt to modify the state of the server (i.e., run time reconfiguration). Queries which return information are permitted. - noquery - Deny ntpq and ntpdc queries. Time service is not affected. - nopeer - Deny unauthenticated packets which would result in mobilizing a new association. This includes broadcast and symmetric active packets when a configured association does not exist. It also includes pool associations, so if you want to use servers from a pool directive and also want to use nopeer by default, you''ll want a restrict source ... line as well that does not include the nopeer directive. - noserve - Deny all packets except ntpq and ntpdc queries. - notrap - Decline to provide mode 6 control message trap service to matching hosts. The trap service is a subsystem of the ntpq control message protocol which is intended for use by remote event logging programs. - notrust - Deny service unless the packet is cryptographically authenticated. - ntpport - This is actually a match algorithm modifier, rather than a restriction flag. Its presence causes the restriction entry to be matched only if the source port in the packet is the standard NTP UDP port (123). Both ntpport and non-ntpport may be specified. The ntpport is considered more specific and is sorted later in the list.' + rationale: "If ntp is in use on the system, proper configuration is vital to ensuring time synchronization is accurate." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery OR If another time synchronization service is in use on the system, run the following command to remove ntp from the system: # apt purge ntp." + references: + - "http://www.ntp.org/" + compliance: + - cis: ["2.1.4.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1070", "T1070.002", "T1498", "T1498.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - 'f:/etc/ntp.conf -> r:^restrict\s*\t*-4\s*\t*default|^restrict\s*\t*default && r:\s*kod && r:\s*nomodify && r:\s*notrap && r:\s*nopeer && r:\s*noquery' + - 'f:/etc/ntp.conf -> r:^restrict\s*\t*-6\s*\t*default && r:\s*kod && r:\s*nomodify && r:\s*notrap && r:\s*nopeer && r:\s*noquery' + + # 2.1.4.2 Ensure ntp is configured with authorized timeserver. (Manual) + - id: 19052 + title: "Ensure ntp is configured with authorized timeserver." + description: 'The various modes are determined by the command keyword and the type of the required IP address. Addresses are classed by type as (s) a remote server or peer (IPv4 class A, B and C), (b) the broadcast address of a local interface, (m) a multicast address (IPv4 class D), or (r) a reference clock address (127.127.x.x). Note: That only those options applicable to each command are listed below. Use of options not listed may not be caught as an error, but may result in some weird and even destructive behavior. If the Basic Socket Interface Extensions for IPv6 (RFC-2553) is detected, support for the IPv6 address family is generated in addition to the default support of the IPv4 address family. In a few cases, including the reslist billboard generated by ntpq or ntpdc, IPv6 addresses are automatically generated. IPv6 addresses can be identified by the presence of colons ":" in the address field. IPv6 addresses can be used almost everywhere where IPv4 addresses can be used, with the exception of reference clock addresses, which are always IPv4. Note: In contexts where a host name is expected, a -4 qualifier preceding the host name forces DNS resolution to the IPv4 namespace, while a -6 qualifier forces DNS resolution to the IPv6 namespace. See IPv6 references for the equivalent classes for that address family. - pool - For type s addresses, this command mobilizes a persistent client mode association with a number of remote servers. In this mode the local clock can synchronized to the remote server, but the remote server can never be synchronized to the local clock. - server - For type s and r addresses, this command mobilizes a persistent client mode association with the specified remote server or local radio clock. In this mode the local clock can synchronized to the remote server, but the remote server can never be synchronized to the local clock. This command should not be used for type b or m addresses.' + rationale: "Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: "Edit /etc/ntp.conf and add or edit server or pool lines as appropriate according to local site policy: <[server|pool]> <[remote-server|remote-pool]> Examples: pool mode: pool time.nist.gov iburst server mode: server time-a-g.nist.gov iburst server 132.163.97.3 iburst server time-d-b.nist.gov iburst Run the following command to load the updated time sources into ntp running config: # systemctl restart ntp OR If another time synchronization service is in use on the system, run the following command to remove ntp from the system: # apt purge ntp." + references: + - "http://www.ntp.org/" + - "https://tf.nist.gov/tf-cgi/servers.cgi" + compliance: + - cis: ["2.1.4.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1070", "T1070.002", "T1498", "T1498.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "f:/etc/ntp.conf -> r:^pool" + - "f:/etc/ntp.conf -> r:^server" + + # 2.1.4.3 Ensure ntp is running as user ntp. (Automated) + - id: 19053 + title: "Ensure ntp is running as user ntp." + description: "The ntp package is installed with a dedicated user account ntp. This account is granted the access required by the ntpd daemon Note: - If chrony or systemd-timesyncd are used, ntp should be removed and this section skipped - This recommendation only applies if ntp is in use on the system - Only one time synchronization method should be in use on the system." + rationale: "The ntpd daemon should run with only the required privlidge." + remediation: "Add or edit the following line in /usr/lib/ntp/ntp-systemd-wrapper: RUNASUSER=ntp Run the following command to restart ntp.servocee: # systemctl restart ntp.service OR If another time synchronization service is in use on the system, run the following command to remove ntp from the system: # apt purge ntp." + references: + - "http://www.ntp.org/" + compliance: + - cis: ["2.1.4.3"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "f:/usr/lib/ntp/ntp-systemd-wrapper -> r:^RUNASUSER=ntp" + + # 2.1.4.4 Ensure ntp is enabled and running. (Automated) + - id: 19054 + title: "Ensure ntp is enabled and running." + description: "ntp is a daemon for synchronizing the system clock across the network." + rationale: "ntp needs to be enabled and running in order to synchronize the system to a timeserver. Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: "IF ntp is in use on the system, run the following commands: Run the following command to unmask ntp.service: # systemctl unmask ntp.service Run the following command to enable and start ntp.service: # systemctl --now enable ntp.service OR If another time synchronization service is in use on the system, run the following command to remove ntp: # apt purge ntp." + compliance: + - cis: ["2.1.4.4"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled ntp.service -> r:^enabled" + - "c:systemctl is-active ntp.service -> r:^active" + + # 2.2.1 Ensure X Window System is not installed. (Automated) + - id: 19055 + title: "Ensure X Window System is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: 'Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime, if provided by your distribution.' + remediation: "Remove the X Windows System packages: apt purge xserver-xorg*." + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' xserver-xorg -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' xserver-xorg -> r:install ok installed" + + # 2.2.2 Ensure Avahi Server is not installed. (Automated) + - id: 19056 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to remove avahi-daemon: # systemctl stop avahi-daaemon.service # systemctl stop avahi-daemon.socket # apt purge avahi-daemon." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' avahi-daemon -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' avahi-daemon -> r:install ok installed" + + # 2.2.3 Ensure CUPS is not installed. (Automated) + - id: 19057 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface." + impact: "Removing CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run one of the following commands to remove cups : # apt purge cups." + references: + - "http://www.cups.org." + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' cups -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' cups -> r:install ok installed" + + # 2.2.4 Ensure DHCP Server is not installed. (Automated) + - id: 19058 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove isc-dhcp-server: # apt purge isc-dhcp-server." + references: + - "http://www.isc.org/software/dhcp." + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' isc-dhcp-server -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' isc-dhcp-server -> r:install ok installed" + + # 2.2.5 Ensure LDAP server is not installed. (Automated) + - id: 19059 + title: "Ensure LDAP server is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run one of the following commands to remove slapd: # apt purge slapd." + references: + - "http://www.openldap.org." + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' slapd -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' slapd -> r:install ok installed" + + # 2.2.6 Ensure NFS is not installed. (Automated) + - id: 19060 + title: "Ensure NFS is not installed." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares, it is recommended that the nfs-kernel-server package be removed to reduce the remote attack surface." + remediation: "Run the following command to remove nfs: # apt purge nfs-kernel-server." + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nfs-kernel-server -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nfs-kernel-server -> r:install ok installed" + + # 2.2.7 Ensure DNS Server is not installed. (Automated) + - id: 19061 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following commands to disable DNS server: # apt purge bind9." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' bind9 -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' bind9 -> r:install ok installed" + + # 2.2.8 Ensure FTP Server is not installed. (Automated) + - id: 19062 + title: "Ensure FTP Server is not installed." + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # apt purge vsftpd." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' vsftpd -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' vsftpd -> r:install ok installed" + + # 2.2.9 Ensure HTTP server is not installed. (Automated) + - id: 19063 + title: "Ensure HTTP server is not installed." + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove apache2: # apt purge apache2." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' apache2 -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' apache2 -> r:install ok installed" + + # 2.2.10 Ensure IMAP and POP3 server are not installed. (Automated) + - id: 19064 + title: "Ensure IMAP and POP3 server are not installed." + description: "dovecot-imapd and dovecot-pop3d are an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run one of the following commands to remove dovecot-imapd and dovecot-pop3d: # apt purge dovecot-imapd dovecot-pop3d." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' dovecot-imapd -> r:install ok installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' dovecot-pop3d -> r:install ok installed" + + # 2.2.11 Ensure Samba is not installed. (Automated) + - id: 19065 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service should be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # apt purge samba." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1005", "T1039", "T1083", "T1135", "T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' samba -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' samba -> r:install ok installed" + + # 2.2.12 Ensure HTTP Proxy Server is not installed. (Automated) + - id: 19066 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove squid: # apt purge squid." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' squid -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' squid -> r:install ok installed" + + # 2.2.13 Ensure SNMP Server is not installed. (Automated) + - id: 19067 + title: "Ensure SNMP Server is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the snmpd package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. If SNMP v2 is absolutely necessary, modify the community strings' values. -." + remediation: "Run the following command to remove snmpd: # apt purge snmpd." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' snmp -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' snmp -> r:install ok installed" + + # 2.2.14 Ensure NIS Server is not installed. (Automated) + - id: 19068 + title: "Ensure NIS Server is not installed." + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed and other, more secure services be used." + remediation: "Run the following command to remove nis: # apt purge nis." + compliance: + - cis: ["2.2.14"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nis -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nis -> r:install ok installed" + + # 2.2.15 Ensure dnsmasq is not installed. (Automated) + - id: 19069 + title: "Ensure dnsmasq is not installed." + description: "dnsmasq is a lightweight tool that provides DNS caching, DNS forwarding and DHCP (Dynamic Host Configuration Protocol) services." + rationale: "Unless a system is specifically designated to act as a DNS caching, DNS forwarding and/or DHCP server, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove dnsmasq: # apt purge dnsmasq." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' dnsmaq -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' dnsmaq -> r:install ok installed" + + # 2.2.16 Ensure mail transfer agent is configured for local-only mode. (Automated) + - id: 19070 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Note: - This recommendation is designed around the postfix mail server. - Depending on your environment you may have an alternative MTA installed such as exim4. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1018", "T1210"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:ss -lntu -> r:\.*:25\.*LISTEN && !r:127.0.0.1:25\.*LISTEN|::1:25\.*LISTEN' + + # 2.2.17 Ensure rsync service is either not installed or is masked. (Automated) + - id: 19071 + title: "Ensure rsync service is either not installed or is masked." + description: "The rsync service can be used to synchronize files between systems over network links." + rationale: "The rsync service presents a security risk as the rsync protocol is unencrypted. The rsync package should be removed or if required for dependencies, the rsync service should be stopped and masked to reduce the attack area of the system." + remediation: "Run the following command to remove rsync: # apt purge rsync -- OR -- Run the following commands to stop and mask rsync: # systemctl stop rsync # systemctl mask rsync." + compliance: + - cis: ["2.2.17"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1105", "T1203", "T1210", "T1543", "T1543.002", "T1570"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' rsync -> r:unknown ok not-installed" + - "c:systemctl is-active rsync -> r:^inactive" + - "c:systemctl is-enabled rsync -> r:^masked" + + # 2.3.1 Ensure NIS Client is not installed. (Automated) + - id: 19072 + title: "Ensure NIS Client is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall nis: # apt purge nis." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nis -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nis -> r:install ok installed" + + # 2.3.2 Ensure rsh client is not installed. (Automated) + - id: 19073 + title: "Ensure rsh client is not installed." + description: "The rsh-client package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh-client package removes the clients for rsh, rcp and rlogin." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall rsh: # apt purge rsh-client." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1041", "M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1040", "T1203", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' rsh-client -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' rsh-client -> r:install ok installed" + + # 2.3.3 Ensure talk client is not installed. (Automated) + - id: 19074 + title: "Ensure talk client is not installed." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall talk: # apt purge talk." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1041", "M1042"] + - mitre_tactics: ["TA0006", "TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' talk -> r:unknown ok not-installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' talk -> r:no packages found matching talk" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' talk -> r:install ok installed" + + # 2.3.4 Ensure telnet client is not installed. (Automated) + - id: 19075 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall telnet: # apt purge telnet." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1041", "M1042"] + - mitre_tactics: ["TA0006", "TA0008"] + - mitre_techniques: ["T1040", "T1203", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' telnet -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' telnet -> r:install ok installed" + + # 2.3.5 Ensure LDAP client is not installed. (Automated) + - id: 19076 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Uninstall ldap-utils: # apt purge ldap-utils." + compliance: + - cis: ["2.3.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' ldap-utils -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' ldap-utils -> r:install ok installed" + + # 2.3.6 Ensure RPC is not installed. (Automated) + - id: 19077 + title: "Ensure RPC is not installed." + description: 'Remote Procedure Call (RPC) is a method for creating low level client server applications across different system architectures. It requires an RPC compliant client listening on a network port. The supporting package is rpcbind.".' + rationale: "If RPC is not required, it is recommended that this services be removed to reduce the remote attack surface." + remediation: "Run the following command to remove rpcbind: # apt purge rpcbind." + compliance: + - cis: ["2.3.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' rpcbind -> r:unknown ok not-installed" + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' rpcbind -> r:install ok installed" + + # 2.4 Ensure nonessential services are removed or masked. (Manual) - Not Implemented + + # 3.1.1 Ensure IPv6 status is identified. (Manual) + - id: 19078 + title: "Ensure IPv6 status is identified." + description: "Internet Protocol Version 6 (IPv6) is the most recent version of Internet Protocol (IP). It's designed to supply IP addressing and additional security to support the predicted growth of connected devices. IPv6 is based on 128-bit addressing and can support 340 undecillion addresses, which is 340 followed by 36 zeroes. Features of IPv6 - Hierarchical addressing and routing infrastructure - Stateful and Stateless configuration - Support for quality of service (QoS) - An ideal protocol for neighboring node interaction." + rationale: "IETF RFC 4038 recommends that applications are built with an assumption of dual stack. It is recommended that IPv6 be enabled and configured in accordance with Benchmark recommendations. If dual stack and IPv6 are not used in your environment, IPv6 may be disabled to reduce the attack surface of the system, and recommendations pertaining to IPv6 can be skipped. Note: It is recommended that IPv6 be enabled and configured unless this is against local site policy." + impact: "IETF RFC 4038 recommends that applications are built with an assumption of dual stack. When enabled, IPv6 will require additional configuration to reduce risk to the system." + remediation: "Enable or disable IPv6 in accordance with system requirements and local site policy." + compliance: + - cis: ["3.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1557", "T1595", "T1595.001", "T1595.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "f:/sys/module/ipv6/parameters/disable -> r:^0$" + + # 3.1.2 Ensure wireless interfaces are disabled. (Automated) - Not Implemented + + # 3.1.3 Ensure bluetooth is disabled. (Automated) + - id: 19079 + title: "Ensure bluetooth is disabled." + description: "Bluetooth is a short-range wireless technology standard that is used for exchanging data between devices over short distances. It employs UHF radio waves in the ISM bands, from 2.402 GHz to 2.48 GHz. It is mainly used as an alternative to wire connections." + rationale: "An attacker may be able to find a way to access or corrupt your data. One example of this type of activity is bluesnarfing, which refers to attackers using a Bluetooth connection to steal information off of your Bluetooth device. Also, viruses or other malicious code can take advantage of Bluetooth technology to infect other devices. If you are infected, your data may be corrupted, compromised, stolen, or lost." + impact: "Many personal electronic devices (PEDs) use Bluetooth technology. For example, you may be able to operate your computer with a wireless keyboard. Disabling Bluetooth will prevent these devices from connecting to the system." + remediation: "Run the following commands to stop and mask the Bluetooth service # systemctl stop bluetooth.service # systemctl mask bluetooth.service Note: A reboot may be required." + references: + - "https://www.cisa.gov/tips/st05-015" + compliance: + - cis: ["3.1.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "not c:systemctl is-enabled bluetooth.service -> r:^enabled" + - "not c:systemctl is-active bluetooth.service -> r:^active" + + # 3.1.4 Ensure DCCP is disabled. (Automated) - Not Implemented + # 3.1.5 Ensure SCTP is disabled. (Automated) - Not Implemented + # 3.1.6 Ensure RDS is disabled. (Automated) Not Implemented + # 3.1.7 Ensure TIPC is disabled. (Automated) - Not Implemented + + # 3.2.1 Ensure packet redirect sending is disabled. (Automated) - Not Implemented + # 3.2.2 Ensure IP forwarding is disabled. (Automated) - Not Implemented + + # 3.3.1 Ensure source routed packets are not accepted. (Automated) - Not Implemented + # 3.3.2 Ensure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.3 Ensure secure ICMP redirects are not accepted. (Automated) - Not Implemented + # 3.3.4 Ensure suspicious packets are logged. (Automated) - Not Implemented + # 3.3.5 Ensure broadcast ICMP requests are ignored. (Automated) - Not Implemented + # 3.3.6 Ensure bogus ICMP responses are ignored. (Automated) - Not Implemented + # 3.3.7 Ensure Reverse Path Filtering is enabled. (Automated) - Not Implemented + # 3.3.8 Ensure TCP SYN Cookies is enabled. (Automated) - Not Implemented + # 3.3.9 Ensure IPv6 router advertisements are not accepted. (Automated) - Not Implemented + + # 3.4.1.1 Ensure ufw is installed. (Automated) + - id: 19080 + title: "Ensure ufw is installed." + description: "The Uncomplicated Firewall (ufw) is a frontend for iptables and is particularly well-suited for host-based firewalls. ufw provides a framework for managing netfilter, as well as a command-line interface for manipulating the firewall." + rationale: "A firewall utility is required to configure the Linux kernel's netfilter framework via the iptables or nftables back-end. The Linux kernel's netfilter framework host-based firewall can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host. Note: Only one firewall utility should be installed and configured. UFW is dependent on the iptables package." + remediation: "Run the following command to install Uncomplicated Firewall (UFW): apt install ufw." + compliance: + - cis: ["3.4.1.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' ufw -> r:install ok installed" + + # 3.4.1.2 Ensure iptables-persistent is not installed with ufw. (Automated) + - id: 19081 + title: "Ensure iptables-persistent is not installed with ufw." + description: "The iptables-persistent is a boot-time loader for netfilter rules, iptables plugin." + rationale: "Running both ufw and the services included in the iptables-persistent package may lead to conflict." + remediation: "Run the following command to remove the iptables-persistent package: # apt purge iptables-persistent." + compliance: + - cis: ["3.4.1.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:dpkg-query -s iptables-persistent -> r:package 'iptables-persistent' is not installed" + + # 3.4.1.3 Ensure ufw service is enabled. (Automated) + - id: 19082 + title: "Ensure ufw service is enabled." + description: "UncomplicatedFirewall (ufw) is a frontend for iptables. ufw provides a framework for managing netfilter, as well as a command-line and available graphical user interface for manipulating the firewall. Note: - When running ufw enable or starting ufw via its initscript, ufw will flush its chains. This is required so ufw can maintain a consistent state, but it may drop existing connections (eg ssh). ufw does support adding rules before enabling the firewall. - Run the following command before running ufw enable. # ufw allow proto tcp from any to any port 22 - The rules will still be flushed, but the ssh port will be open after enabling the firewall. Please note that once ufw is 'enabled', ufw will not flush the chains when adding or removing rules (but will when modifying a rule or changing the default policy) - By default, ufw will prompt when enabling the firewall while running under ssh. This can be disabled by using ufw --force enable." + rationale: "The ufw service must be enabled and running in order for ufw to protect the system." + impact: "Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following command to unmask the ufw daemon: # systemctl unmask ufw.service Run the following command to enable and start the ufw daemon: # systemctl --now enable ufw.service active Run the following command to enable ufw: # ufw enable." + references: + - "http://manpages.ubuntu.com/manpages/precise/en/man8/ufw.8.html" + compliance: + - cis: ["3.4.1.3"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled ufw.service -> r:enabled" + - "c:systemctl is-active ufw -> r:^active" + - "c:ufw status -> r:active" + + # 3.4.1.4 Ensure ufw loopback traffic is configured. (Automated) + - id: 19083 + title: "Ensure ufw loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8 for IPv4 and ::1/128 for IPv6)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8 for IPv4 and ::1/128 for IPv6) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ufw allow in on lo # ufw allow out on lo # ufw deny in from 127.0.0.0/8 # ufw deny in from ::1." + compliance: + - cis: ["3.4.1.4"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:ufw status verbose -> r:Anywhere on lo\s*\t*ALLOW IN\s*\t*Anywhere' + - 'c:ufw status verbose -> r:Anywhere\s*\t*DENY IN\s*\t*127.0.0.0/8' + - 'c:ufw status verbose -> r:Anywhere \(v6\) on lo\s*\t*ALLOW IN\s*\t*Anywhere \(v6\)' + - 'c:ufw status verbose -> r:Anywhere \(v6\)\s*\t*DENY IN\s*\t*::1' + - 'c:ufw status verbose -> r:Anywhere\s*\t*ALLOW OUT\s*\t*Anywhere on lo' + - 'c:ufw status verbose -> r:Anywhere \(v6\)\s*\t*ALLOW OUT\s*\t*Anywhere \(v6\) on lo' + + # 3.4.1.5 Ensure ufw outbound connections are configured. (Manual) - Not Implemented + # 3.4.1.6 Ensure ufw firewall rules exist for all open ports. (Automated) - Not Implemented + + # 3.4.1.7 Ensure ufw default deny firewall policy. (Automated) + - id: 19084 + title: "Ensure ufw default deny firewall policy." + description: "A default deny policy on connections ensures that any unconfigured network usage will be rejected. Note: Any port or protocol without a explicit allow before the default deny will be blocked." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + impact: "Any port and protocol not explicitly allowed will be blocked. The following rules should be considered before applying the default deny. ufw allow git ufw allow in http ufw allow out http <- required for apt to connect to repository ufw allow in https ufw allow out https ufw allow out 53 ufw logging on." + remediation: "Run the following commands to implement a default deny policy: # ufw default deny incoming # ufw default deny outgoing # ufw default deny routed." + compliance: + - cis: ["3.4.1.7"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:ufw status verbose -> r:^Default && r:deny\W+(incoming)|reject\W+(incoming)' + - 'c:ufw status verbose -> r:^Default && r:deny\W+(outgoing)|reject\W+(outgoing)' + - 'c:ufw status verbose -> r:^Default && r:deny\W+(routed)|reject\W+(routed)' + + # 3.4.2.1 Ensure nftables is installed. (Automated) + - id: 19085 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem. Notes: - nftables is available in Linux kernel 3.13 and newer - Only one firewall utility should be installed and configured - Changing firewall settings while connected over the network can result in being locked out of the system." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + remediation: "Run the following command to install nftables: # apt install nftables." + compliance: + - cis: ["3.4.2.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:dpkg-query -s nftables -> r:install ok installed" + + # 3.4.2.2 Ensure ufw is uninstalled or disabled with nftables. (Automated) + - id: 19086 + title: "Ensure ufw is uninstalled or disabled with nftables." + description: "Uncomplicated Firewall (UFW) is a program for managing a netfilter firewall designed to be easy to use." + rationale: "Running both the nftables service and ufw may lead to conflict and unexpected results." + remediation: "Run one of the following to either remove ufw or disable ufw and mask ufw.service: Run the following command to remove ufw: # apt purge ufw -OR- Run the following commands to disable ufw and mask ufw.service: # ufw disable # systemctl stop ufw.service # systemctl mask ufw.service Note: ufw disable needs to be run before systemctl mask ufw.service in order to correctly disable UFW." + compliance: + - cis: ["3.4.2.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - "not c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' ufw -> r:install ok installed" + - "c:ufw status -> r:inactive" + - "c:systemctl is-enabled ufw.service -> r:^masked" + + # 3.4.2.3 Ensure iptables are flushed with nftables. (Manual) - Not Implemented + + # 3.4.2.4 Ensure a nftables table exists. (Automated) + - id: 19087 + title: "Ensure a nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + impact: "Adding rules to a running nftables can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example: # nft create table inet filter." + compliance: + - cis: ["3.4.2.4"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:nft list tables -> r:\w+' + + # 3.4.2.5 Ensure nftables base chains exist. (Automated) + - id: 19088 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.4.2.5"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input" + - "c:nft list ruleset -> r:hook forward" + - "c:nft list ruleset -> r:hook output" + + # 3.4.2.6 Ensure nftables loopback traffic is configured. (Automated) + - id: 19089 + title: "Ensure nftables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # nft add rule inet filter input iif lo accept # nft create rule inet filter input ip saddr 127.0.0.0/8 counter drop -IF- IPv6 is enabled on the system: Run the following command to implement the IPv6 loopback rule: # nft add rule inet filter input ip6 saddr ::1 counter drop." + compliance: + - cis: ["3.4.2.6"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + # 3.4.2.7 Ensure nftables outbound and established connections are configured. (Manual) - Not Implemented + + # 3.4.2.8 Ensure nftables default deny firewall policy. (Automated) + - id: 19090 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue transversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; } # nft chain inet filter output { policy drop \\; }." + compliance: + - cis: ["3.4.2.8"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:nft list ruleset -> r:hook input && r:policy drop" + - "c:nft list ruleset -> r:hook forward && r:policy drop" + - "c:nft list ruleset -> r:hook output && r:policy drop" + + # 3.4.2.9 Ensure nftables service is enabled. (Automated) + - id: 19091 + title: "Ensure nftables service is enabled." + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables." + compliance: + - cis: ["3.4.2.9"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled nftables -> r:enabled" + + # 3.4.2.10 Ensure nftables rules are permanent. (Automated) + - id: 19092 + title: "Ensure nftables rules are permanent." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames. The nftables service reads the /etc/nftables.conf file for a nftables file or files to include in the nftables ruleset. A nftables ruleset containing the input, forward, and output base chains allow network traffic to be filtered." + rationale: "Changes made to nftables ruleset only affect the live system, you will also need to configure the nftables ruleset to apply on boot." + remediation: 'Edit the /etc/nftables.conf file and un-comment or add a line with include for each nftables file you want included in the nftables ruleset on boot Example: # vi /etc/nftables.conf Add the line: include "/etc/nftables.rules".' + compliance: + - cis: ["3.4.2.10"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "f:/etc/nftables.conf -> r:include *" + + # 3.4.3.1.1 Ensure iptables packages are installed. (Automated) + - id: 19093 + title: "Ensure iptables packages are installed." + description: "iptables is a utility program that allows a system administrator to configure the tables provided by the Linux kernel firewall, implemented as different Netfilter modules, and the chains and rules it stores. Different kernel modules and programs are used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames." + rationale: "A method of configuring and maintaining firewall rules is necessary to configure a Host Based Firewall." + remediation: "Run the following command to install iptables and iptables-persistent # apt install iptables iptables-persistent." + compliance: + - cis: ["3.4.3.1.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:apt list iptables iptables-persistent -> r:installed,automatic" + + # 3.4.3.1.2 Ensure nftables is not installed with iptables. (Automated) + - id: 19094 + title: "Ensure nftables is not installed with iptables." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables." + rationale: "Running both iptables and nftables may lead to conflict." + remediation: "Run the following command to remove nftables: # apt purge nftables." + compliance: + - cis: ["3.4.3.1.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nftables -> r:unknown ok not-installed" + + # 3.4.3.1.3 Ensure ufw is uninstalled or disabled with iptables. (Automated) + - id: 19095 + title: "Ensure ufw is uninstalled or disabled with iptables." + description: "Uncomplicated Firewall (UFW) is a program for managing a netfilter firewall designed to be easy to use. - Uses a command-line interface consisting of a small number of simple commands - Uses iptables for configuration." + rationale: "Running iptables.persistent with ufw enabled may lead to conflict and unexpected results." + remediation: "Run one of the following commands to either remove ufw or stop and mask ufw Run the following command to remove ufw: # apt purge ufw -OR- Run the following commands to disable ufw: # ufw disable # systemctl stop ufw # systemctl mask ufw Note: ufw disable needs to be run before systemctl mask ufw in order to correctly disable UFW." + compliance: + - cis: ["3.4.3.1.3"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' ufw -> r:unknown ok not-installed" + - "c:ufw status -> r:inactive" + - "c:systemctl is-enabled ufw -> r:masked" + - "c:ufw status -> r:inactive" + + # 3.4.3.2.1 Ensure iptables default deny firewall policy. (Automated) + - id: 19096 + title: "Ensure iptables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected. Notes: - Changing firewall settings while connected over network can result in being locked out of the system - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP." + compliance: + - cis: ["3.4.3.2.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy DROP\)|Chain INPUT \(policy REJECT\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy DROP\)|Chain FORWARD \(policy REJECT\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy DROP\)|Chain OUTPUT \(policy REJECT\)' + + # 3.4.3.2.2 Ensure iptables loopback traffic is configured. (Automated) + - id: 19097 + title: "Ensure iptables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8). Notes: - Changing firewall settings while connected over network can result in being locked out of the system - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP." + compliance: + - cis: ["3.4.3.2.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + # 3.4.3.2.3 Ensure iptables outbound and established connections are configured. (Manual) - Not Implemented + + # 3.4.3.2.4 Ensure iptables firewall rules exist for all open ports. (Automated) - Not Implemented + + # 3.4.3.3.1 Ensure ip6tables default deny firewall policy. (Automated) + - id: 19098 + title: "Ensure ip6tables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected. Note: - Changing firewall settings while connected over network can result in being locked out of the system - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "IF IPv6 is enabled on your system: Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP." + compliance: + - cis: ["3.4.3.3.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:ip6tables -L -> r:^Chain INPUT && r:policy DROP" + - "c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP" + + # 3.4.3.3.2 Ensure ip6tables loopback traffic is configured. (Automated) + - id: 19099 + title: "Ensure ip6tables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1). Note: - Changing firewall settings while connected over network can result in being locked out of the system - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP." + compliance: + - cis: ["3.4.3.3.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.**\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.**\.**\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.**\.*lo\.*::/0\.*::/0' + + # 3.4.3.3.3 Ensure ip6tables outbound and established connections are configured. (Manual) - Not Implemented + # 3.4.3.3.4 Ensure ip6tables firewall rules exist for all open ports. (Automated) - Not Implemented + + # 4.1.1 Ensure cron daemon is enabled and active. (Automated) + - id: 19100 + title: "Ensure cron daemon is enabled and active." + description: "The cron daemon is used to execute batch jobs on the system. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable and start cron: # systemctl unmask cron # systemctl --now enable cron." + compliance: + - cis: ["4.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + condition: all + rules: + - "c:systemctl is-enabled cron -> r:^enabled" + - "c:systemctl status cron -> r:^active" + + # 4.1.2 Ensure permissions on /etc/crontab are configured. (Automated) + - id: 19101 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab." + compliance: + - cis: ["4.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/crontab -> r:600\s*\t*-rw-------\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + + # 4.1.3 Ensure permissions on /etc/cron.hourly are configured. (Automated) + - id: 19102 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.hourly directory: # chown root:root /etc/cron.hourly/ # chmod og-rwx /etc/cron.hourly/." + compliance: + - cis: ["4.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/cron.hourly/ -> r:700\s*\t*drwx------\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + + # 4.1.4 Ensure permissions on /etc/cron.daily are configured. (Automated) + - id: 19103 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.daily directory: # chown root:root /etc/cron.daily/ # chmod og-rwx /etc/cron.daily/." + compliance: + - cis: ["4.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/cron.daily/ -> r:700\s*\t*drwx------\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + + # 4.1.5 Ensure permissions on /etc/cron.weekly are configured. (Automated) + - id: 19104 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.weekly directory: # chown root:root /etc/cron.weekly/ # chmod og-rwx /etc/cron.weekly/." + compliance: + - cis: ["4.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/cron.weekly/ -> r:700\s*\t*drwx------\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + + # 4.1.6 Ensure permissions on /etc/cron.monthly are configured. (Automated) + - id: 19105 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.monthly directory: # chown root:root /etc/cron.monthly/ # chmod og-rwx /etc/cron.monthly/." + compliance: + - cis: ["4.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/cron.monthly/ -> r:700\s*\t*drwx------\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + + # 4.1.7 Ensure permissions on /etc/cron.d are configured. (Automated) + - id: 19106 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab, but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.d directory: # chown root:root /etc/cron.d/ # chmod og-rwx /etc/cron.d/." + compliance: + - cis: ["4.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/cron.d/ -> r:700\s*\t*drwx------\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + + # 4.1.8 Ensure cron is restricted to authorized users. (Automated) + - id: 19107 + title: "Ensure cron is restricted to authorized users." + description: "Configure /etc/cron.allow to allow specific users to use this service. If /etc/cron.allow does not exist, then /etc/cron.deny is checked. Any user not specifically defined in this file is allowed to use cron. By removing the file, only users in /etc/cron.allow are allowed to use cron. Note: - Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy - Even though a given user is not listed in cron.allow, cron jobs can still be run as that user - The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following script to: - Remove /etc/cron.deny if it exists - Create /etc/cron.allow if it doesn't exist - Change ownership of /etc/cron.allow to the root user - Change group ownership of /etc/cron.allow to the group crontab #!/usr/bin/env bash { if dpkg-query -W cron > /dev/null 2>&1; then l_file=\"/etc/cron.allow\" l_mask='0137' l_maxperm=\"$( printf '%o' $(( 0777 & ~$l_mask)) )\" if [ -e /etc/cron.deny ]; then echo -e \" - Removing \\\"/etc/cron.deny\\\"\" rm -f /etc/cron.deny fi if [ ! -e /etc/cron.allow ]; then echo -e \" - creating \\\"$l_file\\\"\" touch \"$l_file\" fi while read l_mode l_fown l_fgroup; do if [ $(( $l_mode & $l_mask )) -gt 0 ]; then echo -e \" - Removing excessive permissions from \\\"$l_file\\\"\" chmod u-x,g-wx,o-rwx \"$l_file\" fi if [ \"$l_fown\" != \"root\" ]; then echo -e \" - Changing owner on \\\"$l_file\\\" from: \\\"$l_fown\\\" to: \\\"root\\\"\" chown root \"$l_file\" fi if [ \"$l_fgroup\" != \"crontab\" ]; then echo -e \" - Changing group owner on \\\"$l_file\\\" from: \\\"$l_fgroup\\\" to: \\\"crontab\\\"\" chgrp crontab \"$l_file\" fi done < <(stat -Lc '%#a %U %G' \"$l_file\") else echo -e \"- cron is not installed on the system, no remediation required\\n\" fi }." + compliance: + - cis: ["4.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "f:/etc/cron.allow" + - "not f:/etc/cron.deny" + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/cron.allow -> r:640\s*\t*-rw-r-----\s*\t*0\s*\t*root\s*\t*0\s*\t*crontab' + + # 4.1.9 Ensure at is restricted to authorized users. (Automated) + - id: 19108 + title: "Ensure at is restricted to authorized users." + description: "Configure /etc/at.allow to allow specific users to use this service. If /etc/at.allow does not exist, then /etc/at.deny is checked. Any user not specifically defined in this file is allowed to use at. By removing the file, only users in /etc/at.allow are allowed to use at. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, at should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "On many systems, only the system administrator is authorized to schedule at jobs. Using the at.allow file to control who can run at jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following script to: - Remove /etc/at.deny if it exists - Create /etc/at.allow if it doesn't exist - Change ownership of /etc/at.allow to the root user - Change group ownership of /etc/at.allow to the group root #!/usr/bin/env bash { if dpkg-query -W at > /dev/null 2>&1; then l_file=\"/etc/at.allow\" l_mask='0137' l_maxperm=\"$( printf '%o' $(( 0777 & ~$l_mask)) )\" if [ -e /etc/at.deny ]; then echo -e \" - Removing \\\"/etc/at.deny\\\"\" rm -f /etc/at.deny fi if [ ! -e /etc/at.allow ]; then echo -e \" - creating \\\"$l_file\\\"\" touch \"$l_file\" fi while read l_mode l_fown l_fgroup; do if [ $(( $l_mode & $l_mask )) -gt 0 ]; then echo -e \" - Removing excessive permissions from \\\"$l_file\\\"\" chmod u-x,g-wx,o-rwx \"$l_file\" fi if [ \"$l_fown\" != \"root\" ]; then echo -e \" - Changing owner on \\\"$l_file\\\" from: \\\"$l_fown\\\" to: \\\"root\\\"\" chown root \"$l_file\" fi if [ \"$l_fgroup\" != \"root\" ]; then echo -e \" - Changing group owner on \\\"$l_file\\\" from: \\\"$l_fgroup\\\" to: \\\"root\\\"\" chgrp root \"$l_file\" fi done < <(stat -Lc '%#a %U %G' \"$l_file\") else echo -e \"- cron is not installed on the system, no remediation required\\n\" fi }." + compliance: + - cis: ["4.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "f:/etc/at.allow" + - "not f:/etc/at.deny" + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/at.allow -> r:640\s*\t*-rw-r-----\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + + # 4.2.1 Ensure permissions on /etc/ssh/sshd_config are configured. (Automated) + - id: 19109 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The file /etc/ssh/sshd_config, and files ending in .conf in the /etc/ssh/sshd_config.d directory, contain configuration specifications for sshd." + rationale: "configuration specifications for sshd need to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following script to set ownership and permissions on /etc/ssh/sshd_config and files ending in .conf in the /etc/ssh/sshd_config.d directory: #!/usr/bin/env bash { chmod u-x,og-rwx /etc/ssh/sshd_config chown root:root /etc/ssh/sshd_config while IFS= read -r -d $'\\0' l_file; do if [ -e \"$l_file\" ]; then chmod u-x,og-rwx \"$l_file\" chown root:root \"$l_file\" fi done < <(find /etc/ssh/sshd_config.d -type f -print0) }." + compliance: + - cis: ["4.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1098", "T1098.004", "T1543", "T1543.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%a %A %u %U %g %G" /etc/ssh/sshd_config -> r:600\s*\t*-rw-------\s*\t*0\s*\t*root\s*\t*0\s*\t*root' + - 'c:sh -c "stat -L /etc/ssh/sshd_config.d/*.conf" -> r:Access:\s*\(0600/-rw-------\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 4.2.2 Ensure permissions on SSH private host key files are configured. (Automated) - Not Implemented + + # 4.2.3 Ensure permissions on SSH public host key files are configured. (Automated) + - id: 19110 + title: "Ensure permissions on SSH public host key files are configured." + description: "An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully." + rationale: "If a public host key file is modified by an unauthorized user, the SSH service may be compromised." + remediation: "Run the following script to set mode, ownership, and group on the public SSH host key files: #!/usr/bin/env bash { l_pmask=\"0133\" l_maxperm=\"$( printf '%o' $(( 0777 & ~$l_pmask )) )\" awk '{print}' <<< \"$(find -L /etc/ssh -xdev -type f -exec stat -Lc \"%n %#a %U %G\" {} +)\" | (while read -r l_file l_mode l_owner l_group; do if file \"$l_file\" | grep -Pq ':\\h+OpenSSH\\h+(\\H+\\h+)?public\\h+key\\b'; then echo -e \" - Checking private key file: \\\"$l_file\\\"\" if [ $(( $l_mode & $l_pmask )) -gt 0 ]; then echo -e \" - File: \\\"$l_file\\\" is mode \\\"$l_mode\\\" changing to mode: \\\"$l_maxperm\\\"\" chmod u-x,go-wx \"$l_file\" fi if [ \"$l_owner\" != \"root\" ]; then echo -e \" - File: \\\"$l_file\\\" is owned by: \\\"$l_owner\\\" changing owner to \\\"root\\\"\" chown root \"$l_file\" fi if [ \"$l_group\" != \"root\" ]; then echo -e \" - File: \\\"$l_file\\\" is owned by group \\\"$l_group\\\" changing to group \\\"root\\\"\" chgrp \"root\" \"$l_file\" fi fi done ) }." + compliance: + - cis: ["4.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0003", "TA0006"] + - mitre_techniques: ["T1557"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sh -c "find /etc/ssh -xdev -type f -name ''ssh_host_*_key.pub'' -exec stat {} \;" -> r:Access:\s*\( && !r:-rw-r--r--' + + # 4.2.4 Ensure SSH access is limited. (Automated) + - id: 19111 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: o The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: o The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: o The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: o The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file to set one or more of the parameter above any Include entries as follows: AllowUsers OR AllowGroups OR DenyUsers OR DenyGroups Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location. If the Include location is not the default, /etc/ssh/sshd_config.d/*.conf, the audit will need to be modified to account for the Include location used." + compliance: + - cis: ["4.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021", "T1021.004"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowUsers\s+\w+|^\s*AllowGroups\s+\w+|^\s*DenyUsers\s+\w+|^\s*DenyGroups\s+\w+' + - 'f:/etc/ssh/sshd_config -> r:^\s*AllowUsers\s+\w+|^\s*AllowGroups\s+\w+|^\s*DenyUsers\s+\w+|^\s*DenyGroups\s+\w+' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf$ -> r:^\s*AllowUsers\s+\w+|^\s*AllowGroups\s+\w+|^\s*DenyUsers\s+\w+|^\s*DenyGroups\s+\w+' + + # 4.2.5 Ensure SSH LogLevel is appropriate. (Automated) + - id: 19112 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: LogLevel VERBOSE OR LogLevel INFO Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + references: + - "https://www.ssh.com/ssh/sshd_config/" + compliance: + - cis: ["4.2.5"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*LogLevel\s+INFO|^\s*LogLevel\s+VERBOSE' + - 'not f:/etc/ssh/sshd_config -> !r:^\s*LogLevel\s+INFO|^\s*LogLevel\s+VERBOSE' + - 'not d:/etc/ssh/sshd_config.d/ -> r:\.*.conf$ -> !r:^\s*LogLevel\s+INFO|^\s*LogLevel\s+VERBOSE' + + # 4.2.6 Ensure SSH PAM is enabled. (Automated) + - id: 19113 + title: "Ensure SSH PAM is enabled." + description: "The UsePAM directive enables the Pluggable Authentication Module (PAM) interface. If set to yes this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication directives in addition to PAM account and session module processing for all authentication types." + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: UsePAM yes Note: First occurrence of a option takes precedence. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + compliance: + - cis: ["4.2.6"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1035"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1021", "T1021.004"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*usepam\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*usepam\s+no' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf$ -> r:^\s*usepam\s+no' + + # 4.2.7 Ensure SSH root login is disabled. (Automated) + - id: 19114 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using SSH. The default is prohibit-password." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root. This limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: PermitRootLogin no Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + compliance: + - cis: ["4.2.7"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*PermitRootLogin\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*PermitRootLogin\s+yes' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf$ -> r:^\s*PermitRootLogin\s+yes' + + # 4.2.8 Ensure SSH HostbasedAuthentication is disabled. (Automated) + - id: 19115 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: HostbasedAuthentication no Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + compliance: + - cis: ["4.2.8"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*HostbasedAuthentication\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*HostbasedAuthentication\s+yes' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf$ -> r:^\s*HostbasedAuthentication\s+yes' + + # 4.2.9 Ensure SSH PermitEmptyPasswords is disabled. (Automated) + - id: 19116 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: PermitEmptyPasswords no Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + compliance: + - cis: ["4.2.9"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*PermitEmptyPasswords\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*PermitEmptyPasswords\s+yes' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf$ -> r:^\s*PermitEmptyPasswords\s+yes' + + # 4.2.10 Ensure SSH PermitUserEnvironment is disabled. (Automated) + - id: 19117 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the SSH daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has SSH executing trojan'd programs)." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: PermitUserEnvironment no Note: First occurrence of a option takes precedence. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + compliance: + - cis: ["4.2.10"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*PermitUserEnvironment\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*PermitUserEnvironment\s+yes' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf$ -> r:^\s*PermitUserEnvironment\s+yes' + + # 4.2.11 Ensure SSH IgnoreRhosts is enabled. (Automated) + - id: 19118 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with SSH." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: IgnoreRhosts yes Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + compliance: + - cis: ["4.2.11"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*IgnoreRhosts\s+yes' + - 'not f:/etc/ssh/sshd_config -> r:^\s*IgnoreRhosts\s+no' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf$ -> r:^\s*IgnoreRhosts\s+no' + + # 4.2.12 Ensure SSH X11 forwarding is disabled. (Automated) + - id: 19119 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: X11Forwarding no Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + compliance: + - cis: ["4.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1210"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*X11Forwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*X11Forwarding\s+yes' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf$ -> r:^\s*X11Forwarding\s+yes' + + # 4.2.13 Ensure only strong Ciphers are used. (Automated) + - id: 19120 + title: "Ensure only strong Ciphers are used." + description: 'This variable limits the ciphers that SSH can use during communication. Note: - Some organizations may have stricter requirements for approved ciphers. - Ensure that ciphers used are in compliance with site policy. - The only "strong" ciphers currently FIPS 140-2 compliant are: o aes256-ctr o aes192-ctr o aes128-ctr.' + rationale: 'Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised. - The Triple DES ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain clear text data via a birthday attack against a long-duration encrypted session, aka a "Sweet32" attack. - Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plain text data from an arbitrary block of cipher text in an SSH session via unknown vectors.' + remediation: "Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers above any Include entries: Example: Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128- gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr Note: First occurrence of a option takes precedence. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + references: + - "https://nvd.nist.gov/vuln/detail/CVE-2016-2183" + - "https://www.openssh.com/txt/cbc.adv" + - "https://nvd.nist.gov/vuln/detail/CVE-2008-5161" + compliance: + - cis: ["4.2.13"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - mitre_mitigations: ["M1041"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1040", "T1557"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - "not c:sshd -T -> r:ciphers && r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc|rijndael-cbc@lysator.liu.se" + + # 4.2.14 Ensure only strong MAC algorithms are used. (Automated) + - id: 19121 + title: "Ensure only strong MAC algorithms are used." + description: 'This variable limits the types of MAC algorithms that SSH can use during communication. Notes: - Some organizations may have stricter requirements for approved MACs. - Ensure that MACs used are in compliance with site policy. - The only "strong" MACs currently FIPS 140-2 approved are: o hmac-sha2-256 o hmac-sha2-512.' + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information." + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs above any Include entries: Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2- 512,hmac-sha2-256,umac-128-etm@openssh.com,umac-128@openssh.com Note: First occurrence of a option takes precedence. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + references: + - "http://www.mitls.org/pages/attacks/SLOTH" + compliance: + - cis: ["4.2.14"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4", "16.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - mitre_mitigations: ["M1041"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1040", "T1557"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - "not c:sshd -T -> r:MACs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com" + + # 4.2.15 Ensure only strong Key Exchange algorithms are used. (Automated) + - id: 19122 + title: "Ensure only strong Key Exchange algorithms are used." + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received Notes: - Kex algorithms have a higher preference the earlier they appear in the list - Some organizations may have stricter requirements for approved Key exchange algorithms - Ensure that Key exchange algorithms used are in compliance with site policy - The only Key Exchange Algorithms currently FIPS 140-2 approved are: o ecdh-sha2-nistp256 o ecdh-sha2-nistp384 o ecdh-sha2-nistp521 o diffie-hellman-group-exchange-sha256 o diffie-hellman-group16-sha512 o diffie-hellman-group18-sha512 o diffie-hellman-group14-sha256." + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks." + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms above any Include entries: Example: KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman- group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18- sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie- hellman-group-exchange-sha256 Note: First occurrence of a option takes precedence. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + compliance: + - cis: ["4.2.15"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - mitre_mitigations: ["M1041"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1040", "T1557"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - "not c:sshd -T -> r:kexalgorithms && r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1" + + # 4.2.16 Ensure SSH AllowTcpForwarding is disabled. (Automated) + - id: 19123 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and backdoors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments. In some environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: AllowTcpForwarding no Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + references: + - "https://www.ssh.com/ssh/tunneling/example" + compliance: + - cis: ["4.2.16"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1048", "T1048.002", "T1572"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*AllowTcpForwarding\s+no' + - 'not f:/etc/ssh/sshd_config -> r:^\s*AllowTcpForwarding\s+yes' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf$ -> r:^\s*AllowTcpForwarding\s+yes' + + # 4.2.17 Ensure SSH warning banner is configured. (Automated) + - id: 19124 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: Banner /etc/issue.net Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + compliance: + - cis: ["4.2.17"] + - mitre_mitigations: ["M1035"] + - mitre_tactics: ["TA0001", "TA0007"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*banner\s*\t*/etc/issue.net' + + # 4.2.18 Ensure SSH MaxAuthTries is set to 4 or less. (Automated) + - id: 19125 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: MaxAuthTries 4 Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + compliance: + - cis: ["4.2.18"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - mitre_mitigations: ["M1036"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:sshd -T -> n:^MaxAuthTries\s*\t*(\d+) compare <= 4' + - 'not f:/etc/ssh/sshd_config -> n:^MaxAuthTries\s*\t*(\d+) compare > 4' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf$ -> r:^MaxAuthTries\s*\t*([5-9]|[1-9][0-9]+)' + + # 4.2.19 Ensure SSH MaxStartups is configured. (Automated) + - id: 19126 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: MaxStartups 10:30:60 Note: First occurrence of an option takes precedence. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + compliance: + - cis: ["4.2.19"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1499", "T1499.002"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> r:^\s*maxstartups\s+10:30:60' + - 'not f:/etc/ssh/sshd_config -> r:^\s*maxstartups\s+(((1[1-9]|[1-9][0-9][0-9]+):([0-9]+):([0-9]+))|(([0-9]+):(3[1-9]|[4-9][0-9]|[1-9][0-9][0-9]+):([0-9]+))|(([0-9]+):([0-9]+):(6[1-9]|[7-9][0-9]|[1-9][0-9][0-9]+)))' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf$ -> r:^\s*maxstartups\s+(((1[1-9]|[1-9][0-9][0-9]+):([0-9]+):([0-9]+))|(([0-9]+):(3[1-9]|[4-9][0-9]|[1-9][0-9][0-9]+):([0-9]+))|(([0-9]+):([0-9]+):(6[1-9]|[7-9][0-9]|[1-9][0-9][0-9]+)))' + + # 4.2.20 Ensure SSH LoginGraceTime is set to one minute or less. (Automated) + - id: 19127 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: LoginGraceTime 60 Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + compliance: + - cis: ["4.2.20"] + - mitre_mitigations: ["M1036"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003", "T1110.004"] + condition: all + rules: + - 'c:sshd -T -> n:logingracetime\s*\t*(\d+) compare <= 60 && n:LoginGraceTime\s*\t*(\d+) compare != 0' + - 'not f:/etc/ssh/sshd_config -> r:\s*LoginGraceTime\s+(0|6[1-9]|[7-9][0-9]|[1-9][0-9][0-9]+|[^1]m)' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf$ -> r:\s*LoginGraceTime\s+(0|6[1-9]|[7-9][0-9]|[1-9][0-9][0-9]+|[^1]m)' + + # 4.2.21 Ensure SSH MaxSessions is set to 10 or less. (Automated) + - id: 19128 + title: "Ensure SSH MaxSessions is set to 10 or less." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter above any Include entries as follows: MaxSessions 10 Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + compliance: + - cis: ["4.2.21"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1499", "T1499.002"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*maxsessions\s+(\d+) compare <= 10' + - 'not f:/etc/ssh/sshd_config -> r:^\s*MaxSessions\s+(1[1-9]|[2-9][0-9]|[1-9][0-9][0-9]+)' + - 'not d:/etc/ssh/sshd_config.d -> r:\.*.conf$ -> r:^\s*MaxSessions\s+(1[1-9]|[2-9][0-9]|[1-9][0-9][0-9]+)' + + # 4.2.22 Ensure SSH Idle Timeout Interval is configured. (Automated) + - id: 19129 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "Note: To clarify, the two settings described below are only meant for idle connections from a protocol perspective and are not meant to check if the user is active or not. An idle user does not mean an idle connection. SSH does not and never had, intentionally, the capability to drop idle users. In SSH versions before 8.2p1 there was a bug that caused these values to behave in such a manner that they were abused to disconnect idle users. This bug has been resolved in 8.2p1 and thus it can no longer be abused disconnect idle users. The two options ClientAliveInterval and ClientAliveCountMax control the timeout of SSH sessions. Taken directly from man 5 sshd_config: - ClientAliveInterval Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax Sets the number of client alive messages which may be sent without sshd(8) receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. It is important to note that the use of client alive messages is very different from TCPKeepAlive. The client alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The client alive mechanism is valuable when the client or server depend on knowing when a connection has become unresponsive. The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds. Setting a zero ClientAliveCountMax disables connection termination." + rationale: "In order to prevent resource exhaustion, appropriate values should be set for both ClientAliveInterval and ClientAliveCountMax. Specifically, looking at the source code, ClientAliveCountMax must be greater than zero in order to utilize the ability of SSH to drop idle connections. If connections are allowed to stay open indefinately, this can potentially be used as a DDOS attack or simple resource exhaustion could occur over unreliable networks. The example set here is a 45 second timeout. Consult your site policy for network timeouts and apply as appropriate." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters above any Include entries according to site policy. Example: ClientAliveInterval 15 ClientAliveCountMax 3 Note: First occurrence of a option takes precedence, Match set statements withstanding. If Include locations are enabled, used, and order of precedence is understood in your environment, the entry may be created in a file in Include location." + references: + - "https://man.openbsd.org/sshd_config" + compliance: + - cis: ["4.2.22"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003"] + condition: all + rules: + - 'c:sshd -T -> n:ClientAliveInterval\s*\t*(\d+) compare > 0' + - 'c:sshd -T -> n:clientalivecountmax\s*\t*(\d+) compare > 0' + + # 4.3.1 Ensure sudo is installed. (Automated) + - id: 19130 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plug-in architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plug-ins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers and any entries in /etc/sudoers.d. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "First determine is LDAP functionality is required. If so, then install sudo-ldap, else install sudo. Example: # apt install sudo." + compliance: + - cis: ["4.3.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.003"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - "c:dpkg -s sudo -> r:install ok installed" + - "c:dpkg -s sudo-ldap -> r:install ok installed" + + # 4.3.2 Ensure sudo commands use pty. (Automated) + - id: 19131 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo terminal (pseudo-pty)." + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: "Edit the file /etc/sudoers with visudo or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty Note: - sudo will read each file in /etc/sudoers.d, skipping file names that end in ~ or contain a . character to avoid causing problems with package manager or editor temporary/backup files. - Files are parsed in sorted lexical order. That is, /etc/sudoers.d/01_first will be parsed before /etc/sudoers.d/10_second. - Be aware that because the sorting is lexical, not numeric, /etc/sudoers.d/1_whoops would be loaded after /etc/sudoers.d/10_second. - Using a consistent number of leading zeroes in the file names can be used to avoid such problems." + compliance: + - cis: ["4.3.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1026", "M1038"] + - mitre_tactics: ["TA0001", "TA0003"] + - mitre_techniques: ["T1078", "T1078.003", "T1548", "T1548.003"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*use_pty' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*use_pty' + + # 4.3.3 Ensure sudo log file exists. (Automated) + - id: 19132 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: 'Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Example: Defaults logfile="/var/log/sudo.log" Note: - sudo will read each file in /etc/sudoers.d, skipping file names that end in ~ or contain a . character to avoid causing problems with package manager or editor temporary/backup files. - Files are parsed in sorted lexical order. That is, /etc/sudoers.d/01_first will be parsed before /etc/sudoers.d/10_second. - Be aware that because the sorting is lexical, not numeric, /etc/sudoers.d/1_whoops would be loaded after /etc/sudoers.d/10_second. - Using a consistent number of leading zeroes in the file names can be used to avoid such problems.' + compliance: + - cis: ["4.3.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*logfile=' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*logfile=' + + # 4.3.4 Ensure users must provide password for privilege escalation. (Automated) + - id: 19133 + title: "Ensure users must provide password for privilege escalation." + description: "The operating system must be configured so that users must provide a password for privilege escalation." + rationale: "Without (re-)authentication, 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 (re-)authenticate." + impact: "This will prevent automated processes from being able to elevate privileges." + remediation: "Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any line with occurrences of NOPASSWD tags in the file." + compliance: + - cis: ["4.3.4"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1078", "T1548"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - "f:/etc/sudoers -> !r:^# && r:*NOPASSWD" + - 'd:/etc/sudoers.d -> r:\.* -> !r:^# && r:*NOPASSWD' + + # 4.3.5 Ensure re-authentication for privilege escalation is not disabled globally. (Automated) + - id: 19134 + title: "Ensure re-authentication for privilege escalation is not disabled globally." + description: "The operating system must be configured so that users must re-authenticate for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + remediation: "Configure the operating system to require users to reauthenticate for privilege escalation. Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any occurrences of !authenticate tags in the file(s)." + compliance: + - cis: ["4.3.5"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> !r:^# && r:*\!authenticate' + - 'd:/etc/sudoers.d -> r:\.* -> !r:^# && r:*\!authenticate' + + # 4.3.6 Ensure sudo authentication timeout is configured correctly. (Automated) + - id: 19135 + title: "Ensure sudo authentication timeout is configured correctly." + description: "sudo caches used credentials for a default of 15 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies. This default is distribution specific. See audit section for further information." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized privileged access to another user." + remediation: "If the currently configured timeout is larger than 15 minutes, edit the file listed in the audit section with visudo -f and modify the entry timestamp_timeout= to 15 minutes or less as per your site policy. The value is in minutes. This particular entry may appear on it's own, or on the same line as env_reset. See the following two examples: Defaults env_reset, timestamp_timeout=15 Defaults timestamp_timeout=15 Defaults env_reset." + references: + - "https://www.sudo.ws/man/1.9.0/sudoers.man.html" + compliance: + - cis: ["4.3.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'c:sudo -V -> r:Authentication timestamp timeout:\s*\t*15.0 minutes' + - 'f:/etc/sudoers -> n:timestamp_timeout=(\d+) compare <=15' + - 'd:/etc/sudoers.d -> r:\.* -> n:timestamp_timeout=(\d+) compare <=15' + + # 4.3.7 Ensure access to the su command is restricted. (Automated) + - id: 19136 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["4.3.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^# && r:auth\s*\t*required\s*\t*pam_wheel.so && r:use_uid && r:group=\w+' + + # 4.4.1 Ensure password creation requirements are configured. (Automated) + - id: 19137 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following options are set in the /etc/security/pwquality.conf file: - Password Length: o minlen = 14 - password must be 14 characters or more - Password complexity: o minclass = 4 - The minimum number of required classes of characters for the new password (digits, uppercase, lowercase, others) OR o dcredit = -1 - provide at least one digit o ucredit = -1 - provide at least one uppercase character o ocredit = -1 - provide at least one special character o lcredit = -1 - provide at least one lowercase character." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "The following setting is a recommend example policy. Alter these values to conform to your own organization's password policies. Run the following command to install the pam_pwquality module: # apt install libpam-pwquality Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy: minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy: Option 1 minclass = 4 Option 2 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1 Edit the /etc/pam.d/common-password file to include pam_pwquality.so and to conform to site policy: password requisite pam_pwquality.so retry=3." + compliance: + - cis: ["4.4.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.001", "T1110.002", "T1110.003"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/security/pwquality.conf -> !r:^\s*# && n:minlen\s*=\s*(\d+) compare >= 14' + - 'f:/etc/security/pwquality.conf -> !r:^\s*# && n:minclass\s*=\s*(\d+) compare >= 4' + - 'f:/etc/security/pwquality.conf -> !r:^\s*# && r:dcredit = -1' + - 'f:/etc/security/pwquality.conf -> !r:^\s*# && r:ucredit = -1' + - 'f:/etc/security/pwquality.conf -> !r:^\s*# && r:lcredit = -1' + - 'f:/etc/security/pwquality.conf -> !r:^\s*# && r:ocredit = -1' + - 'f:/etc/pam.d/common-password -> !r:^\s*# && n:password\s*requisite\s*pam_pwquality.so\s*retry=(\d+) compare <=3' + + # 4.4.2 Ensure lockout for failed password attempts is configured. (Automated) + - id: 19138 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. - deny=n - n represents the number of failed attempts before the account is locked - unlock_time=n - n represents the number of seconds before the account is unlocked - audit - Will log the user name into the system log if the user is not found. - silent - Don't print informative messages. Set the lockout number and unlock time in accordance with local site policy." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + remediation: "Edit the /etc/pam.d/common-auth file and add the auth line below: auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900 Edit the /etc/pam.d/common-account file and add the account lines bellow: account requisite pam_deny.so account required pam_tally2.so." + compliance: + - cis: ["4.4.2"] + - cis_csc_v7: ["16.7"] + - iso_27001-2013: ["A.9.2.6"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> !r:^# && r:auth\s*\t*required\s*\t*pam_tally2.so && r:onerr=fail && r:audit && r:silent && r:deny\s*=\s*\d+ && r:unlock_time\s*=\s*\d+' + - 'f:/etc/pam.d/common-auth -> n:deny\s*=\s*(\d+) compare <=5' + - 'f:/etc/pam.d/common-account -> !r:^# && r:account\s*\t*requisite\s*\t*pam_deny.so' + - 'f:/etc/pam.d/common-account -> !r:^# && r:account\s*\t*required\s*\t*pam_tally2.so' + + # 4.4.3 Ensure password reuse is limited. (Automated) + - id: 19139 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password." + remediation: "NOTE: Pay special attention to the configuration. Incorrect configuration can cause system lock outs or unexpected behavior. This is example configuration. You configuration may differ based on previous changes to the files. Edit the /etc/pam.d/common-password file to include: - password required pam_pwhistory.so remember=5 - use_authtok on the pam_unix.so line Example: password required pam_pwhistory.so remember=5 password [success=1 default=ignore] pam_unix.so obscure sha512 use_authtok." + references: + - "https://manpages.ubuntu.com/manpages/focal/man8/pam_pwhistory.8.html" + - "https://bugs.launchpad.net/ubuntu/+source/pam/+bug/1989731" + compliance: + - cis: ["4.4.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1028"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.004"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/common-password -> !r:^# && r:password\s*\t*required\s*\t*pam_pwhistory.so && n:remember\s*\t*=\s*\t*(\d+) compare => 5' + - 'f:/etc/pam.d/common-password -> !r:^# && r:password && r:success && r:default\s*=\s*ignore && r:pam_unix.so && r:use_authtok' + + # 4.4.4 Ensure strong password hashing algorithm is configured. (Automated) + - id: 19140 + title: "Ensure strong password hashing algorithm is configured." + description: "Hash functions behave as one-way functions by using mathematical operations that are extremely difficult and cumbersome to revert When a user is created, the password is run through a one-way hashing algorithm before being stored. When the user logs in, the password sent is run through the same one-way hashing algorithm and compared to the hash connected with the provided username. If the hashed password and the stored hash match, the login is valid." + rationale: "The SHA512 hashing algorithm provides stronger hashing than previous available algorithms like MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords." + remediation: "Note: - Pay special attention to the configuration. Incorrect configuration can cause system lock outs. - This is an example configuration. Your configuration may differ based on previous changes to the files. - The encryption method on the password success line for pam_unix.so and the ENCRYPT_METHOD line in /etc/login.defs should match. Edit the /etc/pam.d/common-password file and ensure that sha512 is included and the pam_unix.so success line: Example: password [success=1 default=ignore] pam_unix.so obscure sha512 use_authtok Edit /etc/login.defs and ensure that ENCRYPT_METHOD is set to SHA512. ENCRYPT_METHOD SHA512." + compliance: + - cis: ["4.4.4"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1041"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1003", "T1003.008", "T1110", "T1110.002"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "f:/etc/pam.d/common-password -> !r:^# && r:password && r:pam_unix.so && r:sha512" + + # 4.4.5 Ensure all current passwords uses the configured hashing algorithm. (Manual) - Not Implemented + + # 4.5.1.1 Ensure minimum days between password changes is configured. (Automated) + - id: 19141 + title: "Ensure minimum days between password changes is configured." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 1 in /etc/login.defs: PASS_MIN_DAYS 1 Modify user parameters for all users with a password set to match: # chage --mindays 1 ." + compliance: + - cis: ["4.5.1.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.001", "T1110.002", "T1110.003", "T1110.004"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS\s*\t*(\d+) compare >= 1' + - 'not f:/etc/shadow -> !r:^\w+:\p: && n:^\w+:\S*:\d*:(\d+) compare < 1' + + # 4.5.1.2 Ensure password expiration is 365 days or less. (Automated) + - id: 19142 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity. It is recommended that the PASS_MAX_DAYS parameter does not exceed 365 days and is greater than the value of PASS_MIN_DAYS." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + references: + - "https://www.cisecurity.org/white-papers/cis-password-policy-guide/" + compliance: + - cis: ["4.5.1.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.001", "T1110.002", "T1110.003", "T1110.004"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare > 0' + - 'not f:/etc/shadow -> !r:^\w+:\p: && n:^\w+:\S*:\d*:\d*:(\d+) compare > 365' + + # 4.5.1.3 Ensure password expiration warning days is 7 or more. (Automated) + - id: 19143 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs: PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["4.5.1.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.001", "T1110.002", "T1110.003", "T1110.004"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + - 'not f:/etc/shadow -> !r:^\w+:\p: && n:^\w+:\S*:\d*:\d*:\d*:(\d+) compare < 7' + + # 4.5.1.4 Ensure inactive password lock is 30 days or less. (Automated) + - id: 19144 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["4.5.1.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.002", "T1078.003"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare <= 30' + - 'not c:useradd -D -> n:^INACTIVE=(\d+) compare < 0' + - 'not f:/etc/shadow -> !r:^\w+:\p: && n:^\w+:\S*:\d*:\d*:\d*:\d+:(\d+) compare > 30' + + # 4.5.1.5 Ensure all users last password change date is in the past. (Automated) - Not Implemented + + # 4.5.1.6 Ensure the number of changed characters in a new password is configured. (Automated) + - id: 19145 + title: "Ensure the number of changed characters in a new password is configured." + description: "The pwquality difok option sets the number of characters in a password that must not be present in the old password." + rationale: "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." + remediation: "Edit or add the following line in /etc/security/pwquality.conf to a value of 2 or more: difok = 2." + compliance: + - cis: ["4.5.1.6"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/security/pwquality.conf -> !r:^# && n:difok\s*\t*=\s*\t*(\d+) compare => 2' + + # 4.5.1.7 Ensure preventing the use of dictionary words for passwords is configured. (Automated) + - id: 19146 + title: "Ensure preventing the use of dictionary words for passwords is configured." + description: "The pwquality dictcheck option sets whether to check for the words from the cracklib dictionary." + rationale: "If the operating system 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." + remediation: "Edit or add the following line in /etc/security/pwquality.conf to a value of 1: dictcheck = 1." + compliance: + - cis: ["4.5.1.7"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/security/pwquality.conf -> !r:^# && n:dictcheck\s*\t*=\s*\t*(\d+) compare = 1' + + # 4.5.2 Ensure system accounts are secured. (Automated) - Not Implemented + + # 4.5.3 Ensure default group for the root account is GID 0. (Automated) + - id: 19147 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["4.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> !r:^# && r:root:\w+:\w+:0:' + + # 4.5.4 Ensure default user umask is 027 or more restrictive. (Automated) - Not Implemented + + # 4.5.5 Ensure default user shell timeout is configured. (Automated) - Not Implemented + + # 4.5.6 Ensure nologin is not listed in /etc/shells. (Automated) + - id: 19148 + title: "Ensure nologin is not listed in /etc/shells." + description: "/etc/shells is a text file which contains the full pathnames of valid login shells. This file is consulted by chsh and available to be queried by other programs. Be aware that there are programs which consult this file to find out if a user is a normal user; for example, FTP daemons traditionally disallow access to users with shells not included in this file." + rationale: "A user can use chsh to change their configured shell. If a user has a shell configured that isn't in in /etc/shells, then the system assumes that they're somehow restricted. In the case of chsh it means that the user cannot change that value. Other programs might query that list and apply similar restrictions. By putting nologin in /etc/shells, any user that has nologin as its shell is considered a full, unrestricted user. This is not the expected behavior for nologin." + remediation: "Edit /etc/shells and remove any lines that include nologin." + compliance: + - cis: ["4.5.6"] + condition: all + rules: + - "not f:/etc/shells -> !r:^# && r:nologins" + + # 4.5.7 Ensure maximum number of same consecutive characters in a password is configured. (Automated) + - id: 19149 + title: "Ensure maximum number of same consecutive characters in a password is configured." + description: "The pwquality maxrepeat option sets the maximum number of allowed same consecutive characters in a new password." + rationale: "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." + remediation: "Edit or add the following line in /etc/security/pwquality.conf to a value of 3 or less and not 0: maxrepeat = 3." + compliance: + - cis: ["4.5.7"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/security/pwquality.conf -> !r:^# && n:maxrepeat\s*\t*=\s*\t*(\d+) compare <=3' + - 'not f:/etc/security/pwquality.conf -> !r:^# && n:maxrepeat\s*\t*=\s*\t*(\d+) compare =0' + + # 5.1.1.1.1 Ensure systemd-journal-remote is installed. (Automated) + - id: 19150 + title: "Ensure systemd-journal-remote is installed." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to install systemd-journal-remote: # apt install systemd-journal-remote." + compliance: + - cis: ["5.1.1.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' systemd-journal-remote -> r:install ok installed" + + # 5.1.1.1.2 Ensure systemd-journal-remote is configured. (Manual) + - id: 19151 + title: "Ensure systemd-journal-remote is configured." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Edit the /etc/systemd/journal-upload.conf file and ensure the following lines are set per your environment: URL=192.168.50.42 ServerKeyFile=/etc/ssl/private/journal-upload.pem ServerCertificateFile=/etc/ssl/certs/journal-upload.pem TrustedCertificateFile=/etc/ssl/ca/trusted.pem Restart the service: # systemctl restart systemd-journal-upload." + compliance: + - cis: ["5.1.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "f:/etc/systemd/journal-upload.conf -> r:URL=" + - "f:/etc/systemd/journal-upload.conf -> r:ServerKeyFile=" + - "f:/etc/systemd/journal-upload.conf -> r:ServerCertificateFile=" + - "f:/etc/systemd/journal-upload.conf -> r:TrustedCertificateFile=" + + # 5.1.1.1.3 Ensure systemd-journal-remote is enabled. (Manual) + - id: 19152 + title: "Ensure systemd-journal-remote is enabled." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralized log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to enable systemd-journal-remote: # systemctl --now enable systemd-journal-upload.service." + compliance: + - cis: ["5.1.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-upload.service -> r:^enabled" + + # 5.1.1.1.4 Ensure journald is not configured to receive logs from a remote client. (Automated) + - id: 19153 + title: "Ensure journald is not configured to receive logs from a remote client." + description: "Journald supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts. Note: - The same package, systemd-journal-remote, is used for both sending logs to remote hosts and receiving incoming logs. - With regards to receiving logs, there are two services; systemd-journal- remote.socket and systemd-journal-remote.service." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: "Run the following command to disable systemd-journal-remote.socket: # systemctl --now disable systemd-journal-remote.socket." + compliance: + - cis: ["5.1.1.1.4"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-remote.socket -> r:^disabled" + + # 5.1.1.2 Ensure journald service is enabled. (Automated) + - id: 19154 + title: "Ensure journald service is enabled." + description: "Ensure that the systemd-journald service is enabled to allow capturing of logging events." + rationale: "If the systemd-journald service is not enabled to start on boot, the system will not capture logging events." + remediation: "By default the systemd-journald service does not have an [Install] section and thus cannot be enabled / disabled. It is meant to be referenced as Requires or Wants by other unit files. As such, if the status of systemd-journald is not static, investigate why." + compliance: + - cis: ["5.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journald.service -> r:^static" + + # 5.1.1.3 Ensure journald is configured to compress large log files. (Automated) + - id: 19155 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file or a file ending in .conf in /etc/systemd/journald.conf.d/ and add the following line: Compress=yes Restart the service: # systemctl restart systemd-journald." + compliance: + - cis: ["5.1.1.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.3", "6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1053"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1562", "T1562.002"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: any + rules: + - "f:/etc/systemd/journald.conf -> r:^Compress=yes" + - 'd:/etc/systemd/journald.conf.d -> r:\.* -> r:^Compress=yes' + + # 5.1.1.4 Ensure journald is configured to write logfiles to persistent disk. (Automated) + - id: 19156 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss due to a reboot." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file or a file ending in .conf in /etc/systemd/journald.conf.d/ and add the following line: Storage=persistent Restart the service: # systemctl restart systemd-journald." + compliance: + - cis: ["5.1.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: any + rules: + - "f:/etc/systemd/journald.conf -> r:^Storage=persistent" + - 'd:/etc/systemd/journald.conf.d -> r:\.* -> r:^Storage=persistent' + + # 5.1.1.5 Ensure journald is not configured to send logs to rsyslog. (Manual) + - id: 19157 + title: "Ensure journald is not configured to send logs to rsyslog." + description: "Data from journald should be kept in the confines of the service and not forwarded on to other services." + rationale: "IF journald is the method for capturing logs, all logs of the system should be handled by journald and not forwarded to other logging mechanisms." + remediation: "Edit the /etc/systemd/journald.conf file and files in /etc/systemd/journald.conf.d/ and ensure that ForwardToSyslog=yes is removed. Restart the service: # systemctl restart systemd-journald." + compliance: + - cis: ["5.1.1.5"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: any + rules: + - 'not f:/etc/systemd/journald.conf -> !r:^# && r:ForwardToSyslog\s*=\s*yes' + - 'not d:/etc/systemd/journald.conf.d -> r:\.* -> !r:^# && r:ForwardToSyslog\s*=\s*yes' + + # 5.1.1.6 Ensure journald log rotation is configured per site policy. (Manual) + - id: 19158 + title: "Ensure journald log rotation is configured per site policy." + description: "Journald includes the capability of rotating log files regularly to avoid filling up the system with logs or making the logs unmanageably large. The file /etc/systemd/journald.conf is the configuration file used to specify how logs generated by Journald should be rotated." + rationale: "By keeping the log files smaller and more manageable, a system administrator can easily archive these files to another system and spend less time looking through inordinately large log files." + remediation: "Review /etc/systemd/journald.conf and verify logs are rotated according to site policy. The settings should be carefully understood as there are specific edge cases and prioritisation of parameters. The specific parameters for log rotation are: SystemMaxUse= SystemKeepFree= RuntimeMaxUse= RuntimeKeepFree= MaxFileSec=." + compliance: + - cis: ["5.1.1.6"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "f:/etc/systemd/journald.conf -> r:SystemMaxUse=" + - "f:/etc/systemd/journald.conf -> r:SystemKeepFree=" + - "f:/etc/systemd/journald.conf -> r:RuntimeMaxUse=" + - "f:/etc/systemd/journald.conf -> r:RuntimeKeepFree=" + - "f:/etc/systemd/journald.conf -> r:MaxFileSec=" + + # 5.1.1.7 Ensure journald default file permissions configured. (Manual) - Not Implemented + + # 5.1.2.1 Ensure rsyslog is installed. (Automated) + - id: 19159 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is recommended in environments where journald does not meet operation requirements." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # apt install rsyslog." + compliance: + - cis: ["5.1.2.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1028"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1005", "T1070", "T1070.002"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' rsyslog -> r:install ok installed" + + # 5.1.2.2 Ensure rsyslog service is enabled. (Automated) + - id: 19160 + title: "Ensure rsyslog service is enabled." + description: "Once the rsyslog package is installed, ensure that the service is enabled." + rationale: "If the rsyslog service is not enabled to start on boot, the system will not capture logging events." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["5.1.2.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1028"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:^enabled" + + # 5.1.2.3 Ensure journald is configured to send logs to rsyslog. (Manual) + - id: 19161 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the RSyslog service provides a consistent means of log collection and export." + rationale: "IF RSyslog is the preferred method for capturing logs, all logs of the system should be sent to it for further processing." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["5.1.2.3"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - 'f:/etc/systemd/journald.conf -> r:^\s*\t*ForwardToSyslog\s*=\s*yes' + + # 5.1.2.4 Ensure rsyslog default file permissions are configured. (Automated) + - id: 19162 + title: "Ensure rsyslog default file permissions are configured." + description: "RSyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + impact: "The systems global umask could override, but only making the file permissions stricter, what is configured in RSyslog with the FileCreateMode directive. RSyslog also has it's own $umask directive that can alter the intended file creation mode. In addition, consideration should be given to how FileCreateMode is used. Thus it is critical to ensure that the intended file creation mode is not overridden with less restrictive settings in /etc/rsyslog.conf, /etc/rsyslog.d/*conf files and that FileCreateMode is set before any file is created." + remediation: "Edit either /etc/rsyslog.conf or a dedicated .conf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640 Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["5.1.2.4"] + - cis_csc_v8: ["3.3", "8.2"] + - cis_csc_v7: ["5.1", "6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)", "164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1028"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'f:/etc/rsyslog.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + - 'd:/etc/rsyslog.d/ -> r:\.*.conf -> r:^\$FileCreateMode 06\d0|^\$FileCreateMode 04\d0|^\$FileCreateMode 02\d0|^\$FileCreateMode 00\d0 && r:^\$FileCreateMode 0\d40|^\$FileCreateMode 0\d00' + + # 5.1.2.5 Ensure logging is configured. (Manual) - Not Implemented + # 5.1.2.6 Ensure rsyslog is configured to send logs to a remote log host. (Manual) - Not Implemented + + # 5.1.2.7 Ensure rsyslog is not configured to receive logs from a remote client. (Automated) + - id: 19163 + title: "Ensure rsyslog is not configured to receive logs from a remote client." + description: "RSyslog supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: 'Should there be any active log server configuration found in the auditing section, modify those file and remove the specific lines highlighted by the audit. Ensure none of the following entries are present in any of /etc/rsyslog.conf or /etc/rsyslog.d/*.conf. Old format $ModLoad imtcp $InputTCPServerRun New format module(load="imtcp") input(type="imtcp" port="514") Restart the service: # systemctl restart rsyslog.' + compliance: + - cis: ["5.1.2.7"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - mitre_mitigations: ["M1028"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'not d:/etc/rsyslog.d -> r:\.*.conf$ -> !r:^# && r:module\(load="imtcp"\)|input\(type="imtcp" port="514"\)' + - 'not f:/etc/rsyslog.conf -> !r:^# && r:module\(load="imtcp"\)|input\(type="imtcp" port="514"\)' + + # 5.1.3 Ensure all logfiles have appropriate access configured. (Automated) - Not Implemented + + # 5.2.1.1 Ensure auditd is installed. (Automated) + - id: 19164 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # apt install auditd." + compliance: + - cis: ["5.2.1.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1028"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' auditd -> r: install ok installed" + + # 5.2.1.2 Ensure auditd service is enabled and active. (Automated) + - id: 19165 + title: "Ensure auditd service is enabled and active." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable and start auditd: # systemctl --now enable auditd." + compliance: + - cis: ["5.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1028"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:^enabled" + - "c:systemctl is-active auditd -> r:^active" + + # 5.2.1.3 Ensure auditing for processes that start prior to auditd is enabled. (Automated) + - id: 19166 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd , so that potential malicious activity cannot go undetected." + remediation: 'Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: Example: GRUB_CMDLINE_LINUX="audit=1" Run the following command to update the grub2 configuration: # update-grub.' + compliance: + - cis: ["5.2.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'not f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:audit=1' + + # 5.2.1.4 Ensure audit_backlog_limit is sufficient. (Automated) + - id: 19167 + title: "Ensure audit_backlog_limit is sufficient." + description: "In the kernel-level audit subsystem, a socket buffer queue is used to hold audit events. Whenever a new audit event is received, it is logged and prepared to be added to this queue. The kernel boot parameter audit_backlog_limit=N, with N representing the amount of messages, will ensure that a queue cannot grow beyond a certain size. If an audit event is logged which would grow the queue beyond this limit, then a failure occurs and is handled according to the system configuration." + rationale: "If an audit event is logged which would grow the queue beyond the audit_backlog_limit, then a failure occurs, auditd records will be lost, and potential malicious activity could go undetected." + remediation: 'Edit /etc/default/grub and add audit_backlog_limit=N to GRUB_CMDLINE_LINUX. The recommended size for N is 8192 or larger. Example: GRUB_CMDLINE_LINUX="audit_backlog_limit=8192" Run the following command to update the grub2 configuration: # update-grub.' + compliance: + - cis: ["5.2.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1028", "M1047"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'not f:/boot/grub/grub.cfg -> r:^\s*\t*linux && !r:audit_backlog_limit' + + # 5.2.2.1 Ensure audit log storage size is configured. (Automated) + - id: 19168 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["5.2.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1562", "T1562.006"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file\s*\t*=\s*\t*\d+' + + # 5.2.2.2 Ensure audit logs are not automatically deleted. (Automated) + - id: 19169 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["5.2.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*max_log_file_action\s*\t*=\s*\t*keep_logs' + + # 5.2.2.3 Ensure system is disabled when audit logs are full. (Automated) + - id: 19170 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full. The admin_space_left_action parameter tells the system what action to take when the system has detected that it is low on disk space. Valid values are ignore, syslog, suspend, single, and halt. - ignore, the audit daemon does nothing - Syslog, the audit daemon will issue a warning to syslog - Suspend, the audit daemon will stop writing records to the disk - single, the audit daemon will put the computer system in single user mode - halt, the audit daemon will shutdown the system." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + impact: "If the admin_space_left_action parameter is set to halt the audit daemon will shutdown the system when the disk partition containing the audit logs becomes full." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root set admin_space_left_action to either halt or single in /etc/audit/auditd.conf. Example: admin_space_left_action = halt." + compliance: + - cis: ["5.2.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1028"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*space_left_action\s*=\s*email' + - 'f:/etc/audit/auditd.conf -> r:^\s*action_mail_acct\s*=\s*root' + - 'f:/etc/audit/auditd.conf -> r:^\s*admin_space_left_action\s*=\s*halt|^\s*admin_space_left_action\s*=\s*single' + + # 5.2.3.1 Ensure changes to system administration scope (sudoers) is collected. (Automated) + - id: 19171 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers, or files in /etc/sudoers.d, will be written to when the file(s) or related attributes have changed. The audit records will be tagged with the identifier "scope".' + rationale: "Changes in the /etc/sudoers and /etc/sudoers.d files can indicate that an unauthorized change has been made to the scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor scope changes for system administrators. Example: # printf \" -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d -p wa -k scope \" >> /etc/audit/rules.d/50-scope.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["5.2.3.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'c:auditctl -l -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope|key=\\s*\t*scope' + - 'c:auditctl -l -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope|key=\\s*\t*scope' + + # 5.2.3.2 Ensure actions as another user are always logged. (Automated) + - id: 19172 + title: "Ensure actions as another user are always logged." + description: "sudo provides users with temporary elevated privileges to perform operations, either as the superuser or another user." + rationale: "Creating an audit log of users with temporary elevated privileges and the operation(s) they performed is essential to reporting. Administrators will want to correlate the events written to the audit trail with the records written to sudo's logfile to verify if unauthorized commands have been executed." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor elevated privileges. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -C euid!=uid -F auid!=unset -S execve -k user_emulation -a always,exit -F arch=b32 -C euid!=uid -F auid!=unset -S execve -k user_emulation \" >> /etc/audit/rules.d/50-user_emulation.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["5.2.3.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=-1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + + # 5.2.3.3 Ensure events that modify the sudo log file are collected. (Automated) - Not Implemented + + # 5.2.3.4 Ensure events that modify date and time information are collected. (Automated) + - id: 19173 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the; - adjtimex - tune kernel clock - settimeofday - set time using timeval and timezone structures - stime - using seconds since 1/1/1970 - clock_settime - allows for the setting of several internal clocks and timers system calls have been executed. Further, ensure to write an audit record to the configured audit log file upon exit, tagging the records with a unique identifier such as "time-change".' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: 'Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify date and time information. 64 Bit systems Example: # printf " -a always,exit -F arch=b64 -S adjtimex,settimeofday,clock_settime -k time-change -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime -k time-change -w /etc/localtime -p wa -k time-change \" >> /etc/audit/rules.d/50-time-change.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64. In addition, add stime to the system call audit. Example: -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime,stime -k time-change.' + compliance: + - cis: ["5.2.3.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change' + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change" + + # 5.2.3.5 Ensure events that modify the system's network environment are collected. (Automated) + - id: 19174 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitors the following system calls, and write an audit event on system call exit: - sethostname - set the systems host name - setdomainname - set the systems domain name The files being monitored are: - /etc/issue and /etc/issue.net - messages displayed pre-login - /etc/hosts - file containing host names and associated IP addresses - /etc/networks - symbolic names for networks - /etc/network/ - directory containing network interface scripts and configurations files." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records should have a relevant tag associated with them." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's network environment. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S sethostname,setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname,setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/networks -p wa -k system-locale -w /etc/network/ -p wa -k system-locale \" >> /etc/audit/rules.d/50-system_locale.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["5.2.3.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/network && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/networks/ && r:-p wa && r:-k system-locale|key=system-locale' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/network && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/networks && r:-p wa && r:-k system-locale|key=system-locale" + + # 5.2.3.6 Ensure use of privileged commands are collected. (Automated) - Not Implemented + # 5.2.3.7 Ensure unsuccessful file access attempts are collected. (Automated) - Not Implemented + + # 5.2.3.8 Ensure events that modify user/group information are collected. (Automated) + - id: 19175 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the modification of user or group information, including that of passwords and old passwords if in use. - /etc/group - system groups - /etc/passwd - system users - /etc/gshadow - encrypted password for each group - /etc/shadow - system user passwords - /etc/security/opasswd - storage of old passwords if the relevant PAM module is in use The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify user/group information. Example: # printf \" -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity \" >> /etc/audit/rules.d/50-identity.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["5.2.3.8"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity' + - "c:auditctl -l -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity" + + # 5.2.3.9 Ensure discretionary access control permission modification events are collected. (Automated) - Not Implemented + + # 5.2.3.10 Ensure successful file system mounts are collected. (Automated) + - id: 19176 + title: "Ensure successful file system mounts are collected." + description: "Monitor the use of the mount system call. The mount (and umount) system call controls the mounting and unmounting of file systems. The parameters below configure the system to create an audit record when the mount system call is used by a non-privileged user." + rationale: "It is highly unusual for a non privileged user to mount file systems to the system. While tracking mount commands gives the system administrator evidence that external media may have been mounted (based on a review of the source of the mount and confirming it's an external media type), it does not conclusively indicate that data was exported to the media. System administrators who wish to determine if data were exported, would also have to track successful open, creat and truncate system calls requiring write access to a file under the mount point of the external media file system. This could give a fair indication that a write occurred. The only way to truly prove it, would be to track successful writes to the external media. Tracking write system calls could quickly fill up the audit log and is not recommended. Recommendations on configuration options to track data export to media is beyond the scope of this document." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful file system mounts. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b32 -S mount -F auid>=$UID_MIN -F auid!=unset -k mounts -a always,exit -F arch=b64 -S mount -F auid>=$UID_MIN -F auid!=unset -k mounts \" >> /etc/audit/rules.d/50-mounts.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["5.2.3.10"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1034"] + - mitre_tactics: ["TA0010"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["CM-6"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S mount && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k mounts|key=mounts' + + # 5.2.3.11 Ensure session initiation information is collected. (Automated) + - id: 19177 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. - /var/run/utmp - tracks all currently logged in users. - /var/log/wtmp - file tracks logins, logouts, shutdown, and reboot events. - /var/log/btmp - keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier "session.".' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor session initiation information. Example: # printf \" -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k session -w /var/log/btmp -p wa -k session \" >> /etc/audit/rules.d/50-session.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["5.2.3.11"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session' + - "c:auditctl -l -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session" + + # 5.2.3.12 Ensure login and logout events are collected. (Automated) + - id: 19178 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. - /var/log/lastlog - maintain records of the last time a user successfully logged in. - /var/run/faillock - directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor login and logout events. Example: # printf \" -w /var/log/lastlog -p wa -k logins -w /var/run/faillock -p wa -k logins \" >> /etc/audit/rules.d/50-login.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["5.2.3.12"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.8.1.3", "A.9.4.2"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins' + - "c:auditctl -l -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins" + - "c:auditctl -l -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins" + + # 5.2.3.13 Ensure file deletion events by users are collected. (Automated) + - id: 19179 + title: "Ensure file deletion events by users are collected." + description: 'Monitor the use of system calls associated with the deletion or renaming of files and file attributes. This configuration statement sets up monitoring for: - unlink - remove a file - unlinkat - remove a file attribute - rename - rename a file - renameat rename a file attribute system calls and tags them with the identifier "delete".' + rationale: "Monitoring these calls from non-privileged users could provide a system administrator with evidence that inappropriate removal of files and file attributes associated with protected files is occurring. While this audit option will look at all events, system administrators will want to look for specific privileged files that are being deleted or altered." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor file deletion events by users. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete -a always,exit -F arch=b32 -S rename,unlink,unlinkat,renameat -F auid>=${UID_MIN} -F auid!=unset -F key=delete \" >> /etc/audit/rules.d/50-delete.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["5.2.3.13"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:unlink && r:unlinkat && r:rename && r:renameat && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k delete|key=delete' + + # 5.2.3.14 Ensure events that modify the system's Mandatory Access Controls are collected. (Automated) + - id: 19180 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor AppArmor, an implementation of mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/apparmor/ and /etc/apparmor.d/ directories. Note: If a different Mandatory Access Control method is used, changes to the corresponding directories should be audited." + rationale: "Changes to files in the /etc/apparmor/ and /etc/apparmor.d/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's Mandatory Access Controls. Example: # printf \" -w /etc/apparmor/ -p wa -k MAC-policy -w /etc/apparmor.d/ -p wa -k MAC-policy \" >> /etc/audit/rules.d/50-MAC-policy.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["5.2.3.14"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor.d && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - "c:auditctl -l -> r:^-w && r:/etc/apparmor && r:-p wa && r:-k MAC-policy|key=MAC-policy" + - "c:auditctl -l -> r:^-w && r:/etc/apparmor.d && r:-p wa && r:-k MAC-policy|key=MAC-policy" + + # 5.2.3.15 Ensure successful and unsuccessful attempts to use the chcon command are recorded. (Automated) + - id: 19181 + title: "Ensure successful and unsuccessful attempts to use the chcon command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chcon command." + rationale: "The chcon command is used to change file security context. 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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chcon command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chcon -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["5.2.3.15"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chcon && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|key=perm_chng' + + # 5.2.3.16 Ensure successful and unsuccessful attempts to use the setfacl command are recorded. (Automated) + - id: 19182 + title: "Ensure successful and unsuccessful attempts to use the setfacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the setfacl command." + rationale: "This utility sets Access Control Lists (ACLs) of files and directories. 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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the setfacl command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/setfacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["5.2.3.16"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/setfacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + + # 5.2.3.17 Ensure successful and unsuccessful attempts to use the chacl command are recorded. (Automated) + - id: 19183 + title: "Ensure successful and unsuccessful attempts to use the chacl command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the chacl command. chacl is an IRIX-compatibility command, and is maintained for those users who are familiar with its use from either XFS or IRIX." + rationale: "chacl changes the ACL(s) for a file or directory. 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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the chacl command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/bin/chacl -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k perm_chng \" >> /etc/audit/rules.d/50-perm_chng.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["5.2.3.17"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/chacl && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k perm_chng|-F key=perm_chng' + + # 5.2.3.18 Ensure successful and unsuccessful attempts to use the usermod command are recorded. (Automated) + - id: 19184 + title: "Ensure successful and unsuccessful attempts to use the usermod command are recorded." + description: "The operating system must generate audit records for successful/unsuccessful uses of the usermod command." + rationale: "The usermod command modifies the system account files to reflect the changes that are specified on the command line. 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)." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor successful and unsuccessful attempts to use the usermod command. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F path=/usr/sbin/usermod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k usermod \" >> /etc/audit/rules.d/50-usermod.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["5.2.3.18"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/sbin/usermod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k usermod|-F key=usermod' + + # 5.2.3.19 Ensure kernel module loading unloading and modification is collected. (Automated) + - id: 19185 + title: "Ensure kernel module loading unloading and modification is collected." + description: "Monitor the loading and unloading of kernel modules. All the loading / listing / dependency checking of modules is done by kmod via symbolic links. The following system calls control loading and unloading of modules: - init_module - load a module - finit_module - load a module (used when the overhead of using cryptographically signed modules to determine the authenticity of a module can be avoided) - delete_module - delete a module - create_module - create a loadable module entry - query_module - query the kernel for various bits pertaining to modules Any execution of the loading and unloading module programs and system calls will trigger an audit record with an identifier of modules." + rationale: "Monitoring the use of all the various ways to manipulate kernel modules could provide system administrators with evidence that an unauthorized change was made to a kernel module, possibly compromising the security of the system." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor kernel module modification. 64 Bit systems Example: # { UID_MIN=$(awk '/^\\s*UID_MIN/{print $2}' /etc/login.defs) [ -n \"${UID_MIN}\" ] && printf \" -a always,exit -F arch=b64 -S init_module,finit_module,delete_module,create_module,query_module -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules -a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=${UID_MIN} -F auid!=unset -k kernel_modules \" >> /etc/audit/rules.d/50-kernel_modules.rules || printf \"ERROR: Variable 'UID_MIN' is unset.\\n\" } Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["5.2.3.19"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64|-F arch=b32 && r:-S && r:init_module && r:finit_module && r:delete_module && r:create_module && r:query_module && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - 'c:auditctl -l-> r:^-a && r:always,exit|exit,always && r:-F path=/usr/bin/kmod && r:-F perm=x && r:-F auid>=\d+ && r:-F auid!=-1|-F auid!=4294967295|-F auid!=unset && r:-k kernel_modules|-F key=kernel_modules' + - "c:ls -l /usr/sbin/lsmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/rmmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/insmod -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modinfo -> r:/bin/kmod" + - "c:ls -l /usr/sbin/modprobe -> r:/bin/kmod" + - "c:ls -l /usr/sbin/depmod -> r:/bin/kmod" + + # 5.2.3.20 Ensure the audit configuration is immutable. (Automated) + - id: 19186 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: This setting will require the system to be rebooted to update the active auditd configuration settings.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line -e 2 at the end of the file: Example: # printf -- \"-e 2 \" >> /etc/audit/rules.d/99-finalize.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["5.2.3.20"] + - cis_csc_v8: ["3.3", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1028"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "7.1", "9.4.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + condition: all + rules: + - 'c:sh -c "grep -iEh ''^\s*\t*-e 2\s*$'' /etc/audit/rules.d/*.rules | tail -1" -> r:^\s*\t*-e 2\s*$' + + # 5.2.3.21 Ensure the running and on disk configuration is the same. (Manual) + - id: 19187 + title: "Ensure the running and on disk configuration is the same." + description: "The Audit system have both on disk and running configuration. It is possible for these configuration settings to differ. Note: Due to the limitations of augenrules and auditctl, it is not absolutely guaranteed that loading the rule sets via augenrules --load will result in all rules being loaded or even that the user will be informed if there was a problem loading the rules." + rationale: "Configuration differences between what is currently running and what is on disk could cause unexpected problems or may give a false impression of compliance requirements." + remediation: 'If the rules are not aligned across all three () areas, run the following command to merge and load all rules: # augenrules --load Check if reboot is required. if [[ $(auditctl -s | grep "enabled") =~ "2" ]]; then echo "Reboot required to load rules"; fi.' + compliance: + - cis: ["5.2.3.21"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:augenrules --check -> r:^\s*/usr/sbin/augenrules && r:No change$' + + # 5.2.4.1 Ensure audit log files are mode 0640 or less permissive. (Automated) - Not Implemented + # 5.2.4.2 Ensure only authorized users own audit log files. (Automated) - Not Implemented + + # 5.2.4.3 Ensure only authorized groups are assigned ownership of audit log files. (Automated) + - id: 19188 + title: "Ensure only authorized groups are assigned ownership of audit log files." + description: "Audit log files contain information about the system and system activity." + rationale: "Access to audit records can reveal system and configuration data to attackers, potentially compromising its confidentiality." + remediation: "Run the following command to configure the audit log files to be group owned by adm: # find $(dirname $(awk -F\"=\" '/^\\s*log_file/ {print $2}' /etc/audit/auditd.conf | xargs)) -type f \\( ! -group adm -a ! -group root \\) -exec chgrp adm {} + Run the following command to set the log_group parameter in the audit configuration file to log_group = adm: # sed -ri 's/^\\s*#?\\s*log_group\\s*=\\s*\\S+(\\s*#.*)?.*$/log_group = adm\\1/' /etc/audit/auditd.conf Run the following command to restart the audit daemon to reload the configuration file: # systemctl restart auditd." + compliance: + - cis: ["5.2.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/audit/auditd.conf -> r:^\s*\t*log_group\s*\t*=\s*\t*adm|^\s*\t*log_group\s*\t*=\s*\t*root' + + # 5.2.4.4 Ensure the audit log directory is 0750 or more restrictive. (Automated) - Not Implemented + + # 5.2.4.5 Ensure audit configuration files are 640 or more restrictive. (Automated) + - id: 19189 + title: "Ensure audit configuration files are 640 or more restrictive." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to remove more permissive mode than 0640 from the audit configuration files: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) -exec chmod u-x,g-wx,o-rwx {} +." + compliance: + - cis: ["5.2.4.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:sh -c "stat -Lc \"%n %a\" /etc/audit/*.rules" -> r:^/etc/audit && !r:640|600|400' + - 'not c:sh -c "stat -Lc \"%n %a\" /etc/audit/*.conf" -> r:^/etc/audit && !r:640|600|400' + + # 5.2.4.6 Ensure audit configuration files are owned by root. (Automated) + - id: 19190 + title: "Ensure audit configuration files are owned by root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change ownership to root user: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -user root -exec chown root {} +." + compliance: + - cis: ["5.2.4.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:sh -c "stat -Lc \"%n %U\" /etc/audit/*.rules" -> r:^/etc/audit && !r:root' + - 'not c:sh -c "stat -Lc \"%n %U\" /etc/audit/*.conf" -> r:^/etc/audit && !r:root' + + # 5.2.4.7 Ensure audit configuration files belong to group root. (Automated) + - id: 19191 + title: "Ensure audit configuration files belong to group root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change group to root: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -group root -exec chgrp root {} +." + compliance: + - cis: ["5.2.4.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:sh -c "stat -Lc \"%n %G\" /etc/audit/*.rules" -> r:^/etc/audit && !r:root' + - 'not c:sh -c "stat -Lc \"%n %G\" /etc/audit/*.conf" -> r:^/etc/audit && !r:root' + + # 5.2.4.8 Ensure audit tools are 755 or more restrictive. (Automated) + - id: 19192 + title: "Ensure audit tools are 755 or more restrictive." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["5.2.4.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + + # 5.2.4.9 Ensure audit tools are owned by root. (Automated) + - id: 19193 + title: "Ensure audit tools are owned by root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to change the owner of the audit tools to the root user: # chown root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["5.2.4.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:stat -c "%n %u %U %g %G" /sbin/auditctl -> r:^/sbin && !r:0 root 0 root' + - 'not c:stat -c "%n %u %U %g %G" /sbin/aureport -> r:^/sbin && !r:0 root 0 root' + - 'not c:stat -c "%n %u %U %g %G" /sbin/ausearch -> r:^/sbin && !r:0 root 0 root' + - 'not c:stat -c "%n %u %U %g %G" /sbin/autrace -> r:^/sbin && !r:0 root 0 root' + - 'not c:stat -c "%n %u %U %g %G" /sbin/auditd -> r:^/sbin && !r:0 root 0 root' + - 'not c:stat -c "%n %u %U %g %G" /sbin/augenrules -> r:^/sbin && !r:0 root 0 root' + + # 5.2.4.10 Ensure audit tools belong to group root. (Automated) + - id: 19194 + title: "Ensure audit tools belong to group root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules Run the following command to change owner and group of the audit tools to root user and group: # chown root:root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["5.2.4.10"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'not c:stat -c "%n %a %U %G" /sbin/auditctl -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %a %U %G" /sbin/aureport -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %a %U %G" /sbin/ausearch -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %a %U %G" /sbin/autrace -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %a %U %G" /sbin/auditd -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + - 'not c:stat -c "%n %a %U %G" /sbin/augenrules -> r:^/sbin && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + + # 5.2.4.11 Ensure cryptographic mechanisms are used to protect the integrity of audit tools. (Automated) + - id: 19195 + title: "Ensure cryptographic mechanisms are used to protect the integrity of audit tools." + description: "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." + rationale: "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. Attackers may replace the audit tools or inject code into the existing tools with the purpose of providing the capability to hide or erase system activity from the audit logs. Audit tools should be cryptographically signed in order 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." + remediation: "Add or update the following selection lines for to a file ending in .conf in the /etc/aide/aide.conf.d/ or to /etc/aide/aide.conf to protect the integrity of the audit tools: # Audit Tools /sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512." + compliance: + - cis: ["5.2.4.11"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + condition: all + rules: + - "f:/etc/aide/aide.conf -> r:/sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512" + - "f:/etc/aide/aide.conf -> r:/sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512" + - "f:/etc/aide/aide.conf -> r:/sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512" + - "f:/etc/aide/aide.conf -> r:/sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512" + - "f:/etc/aide/aide.conf -> r:/sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512" + - "f:/etc/aide/aide.conf -> r:/sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512" + + # 6.1.1 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 19196 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd: # chmod u-x,go-wx /etc/passwd # chown root:root /etc/passwd." + compliance: + - cis: ["6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/passwd -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.2 Ensure permissions on /etc/passwd- are configured. (Automated) + - id: 19197 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/passwd-: # chmod u-x,go-wx /etc/passwd- # chown root:root /etc/passwd-." + compliance: + - cis: ["6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/passwd- -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.3 Ensure permissions on /etc/group are configured. (Automated) + - id: 19198 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group: # chmod u-x,go-wx /etc/group # chown root:root /etc/group." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/group -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.4 Ensure permissions on /etc/group- are configured. (Automated) + - id: 19199 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/group-: # chmod u-x,go-wx /etc/group- # chown root:root /etc/group-." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/group- -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.5 Ensure permissions on /etc/shadow are configured. (Automated) + - id: 19200 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run one of the following commands to set ownership of /etc/shadow to root and group to either root or shadow: # chown root:shadow /etc/shadow -OR- # chown root:root /etc/shadow Run the following command to remove excess permissions form /etc/shadow: # chmod u-x,g-wx,o-rwx /etc/shadow." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/shadow -> r:0 root \d+ shadow|0 root 0 root && r: r:644|640|604|600|400|500' + + # 6.1.6 Ensure permissions on /etc/shadow- are configured. (Automated) + - id: 19201 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run one of the following commands to set ownership of /etc/shadow- to root and group to either root or shadow: # chown root:shadow /etc/shadow- -OR- # chown root:root /etc/shadow- Run the following command to remove excess permissions form /etc/shadow-: # chmod u-x,g-wx,o-rwx /etc/shadow-." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/shadow- -> r:0 root \d+ shadow|0 root 0 root && r: r:644|640|604|600|400|500' + + # 6.1.7 Ensure permissions on /etc/gshadow are configured. (Automated) + - id: 19202 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run one of the following commands to set ownership of /etc/gshadow to root and group to either root or shadow: # chown root:shadow /etc/gshadow -OR- # chown root:root /etc/gshadow Run the following command to remove excess permissions form /etc/gshadow: # chmod u-x,g-wx,o-rwx /etc/gshadow." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/gshadow -> r:0 root \d+ shadow|0 root 0 root && r: r:644|640|604|600|400|500' + + # 6.1.8 Ensure permissions on /etc/gshadow- are configured. (Automated) + - id: 19203 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run one of the following commands to set ownership of /etc/gshadow- to root and group to either root or shadow: # chown root:shadow /etc/gshadow- -OR- # chown root:root /etc/gshadow- Run the following command to remove excess permissions form /etc/gshadow-: # chmod u-x,g-wx,o-rwx /etc/gshadow-." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/gshadow- -> r:0 root \d+ shadow|0 root 0 root && r: r:644|640|604|600|400|500' + + # 6.1.9 Ensure permissions on /etc/shells are configured. (Automated) + - id: 19204 + title: "Ensure permissions on /etc/shells are configured." + description: "/etc/shells is a text file which contains the full pathnames of valid login shells. This file is consulted by chsh and available to be queried by other programs." + rationale: "It is critical to ensure that the /etc/shells file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following commands to remove excess permissions, set owner, and set group on /etc/shells: # chmod u-x,go-wx /etc/shells # chown root:root /etc/shells." + compliance: + - cis: ["6.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/shells- -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.10 Ensure permissions on /etc/opasswd are configured. (Automated) + - id: 19205 + title: "Ensure permissions on /etc/opasswd are configured." + description: "/etc/security/opasswd and it's backup /etc/security/opasswd.old hold user's previous passwords if pam_unix or pam_pwhistory is in use on the system." + rationale: "It is critical to ensure that /etc/security/opasswd is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: 'Run the following commands to remove excess permissions, set owner, and set group on /etc/security/opasswd and /etc/security/opasswd.old is they exist: # [ -e "/etc/security/opasswd" ] && chmod u-x,go-rwx /etc/security/opasswd # [ -e "/etc/security/opasswd" ] && chown root:root /etc/security/opasswd # [ -e "/etc/security/opasswd.old" ] && chmod u-x,go-rwx /etc/security/opasswd.old # [ -e "/etc/security/opasswd.old" ] && chown root:root /etc/security/opasswd.old.' + compliance: + - cis: ["6.1.10"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat -Lc "%n %a %u %U %g %G" /etc/security/opasswds -> r:0 root 0 root && r:644|640|604|600|400|500' + + # 6.1.11 Ensure world writable files and directories are secured. (Automated) - Not Implemented + # 6.1.12 Ensure no unowned or ungrouped files or directories exist. (Automated) - Not Implemented + # 6.1.13 Ensure SUID and SGID files are reviewed. (Manual) - - Not Implemented + + # 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords. (Automated) + - id: 19206 + title: "Ensure accounts in /etc/passwd use shadowed passwords." + description: "Local accounts can uses shadowed passwords. With shadowed passwords, The passwords are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. Accounts with a shadowed password have an x in the second field in /etc/passwd." + rationale: "The /etc/passwd file also contains information like user ID's and group ID's that are used by many system programs. Therefore, the /etc/passwd file must remain world readable. In spite of encoding the password with a randomly-generated one-way hash function, an attacker could still break the system if they got access to the /etc/passwd file. This can be mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. This helps mitigate the risk of an attacker gaining access to the encoded passwords with which to perform a dictionary attack. Note: - All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user. - A user account with an empty second field in /etc/passwd allows the account to be logged into by providing only the username." + remediation: "Run the following command to set accounts to use shadowed passwords: # sed -e 's/^\\([a-zA-Z0-9_]*\\):[^:]*:/\\1:x:/' -i /etc/passwd Investigate to determine if the account is logged in and what it is being used for, to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1003", "T1003.008"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'not f:/etc/passwd -> !r:^\w+:x:' + + # 6.2.2 Ensure /etc/shadow password fields are not empty. (Automated) + - id: 19207 + title: "Ensure /etc/shadow password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'not f:/etc/shadow -> r:^\w+::' + + # 6.2.3 Ensure all groups in /etc/passwd exist in /etc/group. (Automated) - Not Implemented + # 6.2.4 Ensure shadow group is empty. (Automated) + - id: 19208 + title: "Ensure shadow group is empty." + description: "The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group." + rationale: "Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts." + remediation: "Run the following command to remove all users from the shadow group # sed -ri 's/(^shadow:[^:]*:[^:]*:)([^:]+$)/\\1/' /etc/group Change the primary group of any users with shadow as their primary group. # usermod -g ." + compliance: + - cis: ["6.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/group -> r:shadow:\w*:\d+:$' + + # 6.2.5 Ensure no duplicate UIDs exist. (Automated) - Not Implemented + # 6.2.6 Ensure no duplicate GIDs exist. (Automated) - Not Implemented + # 6.2.7 Ensure no duplicate user names exist. (Automated) - Not Implemented + # 6.2.8 Ensure no duplicate group names exist. (Automated) - Not Implemented + # 6.2.9 Ensure root PATH Integrity. (Automated) - Not Implemented + + # 6.2.10 Ensure root is the only UID 0 account. (Automated) + - id: 19209 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.10"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1548"] + condition: all + rules: + - 'not f:/etc/passwd -> !r:^\s*\t*# && !r:^root: && r:^\w+:\w+:0:' + + # 6.2.11 Ensure local interactive user home directories are configured. (Automated) - Not Implemented + # 6.2.12 Ensure local interactive user dot files access is configured. (Automated) - Not Implemented diff --git a/etc/ruleset/sca/ubuntu/cis_ubuntu22_04.yml b/etc/ruleset/sca/ubuntu/cis_ubuntu22_04.yml new file mode 100644 index 0000000000..7f8f1de27a --- /dev/null +++ b/etc/ruleset/sca/ubuntu/cis_ubuntu22_04.yml @@ -0,0 +1,4491 @@ +# Security Configuration Assessment +# CIS Checks for Ubuntu Linux 22.04 LTS +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# SCA policy for Ubuntu Linux 22.04 LTS based on Center for Internet Security Ubuntu Linux 22.04 LTS Benchmark v1.0.0 - 08-30-2022 + +policy: + id: "cis_ubuntu22-04" + file: "cis_ubuntu22_04.yml" + name: "CIS Ubuntu Linux 22.04 LTS Benchmark v1.0.0." + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Ubuntu Linux 22.04 LTS based on CIS benchmark for Ubuntu Linux 22.04 LTS." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check Ubuntu version." + description: "Requirements for running the SCA scan against Ubuntu Linux 22.04 LTS" + condition: all + rules: + - "f:/etc/os-release -> r:Ubuntu 22.04" + - "f:/proc/sys/kernel/ostype -> Linux" + +checks: + # 1 Initial Setup + # 1.1 Filesystem Configuration + # 1.1.1 Disable unused filesystems + # 1.1.1.1 Ensure mounting of cramfs filesystems is disabled (Automated) - Not implemented + # 1.1.1.2 Ensure mounting of squashfs filesystems is disabled (Automated) - Not implemented + # 1.1.1.3 Ensure mounting of jffs2 filesystems is disabled (Automated) - Not implemented + + # 1.1.2.1 Ensure /tmp is a separate partition. (Automated) + - id: 28500 + title: "Ensure /tmp is a separate partition." + description: "The /tmp directory is a world-writable directory used for temporary storage by all users and some applications." + rationale: "Making /tmp its own file system allows an administrator to set additional mount options such as the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hard link to a system setuid program and wait for it to be updated. Once the program was updated, the hard link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw. This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp." + impact: "Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a configuration where /tmp is not a separate file system it will essentially have the whole disk available, as the default installation only creates a single / partition. On the other hand, a RAM-based /tmp (as with tmpfs) will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily. Another alternative is to create a dedicated partition for /tmp from a separate volume or disk. One of the downsides of a disk-based dedicated partition is that it will be slower than tmpfs which is RAM-based. /tmp utilizing tmpfs can be resized using the size={size} parameter in the relevant entry in /etc/fstab." + remediation: "First ensure that systemd is correctly configured to ensure that /tmp will be mounted at boot time. # systemctl unmask tmp.mount For specific configuration requirements of the /tmp mount for your environment, modify /etc/fstab or tmp.mount. Example of /etc/fstab configured tmpfs file system with specific mount options: tmpfs /tmp 0 tmpfs defaults,rw,nosuid,nodev,noexec,relatime,size=2G 0 Example of tmp.mount configured tmpfs file system with specific mount options: [Unit] Description=Temporary Directory /tmp ConditionPathIsSymbolicLink=!/tmp DefaultDependencies=no Conflicts=umount.target Before=local-fs.target umount.target After=swap.target [Mount] What=tmpfs Where=/tmp Type=tmpfs." + references: + - "https://www.freedesktop.org/wiki/Software/systemd/APIFileSystems/" + - "https://www.freedesktop.org/software/systemd/man/systemd-fstab-generator.html" + compliance: + - cis: ["1.1.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /tmp -> r:\s*/tmp\s' + - "c:systemctl is-enabled tmp.mount -> r:generated|enabled" + + # 1.1.2.2 Ensure nodev option set on /tmp partition. (Automated) + - id: 28501 + title: "Ensure nodev option set on /tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /tmp." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nodev" + + # 1.1.2.3 Ensure noexec option set on /tmp partition. (Automated) + - id: 28502 + title: "Ensure noexec option set on /tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:noexec" + + # 1.1.2.4 Ensure nosuid option set on /tmp partition. (Automated) + - id: 28503 + title: "Ensure nosuid option set on /tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. Example: /tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /tmp with the configured options: # mount -o remount /tmp." + compliance: + - cis: ["1.1.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /tmp -> r:nosuid" + + # 1.1.3.1 Ensure separate partition exists for /var. (Automated) + - id: 28504 + title: "Ensure separate partition exists for /var." + description: "The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable." + rationale: "The reasoning for mounting /var on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var and cause unintended behavior across the system as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behaviour. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var -> r:\s*/var\s' + + # 1.1.3.2 Ensure nodev option set on /var partition. (Automated) + - id: 28505 + title: "Ensure nodev option set on /var partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "IF the /var partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:nodev" + + # 1.1.3.3 Ensure nosuid option set on /var partition. (Automated) + - id: 28506 + title: "Ensure nosuid option set on /var partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var." + remediation: "IF the /var partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var partition. Example: /var defaults,rw,nosuid,nodev,relatime 0 0 Run the following command to remount /var with the configured options: # mount -o remount /var." + compliance: + - cis: ["1.1.3.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var -> r:nosuid" + + # 1.1.4.1 Ensure separate partition exists for /var/tmp. (Automated) + - id: 28507 + title: "Ensure separate partition exists for /var/tmp." + description: "The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications. Temporary file residing in /var/tmp is to be preserved between reboots." + rationale: "The reasoning for mounting /var/tmp on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/tmp directory may contain world-writable files and directories, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/tmp and cause the potential disruption to daemons as the disk is full. Fine grained control over the mount Configuring /var/tmp as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection from exploitation An example of exploiting /var/tmp may be an attacker establishing a hard-link to a system setuid program and wait for it to be updated. Once the program was updated, the hard-link would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.4.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/tmp -> r:\s*/var/tmp\s' + + # 1.1.4.2 Ensure noexec option set on /var/tmp partition. (Automated) + - id: 28508 + title: "Ensure noexec option set on /var/tmp partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp." + remediation: "IF the /var/tmp partition exists, edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:noexec" + + # 1.1.4.3 Ensure nosuid option set on /var/tmp partition. (Automated) + - id: 28509 + title: "Ensure nosuid option set on /var/tmp partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp." + remediation: "IF the /var/tmp partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nosuid" + + # 1.1.4.4 Ensure nodev option set on /var/tmp partition. (Automated) + - id: 28510 + title: "Ensure nodev option set on /var/tmp partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/tmp." + remediation: "IF the /var/tmp partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. Example: /var/tmp defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/tmp with the configured options: # mount -o remount /var/tmp." + compliance: + - cis: ["1.1.4.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:findmnt --kernel /var/tmp -> r:nodev" + + # 1.1.5.1 Ensure separate partition exists for /var/log. (Automated) + - id: 28511 + title: "Ensure separate partition exists for /var/log." + description: "The /var/log directory is used by system services to store log data." + rationale: "The reasoning for mounting /var/log on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log directory contain the log files that can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. Fine grained control over the mount Configuring /var/log as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of log data As /var/log contains log files, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log . For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.5.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:\s*/var/log\s' + + # 1.1.5.2 Ensure nodev option set on /var/log partition. (Automated) + - id: 28512 + title: "Ensure nodev option set on /var/log partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log." + remediation: "IF the /var/log partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:\s*/var/log\s && r:nodev' + + # 1.1.5.3 Ensure noexec option set on /var/log partition. (Automated) + - id: 28513 + title: "Ensure noexec option set on /var/log partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot run executable binaries from /var/log." + remediation: "IF the /var/log partition exists, edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:\s*/var/log\s && r:noexec' + + # 1.1.5.4 Ensure nosuid option set on /var/log partition. (Automated) + - id: 28514 + title: "Ensure nosuid option set on /var/log partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log filesystem is only intended for log files, set this option to ensure that users cannot create setuid files in /var/log." + remediation: "IF the /var/log partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log partition. Example: /var/log defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log with the configured options: # mount -o remount /var/log." + compliance: + - cis: ["1.1.5.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log -> r:\s*/var/log\s && r:nosuid' + + # 1.1.6.1 Ensure separate partition exists for /var/log/audit. (Automated) + - id: 28515 + title: "Ensure separate partition exists for /var/log/audit." + description: "The auditing daemon, auditd, stores log data in the /var/log/audit directory." + rationale: "The reasoning for mounting /var/log/audit on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /var/log/audit directory contain the audit.log file that can grow quite large, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /var/log/audit and cause auditd to trigger it's space_left_action as the disk is full. See man auditd.conf for details. Fine grained control over the mount Configuring /var/log/audit as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of audit data As /var/log/audit contains audit logs, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.6.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:\s*/var/log/audit\s' + + # 1.1.6.2 Ensure noexec option set on /var/log/audit partition. (Automated) + - id: 28516 + title: "Ensure noexec option set on /var/log/audit partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Since the /var/log/audit filesystem is only intended for audit logs, set this option to ensure that users cannot run executable binaries from /var/log/audit." + remediation: "IF the /var/log/audit partition exists, edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:\s*/var/log/audit\s && r:noexec' + + # 1.1.6.3 Ensure nodev option set on /var/log/audit partition. (Automated) + - id: 28517 + title: "Ensure nodev option set on /var/log/audit partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /var/log/audit filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var/log/audit." + remediation: "IF the /var/log/audit partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:\s*/var/log/audit\s && r:nodev' + + # 1.1.6.4 Ensure nosuid option set on /var/log/audit partition. (Automated) + - id: 28518 + title: "Ensure nosuid option set on /var/log/audit partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /var/log/audit filesystem is only intended for variable files such as logs, set this option to ensure that users cannot create setuid files in /var/log/audit." + remediation: "IF the /var/log/audit partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/log/audit partition. Example: /var/log/audit defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /var/log/audit with the configured options: # mount -o remount /var/log/audit." + compliance: + - cis: ["1.1.6.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /var/log/audit -> r:\s*/var/log/audit\s && r:nosuid' + + # 1.1.7.1 Ensure separate partition exists for /home. (Automated) + - id: 28519 + title: "Ensure separate partition exists for /home." + description: "The /home directory is used to support disk storage needs of local users." + rationale: "The reasoning for mounting /home on a separate partition is as follow. Protection from resource exhaustion The default installation only creates a single / partition. Since the /home directory contains user generated data, there is a risk of resource exhaustion. It will essentially have the whole disk available to fill up and impact the system as a whole. In addition, other operations on the system could fill up the disk unrelated to /home and impact all local users. Fine grained control over the mount Configuring /home as its own file system allows an administrator to set additional mount options such as noexec/nosuid/nodev. These options limits an attackers ability to create exploits on the system. In the case of /home options such as usrquota/grpquota may be considered to limit the impact that users can have on each other with regards to disk resource exhaustion. Other options allow for specific behavior. See man mount for exact details regarding filesystem-independent and filesystem-specific options. Protection of user data As /home contains user data, care should be taken to ensure the security and integrity of the data and mount point." + impact: "Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations." + remediation: "For new installations, during installation create a custom partition setup and specify a separate partition for /home. For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate." + references: + - "http://tldp.org/HOWTO/LVM-HOWTO/" + compliance: + - cis: ["1.1.7.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1499", "T1499.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:\s*/home\s' + + # 1.1.7.2 Ensure nodev option set on /home partition. (Automated) + - id: 28520 + title: "Ensure nodev option set on /home partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /home filesystem is not intended to support devices, set this option to ensure that users cannot create a block or character special devices in /var." + remediation: "IF the /home partition exists, edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:\s*/home\s && r:nodev' + + # 1.1.7.3 Ensure nosuid option set on /home partition. (Automated) + - id: 28521 + title: "Ensure nosuid option set on /home partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Since the /home filesystem is only intended for user file storage, set this option to ensure that users cannot create setuid files in /home." + remediation: "IF the /home partition exists, edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /home partition. Example: /home defaults,rw,nosuid,nodev,relatime 0 0 Run the following command to remount /home with the configured options: # mount -o remount /home." + compliance: + - cis: ["1.1.7.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /home -> r:\s*/home\s && r:nosuid' + + # 1.1.8.1 Ensure nodev option set on /dev/shm partition. (Automated) + - id: 28522 + title: "Ensure nodev option set on /dev/shm partition." + description: "The nodev mount option specifies that the filesystem cannot contain special devices." + rationale: "Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions." + remediation: "Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1200"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:\s*/dev/shm\s && r:nodev' + + # 1.1.8.2 Ensure noexec option set on /dev/shm partition. (Automated) + - id: 28523 + title: "Ensure noexec option set on /dev/shm partition." + description: "The noexec mount option specifies that the filesystem cannot contain executable binaries." + rationale: "Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system." + remediation: "Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. Example: /dev/shm defaults,rw,nosuid,nodev,noexec,relatime 0 0 Run the following command to remount /dev/shm with the configured options: # mount -o remount /dev/shm NOTE It is recommended to use tmpfs as the device/filesystem type as /dev/shm is used as shared memory space by applications." + compliance: + - cis: ["1.1.8.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1204", "T1204.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:\s*/dev/shm\s && r:noexec' + + # 1.1.8.3 Ensure nosuid option set on /dev/shm partition. (Automated) + - id: 28524 + title: "Ensure nosuid option set on /dev/shm partition." + description: "The nosuid mount option specifies that the filesystem cannot contain setuid files." + rationale: "Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them." + remediation: "Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information. Run the following command to remount /dev/shm using the updated options from /etc/fstab: # mount -o remount /dev/shm." + compliance: + - cis: ["1.1.8.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1038"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548", "T1548.001"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:findmnt --kernel /dev/shm -> r:\s*/dev/shm\s && r:nosuid' + + # 1.1.9 Disable Automounting. (Automated) + - id: 28525 + title: "Disable Automounting." + description: "autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives." + rationale: "With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves." + impact: "The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting." + remediation: "If there are no other packages that depends on autofs, remove the package with: # apt purge autofs OR if there are dependencies on the autofs package: Run the following commands to mask autofs: # systemctl stop autofs # systemctl mask autofs." + compliance: + - cis: ["1.1.9"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + - mitre_techniques: ["T1068", "T1203", "T1211", "T1212"] + condition: all + rules: + - 'c:systemctl is-enabled autofs -> r:Failed to get unit file state for autofs\.service|disabled' + + # 1.1.10 Disable USB Storage (Automated) - Not implemented + + # 1.2.1 Ensure package manager repositories are configured (Manual) - Not implemented + # 1.2.2 Ensure GPG keys are configured (Manual) - Not implemented + + # 1.3.1 Ensure AIDE is installed. (Automated) + - id: 28526 + title: "Ensure AIDE is installed." + description: "AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system." + rationale: "By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries." + remediation: "Install AIDE using the appropriate package manager or manual installation: # apt install aide aide-common Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options. Run the following commands to initialize AIDE: # aideinit # mv /var/lib/aide/aide.db.new /var/lib/aide/aide.db." + compliance: + - cis: ["1.3.1"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_techniques: ["T1036", "T1036.002", "T1036.003", "T1036.004", "T1036.005", "T1565", "T1565.001"] + - nist_sp_800-53: ["AC-6(9)"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:dpkg-query -s aide -> r:Status: install ok installed" + - "c:dpkg-query -s aide-common -> r:Status: install ok installed" + + # 1.3.2 Ensure filesystem integrity is regularly checked (Automated) - Not implemented + + # 1.4.1 Ensure bootloader password is set. (Automated) + - id: 28527 + title: "Ensure bootloader password is set." + description: "Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters." + rationale: "Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off AppArmor at boot time)." + impact: 'If password protection is enabled, only the designated superuser can edit a Grub 2 menu item by pressing "e" or access the GRUB 2 command line by pressing "c" If GRUB 2 is set up to boot automatically to a password-protected menu entry the user has no option to back out of the password prompt to select another menu entry. Holding the SHIFT key will not display the menu in this case. The user must enter the correct username and password. If unable, the configuration files will have to be edited via the LiveCD or other means to fix the problem You can add --unrestricted to the menu entries to allow the system to boot without entering a password. Password will still be required to edit menu items. More Information: https://help.ubuntu.com/community/Grub2/Passwords.' + remediation: 'Create an encrypted password with grub-mkpasswd-pbkdf2: # grub-mkpasswd-pbkdf2 Enter password: Reenter password: PBKDF2 hash of your password is Add the following into a custom /etc/grub.d configuration file: cat < EOF The superuser/user information and password should not be contained in the /etc/grub.d/00_header file as this file could be overwritten in a package update. If there is a requirement to be able to boot/reboot without entering the password, edit /etc/grub.d/10_linux and add --unrestricted to the line CLASS= Example: CLASS="--class gnu-linux --class gnu --class os --unrestricted" Run the following command to update the grub2 configuration: # update-grub.' + compliance: + - cis: ["1.4.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1046"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1542"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "f:/boot/grub/grub.cfg -> r:^\\s*\\t*set superusers=" + - "f:/boot/grub/grub.cfg -> r:^\\s*\\t*password_pbkdf2\\s*\\t*\\w+" + + # 1.4.2 Ensure permissions on bootloader config are configured. (Automated) + - id: 28528 + title: "Ensure permissions on bootloader config are configured." + description: "The grub configuration file contains information on boot settings and passwords for unlocking boot options." + rationale: "Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them." + remediation: "Run the following commands to set permissions on your grub configuration: # chown root:root /boot/grub/grub.cfg # chmod u-wx,go-rwx /boot/grub/grub.cfg." + compliance: + - cis: ["1.4.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005", "TA0007"] + - mitre_techniques: ["T1542"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /boot/grub/grub.cfg -> r:Access:\s*\t*\(0400/-r--------\) && r:Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)' + + # 1.4.3 Ensure authentication required for single user mode. (Automated) + - id: 28529 + title: "Ensure authentication required for single user mode." + description: "Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader." + rationale: "Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials." + remediation: "Run the following command and follow the prompts to set a password for the root user: # passwd root." + compliance: + - cis: ["1.4.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "f:/etc/shadow -> r:^root:\\$\\d+" + + # 1.5.1 Ensure address space layout randomization (ASLR) is enabled (Automated) - Not implemented + + # 1.5.2 Ensure prelink is not installed. (Automated) + - id: 28530 + title: "Ensure prelink is not installed." + description: "prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases." + rationale: "The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc." + remediation: "Run the following command to restore binaries to normal: # prelink -ua Uninstall prelink using the appropriate package manager or manual installation: # apt purge prelink." + compliance: + - cis: ["1.5.2"] + - cis_csc_v8: ["3.14"] + - cis_csc_v7: ["14.9"] + - cmmc_v2.0: ["AC.L2-3.1.7"] + - hipaa: ["164.312(b)", "164.312(c)(1)", "164.312(c)(2)"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1050"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1055", "T1055.009", "T1065", "T1065.001"] + - nist_sp_800-53: ["AC-6(9)"] + - pci_dss_v3.2.1: ["10.2.1", "11.5"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1"] + - soc_2: ["CC6.1"] + condition: any + rules: + - "c:dpkg-query -s prelink -> r:package 'prelink' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\t${Status}\t${db:Status-Status}\\n' prelink -> r:prelink\\s*\\t*unknown\\s*\\t*ok\\s*\\t*not-installed\\s*\\t*not-installed|no packages found matching prelink" + + # 1.5.3 Ensure Automatic Error Reporting is not enabled. (Automated) + - id: 28531 + title: "Ensure Automatic Error Reporting is not enabled." + description: "The Apport Error Reporting Service automatically generates crash reports for debugging." + rationale: "Apport collects potentially sensitive data, such as core dumps, stack traces, and log files. They can contain passwords, credit card numbers, serial numbers, and other private material." + remediation: "Edit /etc/default/apport and add or edit the enabled parameter to equal 0: enabled=0 Run the following commands to stop and disable the apport service # systemctl stop apport.service # systemctl --now disable apport.service -- OR -- Run the following command to remove the apport package: # apt purge apport." + compliance: + - cis: ["1.5.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled apport.service -> r:disabled" + - "not f:/etc/default/apport -> n:enabled=(\\d+) compare != 0" + - "not c:systemctl is-active apport.service -> r:active" + + # 1.5.4 Ensure core dumps are restricted. (Automated) + - id: 28532 + title: "Ensure core dumps are restricted." + description: "A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user." + rationale: "Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5)). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core." + remediation: "Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file: * hard core 0 Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file: fs.suid_dumpable = 0 Run the following command to set the active kernel parameter: # sysctl -w fs.suid_dumpable=0 IF systemd-coredump is installed: edit /etc/systemd/coredump.conf and add/modify the following lines: Storage=none ProcessSizeMax=0 Run the command: systemctl daemon-reload." + references: + - "http://wiki.apparmor.net/index.php/Documentation" + - "https://help.ubuntu.com/community/AppArmor" + - "https://www.suse.com/documentation/apparmor/" + compliance: + - cis: ["1.5.4"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1005"] + condition: all + rules: + - "c:sysctl fs.suid_dumpable -> r:^fs.suid_dumpable = 0" + - "c:systemctl is-enabled coredump.service -> r:enabled|masked|disabled" + - 'c:grep -Rh "fs.suid_dumpable" /etc/sysctl.conf /etc/sysctl.d/ -> !r:^\s*\t*# && r:fs.suid_dumpable = 0' + - 'c:grep -Rh "hard core 0" /etc/security/limits.conf /etc/security/limits.d/ -> !r:^\s*\t*# && r:\p hard core 0' + + # 1.6.1.1 Ensure AppArmor is installed. (Automated) + - id: 28533 + title: "Ensure AppArmor is installed." + description: "AppArmor provides Mandatory Access Controls." + rationale: "Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available." + remediation: "Install AppArmor. # apt install apparmor." + compliance: + - cis: ["1.6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\t${Status}\t${db:Status-Status}\\n' apparmor -> r:install\\s+ok\\s+installed" + + # 1.6.1.2 Ensure AppArmor is enabled in the bootloader configuration. (Automated) + - id: 28534 + title: "Ensure AppArmor is enabled in the bootloader configuration." + description: "Configure AppArmor to be enabled at boot time and verify that it has not been overwritten by the bootloader boot parameters. Note: This recommendation is designed around the grub bootloader, if LILO or another bootloader is in use in your environment enact equivalent settings." + rationale: "AppArmor must be enabled at boot time in your bootloader configuration to ensure that the controls it provides are not overridden." + remediation: 'Edit /etc/default/grub and add the apparmor=1 and security=apparmor parameters to the GRUB_CMDLINE_LINUX= line GRUB_CMDLINE_LINUX="apparmor=1 security=apparmor" Run the following command to update the grub2 configuration: # update-grub.' + compliance: + - cis: ["1.6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/boot/grub/grub.cfg -> r:^\s*linux && r:apparmor=1' + - 'f:/boot/grub/grub.cfg -> r:^\s*linux && r:security=apparmor' + - 'not f:/boot/grub/grub.cfg -> r:^\s*linux && !r:apparmor=1' + - 'not f:/boot/grub/grub.cfg -> r:^\s*linux && !r:security=apparmor' + + # 1.6.1.3 Ensure all AppArmor Profiles are in enforce or complain mode. (Automated) + - id: 28535 + title: "Ensure all AppArmor Profiles are in enforce or complain mode." + description: "AppArmor profiles define what resources applications are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* OR Run the following command to set all profiles to complain mode: # aa-complain /etc/apparmor.d/* Note: Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:apparmor_status -> n:^(\d+)\s+profiles\s+are\s+loaded compare > 0' + - 'c:apparmor_status -> r:^0\s+profiles\s+are\s+in\s+kill\s+mode' + - 'c:apparmor_status -> r:^0\s+profiles\s+are\s+in\s+unconfined\s+mode' + - "c:apparmor_status -> r:^0 processes are unconfined" + + # 1.6.1.4 Ensure all AppArmor Profiles are enforcing. (Automated) + - id: 28536 + title: "Ensure all AppArmor Profiles are enforcing." + description: "AppArmor profiles define what resources applications are able to access." + rationale: "Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated." + remediation: "Run the following command to set all profiles to enforce mode: # aa-enforce /etc/apparmor.d/* Note: Any unconfined processes may need to have a profile created or activated for them and then be restarted." + compliance: + - cis: ["1.6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1068", "T1565", "T1565.001", "T1565.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:apparmor_status -> n:^(\d+)\s+profiles\s+are\s+loaded compare > 0' + - 'c:apparmor_status -> n:^(\d+)\s+profiles\s+are\s+in\s+enforce\s+mode compare > 0' + - 'c:apparmor_status -> r:^0\s+profiles\s+are\s+in\s+kill\s+mode' + - 'c:apparmor_status -> r:^0\s+profiles\s+are\s+in\s+unconfined\s+mode' + - 'c:apparmor_status -> r:^0\s*profiles\s+are\s+in\s+complain\s+mode' + - 'c:apparmor_status -> r:^0\s*processes\s+are\s+unconfined' + + # 1.7.1 Ensure message of the day is configured properly. (Automated) + - id: 28537 + title: "Ensure message of the day is configured properly." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform OR if the motd is not used, this file can be removed. Run the following command to remove the motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + condition: any + rules: + - 'not f:/etc/motd -> r:\\v|\\r|\\m|\s|Debian|Ubuntu' + - "not f:/etc/motd" + + # 1.7.2 Ensure local login warning banner is configured properly. (Automated) + - id: 28538 + title: "Ensure local login warning banner is configured properly." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version - or the operating system's name." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue." + compliance: + - cis: ["1.7.2"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1082", "T1592", "T1592.004"] + condition: none + rules: + - 'f:/etc/issue -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + # 1.7.3 Ensure remote login warning banner is configured properly. (Automated) + - id: 28539 + title: "Ensure remote login warning banner is configured properly." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services. Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \\m - machine architecture \\r - operating system release \\s - operating system name \\v - operating system version." + rationale: 'Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.' + remediation: "Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \\m , \\r , \\s , \\v or references to the OS platform # echo \"Authorized uses only. All activity may be monitored and reported.\" > /etc/issue.net." + compliance: + - cis: ["1.7.3"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1018", "T1082", "T1592", "T1592.004"] + condition: none + rules: + - 'f:/etc/issue.net -> r:\\v|\\r|\\m|\\s|Debian|Ubuntu' + + # 1.7.4 Ensure permissions on /etc/motd are configured. (Automated) + - id: 28540 + title: "Ensure permissions on /etc/motd are configured." + description: "The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users." + rationale: "If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/motd : # chown root:root $(readlink -e /etc/motd) # chmod u-x,go-wx $(readlink -e /etc/motd) OR run the following command to remove the /etc/motd file: # rm /etc/motd." + compliance: + - cis: ["1.7.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'c:stat /etc/motd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*\t*Gid:\s*\(\s*0/\s*root\)' + - "not f:/etc/motd" + + # 1.7.5 Ensure permissions on /etc/issue are configured. (Automated) + - id: 28541 + title: "Ensure permissions on /etc/issue are configured." + description: "The contents of the /etc/issue file are displayed to users prior to login for local terminals." + rationale: "If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue : # chown root:root $(readlink -e /etc/issue) # chmod u-x,go-wx $(readlink -e /etc/issue)." + compliance: + - cis: ["1.7.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/issue -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*\t*Gid:\s*\(\s*0/\s*root\)' + + # 1.7.6 Ensure permissions on /etc/issue.net are configured. (Automated) + - id: 28542 + title: "Ensure permissions on /etc/issue.net are configured." + description: "The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services." + rationale: "If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information." + remediation: "Run the following commands to set permissions on /etc/issue.net : # chown root:root $(readlink -e /etc/issue.net) # chmod u-x,go-wx $(readlink -e /etc/issue.net)." + compliance: + - cis: ["1.7.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/issue.net -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*0/\s*root\)\s*\t*Gid:\s*\(\s*0/\s*root\)' + + # 1.8.1 Ensure GNOME Display Manager is removed. (Automated) + - id: 28543 + title: "Ensure GNOME Display Manager is removed." + description: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins." + rationale: "If a Graphical User Interface (GUI) is not required, it should be removed to reduce the attack surface of the system." + impact: "Removing the GNOME Display manager will remove the Graphical User Interface (GUI) from the system." + remediation: "Run the following command to uninstall gdm3: # apt purge gdm3." + compliance: + - cis: ["1.8.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\t${Status}\t${db:Status-Status}\\n' gdm3 -> r:gdm\\s+unknown\\s+ok\\s+not-installed|no\\s+packages\\s+found\\s+matching\\s+gdm3" + + # 1.8.2 Ensure GDM login banner is configured (Automated) - Not implemented + # 1.8.3 Ensure GDM disable-user-list option is enabled (Automated) - Not implemented + # 1.8.4 Ensure GDM screen locks when the user is idle (Automated) - Not implemented + # 1.8.5 Ensure GDM screen locks cannot be overridden (Automated) - Not implemented + # 1.8.6 Ensure GDM automatic mounting of removable media is disabled (Automated) - Not implemented + # 1.8.7 Ensure GDM disabling automatic mounting of removable media is not overridden (Automated) - Not implemented + # 1.8.8 Ensure GDM autorun-never is enabled (Automated) - Not implemented + # 1.8.9 Ensure GDM autorun-never is not overridden (Automated) - Not implemented + + # 1.8.10 Ensure XDCMP is not enabled. (Automated) + - id: 28544 + title: "Ensure XDCMP is not enabled." + description: "X Display Manager Control Protocol (XDMCP) is designed to provide authenticated access to display management services for remote displays." + rationale: "XDMCP is inherently insecure. - XDMCP is not a ciphered protocol. This may allow an attacker to capture keystrokes entered by a user - XDMCP is vulnerable to man-in-the-middle attacks. This may allow an attacker to steal the credentials of legitimate users by impersonating the XDMCP server." + remediation: "Edit the file /etc/gdm3/custom.conf and remove the line: Enable=true." + compliance: + - cis: ["1.8.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1050"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1040", "T1056", "T1056.001", "T1557"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "not f:/etc/gdm3" + - 'not f:/etc/gdm3/custom.conf -> r:^\s*Enable\s*=\s*true' + + # 1.9 Ensure updates, patches, and additional security software are installed (Manual) - Not implemented + + # 2.1.1.1 Ensure a single time synchronization daemon is in use (Automated) - Not implemented + # 2.1.2.1 Ensure chrony is configured with authorized timeserver (Manual) - Not implemented + + # 2.1.2.2 Ensure chrony is running as user _chrony. (Automated) + - id: 28545 + title: "Ensure chrony is running as user _chrony." + description: "The chrony package is installed with a dedicated user account _chrony. This account is granted the access required by the chronyd service." + rationale: "The chronyd service should run with only the required privileges." + remediation: "Add or edit the user line to /etc/chrony/chrony.conf or a file ending in .conf in /etc/chrony/conf.d/: user _chrony OR If another time synchronization service is in use on the system, run the following command to remove chrony from the system: # apt purge chrony." + compliance: + - cis: ["2.1.2.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: any + rules: + - 'c:ps -ef -> r:_chrony\.+chronyd' + - "c:systemctl is-enabled systemd-timesyncd.service -> r:enabled" + + # 2.1.2.3 Ensure chrony is enabled and running. (Automated) + - id: 28546 + title: "Ensure chrony is enabled and running." + description: "chrony is a daemon for synchronizing the system clock across the network." + rationale: "chrony needs to be enabled and running in order to synchronize the system to a timeserver. Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: "IF chrony is in use on the system, run the following commands: Run the following command to unmask chrony.service: # systemctl unmask chrony.service Run the following command to enable and start chrony.service: # systemctl --now enable chrony.service OR If another time synchronization service is in use on the system, run the following command to remove chrony: # apt purge chrony." + compliance: + - cis: ["2.1.2.3"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:ps -ef -> r:chronyd" + - "c:systemctl is-enabled chrony.service -> r:enabled" + - "c:systemctl is-active chrony.service -> r:active" + + # 2.1.3.1 Ensure systemd-timesyncd configured with authorized timeserver (Manual) - Not implemented + + # 2.1.3.2 Ensure systemd-timesyncd is enabled and running. (Automated) + - id: 28547 + title: "Ensure systemd-timesyncd is enabled and running." + description: "systemd-timesyncd is a daemon that has been added for synchronizing the system clock across the network." + rationale: "systemd-timesyncd needs to be enabled and running in order to synchronize the system to a timeserver. Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: "IF systemd-timesyncd is in use on the system, run the following commands: Run the following command to unmask systemd-timesyncd.service: # systemctl unmask systemd-timesyncd.service Run the following command to enable and start systemd-timesyncd.service: # systemctl --now enable systemd-timesyncd.service OR If another time synchronization service is in use on the system, run the following command to stop and mask systemd-timesyncd: # systemctl --now mask systemd-timesyncd.service." + compliance: + - cis: ["2.1.3.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-timesyncd.service -> r:enabled" + - "c:systemctl is-active systemd-timesyncd.service -> r:active" + + # 2.1.4.1 Ensure ntp access control is configured. (Automated) + - id: 28548 + title: "Ensure ntp access control is configured." + description: 'ntp Access Control Commands: restrict address [mask mask] [ippeerlimit int] [flag ...] The address argument expressed in dotted-quad form is the address of a host or network. Alternatively, the address argument can be a valid host DNS name. The mask argument expressed in dotted-quad form defaults to 255.255.255.255, meaning that the address is treated as the address of an individual host. A default entry (address 0.0.0.0, mask 0.0.0.0) is always included and is always the first entry in the list. Note: the text string default, with no mask option, may be used to indicate the default entry. The ippeerlimit directive limits the number of peer requests for each IP to int, where a value of -1 means "unlimited", the current default. A value of 0 means "none". There would usually be at most 1 peering request per IP, but if the remote peering requests are behind a proxy there could well be more than 1 per IP. In the current implementation, flag always restricts access, i.e., an entry with no flags indicates that free access to the server is to be given. The flags are not orthogonal, in that more restrictive flags will often make less restrictive ones redundant. The flags can generally be classed into two categories, those which restrict time service and those which restrict informational queries and attempts to do run-time reconfiguration of the server. One or more of the following flags may be specified: - kod - If this flag is set when an access violation occurs, a kiss-o''-death (KoD) packet is sent. KoD packets are rate limited to no more than one per second. If another KoD packet occurs within one second after the last one, the packet is dropped. - limited - Deny service if the packet spacing violates the lower limits specified in the discard command. A history of clients is kept using the monitoring capability of ntpd. Thus, monitoring is always active as long as there is a restriction entry with the limited flag. - lowpriotrap - Declare traps set by matching hosts to be low priority. The number of traps a server can maintain is limited (the current limit is 3). Traps are usually assigned on a first come, first served basis, with later trap requestors being denied service. This flag modifies the assignment algorithm by allowing low priority traps to be overridden by later requests for normal priority traps. - noepeer - Deny ephemeral peer requests, even if they come from an authenticated source. Note that the ability to use a symmetric key for authentication may be restricted to one or more IPs or subnets via the third field of the ntp.keys file. This restriction is not enabled by default, to maintain backward compatibility. Expect noepeer to become the default in ntp-4.4. - nomodify - Deny ntpq and ntpdc queries which attempt to modify the state of the server (i.e., run time reconfiguration). Queries which return information are permitted. - noquery - Deny ntpq and ntpdc queries. Time service is not affected. - nopeer - Deny unauthenticated packets which would result in mobilizing a new association. This includes broadcast and symmetric active packets when a configured association does not exist. It also includes pool associations, so if you want to use servers from a pool directive and also want to use nopeer by default, you''ll want a restrict source ... line as well that does not include the nopeer directive. - noserve - Deny all packets except ntpq and ntpdc queries. - notrap - Decline to provide mode 6 control message trap service to matching hosts. The trap service is a subsystem of the ntpq control message protocol which is intended for use by remote event logging programs. - notrust - Deny service unless the packet is cryptographically authenticated. - ntpport - This is actually a match algorithm modifier, rather than a restriction flag. Its presence causes the restriction entry to be matched only if the source port in the packet is the standard NTP UDP port (123). Both ntpport and non-ntpport may be specified. The ntpport is considered more specific and is sorted later in the list.' + rationale: "If ntp is in use on the system, proper configuration is vital to ensuring time synchronization is accurate." + remediation: "Add or edit restrict lines in /etc/ntp.conf to match the following: restrict -4 default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery OR If another time synchronization service is in use on the system, run the following command to remove ntp from the system: # apt purge ntp." + references: + - "http://www.ntp.org/" + compliance: + - cis: ["2.1.4.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "f:/etc/ntp.conf -> r:restrict -4 default|restrict default && r:kod && r:notrap && r:nomodify && r:nopeer && r:noquery" + - "f:/etc/ntp.conf -> r:restrict -6 default && r:kod && r:notrap && r:nomodify && r:nopeer && r:noquery" + + # 2.1.4.2 Ensure ntp is configured with authorized timeserver (Manual) - Not implemented + + # 2.1.4.3 Ensure ntp is running as user ntp. (Automated) + - id: 28549 + title: "Ensure ntp is running as user ntp." + description: "The ntp package is installed with a dedicated user account ntp. This account is granted the access required by the ntpd daemon Note: - If chrony or systemd-timesyncd are used, ntp should be removed and this section skipped - This recommendation only applies if ntp is in use on the system - Only one time synchronization method should be in use on the system." + rationale: "The ntpd daemon should run with only the required privlidge." + remediation: "Add or edit the following line in /etc/init.d/ntp: RUNASUSER=ntp Run the following command to restart ntp.servocee: # systemctl restart ntp.service OR If another time synchronization service is in use on the system, run the following command to remove ntp from the system: # apt purge ntp." + references: + - "http://www.ntp.org/" + compliance: + - cis: ["2.1.4.3"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - 'c:ps -ef -> r:^ntp\.+ntpd' + - "f:/etc/init.d/ntp -> r:^\\s*\\t*RUNASUSER=ntp" + + # 2.1.4.4 Ensure ntp is enabled and running. (Automated) + - id: 28550 + title: "Ensure ntp is enabled and running." + description: "ntp is a daemon for synchronizing the system clock across the network." + rationale: "ntp needs to be enabled and running in order to synchronize the system to a timeserver. Time synchronization is important to support time sensitive security mechanisms and to ensure log files have consistent time records across the enterprise to aid in forensic investigations." + remediation: "IF ntp is in use on the system, run the following commands: Run the following command to unmask ntp.service: # systemctl unmask ntp.service Run the following command to enable and start ntp.service: # systemctl --now enable ntp.service OR If another time synchronization service is in use on the system, run the following command to remove ntp: # apt purge ntp." + compliance: + - cis: ["2.1.4.4"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - "c:systemctl is-enabled ntp.service -> r:enabled" + - "c:systemctl is-active ntp.service -> r:active" + + # 2.2.1 Ensure X Window System is not installed. (Automated) + - id: 28551 + title: "Ensure X Window System is not installed." + description: "The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login." + rationale: "Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface." + impact: 'Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime, if provided by your distribution.' + remediation: "Remove the X Windows System packages: apt purge xserver-xorg*." + compliance: + - cis: ["2.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'c:dpkg-query -W -f="${binary:Package}\t${Status}\t${db:Status-Status}\n" xserver-xorg* -> r:no packages found matching|deinstall|not-installed' + - "c:dpkg-query -s xserver-xorg -> r:package 'xserver-xorg' is not installed" + + # 2.2.2 Ensure Avahi Server is not installed. (Automated) + - id: 28552 + title: "Ensure Avahi Server is not installed." + description: "Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine." + rationale: "Automatic discovery of network services is not normally required for system functionality. It is recommended to remove this package to reduce the potential attack surface." + remediation: "Run the following commands to remove avahi-daemon: # systemctl stop avahi-daaemon.service # systemctl stop avahi-daemon.socket # apt purge avahi-daemon." + compliance: + - cis: ["2.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - "c:dpkg-query -s avahi-daemon -> r:package 'avahi-daemon' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' avahi-daemon -> r:no packages found matching avahi-daemon|deinstall|not-installed" + + # 2.2.3 Ensure CUPS is not installed. (Automated) + - id: 28553 + title: "Ensure CUPS is not installed." + description: "The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability." + rationale: "If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be removed to reduce the potential attack surface." + impact: "Removing CUPS will prevent printing from the system, a common task for workstation systems." + remediation: "Run one of the following commands to remove cups : # apt purge cups." + references: + - "http://www.cups.org." + compliance: + - cis: ["2.2.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s cups -> r:package 'cups' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' cups -> r:no packages found matching cups|deinstall|not-installed" + + # 2.2.4 Ensure DHCP Server is not installed. (Automated) + - id: 28554 + title: "Ensure DHCP Server is not installed." + description: "The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses." + rationale: "Unless a system is specifically set up to act as a DHCP server, it is recommended that this package be removed to reduce the potential attack surface." + remediation: "Run the following command to remove isc-dhcp-server: # apt purge isc-dhcp-server." + references: + - "http://www.isc.org/software/dhcp." + compliance: + - cis: ["2.2.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s isc-dhcp-server -> r:package 'isc-dhcp-server' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' isc-dhcp-server -> r:no packages found matching isc-dhcp-server|deinstall|not-installed" + + # 2.2.5 Ensure LDAP server is not installed. (Automated) + - id: 28555 + title: "Ensure LDAP server is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP server, it is recommended that the software be removed to reduce the potential attack surface." + remediation: "Run one of the following commands to remove slapd: # apt purge slapd." + references: + - "http://www.openldap.org." + compliance: + - cis: ["2.2.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s slapd -> r:package 'slapd' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' slapd -> r:no packages found matching slapd|deinstall|not-installed" + + # 2.2.6 Ensure NFS is not installed. (Automated) + - id: 28556 + title: "Ensure NFS is not installed." + description: "The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network." + rationale: "If the system does not export NFS shares or act as an NFS client, it is recommended that these services be removed to reduce the remote attack surface." + remediation: "Run the following command to remove nfs: # apt purge nfs-kernel-server." + compliance: + - cis: ["2.2.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s nfs-kernel-server -> r:package 'nfs-kernel-server' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nfs-kernel-server -> r:no packages found matching nfs-kernel-server|deinstall|not-installed" + + # 2.2.7 Ensure DNS Server is not installed. (Automated) + - id: 28557 + title: "Ensure DNS Server is not installed." + description: "The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network." + rationale: "Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following commands to disable DNS server: # apt purge bind9." + compliance: + - cis: ["2.2.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s bind9 -> r:package 'bind9' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' bind9 -> r:no packages found matching bind9|deinstall|not-installed" + + # 2.2.8 Ensure FTP Server is not installed. (Automated) + - id: 28558 + title: "Ensure FTP Server is not installed." + description: "The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files." + rationale: "FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove vsftpd: # apt purge vsftpd." + compliance: + - cis: ["2.2.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s vsftpd -> r:package 'vsftpd' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' vsftpd -> r:no packages found matching vsftpd|deinstall|not-installed" + + # 2.2.9 Ensure HTTP server is not installed. (Automated) + - id: 28559 + title: "Ensure HTTP server is not installed." + description: "HTTP or web servers provide the ability to host web site content." + rationale: "Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove apache: # apt purge apache2." + compliance: + - cis: ["2.2.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s apache2 -> r:package 'apache2' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' apache2 -> r:no packages found matching apache2|deinstall|not-installed" + + # 2.2.10 Ensure IMAP and POP3 server are not installed. (Automated) + - id: 28560 + title: "Ensure IMAP and POP3 server are not installed." + description: "dovecot-imapd and dovecot-pop3d are an open source IMAP and POP3 server for Linux based systems." + rationale: "Unless POP3 and/or IMAP servers are to be provided by this system, it is recommended that the package be removed to reduce the potential attack surface." + remediation: "Run one of the following commands to remove dovecot-imapd and dovecot-pop3d: # apt purge dovecot-imapd dovecot-pop3d." + compliance: + - cis: ["2.2.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s dovecot-imapd -> r:package 'dovecot-imapd' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' dovecot-imapd -> r:no packages found matching dovecot-imapd|deinstall|not-installed" + - "c:dpkg-query -s dovecot-pop3d -> r:package 'dovecot-pop3d' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' dovecot-pop3d -> r:no packages found matching dovecot-pop3d|deinstall|not-installed" + + # 2.2.11 Ensure Samba is not installed. (Automated) + - id: 28561 + title: "Ensure Samba is not installed." + description: "The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems." + rationale: "If there is no need to mount directories and file systems to Windows systems, then this service should be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove samba: # apt purge samba." + compliance: + - cis: ["2.2.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1005", "T1039", "T1083", "T1135", "T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s samba -> r:package 'samba' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' samba -> r:no packages found matching samba|deinstall|not-installed" + + # 2.2.12 Ensure HTTP Proxy Server is not installed. (Automated) + - id: 28562 + title: "Ensure HTTP Proxy Server is not installed." + description: "Squid is a standard proxy server used in many distributions and environments." + rationale: "If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface." + remediation: "Run the following command to remove squid: # apt purge squid." + compliance: + - cis: ["2.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s squid -> r:package 'squid' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' squid -> r:no packages found matching squid|deinstall|not-installed" + + # 2.2.13 Ensure SNMP Server is not installed. (Automated) + - id: 28563 + title: "Ensure SNMP Server is not installed." + description: 'Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment, computer equipment and devices like UPSs. Net-SNMP is a suite of applications used to implement SNMPv1 (RFC 1157), SNMPv2 (RFCs 1901-1908), and SNMPv3 (RFCs 3411-3418) using both IPv4 and IPv6. Support for SNMPv2 classic (a.k.a. "SNMPv2 historic" - RFCs 1441-1452) was dropped with the 4.0 release of the UCD-snmp package. The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.' + rationale: "The SNMP server can communicate using SNMPv1, which transmits data in the clear and does not require authentication to execute commands. SNMPv3 replaces the simple/clear text password sharing used in SNMPv2 with more securely encoded parameters. If the the SNMP service is not required, the net-snmp package should be removed to reduce the attack surface of the system. Note: If SNMP is required: - The server should be configured for SNMP v3 only. User Authentication and Message Encryption should be configured. If SNMP v2 is absolutely necessary, modify the community strings' values. -." + remediation: "Run the following command to remove snmp: # apt purge snmp." + compliance: + - cis: ["2.2.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s snmp -> r:package 'snmp' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' snmp -> r:no packages found matching snmp|deinstall|not-installed" + # 2.2.14 Ensure NIS Server is not installed. (Automated) + - id: 28564 + title: "Ensure NIS Server is not installed." + description: "The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed and other, more secure services be used." + remediation: "Run the following command to remove nis: # apt purge nis." + compliance: + - cis: ["2.2.14"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1210", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s nis -> r:package 'nis' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nis -> r:no packages found matching nis|deinstall|not-installed" + + # 2.2.15 Ensure mail transfer agent is configured for local-only mode. (Automated) + - id: 28565 + title: "Ensure mail transfer agent is configured for local-only mode." + description: "Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail." + rationale: "The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems. Note: - This recommendation is designed around the postfix mail server. - Depending on your environment you may have an alternative MTA installed such as exim4. If this is the case consult the documentation for your installed MTA to configure the recommended state." + remediation: "Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below: inet_interfaces = loopback-only Run the following command to restart postfix: # systemctl restart postfix." + compliance: + - cis: ["2.2.15"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1018", "T1210"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'not c:ss -lntu -> r:\.*:25\s && r:127.0.0.1:25\s+|::1]:25\s+' + + # 2.2.16 Ensure rsync service is either not installed or masked. (Automated) + - id: 28566 + title: "Ensure rsync service is either not installed or masked." + description: "The rsync service can be used to synchronize files between systems over network links." + rationale: "The rsync service presents a security risk as it uses unencrypted protocols for communication. The rsync package should be removed to reduce the attack area of the system." + remediation: "Run the following command to remove rsync: # apt purge rsync OR Run the following commands to stop and mask rsync: # systemctl stop rsync # systemctl mask rsync." + compliance: + - cis: ["2.2.16"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1105", "T1203", "T1210", "T1543", "T1543.002", "T1570"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -W -f='${binary:Package}\t${Status}\t${db:Status-Status}\\n' rsync -> r:no packages found matching rsync|deinstall|not-installed" + - 'c:systemctl is-active rsync" -> r:inactive' + - "c:systemctl is-enabled rsync -> r:masked|disabled" + + # 2.3.1 Ensure NIS Client is not installed. (Automated) + - id: 28567 + title: "Ensure NIS Client is not installed." + description: "The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client was used to bind a machine to an NIS server and receive the distributed configuration files." + rationale: "The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall nis: # apt purge nis." + compliance: + - cis: ["2.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s nis -> r:package 'nis' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' nis -> r:no packages found matching nis|deinstall|not-installed" + + # 2.3.2 Ensure rsh client is not installed. (Automated) + - id: 28568 + title: "Ensure rsh client is not installed." + description: "The rsh-client package contains the client commands for the rsh services." + rationale: "These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall rsh: # apt purge rsh-client." + compliance: + - cis: ["2.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1041", "M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1040", "T1203", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s rsh-client -> r:package 'rsh-client' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' rsh-client -> r:no packages found matching rsh-client|deinstall|not-installed" + + # 2.3.3 Ensure talk client is not installed. (Automated) + - id: 28569 + title: "Ensure talk client is not installed." + description: "The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default." + rationale: "The software presents a security risk as it uses unencrypted protocols for communication." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall talk: # apt purge talk." + compliance: + - cis: ["2.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1041", "M1042"] + - mitre_tactics: ["TA0006", "TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s talk -> r:package 'talk' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' talk -> r:no packages found matching talk|deinstall|not-installed" + + # 2.3.4 Ensure telnet client is not installed. (Automated) + - id: 28570 + title: "Ensure telnet client is not installed." + description: "The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol." + rationale: "The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions." + impact: "Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse." + remediation: "Uninstall telnet: # apt purge telnet." + compliance: + - cis: ["2.3.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1041", "M1042"] + - mitre_tactics: ["TA0006", "TA0008"] + - mitre_techniques: ["T1040", "T1203", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s telnet -> r:package 'telnet' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' telnet -> r:no packages found matching telnet|deinstall|not-installed" + + # 2.3.5 Ensure LDAP client is not installed. (Automated) + - id: 28571 + title: "Ensure LDAP client is not installed." + description: "The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database." + rationale: "If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface." + impact: "Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment." + remediation: "Uninstall ldap-utils: # apt purge ldap-utils." + compliance: + - cis: ["2.3.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s ldap-utils -> r:package 'ldap-utils' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' ldap-utils -> r:no packages found matching ldap-utils|deinstall|not-installed" + + # 2.3.6 Ensure RPC is not installed. (Automated) + - id: 28572 + title: "Ensure RPC is not installed." + description: 'Remote Procedure Call (RPC) is a method for creating low level client server applications across different system architectures. It requires an RPC compliant client listening on a network port. The supporting package is rpcbind.".' + rationale: "If RPC is not required, it is recommended that this services be removed to reduce the remote attack surface." + remediation: "Run the following command to remove rpcbind: # apt purge rpcbind." + compliance: + - cis: ["2.3.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1203", "T1543", "T1543.002"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:dpkg-query -s rpcbind -> r:package 'rpcbind' is not installed" + - "c:dpkg-query -W -f='${binary:Package}\\t${Status}\\t${db:Status-Status}\\n' rpcbind -> r:no packages found matching rpcbind|deinstall|not-installed" + + # 2.4 Ensure nonessential services are removed or masked (Manual) - Not implemented + + # 3.1.1 Ensure system is checked to determine if IPv6 is enabled (Manual) - Not implemented + + # 3.2.1 Ensure packet redirect sending is disabled (Automated) - Not implemented + # 3.2.2 Ensure IP forwarding is disabled (Automated) - Not implemented + + # 3.3.1 Ensure source routed packets are not accepted (Automated) - Not implemented + # 3.3.2 Ensure ICMP redirects are not accepted (Automated) - Not implemented + # 3.3.3 Ensure secure ICMP redirects are not accepted (Automated) - Not implemented + # 3.3.4 Ensure suspicious packets are logged (Automated) - Not implemented + # 3.3.5 Ensure broadcast ICMP requests are ignored (Automated) - Not implemented + # 3.3.6 Ensure bogus ICMP responses are ignored (Automated) - Not implemented + # 3.3.7 Ensure Reverse Path Filtering is enabled (Automated) - Not implemented + # 3.3.8 Ensure TCP SYN Cookies is enabled (Automated) - Not implemented + # 3.3.9 Ensure IPv6 router advertisements are not accepted (Automated) - Not implemented + + # 3.4.1 Ensure DCCP is disabled (Automated) - Not implemented + # 3.4.2 Ensure SCTP is disabled (Automated) - Not implemented + # 3.4.3 Ensure RDS is disabled (Automated) - Not implemented + # 3.4.4 Ensure TIPC is disabled (Automated) - Not implemented + + # 3.5.1.1 Ensure ufw is installed. (Automated) + - id: 28573 + title: "Ensure ufw is installed." + description: "The Uncomplicated Firewall (ufw) is a frontend for iptables and is particularly well-suited for host-based firewalls. ufw provides a framework for managing netfilter, as well as a command-line interface for manipulating the firewall." + rationale: "A firewall utility is required to configure the Linux kernel's netfilter framework via the iptables or nftables back-end. The Linux kernel's netfilter framework host-based firewall can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host. Note: Only one firewall utility should be installed and configured. UFW is dependent on the iptables package." + remediation: "Run the following command to install Uncomplicated Firewall (UFW): apt install ufw." + compliance: + - cis: ["3.5.1.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:dpkg-query -s ufw -> r:Status: install ok installed" + + # 3.5.1.2 Ensure iptables-persistent is not installed with ufw. (Automated) + - id: 28574 + title: "Ensure iptables-persistent is not installed with ufw." + description: "The iptables-persistent is a boot-time loader for netfilter rules, iptables plugin." + rationale: "Running both ufw and the services included in the iptables-persistent package may lead to conflict." + remediation: "Run the following command to remove the iptables-persistent package: # apt purge iptables-persistent." + compliance: + - cis: ["3.5.1.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:dpkg-query -s ufw -> r:Status: install ok installed" + - "c:dpkg-query -s iptables-persistent -> r:is not installed" + + # 3.5.1.3 Ensure ufw service is enabled. (Automated) + - id: 28575 + title: "Ensure ufw service is enabled." + description: "UncomplicatedFirewall (ufw) is a frontend for iptables. ufw provides a framework for managing netfilter, as well as a command-line and available graphical user interface for manipulating the firewall. Notes: - When running ufw enable or starting ufw via its initscript, ufw will flush its chains. This is required so ufw can maintain a consistent state, but it may drop existing connections (eg ssh). ufw does support adding rules before enabling the firewall. - Run the following command before running ufw enable. # ufw allow proto tcp from any to any port 22 - The rules will still be flushed, but the ssh port will be open after enabling the firewall. Please note that once ufw is 'enabled', ufw will not flush the chains when adding or removing rules (but will when modifying a rule or changing the default policy) - By default, ufw will prompt when enabling the firewall while running under ssh. This can be disabled by using ufw --force enable." + rationale: "The ufw service must be enabled and running in order for ufw to protect the system." + impact: "Changing firewall settings while connected over network can result in being locked out of the system." + remediation: "Run the following command to unmask the ufw daemon: # systemctl unmask ufw.service Run the following command to enable and start the ufw daemon: # systemctl --now enable ufw.service active Run the following command to enable ufw: # ufw enable." + references: + - "http://manpages.ubuntu.com/manpages/precise/en/man8/ufw.8.html" + compliance: + - cis: ["3.5.1.3"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled ufw.service -> r:^enabled" + - "c:systemctl is-active ufw -> r:^active" + - 'c:ufw status -> r:Status:\s+active' + + # 3.5.1.4 Ensure ufw loopback traffic is configured. (Automated) + - id: 28576 + title: "Ensure ufw loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8 for IPv4 and ::1/128 for IPv6)." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8 for IPv4 and ::1/128 for IPv6) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ufw allow in on lo # ufw allow out on lo # ufw deny in from 127.0.0.0/8 # ufw deny in from ::1." + compliance: + - cis: ["3.5.1.4"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:dpkg -s ufw -> r:Status: install ok installed" + - 'c:ufw status verbose -> r:Anywhere on lo\s*ALLOW IN\s*Anywhere' + - 'c:ufw status verbose -> r:Anywhere\s*DENY IN\s*127.0.0.0/8' + - 'c:ufw status verbose -> r:Anywhere \(v6\) on lo\s*ALLOW IN\s*Anywhere \(v6\)' + - 'c:ufw status verbose -> r:Anywhere \(v6\)\s*DENY IN\s*::1' + - 'c:ufw status verbose -> r:Anywhere\s*\t*ALLOW OUT\s*Anywhere on lo' + - 'c:ufw status verbose -> r:Anywhere \(v6\)\s*ALLOW OUT\s*Anywhere \(v6\) on lo' + + # 3.5.1.5 Ensure ufw outbound connections are configured (Manual) - Not implemented + + # 3.5.1.6 Ensure ufw firewall rules exist for all open ports (Automated) - Not implemented + + # 3.5.1.7 Ensure ufw default deny firewall policy. (Automated) + - id: 28577 + title: "Ensure ufw default deny firewall policy." + description: "A default deny policy on connections ensures that any unconfigured network usage will be rejected. Note: Any port or protocol without a explicit allow before the default deny will be blocked." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + impact: "Any port and protocol not explicitly allowed will be blocked. The following rules should be considered before applying the default deny. ufw allow git ufw allow in http ufw allow out http <- required for apt to connect to repository ufw allow in https ufw allow out https ufw allow out 53 ufw logging on." + remediation: "Run the following commands to implement a default deny policy: # ufw default deny incoming # ufw default deny outgoing # ufw default deny routed." + compliance: + - cis: ["3.5.1.7"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:dpkg -s ufw -> r:Status: install ok installed" + - 'c:ufw status verbose -> r:^Default: && r:deny\s+\(incoming\)|reject\s+\(incoming\)' + - 'c:ufw status verbose -> r:^Default: && r:deny\s+\(outgoing\)|reject\s+\(outgoing\)' + - 'c:ufw status verbose -> r:^Default: && r:deny\s+\(routed\)|reject\s+\(routed\)' + + # 3.5.2.1 Ensure nftables is installed. (Automated) + - id: 28578 + title: "Ensure nftables is installed." + description: "nftables provides a new in-kernel packet classification framework that is based on a network-specific Virtual Machine (VM) and a new nft userspace command line tool. nftables reuses the existing Netfilter subsystems such as the existing hook infrastructure, the connection tracking system, NAT, userspace queuing and logging subsystem. Notes: - nftables is available in Linux kernel 3.13 and newer - Only one firewall utility should be installed and configured - Changing firewall settings while connected over the network can result in being locked out of the system." + rationale: "nftables is a subsystem of the Linux kernel that can protect against threats originating from within a corporate network to include malicious mobile code and poorly configured software on a host." + remediation: "Run the following command to install nftables: # apt install nftables." + compliance: + - cis: ["3.5.2.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:dpkg -s nftables -> r:Status: install ok installed" + - "c:dpkg -s iptables -> r:package 'iptables' is not installed" + - "c:dpkg -s ufw -> r:package 'ufw' is not installed" + + # 3.5.2.2 Ensure ufw is uninstalled or disabled with nftables (Automated) - Not implemented + # 3.5.2.3 Ensure iptables are flushed with nftables (Manual) - Not implemented + + # 3.5.2.4 Ensure a nftables table exists. (Automated) + - id: 28579 + title: "Ensure a nftables table exists." + description: "Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families." + rationale: "nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic." + impact: "Adding rules to a running nftables can cause loss of connectivity to the system." + remediation: "Run the following command to create a table in nftables # nft create table inet
Example: # nft create table inet filter." + compliance: + - cis: ["3.5.2.4"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - "c:dpkg -s nftables -> r:Status: install ok installed" + - 'c:nft list tables -> r:\w+' + + # 3.5.2.5 Ensure nftables base chains exist. (Automated) + - id: 28580 + title: "Ensure nftables base chains exist." + description: "Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization." + rationale: "If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command to create the base chains: # nft create chain inet
{ type filter hook <(input|forward|output)> priority 0 \\; } Example: # nft create chain inet filter input { type filter hook input priority 0 \\; } # nft create chain inet filter forward { type filter hook forward priority 0 \\; } # nft create chain inet filter output { type filter hook output priority 0 \\; }." + compliance: + - cis: ["3.5.2.5"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:dpkg -s nftables -> r:Status: install ok installed" + - 'c:nft list ruleset -> r:type\s+filter\s+hook\s+input\s+priority;' + - 'c:nft list ruleset -> r:type\s+filter\s+hook\s+forward\s+priority;' + - 'c:nft list ruleset -> r:type\s+filter\s+hook\s+output\s+priority;' + + # 3.5.2.6 Ensure nftables loopback traffic is configured (Automated) - Not implemented + # 3.5.2.7 Ensure nftables outbound and established connections are configured (Manual) - Not implemented + + # 3.5.2.8 Ensure nftables default deny firewall policy. (Automated) + - id: 28581 + title: "Ensure nftables default deny firewall policy." + description: "Base chain policy is the default verdict that will be applied to packets reaching the end of the chain." + rationale: "There are two policies: accept (Default) and drop. If the policy is set to accept, the firewall will accept any packet that is not configured to be denied and the packet will continue transversing the network stack. It is easier to white list acceptable usage than to black list unacceptable usage. Note: Changing firewall settings while connected over network can result in being locked out of the system." + impact: "If configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity. Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop." + remediation: "Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy: # nft chain
{ policy drop \\; } Example: # nft chain inet filter input { policy drop \\; } # nft chain inet filter forward { policy drop \\; } # nft chain inet filter output { policy drop \\; }." + compliance: + - cis: ["3.5.2.8"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:dpkg -s nftables -> r:Status: install ok installed" + - "c:nft list ruleset -> r:hook input && r:policy drop" + - "c:nft list ruleset -> r:hook forward && r:policy drop" + - "c:nft list ruleset -> r:hook output && r:policy drop" + + # 3.5.2.9 Ensure nftables service is enabled. (Automated) + - id: 28582 + title: "Ensure nftables service is enabled." + description: "The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service." + rationale: "The nftables service restores the nftables rules from the rules files referenced in the /etc/nftables.conf file during boot or the starting of the nftables service." + remediation: "Run the following command to enable the nftables service: # systemctl enable nftables." + compliance: + - cis: ["3.5.2.9"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:dpkg -s nftables -> r:Status: install ok installed" + - "c:systemctl is-enabled nftables -> r:enabled" + + # 3.5.2.10 Ensure nftables rules are permanent (Automated) - Not implemented + + # 3.5.3.1.1 Ensure iptables packages are installed. (Automated) + - id: 28583 + title: "Ensure iptables packages are installed." + description: "iptables is a utility program that allows a system administrator to configure the tables provided by the Linux kernel firewall, implemented as different Netfilter modules, and the chains and rules it stores. Different kernel modules and programs are used for different protocols; iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames." + rationale: "A method of configuring and maintaining firewall rules is necessary to configure a Host Based Firewall." + remediation: "Run the following command to install iptables and iptables-persistent # apt install iptables iptables-persistent." + compliance: + - cis: ["3.5.3.1.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:dpkg -s iptables -> r:Status: install ok installed" + - "c:dpkg -s iptables-persistent -> r:Status: install ok installed" + - "c:dpkg -s nftables -> r:package 'nftables' is not installed" + - "c:dpkg -s ufw -> r:package 'ufw' is not installed" + + # 3.5.3.1.2 Ensure nftables is not installed with iptables. (Automated) + - id: 28584 + title: "Ensure nftables is not installed with iptables." + description: "nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables." + rationale: "Running both iptables and nftables may lead to conflict." + remediation: "Run the following command to remove nftables: # apt purge nftables." + compliance: + - cis: ["3.5.3.1.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "not c:dpkg-query -s nftables -> r:install ok installed" + - "c:dpkg-query -s iptables -> r:install ok installed" + + # 3.5.3.1.3 Ensure ufw is uninstalled or disabled with iptables. (Automated) + - id: 28585 + title: "Ensure ufw is uninstalled or disabled with iptables." + description: "Uncomplicated Firewall (UFW) is a program for managing a netfilter firewall designed to be easy to use. - Uses a command-line interface consisting of a small number of simple commands - Uses iptables for configuration." + rationale: "Running iptables.persistent with ufw enabled may lead to conflict and unexpected results." + remediation: "Run one of the following commands to either remove ufw or stop and mask ufw Run the following command to remove ufw: # apt purge ufw OR Run the following commands to disable ufw: # ufw disable # systemctl stop ufw # systemctl mask ufw." + compliance: + - cis: ["3.5.3.1.3"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "not c:dpkg-query -s ufw -> r:install ok installed" + - "c:dpkg-query -s iptables -> r:install ok installed" + + # 3.5.3.2.1 Ensure iptables default deny firewall policy. (Automated) + - id: 28586 + title: "Ensure iptables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected. Note: - Changing firewall settings while connected over network can result in being locked out of the system - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP." + compliance: + - cis: ["3.5.3.2.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L -> r:Chain INPUT \(policy && r:DROP\)|REJECT\)' + - 'c:iptables -L -> r:Chain FORWARD \(policy && r:DROP\)|REJECT\)' + - 'c:iptables -L -> r:Chain OUTPUT \(policy && r:DROP\)|REJECT\)' + + # 3.5.3.2.2 Ensure iptables loopback traffic is configured. (Automated) + - id: 28587 + title: "Ensure iptables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8). Note: - Changing firewall settings while connected over network can result in being locked out of the system - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # iptables -A INPUT -i lo -j ACCEPT # iptables -A OUTPUT -o lo -j ACCEPT # iptables -A INPUT -s 127.0.0.0/8 -j DROP." + compliance: + - cis: ["3.5.3.2.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:iptables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.*\p\.*0.0.0.0/0\.*0.0.0.0/0' + - 'c:iptables -L INPUT -v -n -> r:\.*DROP\.*all\.*\p\.*\p\.*127.0.0.0/8\.*0.0.0.0/0' + - 'c:iptables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.*\p\.*lo\.*0.0.0.0/0\.*0.0.0.0/0' + + # 3.5.3.2.3 Ensure iptables outbound and established connections are configured (Manual) - Not implemented + # 3.5.3.2.4 Ensure iptables firewall rules exist for all open ports (Automated) - Not implemented + + # 3.5.3.3.1 Ensure ip6tables default deny firewall policy. (Automated) + - id: 28588 + title: "Ensure ip6tables default deny firewall policy." + description: "A default deny all policy on connections ensures that any unconfigured network usage will be rejected. Note: - Changing firewall settings while connected over network can result in being locked out of the system - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage." + remediation: "Run the following commands to implement a default DROP policy: # ip6tables -P INPUT DROP # ip6tables -P OUTPUT DROP # ip6tables -P FORWARD DROP." + compliance: + - cis: ["3.5.3.3.1"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - "c:ip6tables -L -> r:^Chain INPUT && r:policy DROP" + - "c:ip6tables -L -> r:^Chain FORWARD && r:policy DROP" + - "c:ip6tables -L -> r:^Chain OUTPUT && r:policy DROP" + + # 3.5.3.3.2 Ensure ip6tables loopback traffic is configured. (Automated) + - id: 28589 + title: "Ensure ip6tables loopback traffic is configured." + description: "Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1). Note: - Changing firewall settings while connected over network can result in being locked out of the system - Remediation will only affect the active system firewall, be sure to configure the default policy in your firewall management to apply on boot as well." + rationale: "Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure." + remediation: "Run the following commands to implement the loopback rules: # ip6tables -A INPUT -i lo -j ACCEPT # ip6tables -A OUTPUT -o lo -j ACCEPT # ip6tables -A INPUT -s ::1 -j DROP." + compliance: + - cis: ["3.5.3.3.2"] + - cis_csc_v8: ["4.4", "4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - mitre_mitigations: ["M1031", "M1037"] + - mitre_tactics: ["TA0011"] + - mitre_techniques: ["T1562", "T1562.004"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.3.1", "1.4"] + - pci_dss_v4.0: ["1.2.1", "1.4.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'c:ip6tables -L INPUT -v -n -> r:\.*ACCEPT\.*all\.*lo\.*\p\.*::/0\.*::/0' + - 'c:ip6tables -L INPUT -v -n -> r:\.*DROP\.*all\.*\p\.*\p\.*::1\.*::/0' + - 'c:ip6tables -L OUTPUT -v -n -> r:\.*ACCEPT\.*all\.*\p\.*lo\.*::/0\.*::/0' + + # 3.5.3.3.3 Ensure ip6tables outbound and established connections are configured (Manual) - Not implemented + # 3.5.3.3.4 Ensure ip6tables firewall rules exist for all open ports (Automated) - Not implemented + + # 4.1.1.1 Ensure auditd is installed. (Automated) + - id: 28590 + title: "Ensure auditd is installed." + description: "auditd is the userspace component to the Linux Auditing System. It's responsible for writing audit records to the disk." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to Install auditd # apt install auditd audispd-plugins." + compliance: + - cis: ["4.1.1.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:dpkg-query -s auditd -> r:install ok installed" + - "c:dpkg-query -s audispd-plugins -> r:install ok installed" + + # 4.1.1.2 Ensure auditd service is enabled and active. (Automated) + - id: 28591 + title: "Ensure auditd service is enabled and active." + description: "Turn on the auditd daemon to record system events." + rationale: "The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring." + remediation: "Run the following command to enable and start auditd: # systemctl --now enable auditd." + compliance: + - cis: ["4.1.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled auditd -> r:enabled" + - "c:systemctl is-active auditd -> r:active" + + # 4.1.1.3 Ensure auditing for processes that start prior to auditd is enabled. (Automated) + - id: 28592 + title: "Ensure auditing for processes that start prior to auditd is enabled." + description: "Configure grub2 so that processes that are capable of being audited can be audited even if they start up prior to auditd startup." + rationale: "Audit events need to be captured on processes that start up prior to auditd , so that potential malicious activity cannot go undetected." + remediation: 'Edit /etc/default/grub and add audit=1 to GRUB_CMDLINE_LINUX: Example: GRUB_CMDLINE_LINUX="audit=1" Run the following command to update the grub2 configuration: # update-grub.' + compliance: + - cis: ["4.1.1.3"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'not d:/boot -> r:\.*grub.cfg -> r:^\s*\t*linux && !r:audit=1' + + # 4.1.1.4 Ensure audit_backlog_limit is sufficient. (Automated) + - id: 28593 + title: "Ensure audit_backlog_limit is sufficient." + description: "In the kernel-level audit subsystem, a socket buffer queue is used to hold audit events. Whenever a new audit event is received, it is logged and prepared to be added to this queue. The kernel boot parameter audit_backlog_limit=N, with N representing the amount of messages, will ensure that a queue cannot grow beyond a certain size. If an audit event is logged which would grow the queue beyond this limit, then a failure occurs and is handled according to the system configuration." + rationale: "If an audit event is logged which would grow the queue beyond the audit_backlog_limit, then a failure occurs, auditd records will be lost, and potential malicious activity could go undetected." + remediation: 'Edit /etc/default/grub and add audit_backlog_limit=N to GRUB_CMDLINE_LINUX. The recommended size for N is 8192 or larger. Example: GRUB_CMDLINE_LINUX="audit_backlog_limit=8192" Run the following command to update the grub2 configuration: # update-grub.' + compliance: + - cis: ["4.1.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - 'not d:/boot -> r:\.*grub.cfg -> !r:audit_backlog_limit=\d+' + + # 4.1.2.1 Ensure audit log storage size is configured. (Automated) + - id: 28594 + title: "Ensure audit log storage size is configured." + description: "Configure the maximum size of the audit log file. Once the log reaches the maximum size, it will be rotated and a new log file will be started." + rationale: "It is important that an appropriate size is determined for log files so that they do not impact the system and audit data is not lost." + remediation: "Set the following parameter in /etc/audit/auditd.conf in accordance with site policy: max_log_file = ." + compliance: + - cis: ["4.1.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1053"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1562", "T1562.006"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - "f:/etc/audit/auditd.conf -> r:^\\s*max_log_file\\s*=\\s*\\d+" + + # 4.1.2.2 Ensure audit logs are not automatically deleted. (Automated) + - id: 28595 + title: "Ensure audit logs are not automatically deleted." + description: "The max_log_file_action setting determines how to handle the audit log file reaching the max file size. A value of keep_logs will rotate the logs but never delete old logs." + rationale: "In high security contexts, the benefits of maintaining a long audit history exceed the cost of storing the audit history." + remediation: "Set the following parameter in /etc/audit/auditd.conf: max_log_file_action = keep_logs." + compliance: + - cis: ["4.1.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1053"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - "f:/etc/audit/auditd.conf -> r:^\\s*max_log_file_action\\s*=\\s*keep_logs" + + # 4.1.2.3 Ensure system is disabled when audit logs are full. (Automated) + - id: 28596 + title: "Ensure system is disabled when audit logs are full." + description: "The auditd daemon can be configured to halt the system when the audit logs are full. The admin_space_left_action parameter tells the system what action to take when the system has detected that it is low on disk space. Valid values are ignore, syslog, suspend, single, and halt. - ignore, the audit daemon does nothing - Syslog, the audit daemon will issue a warning to syslog - Suspend, the audit daemon will stop writing records to the disk - single, the audit daemon will put the computer system in single user mode - halt, the audit daemon will shutdown the system." + rationale: "In high security contexts, the risk of detecting unauthorized access or nonrepudiation exceeds the benefit of the system's availability." + impact: "If the admin_space_left_action parameter is set to halt the audit daemon will shutdown the system when the disk partition containing the audit logs becomes full." + remediation: "Set the following parameters in /etc/audit/auditd.conf: space_left_action = email action_mail_acct = root set admin_space_left_action to either halt or single in /etc/audit/auditd.conf. Example: admin_space_left_action = halt." + compliance: + - cis: ["4.1.2.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - "d:/etc/audit" + - "f:/etc/audit/auditd.conf" + - "f:/etc/audit/auditd.conf -> r:^\\s*\\t*space_left_action\\s*=\\s*email" + - "f:/etc/audit/auditd.conf -> r:^\\s*\\t*action_mail_acct\\s*=\\s*root" + - "f:/etc/audit/auditd.conf -> r:^\\s*\\t*admin_space_left_action\\s*=\\s* && r:halt|single" + + # 4.1.3.1 Ensure changes to system administration scope (sudoers) is collected. (Automated) + - id: 28597 + title: "Ensure changes to system administration scope (sudoers) is collected." + description: 'Monitor scope changes for system administrators. If the system has been properly configured to force system administrators to log in as themselves first and then use the sudo command to execute privileged commands, it is possible to monitor changes in scope. The file /etc/sudoers, or files in /etc/sudoers.d, will be written to when the file(s) or related attributes have changed. The audit records will be tagged with the identifier "scope".' + rationale: "Changes in the /etc/sudoers and /etc/sudoers.d files can indicate that an unauthorized change has been made to the scope of system administrator activity." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor scope changes for system administrators. Example: # printf \" -w /etc/sudoers -p wa -k scope -w /etc/sudoers.d -p wa -k scope \" >> /etc/audit/rules.d/50-scope.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope' + - "c:auditctl -l -> r:^-w && r:/etc/sudoers && r:-p wa && r:-k scope" + - "c:auditctl -l -> r:^-w && r:/etc/sudoers.d && r:-p wa && r:-k scope" + + # 4.1.3.2 Ensure actions as another user are always logged. (Automated) + - id: 28598 + title: "Ensure actions as another user are always logged." + description: "sudo provides users with temporary elevated privileges to perform operations, either as the superuser or another user." + rationale: "Creating an audit log of users with temporary elevated privileges and the operation(s) they performed is essential to reporting. Administrators will want to correlate the events written to the audit trail with the records written to sudo's logfile to verify if unauthorized commands have been executed." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor elevated privileges. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -C euid!=uid -F auid!=unset -S execve -k user_emulation -a always,exit -F arch=b32 -C euid!=uid -F auid!=unset -S execve -k user_emulation \" >> /etc/audit/rules.d/50-user_emulation.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-C euid!=uid|-C uid!=euid && r:-F auid!=unset|-F auid!=1|-F auid!=4294967295 && r:-S execve && r:-k user_emulation|key=user_emulation" + + # 4.1.3.3 Ensure events that modify the sudo log file are collected (Automated) - Not implemented + + # 4.1.3.4 Ensure events that modify date and time information are collected. (Automated) + - id: 28599 + title: "Ensure events that modify date and time information are collected." + description: 'Capture events where the system date and/or time has been modified. The parameters in this section are set to determine if the; - adjtimex - tune kernel clock - settimeofday - set time using timeval and timezone structures - stime - using seconds since 1/1/1970 - clock_settime - allows for the setting of several internal clocks and timers system calls have been executed. Further, ensure to write an audit record to the configured audit log file upon exit, tagging the records with a unique identifier such as "time-change".' + rationale: "Unexpected changes in system date and/or time could be a sign of malicious activity on the system." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify date and time information. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S adjtimex,settimeofday,clock_settime -k time-change -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime -k time-change -w /etc/localtime -p wa -k time-change \" >> /etc/audit/rules.d/50-time-change.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64. In addition, add stime to the system call audit. Example: -a always,exit -F arch=b32 -S adjtimex,settimeofday,clock_settime,stime -k time-change." + compliance: + - cis: ["4.1.3.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change' + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b64 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-a && r:always,exit|exit,always && r:-F arch=b32 && r:-S && r:adjtimex && r:settimeofday && r:clock_settime && r:-k time-change|key=time-change" + - "c:auditctl -l -> r:^-w && r:/etc/localtime && r:-p wa && r:-k time-change|key=time-change" + + # 4.1.3.5 Ensure events that modify the system's network environment are collected. (Automated) + - id: 28600 + title: "Ensure events that modify the system's network environment are collected." + description: "Record changes to network environment files or system calls. The below parameters monitors the following system calls, and write an audit event on system call exit: - sethostname - set the systems host name - setdomainname - set the systems domain name The files being monitored are: - /etc/issue and /etc/issue.net - messages displayed pre-login - /etc/hosts - file containing host names and associated IP addresses - /etc/networks - symbolic names for networks - /etc/network/ - directory containing network interface scripts and configurations files." + rationale: "Monitoring sethostname and setdomainname will identify potential unauthorized changes to host and domainname of a system. The changing of these names could potentially break security parameters that are set based on those names. The /etc/hosts file is monitored for changes that can indicate an unauthorized intruder is trying to change machine associations with IP addresses and trick users and processes into connecting to unintended machines. Monitoring /etc/issue and /etc/issue.net is important, as intruders could put disinformation into those files and trick users into providing information to the intruder. Monitoring /etc/network is important as it can show if network interfaces or scripts are being modified in a way that can lead to the machine becoming unavailable or compromised. All audit records should have a relevant tag associated with them." + remediation: "Create audit rules Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's network environment. 64 Bit systems Example: # printf \" -a always,exit -F arch=b64 -S sethostname,setdomainname -k system-locale -a always,exit -F arch=b32 -S sethostname,setdomainname -k system-locale -w /etc/issue -p wa -k system-locale -w /etc/issue.net -p wa -k system-locale -w /etc/hosts -p wa -k system-locale -w /etc/networks -p wa -k system-locale -w /etc/network/ -p wa -k system-locale \" >> /etc/audit/rules.d/50-system_local.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi 32 Bit systems Follow the same procedures as for 64 bit systems and ignore any entries with b64." + compliance: + - cis: ["4.1.3.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/network/ && r:-p wa && r:-k system-locale|key=system-locale' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/networks && r:-p wa && r:-k system-locale|key=system-locale' + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b64 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-a && r:exit,always|always,exit && r:-F arch=b32 && r:-S && r:sethostname && r:setdomainname && r:-k system-locale|-F key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/issue.net && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/hosts && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/network/ && r:-p wa && r:-k system-locale|key=system-locale" + - "c:auditctl -l -> r:^-w && r:/etc/networks && r:-p wa && r:-k system-locale|key=system-locale" + + # 4.1.3.6 Ensure use of privileged commands are collected (Automated) - Not implemented + # 4.1.3.7 Ensure unsuccessful file access attempts are collected (Automated) - Not implemented + + # 4.1.3.8 Ensure events that modify user/group information are collected. (Automated) + - id: 28601 + title: "Ensure events that modify user/group information are collected." + description: 'Record events affecting the modification of user or group information, including that of passwords and old passwords if in use. - /etc/group - system groups - /etc/passwd - system users - /etc/gshadow - encrypted password for each group - /etc/shadow - system user passwords - /etc/security/opasswd - storage of old passwords if the relevant PAM module is in use The parameters in this section will watch the files to see if they have been opened for write or have had attribute changes (e.g. permissions) and tag them with the identifier "identity" in the audit log file.' + rationale: "Unexpected changes to these files could be an indication that the system has been compromised and that an unauthorized user is attempting to hide their activities or compromise additional accounts." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify user/group information. Example: # printf \" -w /etc/group -p wa -k identity -w /etc/passwd -p wa -k identity -w /etc/gshadow -p wa -k identity -w /etc/shadow -p wa -k identity -w /etc/security/opasswd -p wa -k identity \" >> /etc/audit/rules.d/50-identity.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.8"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.8"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.3"] + - mitre_mitigations: ["M1047"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity' + - "c:auditctl -l -> r:^-w && r:/etc/group && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/passwd && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/gshadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/shadow && r:-p wa && r:-k identity|key=identity" + - "c:auditctl -l -> r:^-w && r:/etc/security/opasswd && r:-p wa && r:-k identity|key=identity" + + # 4.1.3.9 Ensure discretionary access control permission modification events are collected (Automated) - Not implemented + # 4.1.3.10 Ensure successful file system mounts are collected (Automated) - Not implemented + + # 4.1.3.11 Ensure session initiation information is collected. (Automated) + - id: 28602 + title: "Ensure session initiation information is collected." + description: 'Monitor session initiation events. The parameters in this section track changes to the files associated with session events. - /var/run/utmp - tracks all currently logged in users. - /var/log/wtmp - file tracks logins, logouts, shutdown, and reboot events. - /var/log/btmp - keeps track of failed login attempts and can be read by entering the command /usr/bin/last -f /var/log/btmp. All audit records will be tagged with the identifier "session.".' + rationale: "Monitoring these files for changes could alert a system administrator to logins occurring at unusual hours, which could indicate intruder activity (i.e. a user logging in at a time when they do not normally log in)." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor session initiation information. Example: # printf \" -w /var/run/utmp -p wa -k session -w /var/log/wtmp -p wa -k session -w /var/log/btmp -p wa -k session \" >> /etc/audit/rules.d/50-session.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.11"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.9.4.2"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session' + - "c:auditctl -l -> r:^-w && r:/var/run/utmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/wtmp && r:-p wa && r:-k session|key=session" + - "c:auditctl -l -> r:^-w && r:/var/log/btmp && r:-p wa && r:-k session|key=session" + + # 4.1.3.12 Ensure login and logout events are collected. (Automated) + - id: 28603 + title: "Ensure login and logout events are collected." + description: "Monitor login and logout events. The parameters below track changes to files associated with login/logout events. - /var/log/lastlog - maintain records of the last time a user successfully logged in. - /var/run/faillock - directory maintains records of login failures via the pam_faillock module." + rationale: "Monitoring login/logout events could provide a system administrator with information associated with brute force attacks against user logins." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor login and logout events. Example: # printf \" -w /var/log/lastlog -p wa -k logins -w /var/run/faillock -p wa -k logins \" >> /etc/audit/rules.d/50-login.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.12"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["4.9", "16.11", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.8.1.3", "A.9.4.2"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3", "AU-3(1)"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins' + - "c:auditctl -l -> r:^-w && r:/var/log/lastlog && r:-p wa && r:-k logins|key=logins" + - "c:auditctl -l -> r:^-w && r:/var/run/faillock && r:-p wa && r:-k logins|key=logins" + + # 4.1.3.13 Ensure file deletion events by users are collected (Automated) - Not implemented + + # 4.1.3.14 Ensure events that modify the system's Mandatory Access Controls are collected. (Automated) + - id: 28604 + title: "Ensure events that modify the system's Mandatory Access Controls are collected." + description: "Monitor AppArmor, an implementation of mandatory access controls. The parameters below monitor any write access (potential additional, deletion or modification of files in the directory) or attribute changes to the /etc/apparmor/ and /etc/apparmor.d/ directories. Note: If a different Mandatory Access Control method is used, changes to the corresponding directories should be audited." + rationale: "Changes to files in the /etc/apparmor/ and /etc/apparmor.d/ directories could indicate that an unauthorized user is attempting to modify access controls and change security contexts, leading to a compromise of the system." + remediation: "Edit or create a file in the /etc/audit/rules.d/ directory, ending in .rules extension, with the relevant rules to monitor events that modify the system's Mandatory Access Controls. Example: # printf \" -w /etc/apparmor/ -p wa -k MAC-policy -w /etc/apparmor.d/ -p wa -k MAC-policy \" >> /etc/audit/rules.d/50-MAC-policy.rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.14"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor/ && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-w && r:/etc/apparmor.d/ && r:-p wa && r:-k MAC-policy|key=MAC-policy' + - "c:auditctl -l -> r:^-w && r:/etc/apparmor/ && r:-p wa && r:-k MAC-policy|key=MAC-policy" + - "c:auditctl -l -> r:^-w && r:/etc/apparmor.d/ && r:-p wa && r:-k MAC-policy|key=MAC-policy" + + # 4.1.3.15 Ensure successful and unsuccessful attempts to use the chcon command are recorded (Automated) - Not implemented + # 4.1.3.16 Ensure successful and unsuccessful attempts to use the setfacl command are recorded (Automated) - Not implemented + # 4.1.3.17 Ensure successful and unsuccessful attempts to use the chacl command are recorded (Automated) - Not implemented + # 4.1.3.18 Ensure successful and unsuccessful attempts to use the usermod command are recorded (Automated) - Not implemented + # 4.1.3.19 Ensure kernel module loading unloading and modification is collected (Automated) - Not implemented + + # 4.1.3.20 Ensure the audit configuration is immutable. (Automated) + - id: 28605 + title: "Ensure the audit configuration is immutable." + description: 'Set system audit so that audit rules cannot be modified with auditctl. Setting the flag "-e 2" forces audit to be put in immutable mode. Audit changes can only be made on system reboot. Note: This setting will require the system to be rebooted to update the active auditd configuration settings.' + rationale: "In immutable mode, unauthorized users cannot execute changes to the audit system to potentially hide malicious activity and then put the audit rules back. Users would most likely notice a system reboot and that could alert administrators of an attempt to make unauthorized audit changes." + remediation: "Edit or create the file /etc/audit/rules.d/99-finalize.rules and add the line -e 2 at the end of the file: Example: # printf -- \"-e 2 \" >> /etc/audit/rules.d/99-finalize.rules Load audit rules Merge and load the rules into active configuration: # augenrules --load Check if reboot is required. # if [[ $(auditctl -s | grep \"enabled\") =~ \"2\" ]]; then printf \"Reboot required to load rules\\n\"; fi." + compliance: + - cis: ["4.1.3.20"] + - cis_csc_v8: ["3.3", "8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + - nist_sp_800-53: ["AC-3", "AU-3", "AU-3(1)", "MP-2"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "7.1", "9.4.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + condition: all + rules: + - "d:/etc/audit/rules.d" + - 'd:/etc/audit/rules.d -> r:\.+.rules$' + - 'd:/etc/audit/rules.d -> r:\.+.rules$ -> r:^-e\s+2$' + + # 4.1.3.21 Ensure the running and on disk configuration is the same (Manual) - Not implemented + # 4.1.4.1 Ensure audit log files are mode 0640 or less permissive (Automated) - Not implemented + # 4.1.4.2 Ensure only authorized users own audit log files (Automated) - Not implemented + + # 4.1.4.3 Ensure only authorized groups are assigned ownership of audit log files. (Automated) + - id: 28606 + title: "Ensure only authorized groups are assigned ownership of audit log files." + description: "Audit log files contain information about the system and system activity." + rationale: "Access to audit records can reveal system and configuration data to attackers, potentially compromising its confidentiality." + remediation: "Run the following command to configure the audit log files to be owned by adm group: # find $(dirname $(awk -F\"=\" '/^\\s*log_file\\s*=\\s*/ {print $2}' /etc/audit/auditd.conf | xargs)) -type f \\( ! -group adm -a ! -group root \\) -exec chgrp adm {} + Run the following command to configure the audit log files to be owned by the adm group: # chgrp adm /var/log/audit/ Run the following command to set the log_group parameter in the audit configuration file to log_group = adm: # sed -ri 's/^\\s*#?\\s*log_group\\s*=\\s*\\S+(\\s*#.*)?.*$/log_group = adm\\1/' /etc/audit/auditd.conf Run the following command to restart the audit daemon to reload the configuration file: # systemctl restart auditd." + compliance: + - cis: ["4.1.4.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'f:/etc/audit/auditd.conf -> r:log_group\s*\t*= && !r:adm|root' + + # 4.1.4.4 Ensure the audit log directory is 0750 or more restrictive (Automated) - Not implemented + + # 4.1.4.5 Ensure audit configuration files are 640 or more restrictive. (Automated) + - id: 28607 + title: "Ensure audit configuration files are 640 or more restrictive." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to remove more permissive mode than 0640 from the audit configuration files: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) -exec chmod u-x,g-wx,o-rwx {} +." + compliance: + - cis: ["4.1.4.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) -exec stat -Lc \"%n %a\" {} + -> r:\\w+ -> !r:000|040|200|400|600|240|440|640" + + # 4.1.4.6 Ensure audit configuration files are owned by root. (Automated) + - id: 28608 + title: "Ensure audit configuration files are owned by root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change ownership to root user: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -user root -exec chown root {} +." + compliance: + - cis: ["4.1.4.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:find /etc/audit/ -type f \\( -name '*.rules' -o -name '*.conf' \\) -exec stat -Lc \"%U\" {} + -> !r:root|\\s*" + + # 4.1.4.7 Ensure audit configuration files belong to group root. (Automated) + - id: 28609 + title: "Ensure audit configuration files belong to group root." + description: "Audit configuration files control auditd and what events are audited." + rationale: "Access to the audit configuration files could allow unauthorized personnel to prevent the auditing of critical events. Misconfigured audit configuration files may prevent the auditing of critical events or impact the system's performance by overwhelming the audit log. Misconfiguration of the audit configuration files may also make it more difficult to establish and investigate events relating to an incident." + remediation: "Run the following command to change group to root: # find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) ! -group root -exec chgrp root {} +." + compliance: + - cis: ["4.1.4.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - "c:find /etc/audit/ -type f \\( -name '*.conf' -o -name '*.rules' \\) -exec stat -Lc \"%U\" {} + -> !r:root|\\s*" + + # 4.1.4.8 Ensure audit tools are 755 or more restrictive. (Automated) + - id: 28610 + title: "Ensure audit tools are 755 or more restrictive." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:stat -c "%n %a" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> r:\w+ && !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755' + + # 4.1.4.9 Ensure audit tools are owned by root. (Automated) + - id: 28611 + title: "Ensure audit tools are owned by root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to change the owner of the audit tools to the root user: # chown root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:stat -c "%n %U" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> !r:root|\\s*' + + # 4.1.4.10 Ensure audit tools belong to group root. (Automated) + - id: 28612 + title: "Ensure audit tools belong to group root." + description: "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." + rationale: "Protecting audit information includes identifying and protecting the tools used to view and manipulate log data. Protecting audit tools is necessary to prevent unauthorized operation on audit information." + remediation: "Run the following command to remove more permissive mode from the audit tools: # chmod go-w /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules Run the following command to change owner and group of the audit tools to root user and group: # chown root:root /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules." + compliance: + - cis: ["4.1.4.10"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: none + rules: + - 'c:stat -c "%n %a %U %G" /sbin/auditctl /sbin/aureport /sbin/ausearch /sbin/autrace /sbin/auditd /sbin/augenrules -> !r:000|010|040|050|001|011|041|051|004|014|044|054|005|015|045|055|700|710|740|750|701|711|741|751|704|714|744|754|705|715|745|755 && r:\s*\t*root\s*\t*root' + + # 4.1.4.11 Ensure cryptographic mechanisms are used to protect the integrity of audit tools. (Automated) + - id: 28613 + title: "Ensure cryptographic mechanisms are used to protect the integrity of audit tools." + description: "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." + rationale: "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. Attackers may replace the audit tools or inject code into the existing tools with the purpose of providing the capability to hide or erase system activity from the audit logs. Audit tools should be cryptographically signed in order 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." + remediation: 'Add or update the following selection lines for "/etc/aide/aide.conf" to protect the integrity of the audit tools: # Audit Tools /sbin/auditctl p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/auditd p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/ausearch p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/aureport p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/autrace p+i+n+u+g+s+b+acl+xattrs+sha512 /sbin/augenrules p+i+n+u+g+s+b+acl+xattrs+sha512.' + compliance: + - cis: ["4.1.4.11"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "f:/etc/aide/aide.conf" + - 'f:/etc/aide/aide.conf -> r:/sbin/auditctl\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/auditd\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/ausearch\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/aureport\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/autrace\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + - 'f:/etc/aide/aide.conf -> r:/sbin/augenrules\s*\t*p\pi\pn\pu\pg\ps\pb\pacl\pxattrs\psha512' + + # 4.2.1.1.1 Ensure systemd-journal-remote is installed. (Automated) + - id: 28614 + title: "Ensure systemd-journal-remote is installed." + description: "Journald (via systemd-journal-remote) supports the ability to send log events it gathers to a remote log host or to receive messages from remote hosts, thus enabling centralised log management." + rationale: "Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system." + remediation: "Run the following command to install systemd-journal-remote: # apt install systemd-journal-remote." + compliance: + - cis: ["4.2.1.1.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:dpkg-query -s systemd-journal-remote -> r:install ok installed" + + # 4.2.1.1.2 Ensure systemd-journal-remote is configured (Manual) - Not implemented + # 4.2.1.1.3 Ensure systemd-journal-remote is enabled (Manual) - Not implemented + + # 4.2.1.1.4 Ensure journald is not configured to recieve logs from a remote client. (Automated) + - id: 28615 + title: "Ensure journald is not configured to recieve logs from a remote client." + description: "Journald supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts. NOTE: - The same package, systemd-journal-remote, is used for both sending logs to remote hosts and receiving incoming logs. - With regards to receiving logs, there are two services; systemd-journal- remote.socket and systemd-journal-remote.service." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: "Run the following command to disable systemd-journal-remote.socket: # systemctl --now disable systemd-journal-remote.socket." + compliance: + - cis: ["4.2.1.1.4"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journal-remote.socket -> r:disabled|No such file or directory" + + # 4.2.1.2 Ensure journald service is enabled. (Automated) + - id: 28616 + title: "Ensure journald service is enabled." + description: "Ensure that the systemd-journald service is enabled to allow capturing of logging events." + rationale: "If the systemd-journald service is not enabled to start on boot, the system will not capture logging events." + remediation: "By default the systemd-journald service does not have an [Install] section and thus cannot be enabled / disabled. It is meant to be referenced as Requires or Wants by other unit files. As such, if the status of systemd-journald is not static, investigate why." + compliance: + - cis: ["4.2.1.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled systemd-journald.service -> r:static" + + # 4.2.1.3 Ensure journald is configured to compress large log files. (Automated) + - id: 28617 + title: "Ensure journald is configured to compress large log files." + description: "The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large." + rationale: "Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Compress=yes Restart the service: # systemctl restart systemd-journald." + compliance: + - cis: ["4.2.1.3"] + - cis_csc_v8: ["8.2", "8.3"] + - cis_csc_v7: ["6.2", "6.3", "6.4"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1053"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1562", "T1562.002"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.7"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["A1.1"] + condition: all + rules: + - "f:/etc/systemd/journald.conf -> r:^\\s*\\t*Compress=yes" + + # 4.2.1.4 Ensure journald is configured to write logfiles to persistent disk. (Automated) + - id: 28618 + title: "Ensure journald is configured to write logfiles to persistent disk." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss due to a reboot." + rationale: "Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: Storage=persistent Restart the service: # systemctl restart systemd-journald." + compliance: + - cis: ["4.2.1.4"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "f:/etc/systemd/journald.conf -> r:^\\s*\\t*Storage=persistent" + + # 4.2.1.5 Ensure journald is not configured to send logs to rsyslog. (Manual) + - id: 28619 + title: "Ensure journald is not configured to send logs to rsyslog." + description: "Data from journald should be kept in the confines of the service and not forwarded on to other services." + rationale: "IF journald is the method for capturing logs, all logs of the system should be handled by journald and not forwarded to other logging mechanisms." + remediation: "Edit the /etc/systemd/journald.conf file and ensure that ForwardToSyslog=yes is removed. Restart the service: # systemctl restart systemd-journald." + compliance: + - cis: ["4.2.1.5"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_mitigations: ["M1029"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - "f:/etc/systemd/journald.conf -> !r:^\\s*\\t*ForwardToSyslog=yes" + + # 4.2.1.6 Ensure journald log rotation is configured per site policy (Manual) - Not implemented + # 4.2.1.7 Ensure journald default file permissions configured (Manual) - Not implemented + + # 4.2.2.1 Ensure rsyslog is installed. (Automated) + - id: 28620 + title: "Ensure rsyslog is installed." + description: "The rsyslog software is recommended in environments where journald does not meet operation requirements." + rationale: "The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package." + remediation: "Run the following command to install rsyslog: # apt install rsyslog." + compliance: + - cis: ["4.2.2.1"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1005", "T1070", "T1070.002"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:dpkg-query -s rsyslog -> r:install ok installed" + + # 4.2.2.2 Ensure rsyslog service is enabled. (Automated) + - id: 28621 + title: "Ensure rsyslog service is enabled." + description: "Once the rsyslog package is installed, ensure that the service is enabled." + rationale: "If the rsyslog service is not enabled to start on boot, the system will not capture logging events." + remediation: "Run the following command to enable rsyslog: # systemctl --now enable rsyslog." + compliance: + - cis: ["4.2.2.2"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.001"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: all + rules: + - "c:systemctl is-enabled rsyslog -> r:enabled" + + # 4.2.2.3 Ensure journald is configured to send logs to rsyslog. (Manual) + - id: 28622 + title: "Ensure journald is configured to send logs to rsyslog." + description: "Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the RSyslog service provides a consistent means of log collection and export." + rationale: "IF RSyslog is the preferred method for capturing logs, all logs of the system should be sent to it for further processing." + remediation: "Edit the /etc/systemd/journald.conf file and add the following line: ForwardToSyslog=yes Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.2.3"] + - cis_csc_v8: ["8.2", "8.9"] + - cis_csc_v7: ["6.2", "6.3", "6.5"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-6(3)", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "10.5.3", "10.5.4"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "10.3.3", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["PL1.4"] + condition: all + rules: + - "f:/etc/systemd/journald.conf -> r::^\\s*\\t*ForwardToSyslog=yes$" + + # 4.2.2.4 Ensure rsyslog default file permissions are configured. (Automated) + - id: 28623 + title: "Ensure rsyslog default file permissions are configured." + description: "RSyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files." + rationale: "It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected." + impact: "The systems global umask could override, but only making the file permissions stricter, what is configured in RSyslog with the FileCreateMode directive. RSyslog also has it's own $umask directive that can alter the intended file creation mode. In addition, consideration should be given to how FileCreateMode is used. Thus it is critical to ensure that the intended file creation mode is not overridden with less restrictive settings in /etc/rsyslog.conf, /etc/rsyslog.d/*conf files and that FileCreateMode is set before any file is created." + remediation: "Edit either /etc/rsyslog.conf or a dedicated .conf file in /etc/rsyslog.d/ and set $FileCreateMode to 0640 or more restrictive: $FileCreateMode 0640 Restart the service: # systemctl restart rsyslog." + compliance: + - cis: ["4.2.2.4"] + - cis_csc_v8: ["3.3", "8.2"] + - cis_csc_v7: ["5.1", "6.2", "6.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)", "164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.14.2.5", "A.8.1.3"] + - mitre_tactics: ["TA0007"] + - mitre_techniques: ["T1070", "T1070.002", "T1083"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/rsyslog.conf -> r:^\s*\t*\$FileCreateMode 0640' + - 'd:/etc/rsyslog.d -> r:\.*.conf -> r:^\s*\t*\$FileCreateMode 0640' + + # 4.2.2.5 Ensure logging is configured (Manual) - Not implemented + # 4.2.2.6 Ensure rsyslog is configured to send logs to a remote log host (Manual) - Not implemented + + # 4.2.2.7 Ensure rsyslog is not configured to receive logs from a remote client. (Automated) + - id: 28624 + title: "Ensure rsyslog is not configured to receive logs from a remote client." + description: "RSyslog supports the ability to receive messages from remote hosts, thus acting as a log server. Clients should not receive data from other hosts." + rationale: "If a client is configured to also receive data, thus turning it into a server, the client system is acting outside it's operational boundary." + remediation: 'Should there be any active log server configuration found in the auditing section, modify those file and remove the specific lines highlighted by the audit. Ensure none of the following entries are present in any of /etc/rsyslog.conf or /etc/rsyslog.d/*.conf. Old format $ModLoad imtcp $InputTCPServerRun New format module(load="imtcp") input(type="imtcp" port="514") Restart the service: # systemctl restart rsyslog.' + compliance: + - cis: ["4.2.2.7"] + - cis_csc_v8: ["4.8", "8.2"] + - cis_csc_v7: ["6.2", "6.3", "9.2"] + - cmmc_v2.0: ["AU.L2-3.3.1", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1", "A.13.1.3"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1070", "T1070.002", "T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "10.2", "10.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "2.2.4", "5.3.4", "6.4.1", "6.4.2"] + - soc_2: ["CC6.3", "CC6.6"] + condition: none + rules: + - 'f:/etc/rsyslog.conf -> r:^\s*\t*module\(load="imtcp"\)' + - 'd:/etc/rsyslog.d -> r:\.*.conf -> r:^\s*\t*module\(load="imtcp"\)' + - 'f:/etc/rsyslog.conf -> r:^\s*\t*input\(type="imtcp" port="514"\)' + - 'd:/etc/rsyslog.d -> r:\.*.conf -> r:^\s*\t*input\(type="imtcp" port="514"\)' + + # 4.2.3 Ensure all logfiles have appropriate permissions and ownership (Automated) - Not implemented + + # 5.1.1 Ensure cron daemon is enabled and running. (Automated) + - id: 28625 + title: "Ensure cron daemon is enabled and running." + description: "The cron daemon is used to execute batch jobs on the system. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them." + remediation: "Run the following command to enable and start cron: # systemctl --now enable cron." + compliance: + - cis: ["5.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.001"] + condition: all + rules: + - "c:systemctl is-enabled cron -> r:enabled" + - "c:systemctl status cron -> r:Active: active \\(running\\)" + + # 5.1.2 Ensure permissions on /etc/crontab are configured. (Automated) + - id: 28626 + title: "Ensure permissions on /etc/crontab are configured." + description: "The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access." + remediation: "Run the following commands to set ownership and permissions on /etc/crontab : # chown root:root /etc/crontab # chmod og-rwx /etc/crontab." + compliance: + - cis: ["5.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/crontab -> r:Access:\s*\t*\(0600/-rw-------\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)' + + # 5.1.3 Ensure permissions on /etc/cron.hourly are configured. (Automated) + - id: 28627 + title: "Ensure permissions on /etc/cron.hourly are configured." + description: "This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.hourly directory: # chown root:root /etc/cron.hourly/ # chmod og-rwx /etc/cron.hourly/." + compliance: + - cis: ["5.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.hourly/ -> r:Access:\s*\t*\(0700/drwx------\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)' + + # 5.1.4 Ensure permissions on /etc/cron.daily are configured. (Automated) + - id: 28628 + title: "Ensure permissions on /etc/cron.daily are configured." + description: "The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.daily directory: # chown root:root /etc/cron.daily/ # chmod og-rwx /etc/cron.daily/." + compliance: + - cis: ["5.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.daily/ -> r:Access:\s*\t*\(0700/drwx------\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)' + + # 5.1.5 Ensure permissions on /etc/cron.weekly are configured. (Automated) + - id: 28629 + title: "Ensure permissions on /etc/cron.weekly are configured." + description: "The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.weekly directory: # chown root:root /etc/cron.weekly/ # chmod og-rwx /etc/cron.weekly/." + compliance: + - cis: ["5.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.weekly/ -> r:Access:\s*\t*\(0700/drwx------\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)' + + # 5.1.6 Ensure permissions on /etc/cron.monthly are configured. (Automated) + - id: 28630 + title: "Ensure permissions on /etc/cron.monthly are configured." + description: "The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.monthly directory: # chown root:root /etc/cron.monthly/ # chmod og-rwx /etc/cron.monthly/." + compliance: + - cis: ["5.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.monthly/ -> r:Access:\s*\t*\(0700/drwx------\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)' + + # 5.1.7 Ensure permissions on /etc/cron.d are configured. (Automated) + - id: 28631 + title: "Ensure permissions on /etc/cron.d are configured." + description: "The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab, but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls." + remediation: "Run the following commands to set ownership and permissions on the /etc/cron.d directory: # chown root:root /etc/cron.d/ # chmod og-rwx /etc/cron.d/." + compliance: + - cis: ["5.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002", "TA0007"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/cron.d/ -> r:Access:\s*\t*\(0700/drwx------\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)' + + # 5.1.8 Ensure cron is restricted to authorized users. (Automated) + - id: 28632 + title: "Ensure cron is restricted to authorized users." + description: "Configure /etc/cron.allow to allow specific users to use this service. If /etc/cron.allow does not exist, then /etc/cron.deny is checked. Any user not specifically defined in this file is allowed to use cron. By removing the file, only users in /etc/cron.allow are allowed to use cron. Note: - Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, cron should be removed, and the alternate method should be secured in accordance with local site policy - Even though a given user is not listed in cron.allow, cron jobs can still be run as that user - The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs." + rationale: "On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/cron.deny: # rm /etc/cron.deny Run the following command to create /etc/cron.allow # touch /etc/cron.allow Run the following commands to set permissions and ownership for /etc/cron.allow: # chmod g-wx,o-rwx /etc/cron.allow # chown root:root /etc/cron.allow." + compliance: + - cis: ["5.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "not f:/etc/cron.deny" + - 'c:stat /etc/cron.allow -> r:Access:\s*\t*\(0640/-rw-r-----\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)' + + # 5.1.9 Ensure at is restricted to authorized users. (Automated) + - id: 28633 + title: "Ensure at is restricted to authorized users." + description: "Configure /etc/at.allow to allow specific users to use this service. If /etc/at.allow does not exist, then /etc/at.deny is checked. Any user not specifically defined in this file is allowed to use at. By removing the file, only users in /etc/at.allow are allowed to use at. Note: Other methods, such as systemd timers, exist for scheduling jobs. If another method is used, at should be removed, and the alternate method should be secured in accordance with local site policy." + rationale: "On many systems, only the system administrator is authorized to schedule at jobs. Using the at.allow file to control who can run at jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files." + remediation: "Run the following commands to remove /etc/at.deny: # rm /etc/at.deny Run the following command to create /etc/at.allow # touch /etc/at.allow Run the following commands to set permissions and ownership for /etc/at.allow: # chmod g-wx,o-rwx /etc/at.allow # chown root:root /etc/at.allow." + compliance: + - cis: ["5.1.9"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0002"] + - mitre_techniques: ["T1053", "T1053.003"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - "not f:/etc/at.deny" + - 'c:stat /etc/at.allow -> r:Access:\s*\t*\(0640/-rw-r-----\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)' + + # 5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured. (Automated) + - id: 28634 + title: "Ensure permissions on /etc/ssh/sshd_config are configured." + description: "The /etc/ssh/sshd_config file contains configuration specifications for sshd. The command below sets the owner and group of the file to root." + rationale: "The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users." + remediation: "Run the following commands to set ownership and permissions on /etc/ssh/sshd_config: # chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config." + compliance: + - cis: ["5.2.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1098", "T1098.004", "T1543", "T1543.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/ssh/sshd_config -> r:Access:\s*\t*\(0600/-rw-------\)\s*\t*Uid:\s*\t*\(\s*\t*0/\s*root\)\s*Gid:\s*\t*\(\s*\t*0/\s*\t*root\)' + + # 5.2.2 Ensure permissions on SSH private host key files are configured (Automated) - Not implemented + + # 5.2.3 Ensure permissions on SSH public host key files are configured (Automated) - Not implemented + + # 5.2.4 Ensure SSH access is limited. (Automated) + - id: 28635 + title: "Ensure SSH access is limited." + description: "There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged: - AllowUsers: o The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host. - AllowGroups: o The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable. - DenyUsers: o The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host. - DenyGroups: o The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable." + rationale: "Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system." + remediation: "Edit the /etc/ssh/sshd_config file or a included configuration file to set one or more of the parameter as follows: AllowUsers OR AllowGroups OR DenyUsers OR DenyGroups ." + compliance: + - cis: ["5.2.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_mitigations: ["M1018"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021", "T1021.004"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'c:sshd -T -> r:^\s*\t*Allowusers\s*\t*\w+|^\s*\t*Denyusers\s*\t*\w+|^\s*\t*Allowgroups\s*\t*\w+|^\s*\t*Denygroups\s*\t*\w+' + - 'f:/etc/ssh/sshd_config -> r:^\s*\t*Allowusers\s*\t*\w+|^\s*\t*Denyusers\s*\t*\w+|^\s*\t*Allowgroups\s*\t*\w+|^\s*\t*Denygroups\s*\t*\w+' + - 'd:/etc/ssh/sshd_config.d -> r:\.* -> r:^\s*\t*Allowusers\s*\t*\w+|^\s*\t*Denyusers\s*\t*\w+|^\s*\t*Allowgroups\s*\t*\w+|^\s*\t*Denygroups\s*\t*\w+' + + # 5.2.5 Ensure SSH LogLevel is appropriate. (Automated) + - id: 28636 + title: "Ensure SSH LogLevel is appropriate." + description: "INFO 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. VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments." + rationale: "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." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LogLevel VERBOSE OR LogLevel INFO." + references: + - "https://www.ssh.com/ssh/sshd_config/" + compliance: + - cis: ["5.2.5"] + - cis_csc_v8: ["8.2"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - hipaa: ["164.312(b)"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.2", "10.3"] + - pci_dss_v4.0: ["10.2.1", "10.2.1.1", "10.2.1.2", "10.2.1.3", "10.2.1.4", "10.2.1.5", "10.2.1.6", "10.2.1.7", "10.2.2", "5.3.4", "6.4.1", "6.4.2"] + condition: any + rules: + - "c:sshd -T -> r:^loglevel VERBOSE|^loglevel INFO" + - "not f:/etc/ssh/sshd_config -> !r:^\\s*\\t*loglevel\\s*\\t*VERBOSE|^\\s*\\t*loglevel\\s*\\t*INFO" + + # 5.2.6 Ensure SSH PAM is enabled. (Automated) + - id: 28637 + title: "Ensure SSH PAM is enabled." + description: "The UsePAM directive enables the Pluggable Authentication Module (PAM) interface. If set to yes this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication directives in addition to PAM account and session module processing for all authentication types." + rationale: "When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: UsePAM yes." + compliance: + - cis: ["5.2.6"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1035"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1021", "T1021.004"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:sshd -T -> r:^usepam yes" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*UsePAM\\s*\\t*no" + + # 5.2.7 Ensure SSH root login is disabled. (Automated) + - id: 28638 + title: "Ensure SSH root login is disabled." + description: "The PermitRootLogin parameter specifies if the root user can log in using SSH. The default is prohibit-password." + rationale: "Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root. This limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitRootLogin no." + compliance: + - cis: ["5.2.7"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - "c:sshd -T -> r:^permitrootlogin no" + - "f:/etc/ssh/sshd_config -> r:^\\s*\\t*PermitRootLogin\\s*\\t*no" + + # 5.2.8 Ensure SSH HostbasedAuthentication is disabled. (Automated) + - id: 28639 + title: "Ensure SSH HostbasedAuthentication is disabled." + description: "The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts, or /etc/hosts.equiv, along with successful public key client host authentication." + rationale: "Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf, disabling the ability to use .rhosts files in SSH provides an additional layer of protection." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: HostbasedAuthentication no." + compliance: + - cis: ["5.2.8"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:sshd -T -> r:^hostbasedauthentication no" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*HostBasedAuthentication\\s*\\t*yes" + + # 5.2.9 Ensure SSH PermitEmptyPasswords is disabled. (Automated) + - id: 28640 + title: "Ensure SSH PermitEmptyPasswords is disabled." + description: "The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings." + rationale: "Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitEmptyPasswords no." + compliance: + - cis: ["5.2.9"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["16.3"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:sshd -T -> r:^permitemptypasswords no" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*PermitEmptyPasswords\\s*\\t*yes" + + # 5.2.10 Ensure SSH PermitUserEnvironment is disabled. (Automated) + - id: 28641 + title: "Ensure SSH PermitUserEnvironment is disabled." + description: "The PermitUserEnvironment option allows users to present environment options to the SSH daemon." + rationale: "Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has SSH executing trojan'd programs)." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: PermitUserEnvironment no." + compliance: + - cis: ["5.2.10"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1021"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:sshd -T -> r:^permituserenvironment no" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*PermitUserEnvironment\\s*\\t*yes" + + # 5.2.11 Ensure SSH IgnoreRhosts is enabled. (Automated) + - id: 28642 + title: "Ensure SSH IgnoreRhosts is enabled." + description: "The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication." + rationale: "Setting this parameter forces users to enter a password when authenticating with SSH." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: IgnoreRhosts yes." + compliance: + - cis: ["5.2.11"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:sshd -T -> r:^ignorerhosts yes" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*IgnoreRhosts\\s*\\t*no" + + # 5.2.12 Ensure SSH X11 forwarding is disabled. (Automated) + - id: 28643 + title: "Ensure SSH X11 forwarding is disabled." + description: "The X11Forwarding parameter provides the ability to tunnel X11 traffic through the connection to enable remote graphic connections." + rationale: "Disable X11 forwarding unless there is an operational requirement to use X11 applications directly. There is a small risk that the remote X11 servers of users who are logged in via SSH with X11 forwarding could be compromised by other users on the X11 server. Note that even if X11 forwarding is disabled, users can always install their own forwarders." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: X11Forwarding no." + compliance: + - cis: ["5.2.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1210"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - "c:sshd -T -> r:^x11forwarding no" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*x11forwarding\\s*\\t*yes" + + # 5.2.13 Ensure only strong Ciphers are used. (Automated) + - id: 28644 + title: "Ensure only strong Ciphers are used." + description: 'This variable limits the ciphers that SSH can use during communication. Note: - Some organizations may have stricter requirements for approved ciphers. - Ensure that ciphers used are in compliance with site policy. - The only "strong" ciphers currently FIPS 140-2 compliant are: o aes256-ctr o aes192-ctr o aes128-ctr - Supported ciphers in openSSH 8.2: 3des-cbc aes128-cbc aes192-cbc aes256-cbc aes128-ctr aes192-ctr aes256-ctr aes128-gcm@openssh.com aes256-gcm@openssh.com chacha20-poly1305@openssh.com.' + rationale: 'Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised. - The Triple DES ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain clear text data via a birthday attack against a long-duration encrypted session, aka a "Sweet32" attack. - Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plain text data from an arbitrary block of cipher text in an SSH session via unknown vectors.' + remediation: "Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers. Example: Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128- gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr." + references: + - "https://nvd.nist.gov/vuln/detail/CVE-2016-2183" + - "https://www.openssh.com/txt/cbc.adv" + - "https://nvd.nist.gov/vuln/detail/CVE-2008-5161" + compliance: + - cis: ["5.2.13"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - mitre_mitigations: ["M1041"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1040", "T1557"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: none + rules: + - "c:sshd -T -> r:^Ciphers && r:3des-cbc|aes128-cbc|aes192-cbc|aes256-cbc" + + # 5.2.14 Ensure only strong MAC algorithms are used. (Automated) + - id: 28645 + title: "Ensure only strong MAC algorithms are used." + description: 'This variable limits the types of MAC algorithms that SSH can use during communication. Note: - Some organizations may have stricter requirements for approved MACs. - Ensure that MACs used are in compliance with site policy. - The only "strong" MACs currently FIPS 140-2 approved are: o hmac-sha2-256 o hmac-sha2-512 - The Supported MACs are: hmac-md5 hmac-md5-96 hmac-sha1 hmac-sha1-96 hmac-sha2-256 hmac-sha2-512 umac-64@openssh.com umac-128@openssh.com hmac-md5-etm@openssh.com hmac-md5-96-etm@openssh.com hmac-sha1-etm@openssh.com hmac-sha1-96-etm@openssh.com hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com umac-64-etm@openssh.com umac-128-etm@openssh.com.' + rationale: "MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information." + remediation: "Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs. Example: MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2- 512,hmac-sha2-256." + references: + - "http://www.mitls.org/pages/attacks/SLOTH" + compliance: + - cis: ["5.2.14"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4", "16.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - mitre_mitigations: ["M1041"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1040", "T1557"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: none + rules: + - "c:sshd -T -> r:^MACs && r:hmac-md5|hmac-md5-96|hmac-ripemd160|hmac-sha1|hmac-sha1-96|umac-64@openssh.com|umac-128@openssh.com|hmac-md5-etm@openssh.com|hmac-md5-96-etm@openssh.com|hmac-ripemd160-etm@openssh.com|hmac-sha1-etm@openssh.com|hmac-sha1-96-etm@openssh.com|umac-64-etm@openssh.com|umac-128-etm@openssh.com" + + # 5.2.15 Ensure only strong Key Exchange algorithms are used. (Automated) + - id: 28646 + title: "Ensure only strong Key Exchange algorithms are used." + description: "Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received Notes: - Kex algorithms have a higher preference the earlier they appear in the list - Some organizations may have stricter requirements for approved Key exchange algorithms - Ensure that Key exchange algorithms used are in compliance with site policy - The only Key Exchange Algorithms currently FIPS 140-2 approved are: o ecdh-sha2-nistp256 o ecdh-sha2-nistp384 o ecdh-sha2-nistp521 o diffie-hellman-group-exchange-sha256 o diffie-hellman-group16-sha512 o diffie-hellman-group18-sha512 o diffie-hellman-group14-sha256 - The Key Exchange algorithms supported by OpenSSH 8.2 are: curve25519-sha256 curve25519-sha256@libssh.org diffie-hellman-group1-sha1 diffie-hellman-group14-sha1 diffie-hellman-group14-sha256 diffie-hellman-group16-sha512 diffie-hellman-group18-sha512 diffie-hellman-group-exchange-sha1 diffie-hellman-group-exchange-sha256 ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 sntrup4591761x25519-sha512@tinyssh.org." + rationale: "Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks." + remediation: "Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms Example: KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman- group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18- sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie- hellman-group-exchange-sha256." + compliance: + - cis: ["5.2.15"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - mitre_mitigations: ["M1041"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1040", "T1557"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: none + rules: + - "c:sshd -T -> r:^kexalgorithms && r:diffie-hellman-group1-sha1|diffie-hellman-group14-sha1|diffie-hellman-group-exchange-sha1" + + # 5.2.16 Ensure SSH AllowTcpForwarding is disabled. (Automated) + - id: 28647 + title: "Ensure SSH AllowTcpForwarding is disabled." + description: "SSH port forwarding is a mechanism in SSH for tunneling application ports from the client to the server, or servers to clients. It can be used for adding encryption to legacy applications, going through firewalls, and some system administrators and IT professionals use it for opening backdoors into the internal network from their home machines." + rationale: "Leaving port forwarding enabled can expose the organization to security risks and backdoors. SSH connections are protected with strong encryption. This makes their contents invisible to most deployed network monitoring and traffic filtering solutions. This invisibility carries considerable risk potential if it is used for malicious purposes such as data exfiltration. Cybercriminals or malware could exploit SSH to hide their unauthorized communications, or to exfiltrate stolen data from the target network." + impact: "SSH tunnels are widely used in many corporate environments. In some environments the applications themselves may have very limited native support for security. By utilizing tunneling, compliance with SOX, HIPAA, PCI-DSS, and other standards can be achieved without having to modify the applications." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: AllowTcpForwarding no." + references: + - "https://www.ssh.com/ssh/tunneling/example" + compliance: + - cis: ["5.2.16"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.13.1.3"] + - mitre_mitigations: ["M1042"] + - mitre_tactics: ["TA0008"] + - mitre_techniques: ["T1048", "T1048.002", "T1572"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:sshd -T -> r:^allowtcpforwarding && r:no$" + - "not f:/etc/ssh/sshd_config -> r:^\\s*\\t*AllowTcpForwarding\\s*\\t*yes" + + # 5.2.17 Ensure SSH warning banner is configured. (Automated) + - id: 28648 + title: "Ensure SSH warning banner is configured." + description: "The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed." + rationale: "Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: Banner /etc/issue.net." + compliance: + - cis: ["5.2.17"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1035"] + - mitre_tactics: ["TA0001", "TA0007"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - "c:sshd -T -> r:^banner && r:/etc/issue.net$" + + # 5.2.18 Ensure SSH MaxAuthTries is set to 4 or less. (Automated) + - id: 28649 + title: "Ensure SSH MaxAuthTries is set to 4 or less." + description: "The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure." + rationale: "Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxAuthTries 4." + compliance: + - cis: ["5.2.18"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - mitre_mitigations: ["M1036"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - "c:sshd -T -> n:^maxauthtries\\s+(\\d+) compare <= 4" + - "not f:/etc/ssh/sshd_config -> n:^\\s*\\t*maxauthtries\\s+(\\d+) compare > 4" + + # 5.2.19 Ensure SSH MaxStartups is configured. (Automated) + - id: 28650 + title: "Ensure SSH MaxStartups is configured." + description: "The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon." + rationale: "To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxStartups 10:30:60." + compliance: + - cis: ["5.2.19"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1499", "T1499.002"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*maxstartups\s+(\d+):\d+:\d+ compare <= 10 && n:^maxstartups\s+(\d+):\d+:\d+ compare >= 1' + - 'c:sshd -T -> n:^\s*maxstartups\s+\d+:(\d+):\d+ compare <= 30 && n:^maxstartups\s+(\d+):\d+:\d+ compare >= 1' + - 'c:sshd -T -> n:^\s*maxstartups\s+\d+:\d+:(\d+) compare <= 60 && n:^maxstartups\s+(\d+):\d+:\d+ compare >= 1' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxStartups\s*\t*(\d+):\d+:\d+ compare > 10' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxStartups\s*\t*(\d+):\d+:\d+ compare == 0' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxStartups\s*\t*\d+:(\d+):\d+ compare > 30' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxStartups\s*\t*\d+:(\d+):\d+ compare == 0' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxStartups\s*\t*\d+:\d+:(\d+) compare > 60' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*MaxStartups\s*\t*\d+:\d+:(\d+) compare == 0' + + # 5.2.20 Ensure SSH MaxSessions is set to 10 or less. (Automated) + - id: 28651 + title: "Ensure SSH MaxSessions is set to 10 or less." + description: "The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection." + rationale: "To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: MaxSessions 10." + compliance: + - cis: ["5.2.20"] + - mitre_tactics: ["TA0040"] + - mitre_techniques: ["T1499", "T1499.002"] + condition: all + rules: + - "c:sshd -T -> n:^maxsessions\\s*\\t*(\\d+) compare <= 10" + - "not f:/etc/ssh/sshd_config -> n:^^\\s*\\t*MaxSessions\\s+(\\d+) compare > 10" + + # 5.2.21 Ensure SSH LoginGraceTime is set to one minute or less. (Automated) + - id: 28652 + title: "Ensure SSH LoginGraceTime is set to one minute or less." + description: "The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access." + rationale: "Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections. While the recommended setting is 60 seconds (1 Minute), set the number based on site policy." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameter as follows: LoginGraceTime 60." + compliance: + - cis: ["5.2.21"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_mitigations: ["M1036"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003", "T1110.004", "T1499", "T1499.002"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'c:sshd -T -> n:^\s*logingracetime\s*(\d+) compare <= 60 && n:^logingracetime\s*(\d+) compare >= 1' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*LoginGraceTime\s*\t*(\d+) compare > 60' + - 'not f:/etc/ssh/sshd_config -> n:^\s*\t*LoginGraceTime\s*\t*(\d+) compare == 0' + + # 5.2.22 Ensure SSH Idle Timeout Interval is configured. (Automated) + - id: 28653 + title: "Ensure SSH Idle Timeout Interval is configured." + description: "NOTE: To clarify, the two settings described below is only meant for idle connections from a protocol perspective and not meant to check if the user is active or not. An idle user does not mean an idle connection. SSH does not and never had, intentionally, the capability to drop idle users. In SSH versions before 8.2p1 there was a bug that caused these values to behave in such a manner that they where abused to disconnect idle users. This bug has been resolved in 8.2p1 and thus it can no longer be abused disconnect idle users. The two options ClientAliveInterval and ClientAliveCountMax control the timeout of SSH sessions. Taken directly from man 5 sshd_config: - ClientAliveInterval Sets a timeout interval in seconds after which if no data has been received from the client, sshd(8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. - ClientAliveCountMax Sets the number of client alive messages which may be sent without sshd(8) receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. It is important to note that the use of client alive messages is very different from TCPKeepAlive. The client alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The client alive mechanism is valuable when the client or server depend on knowing when a connection has become unresponsive. The default value is 3. If ClientAliveInterval is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds. Setting a zero ClientAliveCountMax disables connection termination." + rationale: "In order to prevent resource exhaustion, appropriate values should be set for both ClientAliveInterval and ClientAliveCountMax. Specifically, looking at the source code, ClientAliveCountMax must be greater than zero in order to utilize the ability of SSH to drop idle connections. If connections are allowed to stay open indefinately, this can potentially be used as a DDOS attack or simple resource exhaustion could occur over unreliable networks. The example set here is a 45 second timeout. Consult your site policy for network timeouts and apply as appropriate." + remediation: "Edit the /etc/ssh/sshd_config file to set the parameters according to site policy. Example: ClientAliveInterval 15 ClientAliveCountMax 3." + references: + - "https://man.openbsd.org/sshd_config" + compliance: + - cis: ["5.2.22"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003"] + condition: all + rules: + - "c:sshd -T -> -> n:^clientaliveinterval\\s*\\t*(\\d+) compare > 0" + - "c:sshd -T -> -> n:^clientalivecountmax\\s*\\t*(\\d+) compare > 0" + + # 5.3.1 Ensure sudo is installed. (Automated) + - id: 28654 + title: "Ensure sudo is installed." + description: "sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy." + rationale: "sudo supports a plug-in architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plug-ins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers and any entries in /etc/sudoers.d. The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific." + remediation: "First determine is LDAP functionality is required. If so, then install sudo-ldap, else install sudo. Example: # apt install sudo." + compliance: + - cis: ["5.3.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.003"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - "c:dpkg -s sudo -> r:install ok installed" + - "c:dpkg -s sudo-ldap -> r:install ok installed" + + # 5.3.2 Ensure sudo commands use pty. (Automated) + - id: 28655 + title: "Ensure sudo commands use pty." + description: "sudo can be configured to run only from a pseudo terminal (pseudo-pty)." + rationale: "Attackers can run a malicious program using sudo which would fork a background process that remains even when the main program has finished executing." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: "Edit the file /etc/sudoers with visudo or a file in /etc/sudoers.d/ with visudo -f and add the following line: Defaults use_pty." + compliance: + - cis: ["5.3.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1548", "T1548.003"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*use_pty' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*Defaults\s*\t*use_pty' + + # 5.3.3 Ensure sudo log file exists. (Automated) + - id: 28656 + title: "Ensure sudo log file exists." + description: "sudo can use a custom log file." + rationale: "A sudo log file simplifies auditing of sudo commands." + impact: "WARNING: Editing the sudo configuration incorrectly can cause sudo to stop functioning. Always use visudo to modify sudo configuration files." + remediation: 'Edit the file /etc/sudoers or a file in /etc/sudoers.d/ with visudo or visudo -f and add the following line: Example: Defaults logfile="/var/log/sudo.log".' + compliance: + - cis: ["5.3.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - mitre_tactics: ["TA0004"] + - mitre_techniques: ["T1562", "T1562.006"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: any + rules: + - 'f:/etc/sudoers -> r:^\s*\t*Defaults\s*\t*logfile=\S+.log' + - 'd:/etc/sudoers.d -> \.* -> r:^\s*\t*Defaults\s*\t*logfile=\S+.log' + + # 5.3.4 Ensure users must provide password for privilege escalation. (Automated) + - id: 28657 + title: "Ensure users must provide password for privilege escalation." + description: "The operating system must be configured so that users must provide a password for privilege escalation." + rationale: "Without (re-)authentication, 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 (re-)authenticate." + impact: "This will prevent automated processes from being able to elevate privileges." + remediation: "Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any line with occurrences of NOPASSWD tags in the file." + compliance: + - cis: ["5.3.4"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> r:^\s*\t*NOPASSWD' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*NOPASSWD' + + # 5.3.5 Ensure re-authentication for privilege escalation is not disabled globally. (Automated) + - id: 28658 + title: "Ensure re-authentication for privilege escalation is not disabled globally." + description: "The operating system must be configured so that users must re-authenticate for privilege escalation." + rationale: "Without re-authentication, 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 re-authenticate." + remediation: "Configure the operating system to require users to reauthenticate for privilege escalation. Based on the outcome of the audit procedure, use visudo -f to edit the relevant sudoers file. Remove any occurrences of !authenticate tags in the file(s)." + compliance: + - cis: ["5.3.5"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: none + rules: + - 'f:/etc/sudoers -> r:^\s*\t*!authenticate' + - 'd:/etc/sudoers.d -> r:\.* -> r:^\s*\t*!authenticate' + + # 5.3.6 Ensure sudo authentication timeout is configured correctly. (Automated) + - id: 28659 + title: "Ensure sudo authentication timeout is configured correctly." + description: "sudo caches used credentials for a default of 15 minutes. This is for ease of use when there are multiple administrative tasks to perform. The timeout can be modified to suit local security policies. This default is distribution specific. See audit section for further information." + rationale: "Setting a timeout value reduces the window of opportunity for unauthorized privileged access to another user." + remediation: "If the currently configured timeout is larger than 15 minutes, edit the file listed in the audit section with visudo -f and modify the entry timestamp_timeout= to 15 minutes or less as per your site policy. The value is in minutes. This particular entry may appear on its own, or on the same line as env_reset. See the following two examples: Defaults env_reset, timestamp_timeout=15 Defaults timestamp_timeout=15 Defaults env_reset." + references: + - "https://www.sudo.ws/man/1.9.0/sudoers.man.html" + compliance: + - cis: ["5.3.6"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'f:/etc/sudoers -> !r:^\s*\t*# && n:^\s*\t*timestamp_timeout=(\d+) compare <= 15 && n:^\s*\t*timestamp_timeout=(\d+) compare >= 0' + - 'd:/etc/sudoers.d -> r:\.* -> !r:^\s*\t*# && n:^\s*\t*timestamp_timeout=(\d+) compare <= 15 && n:^\s*\t*timestamp_timeout=(\d+) compare >= 0' + - 'c:sudo -V -> n:Authentication timestamp timeout:\s*\t*(\d+) compare <= 15 && n:Authentication timestamp timeout:\s*\t*(\d+) compare >= 0' + + # 5.3.7 Ensure access to the su command is restricted. (Automated) + - id: 28660 + title: "Ensure access to the su command is restricted." + description: "The su command allows a user to run a command or shell as another user. The program has been superseded by sudo, which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su, the su command will only allow users in a specific groups to execute su. This group should be empty to reinforce the use of sudo for privileged access." + rationale: "Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program." + remediation: "Create an empty group that will be specified for use of the su command. The group should be named according to site policy. Example: # groupadd sugroup Add the following line to the /etc/pam.d/su file, specifying the empty group: auth required pam_wheel.so use_uid group=sugroup." + compliance: + - cis: ["5.3.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/su -> !r:^# && r:auth\s*required\s*pam_wheel.so && r:use_uid && r:group=' + + # 5.4.1 Ensure password creation requirements are configured. (Automated) + - id: 28661 + title: "Ensure password creation requirements are configured." + description: "The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following options are set in the /etc/security/pwquality.conf file: - Password Length: o minlen = 14 - password must be 14 characters or more - Password complexity: o minclass = 4 - The minimum number of required classes of characters for the new password (digits, uppercase, lowercase, others) OR o dcredit = -1 - provide at least one digit o ucredit = -1 - provide at least one uppercase character o ocredit = -1 - provide at least one special character o lcredit = -1 - provide at least one lowercase character." + rationale: "Strong passwords protect systems from being hacked through brute force methods." + remediation: "The following setting is a recommend example policy. Alter these values to conform to your own organization's password policies. Run the following command to install the pam_pwquality module: # apt install libpam-pwquality Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy: minlen = 14 Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy: Option 1 minclass = 4 Option 2 dcredit = -1 ucredit = -1 ocredit = -1 lcredit = -1." + compliance: + - cis: ["5.4.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.001", "T1110.002", "T1110.003"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - "c:apt list --installed libpam-pwquality -> r:libpam-pwquality" + - 'f:/etc/security/pwquality.conf -> n:^\s*\t*minlen\s+=\s+(\d+) compare >=14' + - 'f:/etc/security/pwquality.conf -> r:^\s*\t*minclass\s+=\s+4' + + # 5.4.2 Ensure lockout for failed password attempts is configured. (Automated) + - id: 28662 + title: "Ensure lockout for failed password attempts is configured." + description: "Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the common PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM. All configuration of faillock is located in /etc/security/faillock.conf and well commented. - deny - Deny access if the number of consecutive authentication failures for this user during the recent interval exceeds n tries. - fail_interval - The length of the interval, in seconds, during which the consecutive authentication failures must happen for the user account to be locked out - unlock_time - The access will be re-enabled after n seconds after the lock out. The value 0 has the same meaning as value never - the access will not be re-enabled without resetting the faillock entries by the faillock command. Set the lockout number and unlock time in accordance with local site policy." + rationale: "Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems." + impact: "It is critical to test and validate any PAM changes before deploying. Any misconfiguration could cause the system to be inaccessible." + remediation: 'NOTE: Pay special attention to the configuration. Incorrect configuration can cause system lock outs. This is example configuration. You configuration may differ based on previous changes to the files. Common auth Edit /etc/pam.d/common-auth and ensure that faillock is configured. Note: It is critical to understand each line and the relevant arguments for successful implementation. The order of these entries is very specific. The pam_faillock.so lines surround the pam_unix.so line. The comment "Added to enable faillock" is shown to highlight the additional lines and their order in the file. # here are the per-package modules (the "Primary" block) auth required pam_faillock.so preauth # Added to enable faillock auth [success=1 default=ignore] pam_unix.so nullok auth [default=die] pam_faillock.so authfail # Added to enable faillock auth sufficient pam_faillock.so authsucc # Added to enable faillock # here''s the fallback if no module succeeds auth requisite pam_deny.so # prime the stack with a positive return value if there isn''t one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around auth required pam_permit.so # and here are more per-package modules (the "Additional" block) auth optional pam_cap.so # end of pam-auth-update config Common account Edit /etc/pam.d/common-account and ensure that the following stanza is at the end of the file. account required pam_faillock.so Fail lock configuration Edit /etc/security/faillock.conf and configure it per your site policy. Example: deny = 4 fail_interval = 900 unlock time = 600.' + compliance: + - cis: ["5.4.2"] + - cis_csc_v8: ["6.2"] + - cis_csc_v7: ["16.7"] + - cmmc_v2.0: ["AC.L1-3.1.1"] + - hipaa: ["164.308(a)(3)(ii)(C)"] + - iso_27001-2013: ["A.9.2.6"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1110", "T1110.001", "T1110.003"] + - nist_sp_800-53: ["AC-2(1)"] + - pci_dss_v3.2.1: ["8.1.3"] + - pci_dss_v4.0: ["8.2.4", "8.2.5"] + - soc_2: ["CC6.2", "CC6.3"] + condition: all + rules: + - 'f:/etc/pam.d/common-auth -> r:^\s*\t*auth\s*\t*required\s*\t*pam_faillock.so\s*\t*preauth' + - 'f:/etc/pam.d/common-auth -> r:^\s*\t*auth\s*\t*[default=die]\s*\t*pam_faillock.so\s*\t*authfail' + - 'f:/etc/pam.d/common-auth -> r:^\s*\t*auth\s*\t*sufficient\s*\t*pam_faillock.so\s*\t*authsucc' + - 'f:/etc/pam.d/common-account -> r:^\s*\t*account\s*\t*required\s*\t*pam_faillock.so' + - 'f:/etc/security/faillock.conf -> n:^\s*\t*deny\s*\t*=\s*\t*(\d+) compare <= 4' + - 'f:/etc/security/faillock.conf -> n:^\s*\t*fail_interval\s*\t*=\s*\t*(\d+) compare <= 900' + - 'not f:/etc/security/faillock.conf -> n:^\s*\t*unlock_time\s*\t*=\s*\t*(\d+) compare < 600 && n:^\s*\t*unlock_time\s*\t*=\s*\t*(\d+) compare > 0' + + # 5.4.3 Ensure password reuse is limited. (Automated) + - id: 28663 + title: "Ensure password reuse is limited." + description: "The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords." + rationale: "Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password." + remediation: "NOTE: Pay special attention to the configuration. Incorrect configuration can cause system lock outs. This is example configuration. You configuration may differ based on previous changes to the files. Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown: password [success=1 default=ignore] pam_unix.so obscure use_authtok try_first_pass yescrypt remember=5." + compliance: + - cis: ["5.4.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.004"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/pam.d/common-password -> r:^\s*\t*password\s*\t*[success=1\s*\t*default=ignore]\s*\t*pam_unix.so\s*\t*obscure' + - 'f:/etc/pam.d/common-password -> n:^\s*\t*use_authtok\s*\t*try_first_pass\s*\t*yescrypt\s*\t*remember=(\d+) compare >= 5' + + # 5.4.4 Ensure password hashing algorithm is up to date with the latest standards. (Automated) + - id: 28664 + title: "Ensure password hashing algorithm is up to date with the latest standards." + description: "The commands below change password encryption to yescrypt. All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm." + rationale: "The yescrypt algorithm provides much stronger hashing than previous available algorithms, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords. Note: these change only apply to accounts configured on the local system." + remediation: "NOTE: Pay special attention to the configuration. Incorrect configuration can cause system lock outs. This is example configuration. You configuration may differ based on previous changes to the files. PAM Edit the /etc/pam.d/common-password file and ensure that no hashing algorithm option for pam_unix.so is set: password try_first_pass remember=5 [success=1 default=ignore] pam_unix.so obscure use_authtok Login definitions Edit /etc/login.defs and ensure that ENCRYPT_METHOD is set to yescrypt." + compliance: + - cis: ["5.4.4"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1041"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1003", "T1003.008", "T1110", "T1110.002"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'not f:/etc/pam.d/common-password -> !r:^\s*\t*# && r:yescrypt|md5|bigcrypt|sha256|sha512|blowfish' + - 'f:/etc/login.defs -> r:^\s*\t*ENCRYPT_METHOD\s*\t*yescrypt' + + # 5.4.5 Ensure all current passwords uses the configured hashing algorithm (Manual) - Not implemented + + # 5.5.1.1 Ensure minimum days between password changes is configured. (Automated) + - id: 28665 + title: "Ensure minimum days between password changes is configured." + description: "The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days." + rationale: "By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls." + remediation: "Set the PASS_MIN_DAYS parameter to 1 in /etc/login.defs : PASS_MIN_DAYS 1 Modify user parameters for all users with a password set to match: # chage --mindays 1 ." + compliance: + - cis: ["5.5.1.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.004"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MIN_DAYS^\s*\t*(\d+) compare >=1' + - 'f:/etc/shadow -> !r:^\w+:\p: && n:^\w+:\S*:\d*:(\d+): compare < 1' + + # 5.5.1.2 Ensure password expiration is 365 days or less. (Automated) + - id: 28666 + title: "Ensure password expiration is 365 days or less." + description: "The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age." + rationale: "The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity. It is recommended that the PASS_MAX_DAYS parameter does not exceed 365 days and is greater than the value of PASS_MIN_DAYS." + remediation: "Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs : PASS_MAX_DAYS 365 Modify user parameters for all users with a password set to match: # chage --maxdays 365 ." + references: + - "https://www.cisecurity.org/white-papers/cis-password-policy-guide/" + compliance: + - cis: ["5.5.1.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.002", "T1078.003", "T1078.004", "T1110", "T1110.001", "T1110.002", "T1110.003", "T1110.004"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_MAX_DAYS\s*\t*(\d+) compare <= 365' + - 'f:/etc/shadow -> !r:^\w+:\p: && n:^\w+:\S*:\d*:\d*:(\d+) compare <= 365' + + # 5.5.1.3 Ensure password expiration warning days is 7 or more. (Automated) + - id: 28667 + title: "Ensure password expiration warning days is 7 or more." + description: "The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days." + rationale: "Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered." + remediation: "Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs : PASS_WARN_AGE 7 Modify user parameters for all users with a password set to match: # chage --warndays 7 ." + compliance: + - cis: ["5.5.1.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0006"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'f:/etc/login.defs -> n:^\s*\t*PASS_WARN_AGE\s*\t*(\d+) compare >= 7' + - 'f:/etc/shadow -> !r:^\w+:\p: && n:^\w+:\S*:\d*:\d*:\d+:(\d+): compare >= 7' + + # 5.5.1.4 Ensure inactive password lock is 30 days or less. (Automated) + - id: 28668 + title: "Ensure inactive password lock is 30 days or less." + description: "User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled." + rationale: "Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies." + remediation: "Run the following command to set the default password inactivity period to 30 days: # useradd -D -f 30 Modify user parameters for all users with a password set to match: # chage --inactive 30 ." + compliance: + - cis: ["5.5.1.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1078", "T1078.002", "T1078.003"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare >= 30' + - 'c:useradd -D -> n:^INACTIVE=(\d+) compare == 0' + - "c:useradd -D -> r:^INACTIVE=-1" + - 'f:/etc/shadow -> !r:^\w+:\p: && n:^\w+:\S*:\d*:\d*:\d+:\d+:(\d+) compare > 30' + + # 5.5.1.5 Ensure all users last password change date is in the past (Automated) -Not implemented + # 5.5.2 Ensure system accounts are secured (Automated) - Not implemented + + # 5.5.3 Ensure default group for the root account is GID 0. (Automated) + - id: 28669 + title: "Ensure default group for the root account is GID 0." + description: "The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user." + rationale: "Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users." + remediation: "Run the following command to set the root user default group to GID 0 : # usermod -g 0 root." + compliance: + - cis: ["5.5.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1548"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'f:/etc/passwd -> r:^root:\S*:\S*:0:' + + # 5.5.4 Ensure default user umask is 027 or more restrictive (Automated) - Not implemented + # 5.5.5 Ensure default user shell timeout is 900 seconds or less (Automated) - Not implemented + + # 6.1.1 Ensure permissions on /etc/passwd are configured. (Automated) + - id: 28670 + title: "Ensure permissions on /etc/passwd are configured." + description: "The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate." + rationale: "It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd: # chown root:root /etc/passwd # chmod u-x,go-wx /etc/passwd." + compliance: + - cis: ["6.1.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/passwd -> r:Access:\s*\(0644/-rw-r--r--\)\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.2 Ensure permissions on /etc/passwd- are configured. (Automated) + - id: 28671 + title: "Ensure permissions on /etc/passwd- are configured." + description: "The /etc/passwd- file contains backup user account information." + rationale: "It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/passwd- : # chown root:root /etc/passwd- # chmod u-x,go-wx /etc/passwd-." + compliance: + - cis: ["6.1.2"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/passwd- -> r:-rw-\.--\.-- && r:Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.3 Ensure permissions on /etc/group are configured. (Automated) + - id: 28672 + title: "Ensure permissions on /etc/group are configured." + description: "The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else." + rationale: "The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs." + remediation: "Run the following command to set permissions on /etc/group : # chown root:root /etc/group # chmod u-x,go-wx /etc/group." + compliance: + - cis: ["6.1.3"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/group -> r:^Access:\s*\(0644/-rw-r--r--\) && r:\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.4 Ensure permissions on /etc/group- are configured. (Automated) + - id: 28673 + title: "Ensure permissions on /etc/group- are configured." + description: "The /etc/group- file contains a backup list of all the valid groups defined in the system." + rationale: "It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run the following command to set permissions on /etc/group- : # chown root:root /etc/group- # chmod u-x,go-wx /etc/group-." + compliance: + - cis: ["6.1.4"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'c:stat /etc/group- -> r:-rw-\.--\.-- && r:Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + + # 6.1.5 Ensure permissions on /etc/shadow are configured. (Automated) + - id: 28674 + title: "Ensure permissions on /etc/shadow are configured." + description: "The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts." + remediation: "Run one of the following commands to set ownership of /etc/shadow to root and group to either root or shadow: # chown root:root /etc/shadow # chown root:shadow /etc/shadow Run the following command to remove excess permissions form /etc/shadow: # chmod u-x,g-wx,o-rwx /etc/shadow." + compliance: + - cis: ["6.1.5"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'c:stat /etc/shadow -> r:^Access:\s*\(0640/-rw-r-----\)|Access:\s*\(0600/-rw-------\) && r:\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat /etc/shadow -> r:^Access:\s*\(0640/-rw-r-----\)|Access:\s*\(0600/-rw-------\) && r:\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + # 6.1.6 Ensure permissions on /etc/shadow- are configured. (Automated) + - id: 28675 + title: "Ensure permissions on /etc/shadow- are configured." + description: "The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run one of the following commands to set ownership of /etc/shadow- to root and group to either root or shadow: # chown root:root /etc/shadow- # chown root:shadow /etc/shadow- Run the following command to remove excess permissions form /etc/shadow-: # chmod u-x,g-wx,o-rwx /etc/shadow-." + compliance: + - cis: ["6.1.6"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'c:stat /etc/shadow- -> r:^Access:\s*\(0640/-rw-r-----\)|Access:\s*\(0600/-rw-------\) && r:\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat /etc/shadow- -> r:^Access:\s*\(0640/-rw-r-----\)|Access:\s*\(0600/-rw-------\) && r:\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + # 6.1.7 Ensure permissions on /etc/gshadow are configured. (Automated) + - id: 28676 + title: "Ensure permissions on /etc/gshadow are configured." + description: "The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group." + remediation: "Run one of the following commands to set ownership of /etc/gshadow to root and group to either root or shadow: # chown root:root /etc/gshadow # chown root:shadow /etc/gshadow Run the following command to remove excess permissions form /etc/gshadow: # chmod u-x,g-wx,o-rwx /etc/gshadow." + compliance: + - cis: ["6.1.7"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'c:stat /etc/gshadow -> r:^Access:\s*\(0640/-rw-r-----\)|Access:\s*\(0600/-rw-------\) && r:\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat /etc/gshadow -> r:^Access:\s*\(0640/-rw-r-----\)|Access:\s*\(0600/-rw-------\) && r:\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + # 6.1.8 Ensure permissions on /etc/gshadow- are configured. (Automated) + - id: 28677 + title: "Ensure permissions on /etc/gshadow- are configured." + description: "The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information." + rationale: "It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions." + remediation: "Run one of the following commands to set ownership of /etc/gshadow- to root and group to either root or shadow: # chown root:root /etc/gshadow- # chown root:shadow /etc/gshadow- Run the following command to remove excess permissions form /etc/gshadow-: # chmod u-x,g-wx,o-rwx /etc/gshadow-." + compliance: + - cis: ["6.1.8"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - mitre_mitigations: ["M1022"] + - mitre_tactics: ["TA0005"] + - mitre_techniques: ["T1003", "T1003.008", "T1222", "T1222.002"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'c:stat /etc/gshadow- -> r:^Access:\s*\(0640/-rw-r-----\)|Access:\s*\(0600/-rw-------\) && r:\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*0/\s*\t*root\)' + - 'c:stat /etc/gshadow- -> r:^Access:\s*\(0640/-rw-r-----\)|Access:\s*\(0600/-rw-------\) && r:\s*Uid:\s*\(\s*\t*0/\s*\t*root\)\s*\t*Gid:\s*\(\s*\t*\d+/\s*\t*shadow\)' + + # 6.1.9 Ensure no world writable files exist (Automated) - Not implemented + # 6.1.10 Ensure no unowned files or directories exist (Automated) - Not implemented + # 6.1.11 Ensure no ungrouped files or directories exist (Automated) - Not implemented + # 6.1.12 Audit SUID executables (Manual) - Not implemented + # 6.1.13 Audit SGID executables (Manual) - Not implemented + + # 6.2.1 Ensure accounts in /etc/passwd use shadowed passwords. (Automated) + - id: 28678 + title: "Ensure accounts in /etc/passwd use shadowed passwords." + description: "Local accounts can uses shadowed passwords. With shadowed passwords, The passwords are saved in shadow password file, /etc/shadow, encrypted by a salted one-way hash. Accounts with a shadowed password have an x in the second field in /etc/passwd." + rationale: "The /etc/passwd file also contains information like user ID's and group ID's that are used by many system programs. Therefore, the /etc/passwd file must remain world readable. In spite of encoding the password with a randomly-generated one-way hash function, an attacker could still break the system if they got access to the /etc/passwd file. This can be mitigated by using shadowed passwords, thus moving the passwords in the /etc/passwd file to /etc/shadow. The /etc/shadow file is set so only root will be able to read and write. This helps mitigate the risk of an attacker gaining access to the encoded passwords with which to perform a dictionary attack. Note: - All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user. - A user account with an empty second field in /etc/passwd allows the account to be logged into by providing only the username." + remediation: "Run the following command to set accounts to use shadowed passwords: # sed -e 's/^\\([a-zA-Z0-9_]*\\):[^:]*:/\\1:x:/' -i /etc/passwd Investigate to determine if the account is logged in and what it is being used for, to determine if it needs to be forced off." + compliance: + - cis: ["6.2.1"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1003", "T1003.008"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^\w+:x:' + + # 6.2.2 Ensure /etc/shadow password fields are not empty. (Automated) + - id: 28679 + title: "Ensure /etc/shadow password fields are not empty." + description: "An account with an empty password field means that anybody may log in as that user without providing a password." + rationale: "All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user." + remediation: "If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password: # passwd -l Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off." + compliance: + - cis: ["6.2.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1078", "T1078.001", "T1078.003"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: none + rules: + - 'f:/etc/shadow -> r:^\w+::' + + # 6.2.3 Ensure all groups in /etc/passwd exist in /etc/group. (Automated) + - id: 28680 + title: "Ensure all groups in /etc/passwd exist in /etc/group." + description: "Over time, system administration errors and changes can lead to groups being defined in /etc/passwd but not in /etc/group." + rationale: "Groups defined in the /etc/passwd file but not in the /etc/group file pose a threat to system security since group permissions are not properly managed." + remediation: "Analyze the output of the Audit step above and perform the appropriate action to correct any discrepancies found." + compliance: + - cis: ["6.2.3"] + - mitre_mitigations: ["M1027"] + - mitre_tactics: ["TA0003"] + - mitre_techniques: ["T1222", "T1222.002"] + condition: all + rules: + - 'f:/etc/group -> !r:^# && r:shadow:\w*:\d+:$' + + # 6.2.5 Ensure no duplicate UIDs exist (Automated) - Not implemented + # 6.2.6 Ensure no duplicate GIDs exist (Automated) - Not implemented + # 6.2.7 Ensure no duplicate user names exist (Automated) - Not implemented + # 6.2.8 Ensure no duplicate group names exist (Automated) - Not implemented + # 6.2.9 Ensure root PATH Integrity (Automated) - Not implemented + + # 6.2.10 Ensure root is the only UID 0 account. (Automated) + - id: 28681 + title: "Ensure root is the only UID 0 account." + description: "Any account with UID 0 has superuser privileges on the system." + rationale: "This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted." + remediation: "Remove any users other than root with UID 0 or assign them a new UID if appropriate." + compliance: + - cis: ["6.2.10"] + - mitre_mitigations: ["M1026"] + - mitre_tactics: ["TA0001"] + - mitre_techniques: ["T1548"] + condition: none + rules: + - 'f:/etc/passwd -> !r:^# && !r:^root: && r:^\w+:\w+:0:' + + # 6.2.11 Ensure local interactive user home directories exist (Automated) - Not implemented + # 6.2.12 Ensure local interactive users own their home directories (Automated) - Not implemented + # 6.2.13 Ensure local interactive user home directories are mode 750 or more restrictive (Automated) - Not implemented + # 6.2.14 Ensure no local interactive user has .netrc files (Automated) - Not implemented + # 6.2.15 Ensure no local interactive user has .forward files (Automated) - Not implemented + # 6.2.16 Ensure no local interactive user has .rhosts files (Automated) - Not implemented + # 6.2.17 Ensure local interactive user dot files are not group or world writable (Automated) - Not implemented diff --git a/etc/ruleset/sca/windows/cis_win10_enterprise.yml b/etc/ruleset/sca/windows/cis_win10_enterprise.yml new file mode 100644 index 0000000000..f776577b26 --- /dev/null +++ b/etc/ruleset/sca/windows/cis_win10_enterprise.yml @@ -0,0 +1,6085 @@ +# Security Configuration Assessment +# CIS Checks for Windows 10 Enterprise +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# CIS Microsoft Windows 10 Enterprise (Release 21H2) Benchmark v1.12.0 - 02-15-2022 + +policy: + id: "cis_win10_enterprise" + file: "cis_win10_enterprise.yml" + name: "CIS Microsoft Windows 10 Enterprise Benchmark v1.12.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows 10 Enterprise." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform is Windows 10" + description: "Requirements for running the CIS benchmark Domain Controller under Windows 10" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows 10' + +checks: + # 1.1 Password Policy + - id: 15500 + title: "Ensure 'Enforce password history' is set to '24 or more password(s)'." + description: "This policy setting determines the number of renewed, unique passwords that have to be associated with a user account before you can reuse an old password. The value for this policy setting must be between 0 and 24 passwords. The default value for Windows Vista is 0 passwords, but the default setting in a domain is 24 passwords. To maintain the effectiveness of this policy setting, use the Minimum password age setting to prevent users from repeatedly changing their password. The recommended state for this setting is: 24 or more password(s). Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center. Note #2: As of the publication of this benchmark, Microsoft currently has a maximum limit of 24 saved passwords. For more information, please visit Enforce password history (Windows 10) - Windows security | Microsoft Docs" + rationale: "The longer a user uses the same password, the greater the chance that an attacker can determine the password through brute force attacks. Also, any accounts that may have been compromised will remain exploitable for as long as the password is left unchanged. If password changes are required but password reuse is not prevented, or if users continually reuse a small number of passwords, the effectiveness of a good password policy is greatly reduced. If you specify a low number for this policy setting, users will be able to use the same small number of passwords repeatedly. If you do not also configure the Minimum password age setting, users might repeatedly change their passwords until they can reuse their original password." + remediation: "To establish the recommended configuration via GP, set the following UI path to 24 or more password(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Enforce password history" + compliance: + - cis: ["1.1.1"] + - cis_csc: ["5.2"] + condition: all + rules: + - 'c:net.exe accounts -> n:Length of password history maintained:\s+(\d+) compare >= 24' + + - id: 15501 + title: "Ensure 'Maximum password age' is set to '365 or fewer days, but not 0'." + description: "This policy setting defines how long a user can use their password before it expires. Values for this policy setting range from 0 to 999 days. If you set the value to 0, the password will never expire. Because attackers can crack passwords, the more frequently you change the password the less opportunity an attacker has to use a cracked password. However, the lower this value is set, the higher the potential for an increase in calls to help desk support due to users having to change their password or forgetting which password is current. The recommended state for this setting is 365 or fewer days, but not 0. Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "The longer a password exists the higher the likelihood that it will be compromised by a brute force attack, by an attacker gaining general knowledge about the user, or by the user sharing the password. Configuring the Maximum password age setting to 0 so that users are never required to change their passwords is a major security risk because that allows a compromised password to be used by the malicious user for as long as the valid user has authorized access." + remediation: "To establish the recommended configuration via GP, set the following UI path to 365 or fewer days, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Maximum password age" + compliance: + - cis: ["1.1.2"] + - cis_csc: ["5.2"] + condition: all + rules: + - 'c:net.exe accounts -> n:Maximum password age \(days\):\s+(\d+) compare <= 365' + - 'c:net.exe accounts -> n:Maximum password age \(days\):\s+(\d+) compare > 0' + + - id: 15502 + title: "Ensure 'Minimum password age' is set to '1 or more day(s)'." + description: "This policy setting determines the number of days that you must use a password before you can change it. The range of values for this policy setting is between 1 and 999 days. (You may also set the value to 0 to allow immediate password changes.) The default value for this setting is 0 days. The recommended state for this setting is: 1 or more day(s)). Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "Users may have favorite passwords that they like to use because they are easy to remember and they believe that their password choice is secure from compromise. Unfortunately, passwords are compromised and if an attacker is targeting a specific individual's user account, with foreknowledge of data about that user, reuse of old passwords can cause a security breach. To address password reuse a combination of security settings is required. Using this policy setting with the Enforce password history setting prevents the easy reuse of old passwords. For example, if you configure the Enforce password history setting to ensure that users cannot reuse any of their last 12 passwords, they could change their password 13 times in a few minutes and reuse the password they started with, unless you also configure the Minimum password age setting to a number that is greater than 0. You must configure this policy setting to a number that is greater than 0 for the Enforce password history setting to be effective." + remediation: "To establish the recommended configuration via GP, set the following UI path to 1 or more day(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Minimum password age" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["5.2"] + condition: all + rules: + - 'c:net.exe accounts -> n:Minimum password age \(days\):\s+(\d+) compare >= 1' + + - id: 15503 + title: "Ensure 'Minimum password length' is set to '14 or more character(s)'." + description: "This policy setting determines the least number of characters that make up a password for a user account. There are many different theories about how to determine the best password length for an organization, but perhaps 'passphrase' is a better term than 'password.' In Microsoft Windows 2000 and newer, passphrases can be quite long and can include spaces. Therefore, a phrase such as 'I want to drink a $5 milkshake' is a valid passphrase; it is a considerably stronger password than an 8 or 10 character string of random numbers and letters, and yet is easier to remember. Users must be educated about the proper selection and maintenance of passwords, especially with regard to password length. In enterprise environments, the ideal value for the Minimum password length setting is 14 characters, however you should adjust this value to meet your organization's business requirements. The recommended state for this setting is: 14 or more character(s). Note: In Windows Server 2016 and older versions of Windows Server, the GUI of the Local Security Policy (LSP), Local Group Policy Editor (LGPE) and Group Policy Management Editor (GPME) would not let you set this value higher than 14 characters. However, starting with Windows Server 2019, Microsoft changed the GUI to allow up to a 20 character minimum password length. Note #2: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "Types of password attacks include dictionary attacks (which attempt to use common words and phrases) and brute force attacks (which try every possible combination of characters). Also, attackers sometimes try to obtain the account database so they can use tools to discover the accounts and passwords." + remediation: "To establish the recommended configuration via GP, set the following UI path to 14 or more character(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Minimum password length" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.2"] + condition: all + rules: + - 'c:net.exe accounts -> n:Minimum password length:\s+(\d+) compare >= 14' + + - id: 15505 + title: "Ensure 'Relax minimum password length limits' is set to 'Enabled'." + description: "This policy setting determines whether the minimum password length setting can be increased beyond the legacy limit of 14 characters. For more information please see the following Microsoft Security Blog. The recommended state for this setting is: Enabled. Note: This setting only affects local accounts on the computer. Domain accounts are only affected by settings on the Domain Controllers, because that is where domain accounts are stored." + rationale: "This setting will enable the enforcement of longer and generally stronger passwords or passphrases where MFA is not in use." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Relax minimum password length limits. Note: This setting is only available within the built-in OS security template of Windows 10 Release 2004 and Server 2022 (or newer), and is not available via older versions of the OS, or via downloadable Administrative Templates (ADMX/ADML). Therefore, you must use a Windows 10 Release 2004 or Server 2022 system (or newer) to view or edit this setting with the Group Policy Management Console (GPMC) or Group Policy Management Editor (GPME)." + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SAM' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SAM -> RelaxMinimumPasswordLengthLimits' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SAM -> RelaxMinimumPasswordLengthLimits -> 1' + + - id: 15506 + title: "Ensure 'Account lockout duration' is set to '15 or more minute(s)'." + description: "This policy setting determines the length of time that must pass before a locked account is unlocked and a user can try to log on again. The setting does this by specifying the number of minutes a locked out account will remain unavailable. If the value for this policy setting is configured to 0, locked out accounts will remain locked out until an administrator manually unlocks them. Although it might seem like a good idea to configure the value for this policy setting to a high value, such a configuration will likely increase the number of calls that the help desk receives to unlock accounts locked by mistake. Users should be aware of the length of time a lock remains in place, so that they realize they only need to call the help desk if they have an extremely urgent need to regain access to their computer. The recommended state for this setting is: 15 or more minute(s). Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "A denial of service (DoS) condition can be created if an attacker abuses the Account lockout threshold and repeatedly attempts to log on with a specific account. Once you configure the Account lockout threshold setting, the account will be locked out after the specified number of failed attempts. If you configure the Account lockout duration setting to 0, then the account will remain locked out until an administrator unlocks it manually." + remediation: "To establish the recommended configuration via GP, set the following UI path to 15 or more minute(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Account Lockout Policy\\Account lockout duration" + compliance: + - cis: ["1.2.1"] + - cis_csc: ["4.10"] + condition: all + rules: + - 'c:net.exe accounts -> n:Lockout duration \(minutes\):\s+(\d+) compare >= 15' + + - id: 15507 + title: "Ensure 'Account lockout threshold' is set to '5 or fewer invalid logon attempt(s), but not 0'." + description: "This policy setting determines the number of failed logon attempts before the account is locked. Setting this policy to 0 does not conform to the benchmark as doing so disables the account lockout threshold. The recommended state for this setting is: 5 or fewer invalid logon attempt(s), but not 0. Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "Setting an account lockout threshold reduces the likelihood that an online password brute force attack will be successful. Setting the account lockout threshold too low introduces risk of increased accidental lockouts and/or a malicious actor intentionally locking out accounts." + remediation: "To establish the recommended configuration via GP, set the following UI path to 5 or fewer invalid login attempt(s), but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Account Lockout Policy\\Account lockout threshold" + compliance: + - cis: ["1.2.2"] + - cis_csc: ["4.10"] + condition: all + rules: + - 'c:net.exe accounts -> n:Lockout threshold:\s+(\d+) compare > 0' + - 'c:net.exe accounts -> n:Lockout threshold:\s+(\d+) compare <= 5' + + - id: 15508 + title: "Ensure 'Reset account lockout counter after' is set to '15 or more minute(s)'." + description: "This policy setting determines the length of time before the Account lockout threshold resets to zero. The default value for this policy setting is Not Defined. If the Account lockout threshold is defined, this reset time must be less than or equal to the value for the Account lockout duration setting. If you leave this policy setting at its default value or configure the value to an interval that is too long, your environment could be vulnerable to a DoS attack. An attacker could maliciously perform a number of failed logon attempts on all users in the organization, which will lock out their accounts. If no policy were determined to reset the account lockout, it would be a manual task for administrators. Conversely, if a reasonable time value is configured for this policy setting, users would be locked out for a set period until all of the accounts are unlocked automatically. The recommended state for this setting is: 15 or more minute(s). Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "Users can accidentally lock themselves out of their accounts if they mistype their password multiple times. To reduce the chance of such accidental lockouts, the Reset account lockout counter after setting determines the number of minutes that must elapse before the counter that tracks failed logon attempts and triggers lockouts is reset to 0." + remediation: "To establish the recommended configuration via GP, set the following UI path to 15 or more minute(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Account Lockout Policy\\Reset account lockout counter after" + compliance: + - cis: ["1.2.3"] + - cis_csc: ["4.10"] + condition: all + rules: + - 'c:net.exe accounts -> n:Lockout observation window \(minutes\):\s+(\d+) compare >= 15' + + - id: 15509 + title: "Ensure 'Accounts: Administrator account status' is set to 'Disabled'." + description: "This policy setting enables or disables the Administrator account during normal operation. When a computer is booted into safe mode, the Administrator account is always enabled, regardless of how this setting is configured. Note that this setting will have no impact when applied to the Domain Controllers organizational unit via group policy because Domain Controllers have no local account database. It can be configured at the domain level via group policy, similar to account lockout and password policy settings. The recommended state for this setting is: Disabled." + rationale: "In some organizations, it can be a daunting management challenge to maintain a regular schedule for periodic password changes for local accounts. Therefore, you may want to disable the built-in Administrator account instead of relying on regular password changes to protect it from attack. Another reason to disable this built-in account is that it cannot be locked out no matter how many failed logons it accrues, which makes it a prime target for brute force attacks that attempt to guess passwords. Also, this account has a well-known security identifier (SID) and there are third-party tools that allow authentication by using the SID rather than the account name. This capability means that even if you rename the Administrator account, an attacker could launch a brute force attack by using the SID to log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Administrator account status" + compliance: + - cis: ["2.3.1.1"] + - cis_csc: ["4.7"] + condition: any + rules: + - 'c:net user administrator -> r:Account active\s+No' + - "c:net user administrator -> r:The user name could not be found." + + - id: 15510 + title: "Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts'." + description: "This policy setting prevents users from adding new Microsoft accounts on this computer. The recommended state for this setting is: Users can't add or log on with Microsoft accounts." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used to log onto their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + remediation: "To establish the recommended configuration via GP, set the following UI path to Users can't add or log on with Microsoft accounts: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Block Microsoft accounts" + compliance: + - cis: ["2.3.1.2"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> 3' + + - id: 15511 + title: "Ensure 'Accounts: Guest account status' is set to 'Disabled'." + description: "This policy setting determines whether the Guest account is enabled or disabled. The Guest account allows unauthenticated network users to gain access to the system. The recommended state for this setting is: Disabled. Note: This setting will have no impact when applied to the Domain Controllers organizational unit via group policy because Domain Controllers have no local account database. It can be configured at the domain level via group policy, similar to account lockout and password policy settings." + rationale: "The default Guest account allows unauthenticated network users to log on as Guest with no password. These unauthorized users could access any resources that are accessible to the Guest account over the network. This capability means that any network shares with permissions that allow access to the Guest account, the Guests group, or the Everyone group will be accessible over the network, which could lead to the exposure or corruption of data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Guest account status" + compliance: + - cis: ["2.3.1.3"] + - cis_csc: ["4.7"] + condition: all + rules: + - 'c:net user guest -> r:Account active\s+No' + + - id: 15512 + title: "Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'." + description: "This policy setting determines whether local accounts that are not password protected can be used to log on from locations other than the physical computer console. If you enable this policy setting, local accounts that have blank passwords will not be able to log on to the network from remote client computers. Such accounts will only be able to log on at the keyboard of the computer. The recommended state for this setting is: Enabled." + rationale: "Blank passwords are a serious threat to computer security and should be forbidden through both organizational policy and suitable technical measures. In fact, the default settings for Active Directory domains require complex passwords of at least seven characters. However, if users with the ability to create new accounts bypass your domain-based password policies, they could create accounts with blank passwords. For example, a user could build a stand-alone computer, create one or more accounts with blank passwords, and then join the computer to the domain. The local accounts with blank passwords would still function. Anyone who knows the name of one of these unprotected accounts could then use it to log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Limit local account use of blank passwords to console logon only" + compliance: + - cis: ["2.3.1.4"] + - cis_csc: ["5.2"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse -> 1' + + - id: 15513 + title: "Configure 'Accounts: Rename administrator account'." + description: "The built-in local administrator account is a well-known account name that attackers will target. It is recommended to choose another name for this account, and to avoid names that denote administrative or elevated access accounts. Be sure to also change the default description for the local administrator (through the Computer Management console)." + rationale: "The Administrator account exists on all computers that run the Windows 2000 or newer operating systems. If you rename this account, it is slightly more difficult for unauthorized persons to guess this privileged user name and password combination. The built-in Administrator account cannot be locked out, regardless of how many times an attacker might use a bad password. This capability makes the Administrator account a popular target for brute force attacks that attempt to guess passwords. The value of this countermeasure is lessened because this account has a well-known SID, and there are third-party tools that allow authentication by using the SID rather than the account name. Therefore, even if you rename the Administrator account, an attacker could launch a brute force attack by using the SID to log on." + remediation: "To establish the recommended configuration via GP, configure the following UI path: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Rename administrator account" + compliance: + - cis: ["2.3.1.5"] + - cis_csc: ["4.7"] + condition: all + rules: + - "c:net user administrator -> r:The user name could not be found." + + - id: 15514 + title: "Configure 'Accounts: Rename guest account'." + description: "The built-in local guest account is another well-known name to attackers. It is recommended to rename this account to something that does not indicate its purpose. Even if you disable this account, which is recommended, ensure that you rename it for added security." + rationale: "The Guest account exists on all computers that run the Windows 2000 or newer operating systems. If you rename this account, it is slightly more difficult for unauthorized persons to guess this privileged user name and password combination." + remediation: "To establish the recommended configuration via GP, configure the following UI path: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Rename guest account" + compliance: + - cis: ["2.3.1.6"] + - cis_csc: ["4.7"] + condition: all + rules: + - "c:net user guest -> r:The user name could not be found." + + - id: 15515 + title: "Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'." + description: "This policy setting allows administrators to enable the more precise auditing capabilities present in Windows Vista. The Audit Policy settings available in Windows Server 2003 Active Directory do not yet contain settings for managing the new auditing subcategories. To properly apply the auditing policies prescribed in this baseline, the Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings setting needs to be configured to Enabled. The recommended state for this setting is: Enabled. Important: Be very cautious about audit settings that can generate a large volume of traffic. For example, if you enable either success or failure auditing for all of the Privilege Use subcategories, the high volume of audit events generated can make it difficult to find other types of entries in the Security log. Such a configuration could also have a significant impact on system performance." + rationale: "Prior to the introduction of auditing subcategories in Windows Vista, it was difficult to track events at a per-system or per-user level. The larger event categories created too many events and the key information that needed to be audited was difficult to find." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings" + compliance: + - cis: ["2.3.2.1"] + - cis_csc: ["8.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy -> 1' + + - id: 15516 + title: "Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'." + description: "This policy setting determines whether the system shuts down if it is unable to log Security events. It is a requirement for Trusted Computer System Evaluation Criteria (TCSEC)-C2 and Common Criteria certification to prevent auditable events from occurring if the audit system is unable to log them. Microsoft has chosen to meet this requirement by halting the system and displaying a stop message if the auditing system experiences a failure. When this policy setting is enabled, the system will be shut down if a security audit cannot be logged for any reason. If the Audit: Shut down system immediately if unable to log security audits setting is enabled, unplanned system failures can occur. The administrative burden can be significant, especially if you also configure the Retention method for the Security log to Do not overwrite events (clear log manually). This configuration causes a repudiation threat (a backup operator could deny that they backed up or restored data) to become a denial of service (DoS) vulnerability, because a server could be forced to shut down if it is overwhelmed with logon events and other security events that are written to the Security log. Also, because the shutdown is not graceful, it is possible that irreparable damage to the operating system, applications, or data could result. Although the NTFS file system guarantees its integrity when an ungraceful computer shutdown occurs, it cannot guarantee that every data file for every application will still be in a usable form when the computer restarts. The recommended state for this setting is: Disabled." + rationale: "If the computer is unable to record events to the Security log, critical evidence or important troubleshooting information may not be available for review after a security incident. Also, an attacker could potentially generate a large volume of Security log events to purposely force a computer shutdown." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Shut down system immediately if unable to log security audits" + compliance: + - cis: ["2.3.2.2"] + - cis_csc: ["8.3"] + - pci_dss: ["10.7"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 0' + + - id: 15517 + title: "Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators and Interactive Users'." + description: "This policy setting determines who is allowed to format and eject removable NTFS media. You can use this policy setting to prevent unauthorized users from removing data on one computer to access it on another computer on which they have local administrator privileges. The recommended state for this setting is: Administrators and Interactive Users." + rationale: "Users may be able to move data on removable disks to a different computer where they have administrative privileges. The user could then take ownership of any file, grant themselves full control, and view or modify any file. The fact that most removable storage devices will eject media by pressing a mechanical button diminishes the advantage of this policy setting." + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators and Interactive Users: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Allowed to format and eject removable media" + compliance: + - cis: ["2.3.4.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD -> 2' + + - id: 15518 + title: "Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'." + description: "For a computer to print to a shared printer, the driver for that shared printer must be installed on the local computer. This security setting determines who is allowed to install a printer driver as part of connecting to a shared printer. The recommended state for this setting is: Enabled. Note: This setting does not affect the ability to add a local printer. This setting does not affect Administrators." + rationale: "It may be appropriate in some organizations to allow users to install printer drivers on their own workstations. However, in a high security environment, you should allow only Administrators, not users, to do this, because printer driver installation may unintentionally cause the computer to become less stable. A malicious user could install inappropriate printer drivers in a deliberate attempt to damage the computer, or a user might accidentally install malicious software that masquerades as a printer driver. It is feasible for an attacker to disguise a Trojan horse program as a printer driver. The program may appear to users as if they must use it to print, but such a program could unleash malicious code on your computer network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Prevent users from installing printer drivers" + compliance: + - cis: ["2.3.4.2"] + - pci_dss: ["2.2.4", "2.2.5"] + - nist_800_53: ["CM.1"] + - tsc: ["CC6.3", "CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> 1' + + - id: 15519 + title: "Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'." + description: "This policy setting determines whether all secure channel traffic that is initiated by the domain member must be signed or encrypted. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt or sign secure channel data (always)" + compliance: + - cis: ["2.3.6.1"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal -> 1' + + - id: 15520 + title: "Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'." + description: "This policy setting determines whether a domain member should attempt to negotiate encryption for all secure channel traffic that it initiates. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt secure channel data (when possible)" + compliance: + - cis: ["2.3.6.2"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel -> 1' + + - id: 15521 + title: "Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'." + description: "This policy setting determines whether a domain member should attempt to negotiate whether all secure channel traffic that it initiates must be digitally signed. Digital signatures protect the traffic from being modified by anyone who captures the data as it traverses the network. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally sign secure channel data (when possible)" + compliance: + - cis: ["2.3.6.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel -> 1' + + - id: 15522 + title: "Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'." + description: "This policy setting determines whether a domain member can periodically change its computer account password. Computers that cannot automatically change their account passwords are potentially vulnerable, because an attacker might be able to determine the password for the system's domain account. The recommended state for this setting is: Disabled. Note: Some problems can occur as a result of machine account password expiration, particularly if a machine is reverted to a previous point-in-time state, as is common with virtual machines. Depending on how far back the reversion is, the older machine account password stored on the machine may no longer be recognized by the domain controllers, and therefore the computer loses its domain trust. This can also disrupt non-persistent VDI implementations, and devices with write filters that disallow permanent changes to the OS volume. Some organizations may choose to exempt themselves from this recommendation and disable machine account password expiration for these situations." + rationale: "The default configuration for Windows Server 2003-based computers that belong to a domain is that they are automatically required to change the passwords for their accounts every 30 days. If you disable this policy setting, computers that run Windows Server 2003 will retain the same passwords as their computer accounts. Computers that are no longer able to automatically change their account password are at risk from an attacker who could determine the password for the computer's domain account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Disable machine account password changes" + compliance: + - cis: ["2.3.6.4"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange -> 0' + + - id: 15523 + title: "Ensure 'Domain member: Maximum machine account password age' is set to '30 or fewer days, but not 0'." + description: "This policy setting determines the maximum allowable age for a computer account password. By default, domain members automatically change their domain passwords every 30 days. If you increase this interval significantly so that the computers no longer change their passwords, an attacker would have more time to undertake a brute force attack against one of the computer accounts. The recommended state for this setting is: 30 or fewer days, but not 0. Note: A value of 0 does not conform to the benchmark as it disables maximum password age. Note #2: Some problems can occur as a result of machine account password expiration, particularly if a machine is reverted to a previous point-in-time state, as is common with virtual machines. Depending on how far back the reversion is, the older machine account password stored on the machine may no longer be recognized by the domain controllers, and therefore the computer loses its domain trust. This can also disrupt non-persistent VDI implementations, and devices with write filters that disallow permanent changes to the OS volume. Some organizations may choose to exempt themselves from this recommendation and disable machine account password expiration for these situations." + rationale: "In Active Directory-based domains, each computer has an account and password just like every user. By default, the domain members automatically change their domain password every 30 days. If you increase this interval significantly, or set it to 0 so that the computers no longer change their passwords, an attacker will have more time to undertake a brute force attack to guess the password of one or more computer accounts." + remediation: "To establish the recommended configuration via GP, set the following UI path to 30 or fewer days, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Maximum machine account password age" + compliance: + - cis: ["2.3.6.5"] + condition: all + rules: + - 'c:net.exe accounts -> n:Maximum password age (days):\s+(\d+) compare <= 30' + - 'c:net.exe accounts -> n:Maximum password age (days):\s+(\d+) compare > 0' + + - id: 15524 + title: "Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'." + description: "When this policy setting is enabled, a secure channel can only be established with Domain Controllers that are capable of encrypting secure channel data with a strong (128-bit) session key. To enable this policy setting, all Domain Controllers in the domain must be able to encrypt secure channel data with a strong key, which means all Domain Controllers must be running Microsoft Windows 2000 or newer. The recommended state for this setting is: Enabled." + rationale: "Session keys that are used to establish secure channel communications between Domain Controllers and member computers are much stronger in Windows 2000 than they were in previous Microsoft operating systems. Whenever possible, you should take advantage of these stronger session keys to help protect secure channel communications from attacks that attempt to hijack network sessions and eavesdropping. (Eavesdropping is a form of hacking in which network data is read or altered in transit. The data can be modified to hide or change the sender, or be redirected.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Require strong (Windows 2000 or later) session key" + compliance: + - cis: ["2.3.6.6"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey -> 1' + + - id: 15525 + title: "Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'." + description: "This policy setting determines whether users must press CTRL+ALT+DEL before they log on. The recommended state for this setting is: Disabled." + rationale: "Microsoft developed this feature to make it easier for users with certain types of physical impairments to log on to computers that run Windows. If users are not required to press CTRL+ALT+DEL, they are susceptible to attacks that attempt to intercept their passwords. If CTRL+ALT+DEL is required before logon, user passwords are communicated by means of a trusted path. An attacker could install a Trojan horse program that looks like the standard Windows logon dialog box and capture the user's password. The attacker would then be able to log on to the compromised account with whatever level of privilege that user has." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Do not require CTRL+ALT+DEL" + compliance: + - cis: ["2.3.7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD -> 0' + + - id: 15526 + title: "Ensure 'Interactive logon: Don't display last signed-in' is set to 'Enabled'." + description: "This policy setting determines whether the account name of the last user to log on to the client computers in your organization will be displayed in each computer's respective Windows logon screen. Enable this policy setting to prevent intruders from collecting account names visually from the screens of desktop or laptop computers in your organization. The recommended state for this setting is: Enabled." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Don't display last signed-in. Note: In older versions of Microsoft Windows, this setting was named Interactive logon: Do not display last user name, but it was renamed starting with Windows 10 Release 1703." + compliance: + - cis: ["2.3.7.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName -> 1' + + - id: 15527 + title: "Ensure 'Interactive logon: Machine account lockout threshold' is set to '10 or fewer invalid logon attempts, but not 0'." + description: "This security setting determines the number of failed logon attempts that causes the machine to be locked out. Failed password attempts against workstations or member servers that have been locked using either CTRL+ALT+DELETE or password protected screen savers counts as failed logon attempts. The machine lockout policy is enforced only on those machines that have BitLocker enabled for protecting OS volumes. Please ensure that appropriate recovery password backup policies are enabled. The recommended state for this setting is: 10 or fewer invalid logon attempts, but not 0. Note: A value of 0 does not conform to the benchmark as it disables the machine account lockout threshold. Values from 1 to 3 will be interpreted as 4." + rationale: "If a machine is lost or stolen, or if an insider threat attempts a brute force password attack against the computer, it is important to ensure that BitLocker will lock the computer and therefore prevent a successful attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to 10 or fewer invalid logon attempts, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Machine account lockout threshold" + compliance: + - cis: ["2.3.7.3"] + - cis_csc: ["4.10"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> MaxDevicePasswordFailedAttempts' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> MaxDevicePasswordFailedAttempts -> 0' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> MaxDevicePasswordFailedAttempts -> n:^(\d+) compare <=30' + + - id: 15528 + title: "Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'." + description: "Windows notices inactivity of a logon session, and if the amount of inactive time exceeds the inactivity limit, then the screen saver will run, locking the session. The recommended state for this setting is: 900 or fewer second(s), but not 0. Note: A value of 0 does not conform to the benchmark as it disables the machine inactivity limit." + rationale: "If a user forgets to lock their computer when they walk away it's possible that a passerby will hijack it." + remediation: "To establish the recommended configuration via GP, set the following UI path to 900 or fewer seconds, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Machine inactivity limit" + compliance: + - cis: ["2.3.7.4"] + - cis_csc: ["4.3"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 0' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> n:^(\d+) compare <= 900' + + - id: 15529 + title: "Configure 'Interactive logon: Message text for users attempting to log on'." + description: "This policy setting specifies a text message that displays to users when they log on. Set the following group policy to a value that is consistent with the security and operational requirements of your organization." + rationale: "Displaying a warning message before logon may help prevent an attack by warning the attacker about the consequences of their misconduct before it happens. It may also help to reinforce corporate policy by notifying employees of the appropriate policy during the logon process. This text is often used for legal reasons—for example, to warn users about the ramifications of misusing company information or to warn them that their actions may be audited. Note: Any warning that you display should first be approved by your organization's legal and human resources representatives." + remediation: "To establish the recommended configuration via GP, configure the following UI path to a value that is consistent with the security and operational requirements of your organization: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Message text for users attempting to log on" + compliance: + - cis: ["2.3.7.5"] + condition: all + rules: + - 'not c:reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v legalnoticetext -> r:\s+legalnoticetext\s+REG_SZ\s+$' + + - id: 15530 + title: "Configure 'Interactive logon: Message title for users attempting to log on'." + description: "This policy setting specifies the text displayed in the title bar of the window that users see when they log on to the system. Configure this setting in a manner that is consistent with the security and operational requirements of your organization." + rationale: "Displaying a warning message before logon may help prevent an attack by warning the attacker about the consequences of their misconduct before it happens. It may also help to reinforce corporate policy by notifying employees of the appropriate policy during the logon process." + remediation: "To establish the recommended configuration via GP, configure the following UI path to a value that is consistent with the security and operational requirements of your organization: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Message title for users attempting to log on" + compliance: + - cis: ["2.3.7.6"] + condition: all + rules: + - 'not c:reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v legalnoticecaption -> r:\s+legalnoticecaption\s+REG_SZ\s+$' + + - id: 15531 + title: "Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)'." + description: "This policy setting determines whether a user can log on to a Windows domain using cached account information. Logon information for domain accounts can be cached locally to allow users to log on even if a Domain Controller cannot be contacted. This policy setting determines the number of unique users for whom logon information is cached locally. If this value is set to 0, the logon cache feature is disabled. An attacker who is able to access the file system of the server could locate this cached information and use a brute force attack to determine user passwords. The recommended state for this setting is: 4 or fewer logon(s)." + rationale: "The number that is assigned to this policy setting indicates the number of users whose logon information the computer will cache locally. If the number is set to 4, then the computer caches logon information for 4 users. When a 5th user logs on to the computer, the server overwrites the oldest cached logon session. Users who access the computer console will have their logon credentials cached on that computer. An attacker who is able to access the file system of the computer could locate this cached information and use a brute force attack to attempt to determine user passwords. To mitigate this type of attack, Windows encrypts the information and obscures its physical location." + remediation: "To establish the recommended configuration via GP, set the following UI path to 4 or fewer logon(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Number of previous logons to cache (in case domain controller is not available)" + compliance: + - cis: ["2.3.7.7"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> n:^(\d+) compare <= 4' + + - id: 15532 + title: "Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'." + description: "This policy setting determines how far in advance users are warned that their password will expire. It is recommended that you configure this policy setting to at least 5 days but no more than 14 days to sufficiently warn users when their passwords will expire. The recommended state for this setting is: between 5 and 14 days." + rationale: "Users will need to be warned that their passwords are going to expire, or they may inadvertently be locked out of the computer when their passwords expire. This condition could lead to confusion for users who access the network locally, or make it impossible for users to access your organization's network through dial-up or virtual private network (VPN) connections." + remediation: "To establish the recommended configuration via GP, set the following UI path to a value between 5 and 14 days: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Prompt user to change password before expiration" + compliance: + - cis: ["2.3.7.8"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare >= 5 && n:^(\d+) compare <= 14' + + - id: 15533 + title: "Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher." + description: "This policy setting determines what happens when the smart card for a logged-on user is removed from the smart card reader. The recommended state for this setting is: Lock Workstation. Configuring this setting to Force Logoff or Disconnect if a Remote Desktop Services session also conforms to the benchmark." + rationale: "Users sometimes forget to lock their workstations when they are away from them, allowing the possibility for malicious users to access their computers. If smart cards are used for authentication, the computer should automatically lock itself when the card is removed to ensure that only the user with the smart card is accessing resources using those credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Lock Workstation (or, if applicable for your environment, Force Logoff or Disconnect if a Remote Desktop Services session): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Smart card removal behavior" + compliance: + - cis: ["2.3.7.9"] + - cis_csc: ["4.3"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption -> r:^1$|^2$' + + - id: 15534 + title: "Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'." + description: 'This policy setting determines whether packet signing is required by the SMB client component. Note: When Windows Vista-based computers have this policy setting enabled and they connect to file or print shares on remote servers, it is important that the setting is synchronized with its companion setting, Microsoft network server: Digitally sign communications (always), on those servers. For more information about these settings, see the "Microsoft network client and server: Digitally sign communications (four related settings)" section in Chapter 5 of the Threats and Countermeasures guide. The recommended state for this setting is: Enabled.' + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (always)" + compliance: + - cis: ["2.3.8.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> 1' + + - id: 15535 + title: "Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'." + description: "This policy setting determines whether the SMB client will attempt to negotiate SMB packet signing. Note: Enabling this policy setting on SMB clients on your network makes them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (if server agrees)" + compliance: + - cis: ["2.3.8.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> 1' + + - id: 15536 + title: "Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'." + description: "This policy setting determines whether the SMB redirector will send plaintext passwords during authentication to third-party SMB servers that do not support password encryption. It is recommended that you disable this policy setting unless there is a strong business case to enable it. If this policy setting is enabled, unencrypted passwords will be allowed across the network. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting, the server can transmit passwords in plaintext across the network to other computers that offer SMB services, which is a significant security risk. These other computers may not use any of the SMB security mechanisms that are included with Windows Server 2003." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Send unencrypted password to third-party SMB servers" + compliance: + - cis: ["2.3.8.3"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword -> 0' + + - id: 15537 + title: "Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s)'." + description: "This policy setting allows you to specify the amount of continuous idle time that must pass in an SMB session before the session is suspended because of inactivity. Administrators can use this policy setting to control when a computer suspends an inactive SMB session. If client activity resumes, the session is automatically reestablished. The maximum value is 99999, which is over 69 days; in effect, this value disables the setting. The recommended state for this setting is: 15 or fewer minute(s)." + rationale: "Each SMB session consumes server resources, and numerous null sessions will slow the server or possibly cause it to fail. An attacker could repeatedly establish SMB sessions until the server's SMB services become slow or unresponsive." + remediation: "To establish the recommended configuration via GP, set the following UI path to 15 or fewer minute(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Amount of idle time required before suspending session" + compliance: + - cis: ["2.3.9.1"] + - cis_csc: ["4.3"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> n:^(\d+) compare <= 15' + + - id: 15538 + title: "Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'." + description: "This policy setting determines whether packet signing is required by the SMB server component. Enable this policy setting in a mixed environment to prevent downstream clients from using the workstation as a network server. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (always)" + compliance: + - cis: ["2.3.9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature -> 1' + + - id: 15539 + title: "Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'." + description: "This policy setting determines whether the SMB server will negotiate SMB packet signing with clients that request it. If no signing request comes from the client, a connection will be allowed without a signature if the Microsoft network server: Digitally sign communications (always) setting is not enabled. Note: Enable this policy setting on SMB clients on your network to make them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (if client agrees)" + compliance: + - cis: ["2.3.9.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature -> 1' + + - id: 15540 + title: "Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'." + description: "This security setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Network security: Force logoff when logon hours expire (Rule 2.3.11.6). If your organization configures logon hours for users, this policy setting is necessary to ensure they are effective. The recommended state for this setting is: Enabled." + rationale: "If your organization configures logon hours for users, then it makes sense to enable this policy setting. Otherwise, users who should not have access to network resources outside of their logon hours may actually be able to continue to use those resources with sessions that were established during allowed hours." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Disconnect clients when logon hours expire" + compliance: + - cis: ["2.3.9.4"] + - cis_csc: ["5.6"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' + + - id: 15541 + title: "Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher." + description: "This policy setting controls the level of validation a computer with shared folders or printers (the server) performs on the service principal name (SPN) that is provided by the client computer when it establishes a session using the server message block (SMB) protocol. The server message block (SMB) protocol provides the basis for file and print sharing and other networking operations, such as remote Windows administration. The SMB protocol supports validating the SMB server service principal name (SPN) within the authentication blob provided by a SMB client to prevent a class of attacks against SMB servers referred to as SMB relay attacks. This setting will affect both SMB1 and SMB2. The recommended state for this setting is: Accept if provided by client. Configuring this setting to Required from client also conforms to the benchmark." + rationale: "The identity of a computer can be spoofed to gain unauthorized access to network resources." + remediation: "To establish the recommended configuration via GP, set the following UI path to Accept if provided by client (configuring to Required from client also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Server SPN target name validation level" + compliance: + - cis: ["2.3.9.5"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel -> n:^(\d+) compare >= 1' + + - id: 15542 + title: "Ensure 'Network access: Allow anonymous SID/Name translation' is set to 'Disabled'." + description: "This policy setting determines whether an anonymous user can request security identifier (SID) attributes for another user, or use a SID to obtain its corresponding user name. The recommended state for this setting is: Disabled." + rationale: "If this policy setting is enabled, a user with local access could use the well-known Administrator's SID to learn the real name of the built-in Administrator account, even if it has been renamed. That person could then use the account name to initiate a password guessing attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Allow anonymous SID/Name translation" + compliance: + - cis: ["2.3.10.1"] + condition: all + rules: + - 'c:powershell "$null = secedit /export /cfg $env:temp/secexport.cfg; $(gc $env:temp/secexport.cfg | Select-String \"LSAAnonymousNameLookup\").ToString().Split(\"=\")[1].Trim()" -> r:0' + + - id: 15543 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled'." + description: "This policy setting controls the ability of anonymous users to enumerate the accounts in the Security Accounts Manager (SAM). If you enable this policy setting, users with anonymous connections will not be able to enumerate domain account user names on the systems in your environment. This policy setting also allows additional restrictions on anonymous connections. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts" + compliance: + - cis: ["2.3.10.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM -> 1' + + - id: 15544 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled'." + description: "This policy setting controls the ability of anonymous users to enumerate SAM accounts as well as shares. If you enable this policy setting, anonymous users will not be able to enumerate domain account user names and network share names on the systems in your environment. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts and shares" + compliance: + - cis: ["2.3.10.3"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous -> 1' + + - id: 15545 + title: "Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'." + description: "This policy setting determines whether Credential Manager (formerly called Stored User Names and Passwords) saves passwords or credentials for later use when it gains domain authentication. The recommended state for this setting is: Enabled. Note: Changes to this setting will not take effect until Windows is restarted." + rationale: "Passwords that are cached can be accessed by the user when logged on to the computer. Although this information may sound obvious, a problem can arise if the user unknowingly executes hostile code that reads the passwords and forwards them to another, unauthorized user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow storage of passwords and credentials for network authentication" + compliance: + - cis: ["2.3.10.4"] + - pci_dss: ["3.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> DisableDomainCreds' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> 1' + + - id: 15546 + title: "Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'." + description: "This policy setting determines what additional permissions are assigned for anonymous connections to the computer. The recommended state for this setting is: Disabled." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords, perform social engineering attacks, or launch DoS attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Let Everyone permissions apply to anonymous users" + compliance: + - cis: ["2.3.10.5"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 0' + + - id: 15547 + title: "Ensure 'Network access: Named Pipes that can be accessed anonymously' is set to 'None'." + description: "This policy setting determines which communication sessions, or pipes, will have attributes and permissions that allow anonymous access. The recommended state for this setting is: (i.e. None)." + rationale: "Limiting named pipes that can be accessed anonymously will reduce the attack surface of the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to (i.e. None): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Named Pipes that can be accessed anonymously" + compliance: + - cis: ["2.3.10.6"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:\S+' + + - id: 15548 + title: "Ensure 'Network access: Remotely accessible registry paths' is configured." + description: "This policy setting determines which registry paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: This setting does not exist in Windows XP. There was a setting with that name in Windows XP, but it is called 'Network access: Remotely accessible registry paths and sub-paths' in Windows Server 2003, Windows Vista, and Windows Server 2008 (non-R2). Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value. The recommended state for this setting is: System\\CurrentControlSet\\Control\\ProductOptions System\\CurrentControlSet\\Control\\Server Applications Software\\Microsoft\\Windows NT\\CurrentVersion" + rationale: "The registry is a database that contains computer configuration information, and much of the information is sensitive. An attacker could use this information to facilitate unauthorized activities. To reduce the risk of such an attack, suitable ACLs are assigned throughout the registry to help protect it from access by unauthorized users." + remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\ProductOptions System\\CurrentControlSet\\Control\\Server Applications SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Remotely accessible registry paths" + compliance: + - cis: ["2.3.10.7"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:System\\CurrentControlSet\\Control\\ProductOptions System\\CurrentControlSet\\Control\\Server Applications Software\\Microsoft\\Windows NT\\CurrentVersion' + + - id: 15549 + title: "Ensure 'Network access: Remotely accessible registry paths and sub-paths' is configured." + description: "This policy setting determines which registry paths and sub-paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: In Windows XP this setting is called 'Network access: Remotely accessible registry paths,' the setting with that same name in Windows Vista, Windows Server 2008 (non-R2), and Windows Server 2003 does not exist in Windows XP. Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value. The recommended state for this setting is: System\\CurrentControlSet\\Control\\Print\\Printers System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex System\\CurrentControlSet\\Control\\Terminal Server System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib System\\CurrentControlSet\\Services\\SysmonLog" + rationale: "The registry contains sensitive computer configuration information that could be used by an attacker to facilitate unauthorized activities. The fact that the default ACLs assigned throughout the registry are fairly restrictive and help to protect the registry from access by unauthorized users reduces the risk of such an attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\Print\\Printers System\\CurrentControlSet\\Services\\Eventlog SOFTWARE\\Microsoft\\OLAP Server SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex System\\CurrentControlSet\\Control\\Terminal Server System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib System\\CurrentControlSet\\Services\\SysmonLog Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Remotely accessible registry paths and sub-paths" + compliance: + - cis: ["2.3.10.8"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Print\\Printers' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Services\\Eventlog' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\OLAP Server' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Print' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\ContentIndex' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Services\\SysmonLog' + + - id: 15550 + title: "Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'." + description: "When enabled, this policy setting restricts anonymous access to only those shares and pipes that are named in the Network access: Named pipes that can be accessed anonymously and Network access: Shares that can be accessed anonymously settings. This policy setting controls null session access to shares on your computers by adding RestrictNullSessAccess with the value 1 in the HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\LanManServer\\Parameters registry key. This registry value toggles null session shares on or off to control whether the server service restricts unauthenticated clients' access to named resources. The recommended state for this setting is: Enabled." + rationale: "Null sessions are a weakness that can be exploited through shares (including the default shares) on computers in your environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict anonymous access to Named Pipes and Shares" + compliance: + - cis: ["2.3.10.9"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess -> 1' + + - id: 15551 + title: "Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow'." + description: 'This policy setting allows you to restrict remote RPC connections to SAM. The recommended state for this setting is: Administrators: Remote Access: Allow. Note: A Windows 10 R1607, Server 2016 or newer OS is required to access and set this value in Group Policy. Note #2: If your organization is using Azure Advanced Threat Protection (APT), the service account, "AATP Service" will need to be added to the recommendation configuration. For more information on adding the "AATP Service" account please see Configure SAM-R to enable lateral movement path detection in Microsoft Defender for Identity | Microsoft Docs.' + rationale: "To ensure that an unauthorized user cannot anonymously list local account names or groups and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators: Remote Access: Allow: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict clients allowed to make remote calls to SAM" + compliance: + - cis: ["2.3.10.10"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> restrictremotesam' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> restrictremotesam -> r:O:BAG:BAD:\(A;;RC;;;BA\)' + + - id: 15552 + title: "Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'." + description: "This policy setting determines which network shares can be accessed by anonymous users. The default configuration for this policy setting has little effect because all users have to be authenticated before they can access shared resources on the server. The recommended state for this setting is: (i.e. None)." + rationale: "It is very dangerous to allow any values in this setting. Any shares that are listed can be accessed by any network user, which could lead to the exposure or corruption of sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to (i.e. None): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Shares that can be accessed anonymously" + compliance: + - cis: ["2.3.10.11"] + - cis_csc: ["3.3"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> \S+' + + - id: 15553 + title: "Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'." + description: "This policy setting determines how network logons that use local accounts are authenticated. The Classic option allows precise control over access to resources, including the ability to assign different types of access to different users for the same resource. The Guest only option allows you to treat all users equally. In this context, all users authenticate as Guest only to receive the same access level to a given resource. The recommended state for this setting is: Classic - local users authenticate as themselves. Note: This setting does not affect interactive logons that are performed remotely by using such services as Telnet or Remote Desktop Services (formerly called Terminal Services)." + rationale: "With the Guest only model, any user who can authenticate to your computer over the network does so with guest privileges, which probably means that they will not have write access to shared resources on that computer. Although this restriction does increase security, it makes it more difficult for authorized users to access shared resources on those computers because ACLs on those resources must include access control entries (ACEs) for the Guest account. With the Classic model, local accounts should be password protected. Otherwise, if Guest access is enabled, anyone can use those user accounts to access shared system resources." + remediation: "To establish the recommended configuration via GP, set the following UI path to Classic - local users authenticate as themselves: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Sharing and security model for local accounts" + compliance: + - cis: ["2.3.10.12"] + - pci_dss: ["7.1.3"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest -> 0' + + # 2.3.11.1 Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled' + - id: 15554 + title: "Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'." + description: "This policy setting determines whether Local System services that use Negotiate when reverting to NTLM authentication can use the computer identity. This policy is supported on at least Windows 7 or Windows Server 2008 R2. The recommended state for this setting is: Enabled." + rationale: "When connecting to computers running versions of Windows earlier than Windows Vista or Windows Server 2008 (non-R2), services running as Local System and using SPNEGO (Negotiate) that revert to NTLM use the computer identity. In Windows 7, if you are connecting to a computer running Windows Server 2008 or Windows Vista, then a system service uses either the computer identity or a NULL session. When connecting with a NULL session, a system-generated session key is created, which provides no protection but allows applications to sign and encrypt data without errors. When connecting with the computer identity, both signing and encryption is supported in order to provide data protection." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow Local System to use computer identity for NTLM" + compliance: + - cis: ["2.3.11.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> UseMachineId' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> UseMachineId -> 1' + + # 2.3.11.2 Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled' + - id: 15555 + title: "Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'." + description: "This policy setting determines whether NTLM is allowed to fall back to a NULL session when used with LocalSystem. The recommended state for this setting is: Disabled." + rationale: "NULL sessions are less secure because by definition they are unauthenticated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow LocalSystem NULL session fallback" + compliance: + - cis: ["2.3.11.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback -> 0' + + # 2.3.11.3 Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled' + - id: 15556 + title: "Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'." + description: "This setting determines if online identities are able to authenticate to this computer. The Public Key Cryptography Based User-to-User (PKU2U) protocol introduced in Windows 7 and Windows Server 2008 R2 is implemented as a security support provider (SSP). The SSP enables peer-to-peer authentication, particularly through the Windows 7 media and file sharing feature called HomeGroup, which permits sharing between computers that are not members of a domain. With PKU2U, a new extension was introduced to the Negotiate authentication package, Spnego.dll. In previous versions of Windows, Negotiate decided whether to use Kerberos or NTLM for authentication. The extension SSP for Negotiate, Negoexts.dll, which is treated as an authentication protocol by Windows, supports Microsoft SSPs including PKU2U. When computers are configured to accept authentication requests by using online IDs, Negoexts.dll calls the PKU2U SSP on the computer that is used to log on. The PKU2U SSP obtains a local certificate and exchanges the policy between the peer computers. When validated on the peer computer, the certificate within the metadata is sent to the logon peer for validation and associates the user's certificate to a security token and the logon process completes. The recommended state for this setting is: Disabled." + rationale: "The PKU2U protocol is a peer-to-peer authentication protocol - authentication should be managed centrally in most managed networks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network Security: Allow PKU2U authentication requests to this computer to use online identities" + compliance: + - cis: ["2.3.11.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID -> 0' + + # 2.3.11.4 Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types' + - id: 15557 + title: "Ensure 'Network security: Configure encryption types allowed for Kerberos' is set to 'AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types'." + description: "This policy setting allows you to set the encryption types that Kerberos is allowed to use. The recommended state for this setting is: AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types. Note: Some legacy applications and OSes may still require RC4_HMAC_MD5 - we recommend you test in your environment and verify whether you can safely remove it." + rationale: "The strength of each encryption algorithm varies from one to the next, choosing stronger algorithms will reduce the risk of compromise however doing so may cause issues when the computer attempts to authenticate with systems that do not support them." + remediation: "To establish the recommended configuration via GP, set the following UI path to AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Configure encryption types allowed for Kerberos" + compliance: + - cis: ["2.3.11.4"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> r:2147483644|2147483640' + + # 2.3.11.5 Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled' + - id: 15558 + title: "Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'." + description: "This policy setting determines whether the LAN Manager (LM) hash value for the new password is stored when the password is changed. The LM hash is relatively weak and prone to attack compared to the cryptographically stronger Microsoft Windows NT hash. Since LM hashes are stored on the local computer in the security database, passwords can then be easily compromised if the database is attacked. Note: Older operating systems and some third-party applications may fail when this policy setting is enabled. Also, note that the password will need to be changed on all accounts after you enable this setting to gain the proper benefit. The recommended state for this setting is: Enabled." + rationale: "The SAM file can be targeted by attackers who seek access to username and password hashes. Such attacks use special tools to crack passwords, which can then be used to impersonate users and gain access to resources on your network. These types of attacks will not be prevented if you enable this policy setting, but it will be much more difficult for these types of attacks to succeed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Do not store LAN Manager hash value on next password change" + compliance: + - cis: ["2.3.11.5"] + - cis_csc: ["3.11"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash -> 1' + + # 2.3.11.6 Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled' + - id: 15559 + title: "Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'." + description: "This policy setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Microsoft network server: Disconnect clients when logon hours expire (Rule 2.3.9.4). The recommended state for this setting is: Enabled." + rationale: "If this setting is disabled, a user could remain connected to the computer outside of their allotted logon hours." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Force logoff when logon hours expire" + compliance: + - cis: ["2.3.11.6"] + - cis_csc: ["5.6"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' + + # 2.3.11.7 Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM' + - id: 15560 + title: "Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'." + description: "LAN Manager (LM) was a family of early Microsoft client/server software (predating Windows NT) that allowed users to link personal computers together on a single network. LM network capabilities included transparent file and print sharing, user security features, and network administration tools. In Active Directory domains, the Kerberos protocol is the default authentication protocol. However, if the Kerberos protocol is not negotiated for some reason, Active Directory will use LM, NTLM, or NTLMv2. LAN Manager authentication includes the LM, NTLM, and NTLM version 2 (NTLMv2) variants, and is the protocol that is used to authenticate all Windows clients when they perform the following operations: -Join a domain -Authenticate between Active Directory forests -Authenticate to down-level domains -Authenticate to computers that do not run Windows 2000, Windows Server 2003, or Windows XP -Authenticate to computers that are not in the domain. The Network security: LAN Manager authentication level setting determines which challenge/response authentication protocol is used for network logons. This choice affects the level of authentication protocol used by clients, the level of session security negotiated, and the level of authentication accepted by servers. The recommended state for this setting is: Send NTLMv2 response only. Refuse LM & NTLM." + rationale: "Windows 2000 and Windows XP clients were configured by default to send LM and NTLM authentication responses (Windows 95-based and Windows 98-based clients only send LM). The default settings in OSes predating Windows Vista / Windows Server 2008 (non- R2) allowed all clients to authenticate with servers and use their resources. However, this meant that LM responses - the weakest form of authentication response - were sent over the network, and it was potentially possible for attackers to sniff that traffic to more easily reproduce the user's password. The Windows 95, Windows 98, and Windows NT operating systems cannot use the Kerberos version 5 protocol for authentication. For this reason, in a Windows Server 2003 domain, these computers authenticate by default with both the LM and NTLM protocols for network authentication. You can enforce a more secure authentication protocol for Windows 95, Windows 98, and Windows NT by using NTLMv2. For the logon process, NTLMv2 uses a secure channel to protect the authentication process. Even if you use NTLMv2 for older clients and servers, Windows-based clients and servers that are members of the domain will use the Kerberos authentication protocol to authenticate with Windows Server 2003 or newer Domain Controllers. For these reasons, it is strongly preferred to restrict the use of LM & NTLM (non-v2) as much as possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Send NTLMv2 response only. Refuse LM & NTLM: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LAN Manager authentication level" + compliance: + - cis: ["2.3.11.7"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel ' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 5' + + # 2.3.11.8 Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher + - id: 15561 + title: "Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher." + description: "This policy setting determines the level of data signing that is requested on behalf of clients that issue LDAP BIND requests. Note: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are included with Windows XP Professional use ldap_simple_bind or ldap_simple_bind_s to communicate with a Domain Controller. The recommended state for this setting is: Negotiate signing. Configuring this setting to Require signing also conforms to the benchmark." + rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks in which an intruder captures the packets between the client and server, modifies them, and then forwards them to the server. For an LDAP server, this susceptibility means that an attacker could cause a server to make decisions that are based on false or altered data from the LDAP queries. To lower this risk in your network, you can implement strong physical security measures to protect the network infrastructure. Also, you can make all types of man-in-the-middle attacks extremely difficult if you require digital signatures on all network packets by means of IPsec authentication headers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Negotiate signing (configuring to Require signing also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LDAP client signing requirements" + compliance: + - cis: ["2.3.11.8"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> n:(\d+) compare >= 1' + + # 2.3.11.9 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption' + - id: 15562 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'." + description: "This policy setting determines which behaviors are allowed by clients for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable both options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. In other words, these options help protect against man-in-the-middle attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) clients" + compliance: + - cis: ["2.3.11.9"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec -> 537395200' + + # 2.3.11.10 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption' + - id: 15563 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'." + description: "This policy setting determines which behaviors are allowed by servers for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable all of the options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. That is, these options help protect against man-in-the-middle attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) servers" + compliance: + - cis: ["2.3.11.10"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - https://workbench.cisecurity.org/benchmarks/288 + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec -> 537395200' + + - id: 15564 + title: "Ensure 'System cryptography: Force strong key protection for user keys stored on the computer' is set to 'User is prompted when the key is first used' or higher." + description: "This policy setting determines whether users' private keys (such as their S-MIME keys) require a password to be used. The recommended state for this setting is: User is prompted when the key is first used. Configuring this setting to User must enter a password each time they use a key also conforms to the benchmark." + rationale: "If a user's account is compromised or their computer is inadvertently left unsecured the malicious user can use the keys stored for the user to access protected resources. You can configure this policy setting so that users must provide a password that is distinct from their domain password every time they use a key. This configuration makes it more difficult for an attacker to access locally stored user keys, even if the attacker takes control of the user's computer and determines their logon password." + remediation: "To establish the recommended configuration via GP, set the following UI path to User is prompted when the key is first used (configuring to User must enter a password each time they use a key also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System cryptography: Force strong key protection for user keys stored on the computer" + compliance: + - cis: ["2.3.14.1"] + - cis_csc: ["3.11"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Cryptography' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Cryptography -> ForceKeyProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Cryptography -> ForceKeyProtection -> n:(\d+) compare > 0' + + # 2.3.15.1 Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled' + - id: 15565 + title: "Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'." + description: "This policy setting determines whether case insensitivity is enforced for all subsystems. The Microsoft Win32 subsystem is case insensitive. However, the kernel supports case sensitivity for other subsystems, such as the Portable Operating System Interface for UNIX (POSIX). Because Windows is case insensitive (but the POSIX subsystem will support case sensitivity), failure to enforce this policy setting makes it possible for a user of the POSIX subsystem to create a file with the same name as another file by using mixed case to label it. Such a situation can block access to these files by another user who uses typical Win32 tools, because only one of the files will be available. The recommended state for this setting is: Enabled." + rationale: "Because Windows is case-insensitive but the POSIX subsystem will support case sensitivity, failure to enable this policy setting would make it possible for a user of that subsystem to create a file with the same name as another file but with a different mix of upper and lower case letters. Such a situation could potentially confuse users when they try to access such files from normal Win32 tools because only one of the files will be available." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Require case insensitivity for non-Windows subsystems" + compliance: + - cis: ["2.3.15.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive -> 1' + + # 2.3.15.2 Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled' + - id: 15566 + title: "Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'." + description: "This policy setting determines the strength of the default discretionary access control list (DACL) for objects. Active Directory maintains a global list of shared system resources, such as DOS device names, mutexes, and semaphores. In this way, objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and what permissions are granted. The recommended state for this setting is: Enabled." + rationale: "This setting determines the strength of the default DACL for objects. Windows maintains a global list of shared computer resources so that objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and with what permissions." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)" + compliance: + - cis: ["2.3.15.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode -> 1' + + # 2.3.17.1 Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled' + - id: 15567 + title: "Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'." + description: "This policy setting controls the behavior of Admin Approval Mode for the built-in Administrator account. The recommended state for this setting is: Enabled." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. An attack vector for these programs was to discover the password of the account named 'Administrator' because that user account was created for all installations of Windows. To address this risk, in Windows Vista and newer, the built-in Administrator account is now disabled by default. In a default installation of a new computer, accounts with administrative control over the computer are initially set up in one of two ways: - If the computer is not joined to a domain, the first user account you create has the equivalent permissions as a local administrator. - If the computer is joined to a domain, no local administrator accounts are created. The Enterprise or Domain Administrator must log on to the computer and create one if a local administrator account is warranted. Once Windows is installed, the built-in Administrator account may be manually enabled, but we strongly recommend that this account remain disabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Admin Approval Mode for the Built-in Administrator account" + compliance: + - cis: ["2.3.17.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken -> 1' + + - id: 15568 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'." + description: "This policy setting controls the behavior of the elevation prompt for administrators. The recommended state for this setting is: Prompt for consent on the secure desktop." + rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting raises awareness to the administrator of elevated privilege operations and permits the administrator to prevent a malicious program from elevating its privilege when the program attempts to do so." + remediation: "To establish the recommended configuration via GP, set the following UI path to Prompt for consent on the secure desktop: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode" + compliance: + - cis: ["2.3.17.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> r:^2$' + + - id: 15569 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'." + description: "This policy setting controls the behavior of the elevation prompt for standard users. The recommended state for this setting is: Automatically deny elevation requests." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious programs running under elevated credentials without the user or administrator being aware of their activity. This setting raises awareness to the user that a program requires the use of elevated privilege operations and requires that the user be able to supply administrative credentials in order for the program to run." + remediation: "To establish the recommended configuration via GP, set the following UI path to Automatically deny elevation requests: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for standard users" + compliance: + - cis: ["2.3.17.3"] + - pci_dss: ["7.1.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser -> 0' + + - id: 15570 + title: "Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'." + description: "This policy setting controls the behavior of application installation detection for the computer. The recommended state for this setting is: Enabled." + rationale: "Some malicious software will attempt to install itself after being given permission to run. For example, malicious software with a trusted application shell. The user may have given permission for the program to run because the program is trusted, but if they are then prompted for installation of an unknown component this provides another way of trapping the software before it can do damage" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Detect application installations and prompt for elevation" + compliance: + - cis: ["2.3.17.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 1' + + - id: 15571 + title: "Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'." + description: "This policy setting controls whether applications that request to run with a User Interface Accessibility (UIAccess) integrity level must reside in a secure location in the file system. Secure locations are limited to the following: - ...\\Program Files\\, including subfolders - ...\\Windows\\system32\\; - ...\\Program Files (x86)\\, including subfolders (for 64-bit versions of Windows). Note: Windows enforces a public key infrastructure (PKI) signature check on any interactive application that requests to run with a UIAccess integrity level regardless of the state of this security setting. The recommended state for this setting is: Enabled." + rationale: "UIAccess Integrity allows an application to bypass User Interface Privilege Isolation (UIPI) restrictions when an application is elevated in privilege from a standard user to an administrator. This is required to support accessibility features such as screen readers that are transmitting user interfaces to alternative forms. A process that is started with UIAccess rights has the following abilities: - To set the foreground window. - To drive any application window using SendInput function. - To use read input for all integrity levels using low-level hooks, raw input, GetKeyState, GetAsyncKeyState, and GetKeyboardInput. - To set journal hooks. - To uses AttachThreadInput to attach a thread to a higher integrity input queue." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Only elevate UIAccess applications that are installed in secure locations" + compliance: + - cis: ["2.3.17.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths -> 1' + + - id: 15572 + title: "Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'." + description: "This policy setting controls the behavior of all User Account Control (UAC) policy settings for the computer. If you change this policy setting, you must restart your computer. The recommended state for this setting is: Enabled. Note: If this policy setting is disabled, the Security Center notifies you that the overall security of the operating system has been reduced." + rationale: "This is the setting that turns on or off UAC. If this setting is disabled, UAC will not be used and any security benefits and risk mitigations that are dependent on UAC will not be present on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Run all administrators in Admin Approval Mode" + compliance: + - cis: ["2.3.17.6"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA -> 1' + + - id: 15573 + title: "Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'." + description: "This policy setting controls whether the elevation request prompt is displayed on the interactive user's desktop or the secure desktop. The recommended state for this setting is: Enabled." + rationale: "Standard elevation prompt dialog boxes can be spoofed, which may cause users to disclose their passwords to malicious software. The secure desktop presents a very distinct appearance when prompting for elevation, where the user desktop dims, and the elevation prompt UI is more prominent. This increases the likelihood that users who become accustomed to the secure desktop will recognize a spoofed elevation prompt dialog box and not fall for the trick." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Switch to the secure desktop when prompting for elevation" + compliance: + - cis: ["2.3.17.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop -> 1' + + - id: 15574 + title: "Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'." + description: "This policy setting controls whether application write failures are redirected to defined registry and file system locations. This policy setting mitigates applications that run as administrator and write run-time application data to: - %ProgramFiles% - %windir% - %windir%\\System32 - HKEY_LOCAL_MACHINE\\SOFTWARE. The recommended state for this setting is: Enabled." + rationale: "This setting reduces vulnerabilities by ensuring that legacy applications only write data to permitted locations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Virtualize file and registry write failures to per-user locations" + compliance: + - cis: ["2.3.17.8"] + - pci_dss: ["6.5.8"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization -> 1' + + - id: 15575 + title: "Ensure 'Bluetooth Audio Gateway Service (BTAGService)' is set to 'Disabled'." + description: "Service supporting the audio gateway role of the Bluetooth Handsfree Profile. The recommended state for this setting is: Disabled." + rationale: "Bluetooth technology has inherent security risks - especially prior to the v2.1 standard. Wireless Bluetooth traffic is not well encrypted (if at all), so in a high-security environment, it should not be permitted, in spite of the added inconvenience of not being able to use Bluetooth devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Bluetooth Audio Gateway Service. Note: This service was first introduced in Windows 10 Release 1803. It appears to have replaced the older Bluetooth Handsfree Service (BthHFSrv), which was removed from Windows in that release (it is not simply a rename, but a different service)." + compliance: + - cis: ["5.1"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTAGService -> Start -> 4' + + - id: 15576 + title: "Ensure 'Bluetooth Support Service (bthserv)' is set to 'Disabled'." + description: "The Bluetooth service supports discovery and association of remote Bluetooth devices. The recommended state for this setting is: Disabled." + rationale: "Bluetooth technology has inherent security risks - especially prior to the v2.1 standard. Wireless Bluetooth traffic is not well encrypted (if at all), so in a high-security environment, it should not be permitted, in spite of the added inconvenience of not being able to use Bluetooth devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Bluetooth Support Service" + compliance: + - cis: ["5.2"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\bthserv -> Start -> 4' + + - id: 15577 + title: "Ensure 'Downloaded Maps Manager (MapsBroker)' is set to 'Disabled'." + description: "Windows service for application access to downloaded maps. This service is started on-demand by application accessing downloaded maps." + rationale: "Mapping technologies can unwillingly reveal your location to attackers and other software that picks up the information. In addition, automatic downloads of data from 3rd-party sources should be minimized when not needed. Therefore this service should not be needed in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Downloaded Maps Manager" + compliance: + - cis: ["5.4"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MapsBroker -> Start -> 4' + + - id: 15578 + title: "Ensure 'Geolocation Service (lfsvc)' is set to 'Disabled'." + description: "This service monitors the current location of the system and manages geofences (a geographical location with associated events). The recommended state for this setting is: Disabled." + rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it’s not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Geolocation Service" + compliance: + - cis: ["5.5"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lfsvc -> Start -> 4' + + - id: 15579 + title: "Ensure 'IIS Admin Service (IISADMIN)' is set to 'Disabled' or 'Not Installed'." + description: "Enables the server to administer the IIS metabase. The IIS metabase stores configuration for the SMTP and FTP services. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Internet Information Services). Note #2: An organization may choose to selectively grant exceptions to web developers to allow IIS (or another web server) on their workstation, in order for them to locally test & develop web pages. However, the organization should track those machines and ensure the security controls and mitigations are kept up to date, to reduce risk of compromise." + rationale: "Hosting a website from a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. If proper security mitigations are not followed, the chance of successful attack increases significantly. Note: This security concern applies to any web server application installed on a workstation, not just IIS." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\IIS Admin Service" + compliance: + - cis: ["5.6"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IISADMIN' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IISADMIN -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IISADMIN -> Start -> 4' + + - id: 15580 + title: "Ensure 'Infrared monitor service (irmon)' is set to 'Disabled' or 'Not Installed'." + description: "Detects other Infrared devices that are in range and launches the file transfer application. The recommended state for this setting is: Disabled or Not Installed." + rationale: "Infrared connections can potentially be a source of data compromise - especially via the automatic 'file transfer application' functionality. Enterprise-managed systems should utilize a more secure method of connection than infrared." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Infrared monitor service" + compliance: + - cis: ["5.7"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\irmon' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\irmon -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\irmon -> Start -> 4' + + - id: 15581 + title: "Ensure 'Internet Connection Sharing (ICS) (SharedAccess)' is set to 'Disabled'." + description: "Provides network access translation, addressing, name resolution and/or intrusion prevention services for a home or small office network. The recommended state for this setting is: Disabled." + rationale: "Internet Connection Sharing (ICS) is a feature that allows someone to 'share' their Internet connection with other machines on the network - it was designed for home or small office environments where only one machine has Internet access - it effectively turns that machine into an Internet router. This feature causes the bridging of networks and likely bypassing other, more secure pathways. It should not be used on any enterprise-managed system." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Internet Connection Sharing (ICS)" + compliance: + - cis: ["5.8"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess -> Start -> 4' + + - id: 15582 + title: "Ensure 'Link-Layer Topology Discovery Mapper (lltdsvc)' is set to 'Disabled'." + description: "Creates a Network Map, consisting of PC and device topology (connectivity) information, and metadata describing each PC and device. The recommended state for this setting is: Disabled." + rationale: "The feature that this service enables could potentially be used for unauthorized discovery and connection to network devices. Disabling the service helps to prevent responses to requests for network topology discovery in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Link-Layer Topology Discovery Mapper" + compliance: + - cis: ["5.9"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lltdsvc -> Start -> 4' + + - id: 15583 + title: "Ensure 'LxssManager (LxssManager)' is set to 'Disabled' or 'Not Installed'." + description: "The LXSS Manager service supports running native ELF binaries. The service provides the infrastructure necessary for ELF binaries to run on Windows. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Windows Subsystem for Linux)." + rationale: "The Linux Subsystem (LXSS) Manager allows full system access to Linux applications on Windows, including the file system. While this can certainly have some functionality and performance benefits for running those applications, it also creates new security risks in the event that a hacker injects malicious code into a Linux application. For best security, it is preferred to run Linux applications on Linux, and Windows applications on Windows." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\LxssManager" + compliance: + - cis: ["5.10"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager -> Start -> 4' + + - id: 15584 + title: "Ensure 'Microsoft FTP Service (FTPSVC)' is set to 'Disabled' or 'Not Installed'." + description: "Enables the server to be a File Transfer Protocol (FTP) server. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Internet Information Services - FTP Server)." + rationale: "Hosting an FTP server (especially a non-secure FTP server) from a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. Note: This security concern applies to any FTP server application installed on a workstation, not just IIS." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Microsoft FTP Service" + compliance: + - cis: ["5.11"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FTPSVC' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FTPSVC -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FTPSVC -> Start -> 4' + + - id: 15585 + title: "Ensure 'Microsoft iSCSI Initiator Service (MSiSCSI)' is set to 'Disabled'." + description: "Manages Internet SCSI (iSCSI) sessions from this computer to remote target devices. The recommended state for this setting is: Disabled." + rationale: "This service is critically necessary in order to directly attach to an iSCSI device. However, iSCSI itself uses a very weak authentication protocol (CHAP), which means that the passwords for iSCSI communication are easily exposed, unless all of the traffic is isolated and/or encrypted using another technology like IPsec. This service is generally more appropriate for servers in a controlled environment then on workstations requiring high security." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Microsoft iSCSI Initiator Service" + compliance: + - cis: ["5.12"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSiSCSI -> Start -> 4' + + - id: 15586 + title: "Ensure 'OpenSSH SSH Server (sshd)' is set to 'Disabled' or 'Not Installed'." + description: "SSH protocol based service to provide secure encrypted communications between two untrusted hosts over an insecure network. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but it is installed by enabling an optional Windows feature (OpenSSH Server)." + rationale: "Hosting an SSH server from a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. Note: This security concern applies to any SSH server application installed on a workstation, not just the one supplied with Windows." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\OpenSSH SSH Server" + compliance: + - cis: ["5.13"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sshd' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sshd -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sshd -> Start -> 4' + + - id: 15587 + title: "Ensure 'Peer Name Resolution Protocol (PNRPsvc)' is set to 'Disabled'." + description: "Enables serverless peer name resolution over the Internet using the Peer Name Resolution Protocol (PNRP). The recommended state for this setting is: Disabled." + rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Peer Name Resolution Protocol" + compliance: + - cis: ["5.14"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PNRPsvc -> Start -> 4' + + - id: 15588 + title: "Ensure 'Peer Networking Grouping (p2psvc)' is set to 'Disabled'." + description: "Enables multi-party communication using Peer-to-Peer Grouping. The recommended state for this setting is: Disabled." + rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Peer Networking Grouping" + compliance: + - cis: ["5.15"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\p2psvc -> Start -> 4' + + - id: 15589 + title: "Ensure 'Peer Networking Identity Manager (p2pimsvc)' is set to 'Disabled'." + description: "Provides identity services for the Peer Name Resolution Protocol (PNRP) and Peer-to-Peer Grouping services. The recommended state for this setting is: Disabled." + rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Peer Networking Identity Manager" + compliance: + - cis: ["5.16"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\p2pimsvc -> Start -> 4' + + - id: 15590 + title: "Ensure 'PNRP Machine Name Publication Service (PNRPAutoReg)' is set to 'Disabled'." + description: "This service publishes a machine name using the Peer Name Resolution Protocol. Configuration is managed via the netsh context ‘p2p pnrp peer’. The recommended state for this setting is: Disabled." + rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\PNRP Machine Name Publication Service" + compliance: + - cis: ["5.17"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PNRPAutoReg -> Start -> 4' + + - id: 15591 + title: "Ensure 'Print Spooler (Spooler)' is set to 'Disabled'." + description: "This service spools print jobs and handles interaction with printers. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, unnecessary services especially those with known vulnerabilities should be disabled. Disabling the Print Spooler (Spooler) service mitigates the PrintNightmare vulnerability (CVE-2021-34527) and other attacks against the service." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Print Spooler" + compliance: + - cis: ["5.18"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler -> Start -> 4' + + - id: 15592 + title: "Ensure 'Problem Reports and Solutions Control Panel Support (wercplsupport)' is set to 'Disabled'." + description: "This service provides support for viewing, sending and deletion of system-level problem reports for the Problem Reports and Solutions control panel. The recommended state for this setting is: Disabled." + rationale: "This service is involved in the process of displaying/reporting issues & solutions to/from Microsoft. In a high security environment, preventing this information from being sent can help reduce privacy concerns for sensitive corporate information." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Problem Reports and Solutions Control Panel Support" + compliance: + - cis: ["5.19"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wercplsupport -> Start -> 4' + + - id: 15593 + title: "Ensure 'Remote Access Auto Connection Manager (RasAuto)' is set to 'Disabled'." + description: "Creates a connection to a remote network whenever a program references a remote DNS or NetBIOS name or address. The recommended state for this setting is: Disabled." + rationale: "The function of this service is to provide a 'demand dial' type of functionality. In a high security environment, it is preferred that any remote 'dial' connections (whether they be legacy dial-in POTS or VPN) are initiated by the user, not automatically by the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Access Auto Connection Manager" + compliance: + - cis: ["5.20"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasAuto -> Start -> 4' + + - id: 15594 + title: "Ensure 'Remote Desktop Configuration (SessionEnv)' is set to 'Disabled'." + description: "Remote Desktop Configuration service (RDCS) is responsible for all Remote Desktop related configuration and session maintenance activities that require SYSTEM context. These include per-session temporary folders, RD themes, and RD certificates. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, Remote Desktop access is an increased security risk. For these environments, only local console access should be permitted." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Desktop Configuration" + compliance: + - cis: ["5.21"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SessionEnv -> Start -> 4' + + - id: 15595 + title: "Ensure 'Remote Desktop Services (TermService)' is set to 'Disabled'." + description: "Allows users to connect interactively to a remote computer. Remote Desktop and Remote Desktop Session Host Server depend on this service. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, Remote Desktop access is an increased security risk. For these environments, only local console access should be permitted." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Desktop Services" + compliance: + - cis: ["5.22"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService -> Start -> 4' + + - id: 15596 + title: "Ensure 'Remote Desktop Services UserMode Port Redirector (UmRdpService)' is set to 'Disabled'." + description: "Allows the redirection of Printers/Drives/Ports for RDP connections. The recommended state for this setting is: Disabled." + rationale: "In a security-sensitive environment, it is desirable to reduce the possible attack surface - preventing the redirection of COM, LPT and PnP ports will reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer within an RDP session." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Desktop Services UserMode Port Redirector" + compliance: + - cis: ["5.23"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UmRdpService -> Start -> 4' + + - id: 15597 + title: "Ensure 'Remote Procedure Call (RPC) Locator (RpcLocator)' is set to 'Disabled'." + description: "In Windows 2003 and older versions of Windows, the Remote Procedure Call (RPC) Locator service manages the RPC name service database. In Windows Vista and newer versions of Windows, this service does not provide any functionality and is present for application compatibility. The recommended state for this setting is: Disabled." + rationale: "This is a legacy service that has no value or purpose other than application compatibility for very old software. It should be disabled unless there is a specific old application still in use on the system that requires it." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Procedure Call (RPC) Locator" + compliance: + - cis: ["5.24"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RpcLocator -> Start -> 4' + + - id: 15598 + title: "Ensure 'Remote Registry (RemoteRegistry)' is set to 'Disabled'." + description: "Enables remote users to view and modify registry settings on this computer. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, exposing the registry to remote access is an increased security risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Registry" + compliance: + - cis: ["5.25"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RemoteRegistry -> Start -> 4' + + - id: 15599 + title: "Ensure 'Routing and Remote Access (RemoteAccess)' is set to 'Disabled'." + description: "Offers routing services to businesses in local area and wide area network environments. The recommended state for this setting is: Disabled." + rationale: "This service's main purpose is to provide Windows router functionality - this is not an appropriate use of workstations in an enterprise managed environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Routing and Remote Access" + compliance: + - cis: ["5.26"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RemoteAccess -> Start -> 4' + + - id: 15600 + title: "Ensure 'Server (LanmanServer)' is set to 'Disabled'." + description: "Supports file, print, and named-pipe sharing over the network for this computer. If this service is stopped, these functions will be unavailable. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, a secure workstation should only be a client, not a server. Sharing workstation resources for remote access increases security risk as the attack surface is notably higher." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Server" + compliance: + - cis: ["5.27"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer -> Start -> 4' + + - id: 15601 + title: "Ensure 'Simple TCP/IP Services (simptcp)' is set to 'Disabled' or 'Not Installed'." + description: "Supports the following TCP/IP services: Character Generator, Daytime, Discard, Echo, and Quote of the Day. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Simple TCPIP services (i.e. echo, daytime etc))." + rationale: "The Simple TCP/IP Services have very little purpose in a modern enterprise environment - allowing them might increase exposure and risk for attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Simple TCP/IP Services" + compliance: + - cis: ["5.28"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\simptcp' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\simptcp -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\simptcp -> Start -> 4' + + - id: 15602 + title: "Ensure 'SNMP Service (SNMP)' is set to 'Disabled' or 'Not Installed'." + description: "Enables Simple Network Management Protocol (SNMP) requests to be processed by this computer. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Simple Network Management Protocol (SNMP))." + rationale: "Features that enable inbound network connections increase the attack surface. In a high security environment, management of secure workstations should be handled locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\SNMP Service" + compliance: + - cis: ["5.29"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP -> Start -> 4' + + - id: 15603 + title: "Ensure 'Special Administration Console Helper (sacsvr)' is set to 'Disabled' or 'Not Installed'." + description: "This service allows administrators to remotely access a command prompt using Emergency Management Services. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but it is installed by enabling an optional Windows capability (Windows Emergency Management Services and Serial Console)." + rationale: "Allowing the use of a remotely accessible command prompt that provides the ability to perform remote management tasks on a computer is a security risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Special Administration Console Helper" + compliance: + - cis: ["5.30"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sacsvr' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sacsvr -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sacsvr -> Start -> 4' + + - id: 15604 + title: "Ensure 'SSDP Discovery (SSDPSRV)' is set to 'Disabled'." + description: "Discovers networked devices and services that use the SSDP discovery protocol, such as UPnP devices. Also announces SSDP devices and services running on the local computer. The recommended state for this setting is: Disabled." + rationale: "Universal Plug n Play (UPnP) is a real security risk - it allows automatic discovery and attachment to network devices. Note that UPnP is different than regular Plug n Play (PnP). Workstations should not be advertising their services (or automatically discovering and connecting to networked services) in a security-conscious enterprise managed environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\SSDP Discovery" + compliance: + - cis: ["5.31"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SSDPSRV -> Start -> 4' + + - id: 15605 + title: "Ensure 'UPnP Device Host (upnphost)' is set to 'Disabled'." + description: "Allows UPnP devices to be hosted on this computer. The recommended state for this setting is: Disabled." + rationale: "Universal Plug n Play (UPnP) is a real security risk - it allows automatic discovery and attachment to network devices. Notes that UPnP is different than regular Plug n Play (PnP). Workstations should not be advertising their services (or automatically discovering and connecting to networked services) in a security-conscious enterprise managed environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\UPnP Device Host" + compliance: + - cis: ["5.32"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\upnphost -> Start -> 4' + + - id: 15606 + title: "Ensure 'Web Management Service (WMSvc)' is set to 'Disabled' or 'Not Installed'." + description: "The Web Management Service enables remote and delegated management capabilities for administrators to manage for the Web server, sites and applications present on the machine. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Internet Information Services - Web Management Tools - IIS Management Service)." + rationale: "Remote web administration of IIS on a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. If proper security mitigations are not followed, the chance of successful attack increases significantly." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Web Management Service" + compliance: + - cis: ["5.33"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMSvc' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMSvc -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMSvc -> Start -> 4' + + - id: 15607 + title: "Ensure 'Windows Error Reporting Service (WerSvc)' is set to 'Disabled'." + description: "Allows errors to be reported when programs stop working or responding and allows existing solutions to be delivered. Also allows logs to be generated for diagnostic and repair services. The recommended state for this setting is: Disabled." + rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Error Reporting Service" + compliance: + - cis: ["5.34"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WerSvc -> Start -> 4' + + - id: 15608 + title: "Ensure 'Windows Event Collector (Wecsvc)' is set to 'Disabled'." + description: "This service manages persistent subscriptions to events from remote sources that support WS-Management protocol. This includes Windows Vista event logs, hardware and IPMI-enabled event sources. The service stores forwarded events in a local Event Log. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, remote connections to secure workstations should be minimized, and management functions should be done locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Event Collector" + compliance: + - cis: ["5.35"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Wecsvc -> Start -> 4' + + - id: 15609 + title: "Ensure 'Windows Media Player Network Sharing Service (WMPNetworkSvc)' is set to 'Disabled' or 'Not Installed'." + description: "Shares Windows Media Player libraries to other networked players and media devices using Universal Plug and Play. The recommended state for this setting is: Disabled or Not Installed." + rationale: "Network sharing of media from Media Player has no place in an enterprise managed environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Media Player Network Sharing Service" + compliance: + - cis: ["5.36"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMPNetworkSvc' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMPNetworkSvc -> Start -> 4' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMPNetworkSvc -> Start -> 4' + + - id: 15610 + title: "Ensure 'Windows Mobile Hotspot Service (icssvc)' is set to 'Disabled'." + description: "Provides the ability to share a cellular data connection with another device. The recommended state for this setting is: Disabled." + rationale: "The capability to run a mobile hotspot from a domain-connected computer could easily expose the internal network to wardrivers or other hackers." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Mobile Hotspot Service" + compliance: + - cis: ["5.37"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\icssvc -> Start -> 4' + + - id: 15611 + title: "Ensure 'Windows Push Notifications System Service (WpnService)' is set to 'Disabled'." + description: "This service runs in session 0 and hosts the notification platform and connection provider which handles the connection between the device and WNS server. The recommended state for this setting is: Disabled. Note: In the first two releases of Windows 10 (R1507 & R1511), the display name of this service was initially named Windows Push Notifications Service - but it was renamed to Windows Push Notifications System Service starting with Windows 10 R1607." + rationale: "Windows Push Notification Services (WNS) is a mechanism to receive 3rd-party notifications and updates from the cloud/Internet. In a high security environment, external systems, especially those hosted outside the organization, should be prevented from having an impact on the secure workstations." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Push Notifications System Service" + compliance: + - cis: ["5.38"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WpnService -> Start -> 4' + + - id: 15612 + title: "Ensure 'Windows PushToInstall Service (PushToInstall)' is set to 'Disabled'." + description: "This service manages Apps that are pushed to the device from the Microsoft Store App running on other devices or the web. The recommended state for this setting is: Disabled." + rationale: "In a high security managed environment, application installations should be managed centrally by IT staff, not by end users." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows PushToInstall Service (PushToInstall)" + compliance: + - cis: ["5.39"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PushToInstall -> Start -> 4' + + - id: 15613 + title: "Ensure 'Windows Remote Management (WS-Management) (WinRM)' is set to 'Disabled'." + description: "Windows Remote Management (WinRM) service implements the WS-Management protocol for remote management. WS-Management is a standard web services protocol used for remote software and hardware management. The WinRM service listens on the network for WS-Management requests and processes them. The recommended state for this setting is: Disabled." + rationale: "Features that enable inbound network connections increase the attack surface. In a high security environment, management of secure workstations should be handled locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Remote Management (WS-Management)" + compliance: + - cis: ["5.40"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinRM -> Start -> 4' + + - id: 15614 + title: "Ensure 'World Wide Web Publishing Service (W3SVC)' is set to 'Disabled' or 'Not Installed'." + description: "Provides Web connectivity and administration through the Internet Information Services Manager. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Internet Information Services - World Wide Web Services). Note #2: An organization may choose to selectively grant exceptions to web developers to allow IIS (or another web server) on their workstation, in order for them to locally test & develop web pages. However, the organization should track those machines and ensure the security controls and mitigations are kept up to date, to reduce risk of compromise." + rationale: "Hosting a website from a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. If proper security mitigations are not followed, the chance of successful attack increases significantly. Note: This security concern applies to any web server application installed on a workstation, not just IIS." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\World Wide Web Publishing Service" + compliance: + - cis: ["5.41"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC -> Start -> 4' + + - id: 15615 + title: "Ensure 'Xbox Accessory Management Service (XboxGipSvc)' is set to 'Disabled'." + description: "This service manages connected Xbox Accessories. The recommended state for this setting is: Disabled." + rationale: "Xbox Live is a gaming service and has no place in an enterprise managed environment (perhaps unless it is a gaming company)." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Xbox Accessory Management Service" + compliance: + - cis: ["5.42"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XboxGipSvc -> Start -> 4' + + - id: 15616 + title: "Ensure 'Xbox Live Auth Manager (XblAuthManager)' is set to 'Disabled'." + description: "Provides authentication and authorization services for interacting with Xbox Live. The recommended state for this setting is: Disabled." + rationale: "Xbox Live is a gaming service and has no place in an enterprise managed environment (perhaps unless it is a gaming company)." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Xbox Live Auth Manager" + compliance: + - cis: ["5.43"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XblAuthManager -> Start -> 4' + + - id: 15617 + title: "Ensure 'Xbox Live Game Save (XblGameSave)' is set to 'Disabled'." + description: "This service syncs save data for Xbox Live save enabled games. The recommended state for this setting is: Disabled." + rationale: "Xbox Live is a gaming service and has no place in an enterprise managed environment (perhaps unless it is a gaming company)." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Xbox Live Game Save" + compliance: + - cis: ["5.44"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XblGameSave -> Start -> 4' + + - id: 15618 + title: "Ensure 'Xbox Live Networking Service (XboxNetApiSvc)' is set to 'Disabled'." + description: "This service supports the Windows.Networking.XboxLive application programming interface. The recommended state for this setting is: Disabled." + rationale: "Xbox Live is a gaming service and has no place in an enterprise managed environment (perhaps unless it is a gaming company)." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Xbox Live Networking Service" + compliance: + - cis: ["5.45"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XboxNetApiSvc -> Start -> 4' + + - id: 15619 + title: "Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)'." + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Firewall state" + compliance: + - cis: ["9.1.1"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall -> 1' + + - id: 15620 + title: "Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)'." + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Inbound connections" + compliance: + - cis: ["9.1.2"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction -> 1' + + - id: 15621 + title: "Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)'." + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default)." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Outbound connections" + compliance: + - cis: ["9.1.3"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction -> 0' + + - id: 15622 + title: "Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'." + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Settings Customize\\Display a notification" + compliance: + - cis: ["9.1.4"] + - cis_csc: ["4.5"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications -> 1' + + - id: 15623 + title: "Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SystemRoot%\\System32\\logfiles\\firewall\\domainfw.log'." + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SystemRoot%\\System32\\logfiles\\firewall\\domainfw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SystemRoot%\\System32\\logfiles\\firewall\\domainfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.1.5"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\domainfw.log' + + - id: 15624 + title: "Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16,384 KB or greater'." + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Size limit (KB)" + compliance: + - cis: ["9.1.6"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + - id: 15625 + title: "Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log dropped packets" + compliance: + - cis: ["9.1.7"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets -> 1' + + - id: 15626 + title: "Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log successful connections" + compliance: + - cis: ["9.1.8"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections -> 1' + + - id: 15627 + title: "Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)'." + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Firewall state" + compliance: + - cis: ["9.2.1"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall -> 1' + + - id: 15628 + title: "Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)'." + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Inbound connections" + compliance: + - cis: ["9.2.2"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction -> 1' + + - id: 15629 + title: "Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)'." + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Outbound connections" + compliance: + - cis: ["9.2.3"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction -> 0' + + - id: 15630 + title: "Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'." + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Settings Customize\\Display a notification" + compliance: + - cis: ["9.2.4"] + - cis_csc: ["4.5"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications -> 1' + + - id: 15631 + title: "Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SystemRoot%\\System32\\logfiles\\firewall\\privatefw.log'." + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SystemRoot%\\System32\\logfiles\\firewall\\privatefw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SystemRoot%\\System32\\logfiles\\firewall\\privatefw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.2.5"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\privatefw.log' + + - id: 15632 + title: "Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16,384 KB or greater'." + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Size limit (KB)" + compliance: + - cis: ["9.2.6"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + - id: 15633 + title: "Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log dropped packets" + compliance: + - cis: ["9.2.7"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets -> 1' + + - id: 15634 + title: "Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log successful connections" + compliance: + - cis: ["9.2.8"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections -> 1' + + - id: 15635 + title: "Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'." + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Firewall state" + compliance: + - cis: ["9.3.1"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall -> 1' + + - id: 15636 + title: "Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)'." + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Inbound connections" + compliance: + - cis: ["9.3.2"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction -> 1' + + - id: 15637 + title: "Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)'." + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Outbound connections" + compliance: + - cis: ["9.3.3"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction -> 0' + + - id: 15638 + title: "Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No'." + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No." + rationale: "Some organizations may prefer to avoid alarming users when firewall rules block certain types of network activity. However, notifications can be helpful when troubleshooting network issues involving the firewall." + remediation: "To establish the recommended configuration via GP, set the following UI path to 'No': Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Display a notification" + compliance: + - cis: ["9.3.4"] + - cis_csc: ["4.5"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications -> 1' + + - id: 15639 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'." + description: "This setting controls whether local administrators are allowed to create local firewall rules that apply together with firewall rules configured by Group Policy. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "When in the Public profile, there should be no special local firewall exceptions per computer. These settings should be managed by a centralized policy." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local firewall rules" + compliance: + - cis: ["9.3.5"] + - cis_csc: ["4.5"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge -> 0' + + - id: 15640 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'." + description: "This setting controls whether local administrators are allowed to create connection security rules that apply together with connection security rules configured by Group Policy. The recommended state for this setting is: No." + rationale: "Users with administrative privileges might create firewall rules that expose the system to remote attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local connection security rules" + compliance: + - cis: ["9.3.6"] + - cis_csc: ["4.5"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0' + + - id: 15641 + title: "Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SystemRoot%\\System32\\logfiles\\firewall\\publicfw.log'." + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SystemRoot%\\System32\\logfiles\\firewall\\publicfw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SystemRoot%\\System32\\logfiles\\firewall\\publicfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.3.7"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\publicfw.log' + + - id: 15642 + title: "Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16,384 KB or greater'." + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Size limit (KB)" + compliance: + - cis: ["9.3.8"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + - id: 15643 + title: "Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log dropped packets" + compliance: + - cis: ["9.3.9"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets -> 1' + + - id: 15644 + title: "Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log successful connections" + compliance: + - cis: ["9.3.10"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections -> 1' + + - id: 15645 + title: "Ensure 'Audit Credential Validation' is set to 'Success and Failure'." + description: "This subcategory reports the results of validation tests on credentials submitted for a user account logon request. These events occur on the computer that is authoritative for the credentials. For domain accounts, the Domain Controller is authoritative, whereas for local accounts, the local computer is authoritative. In domain environments, most of the Account Logon events occur in the Security log of the Domain Controllers that are authoritative for the domain accounts. However, these events can occur on other computers in the organization when local accounts are used to log on. Events for this subcategory include: - 4774: An account was mapped for logon. - 4775: An account could not be mapped for logon. - 4776: The Domain Controller attempted to validate the credentials for an account. - 4777: The Domain Controller failed to validate the credentials for an account. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Logon\\Audit Credential Validation" + compliance: + - cis: ["17.1.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Credential Validation" -> r:Success and Failure' + + - id: 15646 + title: "Ensure 'Audit Application Group Management' is set to 'Success and Failure'." + description: "This policy setting allows you to audit events generated by changes to application groups such as the following: - Application group is created, changed, or deleted. - Member is added or removed from an application group. Application groups are utilized by Windows Authorization Manager, which is a flexible framework created by Microsoft for integrating role-based access control (RBAC) into applications. More information on Windows Authorization Manager is available at MSDN - Windows Authorization Manager. The recommended state for this setting is: Success and Failure." + rationale: "Auditing events in this category may be useful when investigating an incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Application Group Management" + compliance: + - cis: ["17.2.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Application Group Management" -> r:Success and Failure' + + - id: 15647 + title: "Ensure 'Audit Security Group Management' is set to include 'Success'." + description: "This subcategory reports each event of security group management, such as when a security group is created, changed, or deleted or when a member is added to or removed from a security group. If you enable this Audit policy setting, administrators can track events to detect malicious, accidental, and authorized creation of security group accounts. Events for this subcategory include: - 4727: A security-enabled global group was created. - 4728: A member was added to a security-enabled global group. - 4729: A member was removed from a security-enabled global group. - 4730: A security-enabled global group was deleted. - 4731: A security-enabled local group was created. - 4732: A member was added to a security-enabled local group. - 4733: A member was removed from a security-enabled local group. - 4734: A security-enabled local group was deleted. - 4735: A security-enabled local group was changed. - 4737: A security-enabled global group was changed. - 4754: A security-enabled universal group was created. - 4755: A security-enabled universal group was changed. - 4756: A member was added to a security-enabled universal group. - 4757: A member was removed from a security-enabled universal group. - 4758: A security-enabled universal group was deleted. - 4764: A group's type was changed. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Security Group Management" + compliance: + - cis: ["17.2.2"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Security Group Management" -> r:Success' + + - id: 15648 + title: "Ensure 'Audit User Account Management' is set to 'Success and Failure'." + description: "This subcategory reports each event of user account management, such as when a user account is created, changed, or deleted; a user account is renamed, disabled, or enabled; or a password is set or changed. If you enable this Audit policy setting, administrators can track events to detect malicious, accidental, and authorized creation of user accounts. Events for this subcategory include: - 4720: A user account was created. - 4722: A user account was enabled. - 4723: An attempt was made to change an account's password. - 4724: An attempt was made to reset an account's password. - 4725: A user account was disabled. - 4726: A user account was deleted. - 4738: A user account was changed. - 4740: A user account was locked out. - 4765: SID History was added to an account. - 4766: An attempt to add SID History to an account failed. - 4767: A user account was unlocked. - 4780: The ACL was set on accounts which are members of administrators groups. - 4781: The name of an account was changed: - 4794: An attempt was made to set the Directory Services Restore Mode. - 5376: Credential Manager credentials were backed up. - 5377: Credential Manager credentials were restored from a backup. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit User Account Management" + compliance: + - cis: ["17.2.3"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"User Account Management" -> r:Success and Failure' + + - id: 15649 + title: "Ensure 'Audit PNP Activity' is set to include 'Success'." + description: "This policy setting allows you to audit when plug and play detects an external device. The recommended state for this setting is to include: Success. Note: A Windows 10, Server 2016 or newer OS is required to access and set this value in Group Policy." + rationale: "Enabling this setting will allow a user to audit events when a device is plugged into a system. This can help alert IT staff if unapproved devices are plugged in." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Detailed Tracking\\Audit PNP Activity" + compliance: + - cis: ["17.3.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Plug and Play Events" -> r:Success' + + - id: 15650 + title: "Ensure 'Audit Process Creation' is set to include 'Success'." + description: "This subcategory reports the creation of a process and the name of the program or user that created it. Events for this subcategory include: - 4688: A new process has been created. - 4696: A primary token was assigned to process. Refer to Microsoft Knowledge Base article 947226: Description of security events in Windows Vista and in Windows Server 2008 for the most recent information about this setting. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Detailed Tracking\\Audit Process Creation" + compliance: + - cis: ["17.3.2"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Process Creation" -> r:Success' + + - id: 15651 + title: "Ensure 'Audit Account Lockout' is set to include 'Failure'." + description: "This subcategory reports when a user's account is locked out as a result of too many failed logon attempts. Events for this subcategory include: - 4625: An account failed to log on. The recommended state for this setting is to include: Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Account Lockout" + compliance: + - cis: ["17.5.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Account Lockout" -> r:Failure' + + - id: 15652 + title: "Ensure 'Audit Group Membership' is set to include 'Success'." + description: "This policy allows you to audit the group membership information in the user’s logon token. Events in this subcategory are generated on the computer on which a logon session is created. For an interactive logon, the security audit event is generated on the computer that the user logged on to. For a network logon, such as accessing a shared folder on the network, the security audit event is generated on the computer hosting the resource. The recommended state for this setting is to include: Success. Note: A Windows 10, Server 2016 or newer OS is required to access and set this value in Group Policy." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Group Membership" + compliance: + - cis: ["17.5.2"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Group Membership" -> r:Success' + + - id: 15653 + title: "Ensure 'Audit Logoff' is set to include 'Success'." + description: "This subcategory reports when a user logs off from the system. These events occur on the accessed computer. For interactive logons, the generation of these events occurs on the computer that is logged on to. If a network logon takes place to access a share, these events generate on the computer that hosts the accessed resource. If you configure this setting to No auditing, it is difficult or impossible to determine which user has accessed or attempted to access organization computers. Events for this subcategory include: - 4634: An account was logged off. - 4647: User initiated logoff. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Logoff" + compliance: + - cis: ["17.5.3"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Logoff" -> r:Success' + + - id: 15654 + title: "Ensure 'Audit Logon' is set to 'Success and Failure'." + description: "This subcategory reports when a user attempts to log on to the system. These events occur on the accessed computer. For interactive logons, the generation of these events occurs on the computer that is logged on to. If a network logon takes place to access a share, these events generate on the computer that hosts the accessed resource. If you configure this setting to No auditing, it is difficult or impossible to determine which user has accessed or attempted to access organization computers. Events for this subcategory include: - 4624: An account was successfully logged on. - 4625: An account failed to log on. - 4648: A logon was attempted using explicit credentials. - 4675: SIDs were filtered. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Logon" + compliance: + - cis: ["17.5.4"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Logon" -> r:Success and Failure' + + - id: 15655 + title: "Ensure 'Audit Other Logon/Logoff Events' is set to 'Success and Failure'." + description: "This subcategory reports other logon/logoff-related events, such as Remote Desktop Services session disconnects and reconnects, using RunAs to run processes under a different account, and locking and unlocking a workstation. Events for this subcategory include: - 4649: A replay attack was detected. - 4778: A session was reconnected to a Window Station. - 4779: A session was disconnected from a Window Station. - 4800: The workstation was locked. - 4801: The workstation was unlocked. - 4802: The screen saver was invoked. - 4803: The screen saver was dismissed. - 5378: The requested credentials delegation was disallowed by policy. - 5632: A request was made to authenticate to a wireless network. - 5633: A request was made to authenticate to a wired network. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Other Logon/Logoff Events" + compliance: + - cis: ["17.5.5"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Other Logon/Logoff Events" -> r:Success and Failure' + + - id: 15656 + title: "Ensure 'Audit Special Logon' is set to include 'Success'." + description: "This subcategory reports when a special logon is used. A special logon is a logon that has administrator-equivalent privileges and can be used to elevate a process to a higher level. Events for this subcategory include: - 4964 : Special groups have been assigned to a new logon. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Special Logon" + compliance: + - cis: ["17.5.6"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Special Logon" -> r:Success' + + - id: 15657 + title: "Ensure 'Audit Detailed File Share' is set to include 'Failure'." + description: "This subcategory allows you to audit attempts to access files and folders on a shared folder. Events for this subcategory include: - 5145: network share object was checked to see whether client can be granted desired access. The recommended state for this setting is to include: Failure." + rationale: "Auditing the Failures will log which unauthorized users attempted (and failed) to get access to a file or folder on a network share on this computer, which could possibly be an indication of malicious intent." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit Detailed File Share" + compliance: + - cis: ["17.6.1"] + - cis_csc: ["3.3", "8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Detailed File Share" -> r:Failure' + + - id: 15658 + title: "Ensure 'Audit File Share' is set to 'Success and Failure'." + description: "This policy setting allows you to audit attempts to access a shared folder. The recommended state for this setting is: Success and Failure. Note: There are no system access control lists (SACLs) for shared folders. If this policy setting is enabled, access to all shared folders on the system is audited." + rationale: "In an enterprise managed environment, workstations should have limited file sharing activity, as file servers would normally handle the overall burden of file sharing activities. Any unusual file sharing activity on workstations may therefore be useful in an investigation of potentially malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit File Share" + compliance: + - cis: ["17.6.2"] + - cis_csc: ["3.3", "8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"File Share" -> r:Success and Failure' + + - id: 15659 + title: "Ensure 'Audit Other Object Access Events' is set to 'Success and Failure'." + description: "This policy setting allows you to audit events generated by the management of task scheduler jobs or COM+ objects. For scheduler jobs, the following are audited: - Job created. - Job deleted. - Job enabled. - Job disabled. - Job updated. For COM+ objects, the following are audited: - Catalog object added. - Catalog object updated. - Catalog object deleted. The recommended state for this setting is: Success and Failure." + rationale: "The unexpected creation of scheduled tasks and COM+ objects could potentially be an indication of malicious activity. Since these types of actions are generally low volume, it may be useful to capture them in the audit logs for use during an investigation." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit Other Object Access Events" + compliance: + - cis: ["17.6.3"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Other Object Access Events" -> r:Success and Failure' + + - id: 15660 + title: "Ensure 'Audit Removable Storage' is set to 'Success and Failure'." + description: "This policy setting allows you to audit user attempts to access file system objects on a removable storage device. A security audit event is generated only for all objects for all types of access requested. If you configure this policy setting, an audit event is generated each time an account accesses a file system object on a removable storage. Success audits record successful attempts and Failure audits record unsuccessful attempts. If you do not configure this policy setting, no audit event is generated when an account accesses a file system object on a removable storage. The recommended state for this setting is: Success and Failure. Note: A Windows 8.0, Server 2012 (non-R2) or newer OS is required to access and set this value in Group Policy." + rationale: "Auditing removable storage may be useful when investigating an incident. For example, if an individual is suspected of copying sensitive information onto a USB drive." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit Removable Storage" + compliance: + - cis: ["17.6.4"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Removable Storage" -> r:Success and Failure' + + - id: 15661 + title: "Ensure 'Audit Audit Policy Change' is set to include 'Success'." + description: "This subcategory reports changes in audit policy including SACL changes. Events for this subcategory include: - 4715: The audit policy (SACL) on an object was changed. - 4719: System audit policy was changed. - 4902: The Per-user audit policy table was created. - 4904: An attempt was made to register a security event source. - 4905: An attempt was made to unregister a security event source. - 4906: The CrashOnAuditFail value has changed. - 4907: Auditing settings on object were changed. - 4908: Special Groups Logon table modified. - 4912: Per User Audit Policy was changed. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Audit Policy Change" + compliance: + - cis: ["17.7.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Audit Policy Change" -> r:Success' + + - id: 15662 + title: "Ensure 'Audit Authentication Policy Change' is set to include 'Success'." + description: "This subcategory reports changes in authentication policy. Events for this subcategory include - 4706: A new trust was created to a domain. - 4707: A trust to a domain was removed. - 4713: Kerberos policy was changed. - 4716: Trusted domain information was modified. - 4717: System security access was granted to an account. - 4718: System security access was removed from an account. - 4739: Domain Policy was changed. - 4864: A namespace collision was detected. - 4865: A trusted forest information entry was added. - 4866: A trusted forest information entry was removed. - 4867: A trusted forest information entry was modified. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Authentication Policy Change" + compliance: + - cis: ["17.7.2"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Authentication Policy Change" -> r:Success' + + - id: 15663 + title: "Ensure 'Audit Authorization Policy Change' is set to include 'Success'." + description: "This subcategory reports changes in authorization policy. Events for this subcategory include: - 4704: A user right was assigned. - 4705: A user right was removed. - 4706: A new trust was created to a domain. - 4707: A trust to a domain was removed. - 4714: Encrypted data recovery policy was changed. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Authorization Policy Change" + compliance: + - cis: ["17.7.3"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Authorization Policy Change" -> r:Success' + + - id: 15664 + title: "Ensure 'Audit MPSSVC Rule-Level Policy Change' is set to 'Success and Failure'." + description: "This subcategory determines whether the operating system generates audit events when changes are made to policy rules for the Microsoft Protection Service (MPSSVC.exe). Events for this subcategory include: - 4944: The following policy was active when the Windows Firewall started. - 4945: A rule was listed when the Windows Firewall started. - 4946: A change has been made to Windows Firewall exception list. A rule was added. - 4947: A change has been made to Windows Firewall exception list. A rule was modified. - 4948: A change has been made to Windows Firewall exception list. A rule was deleted. - 4949: Windows Firewall settings were restored to the default values. - 4950: A Windows Firewall setting has changed. - 4951: A rule has been ignored because its major version number was not recognized by Windows Firewall. - 4952: Parts of a rule have been ignored because its minor version number was not recognized by Windows Firewall. The other parts of the rule will be enforced. - 4953: A rule has been ignored by Windows Firewall because it could not parse the rule. - 4954: Windows Firewall Group Policy settings have changed. The new settings have been applied. - 4956: Windows Firewall has changed the active profile. - 4957: Windows Firewall did not apply the following rule. - 4958: Windows Firewall did not apply the following rule because the rule referred to items not configured on this computer. The recommended state for this setting is : Success and Failure" + rationale: "Changes to firewall rules are important for understanding the security state of the computer and how well it is protected against network attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit MPSSVC Rule-Level Policy Change" + compliance: + - cis: ["17.7.4"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"MPSSVC Rule-Level Policy Change" -> r:Success and Failure' + + - id: 15665 + title: "Ensure 'Audit Other Policy Change Events' is set to include 'Failure'." + description: "This subcategory contains events about EFS Data Recovery Agent policy changes, changes in Windows Filtering Platform filter, status on Security policy settings updates for local Group Policy settings, Central Access Policy changes, and detailed troubleshooting events for Cryptographic Next Generation (CNG) operations. - 5063: A cryptographic provider operation was attempted. - 5064: A cryptographic context operation was attempted. - 5065: A cryptographic context modification was attempted. - 5066: A cryptographic function operation was attempted. - 5067: A cryptographic function modification was attempted. - 5068: A cryptographic function provider operation was attempted. - 5069: A cryptographic function property operation was attempted. - 5070: A cryptographic function property modification was attempted. - 6145: One or more errors occurred while processing security policy in the group policy objects. The recommended state for this setting is to include: Failure." + rationale: "This setting can help detect errors in applied Security settings which came from Group Policy, and failure events related to Cryptographic Next Generation (CNG) functions." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Other Policy Change Events" + compliance: + - cis: ["17.7.5"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Other Policy Change Events" -> r:Failure' + + - id: 15666 + title: "Ensure 'Audit Sensitive Privilege Use' is set to 'Success and Failure'." + description: "This subcategory reports when a user account or service uses a sensitive privilege. A sensitive privilege includes the following user rights: - Act as part of the operating system - Back up files and directories - Create a token object - Debug programs - Enable computer and user accounts to be trusted for delegation - Generate security audits - Impersonate a client after authentication - Load and unload device drivers - Manage auditing and security log - Modify firmware environment values - Replace a process-level token - Restore files and directories - Take ownership of files or other objects Auditing this subcategory will create a high volume of events. Events for this subcategory include: - 4672: Special privileges assigned to new logon. - 4673: A privileged service was called. - 4674: An operation was attempted on a privileged object. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Privilege Use\\Audit Sensitive Privilege Use" + compliance: + - cis: ["17.8.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Sensitive Privilege Use" -> r:Success and Failure' + + - id: 15667 + title: "Ensure 'Audit IPsec Driver' is set to 'Success and Failure'." + description: "This subcategory reports on the activities of the Internet Protocol security (IPsec) driver. Events for this subcategory include: - 4960: IPsec dropped an inbound packet that failed an integrity check. If this problem persists, it could indicate a network issue or that packets are being modified in transit to this computer. Verify that the packets sent from the remote computer are the same as those received by this computer. This error might also indicate interoperability problems with other IPsec implementations. - 4961: IPsec dropped an inbound packet that failed a replay check. If this problem persists, it could indicate a replay attack against this computer. - 4962: IPsec dropped an inbound packet that failed a replay check. The inbound packet had too low a sequence number to ensure it was not a replay. - 4963: IPsec dropped an inbound clear text packet that should have been secured. This is usually due to the remote computer changing its IPsec policy without informing this computer. This could also be a spoofing attack attempt. - 4965: IPsec received a packet from a remote computer with an incorrect Security Parameter Index (SPI). This is usually caused by malfunctioning hardware that is corrupting packets. If these errors persist, verify that the packets sent from the remote computer are the same as those received by this computer. This error may also indicate interoperability problems with other IPsec implementations. In that case, if connectivity is not impeded, then these events can be ignored. - 5478: IPsec Services has started successfully. - 5479: IPsec Services has been shut down successfully. The shutdown of IPsec Services can put the computer at greater risk of network attack or expose the computer to potential security risks. - 5480: IPsec Services failed to get the complete list of network interfaces on the computer. This poses a potential security risk because some of the network interfaces may not get the protection provided by the applied IPsec filters. Use the IP Security Monitor snap-in to diagnose the problem. - 5483: IPsec Services failed to initialize RPC server. IPsec Services could not be started.- 5484: IPsec Services has experienced a critical failure and has been shut down. The shutdown of IPsec Services can put the computer at greater risk of network attack or expose the computer to potential security risks. - 5485: IPsec Services failed to process some IPsec filters on a plug-and-play event for network interfaces. This poses a potential security risk because some of the network interfaces may not get the protection provided by the applied IPsec filters. Use the IP Security Monitor snap-in to diagnose the problem. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit IPsec Driver" + compliance: + - cis: ["17.9.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"IPsec Driver" -> r:Success and Failure' + + - id: 15668 + title: "Ensure 'Audit Other System Events' is set to 'Success and Failure'." + description: "This subcategory reports on other system events. Events for this subcategory include: - 5024 : The Windows Firewall Service has started successfully. - 5025 : The Windows Firewall Service has been stopped. - 5027 : The Windows Firewall Service was unable to retrieve the security policy from the local storage. The service will continue enforcing the current policy. - 5028 : The Windows Firewall Service was unable to parse the new security policy. The service will continue with currently enforced policy. - 5029: The Windows Firewall Service failed to initialize the driver. The service will continue to enforce the current policy. - 5030: The Windows Firewall Service failed to start. - 5032: Windows Firewall was unable to notify the user that it blocked an application from accepting incoming connections on the network. - 5033 : The Windows Firewall Driver has started successfully. - 5034 : The Windows Firewall Driver has been stopped. - 5035 : The Windows Firewall Driver failed to start. - 5037 : The Windows Firewall Driver detected critical runtime error. Terminating. - 5058: Key file operation. - 5059: Key migration operation. The recommended state for this setting is: Success and Failure." + rationale: "Capturing these audit events may be useful for identifying when the Windows Firewall is not performing as expected." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit Other System Events" + compliance: + - cis: ["17.9.2"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Other System Events" -> r:Success and Failure' + + - id: 15669 + title: "Ensure 'Audit Security State Change' is set to include 'Success'." + description: "This subcategory reports changes in security state of the system, such as when the security subsystem starts and stops. Events for this subcategory include: - 4608: Windows is starting up. - 4609: Windows is shutting down. - 4616: The system time was changed. - 4621: Administrator recovered system from CrashOnAuditFail. Users who are not administrators will now be allowed to log on. Some audit-able activity might not have been recorded. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit Security State Change" + compliance: + - cis: ["17.9.3"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Security State Change" -> r:Success' + + - id: 15670 + title: "Ensure 'Audit Security System Extension' is set to include 'Success'." + description: "This subcategory reports the loading of extension code such as authentication packages by the security subsystem. Events for this subcategory include: - 4610: An authentication package has been loaded by the Local Security Authority. - 4611: A trusted logon process has been registered with the Local Security Authority. - 4614: A notification package has been loaded by the Security Account Manager. - 4622: A security package has been loaded by the Local Security Authority. - 4697: A service was installed in the system. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit Security System Extension" + compliance: + - cis: ["17.9.4"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Security System Extension" -> r:Success' + + - id: 15671 + title: "Ensure 'Audit System Integrity' is set to 'Success and Failure'." + description: "This subcategory reports on violations of integrity of the security subsystem. Events for this subcategory include: - 4612 : Internal resources allocated for the queuing of audit messages have been exhausted, leading to the loss of some audits. - 4615 : Invalid use of LPC port. - 4618 : A monitored security event pattern has occurred. - 4816 : RPC detected an integrity violation while decrypting an incoming message. - 5038 : Code integrity determined that the image hash of a file is not valid. The file could be corrupt due to unauthorized modification or the invalid hash could indicate a potential disk device error. - 5056: A cryptographic self test was performed. - 5057: A cryptographic primitive operation failed. - 5060: Verification operation failed. - 5061: Cryptographic operation. - 5062: A kernel-mode cryptographic self test was performed. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit System Integrity" + compliance: + - cis: ["17.9.5"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"System Integrity" -> r:Success and Failure' + + - id: 15672 + title: "Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'." + description: "Disables the lock screen camera toggle switch in PC Settings and prevents a camera from being invoked on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen camera extends the protection afforded by the lock screen to camera features." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen camera. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera -> 1' + + - id: 15673 + title: "Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'." + description: "Disables the lock screen slide show settings in PC Settings and prevents a slide show from playing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen slide show extends the protection afforded by the lock screen to slide show contents." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen slide show. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow ' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow -> 1' + + - id: 15674 + title: "Ensure 'Allow users to enable online speech recognition services' is set to 'Disabled'." + description: "This policy enables the automatic learning component of input personalization that includes speech, inking, and typing. Automatic learning enables the collection of speech and handwriting patterns, typing history, contacts, and recent calendar information. It is required for the use of Cortana. Some of this collected information may be stored on the user's OneDrive, in the case of inking and typing; some of the information will be uploaded to Microsoft to personalize speech. The recommended state for this setting is: Disabled." + rationale: "If this setting is Enabled sensitive information could be stored in the cloud or sent to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Regional and Language Options\\Allow users to enable online speech recognition services. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow input personalization, but it was renamed to Allow users to enable online speech recognition services starting with the Windows 10 R1809 & Server 2019 Administrative Templates." + compliance: + - cis: ["18.1.2.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization -> AllowInputPersonalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization -> AllowInputPersonalization -> 0' + + - id: 15675 + title: "Ensure 'Allow Online Tips' is set to 'Disabled'." + description: "This policy setting configures the retrieval of online tips and help for the Settings app. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Allow Online Tips. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanel.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.3"] + - pci_dss: ["1.3.4"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> AllowOnlineTips' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> AllowOnlineTips -> 0' + + - id: 15676 + title: "Ensure LAPS AdmPwd GPO Extension / CSE is installed." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "In order to utilize LAPS, a minor Active Directory Schema update is required, and a Group Policy Client Side Extension (CSE) must be installed on each managed computer. When LAPS is installed, the file AdmPwd.dll must be present in the following location and registered in Windows (the LAPS AdmPwd GPO Extension / CSE installation does this for you): C:\\Program Files\\LAPS\\CSE\\AdmPwd.dll" + compliance: + - cis: ["18.2.1"] + - cis_csc: ["5.2", "5.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + + - id: 15677 + title: "Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled'." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Do not allow password expiration time longer than required by policy. Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.2"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled -> 1' + + - id: 15678 + title: "Ensure 'Enable Local Admin Password Management' is set to 'Enabled'." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Enable Local Admin Password Management. Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.3"] + - cis_csc: ["5.2", "5.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled -> 1' + + - id: 15679 + title: "Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters'." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: Large letters + small letters + numbers + special characters. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Complexity option to Large letters + small letters + numbers + special characters: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings. Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.4"] + - cis_csc: ["5.2"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity -> 4' + + - id: 15680 + title: "Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more'." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 15 or more. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Length option to 15 or more: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings. Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.5"] + - cis_csc: ["5.2"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> n:^(\d+) compare >= 15' + + - id: 15681 + title: "Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer'." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 30 or fewer. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Age (Days) option to 30 or fewer: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings. Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.6"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> n:^(\d+) compare <= 30' + + - id: 15682 + title: "Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled'." + description: "This setting controls whether local accounts can be used for remote administration via network logon (e.g., NET USE, connecting to C$, etc.). Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Enabling this policy significantly reduces that risk. Enabled: Applies UAC token-filtering to local accounts on network logons. Membership in powerful group such as Administrators is disabled and powerful privileges are removed from the resulting access token. This configures the LocalAccountTokenFilterPolicy registry value to 0. This is the default behavior for Windows. Disabled: Allows local accounts to have full administrative rights when authenticating via network logon, by configuring the LocalAccountTokenFilterPolicy registry value to 1. For more information about local accounts and credential theft, review the 'Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques' documents. For more information about LocalAccountTokenFilterPolicy, see Microsoft Knowledge Base article 951016: Description of User Account Control and remote restrictions in Windows Vista. The recommended state for this setting is: Enabled." + rationale: "Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Ensuring this policy is Enabled significantly reduces that risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Apply UAC restrictions to local accounts on network logons. Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required." + compliance: + - cis: ["18.3.1"] + - cis_csc: ["5.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy -> 0' + + - id: 15683 + title: "Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver'." + description: "This setting configures the start type for the Server Message Block version 1 (SMBv1) client driver service (MRxSmb10), which is recommended to be disabled. The recommended state for this setting is: Enabled: Disable driver (recommended). Note: Do not, under any circumstances, configure this overall setting as Disabled, as doing so will delete the underlying registry entry altogether, which will cause serious problems." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable driver (recommended): Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 client driver. Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required." + compliance: + - cis: ["18.3.2"] + - cis_csc: ["4.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start -> 4' + + - id: 15684 + title: "Ensure 'Configure SMB v1 server' is set to 'Disabled'." + description: "This setting configures the server-side processing of the Server Message Block version 1 (SMBv1) protocol. The recommended state for this setting is: Disabled." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 server. Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required." + compliance: + - cis: ["18.3.3"] + - cis_csc: ["4.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1 -> 0' + + - id: 15685 + title: "Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled'." + description: "Windows includes support for Structured Exception Handling Overwrite Protection (SEHOP). We recommend enabling this feature to improve the security profile of the computer. The recommended state for this setting is: Enabled." + rationale: "This feature is designed to block exploits that use the Structured Exception Handler (SEH) overwrite technique. This protection mechanism is provided at run-time. Therefore, it helps protect applications regardless of whether they have been compiled with the latest improvements, such as the /SAFESEH option." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Enable Structured Exception Handling Overwrite Protection (SEHOP). Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required." + compliance: + - cis: ["18.3.4"] + - cis_csc: ["10.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation -> 0' + + - id: 15686 + title: "Ensure 'Limits print driver installation to Administrators' is set to 'Enabled'." + description: "This policy setting controls whether users that aren't Administrators can install print drivers on the system. The recommended state for this setting is: Enabled. Note: On August 10, 2021, Microsoft announced a Point and Print Default Behavior Change which modifies the default Point and Print driver installation and update behavior to require Administrator privileges. This is documented in KB5005652—Manage new Point and Print default driver installation behavior (CVE-2021-34481)." + rationale: "Restricting the installation of print drives to Administrators can help mitigate the PrintNightmare vulnerability (CVE-2021-34527) and other Print Spooler attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Limits print driver installation to Administrators. Note: This Group Policy path does not exist by default. An additional Group Policy template SecGuide.admx/adml is required." + compliance: + - cis: ["18.3.5"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsNT\Printers\PointAndPrint' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsNT\Printers\PointAndPrint -> RestrictDriverInstallationToAdministrators' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsNT\Printers\PointAndPrint -> RestrictDriverInstallationToAdministrators -> 1' + + - id: 15687 + title: "Ensure 'NetBT NodeType configuration' is set to 'Enabled: P-node'." + description: "This setting determines which method NetBIOS over TCP/IP (NetBT) uses to register and resolve names. The available methods are: The B-node (broadcast) method only uses broadcasts. The P-node (point-to-point) method only uses name queries to a name server (WINS). The M-node (mixed) method broadcasts first, then queries a name server (WINS) if broadcast failed. The H-node (hybrid) method queries a name server (WINS) first, then broadcasts if the query failed. The recommended state for this setting is: Enabled: P-node (recommended) (point-to- point). Note: Resolution through LMHOSTS or DNS follows these methods. If the NodeType registry value is present, it overrides any DhcpNodeType registry value. If neither NodeType nor DhcpNodeType is present, the computer uses B-node (broadcast) if there are no WINS servers configured for the network, or H-node (hybrid) if there is at least one WINS server configured." + rationale: "In order to help mitigate the risk of NetBIOS Name Service (NBT-NS) poisoning attacks, setting the node type to P-node (point-to-point) will prevent the system from sending out NetBIOS broadcasts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: P-node (recommended): Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\NetBT NodeType configuration. Note: This change does not take effect until the computer has been restarted. Note #2: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required." + compliance: + - cis: ["18.3.6"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NodeType' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NodeType -> 2' + + - id: 15688 + title: "Ensure 'WDigest Authentication' is set to 'Disabled'." + description: "When WDigest authentication is enabled, Lsass.exe retains a copy of the user's plaintext password in memory, where it can be at risk of theft. If this setting is not configured, WDigest authentication is disabled in Windows 8.1 and in Windows Server 2012 R2; it is enabled by default in earlier versions of Windows and Windows Server. For more information about local accounts and credential theft, review the 'Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques' documents. For more information about UseLogonCredential, see Microsoft Knowledge Base article 2871997: Microsoft Security Advisory Update to improve credentials protection and management May 13, 2014. The recommended state for this setting is: Disabled." + rationale: "Preventing the plaintext storage of credentials in memory may reduce opportunity for credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\WDigest Authentication (disabling may require KB2871997). Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required." + compliance: + - cis: ["18.3.7"] + - cis_csc: ["3.11"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential -> 0' + + - id: 15689 + title: "Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled'." + description: "This setting is separate from the Welcome screen feature in Windows XP and Windows Vista; if that feature is disabled, this setting is not disabled. If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks to which the computer is connected. Also, if you enable automatic logon, the password is stored in the registry in plaintext, and the specific registry key that stores this value is remotely readable by the Authenticated Users group. For additional information, see Microsoft Knowledge Base article 324737: How to turn on automatic logon in Windows. The recommended state for this setting is: Disabled." + rationale: "If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks that the computer is connected to. Also, if you enable automatic logon, the password is stored in the registry in plaintext. The specific registry key that stores this setting is remotely readable by the Authenticated Users group. As a result, this entry is appropriate only if the computer is physically secured and if you ensure that untrusted users cannot remotely see the registry." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.1"] + - cis_csc: ["3.11"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> 0' + + - id: 15690 + title: "Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'." + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should follow through the network. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.2"] + - cis_csc: ["4.8"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting -> 2' + + - id: 15691 + title: "Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'." + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should take through the network. It is recommended to configure this setting to Not Defined for enterprise environments and to Highest Protection for high security environments to completely disable source routing. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.3"] + - cis_csc: ["4.8"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting ' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting -> 2' + + - id: 15692 + title: "Ensure 'MSS: (DisableSavePassword) Prevent the dial-up password from being saved' is set to 'Enabled'." + description: 'When you dial a phonebook or VPN entry in Dial-Up Networking, you can use the "Save Password" option so that your Dial-Up Networking password is cached and you will not need to enter it on successive dial attempts. For security, administrators may want to prevent users from caching passwords. The recommended state for this setting is: Enabled.' + rationale: "An attacker who steals a mobile user's computer could automatically connect to the organization's network if the Save This Password check box is selected for the dial-up or VPN networking entry used to connect to your organization's network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(DisableSavePassword) Prevent the dial-up password from being saved. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.4"] + - cis_csc: ["4.8"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters -> DisableSavePassword' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters -> DisableSavePassword -> 1' + + - id: 15693 + title: "Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'." + description: "Internet Control Message Protocol (ICMP) redirects cause the IPv4 stack to plumb host routes. These routes override the Open Shortest Path First (OSPF) generated routes. The recommended state for this setting is: Disabled." + rationale: "This behavior is expected. The problem is that the 10 minute time-out period for the ICMP redirect-plumbed routes temporarily creates a network situation in which traffic will no longer be routed properly for the affected host. Ignoring such ICMP redirects will limit the system's exposure to attacks that will impact its ability to participate on the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.5"] + - cis_csc: ["4.8"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + - nist_800_53: ["SC.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect -> 0' + + - id: 15694 + title: "Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes (recommended)'." + description: "This value controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet. If the remote computer is still reachable, it acknowledges the keep-alive packet. The recommended state for this setting is: Enabled: 300,000 or 5 minutes (recommended)." + rationale: "An attacker who is able to connect to network applications could establish numerous connections to cause a DoS condition." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 300,000 or 5 minutes (recommended): Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.6"] + - cis_csc: ["4.8"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> 300000' + + - id: 15695 + title: "Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'." + description: "NetBIOS over TCP/IP is a network protocol that among other things provides a way to easily resolve NetBIOS names that are registered on Windows-based systems to the IP addresses that are configured on those systems. This setting determines whether the computer releases its NetBIOS name when it receives a name-release request. The recommended state for this setting is: Enabled." + rationale: "The NetBT protocol is designed not to use authentication, and is therefore vulnerable to spoofing. Spoofing makes a transmission appear to come from a user other than the user who performed the action. A malicious user could exploit the unauthenticated nature of the protocol to send a name-conflict datagram to a target computer, which would cause the computer to relinquish its name and not respond to queries. An attacker could send a request over the network and query a computer to release its NetBIOS name. As with any change that could affect applications, it is recommended that you test this change in a non-production environment before you change the production environment. The result of such an attack could be to cause intermittent connectivity issues on the target computer, or even to prevent the use of Network Neighborhood, domain logons, the NET SEND command, or additional NetBIOS name resolution." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.7"] + - cis_csc: ["4.8"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand -> 1' + + - id: 15696 + title: "Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'." + description: "This setting is used to enable or disable the Internet Router Discovery Protocol (IRDP), which allows the system to detect and configure default gateway addresses automatically as described in RFC 1256 on a per-interface basis. The recommended state for this setting is: Disabled." + rationale: "An attacker who has gained control of a computer on the same network segment could configure a computer on the network to impersonate a router. Other computers with IRDP enabled would then attempt to route their traffic through the already compromised computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.8"] + - cis_csc: ["4.8"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> 0' + + - id: 15697 + title: "Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'." + description: "The DLL search order can be configured to search for DLLs that are requested by running processes in one of two ways: - Search folders specified in the system path first, and then search the current working folder. - Search current working folder first, and then search the folders specified in the system path. When enabled, the registry value is set to 1. With a setting of 1, the system first searches the folders that are specified in the system path and then searches the current working folder. When disabled the registry value is set to 0 and the system first searches the current working folder and then searches the folders that are specified in the system path. Applications will be forced to search for DLLs in the system path first. For applications that require unique versions of these DLLs that are included with the application, this entry could cause performance or stability problems. The recommended state for this setting is: Enabled. Note: More information on how Safe DLL search mode works is available at this link: Dynamic-Link Library Search Order - Windows applications | Microsoft Docs" + rationale: "If a user unknowingly executes hostile code that was packaged with additional files that include modified versions of system DLLs, the hostile code could load its own versions of those DLLs and potentially increase the type and degree of damage the code can render." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.9"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode -> 1' + + - id: 15698 + title: "Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds'." + description: "Windows includes a grace period between when the screen saver is launched and when the console is actually locked automatically when screen saver locking is enabled. The recommended state for this setting is: Enabled: 5 or fewer seconds." + rationale: "The default grace period that is allowed for user movement before the screen saver lock takes effect is five seconds. If you leave the default grace period configuration, your computer is vulnerable to a potential attack from someone who could approach the console and attempt to log on to the computer before the lock takes effect. An entry to the registry can be made to adjust the length of the grace period." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 5 or fewer seconds: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.10"] + - cis_csc: ["4.3"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> n:^(\d+) compare <= 5' + + - id: 15699 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'." + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.11"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' + + - id: 15700 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'." + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.12"] + - cis_csc: ["4.8"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' + + - id: 15701 + title: "Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less'." + description: "This setting can generate a security audit in the Security event log when the log reaches a user-defined threshold. The recommended state for this setting is: Enabled: 90% or less. Note: If log settings are configured to Overwrite events as needed or Overwrite events older than x days, this event will not be generated." + rationale: "If the Security log reaches 90 percent of its capacity and the computer has not been configured to overwrite events as needed, more recent events will not be written to the log. If the log reaches its capacity and the computer has been configured to shut down when it can no longer record events to the Security log, the computer will shut down and will no longer be available to provide network services." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 90% or less: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.13"] + - pci_dss: ["10.7"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> n:^(\d+) compare <= 90' + + - id: 15702 + title: "Ensure 'Configure DNS over HTTPS (DoH) name resolution' is set to 'Enabled: Allow DoH' or higher." + description: "This setting determines if DNS over HTTPS (DoH) is used by the system. DNS over HTTPS (DoH) is a protocol for performing remote Domain Name System (DNS) resolution over the Hypertext Transfer Protocol Secure (HTTPS). For additional information on DNS over HTTPS (DoH), visit: Secure DNS Client over HTTPS (DoH) on Windows Server 2022 | Microsoft Docs. The recommended state for this setting is: Enabled: Allow DoH. Configuring this setting to Enabled: Require DoH also conforms to the benchmark." + rationale: "DNS over HTTPS (DoH) helps protect against DNS spoofing. Spoofing makes a transmission appear to come from a user other than the user who performed the action. It can also help prevent man-in-the-middle (MitM) attacks because the session in-between is encrypted." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Allow DoH (configuring to Enabled: Require DoH also conforms to the benchmark): Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Configure DNS over HTTPS (DoH) name resolution. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DnsClient.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.4.1"] + - cis_csc: ["3.10"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> DoHPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> DoHPolicy -> r:^2$|^3$' + + - id: 15703 + title: "Ensure 'Turn off multicast name resolution' is set to 'Enabled'." + description: "LLMNR is a secondary name resolution protocol. With LLMNR, queries are sent using multicast over a local network link on a single subnet from a client computer to another client computer on the same subnet that also has LLMNR enabled. LLMNR does not require a DNS server or DNS client configuration, and provides name resolution in scenarios in which conventional DNS name resolution is not possible. The recommended state for this setting is: Enabled." + rationale: "An attacker can listen on a network for these LLMNR (UDP/5355) or NBT-NS (UDP/137) broadcasts and respond to them, tricking the host into thinking that it knows the location of the requested system. Note: To completely mitigate local name resolution poisoning, in addition to this setting, the properties of each installed NIC should also be set to Disable NetBIOS over TCP/IP (on the WINS tab in the NIC properties). Unfortunately, there is no global setting to achieve this that automatically applies to all NICs - it is a per-NIC setting that varies with different NIC hardware installations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Turn off multicast name resolution. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DnsClient.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.4.2"] + - cis_csc: ["4.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast -> 0' + + - id: 15704 + title: "Ensure 'Enable Font Providers' is set to 'Disabled'." + description: "This policy setting determines whether Windows is allowed to download fonts and font catalog data from an online font provider. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment the IT department should be managing the changes to the system configuration, to ensure all changes are tested and approved." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Fonts\\Enable Font Providers. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.5.1"] + - cis_csc: ["16.5"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableFontProviders' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableFontProviders -> 0' + + - id: 15705 + title: "Ensure 'Enable insecure guest logons' is set to 'Disabled'." + description: "This policy setting determines if the SMB client will allow insecure guest logons to an SMB server. The recommended state for this setting is: Disabled." + rationale: "Insecure guest logons are used by file servers to allow unauthenticated access to shared folders." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Lanman Workstation\\Enable insecure guest logons. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template LanmanWorkstation.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.8.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation -> AllowInsecureGuestAuth' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation -> AllowInsecureGuestAuth -> 0' + + - id: 15706 + title: "Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'." + description: "This policy setting changes the operational behavior of the Mapper I/O network protocol driver. LLTDIO allows a computer to discover the topology of a network it's connected to. It also allows a computer to initiate Quality-of-Service requests such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Mapper I/O (LLTDIO) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> 0' + + - id: 15707 + title: "Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'." + description: "This policy setting changes the operational behavior of the Responder network protocol driver. The Responder allows a computer to participate in Link Layer Topology Discovery requests so that it can be discovered and located on the network. It also allows a computer to participate in Quality-of-Service activities such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Responder (RSPNDR) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.9.2"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> 0' + + - id: 15708 + title: "Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'." + description: "The Peer Name Resolution Protocol (PNRP) allows for distributed resolution of a name to an IPv6 address and port number. The protocol operates in the context of clouds. A cloud is a set of peer computers that can communicate with each other by using the same IPv6 scope. Peer-to-Peer protocols allow for applications in the areas of RTC, collaboration, content distribution and distributed processing. The recommended state for this setting is: Enabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to peer-to-peer networking." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Microsoft Peer-to-Peer Networking Services\\Turn off Microsoft Peer-to-Peer Networking Services. Note: This Group Policy path is provided by the Group Policy template P2P- pnrp.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.10.2"] + - cis_csc: ["4.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> 1' + + - id: 15709 + title: "Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'." + description: "You can use this procedure to control a user's ability to install and configure a Network Bridge. The recommended state for this setting is: Enabled." + rationale: "The Network Bridge setting, if enabled, allows users to create a Layer 2 Media Access Control (MAC) bridge, enabling them to connect two or more physical network segments together. A Network Bridge thus allows a computer that has connections to two different networks to share data between those networks. In an enterprise managed environment, where there is a need to control network traffic to only authorized paths, allowing users to create a Network Bridge increases the risk and attack surface from the bridged network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit installation and configuration of Network Bridge on your DNS domain network. Note: This Group Policy path is provided by the Group Policy template NetworkConnections.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.11.2"] + - cis_csc: ["12.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA -> 0' + + - id: 15710 + title: "Ensure 'Prohibit use of Internet Connection Sharing on your DNS domain network' is set to 'Enabled'." + description: "Although this 'legacy' setting traditionally applied to the use of Internet Connection Sharing (ICS) in Windows 2000, Windows XP & Server 2003, this setting now freshly applies to the Mobile Hotspot feature in Windows 10 & Server 2016. The recommended state for this setting is: Enabled." + rationale: "Non-administrators should not be able to turn on the Mobile Hotspot feature and open their Internet connectivity up to nearby mobile devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit use of Internet Connection Sharing on your DNS domain network. Note: This Group Policy path is provided by the Group Policy template NetworkConnections.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.11.3"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_ShowSharedAccessUI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_ShowSharedAccessUI -> 0' + + - id: 15711 + title: "Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'." + description: "This policy setting determines whether to require domain users to elevate when setting a network's location. The recommended state for this setting is: Enabled." + rationale: "Allowing regular users to set a network location increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Require domain users to elevate when setting a network's location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template NetworkConnections.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.11.4"] + - cis_csc: ["5.4"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation -> 1' + + - id: 15712 + title: 'Ensure ''Hardened UNC Paths'' is set to ''Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares''.' + description: 'This policy setting configures secure access to UNC paths. The recommended state for this setting is: Enabled, with Require Mutual Authentication and Require Integrity set for all NETLOGON and SYSVOL shares. Note: If the environment exclusively contains Windows 8.0 / Server 2012 (non-R2) or newer systems, then the "Privacy" setting may (optionally) also be set to enable SMB encryption. However, using SMB encryption will render the targeted share paths completely inaccessible by older OSes, so only use this additional option with caution and thorough testing.' + rationale: "In February 2015, Microsoft released a new control mechanism to mitigate a security risk in Group Policy as part of the MS15-011 / MSKB 3000483 security update. This mechanism requires both the installation of the new security update and also the deployment of specific group policy settings to all computers on the domain from Windows Vista / Server 2008 (non-R2) or newer (the associated security patch to enable this feature was not released for Server 2003). A new group policy template (NetworkProvider.admx/adml) was also provided with the security update. Once the new GPO template is in place, the following are the minimum requirements to remediate the Group Policy security risk: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Note: A reboot may be required after the setting is applied to a client machine to access the above paths. Additional guidance on the deployment of this security setting is available from the Microsoft Premier Field Engineering (PFE) Platforms TechNet Blog here: Guidance on Deployment of MS15-011 and MS15-014." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with the following paths configured, at a minimum: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Provider\\Hardened UNC Paths. Note: This Group Policy path does not exist by default. An additional Group Policy template (NetworkProvider.admx/adml) is required." + compliance: + - cis: ["18.5.14.1"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\NETLOGON' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\SYSVOL' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\NETLOGON -> r:RequireMutualAuthentication=1, RequireIntegrity=1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\SYSVOL -> r:RequireMutualAuthentication=1, RequireIntegrity=1' + + - id: 15713 + title: "Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')." + description: "Internet Protocol version 6 (IPv6) is a set of protocols that computers use to exchange information over the Internet and over home and business networks. IPv6 allows for many more IP addresses to be assigned than IPv4 did. Older networking, hosts and operating systems may not support IPv6 natively. The recommended state for this setting is: DisabledComponents - 0xff (255)" + rationale: "Since the vast majority of private enterprise managed networks have no need to utilize IPv6 (because they have access to private IPv4 addressing), disabling IPv6 components removes a possible attack surface that is also harder to monitor the traffic on. As a result, we recommend configuring IPv6 to a Disabled state when it is not needed." + remediation: "To establish the recommended configuration, set the following Registry value to 0xff (255) (DWORD): HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TCPIP6\\Parameters:DisabledComponents. Note: This change does not take effect until the computer has been restarted. Note #2: Although Microsoft does not provide an ADMX template to configure this registry value, a custom .ADM template (Disable-IPv6-Components-KB929852.adm) is provided in the CIS Benchmark Remediation Kit to facilitate its configuration. Be aware though that simply turning off the group policy setting in the .ADM template will not \"undo\" the change once applied. Instead, the opposite setting must be applied to change the registry value to the opposite state." + compliance: + - cis: ["18.5.19.2.1"] + - cis_csc: ["4.8"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> 255' + + - id: 15714 + title: "Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'." + description: "This policy setting allows the configuration of wireless settings using Windows Connect Now (WCN). The WCN Registrar enables the discovery and configuration of devices over Ethernet (UPnP) over in-band 802.11 Wi-Fi through the Windows Portable Device API (WPD) and via USB Flash drives. Additional options are available to allow discovery and configuration over a specific medium. The recommended state for this setting is: Disabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to user configuration of wireless settings." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Configuration of wireless settings using Windows Connect Now. Note: This Group Policy path is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.20.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> 0' + + - id: 15715 + title: "Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'." + description: "This policy setting prohibits access to Windows Connect Now (WCN) wizards. The recommended state for this setting is: Enabled." + rationale: "Allowing standard users to access the Windows Connect Now wizard increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Prohibit access of the Windows Connect Now wizards. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.20.2"] + - cis_csc: ["15.4", "15.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> 1' + + - id: 15716 + title: "Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled: 3 = Prevent Wi-Fi when on Ethernet'." + description: "This policy setting prevents computers from establishing multiple simultaneous connections to either the Internet or to a Windows domain. The recommended state for this setting is: Enabled: 3 = Prevent Wi-Fi when on Ethernet." + rationale: "Preventing bridged network connections can help prevent a user unknowingly allowing traffic to route between internal and external networks, which risks exposure to sensitive internal data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3 = Prevent Wi-Fi when on Ethernet: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Minimize the number of simultaneous connections to the Internet or a Windows Domain. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WCM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates. It was updated with a new Minimize Policy Options sub-setting starting with the Windows 10 Release 1903 Administrative Templates." + compliance: + - cis: ["18.5.21.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections -> 3' + + - id: 15717 + title: "Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled'." + description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time. The recommended state for this setting is: Enabled." + rationale: "The potential concern is that a user would unknowingly allow network traffic to flow between the insecure public network and the enterprise managed network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Prohibit connection to non-domain networks when connected to domain authenticated network. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WCM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.21.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain -> 1' + + - id: 15718 + title: "Ensure 'Allow Windows to automatically connect to suggested open hotspots, to networks shared by contacts, and to hotspots offering paid services' is set to 'Disabled'." + description: 'This policy setting determines whether users can enable the following WLAN settings: Connect to suggested open hotspots, Connect to networks shared by my contacts, and Enable paid services. - Connect to suggested open hotspots enables Windows to automatically connect users to open hotspots it knows about by crowdsourcing networks that other people using Windows have connected to. - Connect to networks shared by my contacts enables Windows to automatically connect to networks that the user''s contacts have shared with them, and enables users on this device to share networks with their contacts. - Enable paid services enables Windows to temporarily connect to open hotspots to determine if paid services are available. The recommended state for this setting is: Disabled. Note: These features are also known by the name "Wi-Fi Sense".' + rationale: "Automatically connecting to an open hotspot or network can introduce the system to a rogue network with malicious intent." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\WLAN Service\\WLAN Settings\\Allow Windows to automatically connect to suggested open hotspots, to networks shared by contacts, and to hotspots offering paid services. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template wlansvc.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.23.2.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config -> AutoConnectAllowedOEM' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config -> AutoConnectAllowedOEM -> 0' + + - id: 15719 + title: "Ensure 'Allow Print Spooler to accept client connections' is set to 'Disabled'." + description: "This policy setting controls whether the Print Spooler service will accept client connections. The recommended state for this setting is: Disabled. Note: The Print Spooler service must be restarted for changes to this policy to take effect." + rationale: "Disabling the ability for the Print Spooler service to accept client connections mitigates remote attacks against the PrintNightmare vulnerability (CVE-2021-34527) and other remote Print Spooler attacks. However, this recommendation does not mitigate against local attacks on the Print Spooler service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Allow Print Spooler to accept client connections. Note: This Group Policy path is provided by the Group Policy template printing2.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsNT\Printers' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsNT\Printers -> RegisterSpoolerRemoteRpcEndPoint' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsNT\Printers -> RegisterSpoolerRemoteRpcEndPoint -> 2' + + - id: 15720 + title: "Ensure 'Point and Print Restrictions: When installing drivers for a new connection' is set to 'Enabled: Show warning and elevation prompt'." + description: "This policy setting controls whether computers will show a warning and a security elevation prompt when users create a new printer connection using Point and Print. The recommended state for this setting is: Enabled: Show warning and elevation prompt. Note: On August 10, 2021, Microsoft announced a Point and Print Default Behavior Change which modifies the default Point and Print driver installation and update behavior to require Administrator privileges. This is documented in KB5005652—Manage new Point and Print default driver installation behavior (CVE-2021-34481). This change overrides all Point and Print Group Policy settings and ensures that only Administrators can install printer drivers from a print server using Point and Print." + rationale: "Enabling Windows User Account Control (UAC) for the installation of new print drivers can help mitigate the PrintNightmare vulnerability (CVE-2021-34527) and other Print Spooler attacks. Although the Point and Print default driver installation behavior overrides this setting, it is important to configure this as a backstop in the event that behavior is reversed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Show warning and elevation prompt: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Point and Print Restrictions: When installing drivers for a new connection. Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsNT\Printers\PointAndPrint' + - 'not r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsNT\Printers\PointAndPrint -> NoWarningNoElevationOnInstall' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsNT\Printers\PointAndPrint -> NoWarningNoElevationOnInstall -> 0' + + - id: 15721 + title: "Ensure 'Point and Print Restrictions: When updating drivers for an existing connection' is set to 'Enabled: Show warning and elevation prompt'." + description: "This policy setting controls whether computers will show a warning and a security elevation prompt when users are updating drivers for an existing connection using Point and Print. The recommended state for this setting is: Enabled: Show warning and elevation prompt. Note: On August 10, 2021, Microsoft announced a Point and Print Default Behavior Change which modifies the default Point and Print driver installation and update behavior to require Administrator privileges. This is documented in KB5005652—Manage new Point and Print default driver installation behavior (CVE-2021-34481). This change overrides all Point and Print Group Policy settings and ensures that only Administrators can install printer drivers from a print server using Point and Print." + rationale: "Enabling Windows User Account Control (UAC) for updating existing print drivers can help mitigate the PrintNightmare vulnerability (CVE-2021-34527) and other Print Spooler attacks. Although the Point and Print default driver installation behavior overrides this setting, it is important to configure this as a backstop in the event that behavior is reversed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Show warning and elevation prompt: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Point and Print Restrictions: When updating drivers for an existing connection. Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsNT\Printers\PointAndPrint' + - 'not r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsNT\Printers\PointAndPrint -> UpdatePromptSettings' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsNT\Printers\PointAndPrint -> UpdatePromptSettings -> 0' + + - id: 15722 + title: "Ensure 'Turn off notifications network usage' is set to 'Enabled'." + description: "This policy setting blocks applications from using the network to send notifications to update tiles, tile badges, toast, or raw notifications. This policy setting turns off the connection between Windows and the Windows Push Notification Service (WNS). This policy setting also stops applications from being able to poll application services to update tiles. The recommended state for this setting is: Enabled." + rationale: "Windows Push Notification Services (WNS) is a mechanism to receive 3rd-party notifications and updates from the cloud/Internet. In a high security environment, external systems, especially those hosted outside the organization, should be prevented from having an impact on the secure workstations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Start Menu and Taskbar\\Turn off notifications network usage. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WPN.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.7.1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -> NoCloudApplicationNotification' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -> NoCloudApplicationNotification -> 1' + + - id: 15723 + title: "Ensure 'Include command line in process creation events' is set to 'Enabled'." + description: "This policy setting controls whether the process creation command line text is logged in security audit events when a new process has been created. The recommended state for this setting is: Enabled. Note: This feature that this setting controls was not originally supported in workstation OSes older than Windows 8.1. However, in February 2015 Microsoft added support for the feature to Windows 7 and Windows 8.0 via an update - KB3004375. Therefore, this setting is also important to set on those older OSes." + rationale: "Capturing process command line information in event logs can be very valuable when performing forensic investigations of attack incidents." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Audit Process Creation\\Include command line in process creation events. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AuditSettings.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.3.1"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled -> 1' + + - id: 15724 + title: "Ensure 'Encryption Oracle Remediation' is set to 'Enabled: Force Updated Clients'." + description: "Some versions of the CredSSP protocol that is used by some applications (such as Remote Desktop Connection) are vulnerable to an encryption oracle attack against the client. This policy controls compatibility with vulnerable clients and servers and allows you to set the level of protection desired for the encryption oracle vulnerability. The recommended state for this setting is: Enabled: Force Updated Clients." + rationale: "This setting is important to mitigate the CredSSP encryption oracle vulnerability, for which information was published by Microsoft on 03/13/2018 in CVE-2018-0886 | CredSSP Remote Code Execution Vulnerability. All versions of Windows from Windows Vista onwards are affected by this vulnerability, and will be compatible with this recommendation provided that they have been patched at least through May 2018 (or later)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Force Updated Clients: Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Encryption Oracle Remediation. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1803 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.4.1"] + - cis_csc: ["7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters -> AllowEncryptionOracle' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters -> AllowEncryptionOracle -> 0' + + - id: 15725 + title: "Ensure 'Remote host allows delegation of non-exportable credentials' is set to 'Enabled'." + description: "Remote host allows delegation of non-exportable credentials. When using credential delegation, devices provide an exportable version of credentials to the remote host. This exposes users to the risk of credential theft from attackers on the remote host. The Restricted Admin Mode and Windows Defender Remote Credential Guard features are two options to help protect against this risk. The recommended state for this setting is: Enabled. Note: More detailed information on Windows Defender Remote Credential Guard and how it compares to Restricted Admin Mode can be found at this link: Protect Remote Desktop credentials with Windows Defender Remote Credential Guard (Windows 10) | Microsoft Docs" + rationale: "Restricted Admin Mode was designed to help protect administrator accounts by ensuring that reusable credentials are not stored in memory on remote devices that could potentially be compromised. Windows Defender Remote Credential Guard helps you protect your credentials over a Remote Desktop connection by redirecting Kerberos requests back to the device that is requesting the connection. Both features should be enabled and supported, as they reduce the chance of credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Remote host allows delegation of non-exportable credentials. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.4.2"] + - cis_csc: ["10.5"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds -> 1' + + - id: 15726 + title: "Ensure 'Turn On Virtualization Based Security' is set to 'Enabled'." + description: "This policy setting specifies whether Virtualization Based Security is enabled. Virtualization Based Security uses the Windows Hypervisor to provide support for security services. The recommended state for this setting is: Enabled. Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Kerberos, NTLM, and Credential manager isolate secrets by using virtualization-based security. Previous versions of Windows stored secrets in the Local Security Authority (LSA). Prior to Windows 10, the LSA stored secrets used by the operating system in its process memory. With Windows Defender Credential Guard enabled, the LSA process in the operating system talks to a new component called the isolated LSA process that stores and protects those secrets. Data stored by the isolated LSA process is protected using virtualization-based security and is not accessible to the rest of the operating system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.5.1"] + - cis_csc: ["10.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> EnableVirtualizationBasedSecurity' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> EnableVirtualizationBasedSecurity -> 1' + + - id: 15727 + title: "Ensure 'Turn On Virtualization Based Security: Select Platform Security Level' is set to 'Secure Boot and DMA Protection'." + description: "This policy setting specifies whether Virtualization Based Security is enabled. Virtualization Based Security uses the Windows Hypervisor to provide support for security services. The recommended state for this setting is: Secure Boot and DMA Protection. Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Secure Boot can help reduce the risk of bootloader attacks and in conjunction with DMA protections to help protect data from being scraped from memory." + remediation: "To establish the recommended configuration via GP, set the following UI path to Secure Boot and DMA Protection: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Select Platform Security Level. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.5.2"] + - cis_csc: ["10.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> RequirePlatformSecurityFeatures' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> RequirePlatformSecurityFeatures -> 3' + + - id: 15728 + title: "Ensure 'Turn On Virtualization Based Security: Virtualization Based Protection of Code Integrity' is set to 'Enabled with UEFI lock'." + description: "This setting enables virtualization based protection of Kernel Mode Code Integrity. When this is enabled, kernel mode memory protections are enforced and the Code Integrity validation path is protected by the Virtualization Based Security feature. The recommended state for this setting is: Enabled with UEFI lock. Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "The Enabled with UEFI lock option ensures that Virtualization Based Protection of Code Integrity cannot be disabled remotely." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with UEFI lock: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Virtualization Based Protection of Code Integrity. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.5.3"] + - cis_csc: ["5.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HypervisorEnforcedCodeIntegrity' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HypervisorEnforcedCodeIntegrity -> 1' + + - id: 15729 + title: "Ensure 'Turn On Virtualization Based Security: Require UEFI Memory Attributes Table' is set to 'True (checked)'." + description: "This option will only enable Virtualization Based Protection of Code Integrity on devices with UEFI firmware support for the Memory Attributes Table. Devices without the UEFI Memory Attributes Table may have firmware that is incompatible with Virtualization Based Protection of Code Integrity which in some cases can lead to crashes or data loss or incompatibility with certain plug-in cards. If not setting this option the targeted devices should be tested to ensure compatibility. The recommended state for this setting is: True (checked). Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "This setting will help protect this control from being enabled on a system that is not compatible which could lead to a crash or data loss." + remediation: "To establish the recommended configuration via GP, set the following UI path to TRUE: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Require UEFI Memory Attributes Table. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.5.4"] + - cis_csc: ["10.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HVCIMATRequired' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HVCIMATRequired -> 1' + + - id: 15730 + title: "Ensure 'Turn On Virtualization Based Security: Credential Guard Configuration' is set to 'Enabled with UEFI lock'." + description: 'This setting lets users turn on Credential Guard with virtualization-based security to help protect credentials. The "Enabled with UEFI lock" option ensures that Credential Guard cannot be disabled remotely. In order to disable the feature, you must set the Group Policy to "Disabled" as well as remove the security functionality from each computer, with a physically present user, in order to clear configuration persisted in UEFI. The recommended state for this setting is: Enabled with UEFI lock. Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs.' + rationale: "The Enabled with UEFI lock option ensures that Credential Guard cannot be disabled remotely." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with UEFI lock: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Credential Guard Configuration. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.5.5"] + - cis_csc: ["10.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> LsaCfgFlags' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> LsaCfgFlags -> 1' + + - id: 15731 + title: "Ensure 'Turn On Virtualization Based Security: Secure Launch Configuration' is set to 'Enabled'." + description: "Secure Launch protects the Virtualization Based Security environment from exploited vulnerabilities in device firmware. The recommended state for this setting is: Enabled. Note: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Secure Launch changes the way Windows boots to use Intel Trusted Execution Technology (TXT) and Runtime BIOS Resilience features to prevent firmware exploits from being able to impact the security of the Windows Virtualization Based Security environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Secure Launch Configuration. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.5.6"] + - cis_csc: ["10.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> ConfigureSystemGuardLaunch' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> ConfigureSystemGuardLaunch -> 1' + + - id: 15732 + title: "Ensure 'Prevent device metadata retrieval from the Internet' is set to 'Enabled'." + description: "This policy setting allows you to prevent Windows from retrieving device metadata from the Internet. The recommended state for this setting is: Enabled. Note: This will not prevent the installation of basic hardware drivers, but does prevent associated 3rd-party utility software from automatically being installed under the context of the SYSTEM account." + rationale: "Installation of software should be conducted by an authorized system administrator and not a standard user. Allowing automatic 3rd-party software installations under the context of the SYSTEM account has potential for allowing unauthorized access via backdoors or installation software bugs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Installation\\Prevent device metadata retrieval from the Internet. Note: This Group Policy path is provided by the Group Policy template DeviceInstallation.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates, or with the Group Policy template DeviceSetup.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata -> PreventDeviceMetadataFromNetwork' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata -> PreventDeviceMetadataFromNetwork -> 1' + + - id: 15733 + title: "Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'." + description: "This policy setting allows you to specify which boot-start drivers are initialized based on a classification determined by an Early Launch Antimalware boot-start driver. The Early Launch Antimalware boot-start driver can return the following classifications for each boot-start driver: - Good: The driver has been signed and has not been tampered with. - Bad: The driver has been identified as malware. It is recommended that you do not allow known bad drivers to be initialized. - Bad, but required for boot: The driver has been identified as malware, but the computer cannot successfully boot without loading this driver. - Unknown: This driver has not been attested to by your malware detection application and has not been classified by the Early Launch Antimalware boot-start driver. If you enable this policy setting you will be able to choose which boot-start drivers to initialize the next time the computer is started. If your malware detection application does not include an Early Launch Antimalware bootstart driver or if your Early Launch Antimalware boot-start driver has been disabled, this setting has no effect and all boot-start drivers are initialized. The recommended state for this setting is: Enabled: Good, unknown and bad but critical." + rationale: "This policy setting helps reduce the impact of malware that has already infected your system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Good, unknown and bad but critical: Computer Configuration\\Policies\\Administrative Templates\\System\\Early Launch Antimalware\\Boot-Start Driver Initialization Policy. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template EarlyLaunchAM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.14.1"] + - cis_csc: ["10.5"] + - pci_dss: ["5.1.1"] + - nist_800_53: ["SI.3"] + - tsc: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy -> 3' + + - id: 15734 + title: "Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'." + description: 'The "Do not apply during periodic background processing" option prevents the system from updating affected policies in the background while the computer is in use. When background updates are disabled, policy changes will not take effect until the next user logon or system restart. The recommended state for this setting is: Enabled: FALSE (unchecked).' + rationale: "Setting this option to false (unchecked) will ensure that domain policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Do not apply during periodic background processing option to FALSE (unchecked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy -> 0' + + - id: 15735 + title: "Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'." + description: 'The "Process even if the Group Policy objects have not changed" option updates and reapplies policies even if the policies have not changed. The recommended state for this setting is: Enabled: TRUE (checked).' + rationale: "Setting this option to true (checked) will ensure unauthorized changes that might have been configured locally are forced to match the domain-based Group Policy settings again." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Process even if the Group Policy objects have not changed option to TRUE (checked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.3"] + - pci_dss: ["11.5.1"] + - tsc: ["PI1.4", "PI1.5", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges -> 0' + + - id: 15736 + title: "Ensure 'Continue experiences on this device' is set to 'Disabled'." + description: "This policy setting determines whether the Windows device is allowed to participate in cross-device experiences (continue experiences). The recommended state for this setting is: Disabled." + rationale: "A cross-device experience is when a system can access app and send messages to other devices. In an enterprise managed environment only trusted systems should be communicating within the network. Access to any other system should be prohibited." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Continue experiences on this device. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableCdp' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableCdp -> 0' + + - id: 15737 + title: "Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'." + description: "This policy setting prevents Group Policy from being updated while the computer is in use. This policy setting applies to Group Policy for computers, users and Domain Controllers. The recommended state for this setting is: Disabled." + rationale: "This setting ensures that group policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Turn off background refresh of Group Policy. Note: This Group Policy path is provided by the Group Policy template GroupPolicy.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.21.5"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy' + + - id: 15738 + title: "Ensure 'Turn off access to the Store' is set to 'Enabled'." + description: "This policy setting specifies whether to use the Store service for finding an application to open a file with an unhandled file type or protocol association. When a user opens a file type or protocol that is not associated with any applications on the computer, the user is given the choice to select a local application or use the Store service to find an application. The recommended state for this setting is: Enabled." + rationale: "The Store service is a retail outlet built into Windows, primarily for consumer use. In an enterprise managed environment the IT department should be managing the installation of all applications to reduce the risk of the installation of vulnerable software." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off access to the Store. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ICM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.22.1.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> 1' + + - id: 15739 + title: "Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'." + description: "This policy setting controls whether the computer can download print driver packages over HTTP. To set up HTTP printing, printer drivers that are not available in the standard operating system installation might need to be downloaded over HTTP. The recommended state for this setting is: Enabled." + rationale: "Users might download drivers that include malicious code." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off downloading of print drivers over HTTP. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.2"] + - cis_csc: ["2.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> 1' + + - id: 15740 + title: "Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'." + description: "This setting turns off data sharing from the handwriting recognition personalization tool. The handwriting recognition personalization tool enables Tablet PC users to adapt handwriting recognition to their own writing style by providing writing samples. The tool can optionally share user writing samples with Microsoft to improve handwriting recognition in future versions of Windows. The tool generates reports and transmits them to Microsoft over a secure connection. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting personalization data sharing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ShapeCollector.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.22.1.3"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> 1' + + - id: 15741 + title: "Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'." + description: "Turns off the handwriting recognition error reporting tool. The handwriting recognition error reporting tool enables users to report errors encountered in Tablet PC Input Panel. The tool generates error reports and transmits them to Microsoft over a secure connection. Microsoft uses these error reports to improve handwriting recognition in future versions of Windows. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting recognition error reporting. Note: This Group Policy path is provided by the Group Policy template InkWatson.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> 1' + + - id: 15742 + title: "Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'." + description: "This policy setting specifies whether the Internet Connection Wizard can connect to Microsoft to download a list of Internet Service Providers (ISPs). The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> 1' + + - id: 15743 + title: "Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'." + description: "This policy setting controls whether Windows will download a list of providers for the Web publishing and online ordering wizards. The recommended state for this setting is: Enabled." + rationale: "Although the risk is minimal, enabling this setting will reduce the possibility of a user unknowingly downloading malicious content through this feature." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet download for Web publishing and online ordering wizards. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> 1' + + - id: 15744 + title: "Ensure 'Turn off printing over HTTP' is set to 'Enabled'." + description: "This policy setting allows you to disable the client computer's ability to print over HTTP, which allows the computer to print to printers on the intranet as well as the Internet. The recommended state for this setting is: Enabled. Note: This control affects printing over both HTTP and HTTPS." + rationale: "Information that is transmitted over HTTP through this capability is not protected and can be intercepted by malicious users. For this reason, it is not often used in enterprise managed environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off printing over HTTP. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> 1' + + - id: 15745 + title: "Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'." + description: "This policy setting specifies whether the Windows Registration Wizard connects to Microsoft.com for online registration. The recommended state for this setting is: Enabled." + rationale: "Users in an enterprise managed environment should not be registering their own copies of Windows, providing their own PII in the process." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Registration if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> 1' + + - id: 15746 + title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'." + description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches. The recommended state for this setting is: Enabled." + rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for. This risk is very low because even if this setting is enabled users still must submit search queries to the desired search engine in order to perform searches." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Search Companion content file updates. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' + + - id: 15747 + title: 'Ensure ''Turn off the "Order Prints" picture task'' is set to ''Enabled''.' + description: 'This policy setting specifies whether the "Order Prints Online" task is available from Picture Tasks in Windows folders. The Order Prints Online Wizard is used to download a list of providers and allow users to order prints online. The recommended state for this setting is: Enabled.' + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Order Prints\" picture task. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.10"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> 1' + + - id: 15748 + title: 'Ensure''Turn off the "Publish to Web" task for files and folders'' is set to ''Enabled''.' + description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders. The Web Publishing wizard is used to download a list of providers and allow users to publish content to the Web. The recommended state for this setting is: Enabled." + rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Publish to Web\" task for files and folders. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.11"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' + + - id: 15749 + title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'." + description: "This policy setting specifies whether the Windows Customer Experience Improvement Program can collect anonymous information about how Windows is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to improve features that are most used and to detect flaws so that they can be corrected more quickly. Enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the Windows Messenger Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.12"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' + + - id: 15750 + title: "Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'." + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> 0' + + - id: 15751 + title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'." + description: "This policy setting controls whether or not errors are reported to Microsoft. Error Reporting is used to report information about a system or application that has failed or has stopped responding and is used to improve the quality of the product. The recommended state for this setting is: Enabled." + rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Error Reporting. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.14"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' + + - id: 15752 + title: "Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic'." + description: "This policy setting allows you to set support for Kerberos to attempt authentication using the certificate for the device to the domain. Support for device authentication using certificate will require connectivity to a DC in the device account domain which supports certificate authentication for computer accounts. The recommended state for this setting is: Enabled: Automatic." + rationale: "Having stronger device authentication with the use of certificates is strongly encouraged over standard username and password authentication. Having this set to Automatic will allow certificate based authentication to be used whenever possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Automatic: Computer Configuration\\Policies\\Administrative Templates\\System\\Kerberos\\Support device authentication using certificate. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Kerberos.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.25.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitBehavior -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitEnabled -> 1' + + - id: 15753 + title: "Ensure 'Enumeration policy for external devices incompatible with Kernel DMA Protection' is set to 'Enabled: Block All'." + description: "This policy is intended to provide additional security against external DMA-capable devices. It allows for more control over the enumeration of external DMA-capable devices that are not compatible with DMA Remapping/device memory isolation and sandboxing. The recommended state for this setting is: Enabled: Block All. Note: This policy does not apply to 1394, PCMCIA or ExpressCard devices. The protection also only applies to Windows 10 R1803 or higher, and also requires a UEFI BIOS to function. Note #2: More information on this feature is available at this link: Kernel DMA Protection for Thunderbolt™ 3 (Windows 10) | Microsoft Docs." + rationale: "Device memory sandboxing allows the OS to leverage the I/O Memory Management Unit (IOMMU) of a device to block unpermitted I/O, or memory access, by the peripheral." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block All: Computer Configuration\\Policies\\Administrative Templates\\System\\Kernel DMA Protection\\Enumeration policy for external devices incompatible with Kernel DMA Protection. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DmaGuard.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.26.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Kernel DMA Protection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Kernel DMA Protection -> DeviceEnumerationPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Kernel DMA Protection -> DeviceEnumerationPolicy -> 0' + + - id: 15754 + title: "Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'." + description: "This policy prevents automatic copying of user input methods to the system account for use on the sign-in screen. The user is restricted to the set of input methods that are enabled in the system account. The recommended state for this setting is: Enabled." + rationale: "This is a way to increase the security of the system account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Locale Services\\Disallow copying of user input methods to the system account for sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.27.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> 1' + + - id: 15755 + title: "Ensure 'Block user from showing account details on sign-in' is set to 'Enabled'." + description: "This policy prevents the user from showing account details (email address or user name) on the sign-in screen. The recommended state for this setting is: Enabled." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the workstation through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Block user from showing account details on sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockUserFromShowingAccountDetailsOnSignin' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockUserFromShowingAccountDetailsOnSignin -> 1' + + - id: 15756 + title: "Ensure 'Do not display network selection UI' is set to 'Enabled'." + description: "This policy setting allows you to control whether anyone can interact with available networks UI on the logon screen. The recommended state for this setting is: Enabled." + rationale: "An unauthorized user could disconnect the PC from the network or can connect the PC to other available networks without signing into Windows." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not display network selection UI. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI -> 1' + + - id: 15757 + title: "Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'." + description: "This policy setting prevents connected users from being enumerated on domain-joined computers. The recommended state for this setting is: Enabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not enumerate connected users on domain-joined computers. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.3"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers -> 1' + + - id: 15758 + title: "Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled'." + description: "This policy setting allows local users to be enumerated on domain-joined computers. The recommended state for this setting is: Disabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Enumerate local users on domain-joined computers. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers -> 0' + + - id: 15759 + title: "Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled'." + description: "This policy setting allows you to prevent app notifications from appearing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "App notifications might display sensitive business or personal data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off app notifications on the lock screen. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications -> 1' + + - id: 15760 + title: "Ensure 'Turn off picture password sign-in' is set to 'Enabled'." + description: "This policy setting allows you to control whether a domain user can sign in using a picture password. The recommended state for this setting is: Enabled. Note: If the picture password feature is permitted, the user's domain password is cached in the system vault when using it." + rationale: "Picture passwords bypass the requirement for a typed complex password. In a shared work environment, a simple shoulder surf where someone observed the on-screen gestures would allow that person to gain access to the system without the need to know the complex password. Vertical monitor screens with an image are much more visible at a distance than horizontal key strokes, increasing the likelihood of a successful observation of the mouse gestures." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off picture password sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.6"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword -> 1' + + - id: 15761 + title: "Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'." + description: "This policy setting allows you to control whether a domain user can sign in using a convenience PIN. In Windows 10, convenience PIN was replaced with Passport, which has stronger security properties. To configure Passport for domain users, use the policies under Computer Configuration\\Administrative Templates\\Windows Components\\Microsoft Passport for Work. Note: The user's domain password will be cached in the system vault when using this feature. The recommended state for this setting is: Disabled." + rationale: "A PIN is created from a much smaller selection of characters than a password, so in most cases a PIN will be much less robust than a password." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn on convenience PIN sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn on PIN sign-in, but it was renamed starting with the Windows 10 Release 1511 Administrative Templates." + compliance: + - cis: ["18.8.28.7"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon -> 0' + + - id: 15762 + title: "Ensure 'Allow Clipboard synchronization across devices' is set to 'Disabled'." + description: "This setting determines whether Clipboard contents can be synchronized across devices. The recommended state for this setting is: Disabled." + rationale: "In high security environments, clipboard data should stay local to the system and not synced across devices, as it may contain very sensitive information that must be contained locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\OS Policies\\Allow Clipboard synchronization across devices. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template OSPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.31.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowCrossDeviceClipboard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowCrossDeviceClipboard -> 0' + + - id: 15763 + title: "Ensure 'Allow upload of User Activities' is set to 'Disabled'." + description: "This policy setting determines whether published User Activities can be uploaded to the cloud. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\OS Policies\\Allow upload of User Activities. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template OSPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1803 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.31.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> UploadUserActivities' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> UploadUserActivities -> 0' + + - id: 15764 + title: "Ensure 'Allow network connectivity during connected-standby (on battery)' is set to 'Disabled'." + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, on battery and in a sleep state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (on battery). Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.34.6.1"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> DCSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> DCSettingIndex -> 0' + + - id: 15765 + title: "Ensure 'Allow network connectivity during connected-standby (plugged in)' is set to 'Disabled'." + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, plugged in and in a sleep state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (plugged in). Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.34.6.2"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> ACSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> ACSettingIndex -> 0' + + - id: 15766 + title: "Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'." + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (on battery). Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.34.6.5"] + - cis_csc: ["4.3"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex -> 1' + + - id: 15767 + title: "Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'." + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (plugged in). Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.34.6.6"] + - cis_csc: ["4.3"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex -> 1' + + - id: 15768 + title: "Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'." + description: "This policy setting allows you to turn on or turn off Offer (Unsolicited) Remote Assistance on this computer. Help desk and support personnel will not be able to proactively offer assistance, although they can still respond to user assistance requests. The recommended state for this setting is: Disabled." + rationale: "A user might be tricked and accept an unsolicited Remote Assistance offer from a malicious user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Offer Remote Assistance. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.36.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited -> 0' + + - id: 15769 + title: "Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'." + description: "This policy setting allows you to turn on or turn off Solicited (Ask for) Remote Assistance on this computer. The recommended state for this setting is: Disabled." + rationale: "There is slight risk that a rogue administrator will gain access to another user's desktop session, however, they cannot connect to a user's computer unannounced or control it without permission from the user. When an expert tries to connect, the user can still choose to deny the connection or give the expert view-only privileges. The user must explicitly click the Yes button to allow the expert to remotely control the workstation." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Solicited Remote Assistance. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.36.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp -> 0' + + - id: 15770 + title: "Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled'." + description: "This policy setting controls whether RPC clients authenticate with the Endpoint Mapper Service when the call they are making contains authentication information. The Endpoint Mapper Service on computers running Windows NT4 (all service packs) cannot process authentication information supplied in this manner. This policy setting can cause a specific issue with 1-way forest trusts if it is applied to the trusting domain DCs (see Microsoft KB3073942), so we do not recommend applying it to Domain Controllers. Note: This policy will not in effect until the system is rebooted. The recommended state for this setting is: Enabled." + rationale: "Anonymous access to RPC services could result in accidental disclosure of information to unauthenticated users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Enable RPC Endpoint Mapper Client Authentication. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RPC.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.37.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution -> 1' + + - id: 15771 + title: "Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated'." + description: 'This policy setting controls how the RPC server runtime handles unauthenticated RPC clients connecting to RPC servers. This policy setting impacts all RPC applications. In a domain environment this policy setting should be used with caution as it can impact a wide range of functionality including group policy processing itself. Reverting a change to this policy setting can require manual intervention on each affected machine. This policy setting should never be applied to a Domain Controller. A client will be considered an authenticated client if it uses a named pipe to communicate with the server or if it uses RPC Security. RPC Interfaces that have specifically requested to be accessible by unauthenticated clients may be exempt from this restriction, depending on the selected value for this policy setting. -- "None" allows all RPC clients to connect to RPC Servers running on the machine on which the policy setting is applied. -- "Authenticated" allows only authenticated RPC Clients (per the definition above) to connect to RPC Servers running on the machine on which the policy setting is applied. Exemptions are granted to interfaces that have requested them. -- "Authenticated without exceptions" allows only authenticated RPC Clients (per the definition above) to connect to RPC Servers running on the machine on which the policy setting is applied. No exceptions are allowed. This value has the potential to cause serious problems and is not recommended.'' Note: This policy setting will not be applied until the system is rebooted. The recommended state for this setting is: Enabled: Authenticated.' + rationale: "Unauthenticated RPC communication can create a security vulnerability." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Authenticated: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Restrict Unauthenticated RPC clients. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RPC.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.37.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients -> 1' + + - id: 15772 + title: "Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'." + description: "This policy setting configures Microsoft Support Diagnostic Tool (MSDT) interactive communication with the support provider. MSDT gathers diagnostic data for analysis by support professionals. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Microsoft Support Diagnostic Tool\\Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSDT.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.48.5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> 0' + + - id: 15773 + title: "Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'." + description: "This policy setting specifies whether to enable or disable tracking of responsiveness events. The recommended state for this setting is: Disabled." + rationale: "When enabled the aggregated data of a given event will be transmitted to Microsoft. The option exists to restrict this feature for a specific user, set the consent level, and designate specific programs for which error reports could be sent. However, centrally restricting the ability to execute PerfTrack to limit the potential for unauthorized or undesired usage, data leakage, or unintentional communications is highly recommended." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Windows Performance PerfTrack\\Enable/Disable PerfTrack. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PerformancePerftrack.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.48.11.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> 0' + + - id: 15774 + title: "Ensure 'Turn off the advertising ID' is set to 'Enabled'." + description: "This policy setting turns off the advertising ID, preventing apps from using the ID for experiences across apps. The recommended state for this setting is: Enabled." + rationale: "Tracking user activity for advertising purposes, even anonymously, may be a privacy concern. In an enterprise managed environment, applications should not need or require tracking for targeted advertising." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\User Profiles\\Turn off the advertising ID. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template UserProfiles.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.50.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> 1' + + - id: 15775 + title: "Ensure 'Enable Windows NTP Client' is set to 'Enabled'." + description: "This policy setting specifies whether the Windows NTP Client is enabled. Enabling the Windows NTP Client allows your computer to synchronize its computer clock with other NTP servers. You might want to disable this service if you decide to use a third-party time provider. The recommended state for this setting is: Enabled." + rationale: "A reliable and accurate account of time is important for a number of services and security requirements, including but not limited to distributed applications, authentication services, multi-user databases and logging services. The use of an NTP client (with secure operation) establishes functional accuracy and is a focal point when reviewing security relevant events." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Client. Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.53.1.1"] + - cis_csc: ["8.4"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> 1' + + - id: 15776 + title: "Ensure 'Enable Windows NTP Server' is set to 'Disabled'." + description: "This policy setting allows you to specify whether the Windows NTP Server is enabled. The recommended state for this setting is: Disabled." + rationale: "The configuration of proper time synchronization is critically important in an enterprise managed environment both due to the sensitivity of Kerberos authentication timestamps and also to ensure accurate security logging." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Server. Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.53.1.2"] + - cis_csc: ["8.4"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled -> 0' + + - id: 15777 + title: "Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled'." + description: "Manages a Windows app's ability to share data between users who have installed the app. Data is shared through the SharedLocal folder. This folder is available through the Windows.Storage API. The recommended state for this setting is: Disabled." + rationale: "Users of a system could accidentally share sensitive data with other users on the same system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Package Deployment\\Allow a Windows app to share application data between users. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppxPackageManager.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.4.1"] + - cis_csc: ["3.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager -> AllowSharedLocalAppData' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager -> AllowSharedLocalAppData -> 0' + + - id: 15778 + title: "Ensure 'Prevent non-admin users from installing packaged Windows apps' is set to 'Enabled'." + description: "This setting manages non-Administrator users' ability to install Windows app packages. The recommended state for this setting is: Enabled." + rationale: "In a corporate managed environment, application installations should be managed centrally by IT staff, not by end users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Package Deployment\\Prevent non-admin users from installing packaged Windows apps. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppxPackageManager.admx/adml that is included with the Microsoft Windows 10 Release 2004 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.4.2"] + - cis_csc: ["2.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Appx' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Appx -> BlockNonAdminUserInstall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Appx -> BlockNonAdminUserInstall -> 1' + + - id: 15779 + title: "Ensure 'Let Windows apps activate with voice while the system is locked' is set to 'Enabled: Force Deny'." + description: "This policy setting specifies whether Windows apps can be activated by voice (apps and Cortana) while the system is locked. The recommended state for this setting is: Enabled: Force Deny." + rationale: "Access to any computer resource should not be allowed when the device is locked." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Force Deny: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Privacy\\Let Windows apps activate with voice while the system is locked. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppPrivacy.admx/adml that is included with the Microsoft Windows 10 Release 1903 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy -> LetAppsActivateWithVoiceAboveLock' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy -> LetAppsActivateWithVoiceAboveLock -> 2' + + - id: 15780 + title: "Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'." + description: "This policy setting lets you control whether Microsoft accounts are optional for Windows Store apps that require an account to sign in. This policy only affects Windows Store apps that support it. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting allows an organization to use their enterprise user accounts instead of using their Microsoft accounts when accessing Windows store apps. This provides the organization with greater control over relevant credentials. Microsoft accounts cannot be centrally managed and as such enterprise credential security policies cannot be applied to them, which could put any information accessed by using Microsoft accounts at risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App runtime\\Allow Microsoft accounts to be optional. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppXRuntime.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.6.1"] + - cis_csc: ["5.6"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional -> 1' + + - id: 15781 + title: "Ensure 'Block launching Universal Windows apps with Windows Runtime API access from hosted content.' is set to 'Enabled'." + description: "This policy setting controls whether Microsoft Store apps with Windows Runtime API access directly from web content can be launched. The recommended state for this setting is: Enabled." + rationale: "Blocking apps from the web with direct access to the Windows API can prevent malicious apps from being run on a system. Only system administrators should be installing approved applications." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App runtime\\Block launching Universal Windows apps with Windows Runtime API access from hosted content. Note: A reboot may be required after the setting is applied. Note #2: This Group Policy path may not exist by default. It is provided by the Group Policy template AppXRuntime.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer). Note #3: In older Microsoft Windows Administrative Templates, this setting was initially named Block launching Windows Store apps with Windows Runtime API access from hosted content., but it was renamed starting with the Windows 10 Release 1803 Administrative Templates" + compliance: + - cis: ["18.9.6.2"] + - cis_csc: ["2.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> BlockHostedAppAccessWinRT' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> BlockHostedAppAccessWinRT -> 1' + + - id: 15782 + title: "Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'." + description: "This policy setting disallows AutoPlay for MTP devices like cameras or phones. The recommended state for this setting is: Enabled." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Disallow Autoplay for non-volume devices. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.8.1"] + - cis_csc: ["10.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume -> 1' + + - id: 15783 + title: "Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'." + description: "This policy setting sets the default behavior for Autorun commands. Autorun commands are generally stored in autorun.inf files. They often launch the installation program or other routines. The recommended state for this setting is: Enabled: Do not execute any autorun commands." + rationale: "Prior to Windows Vista, when media containing an autorun command is inserted, the system will automatically execute the program without user intervention. This creates a major security concern as code may be executed without user's knowledge. The default behavior starting with Windows Vista is to prompt the user whether autorun command is to be run. The autorun command is represented as a handler in the Autoplay dialog." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Do not execute any autorun commands: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Set the default behavior for AutoRun. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.8.2"] + - cis_csc: ["10.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun -> 1' + + - id: 15784 + title: "Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'." + description: "Autoplay starts to read from a drive as soon as you insert media in the drive, which causes the setup file for programs or audio media to start immediately. An attacker could use this feature to launch a program to damage the computer or data on the computer. Autoplay is disabled by default on some removable drive types, such as floppy disk and network drives, but not on CD-ROM drives. Note: You cannot use this policy setting to enable Autoplay on computer drives in which it is disabled by default, such as floppy disk and network drives. The recommended state for this setting is: Enabled: All drives." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: All drives: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Turn off Autoplay. Note: This Group Policy path is provided by the Group Policy template AutoPlay.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.8.3"] + - cis_csc: ["10.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun -> 255' + + - id: 15785 + title: "Ensure 'Configure enhanced anti-spoofing' is set to 'Enabled'." + description: "This policy setting determines whether enhanced anti-spoofing is configured for devices which support it. The recommended state for this setting is: Enabled." + rationale: "Enterprise managed environments are now supporting a wider range of mobile devices, increasing the security on these devices will help protect against unauthorized access on your network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Biometrics\\Facial Features\\Configure enhanced anti-spoofing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Biometrics.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Windows 10 Release 1511 and Windows 10 Release 1607 & Server 2016 Administrative Templates, this setting was initially named Use enhanced anti-spoofing when available. It was renamed to Configure enhanced anti-spoofing starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.10.1.1"] + - cis_csc: ["10.5"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures -> EnhancedAntiSpoofing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures -> EnhancedAntiSpoofing -> 1' + + - id: 15786 + title: "Ensure 'Allow Use of Camera' is set to 'Disabled'." + description: "This policy setting controls whether the use of Camera devices on the machine are permitted. The recommended state for this setting is: Disabled." + rationale: "Cameras in a high security environment can pose serious privacy and data exfiltration risks - they should be disabled to help mitigate that risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Camera\\Allow Use of Camera. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Camera.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.12.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera -> AllowCamera' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera -> AllowCamera -> 0' + + - id: 15787 + title: "Ensure 'Turn off cloud consumer account state content' is set to 'Enabled'." + description: "This policy setting determines whether cloud consumer account state content is allowed in all Windows experiences. The recommended state for this setting is: Enabled." + rationale: "The use of consumer accounts in an enterprise managed environment is not good security practice as it could lead to possible data leakage." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off cloud consumer account state content. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.14.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableConsumerAccountStateContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableConsumerAccountStateContent -> 1' + + - id: 15788 + title: "Ensure 'Turn off cloud optimized content' is set to 'Enabled'." + description: "This policy setting turns off cloud optimized content in all Windows experiences. The recommended state for this setting is: Enabled." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off cloud optimized content. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 10 Release 20H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.14.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableCloudOptimizedContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableCloudOptimizedContent -> 1' + + - id: 15789 + title: "Ensure 'Turn off Microsoft consumer experiences' is set to 'Enabled'." + description: "This policy setting turns off experiences that help consumers make the most of their devices and Microsoft account. The recommended state for this setting is: Enabled. Note: Per Microsoft TechNet, this policy setting only applies to Windows 10 Enterprise and Windows 10 Education editions." + rationale: "Having apps silently install in an enterprise managed environment is not good security practice - especially if the apps send data back to a 3rd party." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off Microsoft consumer experiences. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.14.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableWindowsConsumerFeatures' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableWindowsConsumerFeatures -> 1' + + - id: 15790 + title: "Ensure 'Require pin for pairing' is set to 'Enabled: First Time' OR 'Enabled: Always'." + description: "This policy setting controls whether or not a PIN is required for pairing to a wireless display device. The recommended state for this setting is: Enabled: First Time OR Enabled: Always." + rationale: "If this setting is not configured or disabled then a PIN would not be required when pairing wireless display devices to the system, increasing the risk of unauthorized use." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: First Time OR Enabled: Always: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Connect\\Require pin for pairing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WirelessDisplay.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). The new Choose one of the following actions sub-option was later added as of the Windows 10 Release 1809 Administrative Templates. Choosing Enabled in the older templates is the equivalent of choosing Enabled: First Time in the newer templates." + compliance: + - cis: ["18.9.15.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing -> r:^1$|^2$' + + - id: 15791 + title: "Ensure 'Do not display the password reveal button' is set to 'Enabled'." + description: "This policy setting allows you to configure the display of the password reveal button in password entry user experiences. The recommended state for this setting is: Enabled." + rationale: "This is a useful feature when entering a long and complex password, especially when using a touchscreen. The potential risk is that someone else may see your password while surreptitiously observing your screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Do not display the password reveal button. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredUI.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.1"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal -> 1' + + - id: 15792 + title: "Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'." + description: "This policy setting controls whether administrator accounts are displayed when a user attempts to elevate a running application. The recommended state for this setting is: Disabled." + rationale: "Users could see the list of administrator accounts, making it slightly easier for a malicious user who has logged onto a console session to try to crack the passwords of those accounts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Enumerate administrator accounts on elevation. Note: This Group Policy path is provided by the Group Policy template CredUI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.16.2"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators -> 0' + + - id: 15793 + title: "Ensure 'Prevent the use of security questions for local accounts' is set to 'Enabled'." + description: "This policy setting controls whether security questions can be used to reset local account passwords. The security question feature does not apply to domain accounts, only local accounts on the workstation. The recommended state for this setting is: Enabled." + rationale: "Users could establish security questions that are easily guessed or sleuthed by observing the user’s social media accounts, making it easier for a malicious actor to change the local user account password and gain access to the computer as that user account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Prevent the use of security questions for local accounts. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredUI.admx/adml that is included with the Microsoft Windows 10 Release 1903 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> NoLocalPasswordResetQuestions' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> NoLocalPasswordResetQuestions -> 1' + + - id: 15794 + title: "Ensure 'Allow Diagnostic Data' is set to 'Enabled: Diagnostic data off (not recommended)' or 'Enabled: Send required diagnostic data'." + description: "This policy setting determines the amount of diagnostic and usage data reported to Microsoft: - A value of (0) Diagnostic data off (not recommended). Using this value, no diagnostic data is sent from the device. This value is only supported on Enterprise, Education, and Server editions. If you choose this setting, devices in your organization will still be secure. - A value of (1) Send required diagnostic data. This is the minimum diagnostic data necessary to keep Windows secure, up to date, and performing as expected. Using this value disables the Optional diagnostic data control in the Settings app. - A value of (3)Send optional diagnostic data. Additional diagnostic data is collected that helps us to detect, diagnose and fix issues, as well as make product improvements. Required diagnostic data will always be included when you choose to send optional diagnostic data. Optional diagnostic data can also include diagnostic log files and crash dumps. Use the Limit Dump Collection and the Limit Diagnostic Log Collection policies for more granular control of what optional diagnostic data is sent. Windows telemetry settings apply to the Windows operating system and some first party apps. This setting does not apply to third party apps running on Windows 10/11. The recommended state for this setting is: Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data. Note: If your organization relies on Windows Update, the minimum recommended setting is Required diagnostic data. Because no Windows Update information is collected when diagnostic data is off, important information about update failures is not sent. Microsoft uses this information to fix the causes of those failures and improve the quality of updates. Note #2: The Configure diagnostic data opt-in settings user interface group policy can be used to prevent end users from changing their data collection settings. Note #3: Enhanced diagnostic data setting is not available on Windows 11 and Windows Server 2022 and has been replaced with policies that can control the amount of optional diagnostic data that is sent. For more information on these settings visit Manage diagnostic data using Group Policy and MDM" + rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Allow Diagnostic Data. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow Telemetry, but it was renamed to Allow Diagnostic Data starting with the Windows 11 Release 21H2 Administrative Templates." + compliance: + - cis: ["18.9.17.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry -> r:^0$|^1$' + + - id: 15795 + title: "Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage'." + description: "This policy setting controls whether the Connected User Experience and Telemetry service can automatically use an authenticated proxy to send data back to Microsoft. The recommended state for this setting is: Enabled: Disable Authenticated Proxy usage." + rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Authenticated Proxy usage: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableEnterpriseAuthProxy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableEnterpriseAuthProxy -> 1' + + - id: 15796 + title: "Ensure 'Disable OneSettings Downloads' is set to 'Enabled'." + description: "This policy setting controls whether Windows attempts to connect with the OneSettings service to download configuration settings. The recommended state for this setting is: Enabled." + rationale: "Sending data to a 3rd party vendor is a security concern and should only be done on an as-needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Disable OneSettings Downloads. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableOneSettingsDownloads' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableOneSettingsDownloads -> 1' + + - id: 15797 + title: "Ensure 'Do not show feedback notifications' is set to 'Enabled'." + description: "This policy setting allows an organization to prevent its devices from showing feedback questions from Microsoft. The recommended state for this setting is: Enabled." + rationale: "Users should not be sending any feedback to 3rd party vendors in an enterprise managed environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Do not show feedback notifications. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template FeedbackNotifications.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DoNotShowFeedbackNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DoNotShowFeedbackNotifications -> 1' + + - id: 15798 + title: "Ensure 'Enable OneSettings Auditing' is set to 'Enabled'." + description: "This policy setting controls whether Windows records attempts to connect with the OneSettings service to the Operational EventLog. The recommended state for this setting is: Enabled." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Enable OneSettings Auditing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.5"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> EnableOneSettingsAuditing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> EnableOneSettingsAuditing -> 1' + + - id: 15799 + title: "Ensure 'Limit Diagnostic Log Collection' is set to 'Enabled'." + description: "This policy setting controls whether additional diagnostic logs are collected when more information is needed to troubleshoot a problem on the device. The recommended state for this setting is: Enabled. Note: Diagnostic logs are only sent when the device has been configured to send optional diagnostic data. Diagnostic data is limited with recommendation Allow Diagnostic Data is set to Enabled: Diagnostic data off (not recommended)or Enabled: Send required diagnostic data to send only basic information." + rationale: "Sending data to a 3rd-party vendor is a security concern and should only be done on an as-needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Limit Diagnostic Log Collection. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDiagnosticLogCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDiagnosticLogCollection -> 1' + + - id: 15800 + title: "Ensure 'Limit Dump Collection' is set to 'Enabled'." + description: "This policy setting limits the type of dumps that can be collected when more information is needed to troubleshoot a problem. The recommended state for this setting is: Enabled. Note: Dumps are only sent when the device has been configured to send optional diagnostic data. Diagnostic data is limited with recommendation Ensure Allow Diagnostic Data is set to Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data to send only basic information." + rationale: "Sending data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Limit Dump Collection. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.7"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDumpCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDumpCollection -> 1' + + - id: 15801 + title: "Ensure 'Toggle user control over Insider builds' is set to 'Disabled'." + description: 'This policy setting determines whether users can access the Insider build controls in the Advanced Options for Windows Update. These controls are located under "Get Insider builds," and enable users to make their devices available for downloading and installing Windows preview software. The recommended state for this setting is: Disabled. Note: This policy setting applies only to devices running Windows 10 Pro or Windows 10 Enterprise, up until Release 1703. For Release 1709 or newer, Microsoft encourages using the Manage preview builds setting (recommendation title ‘Manage preview builds’). We have kept this setting in the benchmark to ensure that any older builds of Windows 10 in the environment are still enforced.' + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Toggle user control over Insider builds. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AllowBuildPreview.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.8"] + - cis_csc: ["2.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> AllowBuildPreview' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> AllowBuildPreview -> 0' + + - id: 15802 + title: "Ensure 'Download Mode' is NOT set to 'Enabled: Internet'." + description: "This policy setting specifies the download method that Delivery Optimization can use in downloads of Windows Updates, Apps and App updates. The following methods are supported: - 0 = HTTP only, no peering. - 1 = HTTP blended with peering behind the same NAT. - 2 = HTTP blended with peering across a private group. Peering occurs on devices in the same Active Directory Site (if exist) or the same domain by default. When this option is selected, peering will cross NATs. To create a custom group use Group ID in combination with Mode 2. - 3 = HTTP blended with Internet Peering. - 99 = Simple download mode with no peering. Delivery Optimization downloads using HTTP only and does not attempt to contact the Delivery Optimization cloud services. - 100 = Bypass mode. Do not use Delivery Optimization and use BITS instead. The recommended state for this setting is any value EXCEPT: Enabled: Internet (3). Note: The default on all SKUs other than Enterprise, Enterprise LTSB or Education is Enabled: Internet (3), so on other SKUs, be sure to set this to a different value." + rationale: "Due to privacy concerns and security risks, updates should only be downloaded directly from Microsoft, or from a trusted machine on the internal network that received its updates from a trusted source and approved by the network administrator." + remediation: "To establish the recommended configuration via GP, set the following UI path to any value other than Enabled: Internet (3): Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Delivery Optimization\\Download Mode. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeliveryOptimization.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.18.1"] + - cis_csc: ["7.3"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization -> DODownloadMode -> r:^3$' + + - id: 15803 + title: "Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Control Event Log behavior when the log file reaches its maximum size. Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.1.1"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention -> 0' + + - id: 15804 + title: "Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Specify the maximum log file size (KB). Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.1.2"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> n:^(\d+) compare >= 32768' + + - id: 15805 + title: "Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Control Event Log behavior when the log file reaches its maximum size. Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.2.1"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention -> 0' + + - id: 15806 + title: "Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 196,608 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 196,608 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Specify the maximum log file size (KB). Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.2.2"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> n:^(\d+) compare >= 196608' + + - id: 15807 + title: "Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Control Event Log behavior when the log file reaches its maximum size. Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.3.1"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention -> 0' + + - id: 15808 + title: "Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Specify the maximum log file size (KB). Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.3.2"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> n:^(\d+) compare >= 32768' + + - id: 15809 + title: "Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Control Event Log behavior when the log file reaches its maximum size. Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.4.1"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention -> 0' + + - id: 15810 + title: "Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Specify the maximum log file size (KB). Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.4.2"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> n:^(\d+) compare >= 32768' + + - id: 15811 + title: "Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'." + description: "Disabling Data Execution Prevention can allow certain legacy plug-in applications to function without terminating Explorer. The recommended state for this setting is: Disabled. Note: Some legacy plug-in applications and other software may not function with Data Execution Prevention and will require an exception to be defined for that specific plug- in/software." + rationale: "Data Execution Prevention is an important security feature supported by Explorer that helps to limit the impact of certain types of malware." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off Data Execution Prevention for Explorer. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Explorer.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.31.2"] + - cis_csc: ["10.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention -> 0' + + - id: 15812 + title: "Ensure 'Turn off heap termination on corruption' is set to 'Disabled'." + description: "Without heap termination on corruption, legacy plug-in applications may continue to function when a File Explorer session has become corrupt. Ensuring that heap termination on corruption is active will prevent this. The recommended state for this setting is: Disabled." + rationale: "Allowing an application to function after its session has become corrupt increases the risk posture to the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off heap termination on corruption. Note: This Group Policy path is provided by the Group Policy template Explorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.31.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption -> 0' + + - id: 15813 + title: "Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'." + description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." + rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off shell protocol protected mode. Note: This Group Policy path is provided by the Group Policy template WindowsExplorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.31.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior -> 0' + + - id: 15814 + title: "Ensure 'Prevent the computer from joining a homegroup' is set to 'Enabled'." + description: "By default, users can add their computer to a HomeGroup on a home network. The recommended state for this setting is: Enabled. Note: The HomeGroup feature is available in all workstation releases of Windows from Windows 7 through Windows 10 Release 1709. Microsoft removed the feature completely starting with Windows 10 Release 1803. However, if your environment still contains any Windows 10 Release 1709 (or older) workstations, then this setting remains important to disable HomeGroup on those systems." + rationale: "While resources on a domain-joined computer cannot be shared with a HomeGroup, information from the domain-joined computer can be leaked to other computers in the HomeGroup." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\HomeGroup\\Prevent the computer from joining a homegroup. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sharing.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.36.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HomeGroup' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HomeGroup -> DisableHomeGroup' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HomeGroup -> DisableHomeGroup -> 1' + + - id: 15815 + title: "Ensure 'Turn off location' is set to 'Enabled'." + description: "This policy setting turns off the location feature for the computer. The recommended state for this setting is: Enabled." + rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Turn off location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sensors.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.41.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> 1' + + - id: 15816 + title: "Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled'." + description: "This policy setting allows backup and restore of cellular text messages to Microsoft's cloud services. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Messaging\\Allow Message Service Cloud Sync. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Messaging.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.45.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging -> AllowMessageSync' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging -> AllowMessageSync -> 0' + + - id: 15817 + title: "Ensure 'Block all consumer Microsoft account user authentication' is set to 'Enabled'." + description: "This setting determines whether applications and services on the device can utilize new consumer Microsoft account authentication via the Windows OnlineID and WebAccountManager APIs. The recommended state for this setting is: Enabled." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used on their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft accounts\\Block all consumer Microsoft account user authentication. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSAPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.46.1"] + - cis_csc: ["5.3"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount -> DisableUserAuth' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount -> DisableUserAuth -> 1' + + - id: 15818 + title: "Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled'." + description: "This policy setting configures a local override for the configuration to join Microsoft Active Protection Service (MAPS), which Microsoft renamed to Windows Defender Antivirus Cloud Protection Service and then Microsoft Defender Antivirus Cloud Protection Service. This setting can only be set by Group Policy. The recommended state for this setting is: Disabled." + rationale: "The decision on whether or not to participate in Microsoft MAPS / Microsoft Defender Antivirus Cloud Protection Service for malicious software reporting should be made centrally in an enterprise managed environment, so that all computers within it behave consistently in that regard. Configuring this setting to Disabled ensures that the decision remains centrally managed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\MAPS\\Configure local setting override for reporting to Microsoft MAPS. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.4.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting -> 0' + + - id: 15819 + title: "Ensure 'Join Microsoft MAPS' is set to 'Disabled'." + description: "This policy setting allows you to join Microsoft Active Protection Service (MAPS), which Microsoft renamed to Windows Defender Antivirus Cloud Protection Service and then Microsoft Defender Antivirus Cloud Protection Service. Microsoft MAPS / Microsoft Defender Antivirus Cloud Protection Service is the online community that helps you choose how to respond to potential threats. The community also helps stop the spread of new malicious software infections. You can choose to send basic or additional information about detected software. Additional information helps Microsoft create new definitions and help it to protect your computer. Possible options are: - (0x0) Disabled (default) - (0x1) Basic membership - (0x2) Advanced membership Basic membership will send basic information to Microsoft about software that has been detected including where the software came from the actions that you apply or that are applied automatically and whether the actions were successful. Advanced membership in addition to basic information will send more information to Microsoft about malicious software spyware and potentially unwanted software including the location of the software file names how the software operates and how it has impacted your computer. The recommended state for this setting is: Disabled." + rationale: "The information that would be sent can include things like location of detected items on your computer if harmful software was removed. The information would be automatically collected and sent. In some instances personal information might unintentionally be sent to Microsoft. However, Microsoft states that it will not use this information to identify you or contact you. For privacy reasons in high security environments, it is best to prevent these data submissions altogether." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\MAPS\\Join Microsoft MAPS. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.4.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting' + + - id: 15820 + title: "Ensure 'Configure Attack Surface Reduction rules' is set to 'Enabled'." + description: "This policy setting controls the state for the Attack Surface Reduction (ASR) rules. The recommended state for this setting is: Enabled." + rationale: "Attack surface reduction helps prevent actions and apps that are typically used by exploit-seeking malware to infect machines." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Microsoft Defender Exploit Guard\\Attack Surface Reduction\\Configure Attack Surface Reduction rules. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.5.1.1"] + - cis_csc: ["10.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR -> ExploitGuard_ASR_Rules' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR -> ExploitGuard_ASR_Rules -> 1' + + - id: 15821 + title: "Ensure 'Configure Attack Surface Reduction rules: Set the state for each ASR rule' is configured." + description: "This policy setting sets the Attack Surface Reduction rules. The recommended state for this setting is: 26190899-1602-49e8-8b27-eb1d0a1ce869 - 1 (Block Office communication application from creating child processes) 3b576869-a4ec-4529-8536-b80a7769e899 - 1 (Block Office applications from creating executable content) 5beb7efe-fd9a-4556-801d-275e5ffc04cc - 1 (Block execution of potentially obfuscated scripts) 75668c1f-73b5-4cf0-bb93-3ecf5cb7cc84 - 1 (Block Office applications from injecting code into other processes) 7674ba52-37eb-4a4f-a9a1-f0f9a1619a2c - 1 (Block Adobe Reader from creating child processes) 92e97fa1-2edf-4476-bdd6-9dd0b4dddc7b - 1 (Block Win32 API calls from Office macro) 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 - 1 (Block credential stealing from the Windows local security authority subsystem (lsass.exe)) b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4 - 1 (Block untrusted and unsigned processes that run from USB) be9ba2d9-53ea-4cdc-84e5-9b1eeee46550 - 1 (Block executable content from email client and webmail) d3e037e1-3eb8-44c8-a917-57927947596d - 1 (Block JavaScript or VBScript from launching downloaded executable content) d4f940ab-401b-4efc-aadc-ad5f3c50688a - 1 (Block Office applications from creating child processes) e6db77e5-3df2-4cf1-b95a-636979351e5b - 1 (Block persistence through WMI event subscription) Note: More information on ASR rules can be found at the following link: Use Attack surface reduction rules to prevent malware infection | Microsoft Docs" + rationale: "Attack surface reduction helps prevent actions and apps that are typically used by exploit-seeking malware to infect machines." + remediation: "To establish the recommended configuration via GP, set the following UI path so that 26190899-1602-49e8-8b27-eb1d0a1ce869, 3b576869-a4ec-4529-8536-b80a7769e899, 5beb7efe-fd9a-4556-801d-275e5ffc04cc, 75668c1f-73b5-4cf0-bb93-3ecf5cb7cc84, 7674ba52-37eb-4a4f-a9a1-f0f9a1619a2c, 92e97fa1-2edf-4476-bdd6-9dd0b4dddc7b, 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2, b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4, be9ba2d9-53ea-4cdc-84e5-9b1eeee46550, d3e037e1-3eb8-44c8-a917-57927947596d, d4f940ab-401b-4efc-aadc-ad5f3c50688a, and e6db77e5-3df2-4cf1-b95a-636979351e5b are each set to a value of 1: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Microsoft Defender Exploit Guard\\Attack Surface Reduction\\Configure Attack Surface Reduction rules: Set the state for each ASR rule. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.5.1.2"] + - cis_csc: ["10.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D4F940AB-401B-4EFC-AADC-AD5F3C50688A' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 3B576869-A4EC-4529-8536-B80A7769E899' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D3E037E1-3EB8-44C8-A917-57927947596D' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 26190899-1602-49E8-8B27-eB1D0A1CE869' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 7674BA52-37EB-4A4F-A9A1-F0F9A1619A2C' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 9E6C4E1F-7D60-472F-bA1A-A39EF669E4B2' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D4F940AB-401B-4EFC-AADC-AD5F3C50688A -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 3B576869-A4EC-4529-8536-B80A7769E899 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D3E037E1-3EB8-44C8-A917-57927947596D -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 26190899-1602-49E8-8B27-eB1D0A1CE869 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 7674BA52-37EB-4A4F-A9A1-F0F9A1619A2C -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 9E6C4E1F-7D60-472F-bA1A-A39EF669E4B2 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4 -> 1' + + - id: 15822 + title: "Ensure 'Prevent users and apps from accessing dangerous websites' is set to 'Enabled: Block'." + description: "This policy setting controls Microsoft Defender Exploit Guard network protection. The recommended state for this setting is: Enabled: Block." + rationale: "This setting can help prevent employees from using any application to access dangerous domains that may host phishing scams, exploit-hosting sites, and other malicious content on the Internet." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Windows Defender Exploit Guard\\Network Protection\\Prevent users and apps from accessing dangerous websites. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.5.3.1"] + - cis_csc: ["9.3", "10.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection -> EnableNetworkProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection -> EnableNetworkProtection -> 1' + + - id: 15823 + title: "Ensure 'Enable file hash computation feature' is set to 'Enabled'." + description: "This setting determines whether hash values are computed for files scanned by Microsoft Defender. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to monitor for suspicious and known malicious activity. File hashes are a reliable way of detecting changes to files, and can speed up the scan process by skipping files that have not changed since they were last scanned and determined to be safe. A changed file hash can also be cause for additional scrutiny." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\MpEngine\\Enable file hash computation feature. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.6.1"] + - cis_csc: ["10.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine -> EnableFileHashComputation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine -> EnableFileHashComputation -> 1' + + - id: 15824 + title: "Ensure 'Scan all downloaded files and attachments' is set to 'Enabled'." + description: "This policy setting configures scanning for all downloaded files and attachments. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Scan all downloaded files and attachments. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.9.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableIOAVProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableIOAVProtection -> 0' + + - id: 15825 + title: "Ensure 'Turn off real-time protection' is set to 'Disabled'." + description: "This policy setting configures real-time protection prompts for known malware detection. Microsoft Defender Antivirus alerts you when malware or potentially unwanted software attempts to install itself or to run on your computer. The recommended state for this setting is: Disabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Turn off real-time protection. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.9.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableRealtimeMonitoring' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableRealtimeMonitoring -> 0' + + - id: 15826 + title: "Ensure 'Turn on behavior monitoring' is set to 'Enabled'." + description: "This policy setting allows you to configure behavior monitoring for Microsoft Defender Antivirus. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Turn on behavior monitoring. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.9.3"] + - cis_csc: ["10.7"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableBehaviorMonitoring' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableBehaviorMonitoring -> 0' + + - id: 15827 + title: "Ensure 'Turn on script scanning' is set to 'Enabled'." + description: "This policy setting allows script scanning to be turned on/off. Script scanning intercepts scripts then scans them before they are executed on the system. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Turn on script scanning. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.9.4"] + - cis_csc: ["10.7"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableScriptScanning' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableScriptScanning -> 0' + + - id: 15828 + title: "Ensure 'Configure Watson events' is set to 'Disabled'." + description: "This policy setting allows you to configure whether or not Watson events are sent. The recommended state for this setting is: Disabled." + rationale: "Watson events are the reports that get sent to Microsoft when a program or service crashes or fails, including the possibility of automatic submission. Preventing this information from being sent can help reduce privacy concerns." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Reporting\\Configure Watson events. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.11.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts -> 1' + + - id: 15829 + title: "Ensure 'Scan removable drives' is set to 'Enabled'." + description: "This policy setting allows you to manage whether or not to scan for malicious software and unwanted software in the contents of removable drives, such as USB flash drives, when running a full scan. The recommended state for this setting is: Enabled." + rationale: "It is important to ensure that any present removable drives are always included in any type of scan, as removable drives are more likely to contain malicious software brought in to the enterprise managed environment from an external, unmanaged computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Scan\\Scan removable drives. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.12.1"] + - cis_csc: ["10.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning -> 0' + + - id: 15830 + title: "Ensure 'Turn on e-mail scanning' is set to 'Enabled'." + description: "This policy setting allows you to configure e-mail scanning. When e-mail scanning is enabled, the engine will parse the mailbox and mail files, according to their specific format, in order to analyze the mail bodies and attachments. Several e-mail formats are currently supported, for example: pst (Outlook), dbx, mbx, mime (Outlook Express), binhex (Mac). The recommended state for this setting is: Enabled." + rationale: "Incoming e-mails should be scanned by an antivirus solution such as Microsoft Defender Antivirus, as email attachments are a commonly used attack vector to infiltrate computers with malicious software." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Scan\\Turn on e-mail scanning. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.12.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning -> 0' + + - id: 15831 + title: "Ensure 'Configure detection for potentially unwanted applications' is set to 'Enabled: Block'." + description: "This policy setting controls detection and action for Potentially Unwanted Applications (PUA), which are sneaky unwanted application bundlers or their bundled applications, that can deliver adware or malware. The recommended state for this setting is: Enabled: Block. For more information, see this link: Block potentially unwanted applications with Microsoft Defender Antivirus | Microsoft Docs" + rationale: "Potentially unwanted applications can increase the risk of your network being infected with malware, cause malware infections to be harder to identify, and can waste IT resources in cleaning up the applications. They should be blocked from installation." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Configure detection for potentially unwanted applications. Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.15"] + - cis_csc: ["2.5", "10.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> PUAProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> PUAProtection -> 1' + + - id: 15832 + title: "Ensure 'Turn off Microsoft Defender AntiVirus' is set to 'Disabled'." + description: "This policy setting turns off Microsoft Defender Antivirus. If the setting is configured to Disabled, Microsoft Defender Antivirus runs and computers are scanned for malware and other potentially unwanted software. The recommended state for this setting is: Disabled." + rationale: "It is important to ensure a current, updated antivirus product is scanning each computer for malicious file activity. Microsoft provides a competent solution out of the box in Microsoft Defender Antivirus. Organizations that choose to purchase a reputable 3rd-party antivirus solution may choose to exempt themselves from this recommendation in lieu of the commercial alternative." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Turn off Microsoft Defender AntiVirus. Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn off Windows Defender, but it was renamed to Windows Defender Antivirus starting with the Windows 10 Release 1703 Administrative Templates. It was again renamed to Turn off Microsoft Defender Antivirus starting with the Windows 10 Release 2004 Administrative Templates." + compliance: + - cis: ["18.9.47.16"] + - cis_csc: ["10.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> DisableAntiSpyware' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> DisableAntiSpyware -> 0' + + - id: 15833 + title: "Ensure 'Enable news and interests on the taskbar' is set to 'Disabled'." + description: "This policy setting specifies whether the news and interests feature is allowed on the device. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, apps and features such as news and interests on the Windows taskbar should be treated as a possible security risk due to the potential of data being sent back to 3rd parties, such as Microsoft. In addition, the app may display inappropriate news and interests within the feed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\News and interests\\Enable news and interests on the taskbar. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Feeds.admx/adml that is included with the Microsoft Windows 10 Release 21H1 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.57.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds -> EnableFeeds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds -> EnableFeeds -> 0' + + - id: 15834 + title: "Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'." + description: "This policy setting lets you prevent apps and features from working with files on OneDrive using the Next Generation Sync Client. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting prevents users from accidentally (or intentionally) uploading confidential or sensitive corporate information to the OneDrive cloud service using the Next Generation Sync Client. Note: This security concern applies to any cloud-based file storage application installed on a workstation, not just the one supplied with Windows." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\OneDrive\\Prevent the usage of OneDrive for file storage. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template SkyDrive.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer). However, we strongly recommend you only use the version included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Older versions of the templates had conflicting settings in different template files for both OneDrive & SkyDrive, until it was cleaned up properly in the above version. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Prevent the usage of SkyDrive for file storage, but it was renamed starting with the Windows 10 RTM (Release 1507) Administrative Templates." + compliance: + - cis: ["18.9.58.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC -> 1' + + - id: 15835 + title: "Ensure 'Turn off Push To Install service' is set to 'Enabled'." + description: "This policy setting controls whether users can push Apps to the device from the Microsoft Store App running on other devices or the web. The recommended state for this setting is: Enabled." + rationale: "In a high security managed environment, application installations should be managed centrally by IT staff, not by end users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Push to Install\\Turn off Push To Install service. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PushToInstall.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.64.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall -> DisablePushToInstall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall -> DisablePushToInstall -> 1' + + - id: 15836 + title: "Ensure 'Do not allow passwords to be saved' is set to 'Enabled'." + description: "This policy setting helps prevent Remote Desktop clients from saving passwords on a computer. The recommended state for this setting is: Enabled. Note: If this policy setting was previously configured as Disabled or Not configured, any previously saved passwords will be deleted the first time a Remote Desktop client disconnects from any server." + rationale: "An attacker with physical access to the computer may be able to break the protection guarding saved passwords. An attacker who compromises a user's account and connects to their computer could use saved passwords to gain access to additional hosts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Connection Client\\Do not allow passwords to be saved. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.2.2"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving -> 1' + + - id: 15837 + title: "Ensure 'Allow users to connect remotely by using Remote Desktop Services' is set to 'Disabled'." + description: "This policy setting allows you to configure remote access to computers by using Remote Desktop Services. The recommended state for this setting is: Disabled." + rationale: "Any account with the Allow log on through Remote Desktop Services user right can log on to the remote console of the computer. If you do not restrict access to legitimate users who need to log on to the console of the computer, unauthorized users could download and execute malicious code to elevate their privileges." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Connections\\Allow users to connect remotely by using Remote Desktop Services. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow users to connect remotely using Terminal Services, but it was renamed to Allow users to connect remotely using Remote Desktop Services in the Windows 7 & Server 2008 R2 Administrative Templates. It was finally renamed (again) to Allow users to connect remotely by using Remote Desktop Services starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.65.3.2.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDenyTSConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDenyTSConnections -> 1' + + - id: 15838 + title: "Ensure 'Allow UI Automation redirection' is set to 'Disabled'." + description: "This policy setting determines whether User Interface (UI) Automation client applications running on the local computer can access UI elements on the server. UI Automation gives programs access to most UI elements, which allows use of assistive technology products like Magnifier and Narrator that need to interact with the UI in order to work properly. UI information also allows automated test scripts to interact with the UI. For example, the local computers Narrator and Magnifier clients can be used to interact with UI on a web page opened in a remote session. The recommended state for this setting is: Disabled. Note: Remote Desktop sessions dont currently support UI Automation redirection." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for UI Automation redirection within a Remote Desktop session is rare, and not supported at this time, but it makes sense to reduce the number of unexpected avenues for malicious activity to occur." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Allow UI Automation redirection. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template TerminalServer.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.65.3.3.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> EnableUiaRedirection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> EnableUiaRedirection -> 0' + + - id: 15839 + title: "Ensure 'Do not allow COM port redirection' is set to 'Enabled'." + description: "This policy setting specifies whether to prevent the redirection of data to client COM ports from the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for COM port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow COM port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.3.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> 1' + + - id: 15840 + title: "Ensure 'Do not allow drive redirection' is set to 'Enabled'." + description: "This policy setting prevents users from sharing the local drives on their client computers to Remote Desktop Servers that they access. Mapped drives appear in the session folder tree in Windows Explorer in the following format: \\\\TSClient\\$ If local drives are shared they are left vulnerable to intruders who want to exploit the data that is stored on them. The recommended state for this setting is: Enabled." + rationale: "Data could be forwarded from the user's Remote Desktop Services session to the user's local computer without any direct user interaction. Malicious software already present on a compromised server would have direct and stealthy disk access to the user's local computer during the Remote Desktop session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow drive redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.3.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm -> 1' + + - id: 15841 + title: "Ensure 'Do not allow location redirection' is set to 'Enabled'." + description: "This policy setting controls the redirection of location data to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for location data redirection within a Remote Desktop session is rare, so it makes sense to reduce the number of unexpected avenues for malicious activity to occur." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow location redirection. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template TerminalServer.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.65.3.3.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLocationRedir' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLocationRedir -> 1' + + - id: 15842 + title: "Ensure 'Do not allow LPT port redirection' is set to 'Enabled'." + description: "This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for LPT port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow LPT port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.3.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> 1' + + - id: 15843 + title: "Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'." + description: "This policy setting allows you to control the redirection of supported Plug and Play devices, such as Windows Portable Devices, to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for Plug and Play device redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow supported Plug and Play device redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.3.6"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> 1' + + - id: 15844 + title: "Ensure 'Always prompt for password upon connection' is set to 'Enabled'." + description: "This policy setting specifies whether Remote Desktop Services always prompts the client computer for a password upon connection. You can use this policy setting to enforce a password prompt for users who log on to Remote Desktop Services, even if they already provided the password in the Remote Desktop Connection client. The recommended state for this setting is: Enabled." + rationale: "Users have the option to store both their username and password when they create a new Remote Desktop Connection shortcut. If the server that runs Remote Desktop Services allows users who have used this feature to log on to the server but not enter their password, then it is possible that an attacker who has gained physical access to the user's computer could connect to a Remote Desktop Server through the Remote Desktop Connection shortcut, even though they may not know the user's password." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Always prompt for password upon connection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In the Microsoft Windows Vista Administrative Templates, this setting was named Always prompt client for password upon connection, but it was renamed starting with the Windows Server 2008 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.65.3.9.1"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword -> 1' + + - id: 15845 + title: "Ensure 'Require secure RPC communication' is set to 'Enabled'." + description: "This policy setting allows you to specify whether Remote Desktop Services requires secure Remote Procedure Call (RPC) communication with all clients or allows unsecured communication. You can use this policy setting to strengthen the security of RPC communication with clients by allowing only authenticated and encrypted requests. The recommended state for this setting is: Enabled." + rationale: "Allowing unsecure RPC communication can exposes the server to man in the middle attacks and data disclosure attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require secure RPC communication. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.9.2"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic -> 1' + + - id: 15846 + title: "Ensure 'Require use of specific security layer for remote (RDP) connections' is set to 'Enabled: SSL'." + description: "This policy setting specifies whether to require the use of a specific security layer to secure communications between clients and RD Session Host servers during Remote Desktop Protocol (RDP) connections. The recommended state for this setting is: Enabled: SSL. Note: In spite of this setting being labeled SSL, it is actually enforcing Transport Layer Security (TLS) version 1.0, not the older (and less secure) SSL protocol." + rationale: "The native Remote Desktop Protocol (RDP) encryption is now considered a weak protocol, so enforcing the use of stronger Transport Layer Security (TLS) encryption for all RDP communications between clients and RD Session Host servers is preferred." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: SSL: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require use of specific security layer for remote (RDP) connections. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.9.3"] + - cis_csc: ["3.10"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> SecurityLayer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> SecurityLayer -> 2' + + - id: 15847 + title: "Ensure 'Require user authentication for remote connections by using Network Level Authentication' is set to 'Enabled'." + description: "This policy setting allows you to specify whether to require user authentication for remote connections to the RD Session Host server by using Network Level Authentication. The recommended state for this setting is: Enabled." + rationale: "Requiring that user authentication occur earlier in the remote connection process enhances security." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require user authentication for remote connections by using Network Level Authentication. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In the Microsoft Windows Vista Administrative Templates, this setting was initially named Require user authentication using RDP 6.0 for remote connections, but it was renamed starting with the Windows Server 2008 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.65.3.9.4"] + - cis_csc: ["3.10"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> UserAuthentication' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> UserAuthentication -> 1' + + - id: 15848 + title: "Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'." + description: "This policy setting specifies whether to require the use of a specific encryption level to secure communications between client computers and RD Session Host servers during Remote Desktop Protocol (RDP) connections. This policy only applies when you are using native RDP encryption. However, native RDP encryption (as opposed to SSL encryption) is not recommended. This policy does not apply to SSL encryption. The recommended state for this setting is: Enabled: High Level." + rationale: "If Remote Desktop client connections that use low level encryption are allowed, it is more likely that an attacker will be able to decrypt any captured Remote Desktop Services network traffic." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: High Level: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Set client connection encryption level. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.9.5"] + - cis_csc: ["3.10"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel -> 3' + + - id: 15849 + title: "Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less, but not Never (0)'." + description: "This policy setting allows you to specify the maximum amount of time that an active Remote Desktop Services session can be idle (without user input) before it is automatically disconnected. The recommended state for this setting is: Enabled: 15 minutes or less, but not Never (0)." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of inactive sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 15 minutes or less, but not Never (0): Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for active but idle Remote Desktop Services sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Set time limit for active but idle Terminal Services sessions, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.65.3.10.1"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - https://workbench.cisecurity.org/benchmarks/766 + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare <= 900000' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare != 0' + + - id: 15850 + title: "Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'." + description: "This policy setting allows you to configure a time limit for disconnected Remote Desktop Services sessions. The recommended state for this setting is: Enabled: 1 minute." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of disconnected but still active sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. This setting is important to ensure a disconnected session is properly terminated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 minute: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for disconnected sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.10.2"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> 60000' + + - id: 15851 + title: "Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'." + description: "This policy setting specifies whether Remote Desktop Services retains a user's per-session temporary folders at logoff. The recommended state for this setting is: Disabled." + rationale: "Sensitive information could be contained inside the temporary folders and visible to other administrators that log into the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not delete temp folders upon exit. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Do not delete temp folder upon exit, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.65.3.11.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit -> 1' + + - id: 15852 + title: "Ensure 'Prevent downloading of enclosures' is set to 'Enabled'." + description: "This policy setting prevents the user from having enclosures (file attachments) downloaded from an RSS feed to the user's computer. The recommended state for this setting is: Enabled." + rationale: "Allowing attachments to be downloaded through the RSS feed can introduce files that could have malicious intent." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\RSS Feeds\\Prevent downloading of enclosures. Note: This Group Policy path is provided by the Group Policy template InetRes.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Turn off downloading of enclosures, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.66.1"] + - cis_csc: ["9.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload -> 1' + + - id: 15853 + title: "Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search'." + description: "This policy setting allows search and Cortana to search cloud sources like OneDrive and SharePoint. The recommended state for this setting is: Enabled: Disable Cloud Search." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Cloud Search: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cloud Search. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.67.2"] + - cis_csc: ["4.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCloudSearch' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCloudSearch -> 0' + + - id: 15854 + title: "Ensure 'Allow Cortana' is set to 'Disabled'." + description: "This policy setting specifies whether Cortana is allowed on the device. The recommended state for this setting is: Disabled." + rationale: "If Cortana is enabled, sensitive information could be contained in search history and sent out to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cortana. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.67.3"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCortana' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCortana -> 0' + + - id: 15855 + title: "Ensure 'Allow Cortana above lock screen' is set to 'Disabled'." + description: "This policy setting determines whether or not the user can interact with Cortana using speech while the system is locked. The recommended state for this setting is: Disabled." + rationale: "Access to any computer resource should not be allowed when the device is locked." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cortana above lock screen. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.67.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCortanaAboveLock' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCortanaAboveLock -> 0' + + - id: 15856 + title: "Ensure 'Allow indexing of encrypted files' is set to 'Disabled'." + description: "This policy setting controls whether encrypted items are allowed to be indexed. When this setting is changed, the index is rebuilt completely. Full volume encryption (such as BitLocker Drive Encryption or a non-Microsoft solution) must be used for the location of the index to maintain security for encrypted files. The recommended state for this setting is: Disabled." + rationale: "Indexing and allowing users to search encrypted files could potentially reveal confidential data stored within the encrypted files." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow indexing of encrypted files. Note: This Group Policy path is provided by the Group Policy template Search.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.67.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems -> 0' + + - id: 15857 + title: "Ensure 'Allow search and Cortana to use location' is set to 'Disabled'." + description: "This policy setting specifies whether search and Cortana can provide location aware search and Cortana results. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment, allowing Cortana and Search to have access to location data is unnecessary. Organizations likely do not want this information shared out." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow search and Cortana to use location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.67.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowSearchToUseLocation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowSearchToUseLocation -> 0' + + - id: 15858 + title: "Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'." + description: "The Key Management Service (KMS) is a Microsoft license activation method that entails setting up a local server to store the software licenses. The KMS server itself needs to connect to Microsoft to activate the KMS service, but subsequent on-network clients can activate Microsoft Windows OS and/or their Microsoft Office via the KMS server instead of connecting directly to Microsoft. This policy setting lets you opt-out of sending KMS client activation data to Microsoft automatically. The recommended state for this setting is: Enabled." + rationale: "Even though the KMS licensing method does not require KMS clients to connect to Microsoft, they still send KMS client activation state data to Microsoft automatically. Preventing this information from being sent can help reduce privacy concerns in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Software Protection Platform\\Turn off KMS Client Online AVS Validation. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AVSValidationGP.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.72.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> 1' + + - id: 15859 + title: "Ensure 'Disable all apps from Microsoft Store' is set to 'Disabled'." + description: "This setting configures the launch of all apps from the Microsoft Store that came pre- installed or were downloaded. The recommended state for this setting is: Disabled. Note: This policy setting only applies to Windows 10 Enterprise and Windows 10 Education editions. Note #2: The name of this setting and the Enabled/Disabled values are incorrectly worded - logically, the title implies that configuring it to Enabled will disable all apps from the Microsoft Store, and configuring it to Disabled will enable all apps from the Microsoft Store. The opposite is true (and is consistent with the GPME help text). This is a logical wording mistake by Microsoft in the Administrative Template." + rationale: "The Store service is a retail outlet built into Windows, primarily for consumer use. In an enterprise managed environment the IT department should be managing the installation of all applications to reduce the risk of the installation of vulnerable software." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Disable all apps from Microsoft Store. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsStore.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable all apps from Windows Store, but it was renamed starting with the Windows 10 Release 1803 Administrative Templates." + compliance: + - cis: ["18.9.75.1"] + - cis_csc: ["2.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> DisableStoreApps' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> DisableStoreApps -> 1' + + - id: 15860 + title: "Ensure 'Only display the private store within the Microsoft Store' is set to 'Enabled'." + description: "This policy setting denies access to the retail catalog in the Microsoft Store, but displays the private store. The recommended state for this setting is: Enabled." + rationale: "Allowing the private store will allow an organization to control the apps that users have access to add to a system. This will help ensure that unapproved malicious apps are not running on a system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Only display the private store within the Microsoft Store. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsStore.admx/adml that is included with the Microsoft Windows 10 Release 1607 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Only display the private store within the Windows Store app, but it was renamed starting with the Windows 10 Release 1803 Administrative Templates." + compliance: + - cis: ["18.9.75.2"] + - cis_csc: ["2.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> RequirePrivateStoreOnly' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> RequirePrivateStoreOnly -> 1' + + - id: 15861 + title: "Ensure 'Turn off Automatic Download and Install of updates' is set to 'Disabled'." + description: "This setting enables or disables the automatic download and installation of Microsoft Store app updates. The recommended state for this setting is: Disabled." + rationale: "Keeping your system properly patched can help protect against 0 day vulnerabilities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Turn off Automatic Download and Install of updates. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinStoreUI.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates, or by the Group Policy template WindowsStore.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.75.3"] + - cis_csc: ["7.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> AutoDownload' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> AutoDownload -> 4' + + - id: 15862 + title: "Ensure 'Turn off the offer to update to the latest version of Windows' is set to 'Enabled'." + description: "Enables or disables the Microsoft Store offer to update to the latest version of Windows. The recommended state for this setting is: Enabled." + rationale: "Unplanned OS upgrades can lead to more preventable support calls. The IT department should be managing and approving all upgrades and updates." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Turn off the offer to update to the latest version of Windows. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinStoreUI.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates, or by the Group Policy template WindowsStore.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.75.4"] + - cis_csc: ["7.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> DisableOSUpgrade' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> DisableOSUpgrade -> 1' + + - id: 15863 + title: "Ensure 'Turn off the Store application' is set to 'Enabled'." + description: "This setting denies or allows access to the Store application. The recommended state for this setting is: Enabled. Note: Per Microsoft TechNet and MSKB 3135657, this policy setting does not apply to any Windows 10 editions other than Enterprise and Education." + rationale: "Only applications approved by an IT department should be installed. Allowing users to install 3rd party applications can lead to missed patches and potential zero day vulnerabilities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Turn off the Store application. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinStoreUI.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates, or by the Group Policy template WindowsStore.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.75.5"] + - cis_csc: ["2.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - https://docs.microsoft.com/en-us/windows/client-management/group-policies-for-enterprise-and-education-editions + - https://support.microsoft.com/en-us/help/3135657/can-t-disable-windows-store-in-windows-10-pro-through-group-policy + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> RemoveWindowsStore' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> RemoveWindowsStore -> 1' + + - id: 15864 + title: "Ensure 'Allow widgets' is set to 'Disabled'." + description: "This policy setting specifies whether the widgets feature is allowed on the device. The widgets feature provides information such as, weather, news, sports, stocks, traffic, and entertainment (not an inclusive list). The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, apps and features such as widgets on the Windows taskbar should be treated as a possible security risk due to the potential of data being sent back to 3rd parties, such as Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Widgets\\Allow Widgets. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template NewsAndInterests.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.81.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Dsh' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Dsh -> AllowNewsAndInterests' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Dsh -> AllowNewsAndInterests -> 0' + + - id: 15865 + title: "Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass'." + description: "This policy setting allows you to manage the behavior of Windows Defender SmartScreen. Windows Defender SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. Some information is sent to Microsoft about files and programs run on PCs with this feature enabled. The recommended state for this setting is: Enabled: Warn and prevent bypass." + rationale: "Windows Defender SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. However, due to the fact that some information is sent to Microsoft about files and programs run on PCs some organizations may prefer to disable it." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Warn and prevent bypass: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender SmartScreen\\Explorer\\Configure Windows Defender SmartScreen. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsExplorer.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Configure Windows SmartScreen, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.85.1.1"] + - cis_csc: ["10.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> ShellSmartScreenLevel' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> ShellSmartScreenLevel -> Block' + + - id: 15866 + title: "Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled'." + description: "This setting lets you decide whether to turn on SmartScreen Filter. SmartScreen Filter provides warning messages to help protect your employees from potential phishing scams and malicious software. The recommended state for this setting is: Enabled." + rationale: "SmartScreen serves an important purpose as it helps to warn users of possible malicious sites and files. Allowing users to turn off this setting can make the browser become more vulnerable to compromise." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender SmartScreen\\Microsoft Edge\\Configure Windows Defender SmartScreen. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer). Note #2: In the Microsoft Windows 10 RTM (Release 1507) Administrative Templates, this setting was initially named Allows you to configure SmartScreen. In the Microsoft Windows 10 Release 1511 Administrative Templates, it was renamed to Turn off the SmartScreen Filter. In the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates, it was renamed (again) to Configure SmartScreen Filter. Finally, it was given its current name of Configure Windows Defender SmartScreen starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.85.2.1"] + - cis_csc: ["10.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter -> EnabledV9' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter -> EnabledV9 -> 1' + + - id: 15867 + title: "Ensure 'Prevent bypassing Windows Defender SmartScreen prompts for sites' is set to 'Enabled'." + description: "This setting lets you decide whether employees can override the SmartScreen Filter warnings about potentially malicious websites. The recommended state for this setting is: Enabled." + rationale: "SmartScreen will warn an employee if a website is potentially malicious. Enabling this setting prevents these warnings from being bypassed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender SmartScreen\\Microsoft Edge\\Prevent bypassing Windows Defender SmartScreen prompts for sites. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Microsoft Windows 10 Release 1511 Administrative Templates, this setting was initially named Don't allow SmartScreen Filter warning overrides. In the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates, this setting was renamed to Prevent bypassing SmartScreen prompts for sites. Finally, it was given its current name of Prevent bypassing Windows Defender SmartScreen prompts for sites starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.85.2.2"] + - cis_csc: ["10.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter -> PreventOverride' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter -> PreventOverride -> 1' + + - id: 15868 + title: "Ensure 'Enables or disables Windows Game Recording and Broadcasting' is set to 'Disabled'." + description: "This setting enables or disables the Windows Game Recording and Broadcasting features. The recommended state for this setting is: Disabled." + rationale: "If this setting is allowed, users could record and broadcast session info to external sites, which is both a risk of accidentally exposing sensitive company data (on-screen) outside the company as well as a privacy concern." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Game Recording and Broadcasting\\Enables or disables Windows Game Recording and Broadcasting. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GameDVR.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.87.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR -> AllowGameDVR' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR -> AllowGameDVR -> 0' + + - id: 15869 + title: "Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled'." + description: "This policy setting determines whether suggested apps in Windows Ink Workspace are allowed. The recommended state for this setting is: Disabled." + rationale: "This Microsoft feature is designed to collect data and suggest apps based on that data collected. Disabling this setting will help ensure your data is not shared with any third party." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow suggested apps in Windows Ink Workspace. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.89.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowSuggestedAppsInWindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowSuggestedAppsInWindowsInkWorkspace -> 0' + + - id: 15870 + title: "Ensure 'Allow Windows Ink Workspace' is set to 'Enabled: On, but disallow access above lock' OR 'Disabled' but not 'Enabled: On'." + description: "This policy setting determines whether Windows Ink items are allowed above the lock screen. The recommended state for this setting is: Enabled: On, but disallow access above lock OR Disabled." + rationale: "Allowing any apps to be accessed while system is locked is not recommended. If this feature is permitted, it should only be accessible once a user authenticates with the proper credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: On, but disallow access above lock OR Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow Windows Ink Workspace. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.89.2"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace -> r:^0$|^1$' + + - id: 15871 + title: "Ensure 'Allow user control over installs' is set to 'Disabled'." + description: "This setting controls whether users are permitted to change installation options that typically are available only to system administrators. The security features of Windows Installer normally prevent users from changing installation options that are typically reserved for system administrators, such as specifying the directory to which files are installed. If Windows Installer detects that an installation package has permitted the user to change a protected option, it stops the installation and displays a message. These security features operate only when the installation program is running in a privileged security context in which it has access to directories denied to the user. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment, only IT staff with administrative rights should be installing or changing software on a system. Allowing users the ability to have any control over installs can risk unapproved software from being installed or removed from a system, which could cause the system to become vulnerable to compromise." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Allow user control over installs. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Enable user control over installs, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.90.1"] + - cis_csc: ["2.5"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl -> 0' + + - id: 15872 + title: "Ensure 'Always install with elevated privileges' is set to 'Disabled'." + description: "This setting controls whether or not Windows Installer should use system permissions when it installs any program on the system. Note: This setting appears both in the Computer Configuration and User Configuration folders. To make this setting effective, you must enable the setting in both folders. Caution: If enabled, skilled users can take advantage of the permissions this setting grants to change their privileges and gain permanent access to restricted files and folders. Note that the User Configuration version of this setting is not guaranteed to be secure. The recommended state for this setting is: Disabled." + rationale: "Users with limited privileges can exploit this feature by creating a Windows Installer installation package that creates a new local account that belongs to the local built-in Administrators group, adds their current account to the local built-in Administrators group, installs malicious software, or performs other unauthorized activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Always install with elevated privileges. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.90.2"] + - cis_csc: ["5.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated -> 0' + + - id: 15873 + title: "Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'." + description: "This policy setting controls whether Web-based programs are allowed to install software on the computer without notifying the user. The recommended state for this setting is: Disabled." + rationale: "Suppressing the system warning can pose a security risk and increase the attack surface on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Prevent Internet Explorer security prompt for Windows Installer scripts. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable IE security prompt for Windows Installer scripts, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.90.3"] + - cis_csc: ["2.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> 0' + + - id: 15874 + title: "Ensure 'Sign-in and lock last interactive user automatically after a restart' is set to 'Disabled'." + description: "This policy setting controls whether a device will automatically sign-in the last interactive user after Windows Update restarts the system. The recommended state for this setting is: Disabled." + rationale: "Disabling this feature will prevent the caching of user's credentials and unauthorized use of the device, and also ensure the user is aware of the restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Logon Options\\Sign-in and lock last interactive user automatically after a restart. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinLogon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Sign-in last interactive user automatically after a system-initiated restart, but it was renamed starting with the Windows 10 Release 1903 Administrative Templates." + compliance: + - cis: ["18.9.91.1"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn -> 1' + + - id: 15875 + title: "Ensure 'Turn on PowerShell Script Block Logging' is set to 'Enabled'." + description: "This policy setting enables logging of all PowerShell script input to the Applications and Services Logs\\Microsoft\\Windows\\PowerShell\\Operational Event Log channel. The recommended state for this setting is: Enabled. Note: If logging of Script Block Invocation Start/Stop Events is enabled (option box checked), PowerShell will log additional events when invocation of a command, script block, function, or script starts or stops. Enabling this option generates a high volume of event logs. CIS has intentionally chosen not to make a recommendation for this option, since it generates a large volume of events. If an organization chooses to enable the optional setting (checked), this also conforms to the benchmark." + rationale: "Logs of PowerShell script input can be very valuable when performing forensic investigations of PowerShell attack incidents to determine what occurred." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Script Block Logging. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.100.1"] + - cis_csc: ["8.8"] + - pci_dss: ["12.3.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging -> 1' + + - id: 15876 + title: "Ensure 'Turn on PowerShell Transcription' is set to 'Disabled'." + description: "This Policy setting lets you capture the input and output of Windows PowerShell commands into text-based transcripts. The recommended state for this setting is: Disabled." + rationale: "If this setting is enabled there is a risk that passwords could get stored in plain text in the PowerShell_transcript output file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Transcription. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.100.2"] + - pci_dss: ["12.3.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting -> 0' + + - id: 15877 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client uses Basic authentication. The recommended state for this setting is: Disabled. Note: Clients that use Microsoft's Exchange Online service (Office 365) will require an exception to this recommendation, to instead have this setting set to Enabled. Exchange Online uses Basic authentication over HTTPS, and so the Exchange Online authentication traffic will still be safely encrypted." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow Basic authentication. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.1.1"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic -> 0' + + - id: 15878 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow unencrypted traffic. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.1.2"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic -> 0' + + - id: 15879 + title: "Ensure 'Disallow Digest authentication' is set to 'Enabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client will not use Digest authentication. The recommended state for this setting is: Enabled." + rationale: "Digest authentication is less robust than other authentication methods available in WinRM, an attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Disallow Digest authentication. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.1.3"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest -> 0' + + - id: 15880 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service accepts Basic authentication from a remote client. The recommended state for this setting is: Disabled." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow Basic authentication. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.2.1"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic -> 0' + + - id: 15881 + title: "Ensure 'Allow remote server management through WinRM' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port. The recommended state for this setting is: Disabled." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Management (WinRM) service on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow automatic configuration of listeners, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.102.2.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> 0' + + - id: 15882 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow unencrypted traffic. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.2.3"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic -> 0' + + - id: 15883 + title: "Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service will allow RunAs credentials to be stored for any plug-ins. The recommended state for this setting is: Enabled. Note: If you enable and then disable this policy setting, any values that were previously configured for RunAsPassword will need to be reset." + rationale: "Although the ability to store RunAs credentials is a convenient feature it increases the risk of account compromise slightly. For example, if you forget to lock your desktop before leaving it unattended for a few minutes another person could access not only the desktop of your computer but also any hosts you manage via WinRM with cached RunAs credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Disallow WinRM from storing RunAs credentials. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.102.2.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs -> 1' + + - id: 15884 + title: "Ensure 'Allow Remote Shell Access' is set to 'Disabled'." + description: "This policy setting allows you to manage configuration of remote access to all supported shells to execute scripts and commands. The recommended state for this setting is: Disabled. Note: The GPME help text for this setting is incorrectly worded, implying that configuring it to Enabled will reject new Remote Shell connections, and setting it to Disabled will allow Remote Shell connections. The opposite is true (and is consistent with the title of the setting). This is a wording mistake by Microsoft in the Administrative Template." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Shell on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Shell\\Allow Remote Shell Access. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteShell.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.103.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> 0' + + - id: 15885 + title: "Ensure 'Allow clipboard sharing with Windows Sandbox' is set to 'Disabled'." + description: 'This policy setting enables or disables clipboard sharing with the Windows sandbox. The recommended state for this setting is: Disabled. Note: The Windows Sandbox feature was first introduced in Windows 10 R1903, and allows a temporary "clean install" virtual instance of Windows to be run inside the host, for the ostensible purpose of testing applications without making changes to the host.' + rationale: "Disabling copy and paste decreases the attack surface exposed by the Windows Sandbox and possible exposure of untrusted applications to the internal network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Sandbox\\Allow clipboard sharing with Windows Sandbox. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsSandbox.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.104.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Sandbox' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Sandbox -> AllowClipboardRedirection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Sandbox -> AllowClipboardRedirection -> 0' + + - id: 15886 + title: "Ensure 'Allow networking in Windows Sandbox' is set to 'Disabled'." + description: 'This policy setting enables or disables networking in the Windows Sandbox. Networking is achieved by creating a virtual switch on the host, and connecting the Windows Sandbox to it via a virtual Network Interface Card (NIC). The recommended state for this setting is: Disabled. Note: The Windows Sandbox feature was first introduced in Windows 10 R1903, and allows a temporary "clean install" virtual instance of Windows to be run inside the host, for the ostensible purpose of testing applications without making changes to the host.' + rationale: "Disabling network access decreases the attack surface exposed by the Windows Sandbox and exposure of untrusted applications to the internal network. Note: Per Microsoft, enabling networking in the Windows Sandbox can expose untrusted applications to the internal network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Sandbox\\Allow networking in Windows Sandbox. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsSandbox.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.104.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Sandbox' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Sandbox -> AllowNetworking' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Sandbox -> AllowNetworking -> 0' + + - id: 15887 + title: "Ensure 'Prevent users from modifying settings' is set to 'Enabled'." + description: "This policy setting prevent users from making changes to the Exploit protection settings area in the Windows Security settings. The recommended state for this setting is: Enabled." + rationale: "Only authorized IT staff should be able to make changes to the exploit protection settings in order to ensure the organizations specific configuration is not modified." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Security\\App and browser protection\\Prevent users from modifying settings. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefenderSecurityCenter.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.105.2.1"] + - cis_csc: ["10.5"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection -> DisallowExploitProtectionOverride' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection -> DisallowExploitProtectionOverride -> 1' + + - id: 15888 + title: "Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'." + description: "This policy setting specifies that Automatic Updates will wait for computers to be restarted by the users who are logged on to them to complete a scheduled installation. The recommended state for this setting is: Disabled. Note: This setting applies only when you configure Automatic Updates to perform scheduled update installations. If you configure the Configure Automatic Updates setting to Disabled, this setting has no effect." + rationale: "Some security updates require that the computer be restarted to complete an installation. If the computer cannot restart automatically, then the most recent update will not completely install and no new updates will download to the computer until it is restarted. Without the auto-restart functionality, users who are not security-conscious may choose to indefinitely delay the restart, therefore keeping the computer in a less secure state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Legacy Policies\\No auto-restart with logged on users for scheduled automatic updates installations. Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named No auto-restart for scheduled Automatic Updates installations, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.108.1.1"] + - cis_csc: ["7.3"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers -> 0' + + - id: 15889 + title: "Ensure 'Configure Automatic Updates' is set to 'Enabled'." + description: 'This policy setting specifies whether computers in your environment will receive security updates from Windows Update or WSUS. If you configure this policy setting to Enabled, the operating system will recognize when a network connection is available and then use the network connection to search Windows Update or your designated intranet site for updates that apply to them. After you configure this policy setting to Enabled, select one of the following three options in the Configure Automatic Updates Properties dialog box to specify how the service will work: 2 - Notify for download and auto install (Notify before downloading any updates) 3 - Auto download and notify for install (Download the updates automatically and notify when they are ready to be installed.) (Default setting) 4 - Auto download and schedule the install (Automatically download updates and install them on the schedule specified below.)) 5 - Allow local admin to choose setting (Leave decision on above choices up to the local Administrators (Not Recommended)) The recommended state for this setting is: Enabled. Note: The sub-setting "Configure automatic updating:" has 4 possible values - all of them are valid depending on specific organizational needs, however if feasible we suggest using a value of 4 - Auto download and schedule the install. This suggestion is not a scored requirement. Note #2: Organizations that utilize a 3rd-party solution for patching may choose to exempt themselves from this recommendation, and instead configure it to Disabled so that the native Windows Update mechanism does not interfere with the 3rd-party patching process.' + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage end user experience\\Configure Automatic Updates. Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.108.2.1"] + - cis_csc: ["7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> 0' + + - id: 15890 + title: "Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'." + description: "This policy setting specifies when computers in your environment will receive security updates from Windows Update or WSUS. The recommended state for this setting is: 0 - Every day. Note: This setting is only applicable if 4 - Auto download and schedule the install is selected in recommendation 'Configure Automatic Updates'. It will have no impact if any other option is selected." + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to 0 - Every day: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage end user experience\\Configure Automatic Updates: Scheduled install day. Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.108.2.2"] + - cis_csc: ["7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> 4' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay -> 0' + + - id: 15891 + title: 'Ensure ''Remove access to "Pause updates" feature'' is set to ''Enabled''.' + description: 'This policy removes access to "Pause updates" feature. The recommended state for this setting is: Enabled.' + rationale: "In order to ensure security and system updates are applied, system administrators should control when updates are applied to systems." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage end user experience\\Remove access to \"Pause updates\" feature. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.108.2.3"] + - cis_csc: ["7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> SetDisablePauseUXAccess' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> SetDisablePauseUXAccess -> 1' + + - id: 15892 + title: "Ensure 'Manage preview builds' is set to 'Disabled'." + description: "This policy setting manage which updates that are receive prior to the update being released. Dev Channel: Ideal for highly technical users. Insiders in the Dev Channel will receive builds from our active development branch that is earliest in a development cycle. These builds are not matched to a specific Windows 10 release. Beta Channel: Ideal for feature explorers who want to see upcoming Windows 10 features. Your feedback will be especially important here as it will help our engineers ensure key issues are fixed before a major release. Release Preview Channel (default): Insiders in the Release Preview Channel will have access to the upcoming release of Windows 10 prior to it being released to the world. These builds are supported by Microsoft. The Release Preview Channel is where we recommend companies preview and validate upcoming Windows 10 releases before broad deployment within their organization. The recommended state for this setting is: Disabled. Note: Preview Build enrollment requires a telemetry level setting of 2 or higher and your domain registered on insider.windows.com. For additional information on Preview Builds, see: https://aka.ms/wipforbiz" + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage updates offered from Windows Update\\Manage preview builds. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.108.4.1"] + - cis_csc: ["2.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuildsPolicyValue' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuildsPolicyValue -> 1' + + - id: 15893 + title: "Ensure 'Select when Preview Builds and Feature Updates are received' is set to 'Enabled: 180 or more days'." + description: 'This policy setting determines when Preview Build or Feature Updates are received. Defer Updates This enables devices to defer taking the next Feature Update available to your channel for up to 14 days for all the pre-release channels and up to 365 days for the Semi-Annual Channel. Or, if the device is updating from the Semi-Annual Channel, a version for the device to move to and/or stay on until the policy is updated or the device reaches end of service can be specified. Note: If you set both policies, the version specified will take precedence and the deferrals will not be in effect. Please see the Windows Release Information page for OS version information. Pause Updates To prevent Feature Updates from being received on their scheduled time, you can temporarily pause Feature Updates. The pause will remain in effect for 35 days from the specified start date or until the field is cleared (Quality Updates will still be offered). Note: If the "Allow Diagnostic Data" (formerly "Allow Telemetry") policy is set to 0, this policy will have no effect. Note #2: Starting with Windows 10 R1607, Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering. More information on Dual Scan is available at these links: - Demystifying "Dual Scan" - WSUS Product Team Blog - Improving Dual Scan on 1607 - WSUS Product Team Blog Note #3: Prior to Windows 10 R1703, values above 180 days are not recognized by the OS. Starting with Windows 10 R1703, the maximum number of days you can defer is 365 days.' + rationale: "In a production environment, it is preferred to only use software and features that are publicly available, after they have gone through rigorous testing in beta." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 180 or more days: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage updates offered from Windows Update\\Windows Update for Business\\Select when Preview Builds and Feature Updates are received. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Select when Feature Updates are received, but it was renamed to Select when Preview Builds and Feature Updates are received starting with the Windows 10 Release 1709 Administrative Templates." + compliance: + - cis: ["18.9.108.4.2"] + - cis_csc: ["2.5", "7.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdates' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdatesPeriodInDays' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdatesPeriodInDays -> n:^(\d+) compare >= 180' + + - id: 15894 + title: "Ensure 'Select when Quality Updates are received' is set to 'Enabled: 0 days'." + description: 'This settings controls when Quality Updates are received. The recommended state for this setting is: Enabled: 0 days. Note: If the "Allow Diagnostic Data" (formerly "Allow Telemetry") policy is set to 0, this policy will have no effect. Note #2: Starting with Windows 10 R1607, Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering. More information on Dual Scan is available at these links: - Demystifying "Dual Scan" - WSUS Product Team Blog - Improving Dual Scan on 1607 - WSUS Product Team Blog' + rationale: "Quality Updates can contain important bug fixes and/or security patches, and should be installed as soon as possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled:0 days: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Windows Update for Business\\Select when Quality Updates are received Note: This Group Policy path does not exist by default. An updated Group Policy template (WindowsUpdate.admx/adml) is required - it is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.108.4.3"] + - cis_csc: ["7.3"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdatesPeriodInDays -> 0' diff --git a/etc/ruleset/sca/windows/cis_win11_enterprise.yml b/etc/ruleset/sca/windows/cis_win11_enterprise.yml new file mode 100644 index 0000000000..a773eee4ea --- /dev/null +++ b/etc/ruleset/sca/windows/cis_win11_enterprise.yml @@ -0,0 +1,6115 @@ +# Security Configuration Assessment +# CIS Checks for Windows 11 Enterprise +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark v1.0.0 for Microsoft Windows 11 Release 21H2 - 02-14-2022 + +policy: + id: "cis_win11_enterprise_21H2" + file: "cis_win11_enterprise.yml" + name: "CIS Microsoft Windows 11 Enterprise Benchmark v1.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows 11." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform is Windows 11" + description: "Requirements for running the CIS benchmark Domain Controller under Windows 11" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows 10' + +checks: + # 1.1 Password Policy + - id: 26000 + title: "Ensure 'Enforce password history' is set to '24 or more password(s)'." + description: "This policy setting determines the number of renewed, unique passwords that have to be associated with a user account before you can reuse an old password. The value for this policy setting must be between 0 and 24 passwords. The default value for Windows Vista is 0 passwords, but the default setting in a domain is 24 passwords. To maintain the effectiveness of this policy setting, use the Minimum password age setting to prevent users from repeatedly changing their password. The recommended state for this setting is: 24 or more password(s). Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center. Note #2: As of the publication of this benchmark, Microsoft currently has a maximum limit of 24 saved passwords. For more information, please visit Enforce password history (Windows 10) - Windows security | Microsoft Docs" + rationale: "The longer a user uses the same password, the greater the chance that an attacker can determine the password through brute force attacks. Also, any accounts that may have been compromised will remain exploitable for as long as the password is left unchanged. If password changes are required but password reuse is not prevented, or if users continually reuse a small number of passwords, the effectiveness of a good password policy is greatly reduced. If you specify a low number for this policy setting, users will be able to use the same small number of passwords repeatedly. If you do not also configure the Minimum password age setting, users might repeatedly change their passwords until they can reuse their original password." + remediation: "To establish the recommended configuration via GP, set the following UI path to 24 or more password(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Enforce password history" + compliance: + - cis: ["1.1.1"] + - cis_csc: ["5.2"] + condition: all + rules: + - 'c:net.exe accounts -> n:Length of password history maintained:\s+(\d+) compare >= 24' + + - id: 26001 + title: "Ensure 'Maximum password age' is set to '365 or fewer days, but not 0'." + description: "This policy setting defines how long a user can use their password before it expires. Values for this policy setting range from 0 to 999 days. If you set the value to 0, the password will never expire. Because attackers can crack passwords, the more frequently you change the password the less opportunity an attacker has to use a cracked password. However, the lower this value is set, the higher the potential for an increase in calls to help desk support due to users having to change their password or forgetting which password is current. The recommended state for this setting is 365 or fewer days, but not 0. Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "The longer a password exists the higher the likelihood that it will be compromised by a brute force attack, by an attacker gaining general knowledge about the user, or by the user sharing the password. Configuring the Maximum password age setting to 0 so that users are never required to change their passwords is a major security risk because that allows a compromised password to be used by the malicious user for as long as the valid user has authorized access." + remediation: "To establish the recommended configuration via GP, set the following UI path to 365 or fewer days, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Maximum password age" + compliance: + - cis: ["1.1.2"] + - cis_csc: ["5.2"] + condition: all + rules: + - 'c:net.exe accounts -> n:Maximum password age \(days\):\s+(\d+) compare <= 365' + - 'c:net.exe accounts -> n:Maximum password age \(days\):\s+(\d+) compare > 0' + + - id: 26002 + title: "Ensure 'Minimum password age' is set to '1 or more day(s)'." + description: "This policy setting determines the number of days that you must use a password before you can change it. The range of values for this policy setting is between 1 and 999 days. (You may also set the value to 0 to allow immediate password changes.) The default value for this setting is 0 days. The recommended state for this setting is: 1 or more day(s)). Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "Users may have favorite passwords that they like to use because they are easy to remember and they believe that their password choice is secure from compromise. Unfortunately, passwords are compromised and if an attacker is targeting a specific individual's user account, with foreknowledge of data about that user, reuse of old passwords can cause a security breach. To address password reuse a combination of security settings is required. Using this policy setting with the Enforce password history setting prevents the easy reuse of old passwords. For example, if you configure the Enforce password history setting to ensure that users cannot reuse any of their last 12 passwords, they could change their password 13 times in a few minutes and reuse the password they started with, unless you also configure the Minimum password age setting to a number that is greater than 0. You must configure this policy setting to a number that is greater than 0 for the Enforce password history setting to be effective." + remediation: "To establish the recommended configuration via GP, set the following UI path to 1 or more day(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Minimum password age" + compliance: + - cis: ["1.1.3"] + - cis_csc: ["5.2"] + condition: all + rules: + - 'c:net.exe accounts -> n:Minimum password age \(days\):\s+(\d+) compare >= 1' + + - id: 26003 + title: "Ensure 'Minimum password length' is set to '14 or more character(s)'." + description: "This policy setting determines the least number of characters that make up a password for a user account. There are many different theories about how to determine the best password length for an organization, but perhaps 'passphrase' is a better term than 'password.' In Microsoft Windows 2000 and newer, passphrases can be quite long and can include spaces. Therefore, a phrase such as 'I want to drink a $5 milkshake' is a valid passphrase; it is a considerably stronger password than an 8 or 10 character string of random numbers and letters, and yet is easier to remember. Users must be educated about the proper selection and maintenance of passwords, especially with regard to password length. In enterprise environments, the ideal value for the Minimum password length setting is 14 characters, however you should adjust this value to meet your organization's business requirements. The recommended state for this setting is: 14 or more character(s). Note: In Windows Server 2016 and older versions of Windows Server, the GUI of the Local Security Policy (LSP), Local Group Policy Editor (LGPE) and Group Policy Management Editor (GPME) would not let you set this value higher than 14 characters. However, starting with Windows Server 2019, Microsoft changed the GUI to allow up to a 20 character minimum password length. Note #2: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "Types of password attacks include dictionary attacks (which attempt to use common words and phrases) and brute force attacks (which try every possible combination of characters). Also, attackers sometimes try to obtain the account database so they can use tools to discover the accounts and passwords." + remediation: "To establish the recommended configuration via GP, set the following UI path to 14 or more character(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Minimum password length" + compliance: + - cis: ["1.1.4"] + - cis_csc: ["5.2"] + condition: all + rules: + - 'c:net.exe accounts -> n:Minimum password length:\s+(\d+) compare >= 14' + + - id: 26004 + title: "Ensure 'Password must meet complexity requirements' is set to 'Enabled'." + description: "This policy setting checks all new passwords to ensure that they meet basic requirements for strong passwords. When this policy is enabled, passwords must meet the following minimum requirements: - Not contain the user's account name or parts of the user's full name that exceed two consecutive characters - Be at least six characters in length - Contain characters from three of the following categories: - English uppercase characters (A through Z) - English lowercase characters (a through z) - Base 10 digits (0 through 9) - Non-alphabetic characters (for example, !, $, #, %) o A catch-all category of any Unicode character that does not fall under the previous four categories. This fifth category can be regionally specific. Each additional character in a password increases its complexity exponentially. For instance, a seven-character, all lower-case alphabetic password would have 267 (approximately 8 x 109 or 8 billion) possible combinations. At 1,000,000 attempts per second (a capability of many password-cracking utilities), it would only take 133 minutes to crack. A seven-character alphabetic password with case sensitivity has 527 combinations. A seven-character case-sensitive alphanumeric password without punctuation has 627 combinations. An eight-character password has 268 (or 2 x 1011) possible combinations. Although this might seem to be a large number, at 1,000,000 attempts per second it would take only 59 hours to try all possible passwords. Remember, these times will significantly increase for passwords that use ALT characters and other special keyboard characters such as '!'' or '@''. Proper use of the password settings can help make it difficult to mount a brute force attack. The recommended state for this setting is: Enabled. Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "Passwords that contain only alphanumeric characters are extremely easy to discover with several publicly available tools." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Password must meet complexity requirements" + compliance: + - cis: ["1.1.5"] + - cis_csc: ["5.2"] + condition: all + rules: + - 'c:powershell Get-ADDefaultDomainPasswordPolicy -Current LoggedOnUser -> r:ComplexityEnabled\s+: True' + + - id: 26005 + title: "Ensure 'Relax minimum password length limits' is set to 'Enabled'." + description: "This policy setting determines whether the minimum password length setting can be increased beyond the legacy limit of 14 characters. For more information please see the following Microsoft Security Blog. The recommended state for this setting is: Enabled. Note: This setting only affects local accounts on the computer. Domain accounts are only affected by settings on the Domain Controllers, because that is where domain accounts are stored." + rationale: "This setting will enable the enforcement of longer and generally stronger passwords or passphrases where MFA is not in use." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Relax minimum password length limits. Note: This setting is only available within the built-in OS security template of Windows 10 Release 2004 and Server 2022 (or newer), and is not available via older versions of the OS, or via downloadable Administrative Templates (ADMX/ADML). Therefore, you must use a Windows 10 Release 2004 or Server 2022 system (or newer) to view or edit this setting with the Group Policy Management Console (GPMC) or Group Policy Management Editor (GPME)." + compliance: + - cis: ["1.1.6"] + - cis_csc: ["5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SAM' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SAM -> RelaxMinimumPasswordLengthLimits' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SAM -> RelaxMinimumPasswordLengthLimits -> 1' + + - id: 26006 + title: "Ensure 'Account lockout duration' is set to '15 or more minute(s)'." + description: "This policy setting determines the length of time that must pass before a locked account is unlocked and a user can try to log on again. The setting does this by specifying the number of minutes a locked out account will remain unavailable. If the value for this policy setting is configured to 0, locked out accounts will remain locked out until an administrator manually unlocks them. Although it might seem like a good idea to configure the value for this policy setting to a high value, such a configuration will likely increase the number of calls that the help desk receives to unlock accounts locked by mistake. Users should be aware of the length of time a lock remains in place, so that they realize they only need to call the help desk if they have an extremely urgent need to regain access to their computer. The recommended state for this setting is: 15 or more minute(s). Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "A denial of service (DoS) condition can be created if an attacker abuses the Account lockout threshold and repeatedly attempts to log on with a specific account. Once you configure the Account lockout threshold setting, the account will be locked out after the specified number of failed attempts. If you configure the Account lockout duration setting to 0, then the account will remain locked out until an administrator unlocks it manually." + remediation: "To establish the recommended configuration via GP, set the following UI path to 15 or more minute(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Account Lockout Policy\\Account lockout duration" + compliance: + - cis: ["1.2.1"] + - cis_csc: ["4.10"] + condition: all + rules: + - 'c:net.exe accounts -> n:Lockout duration \(minutes\):\s+(\d+) compare >= 15' + + - id: 26007 + title: "Ensure 'Account lockout threshold' is set to '5 or fewer invalid logon attempt(s), but not 0'." + description: "This policy setting determines the number of failed logon attempts before the account is locked. Setting this policy to 0 does not conform to the benchmark as doing so disables the account lockout threshold. The recommended state for this setting is: 5 or fewer invalid logon attempt(s), but not 0. Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "Setting an account lockout threshold reduces the likelihood that an online password brute force attack will be successful. Setting the account lockout threshold too low introduces risk of increased accidental lockouts and/or a malicious actor intentionally locking out accounts." + remediation: "To establish the recommended configuration via GP, set the following UI path to 5 or fewer invalid login attempt(s), but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Account Lockout Policy\\Account lockout threshold" + compliance: + - cis: ["1.2.2"] + - cis_csc: ["4.10"] + condition: all + rules: + - 'c:net.exe accounts -> n:Lockout threshold:\s+(\d+) compare > 0' + - 'c:net.exe accounts -> n:Lockout threshold:\s+(\d+) compare <= 5' + + - id: 26008 + title: "Ensure 'Reset account lockout counter after' is set to '15 or more minute(s)'." + description: "This policy setting determines the length of time before the Account lockout threshold resets to zero. The default value for this policy setting is Not Defined. If the Account lockout threshold is defined, this reset time must be less than or equal to the value for the Account lockout duration setting. If you leave this policy setting at its default value or configure the value to an interval that is too long, your environment could be vulnerable to a DoS attack. An attacker could maliciously perform a number of failed logon attempts on all users in the organization, which will lock out their accounts. If no policy were determined to reset the account lockout, it would be a manual task for administrators. Conversely, if a reasonable time value is configured for this policy setting, users would be locked out for a set period until all of the accounts are unlocked automatically. The recommended state for this setting is: 15 or more minute(s). Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "Users can accidentally lock themselves out of their accounts if they mistype their password multiple times. To reduce the chance of such accidental lockouts, the Reset account lockout counter after setting determines the number of minutes that must elapse before the counter that tracks failed logon attempts and triggers lockouts is reset to 0." + remediation: "To establish the recommended configuration via GP, set the following UI path to 15 or more minute(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Account Lockout Policy\\Reset account lockout counter after" + compliance: + - cis: ["1.2.3"] + - cis_csc: ["4.10"] + condition: all + rules: + - 'c:net.exe accounts -> n:Lockout observation window \(minutes\):\s+(\d+) compare >= 15' + + - id: 26009 + title: "Ensure 'Accounts: Administrator account status' is set to 'Disabled'." + description: "This policy setting enables or disables the Administrator account during normal operation. When a computer is booted into safe mode, the Administrator account is always enabled, regardless of how this setting is configured. Note that this setting will have no impact when applied to the Domain Controllers organizational unit via group policy because Domain Controllers have no local account database. It can be configured at the domain level via group policy, similar to account lockout and password policy settings. The recommended state for this setting is: Disabled." + rationale: "In some organizations, it can be a daunting management challenge to maintain a regular schedule for periodic password changes for local accounts. Therefore, you may want to disable the built-in Administrator account instead of relying on regular password changes to protect it from attack. Another reason to disable this built-in account is that it cannot be locked out no matter how many failed logons it accrues, which makes it a prime target for brute force attacks that attempt to guess passwords. Also, this account has a well-known security identifier (SID) and there are third-party tools that allow authentication by using the SID rather than the account name. This capability means that even if you rename the Administrator account, an attacker could launch a brute force attack by using the SID to log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Administrator account status" + compliance: + - cis: ["2.3.1.1"] + - cis_csc: ["4.7"] + condition: any + rules: + - 'c:net user administrator -> r:Account active\s+No' + - "c:net user administrator -> r:The user name could not be found." + + - id: 26010 + title: "Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts'." + description: "This policy setting prevents users from adding new Microsoft accounts on this computer. The recommended state for this setting is: Users can't add or log on with Microsoft accounts." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used to log onto their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + remediation: "To establish the recommended configuration via GP, set the following UI path to Users can't add or log on with Microsoft accounts: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Block Microsoft accounts" + compliance: + - cis: ["2.3.1.2"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> 3' + + - id: 26011 + title: "Ensure 'Accounts: Guest account status' is set to 'Disabled'." + description: "This policy setting determines whether the Guest account is enabled or disabled. The Guest account allows unauthenticated network users to gain access to the system. The recommended state for this setting is: Disabled. Note: This setting will have no impact when applied to the Domain Controllers organizational unit via group policy because Domain Controllers have no local account database. It can be configured at the domain level via group policy, similar to account lockout and password policy settings." + rationale: "The default Guest account allows unauthenticated network users to log on as Guest with no password. These unauthorized users could access any resources that are accessible to the Guest account over the network. This capability means that any network shares with permissions that allow access to the Guest account, the Guests group, or the Everyone group will be accessible over the network, which could lead to the exposure or corruption of data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Guest account status" + compliance: + - cis: ["2.3.1.3"] + - cis_csc: ["4.7"] + condition: all + rules: + - 'c:net user guest -> r:Account active\s+No' + + - id: 26012 + title: "Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'." + description: "This policy setting determines whether local accounts that are not password protected can be used to log on from locations other than the physical computer console. If you enable this policy setting, local accounts that have blank passwords will not be able to log on to the network from remote client computers. Such accounts will only be able to log on at the keyboard of the computer. The recommended state for this setting is: Enabled." + rationale: "Blank passwords are a serious threat to computer security and should be forbidden through both organizational policy and suitable technical measures. In fact, the default settings for Active Directory domains require complex passwords of at least seven characters. However, if users with the ability to create new accounts bypass your domain-based password policies, they could create accounts with blank passwords. For example, a user could build a stand-alone computer, create one or more accounts with blank passwords, and then join the computer to the domain. The local accounts with blank passwords would still function. Anyone who knows the name of one of these unprotected accounts could then use it to log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Limit local account use of blank passwords to console logon only" + compliance: + - cis: ["2.3.1.4"] + - cis_csc: ["5.2"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse -> 1' + + - id: 26013 + title: "Configure 'Accounts: Rename administrator account'." + description: "The built-in local administrator account is a well-known account name that attackers will target. It is recommended to choose another name for this account, and to avoid names that denote administrative or elevated access accounts. Be sure to also change the default description for the local administrator (through the Computer Management console)." + rationale: "The Administrator account exists on all computers that run the Windows 2000 or newer operating systems. If you rename this account, it is slightly more difficult for unauthorized persons to guess this privileged user name and password combination. The built-in Administrator account cannot be locked out, regardless of how many times an attacker might use a bad password. This capability makes the Administrator account a popular target for brute force attacks that attempt to guess passwords. The value of this countermeasure is lessened because this account has a well-known SID, and there are third-party tools that allow authentication by using the SID rather than the account name. Therefore, even if you rename the Administrator account, an attacker could launch a brute force attack by using the SID to log on." + remediation: "To establish the recommended configuration via GP, configure the following UI path: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Rename administrator account" + compliance: + - cis: ["2.3.1.5"] + - cis_csc: ["4.7"] + condition: all + rules: + - "c:net user administrator -> r:The user name could not be found." + + - id: 26014 + title: "Configure 'Accounts: Rename guest account'." + description: "The built-in local guest account is another well-known name to attackers. It is recommended to rename this account to something that does not indicate its purpose. Even if you disable this account, which is recommended, ensure that you rename it for added security." + rationale: "The Guest account exists on all computers that run the Windows 2000 or newer operating systems. If you rename this account, it is slightly more difficult for unauthorized persons to guess this privileged user name and password combination." + remediation: "To establish the recommended configuration via GP, configure the following UI path: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Rename guest account" + compliance: + - cis: ["2.3.1.6"] + - cis_csc: ["4.7"] + condition: all + rules: + - "c:net user guest -> r:The user name could not be found." + + - id: 26015 + title: "Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'." + description: "This policy setting allows administrators to enable the more precise auditing capabilities present in Windows Vista. The Audit Policy settings available in Windows Server 2003 Active Directory do not yet contain settings for managing the new auditing subcategories. To properly apply the auditing policies prescribed in this baseline, the Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings setting needs to be configured to Enabled. The recommended state for this setting is: Enabled. Important: Be very cautious about audit settings that can generate a large volume of traffic. For example, if you enable either success or failure auditing for all of the Privilege Use subcategories, the high volume of audit events generated can make it difficult to find other types of entries in the Security log. Such a configuration could also have a significant impact on system performance." + rationale: "Prior to the introduction of auditing subcategories in Windows Vista, it was difficult to track events at a per-system or per-user level. The larger event categories created too many events and the key information that needed to be audited was difficult to find." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings" + compliance: + - cis: ["2.3.2.1"] + - cis_csc: ["8.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy -> 1' + + - id: 26016 + title: "Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'." + description: "This policy setting determines whether the system shuts down if it is unable to log Security events. It is a requirement for Trusted Computer System Evaluation Criteria (TCSEC)-C2 and Common Criteria certification to prevent auditable events from occurring if the audit system is unable to log them. Microsoft has chosen to meet this requirement by halting the system and displaying a stop message if the auditing system experiences a failure. When this policy setting is enabled, the system will be shut down if a security audit cannot be logged for any reason. If the Audit: Shut down system immediately if unable to log security audits setting is enabled, unplanned system failures can occur. The administrative burden can be significant, especially if you also configure the Retention method for the Security log to Do not overwrite events (clear log manually). This configuration causes a repudiation threat (a backup operator could deny that they backed up or restored data) to become a denial of service (DoS) vulnerability, because a server could be forced to shut down if it is overwhelmed with logon events and other security events that are written to the Security log. Also, because the shutdown is not graceful, it is possible that irreparable damage to the operating system, applications, or data could result. Although the NTFS file system guarantees its integrity when an ungraceful computer shutdown occurs, it cannot guarantee that every data file for every application will still be in a usable form when the computer restarts. The recommended state for this setting is: Disabled." + rationale: "If the computer is unable to record events to the Security log, critical evidence or important troubleshooting information may not be available for review after a security incident. Also, an attacker could potentially generate a large volume of Security log events to purposely force a computer shutdown." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Shut down system immediately if unable to log security audits" + compliance: + - cis: ["2.3.2.2"] + - cis_csc: ["8.3"] + - pci_dss: ["10.7"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 0' + + - id: 26017 + title: "Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators and Interactive Users'." + description: "This policy setting determines who is allowed to format and eject removable NTFS media. You can use this policy setting to prevent unauthorized users from removing data on one computer to access it on another computer on which they have local administrator privileges. The recommended state for this setting is: Administrators and Interactive Users." + rationale: "Users may be able to move data on removable disks to a different computer where they have administrative privileges. The user could then take ownership of any file, grant themselves full control, and view or modify any file. The fact that most removable storage devices will eject media by pressing a mechanical button diminishes the advantage of this policy setting." + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators and Interactive Users: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Allowed to format and eject removable media" + compliance: + - cis: ["2.3.4.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD -> 2' + + - id: 26018 + title: "Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'." + description: "For a computer to print to a shared printer, the driver for that shared printer must be installed on the local computer. This security setting determines who is allowed to install a printer driver as part of connecting to a shared printer. The recommended state for this setting is: Enabled. Note: This setting does not affect the ability to add a local printer. This setting does not affect Administrators." + rationale: "It may be appropriate in some organizations to allow users to install printer drivers on their own workstations. However, in a high security environment, you should allow only Administrators, not users, to do this, because printer driver installation may unintentionally cause the computer to become less stable. A malicious user could install inappropriate printer drivers in a deliberate attempt to damage the computer, or a user might accidentally install malicious software that masquerades as a printer driver. It is feasible for an attacker to disguise a Trojan horse program as a printer driver. The program may appear to users as if they must use it to print, but such a program could unleash malicious code on your computer network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Prevent users from installing printer drivers" + compliance: + - cis: ["2.3.4.2"] + - pci_dss: ["2.2.4", "2.2.5"] + - nist_800_53: ["CM.1"] + - tsc: ["CC6.3", "CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> 1' + + - id: 26019 + title: "Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'." + description: "This policy setting determines whether all secure channel traffic that is initiated by the domain member must be signed or encrypted. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt or sign secure channel data (always)" + compliance: + - cis: ["2.3.6.1"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal -> 1' + + - id: 26020 + title: "Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'." + description: "This policy setting determines whether a domain member should attempt to negotiate encryption for all secure channel traffic that it initiates. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt secure channel data (when possible)" + compliance: + - cis: ["2.3.6.2"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel -> 1' + + - id: 26021 + title: "Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'." + description: "This policy setting determines whether a domain member should attempt to negotiate whether all secure channel traffic that it initiates must be digitally signed. Digital signatures protect the traffic from being modified by anyone who captures the data as it traverses the network. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally sign secure channel data (when possible)" + compliance: + - cis: ["2.3.6.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel -> 1' + + - id: 26022 + title: "Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'." + description: "This policy setting determines whether a domain member can periodically change its computer account password. Computers that cannot automatically change their account passwords are potentially vulnerable, because an attacker might be able to determine the password for the system's domain account. The recommended state for this setting is: Disabled. Note: Some problems can occur as a result of machine account password expiration, particularly if a machine is reverted to a previous point-in-time state, as is common with virtual machines. Depending on how far back the reversion is, the older machine account password stored on the machine may no longer be recognized by the domain controllers, and therefore the computer loses its domain trust. This can also disrupt non-persistent VDI implementations, and devices with write filters that disallow permanent changes to the OS volume. Some organizations may choose to exempt themselves from this recommendation and disable machine account password expiration for these situations." + rationale: "The default configuration for Windows Server 2003-based computers that belong to a domain is that they are automatically required to change the passwords for their accounts every 30 days. If you disable this policy setting, computers that run Windows Server 2003 will retain the same passwords as their computer accounts. Computers that are no longer able to automatically change their account password are at risk from an attacker who could determine the password for the computer's domain account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Disable machine account password changes" + compliance: + - cis: ["2.3.6.4"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange -> 0' + + - id: 26023 + title: "Ensure 'Domain member: Maximum machine account password age' is set to '30 or fewer days, but not 0'." + description: "This policy setting determines the maximum allowable age for a computer account password. By default, domain members automatically change their domain passwords every 30 days. If you increase this interval significantly so that the computers no longer change their passwords, an attacker would have more time to undertake a brute force attack against one of the computer accounts. The recommended state for this setting is: 30 or fewer days, but not 0. Note: A value of 0 does not conform to the benchmark as it disables maximum password age. Note #2: Some problems can occur as a result of machine account password expiration, particularly if a machine is reverted to a previous point-in-time state, as is common with virtual machines. Depending on how far back the reversion is, the older machine account password stored on the machine may no longer be recognized by the domain controllers, and therefore the computer loses its domain trust. This can also disrupt non-persistent VDI implementations, and devices with write filters that disallow permanent changes to the OS volume. Some organizations may choose to exempt themselves from this recommendation and disable machine account password expiration for these situations." + rationale: "In Active Directory-based domains, each computer has an account and password just like every user. By default, the domain members automatically change their domain password every 30 days. If you increase this interval significantly, or set it to 0 so that the computers no longer change their passwords, an attacker will have more time to undertake a brute force attack to guess the password of one or more computer accounts." + remediation: "To establish the recommended configuration via GP, set the following UI path to 30 or fewer days, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Maximum machine account password age" + compliance: + - cis: ["2.3.6.5"] + condition: all + rules: + - 'c:net.exe accounts -> n:Maximum password age (days):\s+(\d+) compare <= 30' + - 'c:net.exe accounts -> n:Maximum password age (days):\s+(\d+) compare > 0' + + - id: 26024 + title: "Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'." + description: "When this policy setting is enabled, a secure channel can only be established with Domain Controllers that are capable of encrypting secure channel data with a strong (128-bit) session key. To enable this policy setting, all Domain Controllers in the domain must be able to encrypt secure channel data with a strong key, which means all Domain Controllers must be running Microsoft Windows 2000 or newer. The recommended state for this setting is: Enabled." + rationale: "Session keys that are used to establish secure channel communications between Domain Controllers and member computers are much stronger in Windows 2000 than they were in previous Microsoft operating systems. Whenever possible, you should take advantage of these stronger session keys to help protect secure channel communications from attacks that attempt to hijack network sessions and eavesdropping. (Eavesdropping is a form of hacking in which network data is read or altered in transit. The data can be modified to hide or change the sender, or be redirected.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Require strong (Windows 2000 or later) session key" + compliance: + - cis: ["2.3.6.6"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey -> 1' + + - id: 26025 + title: "Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'." + description: "This policy setting determines whether users must press CTRL+ALT+DEL before they log on. The recommended state for this setting is: Disabled." + rationale: "Microsoft developed this feature to make it easier for users with certain types of physical impairments to log on to computers that run Windows. If users are not required to press CTRL+ALT+DEL, they are susceptible to attacks that attempt to intercept their passwords. If CTRL+ALT+DEL is required before logon, user passwords are communicated by means of a trusted path. An attacker could install a Trojan horse program that looks like the standard Windows logon dialog box and capture the user's password. The attacker would then be able to log on to the compromised account with whatever level of privilege that user has." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Do not require CTRL+ALT+DEL" + compliance: + - cis: ["2.3.7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD -> 0' + + - id: 26026 + title: "Ensure 'Interactive logon: Don't display last signed-in' is set to 'Enabled'." + description: "This policy setting determines whether the account name of the last user to log on to the client computers in your organization will be displayed in each computer's respective Windows logon screen. Enable this policy setting to prevent intruders from collecting account names visually from the screens of desktop or laptop computers in your organization. The recommended state for this setting is: Enabled." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Don't display last signed-in. Note: In older versions of Microsoft Windows, this setting was named Interactive logon: Do not display last user name, but it was renamed starting with Windows 10 Release 1703." + compliance: + - cis: ["2.3.7.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName -> 1' + + - id: 26027 + title: "Ensure 'Interactive logon: Machine account lockout threshold' is set to '10 or fewer invalid logon attempts, but not 0'." + description: "This security setting determines the number of failed logon attempts that causes the machine to be locked out. Failed password attempts against workstations or member servers that have been locked using either CTRL+ALT+DELETE or password protected screen savers counts as failed logon attempts. The machine lockout policy is enforced only on those machines that have BitLocker enabled for protecting OS volumes. Please ensure that appropriate recovery password backup policies are enabled. The recommended state for this setting is: 10 or fewer invalid logon attempts, but not 0. Note: A value of 0 does not conform to the benchmark as it disables the machine account lockout threshold. Values from 1 to 3 will be interpreted as 4." + rationale: "If a machine is lost or stolen, or if an insider threat attempts a brute force password attack against the computer, it is important to ensure that BitLocker will lock the computer and therefore prevent a successful attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to 10 or fewer invalid logon attempts, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Machine account lockout threshold" + compliance: + - cis: ["2.3.7.3"] + - cis_csc: ["4.10"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> MaxDevicePasswordFailedAttempts' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> MaxDevicePasswordFailedAttempts -> 0' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> MaxDevicePasswordFailedAttempts -> n:^(\d+) compare <=30' + + - id: 26028 + title: "Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'." + description: "Windows notices inactivity of a logon session, and if the amount of inactive time exceeds the inactivity limit, then the screen saver will run, locking the session. The recommended state for this setting is: 900 or fewer second(s), but not 0. Note: A value of 0 does not conform to the benchmark as it disables the machine inactivity limit." + rationale: "If a user forgets to lock their computer when they walk away it's possible that a passerby will hijack it." + remediation: "To establish the recommended configuration via GP, set the following UI path to 900 or fewer seconds, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Machine inactivity limit" + compliance: + - cis: ["2.3.7.4"] + - cis_csc: ["4.3"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 0' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> n:^(\d+) compare <= 900' + + - id: 26029 + title: "Configure 'Interactive logon: Message text for users attempting to log on'." + description: "This policy setting specifies a text message that displays to users when they log on. Set the following group policy to a value that is consistent with the security and operational requirements of your organization." + rationale: "Displaying a warning message before logon may help prevent an attack by warning the attacker about the consequences of their misconduct before it happens. It may also help to reinforce corporate policy by notifying employees of the appropriate policy during the logon process. This text is often used for legal reasons—for example, to warn users about the ramifications of misusing company information or to warn them that their actions may be audited. Note: Any warning that you display should first be approved by your organization's legal and human resources representatives." + remediation: "To establish the recommended configuration via GP, configure the following UI path to a value that is consistent with the security and operational requirements of your organization: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Message text for users attempting to log on" + compliance: + - cis: ["2.3.7.5"] + condition: all + rules: + - 'not c:reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v legalnoticetext -> r:\s+legalnoticetext\s+REG_SZ\s+$' + + - id: 26030 + title: "Configure 'Interactive logon: Message title for users attempting to log on'." + description: "This policy setting specifies the text displayed in the title bar of the window that users see when they log on to the system. Configure this setting in a manner that is consistent with the security and operational requirements of your organization." + rationale: "Displaying a warning message before logon may help prevent an attack by warning the attacker about the consequences of their misconduct before it happens. It may also help to reinforce corporate policy by notifying employees of the appropriate policy during the logon process." + remediation: "To establish the recommended configuration via GP, configure the following UI path to a value that is consistent with the security and operational requirements of your organization: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Message title for users attempting to log on" + compliance: + - cis: ["2.3.7.6"] + condition: all + rules: + - 'not c:reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v legalnoticecaption -> r:\s+legalnoticecaption\s+REG_SZ\s+$' + + - id: 26031 + title: "Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)'." + description: "This policy setting determines whether a user can log on to a Windows domain using cached account information. Logon information for domain accounts can be cached locally to allow users to log on even if a Domain Controller cannot be contacted. This policy setting determines the number of unique users for whom logon information is cached locally. If this value is set to 0, the logon cache feature is disabled. An attacker who is able to access the file system of the server could locate this cached information and use a brute force attack to determine user passwords. The recommended state for this setting is: 4 or fewer logon(s)." + rationale: "The number that is assigned to this policy setting indicates the number of users whose logon information the computer will cache locally. If the number is set to 4, then the computer caches logon information for 4 users. When a 5th user logs on to the computer, the server overwrites the oldest cached logon session. Users who access the computer console will have their logon credentials cached on that computer. An attacker who is able to access the file system of the computer could locate this cached information and use a brute force attack to attempt to determine user passwords. To mitigate this type of attack, Windows encrypts the information and obscures its physical location." + remediation: "To establish the recommended configuration via GP, set the following UI path to 4 or fewer logon(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Number of previous logons to cache (in case domain controller is not available)" + compliance: + - cis: ["2.3.7.7"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> n:^(\d+) compare <= 4' + + - id: 26032 + title: "Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'." + description: "This policy setting determines how far in advance users are warned that their password will expire. It is recommended that you configure this policy setting to at least 5 days but no more than 14 days to sufficiently warn users when their passwords will expire. The recommended state for this setting is: between 5 and 14 days." + rationale: "Users will need to be warned that their passwords are going to expire, or they may inadvertently be locked out of the computer when their passwords expire. This condition could lead to confusion for users who access the network locally, or make it impossible for users to access your organization's network through dial-up or virtual private network (VPN) connections." + remediation: "To establish the recommended configuration via GP, set the following UI path to a value between 5 and 14 days: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Prompt user to change password before expiration" + compliance: + - cis: ["2.3.7.8"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare >= 5 && n:^(\d+) compare <= 14' + + - id: 26033 + title: "Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher." + description: "This policy setting determines what happens when the smart card for a logged-on user is removed from the smart card reader. The recommended state for this setting is: Lock Workstation. Configuring this setting to Force Logoff or Disconnect if a Remote Desktop Services session also conforms to the benchmark." + rationale: "Users sometimes forget to lock their workstations when they are away from them, allowing the possibility for malicious users to access their computers. If smart cards are used for authentication, the computer should automatically lock itself when the card is removed to ensure that only the user with the smart card is accessing resources using those credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Lock Workstation (or, if applicable for your environment, Force Logoff or Disconnect if a Remote Desktop Services session): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Smart card removal behavior" + compliance: + - cis: ["2.3.7.9"] + - cis_csc: ["4.3"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption -> r:^1$|^2$' + + - id: 26034 + title: "Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'." + description: 'This policy setting determines whether packet signing is required by the SMB client component. Note: When Windows Vista-based computers have this policy setting enabled and they connect to file or print shares on remote servers, it is important that the setting is synchronized with its companion setting, Microsoft network server: Digitally sign communications (always), on those servers. For more information about these settings, see the "Microsoft network client and server: Digitally sign communications (four related settings)" section in Chapter 5 of the Threats and Countermeasures guide. The recommended state for this setting is: Enabled.' + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (always)" + compliance: + - cis: ["2.3.8.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> 1' + + - id: 26035 + title: "Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'." + description: "This policy setting determines whether the SMB client will attempt to negotiate SMB packet signing. Note: Enabling this policy setting on SMB clients on your network makes them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (if server agrees)" + compliance: + - cis: ["2.3.8.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> 1' + + - id: 26036 + title: "Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'." + description: "This policy setting determines whether the SMB redirector will send plaintext passwords during authentication to third-party SMB servers that do not support password encryption. It is recommended that you disable this policy setting unless there is a strong business case to enable it. If this policy setting is enabled, unencrypted passwords will be allowed across the network. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting, the server can transmit passwords in plaintext across the network to other computers that offer SMB services, which is a significant security risk. These other computers may not use any of the SMB security mechanisms that are included with Windows Server 2003." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Send unencrypted password to third-party SMB servers" + compliance: + - cis: ["2.3.8.3"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword -> 0' + + - id: 26037 + title: "Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s)'." + description: "This policy setting allows you to specify the amount of continuous idle time that must pass in an SMB session before the session is suspended because of inactivity. Administrators can use this policy setting to control when a computer suspends an inactive SMB session. If client activity resumes, the session is automatically reestablished. The maximum value is 99999, which is over 69 days; in effect, this value disables the setting. The recommended state for this setting is: 15 or fewer minute(s)." + rationale: "Each SMB session consumes server resources, and numerous null sessions will slow the server or possibly cause it to fail. An attacker could repeatedly establish SMB sessions until the server's SMB services become slow or unresponsive." + remediation: "To establish the recommended configuration via GP, set the following UI path to 15 or fewer minute(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Amount of idle time required before suspending session" + compliance: + - cis: ["2.3.9.1"] + - cis_csc: ["4.3"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> n:^(\d+) compare <= 15' + + - id: 26038 + title: "Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'." + description: "This policy setting determines whether packet signing is required by the SMB server component. Enable this policy setting in a mixed environment to prevent downstream clients from using the workstation as a network server. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (always)" + compliance: + - cis: ["2.3.9.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature -> 1' + + - id: 26039 + title: "Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'." + description: "This policy setting determines whether the SMB server will negotiate SMB packet signing with clients that request it. If no signing request comes from the client, a connection will be allowed without a signature if the Microsoft network server: Digitally sign communications (always) setting is not enabled. Note: Enable this policy setting on SMB clients on your network to make them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (if client agrees)" + compliance: + - cis: ["2.3.9.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature -> 1' + + - id: 26040 + title: "Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'." + description: "This security setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Network security: Force logoff when logon hours expire (Rule 2.3.11.6). If your organization configures logon hours for users, this policy setting is necessary to ensure they are effective. The recommended state for this setting is: Enabled." + rationale: "If your organization configures logon hours for users, then it makes sense to enable this policy setting. Otherwise, users who should not have access to network resources outside of their logon hours may actually be able to continue to use those resources with sessions that were established during allowed hours." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Disconnect clients when logon hours expire" + compliance: + - cis: ["2.3.9.4"] + - cis_csc: ["5.6"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' + + - id: 26041 + title: "Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher." + description: "This policy setting controls the level of validation a computer with shared folders or printers (the server) performs on the service principal name (SPN) that is provided by the client computer when it establishes a session using the server message block (SMB) protocol. The server message block (SMB) protocol provides the basis for file and print sharing and other networking operations, such as remote Windows administration. The SMB protocol supports validating the SMB server service principal name (SPN) within the authentication blob provided by a SMB client to prevent a class of attacks against SMB servers referred to as SMB relay attacks. This setting will affect both SMB1 and SMB2. The recommended state for this setting is: Accept if provided by client. Configuring this setting to Required from client also conforms to the benchmark." + rationale: "The identity of a computer can be spoofed to gain unauthorized access to network resources." + remediation: "To establish the recommended configuration via GP, set the following UI path to Accept if provided by client (configuring to Required from client also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Server SPN target name validation level" + compliance: + - cis: ["2.3.9.5"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel -> n:^(\d+) compare >= 1' + + - id: 26042 + title: "Ensure 'Network access: Allow anonymous SID/Name translation' is set to 'Disabled'." + description: "This policy setting determines whether an anonymous user can request security identifier (SID) attributes for another user, or use a SID to obtain its corresponding user name. The recommended state for this setting is: Disabled." + rationale: "If this policy setting is enabled, a user with local access could use the well-known Administrator's SID to learn the real name of the built-in Administrator account, even if it has been renamed. That person could then use the account name to initiate a password guessing attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Allow anonymous SID/Name translation" + compliance: + - cis: ["2.3.10.1"] + condition: all + rules: + - 'c:powershell "$null = secedit /export /cfg $env:temp/secexport.cfg; $(gc $env:temp/secexport.cfg | Select-String \"LSAAnonymousNameLookup\").ToString().Split(\"=\")[1].Trim()" -> r:0' + + - id: 26043 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled'." + description: "This policy setting controls the ability of anonymous users to enumerate the accounts in the Security Accounts Manager (SAM). If you enable this policy setting, users with anonymous connections will not be able to enumerate domain account user names on the systems in your environment. This policy setting also allows additional restrictions on anonymous connections. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts" + compliance: + - cis: ["2.3.10.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM -> 1' + + - id: 26044 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled'." + description: "This policy setting controls the ability of anonymous users to enumerate SAM accounts as well as shares. If you enable this policy setting, anonymous users will not be able to enumerate domain account user names and network share names on the systems in your environment. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts and shares" + compliance: + - cis: ["2.3.10.3"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous -> 1' + + - id: 26045 + title: "Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'." + description: "This policy setting determines whether Credential Manager (formerly called Stored User Names and Passwords) saves passwords or credentials for later use when it gains domain authentication. The recommended state for this setting is: Enabled. Note: Changes to this setting will not take effect until Windows is restarted." + rationale: "Passwords that are cached can be accessed by the user when logged on to the computer. Although this information may sound obvious, a problem can arise if the user unknowingly executes hostile code that reads the passwords and forwards them to another, unauthorized user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow storage of passwords and credentials for network authentication" + compliance: + - cis: ["2.3.10.4"] + - pci_dss: ["3.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> DisableDomainCreds' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> 1' + + - id: 26046 + title: "Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'." + description: "This policy setting determines what additional permissions are assigned for anonymous connections to the computer. The recommended state for this setting is: Disabled." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords, perform social engineering attacks, or launch DoS attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Let Everyone permissions apply to anonymous users" + compliance: + - cis: ["2.3.10.5"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 0' + + - id: 26047 + title: "Ensure 'Network access: Named Pipes that can be accessed anonymously' is set to 'None'." + description: "This policy setting determines which communication sessions, or pipes, will have attributes and permissions that allow anonymous access. The recommended state for this setting is: (i.e. None)." + rationale: "Limiting named pipes that can be accessed anonymously will reduce the attack surface of the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to (i.e. None): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Named Pipes that can be accessed anonymously" + compliance: + - cis: ["2.3.10.6"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:\S+' + + - id: 26048 + title: "Ensure 'Network access: Remotely accessible registry paths' is configured." + description: "This policy setting determines which registry paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: This setting does not exist in Windows XP. There was a setting with that name in Windows XP, but it is called 'Network access: Remotely accessible registry paths and sub-paths' in Windows Server 2003, Windows Vista, and Windows Server 2008 (non-R2). Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value. The recommended state for this setting is: System\\CurrentControlSet\\Control\\ProductOptions System\\CurrentControlSet\\Control\\Server Applications Software\\Microsoft\\Windows NT\\CurrentVersion" + rationale: "The registry is a database that contains computer configuration information, and much of the information is sensitive. An attacker could use this information to facilitate unauthorized activities. To reduce the risk of such an attack, suitable ACLs are assigned throughout the registry to help protect it from access by unauthorized users." + remediation: > + To establish the recommended configuration via GP, in the following UI path: + Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Remotely accessible registry paths." + Set these values: + -"System\\CurrentControlSet\\Control\\ProductOptions" + -"System\\CurrentControlSet\\Control\\Server Applications" + -"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" + compliance: + - cis: ["2.3.10.7"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:System\\CurrentControlSet\\Control\\ProductOptions System\\CurrentControlSet\\Control\\Server Applications Software\\Microsoft\\Windows NT\\CurrentVersion' + + - id: 26049 + title: "Ensure 'Network access: Remotely accessible registry paths and sub-paths' is configured." + description: "This policy setting determines which registry paths and sub-paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: In Windows XP this setting is called 'Network access: Remotely accessible registry paths,' the setting with that same name in Windows Vista, Windows Server 2008 (non-R2), and Windows Server 2003 does not exist in Windows XP. Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value. The recommended state for this setting is: System\\CurrentControlSet\\Control\\Print\\Printers System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex System\\CurrentControlSet\\Control\\Terminal Server System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib System\\CurrentControlSet\\Services\\SysmonLog" + rationale: "The registry contains sensitive computer configuration information that could be used by an attacker to facilitate unauthorized activities. The fact that the default ACLs assigned throughout the registry are fairly restrictive and help to protect the registry from access by unauthorized users reduces the risk of such an attack." + remediation: > + To establish the recommended configuration via GP, in the following UI path: + Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Remotely accessible registry paths and sub-paths + Set the following values: + -"System\\CurrentControlSet\\Control\\Print\\Printers" + -"System\\CurrentControlSet\\Services\\Eventlog" + -"SOFTWARE\\Microsoft\\OLAP Server SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Print" + -"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex" + -"System\\CurrentControlSet\\Control\\Terminal Server System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig" + -"System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration" + -"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Perflib System\\CurrentControlSet\\Services\\SysmonLog" + + compliance: + - cis: ["2.3.10.8"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Print\\Printers' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Services\\Eventlog' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\OLAP Server' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Print' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\ContentIndex' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Services\\SysmonLog' + + - id: 26050 + title: "Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'." + description: "When enabled, this policy setting restricts anonymous access to only those shares and pipes that are named in the Network access: Named pipes that can be accessed anonymously and Network access: Shares that can be accessed anonymously settings. This policy setting controls null session access to shares on your computers by adding RestrictNullSessAccess with the value 1 in the HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\LanManServer\\Parameters registry key. This registry value toggles null session shares on or off to control whether the server service restricts unauthenticated clients' access to named resources. The recommended state for this setting is: Enabled." + rationale: "Null sessions are a weakness that can be exploited through shares (including the default shares) on computers in your environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict anonymous access to Named Pipes and Shares" + compliance: + - cis: ["2.3.10.9"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess -> 1' + + - id: 26051 + title: "Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow'." + description: 'This policy setting allows you to restrict remote RPC connections to SAM. The recommended state for this setting is: Administrators: Remote Access: Allow. Note: A Windows 10 R1607, Server 2016 or newer OS is required to access and set this value in Group Policy. Note #2: If your organization is using Azure Advanced Threat Protection (APT), the service account, "AATP Service" will need to be added to the recommendation configuration. For more information on adding the "AATP Service" account please see Configure SAM-R to enable lateral movement path detection in Microsoft Defender for Identity | Microsoft Docs.' + rationale: "To ensure that an unauthorized user cannot anonymously list local account names or groups and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators: Remote Access: Allow: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict clients allowed to make remote calls to SAM" + compliance: + - cis: ["2.3.10.10"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> restrictremotesam' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> restrictremotesam -> r:O:BAG:BAD:\(A;;RC;;;BA\)' + + - id: 26052 + title: "Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'." + description: "This policy setting determines which network shares can be accessed by anonymous users. The default configuration for this policy setting has little effect because all users have to be authenticated before they can access shared resources on the server. The recommended state for this setting is: (i.e. None)." + rationale: "It is very dangerous to allow any values in this setting. Any shares that are listed can be accessed by any network user, which could lead to the exposure or corruption of sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to (i.e. None): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Shares that can be accessed anonymously" + compliance: + - cis: ["2.3.10.11"] + - cis_csc: ["3.3"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> \S+' + + - id: 26053 + title: "Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'." + description: "This policy setting determines how network logons that use local accounts are authenticated. The Classic option allows precise control over access to resources, including the ability to assign different types of access to different users for the same resource. The Guest only option allows you to treat all users equally. In this context, all users authenticate as Guest only to receive the same access level to a given resource. The recommended state for this setting is: Classic - local users authenticate as themselves. Note: This setting does not affect interactive logons that are performed remotely by using such services as Telnet or Remote Desktop Services (formerly called Terminal Services)." + rationale: "With the Guest only model, any user who can authenticate to your computer over the network does so with guest privileges, which probably means that they will not have write access to shared resources on that computer. Although this restriction does increase security, it makes it more difficult for authorized users to access shared resources on those computers because ACLs on those resources must include access control entries (ACEs) for the Guest account. With the Classic model, local accounts should be password protected. Otherwise, if Guest access is enabled, anyone can use those user accounts to access shared system resources." + remediation: "To establish the recommended configuration via GP, set the following UI path to Classic - local users authenticate as themselves: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Sharing and security model for local accounts" + compliance: + - cis: ["2.3.10.12"] + - pci_dss: ["7.1.3"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest -> 0' + + # 2.3.11.1 Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled' + - id: 26054 + title: "Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'." + description: "This policy setting determines whether Local System services that use Negotiate when reverting to NTLM authentication can use the computer identity. This policy is supported on at least Windows 7 or Windows Server 2008 R2. The recommended state for this setting is: Enabled." + rationale: "When connecting to computers running versions of Windows earlier than Windows Vista or Windows Server 2008 (non-R2), services running as Local System and using SPNEGO (Negotiate) that revert to NTLM use the computer identity. In Windows 7, if you are connecting to a computer running Windows Server 2008 or Windows Vista, then a system service uses either the computer identity or a NULL session. When connecting with a NULL session, a system-generated session key is created, which provides no protection but allows applications to sign and encrypt data without errors. When connecting with the computer identity, both signing and encryption is supported in order to provide data protection." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow Local System to use computer identity for NTLM" + compliance: + - cis: ["2.3.11.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> UseMachineId' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> UseMachineId -> 1' + + # 2.3.11.2 Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled' + - id: 26055 + title: "Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'." + description: "This policy setting determines whether NTLM is allowed to fall back to a NULL session when used with LocalSystem. The recommended state for this setting is: Disabled." + rationale: "NULL sessions are less secure because by definition they are unauthenticated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow LocalSystem NULL session fallback" + compliance: + - cis: ["2.3.11.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback -> 0' + + # 2.3.11.3 Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled' + - id: 26056 + title: "Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'." + description: "This setting determines if online identities are able to authenticate to this computer. The Public Key Cryptography Based User-to-User (PKU2U) protocol introduced in Windows 7 and Windows Server 2008 R2 is implemented as a security support provider (SSP). The SSP enables peer-to-peer authentication, particularly through the Windows 7 media and file sharing feature called HomeGroup, which permits sharing between computers that are not members of a domain. With PKU2U, a new extension was introduced to the Negotiate authentication package, Spnego.dll. In previous versions of Windows, Negotiate decided whether to use Kerberos or NTLM for authentication. The extension SSP for Negotiate, Negoexts.dll, which is treated as an authentication protocol by Windows, supports Microsoft SSPs including PKU2U. When computers are configured to accept authentication requests by using online IDs, Negoexts.dll calls the PKU2U SSP on the computer that is used to log on. The PKU2U SSP obtains a local certificate and exchanges the policy between the peer computers. When validated on the peer computer, the certificate within the metadata is sent to the logon peer for validation and associates the user's certificate to a security token and the logon process completes. The recommended state for this setting is: Disabled." + rationale: "The PKU2U protocol is a peer-to-peer authentication protocol - authentication should be managed centrally in most managed networks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network Security: Allow PKU2U authentication requests to this computer to use online identities" + compliance: + - cis: ["2.3.11.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID -> 0' + + # 2.3.11.4 Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types' + - id: 26057 + title: "Ensure 'Network security: Configure encryption types allowed for Kerberos' is set to 'AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types'." + description: "This policy setting allows you to set the encryption types that Kerberos is allowed to use. The recommended state for this setting is: AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types. Note: Some legacy applications and OSes may still require RC4_HMAC_MD5 - we recommend you test in your environment and verify whether you can safely remove it." + rationale: "The strength of each encryption algorithm varies from one to the next, choosing stronger algorithms will reduce the risk of compromise however doing so may cause issues when the computer attempts to authenticate with systems that do not support them." + remediation: "To establish the recommended configuration via GP, set the following UI path to AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Configure encryption types allowed for Kerberos" + compliance: + - cis: ["2.3.11.4"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> r:2147483644|2147483640' + + # 2.3.11.5 Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled' + - id: 26058 + title: "Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'." + description: "This policy setting determines whether the LAN Manager (LM) hash value for the new password is stored when the password is changed. The LM hash is relatively weak and prone to attack compared to the cryptographically stronger Microsoft Windows NT hash. Since LM hashes are stored on the local computer in the security database, passwords can then be easily compromised if the database is attacked. Note: Older operating systems and some third-party applications may fail when this policy setting is enabled. Also, note that the password will need to be changed on all accounts after you enable this setting to gain the proper benefit. The recommended state for this setting is: Enabled." + rationale: "The SAM file can be targeted by attackers who seek access to username and password hashes. Such attacks use special tools to crack passwords, which can then be used to impersonate users and gain access to resources on your network. These types of attacks will not be prevented if you enable this policy setting, but it will be much more difficult for these types of attacks to succeed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Do not store LAN Manager hash value on next password change" + compliance: + - cis: ["2.3.11.5"] + - cis_csc: ["3.11"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash -> 1' + + # 2.3.11.6 Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled' + - id: 26059 + title: "Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'." + description: "This policy setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Microsoft network server: Disconnect clients when logon hours expire (Rule 2.3.9.4). The recommended state for this setting is: Enabled." + rationale: "If this setting is disabled, a user could remain connected to the computer outside of their allotted logon hours." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Force logoff when logon hours expire" + compliance: + - cis: ["2.3.11.6"] + - cis_csc: ["5.6"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' + + # 2.3.11.7 Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM' + - id: 26060 + title: "Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'." + description: "LAN Manager (LM) was a family of early Microsoft client/server software (predating Windows NT) that allowed users to link personal computers together on a single network. LM network capabilities included transparent file and print sharing, user security features, and network administration tools. In Active Directory domains, the Kerberos protocol is the default authentication protocol. However, if the Kerberos protocol is not negotiated for some reason, Active Directory will use LM, NTLM, or NTLMv2. LAN Manager authentication includes the LM, NTLM, and NTLM version 2 (NTLMv2) variants, and is the protocol that is used to authenticate all Windows clients when they perform the following operations: -Join a domain -Authenticate between Active Directory forests -Authenticate to down-level domains -Authenticate to computers that do not run Windows 2000, Windows Server 2003, or Windows XP -Authenticate to computers that are not in the domain. The Network security: LAN Manager authentication level setting determines which challenge/response authentication protocol is used for network logons. This choice affects the level of authentication protocol used by clients, the level of session security negotiated, and the level of authentication accepted by servers. The recommended state for this setting is: Send NTLMv2 response only. Refuse LM & NTLM." + rationale: "Windows 2000 and Windows XP clients were configured by default to send LM and NTLM authentication responses (Windows 95-based and Windows 98-based clients only send LM). The default settings in OSes predating Windows Vista / Windows Server 2008 (non- R2) allowed all clients to authenticate with servers and use their resources. However, this meant that LM responses - the weakest form of authentication response - were sent over the network, and it was potentially possible for attackers to sniff that traffic to more easily reproduce the user's password. The Windows 95, Windows 98, and Windows NT operating systems cannot use the Kerberos version 5 protocol for authentication. For this reason, in a Windows Server 2003 domain, these computers authenticate by default with both the LM and NTLM protocols for network authentication. You can enforce a more secure authentication protocol for Windows 95, Windows 98, and Windows NT by using NTLMv2. For the logon process, NTLMv2 uses a secure channel to protect the authentication process. Even if you use NTLMv2 for older clients and servers, Windows-based clients and servers that are members of the domain will use the Kerberos authentication protocol to authenticate with Windows Server 2003 or newer Domain Controllers. For these reasons, it is strongly preferred to restrict the use of LM & NTLM (non-v2) as much as possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Send NTLMv2 response only. Refuse LM & NTLM: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LAN Manager authentication level" + compliance: + - cis: ["2.3.11.7"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 5' + + # 2.3.11.8 Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher + - id: 26061 + title: "Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher." + description: "This policy setting determines the level of data signing that is requested on behalf of clients that issue LDAP BIND requests. Note: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are included with Windows XP Professional use ldap_simple_bind or ldap_simple_bind_s to communicate with a Domain Controller. The recommended state for this setting is: Negotiate signing. Configuring this setting to Require signing also conforms to the benchmark." + rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks in which an intruder captures the packets between the client and server, modifies them, and then forwards them to the server. For an LDAP server, this susceptibility means that an attacker could cause a server to make decisions that are based on false or altered data from the LDAP queries. To lower this risk in your network, you can implement strong physical security measures to protect the network infrastructure. Also, you can make all types of man-in-the-middle attacks extremely difficult if you require digital signatures on all network packets by means of IPsec authentication headers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Negotiate signing (configuring to Require signing also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LDAP client signing requirements" + compliance: + - cis: ["2.3.11.8"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> n:(\d+) compare >= 1' + + # 2.3.11.9 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption' + - id: 26062 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'." + description: "This policy setting determines which behaviors are allowed by clients for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable both options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. In other words, these options help protect against man-in-the-middle attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) clients" + compliance: + - cis: ["2.3.11.9"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec -> 537395200' + + # 2.3.11.10 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption' + - id: 26063 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'." + description: "This policy setting determines which behaviors are allowed by servers for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable all of the options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. That is, these options help protect against man-in-the-middle attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) servers" + compliance: + - cis: ["2.3.11.10"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - https://workbench.cisecurity.org/benchmarks/288 + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec -> 537395200' + + - id: 26064 + title: "Ensure 'System cryptography: Force strong key protection for user keys stored on the computer' is set to 'User is prompted when the key is first used' or higher." + description: "This policy setting determines whether users' private keys (such as their S-MIME keys) require a password to be used. The recommended state for this setting is: User is prompted when the key is first used. Configuring this setting to User must enter a password each time they use a key also conforms to the benchmark." + rationale: "If a user's account is compromised or their computer is inadvertently left unsecured the malicious user can use the keys stored for the user to access protected resources. You can configure this policy setting so that users must provide a password that is distinct from their domain password every time they use a key. This configuration makes it more difficult for an attacker to access locally stored user keys, even if the attacker takes control of the user's computer and determines their logon password." + remediation: "To establish the recommended configuration via GP, set the following UI path to User is prompted when the key is first used (configuring to User must enter a password each time they use a key also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System cryptography: Force strong key protection for user keys stored on the computer" + compliance: + - cis: ["2.3.14.1"] + - cis_csc: ["3.11"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Cryptography' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Cryptography -> ForceKeyProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Cryptography -> ForceKeyProtection -> n:(\d+) compare > 0' + + # 2.3.15.1 Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled' + - id: 26065 + title: "Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'." + description: "This policy setting determines whether case insensitivity is enforced for all subsystems. The Microsoft Win32 subsystem is case insensitive. However, the kernel supports case sensitivity for other subsystems, such as the Portable Operating System Interface for UNIX (POSIX). Because Windows is case insensitive (but the POSIX subsystem will support case sensitivity), failure to enforce this policy setting makes it possible for a user of the POSIX subsystem to create a file with the same name as another file by using mixed case to label it. Such a situation can block access to these files by another user who uses typical Win32 tools, because only one of the files will be available. The recommended state for this setting is: Enabled." + rationale: "Because Windows is case-insensitive but the POSIX subsystem will support case sensitivity, failure to enable this policy setting would make it possible for a user of that subsystem to create a file with the same name as another file but with a different mix of upper and lower case letters. Such a situation could potentially confuse users when they try to access such files from normal Win32 tools because only one of the files will be available." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Require case insensitivity for non-Windows subsystems" + compliance: + - cis: ["2.3.15.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive -> 1' + + # 2.3.15.2 Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled' + - id: 26066 + title: "Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'." + description: "This policy setting determines the strength of the default discretionary access control list (DACL) for objects. Active Directory maintains a global list of shared system resources, such as DOS device names, mutexes, and semaphores. In this way, objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and what permissions are granted. The recommended state for this setting is: Enabled." + rationale: "This setting determines the strength of the default DACL for objects. Windows maintains a global list of shared computer resources so that objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and with what permissions." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)" + compliance: + - cis: ["2.3.15.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode -> 1' + + # 2.3.17.1 Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled' + - id: 26067 + title: "Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'." + description: "This policy setting controls the behavior of Admin Approval Mode for the built-in Administrator account. The recommended state for this setting is: Enabled." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. An attack vector for these programs was to discover the password of the account named 'Administrator' because that user account was created for all installations of Windows. To address this risk, in Windows Vista and newer, the built-in Administrator account is now disabled by default. In a default installation of a new computer, accounts with administrative control over the computer are initially set up in one of two ways: - If the computer is not joined to a domain, the first user account you create has the equivalent permissions as a local administrator. - If the computer is joined to a domain, no local administrator accounts are created. The Enterprise or Domain Administrator must log on to the computer and create one if a local administrator account is warranted. Once Windows is installed, the built-in Administrator account may be manually enabled, but we strongly recommend that this account remain disabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Admin Approval Mode for the Built-in Administrator account" + compliance: + - cis: ["2.3.17.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken -> 1' + + - id: 26068 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'." + description: "This policy setting controls the behavior of the elevation prompt for administrators. The recommended state for this setting is: Prompt for consent on the secure desktop." + rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting raises awareness to the administrator of elevated privilege operations and permits the administrator to prevent a malicious program from elevating its privilege when the program attempts to do so." + remediation: "To establish the recommended configuration via GP, set the following UI path to Prompt for consent on the secure desktop: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode" + compliance: + - cis: ["2.3.17.2"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> r:^2$' + + - id: 26069 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'." + description: "This policy setting controls the behavior of the elevation prompt for standard users. The recommended state for this setting is: Automatically deny elevation requests." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious programs running under elevated credentials without the user or administrator being aware of their activity. This setting raises awareness to the user that a program requires the use of elevated privilege operations and requires that the user be able to supply administrative credentials in order for the program to run." + remediation: "To establish the recommended configuration via GP, set the following UI path to Automatically deny elevation requests: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for standard users" + compliance: + - cis: ["2.3.17.3"] + - pci_dss: ["7.1.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser -> 0' + + - id: 26070 + title: "Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'." + description: "This policy setting controls the behavior of application installation detection for the computer. The recommended state for this setting is: Enabled." + rationale: "Some malicious software will attempt to install itself after being given permission to run. For example, malicious software with a trusted application shell. The user may have given permission for the program to run because the program is trusted, but if they are then prompted for installation of an unknown component this provides another way of trapping the software before it can do damage" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Detect application installations and prompt for elevation" + compliance: + - cis: ["2.3.17.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 1' + + - id: 26071 + title: "Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'." + description: "This policy setting controls whether applications that request to run with a User Interface Accessibility (UIAccess) integrity level must reside in a secure location in the file system. Secure locations are limited to the following: - ...\\Program Files\\, including subfolders - ...\\Windows\\system32\\; - ...\\Program Files (x86)\\, including subfolders (for 64-bit versions of Windows). Note: Windows enforces a public key infrastructure (PKI) signature check on any interactive application that requests to run with a UIAccess integrity level regardless of the state of this security setting. The recommended state for this setting is: Enabled." + rationale: "UIAccess Integrity allows an application to bypass User Interface Privilege Isolation (UIPI) restrictions when an application is elevated in privilege from a standard user to an administrator. This is required to support accessibility features such as screen readers that are transmitting user interfaces to alternative forms. A process that is started with UIAccess rights has the following abilities: - To set the foreground window. - To drive any application window using SendInput function. - To use read input for all integrity levels using low-level hooks, raw input, GetKeyState, GetAsyncKeyState, and GetKeyboardInput. - To set journal hooks. - To uses AttachThreadInput to attach a thread to a higher integrity input queue." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Only elevate UIAccess applications that are installed in secure locations" + compliance: + - cis: ["2.3.17.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths -> 1' + + - id: 26072 + title: "Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'." + description: "This policy setting controls the behavior of all User Account Control (UAC) policy settings for the computer. If you change this policy setting, you must restart your computer. The recommended state for this setting is: Enabled. Note: If this policy setting is disabled, the Security Center notifies you that the overall security of the operating system has been reduced." + rationale: "This is the setting that turns on or off UAC. If this setting is disabled, UAC will not be used and any security benefits and risk mitigations that are dependent on UAC will not be present on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Run all administrators in Admin Approval Mode" + compliance: + - cis: ["2.3.17.6"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA -> 1' + + - id: 26073 + title: "Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'." + description: "This policy setting controls whether the elevation request prompt is displayed on the interactive user's desktop or the secure desktop. The recommended state for this setting is: Enabled." + rationale: "Standard elevation prompt dialog boxes can be spoofed, which may cause users to disclose their passwords to malicious software. The secure desktop presents a very distinct appearance when prompting for elevation, where the user desktop dims, and the elevation prompt UI is more prominent. This increases the likelihood that users who become accustomed to the secure desktop will recognize a spoofed elevation prompt dialog box and not fall for the trick." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Switch to the secure desktop when prompting for elevation" + compliance: + - cis: ["2.3.17.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop -> 1' + + - id: 26074 + title: "Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'." + description: "This policy setting controls whether application write failures are redirected to defined registry and file system locations. This policy setting mitigates applications that run as administrator and write run-time application data to: - %ProgramFiles% - %windir% - %windir%\\System32 - HKEY_LOCAL_MACHINE\\SOFTWARE. The recommended state for this setting is: Enabled." + rationale: "This setting reduces vulnerabilities by ensuring that legacy applications only write data to permitted locations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Virtualize file and registry write failures to per-user locations" + compliance: + - cis: ["2.3.17.8"] + - pci_dss: ["6.5.8"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization -> 1' + + - id: 26075 + title: "Ensure 'Bluetooth Audio Gateway Service (BTAGService)' is set to 'Disabled'." + description: "Service supporting the audio gateway role of the Bluetooth Handsfree Profile. The recommended state for this setting is: Disabled." + rationale: "Bluetooth technology has inherent security risks - especially prior to the v2.1 standard. Wireless Bluetooth traffic is not well encrypted (if at all), so in a high-security environment, it should not be permitted, in spite of the added inconvenience of not being able to use Bluetooth devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Bluetooth Audio Gateway Service. Note: This service was first introduced in Windows 10 Release 1803. It appears to have replaced the older Bluetooth Handsfree Service (BthHFSrv), which was removed from Windows in that release (it is not simply a rename, but a different service)." + compliance: + - cis: ["5.1"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTAGService -> Start -> 4' + + - id: 26076 + title: "Ensure 'Bluetooth Support Service (bthserv)' is set to 'Disabled'." + description: "The Bluetooth service supports discovery and association of remote Bluetooth devices. The recommended state for this setting is: Disabled." + rationale: "Bluetooth technology has inherent security risks - especially prior to the v2.1 standard. Wireless Bluetooth traffic is not well encrypted (if at all), so in a high-security environment, it should not be permitted, in spite of the added inconvenience of not being able to use Bluetooth devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Bluetooth Support Service" + compliance: + - cis: ["5.2"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\bthserv -> Start -> 4' + + - id: 26077 + title: "Ensure 'Downloaded Maps Manager (MapsBroker)' is set to 'Disabled'." + description: "Windows service for application access to downloaded maps. This service is started on-demand by application accessing downloaded maps." + rationale: "Mapping technologies can unwillingly reveal your location to attackers and other software that picks up the information. In addition, automatic downloads of data from 3rd-party sources should be minimized when not needed. Therefore this service should not be needed in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Downloaded Maps Manager" + compliance: + - cis: ["5.4"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MapsBroker -> Start -> 4' + + - id: 26078 + title: "Ensure 'Geolocation Service (lfsvc)' is set to 'Disabled'." + description: "This service monitors the current location of the system and manages geofences (a geographical location with associated events). The recommended state for this setting is: Disabled." + rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it’s not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Geolocation Service" + compliance: + - cis: ["5.5"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lfsvc -> Start -> 4' + + - id: 26079 + title: "Ensure 'IIS Admin Service (IISADMIN)' is set to 'Disabled' or 'Not Installed'." + description: "Enables the server to administer the IIS metabase. The IIS metabase stores configuration for the SMTP and FTP services. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Internet Information Services). Note #2: An organization may choose to selectively grant exceptions to web developers to allow IIS (or another web server) on their workstation, in order for them to locally test & develop web pages. However, the organization should track those machines and ensure the security controls and mitigations are kept up to date, to reduce risk of compromise." + rationale: "Hosting a website from a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. If proper security mitigations are not followed, the chance of successful attack increases significantly. Note: This security concern applies to any web server application installed on a workstation, not just IIS." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\IIS Admin Service" + compliance: + - cis: ["5.6"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IISADMIN' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IISADMIN -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IISADMIN -> Start -> 4' + + - id: 26080 + title: "Ensure 'Infrared monitor service (irmon)' is set to 'Disabled' or 'Not Installed'." + description: "Detects other Infrared devices that are in range and launches the file transfer application. The recommended state for this setting is: Disabled or Not Installed." + rationale: "Infrared connections can potentially be a source of data compromise - especially via the automatic 'file transfer application' functionality. Enterprise-managed systems should utilize a more secure method of connection than infrared." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Infrared monitor service" + compliance: + - cis: ["5.7"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\irmon' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\irmon -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\irmon -> Start -> 4' + + - id: 26081 + title: "Ensure 'Internet Connection Sharing (ICS) (SharedAccess)' is set to 'Disabled'." + description: "Provides network access translation, addressing, name resolution and/or intrusion prevention services for a home or small office network. The recommended state for this setting is: Disabled." + rationale: "Internet Connection Sharing (ICS) is a feature that allows someone to 'share' their Internet connection with other machines on the network - it was designed for home or small office environments where only one machine has Internet access - it effectively turns that machine into an Internet router. This feature causes the bridging of networks and likely bypassing other, more secure pathways. It should not be used on any enterprise-managed system." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Internet Connection Sharing (ICS)" + compliance: + - cis: ["5.8"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess -> Start -> 4' + + - id: 26082 + title: "Ensure 'Link-Layer Topology Discovery Mapper (lltdsvc)' is set to 'Disabled'." + description: "Creates a Network Map, consisting of PC and device topology (connectivity) information, and metadata describing each PC and device. The recommended state for this setting is: Disabled." + rationale: "The feature that this service enables could potentially be used for unauthorized discovery and connection to network devices. Disabling the service helps to prevent responses to requests for network topology discovery in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Link-Layer Topology Discovery Mapper" + compliance: + - cis: ["5.9"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lltdsvc -> Start -> 4' + + - id: 26083 + title: "Ensure 'LxssManager (LxssManager)' is set to 'Disabled' or 'Not Installed'." + description: "The LXSS Manager service supports running native ELF binaries. The service provides the infrastructure necessary for ELF binaries to run on Windows. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Windows Subsystem for Linux)." + rationale: "The Linux Subsystem (LXSS) Manager allows full system access to Linux applications on Windows, including the file system. While this can certainly have some functionality and performance benefits for running those applications, it also creates new security risks in the event that a hacker injects malicious code into a Linux application. For best security, it is preferred to run Linux applications on Linux, and Windows applications on Windows." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\LxssManager" + compliance: + - cis: ["5.10"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager -> Start -> 4' + + - id: 26084 + title: "Ensure 'Microsoft FTP Service (FTPSVC)' is set to 'Disabled' or 'Not Installed'." + description: "Enables the server to be a File Transfer Protocol (FTP) server. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Internet Information Services - FTP Server)." + rationale: "Hosting an FTP server (especially a non-secure FTP server) from a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. Note: This security concern applies to any FTP server application installed on a workstation, not just IIS." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Microsoft FTP Service" + compliance: + - cis: ["5.11"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FTPSVC' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FTPSVC -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FTPSVC -> Start -> 4' + + - id: 26085 + title: "Ensure 'Microsoft iSCSI Initiator Service (MSiSCSI)' is set to 'Disabled'." + description: "Manages Internet SCSI (iSCSI) sessions from this computer to remote target devices. The recommended state for this setting is: Disabled." + rationale: "This service is critically necessary in order to directly attach to an iSCSI device. However, iSCSI itself uses a very weak authentication protocol (CHAP), which means that the passwords for iSCSI communication are easily exposed, unless all of the traffic is isolated and/or encrypted using another technology like IPsec. This service is generally more appropriate for servers in a controlled environment then on workstations requiring high security." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Microsoft iSCSI Initiator Service" + compliance: + - cis: ["5.12"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSiSCSI -> Start -> 4' + + - id: 26086 + title: "Ensure 'OpenSSH SSH Server (sshd)' is set to 'Disabled' or 'Not Installed'." + description: "SSH protocol based service to provide secure encrypted communications between two untrusted hosts over an insecure network. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but it is installed by enabling an optional Windows feature (OpenSSH Server)." + rationale: "Hosting an SSH server from a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. Note: This security concern applies to any SSH server application installed on a workstation, not just the one supplied with Windows." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\OpenSSH SSH Server" + compliance: + - cis: ["5.13"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sshd' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sshd -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sshd -> Start -> 4' + + - id: 26087 + title: "Ensure 'Peer Name Resolution Protocol (PNRPsvc)' is set to 'Disabled'." + description: "Enables serverless peer name resolution over the Internet using the Peer Name Resolution Protocol (PNRP). The recommended state for this setting is: Disabled." + rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Peer Name Resolution Protocol" + compliance: + - cis: ["5.14"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PNRPsvc -> Start -> 4' + + - id: 26088 + title: "Ensure 'Peer Networking Grouping (p2psvc)' is set to 'Disabled'." + description: "Enables multi-party communication using Peer-to-Peer Grouping. The recommended state for this setting is: Disabled." + rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Peer Networking Grouping" + compliance: + - cis: ["5.15"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\p2psvc -> Start -> 4' + + - id: 26089 + title: "Ensure 'Peer Networking Identity Manager (p2pimsvc)' is set to 'Disabled'." + description: "Provides identity services for the Peer Name Resolution Protocol (PNRP) and Peer-to-Peer Grouping services. The recommended state for this setting is: Disabled." + rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Peer Networking Identity Manager" + compliance: + - cis: ["5.16"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\p2pimsvc -> Start -> 4' + + - id: 26090 + title: "Ensure 'PNRP Machine Name Publication Service (PNRPAutoReg)' is set to 'Disabled'." + description: "This service publishes a machine name using the Peer Name Resolution Protocol. Configuration is managed via the netsh context ‘p2p pnrp peer’. The recommended state for this setting is: Disabled." + rationale: "Peer Name Resolution Protocol is a distributed and (mostly) serverless way to handle name resolution of clients with each other. In a high security environment, it is more secure to rely on centralized name resolution methods maintained by authorized staff." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\PNRP Machine Name Publication Service" + compliance: + - cis: ["5.17"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PNRPAutoReg -> Start -> 4' + + - id: 26091 + title: "Ensure 'Print Spooler (Spooler)' is set to 'Disabled'." + description: "This service spools print jobs and handles interaction with printers. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, unnecessary services especially those with known vulnerabilities should be disabled. Disabling the Print Spooler (Spooler) service mitigates the PrintNightmare vulnerability (CVE-2021-34527) and other attacks against the service." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Print Spooler" + compliance: + - cis: ["5.18"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler -> Start -> 4' + + - id: 26092 + title: "Ensure 'Problem Reports and Solutions Control Panel Support (wercplsupport)' is set to 'Disabled'." + description: "This service provides support for viewing, sending and deletion of system-level problem reports for the Problem Reports and Solutions control panel. The recommended state for this setting is: Disabled." + rationale: "This service is involved in the process of displaying/reporting issues & solutions to/from Microsoft. In a high security environment, preventing this information from being sent can help reduce privacy concerns for sensitive corporate information." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Problem Reports and Solutions Control Panel Support" + compliance: + - cis: ["5.19"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wercplsupport -> Start -> 4' + + - id: 26093 + title: "Ensure 'Remote Access Auto Connection Manager (RasAuto)' is set to 'Disabled'." + description: "Creates a connection to a remote network whenever a program references a remote DNS or NetBIOS name or address. The recommended state for this setting is: Disabled." + rationale: "The function of this service is to provide a 'demand dial' type of functionality. In a high security environment, it is preferred that any remote 'dial' connections (whether they be legacy dial-in POTS or VPN) are initiated by the user, not automatically by the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Access Auto Connection Manager" + compliance: + - cis: ["5.20"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasAuto -> Start -> 4' + + - id: 26094 + title: "Ensure 'Remote Desktop Configuration (SessionEnv)' is set to 'Disabled'." + description: "Remote Desktop Configuration service (RDCS) is responsible for all Remote Desktop related configuration and session maintenance activities that require SYSTEM context. These include per-session temporary folders, RD themes, and RD certificates. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, Remote Desktop access is an increased security risk. For these environments, only local console access should be permitted." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Desktop Configuration" + compliance: + - cis: ["5.21"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SessionEnv -> Start -> 4' + + - id: 26095 + title: "Ensure 'Remote Desktop Services (TermService)' is set to 'Disabled'." + description: "Allows users to connect interactively to a remote computer. Remote Desktop and Remote Desktop Session Host Server depend on this service. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, Remote Desktop access is an increased security risk. For these environments, only local console access should be permitted." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Desktop Services" + compliance: + - cis: ["5.22"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TermService -> Start -> 4' + + - id: 26096 + title: "Ensure 'Remote Desktop Services UserMode Port Redirector (UmRdpService)' is set to 'Disabled'." + description: "Allows the redirection of Printers/Drives/Ports for RDP connections. The recommended state for this setting is: Disabled." + rationale: "In a security-sensitive environment, it is desirable to reduce the possible attack surface - preventing the redirection of COM, LPT and PnP ports will reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer within an RDP session." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Desktop Services UserMode Port Redirector" + compliance: + - cis: ["5.23"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UmRdpService -> Start -> 4' + + - id: 26097 + title: "Ensure 'Remote Procedure Call (RPC) Locator (RpcLocator)' is set to 'Disabled'." + description: "In Windows 2003 and older versions of Windows, the Remote Procedure Call (RPC) Locator service manages the RPC name service database. In Windows Vista and newer versions of Windows, this service does not provide any functionality and is present for application compatibility. The recommended state for this setting is: Disabled." + rationale: "This is a legacy service that has no value or purpose other than application compatibility for very old software. It should be disabled unless there is a specific old application still in use on the system that requires it." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Procedure Call (RPC) Locator" + compliance: + - cis: ["5.24"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RpcLocator -> Start -> 4' + + - id: 26098 + title: "Ensure 'Remote Registry (RemoteRegistry)' is set to 'Disabled'." + description: "Enables remote users to view and modify registry settings on this computer. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, exposing the registry to remote access is an increased security risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Remote Registry" + compliance: + - cis: ["5.25"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RemoteRegistry -> Start -> 4' + + - id: 26099 + title: "Ensure 'Routing and Remote Access (RemoteAccess)' is set to 'Disabled'." + description: "Offers routing services to businesses in local area and wide area network environments. The recommended state for this setting is: Disabled." + rationale: "This service's main purpose is to provide Windows router functionality - this is not an appropriate use of workstations in an enterprise managed environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Routing and Remote Access" + compliance: + - cis: ["5.26"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RemoteAccess -> Start -> 4' + + - id: 26100 + title: "Ensure 'Server (LanmanServer)' is set to 'Disabled'." + description: "Supports file, print, and named-pipe sharing over the network for this computer. If this service is stopped, these functions will be unavailable. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, a secure workstation should only be a client, not a server. Sharing workstation resources for remote access increases security risk as the attack surface is notably higher." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Server" + compliance: + - cis: ["5.27"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer -> Start -> 4' + + - id: 26101 + title: "Ensure 'Simple TCP/IP Services (simptcp)' is set to 'Disabled' or 'Not Installed'." + description: "Supports the following TCP/IP services: Character Generator, Daytime, Discard, Echo, and Quote of the Day. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Simple TCPIP services (i.e. echo, daytime etc))." + rationale: "The Simple TCP/IP Services have very little purpose in a modern enterprise environment - allowing them might increase exposure and risk for attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Simple TCP/IP Services" + compliance: + - cis: ["5.28"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\simptcp' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\simptcp -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\simptcp -> Start -> 4' + + - id: 26102 + title: "Ensure 'SNMP Service (SNMP)' is set to 'Disabled' or 'Not Installed'." + description: "Enables Simple Network Management Protocol (SNMP) requests to be processed by this computer. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Simple Network Management Protocol (SNMP))." + rationale: "Features that enable inbound network connections increase the attack surface. In a high security environment, management of secure workstations should be handled locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\SNMP Service" + compliance: + - cis: ["5.29"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SNMP -> Start -> 4' + + - id: 26103 + title: "Ensure 'Special Administration Console Helper (sacsvr)' is set to 'Disabled' or 'Not Installed'." + description: "This service allows administrators to remotely access a command prompt using Emergency Management Services. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but it is installed by enabling an optional Windows capability (Windows Emergency Management Services and Serial Console)." + rationale: "Allowing the use of a remotely accessible command prompt that provides the ability to perform remote management tasks on a computer is a security risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Special Administration Console Helper" + compliance: + - cis: ["5.30"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sacsvr' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sacsvr -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sacsvr -> Start -> 4' + + - id: 26104 + title: "Ensure 'SSDP Discovery (SSDPSRV)' is set to 'Disabled'." + description: "Discovers networked devices and services that use the SSDP discovery protocol, such as UPnP devices. Also announces SSDP devices and services running on the local computer. The recommended state for this setting is: Disabled." + rationale: "Universal Plug n Play (UPnP) is a real security risk - it allows automatic discovery and attachment to network devices. Note that UPnP is different than regular Plug n Play (PnP). Workstations should not be advertising their services (or automatically discovering and connecting to networked services) in a security-conscious enterprise managed environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\SSDP Discovery" + compliance: + - cis: ["5.31"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SSDPSRV -> Start -> 4' + + - id: 26105 + title: "Ensure 'UPnP Device Host (upnphost)' is set to 'Disabled'." + description: "Allows UPnP devices to be hosted on this computer. The recommended state for this setting is: Disabled." + rationale: "Universal Plug n Play (UPnP) is a real security risk - it allows automatic discovery and attachment to network devices. Notes that UPnP is different than regular Plug n Play (PnP). Workstations should not be advertising their services (or automatically discovering and connecting to networked services) in a security-conscious enterprise managed environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\UPnP Device Host" + compliance: + - cis: ["5.32"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\upnphost -> Start -> 4' + + - id: 26106 + title: "Ensure 'Web Management Service (WMSvc)' is set to 'Disabled' or 'Not Installed'." + description: "The Web Management Service enables remote and delegated management capabilities for administrators to manage for the Web server, sites and applications present on the machine. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Internet Information Services - Web Management Tools - IIS Management Service)." + rationale: "Remote web administration of IIS on a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. If proper security mitigations are not followed, the chance of successful attack increases significantly." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Web Management Service" + compliance: + - cis: ["5.33"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMSvc' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMSvc -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMSvc -> Start -> 4' + + - id: 26107 + title: "Ensure 'Windows Error Reporting Service (WerSvc)' is set to 'Disabled'." + description: "Allows errors to be reported when programs stop working or responding and allows existing solutions to be delivered. Also allows logs to be generated for diagnostic and repair services. The recommended state for this setting is: Disabled." + rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Error Reporting Service" + compliance: + - cis: ["5.34"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WerSvc -> Start -> 4' + + - id: 26108 + title: "Ensure 'Windows Event Collector (Wecsvc)' is set to 'Disabled'." + description: "This service manages persistent subscriptions to events from remote sources that support WS-Management protocol. This includes Windows Vista event logs, hardware and IPMI-enabled event sources. The service stores forwarded events in a local Event Log. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, remote connections to secure workstations should be minimized, and management functions should be done locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Event Collector" + compliance: + - cis: ["5.35"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Wecsvc -> Start -> 4' + + - id: 26109 + title: "Ensure 'Windows Media Player Network Sharing Service (WMPNetworkSvc)' is set to 'Disabled' or 'Not Installed'." + description: "Shares Windows Media Player libraries to other networked players and media devices using Universal Plug and Play. The recommended state for this setting is: Disabled or Not Installed." + rationale: "Network sharing of media from Media Player has no place in an enterprise managed environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Media Player Network Sharing Service" + compliance: + - cis: ["5.36"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMPNetworkSvc' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMPNetworkSvc -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMPNetworkSvc -> Start -> 4' + + - id: 26110 + title: "Ensure 'Windows Mobile Hotspot Service (icssvc)' is set to 'Disabled'." + description: "Provides the ability to share a cellular data connection with another device. The recommended state for this setting is: Disabled." + rationale: "The capability to run a mobile hotspot from a domain-connected computer could easily expose the internal network to wardrivers or other hackers." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Mobile Hotspot Service" + compliance: + - cis: ["5.37"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\icssvc -> Start -> 4' + + - id: 26111 + title: "Ensure 'Windows Push Notifications System Service (WpnService)' is set to 'Disabled'." + description: "This service runs in session 0 and hosts the notification platform and connection provider which handles the connection between the device and WNS server. The recommended state for this setting is: Disabled. Note: In the first two releases of Windows 10 (R1507 & R1511), the display name of this service was initially named Windows Push Notifications Service - but it was renamed to Windows Push Notifications System Service starting with Windows 10 R1607." + rationale: "Windows Push Notification Services (WNS) is a mechanism to receive 3rd-party notifications and updates from the cloud/Internet. In a high security environment, external systems, especially those hosted outside the organization, should be prevented from having an impact on the secure workstations." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Push Notifications System Service" + compliance: + - cis: ["5.38"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WpnService -> Start -> 4' + + - id: 26112 + title: "Ensure 'Windows PushToInstall Service (PushToInstall)' is set to 'Disabled'." + description: "This service manages Apps that are pushed to the device from the Microsoft Store App running on other devices or the web. The recommended state for this setting is: Disabled." + rationale: "In a high security managed environment, application installations should be managed centrally by IT staff, not by end users." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows PushToInstall Service (PushToInstall)" + compliance: + - cis: ["5.39"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PushToInstall -> Start -> 4' + + - id: 26113 + title: "Ensure 'Windows Remote Management (WS-Management) (WinRM)' is set to 'Disabled'." + description: "Windows Remote Management (WinRM) service implements the WS-Management protocol for remote management. WS-Management is a standard web services protocol used for remote software and hardware management. The WinRM service listens on the network for WS-Management requests and processes them. The recommended state for this setting is: Disabled." + rationale: "Features that enable inbound network connections increase the attack surface. In a high security environment, management of secure workstations should be handled locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Windows Remote Management (WS-Management)" + compliance: + - cis: ["5.40"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinRM -> Start -> 4' + + - id: 26114 + title: "Ensure 'World Wide Web Publishing Service (W3SVC)' is set to 'Disabled' or 'Not Installed'." + description: "Provides Web connectivity and administration through the Internet Information Services Manager. The recommended state for this setting is: Disabled or Not Installed. Note: This service is not installed by default. It is supplied with Windows, but is installed by enabling an optional Windows feature (Internet Information Services - World Wide Web Services). Note #2: An organization may choose to selectively grant exceptions to web developers to allow IIS (or another web server) on their workstation, in order for them to locally test & develop web pages. However, the organization should track those machines and ensure the security controls and mitigations are kept up to date, to reduce risk of compromise." + rationale: "Hosting a website from a workstation is an increased security risk, as the attack surface of that workstation is then greatly increased. If proper security mitigations are not followed, the chance of successful attack increases significantly. Note: This security concern applies to any web server application installed on a workstation, not just IIS." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled or ensure the service is not installed. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\World Wide Web Publishing Service" + compliance: + - cis: ["5.41"] + - cis_csc: ["4.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC -> Start -> 4' + + - id: 26115 + title: "Ensure 'Xbox Accessory Management Service (XboxGipSvc)' is set to 'Disabled'." + description: "This service manages connected Xbox Accessories. The recommended state for this setting is: Disabled." + rationale: "Xbox Live is a gaming service and has no place in an enterprise managed environment (perhaps unless it is a gaming company)." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Xbox Accessory Management Service" + compliance: + - cis: ["5.42"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XboxGipSvc -> Start -> 4' + + - id: 26116 + title: "Ensure 'Xbox Live Auth Manager (XblAuthManager)' is set to 'Disabled'." + description: "Provides authentication and authorization services for interacting with Xbox Live. The recommended state for this setting is: Disabled." + rationale: "Xbox Live is a gaming service and has no place in an enterprise managed environment (perhaps unless it is a gaming company)." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Xbox Live Auth Manager" + compliance: + - cis: ["5.43"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XblAuthManager -> Start -> 4' + + - id: 26117 + title: "Ensure 'Xbox Live Game Save (XblGameSave)' is set to 'Disabled'." + description: "This service syncs save data for Xbox Live save enabled games. The recommended state for this setting is: Disabled." + rationale: "Xbox Live is a gaming service and has no place in an enterprise managed environment (perhaps unless it is a gaming company)." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Xbox Live Game Save" + compliance: + - cis: ["5.44"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XblGameSave -> Start -> 4' + + - id: 26118 + title: "Ensure 'Xbox Live Networking Service (XboxNetApiSvc)' is set to 'Disabled'." + description: "This service supports the Windows.Networking.XboxLive application programming interface. The recommended state for this setting is: Disabled." + rationale: "Xbox Live is a gaming service and has no place in an enterprise managed environment (perhaps unless it is a gaming company)." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Xbox Live Networking Service" + compliance: + - cis: ["5.45"] + - cis_csc: ["4.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\XboxNetApiSvc -> Start -> 4' + + - id: 26119 + title: "Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)'." + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Firewall state" + compliance: + - cis: ["9.1.1"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall -> 1' + + - id: 26120 + title: "Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)'." + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Inbound connections" + compliance: + - cis: ["9.1.2"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction -> 1' + + - id: 26121 + title: "Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)'." + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default)." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Outbound connections" + compliance: + - cis: ["9.1.3"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction -> 0' + + - id: 26122 + title: "Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'." + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Settings Customize\\Display a notification" + compliance: + - cis: ["9.1.4"] + - cis_csc: ["4.5"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications -> 1' + + - id: 26123 + title: "Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SystemRoot%\\System32\\logfiles\\firewall\\domainfw.log'." + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SystemRoot%\\System32\\logfiles\\firewall\\domainfw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SystemRoot%\\System32\\logfiles\\firewall\\domainfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.1.5"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\domainfw.log' + + - id: 26124 + title: "Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16,384 KB or greater'." + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Size limit (KB)" + compliance: + - cis: ["9.1.6"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + - id: 26125 + title: "Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log dropped packets" + compliance: + - cis: ["9.1.7"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets -> 1' + + - id: 26126 + title: "Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log successful connections" + compliance: + - cis: ["9.1.8"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections -> 1' + + - id: 26127 + title: "Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)'." + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Firewall state" + compliance: + - cis: ["9.2.1"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall -> 1' + + - id: 26128 + title: "Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)'." + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Inbound connections" + compliance: + - cis: ["9.2.2"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction -> 1' + + - id: 26129 + title: "Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)'." + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Outbound connections" + compliance: + - cis: ["9.2.3"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction -> 0' + + - id: 26130 + title: "Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'." + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Settings Customize\\Display a notification" + compliance: + - cis: ["9.2.4"] + - cis_csc: ["4.5"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications -> 1' + + - id: 26131 + title: "Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SystemRoot%\\System32\\logfiles\\firewall\\privatefw.log'." + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SystemRoot%\\System32\\logfiles\\firewall\\privatefw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SystemRoot%\\System32\\logfiles\\firewall\\privatefw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.2.5"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\privatefw.log' + + - id: 26132 + title: "Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16,384 KB or greater'." + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Size limit (KB)" + compliance: + - cis: ["9.2.6"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + - id: 26133 + title: "Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log dropped packets" + compliance: + - cis: ["9.2.7"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets -> 1' + + - id: 26134 + title: "Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log successful connections" + compliance: + - cis: ["9.2.8"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections -> 1' + + - id: 26135 + title: "Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'." + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Firewall state" + compliance: + - cis: ["9.3.1"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall -> 1' + + - id: 26136 + title: "Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)'." + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Inbound connections" + compliance: + - cis: ["9.3.2"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction -> 1' + + - id: 26137 + title: "Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)'." + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Outbound connections" + compliance: + - cis: ["9.3.3"] + - cis_csc: ["4.5"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction -> 0' + + - id: 26138 + title: "Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No'." + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No." + rationale: "Some organizations may prefer to avoid alarming users when firewall rules block certain types of network activity. However, notifications can be helpful when troubleshooting network issues involving the firewall." + remediation: "To establish the recommended configuration via GP, set the following UI path to 'No': Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Display a notification" + compliance: + - cis: ["9.3.4"] + - cis_csc: ["4.5"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications -> 1' + + - id: 26139 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'." + description: "This setting controls whether local administrators are allowed to create local firewall rules that apply together with firewall rules configured by Group Policy. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "When in the Public profile, there should be no special local firewall exceptions per computer. These settings should be managed by a centralized policy." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local firewall rules" + compliance: + - cis: ["9.3.5"] + - cis_csc: ["4.5"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge -> 0' + + - id: 26140 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'." + description: "This setting controls whether local administrators are allowed to create connection security rules that apply together with connection security rules configured by Group Policy. The recommended state for this setting is: No." + rationale: "Users with administrative privileges might create firewall rules that expose the system to remote attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local connection security rules" + compliance: + - cis: ["9.3.6"] + - cis_csc: ["4.5"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0' + + - id: 26141 + title: "Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SystemRoot%\\System32\\logfiles\\firewall\\publicfw.log'." + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SystemRoot%\\System32\\logfiles\\firewall\\publicfw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SystemRoot%\\System32\\logfiles\\firewall\\publicfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.3.7"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\publicfw.log' + + - id: 26142 + title: "Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16,384 KB or greater'." + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Size limit (KB)" + compliance: + - cis: ["9.3.8"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + - id: 26143 + title: "Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log dropped packets" + compliance: + - cis: ["9.3.9"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets -> 1' + + - id: 26144 + title: "Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log successful connections" + compliance: + - cis: ["9.3.10"] + - cis_csc: ["4.5", "8.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections -> 1' + + - id: 26145 + title: "Ensure 'Audit Credential Validation' is set to 'Success and Failure'." + description: "This subcategory reports the results of validation tests on credentials submitted for a user account logon request. These events occur on the computer that is authoritative for the credentials. For domain accounts, the Domain Controller is authoritative, whereas for local accounts, the local computer is authoritative. In domain environments, most of the Account Logon events occur in the Security log of the Domain Controllers that are authoritative for the domain accounts. However, these events can occur on other computers in the organization when local accounts are used to log on. Events for this subcategory include: - 4774: An account was mapped for logon. - 4775: An account could not be mapped for logon. - 4776: The Domain Controller attempted to validate the credentials for an account. - 4777: The Domain Controller failed to validate the credentials for an account. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Logon\\Audit Credential Validation" + compliance: + - cis: ["17.1.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Credential Validation" -> r:Success and Failure' + + - id: 26146 + title: "Ensure 'Audit Application Group Management' is set to 'Success and Failure'." + description: "This policy setting allows you to audit events generated by changes to application groups such as the following: - Application group is created, changed, or deleted. - Member is added or removed from an application group. Application groups are utilized by Windows Authorization Manager, which is a flexible framework created by Microsoft for integrating role-based access control (RBAC) into applications. More information on Windows Authorization Manager is available at MSDN - Windows Authorization Manager. The recommended state for this setting is: Success and Failure." + rationale: "Auditing events in this category may be useful when investigating an incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Application Group Management" + compliance: + - cis: ["17.2.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Application Group Management" -> r:Success and Failure' + + - id: 26147 + title: "Ensure 'Audit Security Group Management' is set to include 'Success'." + description: "This subcategory reports each event of security group management, such as when a security group is created, changed, or deleted or when a member is added to or removed from a security group. If you enable this Audit policy setting, administrators can track events to detect malicious, accidental, and authorized creation of security group accounts. Events for this subcategory include: - 4727: A security-enabled global group was created. - 4728: A member was added to a security-enabled global group. - 4729: A member was removed from a security-enabled global group. - 4730: A security-enabled global group was deleted. - 4731: A security-enabled local group was created. - 4732: A member was added to a security-enabled local group. - 4733: A member was removed from a security-enabled local group. - 4734: A security-enabled local group was deleted. - 4735: A security-enabled local group was changed. - 4737: A security-enabled global group was changed. - 4754: A security-enabled universal group was created. - 4755: A security-enabled universal group was changed. - 4756: A member was added to a security-enabled universal group. - 4757: A member was removed from a security-enabled universal group. - 4758: A security-enabled universal group was deleted. - 4764: A group's type was changed. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Security Group Management" + compliance: + - cis: ["17.2.2"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Security Group Management" -> r:Success' + + - id: 26148 + title: "Ensure 'Audit User Account Management' is set to 'Success and Failure'." + description: "This subcategory reports each event of user account management, such as when a user account is created, changed, or deleted; a user account is renamed, disabled, or enabled; or a password is set or changed. If you enable this Audit policy setting, administrators can track events to detect malicious, accidental, and authorized creation of user accounts. Events for this subcategory include: - 4720: A user account was created. - 4722: A user account was enabled. - 4723: An attempt was made to change an account's password. - 4724: An attempt was made to reset an account's password. - 4725: A user account was disabled. - 4726: A user account was deleted. - 4738: A user account was changed. - 4740: A user account was locked out. - 4765: SID History was added to an account. - 4766: An attempt to add SID History to an account failed. - 4767: A user account was unlocked. - 4780: The ACL was set on accounts which are members of administrators groups. - 4781: The name of an account was changed: - 4794: An attempt was made to set the Directory Services Restore Mode. - 5376: Credential Manager credentials were backed up. - 5377: Credential Manager credentials were restored from a backup. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit User Account Management" + compliance: + - cis: ["17.2.3"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"User Account Management" -> r:Success and Failure' + + - id: 26149 + title: "Ensure 'Audit PNP Activity' is set to include 'Success'." + description: "This policy setting allows you to audit when plug and play detects an external device. The recommended state for this setting is to include: Success. Note: A Windows 10, Server 2016 or newer OS is required to access and set this value in Group Policy." + rationale: "Enabling this setting will allow a user to audit events when a device is plugged into a system. This can help alert IT staff if unapproved devices are plugged in." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Detailed Tracking\\Audit PNP Activity" + compliance: + - cis: ["17.3.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Plug and Play Events" -> r:Success' + + - id: 26150 + title: "Ensure 'Audit Process Creation' is set to include 'Success'." + description: "This subcategory reports the creation of a process and the name of the program or user that created it. Events for this subcategory include: - 4688: A new process has been created. - 4696: A primary token was assigned to process. Refer to Microsoft Knowledge Base article 947226: Description of security events in Windows Vista and in Windows Server 2008 for the most recent information about this setting. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Detailed Tracking\\Audit Process Creation" + compliance: + - cis: ["17.3.2"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Process Creation" -> r:Success' + + - id: 26151 + title: "Ensure 'Audit Account Lockout' is set to include 'Failure'." + description: "This subcategory reports when a user's account is locked out as a result of too many failed logon attempts. Events for this subcategory include: - 4625: An account failed to log on. The recommended state for this setting is to include: Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Account Lockout" + compliance: + - cis: ["17.5.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Account Lockout" -> r:Failure' + + - id: 26152 + title: "Ensure 'Audit Group Membership' is set to include 'Success'." + description: "This policy allows you to audit the group membership information in the user’s logon token. Events in this subcategory are generated on the computer on which a logon session is created. For an interactive logon, the security audit event is generated on the computer that the user logged on to. For a network logon, such as accessing a shared folder on the network, the security audit event is generated on the computer hosting the resource. The recommended state for this setting is to include: Success. Note: A Windows 10, Server 2016 or newer OS is required to access and set this value in Group Policy." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Group Membership" + compliance: + - cis: ["17.5.2"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Group Membership" -> r:Success' + + - id: 26153 + title: "Ensure 'Audit Logoff' is set to include 'Success'." + description: "This subcategory reports when a user logs off from the system. These events occur on the accessed computer. For interactive logons, the generation of these events occurs on the computer that is logged on to. If a network logon takes place to access a share, these events generate on the computer that hosts the accessed resource. If you configure this setting to No auditing, it is difficult or impossible to determine which user has accessed or attempted to access organization computers. Events for this subcategory include: - 4634: An account was logged off. - 4647: User initiated logoff. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Logoff" + compliance: + - cis: ["17.5.3"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Logoff" -> r:Success' + + - id: 26154 + title: "Ensure 'Audit Logon' is set to 'Success and Failure'." + description: "This subcategory reports when a user attempts to log on to the system. These events occur on the accessed computer. For interactive logons, the generation of these events occurs on the computer that is logged on to. If a network logon takes place to access a share, these events generate on the computer that hosts the accessed resource. If you configure this setting to No auditing, it is difficult or impossible to determine which user has accessed or attempted to access organization computers. Events for this subcategory include: - 4624: An account was successfully logged on. - 4625: An account failed to log on. - 4648: A logon was attempted using explicit credentials. - 4675: SIDs were filtered. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Logon" + compliance: + - cis: ["17.5.4"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Logon" -> r:Success and Failure' + + - id: 26155 + title: "Ensure 'Audit Other Logon/Logoff Events' is set to 'Success and Failure'." + description: "This subcategory reports other logon/logoff-related events, such as Remote Desktop Services session disconnects and reconnects, using RunAs to run processes under a different account, and locking and unlocking a workstation. Events for this subcategory include: - 4649: A replay attack was detected. - 4778: A session was reconnected to a Window Station. - 4779: A session was disconnected from a Window Station. - 4800: The workstation was locked. - 4801: The workstation was unlocked. - 4802: The screen saver was invoked. - 4803: The screen saver was dismissed. - 5378: The requested credentials delegation was disallowed by policy. - 5632: A request was made to authenticate to a wireless network. - 5633: A request was made to authenticate to a wired network. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Other Logon/Logoff Events" + compliance: + - cis: ["17.5.5"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Other Logon/Logoff Events" -> r:Success and Failure' + + - id: 26156 + title: "Ensure 'Audit Special Logon' is set to include 'Success'." + description: "This subcategory reports when a special logon is used. A special logon is a logon that has administrator-equivalent privileges and can be used to elevate a process to a higher level. Events for this subcategory include: - 4964 : Special groups have been assigned to a new logon. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Special Logon" + compliance: + - cis: ["17.5.6"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Special Logon" -> r:Success' + + - id: 26157 + title: "Ensure 'Audit Detailed File Share' is set to include 'Failure'." + description: "This subcategory allows you to audit attempts to access files and folders on a shared folder. Events for this subcategory include: - 5145: network share object was checked to see whether client can be granted desired access. The recommended state for this setting is to include: Failure." + rationale: "Auditing the Failures will log which unauthorized users attempted (and failed) to get access to a file or folder on a network share on this computer, which could possibly be an indication of malicious intent." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit Detailed File Share" + compliance: + - cis: ["17.6.1"] + - cis_csc: ["3.3", "8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Detailed File Share" -> r:Failure' + + - id: 26158 + title: "Ensure 'Audit File Share' is set to 'Success and Failure'." + description: "This policy setting allows you to audit attempts to access a shared folder. The recommended state for this setting is: Success and Failure. Note: There are no system access control lists (SACLs) for shared folders. If this policy setting is enabled, access to all shared folders on the system is audited." + rationale: "In an enterprise managed environment, workstations should have limited file sharing activity, as file servers would normally handle the overall burden of file sharing activities. Any unusual file sharing activity on workstations may therefore be useful in an investigation of potentially malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit File Share" + compliance: + - cis: ["17.6.2"] + - cis_csc: ["3.3", "8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"File Share" -> r:Success and Failure' + + - id: 26159 + title: "Ensure 'Audit Other Object Access Events' is set to 'Success and Failure'." + description: "This policy setting allows you to audit events generated by the management of task scheduler jobs or COM+ objects. For scheduler jobs, the following are audited: - Job created. - Job deleted. - Job enabled. - Job disabled. - Job updated. For COM+ objects, the following are audited: - Catalog object added. - Catalog object updated. - Catalog object deleted. The recommended state for this setting is: Success and Failure." + rationale: "The unexpected creation of scheduled tasks and COM+ objects could potentially be an indication of malicious activity. Since these types of actions are generally low volume, it may be useful to capture them in the audit logs for use during an investigation." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit Other Object Access Events" + compliance: + - cis: ["17.6.3"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Other Object Access Events" -> r:Success and Failure' + + - id: 26160 + title: "Ensure 'Audit Removable Storage' is set to 'Success and Failure'." + description: "This policy setting allows you to audit user attempts to access file system objects on a removable storage device. A security audit event is generated only for all objects for all types of access requested. If you configure this policy setting, an audit event is generated each time an account accesses a file system object on a removable storage. Success audits record successful attempts and Failure audits record unsuccessful attempts. If you do not configure this policy setting, no audit event is generated when an account accesses a file system object on a removable storage. The recommended state for this setting is: Success and Failure. Note: A Windows 8.0, Server 2012 (non-R2) or newer OS is required to access and set this value in Group Policy." + rationale: "Auditing removable storage may be useful when investigating an incident. For example, if an individual is suspected of copying sensitive information onto a USB drive." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit Removable Storage" + compliance: + - cis: ["17.6.4"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Removable Storage" -> r:Success and Failure' + + - id: 26161 + title: "Ensure 'Audit Audit Policy Change' is set to include 'Success'." + description: "This subcategory reports changes in audit policy including SACL changes. Events for this subcategory include: - 4715: The audit policy (SACL) on an object was changed. - 4719: System audit policy was changed. - 4902: The Per-user audit policy table was created. - 4904: An attempt was made to register a security event source. - 4905: An attempt was made to unregister a security event source. - 4906: The CrashOnAuditFail value has changed. - 4907: Auditing settings on object were changed. - 4908: Special Groups Logon table modified. - 4912: Per User Audit Policy was changed. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Audit Policy Change" + compliance: + - cis: ["17.7.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Audit Policy Change" -> r:Success' + + - id: 26162 + title: "Ensure 'Audit Authentication Policy Change' is set to include 'Success'." + description: "This subcategory reports changes in authentication policy. Events for this subcategory include: - 4706: A new trust was created to a domain. - 4707: A trust to a domain was removed. - 4713: Kerberos policy was changed. - 4716: Trusted domain information was modified. - 4717: System security access was granted to an account. - 4718: System security access was removed from an account. - 4739: Domain Policy was changed. - 4864: A namespace collision was detected. - 4865: A trusted forest information entry was added. - 4866: A trusted forest information entry was removed. - 4867: A trusted forest information entry was modified. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Authentication Policy Change" + compliance: + - cis: ["17.7.2"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Authentication Policy Change" -> r:Success' + + - id: 26163 + title: "Ensure 'Audit Authorization Policy Change' is set to include 'Success'." + description: "This subcategory reports changes in authorization policy. Events for this subcategory include: - 4704: A user right was assigned. - 4705: A user right was removed. - 4706: A new trust was created to a domain. - 4707: A trust to a domain was removed. - 4714: Encrypted data recovery policy was changed. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Authorization Policy Change" + compliance: + - cis: ["17.7.3"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Authorization Policy Change" -> r:Success' + + - id: 26164 + title: "Ensure 'Audit MPSSVC Rule-Level Policy Change' is set to 'Success and Failure'." + description: "This subcategory determines whether the operating system generates audit events when changes are made to policy rules for the Microsoft Protection Service (MPSSVC.exe). Events for this subcategory include: - 4944: The following policy was active when the Windows Firewall started. - 4945: A rule was listed when the Windows Firewall started. - 4946: A change has been made to Windows Firewall exception list. A rule was added. - 4947: A change has been made to Windows Firewall exception list. A rule was modified. - 4948: A change has been made to Windows Firewall exception list. A rule was deleted. - 4949: Windows Firewall settings were restored to the default values. - 4950: A Windows Firewall setting has changed. - 4951: A rule has been ignored because its major version number was not recognized by Windows Firewall. - 4952: Parts of a rule have been ignored because its minor version number was not recognized by Windows Firewall. The other parts of the rule will be enforced. - 4953: A rule has been ignored by Windows Firewall because it could not parse the rule. - 4954: Windows Firewall Group Policy settings have changed. The new settings have been applied. - 4956: Windows Firewall has changed the active profile. - 4957: Windows Firewall did not apply the following rule. - 4958: Windows Firewall did not apply the following rule because the rule referred to items not configured on this computer. The recommended state for this setting is : Success and Failure" + rationale: "Changes to firewall rules are important for understanding the security state of the computer and how well it is protected against network attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit MPSSVC Rule-Level Policy Change" + compliance: + - cis: ["17.7.4"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"MPSSVC Rule-Level Policy Change" -> r:Success and Failure' + + - id: 26165 + title: "Ensure 'Audit Other Policy Change Events' is set to include 'Failure'." + description: "This subcategory contains events about EFS Data Recovery Agent policy changes, changes in Windows Filtering Platform filter, status on Security policy settings updates for local Group Policy settings, Central Access Policy changes, and detailed troubleshooting events for Cryptographic Next Generation (CNG) operations. - 5063: A cryptographic provider operation was attempted. - 5064: A cryptographic context operation was attempted. - 5065: A cryptographic context modification was attempted. - 5066: A cryptographic function operation was attempted. - 5067: A cryptographic function modification was attempted. - 5068: A cryptographic function provider operation was attempted. - 5069: A cryptographic function property operation was attempted. - 5070: A cryptographic function property modification was attempted. - 6145: One or more errors occurred while processing security policy in the group policy objects. The recommended state for this setting is to include: Failure." + rationale: "This setting can help detect errors in applied Security settings which came from Group Policy, and failure events related to Cryptographic Next Generation (CNG) functions." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Other Policy Change Events" + compliance: + - cis: ["17.7.5"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Other Policy Change Events" -> r:Failure' + + - id: 26166 + title: "Ensure 'Audit Sensitive Privilege Use' is set to 'Success and Failure'." + description: "This subcategory reports when a user account or service uses a sensitive privilege. A sensitive privilege includes the following user rights: - Act as part of the operating system - Back up files and directories - Create a token object - Debug programs - Enable computer and user accounts to be trusted for delegation - Generate security audits - Impersonate a client after authentication - Load and unload device drivers - Manage auditing and security log - Modify firmware environment values - Replace a process-level token - Restore files and directories - Take ownership of files or other objects Auditing this subcategory will create a high volume of events. Events for this subcategory include: - 4672: Special privileges assigned to new logon. - 4673: A privileged service was called. - 4674: An operation was attempted on a privileged object. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Privilege Use\\Audit Sensitive Privilege Use" + compliance: + - cis: ["17.8.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Sensitive Privilege Use" -> r:Success and Failure' + + - id: 26167 + title: "Ensure 'Audit IPsec Driver' is set to 'Success and Failure'." + description: "This subcategory reports on the activities of the Internet Protocol security (IPsec) driver. Events for this subcategory include: - 4960: IPsec dropped an inbound packet that failed an integrity check. If this problem persists, it could indicate a network issue or that packets are being modified in transit to this computer. Verify that the packets sent from the remote computer are the same as those received by this computer. This error might also indicate interoperability problems with other IPsec implementations. - 4961: IPsec dropped an inbound packet that failed a replay check. If this problem persists, it could indicate a replay attack against this computer. - 4962: IPsec dropped an inbound packet that failed a replay check. The inbound packet had too low a sequence number to ensure it was not a replay. - 4963: IPsec dropped an inbound clear text packet that should have been secured. This is usually due to the remote computer changing its IPsec policy without informing this computer. This could also be a spoofing attack attempt. - 4965: IPsec received a packet from a remote computer with an incorrect Security Parameter Index (SPI). This is usually caused by malfunctioning hardware that is corrupting packets. If these errors persist, verify that the packets sent from the remote computer are the same as those received by this computer. This error may also indicate interoperability problems with other IPsec implementations. In that case, if connectivity is not impeded, then these events can be ignored. - 5478: IPsec Services has started successfully. - 5479: IPsec Services has been shut down successfully. The shutdown of IPsec Services can put the computer at greater risk of network attack or expose the computer to potential security risks. - 5480: IPsec Services failed to get the complete list of network interfaces on the computer. This poses a potential security risk because some of the network interfaces may not get the protection provided by the applied IPsec filters. Use the IP Security Monitor snap-in to diagnose the problem. - 5483: IPsec Services failed to initialize RPC server. IPsec Services could not be started. - 5484: IPsec Services has experienced a critical failure and has been shut down. The shutdown of IPsec Services can put the computer at greater risk of network attack or expose the computer to potential security risks. - 5485: IPsec Services failed to process some IPsec filters on a plug-and-play event for network interfaces. This poses a potential security risk because some of the network interfaces may not get the protection provided by the applied IPsec filters. Use the IP Security Monitor snap-in to diagnose the problem. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit IPsec Driver" + compliance: + - cis: ["17.9.1"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"IPsec Driver" -> r:Success and Failure' + + - id: 26168 + title: "Ensure 'Audit Other System Events' is set to 'Success and Failure'." + description: "This subcategory reports on other system events. Events for this subcategory include: - 5024 : The Windows Firewall Service has started successfully. - 5025 : The Windows Firewall Service has been stopped. - 5027 : The Windows Firewall Service was unable to retrieve the security policy from the local storage. The service will continue enforcing the current policy. - 5028 : The Windows Firewall Service was unable to parse the new security policy. The service will continue with currently enforced policy. - 5029: The Windows Firewall Service failed to initialize the driver. The service will continue to enforce the current policy. - 5030: The Windows Firewall Service failed to start. - 5032: Windows Firewall was unable to notify the user that it blocked an application from accepting incoming connections on the network. - 5033 : The Windows Firewall Driver has started successfully. - 5034 : The Windows Firewall Driver has been stopped. - 5035 : The Windows Firewall Driver failed to start. - 5037 : The Windows Firewall Driver detected critical runtime error. Terminating. - 5058: Key file operation. - 5059: Key migration operation. The recommended state for this setting is: Success and Failure." + rationale: "Capturing these audit events may be useful for identifying when the Windows Firewall is not performing as expected." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit Other System Events" + compliance: + - cis: ["17.9.2"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Other System Events" -> r:Success and Failure' + + - id: 26169 + title: "Ensure 'Audit Security State Change' is set to include 'Success'." + description: "This subcategory reports changes in security state of the system, such as when the security subsystem starts and stops. Events for this subcategory include: - 4608: Windows is starting up. - 4609: Windows is shutting down. - 4616: The system time was changed. - 4621: Administrator recovered system from CrashOnAuditFail. Users who are not administrators will now be allowed to log on. Some audit-able activity might not have been recorded. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit Security State Change" + compliance: + - cis: ["17.9.3"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Security State Change" -> r:Success' + + - id: 26170 + title: "Ensure 'Audit Security System Extension' is set to include 'Success'." + description: "This subcategory reports the loading of extension code such as authentication packages by the security subsystem. Events for this subcategory include: - 4610: An authentication package has been loaded by the Local Security Authority. - 4611: A trusted logon process has been registered with the Local Security Authority. - 4614: A notification package has been loaded by the Security Account Manager. - 4622: A security package has been loaded by the Local Security Authority. - 4697: A service was installed in the system. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit Security System Extension" + compliance: + - cis: ["17.9.4"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Security System Extension" -> r:Success' + + - id: 26171 + title: "Ensure 'Audit System Integrity' is set to 'Success and Failure'." + description: "This subcategory reports on violations of integrity of the security subsystem. Events for this subcategory include: - 4612 : Internal resources allocated for the queuing of audit messages have been exhausted, leading to the loss of some audits. - 4615 : Invalid use of LPC port. - 4618 : A monitored security event pattern has occurred. - 4816 : RPC detected an integrity violation while decrypting an incoming message. - 5038 : Code integrity determined that the image hash of a file is not valid. The file could be corrupt due to unauthorized modification or the invalid hash could indicate a potential disk device error. - 5056: A cryptographic self test was performed. - 5057: A cryptographic primitive operation failed. - 5060: Verification operation failed. - 5061: Cryptographic operation. - 5062: A kernel-mode cryptographic self test was performed. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit System Integrity" + compliance: + - cis: ["17.9.5"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"System Integrity" -> r:Success and Failure' + + - id: 26172 + title: "Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'." + description: "Disables the lock screen camera toggle switch in PC Settings and prevents a camera from being invoked on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen camera extends the protection afforded by the lock screen to camera features." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen camera. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera -> 1' + + - id: 26173 + title: "Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'." + description: "Disables the lock screen slide show settings in PC Settings and prevents a slide show from playing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen slide show extends the protection afforded by the lock screen to slide show contents." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen slide show. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow -> 1' + + - id: 26174 + title: "Ensure 'Allow users to enable online speech recognition services' is set to 'Disabled'." + description: "This policy enables the automatic learning component of input personalization that includes speech, inking, and typing. Automatic learning enables the collection of speech and handwriting patterns, typing history, contacts, and recent calendar information. It is required for the use of Cortana. Some of this collected information may be stored on the user's OneDrive, in the case of inking and typing; some of the information will be uploaded to Microsoft to personalize speech. The recommended state for this setting is: Disabled." + rationale: "If this setting is Enabled sensitive information could be stored in the cloud or sent to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Regional and Language Options\\Allow users to enable online speech recognition services. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow input personalization, but it was renamed to Allow users to enable online speech recognition services starting with the Windows 10 R1809 & Server 2019 Administrative Templates." + compliance: + - cis: ["18.1.2.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization -> AllowInputPersonalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization -> AllowInputPersonalization -> 0' + + - id: 26175 + title: "Ensure 'Allow Online Tips' is set to 'Disabled'." + description: "This policy setting configures the retrieval of online tips and help for the Settings app. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Allow Online Tips. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanel.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.3"] + - pci_dss: ["1.3.4"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> AllowOnlineTips' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> AllowOnlineTips -> 0' + + - id: 26176 + title: "Ensure LAPS AdmPwd GPO Extension / CSE is installed." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "In order to utilize LAPS, a minor Active Directory Schema update is required, and a Group Policy Client Side Extension (CSE) must be installed on each managed computer. When LAPS is installed, the file AdmPwd.dll must be present in the following location and registered in Windows (the LAPS AdmPwd GPO Extension / CSE installation does this for you): C:\\Program Files\\LAPS\\CSE\\AdmPwd.dll" + compliance: + - cis: ["18.2.1"] + - cis_csc: ["5.2", "5.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + + - id: 26177 + title: "Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled'." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Do not allow password expiration time longer than required by policy. Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.2"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled -> 1' + + - id: 26178 + title: "Ensure 'Enable Local Admin Password Management' is set to 'Enabled'." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Enable Local Admin Password Management. Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.3"] + - cis_csc: ["5.2", "5.4"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled -> 1' + + - id: 26179 + title: "Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters'." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: Large letters + small letters + numbers + special characters. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Complexity option to Large letters + small letters + numbers + special characters: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings. Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.4"] + - cis_csc: ["5.2"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity -> 4' + + - id: 26180 + title: "Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more'." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 15 or more. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Length option to 15 or more: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings. Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.5"] + - cis_csc: ["5.2"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> n:^(\d+) compare >= 15' + + - id: 26181 + title: "Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer'." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 30 or fewer. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Age (Days) option to 30 or fewer: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings. Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.6"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> n:^(\d+) compare <= 30' + + - id: 26182 + title: "Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled'." + description: "This setting controls whether local accounts can be used for remote administration via network logon (e.g., NET USE, connecting to C$, etc.). Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Enabling this policy significantly reduces that risk. Enabled: Applies UAC token-filtering to local accounts on network logons. Membership in powerful group such as Administrators is disabled and powerful privileges are removed from the resulting access token. This configures the LocalAccountTokenFilterPolicy registry value to 0. This is the default behavior for Windows. Disabled: Allows local accounts to have full administrative rights when authenticating via network logon, by configuring the LocalAccountTokenFilterPolicy registry value to 1. For more information about local accounts and credential theft, review the 'Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques' documents. For more information about LocalAccountTokenFilterPolicy, see Microsoft Knowledge Base article 951016: Description of User Account Control and remote restrictions in Windows Vista. The recommended state for this setting is: Enabled." + rationale: "Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Ensuring this policy is Enabled significantly reduces that risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Apply UAC restrictions to local accounts on network logons. Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required." + compliance: + - cis: ["18.3.1"] + - cis_csc: ["5.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy -> 0' + + - id: 26183 + title: "Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver'." + description: "This setting configures the start type for the Server Message Block version 1 (SMBv1) client driver service (MRxSmb10), which is recommended to be disabled. The recommended state for this setting is: Enabled: Disable driver (recommended). Note: Do not, under any circumstances, configure this overall setting as Disabled, as doing so will delete the underlying registry entry altogether, which will cause serious problems." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable driver (recommended): Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 client driver. Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required." + compliance: + - cis: ["18.3.2"] + - cis_csc: ["4.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start -> 4' + + - id: 26184 + title: "Ensure 'Configure SMB v1 server' is set to 'Disabled'." + description: "This setting configures the server-side processing of the Server Message Block version 1 (SMBv1) protocol. The recommended state for this setting is: Disabled." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 server. Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required." + compliance: + - cis: ["18.3.3"] + - cis_csc: ["4.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1 -> 0' + + - id: 26185 + title: "Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled'." + description: "Windows includes support for Structured Exception Handling Overwrite Protection (SEHOP). We recommend enabling this feature to improve the security profile of the computer. The recommended state for this setting is: Enabled." + rationale: "This feature is designed to block exploits that use the Structured Exception Handler (SEH) overwrite technique. This protection mechanism is provided at run-time. Therefore, it helps protect applications regardless of whether they have been compiled with the latest improvements, such as the /SAFESEH option." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Enable Structured Exception Handling Overwrite Protection (SEHOP). Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required." + compliance: + - cis: ["18.3.4"] + - cis_csc: ["10.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation -> 0' + + - id: 26186 + title: "Ensure 'Limits print driver installation to Administrators' is set to 'Enabled'." + description: "This policy setting controls whether users that aren't Administrators can install print drivers on the system. The recommended state for this setting is: Enabled. Note: On August 10, 2021, Microsoft announced a Point and Print Default Behavior Change which modifies the default Point and Print driver installation and update behavior to require Administrator privileges. This is documented in KB5005652—Manage new Point and Print default driver installation behavior (CVE-2021-34481)." + rationale: "Restricting the installation of print drives to Administrators can help mitigate the PrintNightmare vulnerability (CVE-2021-34527) and other Print Spooler attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Limits print driver installation to Administrators. Note: This Group Policy path does not exist by default. An additional Group Policy template SecGuide.admx/adml is required." + compliance: + - cis: ["18.3.5"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> RestrictDriverInstallationToAdministrators' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> RestrictDriverInstallationToAdministrators -> 1' + + - id: 26187 + title: "Ensure 'NetBT NodeType configuration' is set to 'Enabled: P-node'." + description: "This setting determines which method NetBIOS over TCP/IP (NetBT) uses to register and resolve names. The available methods are: The B-node (broadcast) method only uses broadcasts. The P-node (point-to-point) method only uses name queries to a name server (WINS). The M-node (mixed) method broadcasts first, then queries a name server (WINS) if broadcast failed. The H-node (hybrid) method queries a name server (WINS) first, then broadcasts if the query failed. The recommended state for this setting is: Enabled: P-node (recommended) (point-to- point). Note: Resolution through LMHOSTS or DNS follows these methods. If the NodeType registry value is present, it overrides any DhcpNodeType registry value. If neither NodeType nor DhcpNodeType is present, the computer uses B-node (broadcast) if there are no WINS servers configured for the network, or H-node (hybrid) if there is at least one WINS server configured." + rationale: "In order to help mitigate the risk of NetBIOS Name Service (NBT-NS) poisoning attacks, setting the node type to P-node (point-to-point) will prevent the system from sending out NetBIOS broadcasts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: P-node (recommended): Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\NetBT NodeType configuration. Note: This change does not take effect until the computer has been restarted. Note #2: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required." + compliance: + - cis: ["18.3.6"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NodeType' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NodeType -> 2' + + - id: 26188 + title: "Ensure 'WDigest Authentication' is set to 'Disabled'." + description: "When WDigest authentication is enabled, Lsass.exe retains a copy of the user's plaintext password in memory, where it can be at risk of theft. If this setting is not configured, WDigest authentication is disabled in Windows 8.1 and in Windows Server 2012 R2; it is enabled by default in earlier versions of Windows and Windows Server. For more information about local accounts and credential theft, review the 'Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques' documents. For more information about UseLogonCredential, see Microsoft Knowledge Base article 2871997: Microsoft Security Advisory Update to improve credentials protection and management May 13, 2014. The recommended state for this setting is: Disabled." + rationale: "Preventing the plaintext storage of credentials in memory may reduce opportunity for credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\WDigest Authentication (disabling may require KB2871997). Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required." + compliance: + - cis: ["18.3.7"] + - cis_csc: ["3.11"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential -> 0' + + - id: 26189 + title: "Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled'." + description: "This setting is separate from the Welcome screen feature in Windows XP and Windows Vista; if that feature is disabled, this setting is not disabled. If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks to which the computer is connected. Also, if you enable automatic logon, the password is stored in the registry in plaintext, and the specific registry key that stores this value is remotely readable by the Authenticated Users group. For additional information, see Microsoft Knowledge Base article 324737: How to turn on automatic logon in Windows. The recommended state for this setting is: Disabled." + rationale: "If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks that the computer is connected to. Also, if you enable automatic logon, the password is stored in the registry in plaintext. The specific registry key that stores this setting is remotely readable by the Authenticated Users group. As a result, this entry is appropriate only if the computer is physically secured and if you ensure that untrusted users cannot remotely see the registry." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.1"] + - cis_csc: ["3.11"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> 0' + + - id: 26190 + title: "Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'." + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should follow through the network. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.2"] + - cis_csc: ["4.8"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting -> 2' + + - id: 26191 + title: "Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'." + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should take through the network. It is recommended to configure this setting to Not Defined for enterprise environments and to Highest Protection for high security environments to completely disable source routing. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.3"] + - cis_csc: ["4.8"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting -> 2' + + - id: 26192 + title: "Ensure 'MSS: (DisableSavePassword) Prevent the dial-up password from being saved' is set to 'Enabled'." + description: 'When you dial a phonebook or VPN entry in Dial-Up Networking, you can use the "Save Password" option so that your Dial-Up Networking password is cached and you will not need to enter it on successive dial attempts. For security, administrators may want to prevent users from caching passwords. The recommended state for this setting is: Enabled.' + rationale: "An attacker who steals a mobile user's computer could automatically connect to the organization's network if the Save This Password check box is selected for the dial-up or VPN networking entry used to connect to your organization's network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(DisableSavePassword) Prevent the dial-up password from being saved. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.4"] + - cis_csc: ["4.8"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters -> DisableSavePassword' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters -> DisableSavePassword -> 1' + + - id: 26193 + title: "Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'." + description: "Internet Control Message Protocol (ICMP) redirects cause the IPv4 stack to plumb host routes. These routes override the Open Shortest Path First (OSPF) generated routes. The recommended state for this setting is: Disabled." + rationale: "This behavior is expected. The problem is that the 10 minute time-out period for the ICMP redirect-plumbed routes temporarily creates a network situation in which traffic will no longer be routed properly for the affected host. Ignoring such ICMP redirects will limit the system's exposure to attacks that will impact its ability to participate on the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.5"] + - cis_csc: ["4.8"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + - nist_800_53: ["SC.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect -> 0' + + - id: 26194 + title: "Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes (recommended)'." + description: "This value controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet. If the remote computer is still reachable, it acknowledges the keep-alive packet. The recommended state for this setting is: Enabled: 300,000 or 5 minutes (recommended)." + rationale: "An attacker who is able to connect to network applications could establish numerous connections to cause a DoS condition." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 300,000 or 5 minutes (recommended): Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.6"] + - cis_csc: ["4.8"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> 300000' + + - id: 26195 + title: "Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'." + description: "NetBIOS over TCP/IP is a network protocol that among other things provides a way to easily resolve NetBIOS names that are registered on Windows-based systems to the IP addresses that are configured on those systems. This setting determines whether the computer releases its NetBIOS name when it receives a name-release request. The recommended state for this setting is: Enabled." + rationale: "The NetBT protocol is designed not to use authentication, and is therefore vulnerable to spoofing. Spoofing makes a transmission appear to come from a user other than the user who performed the action. A malicious user could exploit the unauthenticated nature of the protocol to send a name-conflict datagram to a target computer, which would cause the computer to relinquish its name and not respond to queries. An attacker could send a request over the network and query a computer to release its NetBIOS name. As with any change that could affect applications, it is recommended that you test this change in a non-production environment before you change the production environment. The result of such an attack could be to cause intermittent connectivity issues on the target computer, or even to prevent the use of Network Neighborhood, domain logons, the NET SEND command, or additional NetBIOS name resolution." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.7"] + - cis_csc: ["4.8"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand -> 1' + + - id: 26196 + title: "Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'." + description: "This setting is used to enable or disable the Internet Router Discovery Protocol (IRDP), which allows the system to detect and configure default gateway addresses automatically as described in RFC 1256 on a per-interface basis. The recommended state for this setting is: Disabled." + rationale: "An attacker who has gained control of a computer on the same network segment could configure a computer on the network to impersonate a router. Other computers with IRDP enabled would then attempt to route their traffic through the already compromised computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.8"] + - cis_csc: ["4.8"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> 0' + + - id: 26197 + title: "Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'." + description: "The DLL search order can be configured to search for DLLs that are requested by running processes in one of two ways: - Search folders specified in the system path first, and then search the current working folder. - Search current working folder first, and then search the folders specified in the system path. When enabled, the registry value is set to 1. With a setting of 1, the system first searches the folders that are specified in the system path and then searches the current working folder. When disabled the registry value is set to 0 and the system first searches the current working folder and then searches the folders that are specified in the system path. Applications will be forced to search for DLLs in the system path first. For applications that require unique versions of these DLLs that are included with the application, this entry could cause performance or stability problems. The recommended state for this setting is: Enabled. Note: More information on how Safe DLL search mode works is available at this link: Dynamic-Link Library Search Order - Windows applications | Microsoft Docs" + rationale: "If a user unknowingly executes hostile code that was packaged with additional files that include modified versions of system DLLs, the hostile code could load its own versions of those DLLs and potentially increase the type and degree of damage the code can render." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.9"] + - cis_csc: ["2.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode -> 1' + + - id: 26198 + title: "Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds'." + description: "Windows includes a grace period between when the screen saver is launched and when the console is actually locked automatically when screen saver locking is enabled. The recommended state for this setting is: Enabled: 5 or fewer seconds." + rationale: "The default grace period that is allowed for user movement before the screen saver lock takes effect is five seconds. If you leave the default grace period configuration, your computer is vulnerable to a potential attack from someone who could approach the console and attempt to log on to the computer before the lock takes effect. An entry to the registry can be made to adjust the length of the grace period." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 5 or fewer seconds: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.10"] + - cis_csc: ["4.3"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> n:^(\d+) compare <= 5' + + - id: 26199 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'." + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.11"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' + + - id: 26200 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'." + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.12"] + - cis_csc: ["4.8"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' + + - id: 26201 + title: "Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less'." + description: "This setting can generate a security audit in the Security event log when the log reaches a user-defined threshold. The recommended state for this setting is: Enabled: 90% or less. Note: If log settings are configured to Overwrite events as needed or Overwrite events older than x days, this event will not be generated." + rationale: "If the Security log reaches 90 percent of its capacity and the computer has not been configured to overwrite events as needed, more recent events will not be written to the log. If the log reaches its capacity and the computer has been configured to shut down when it can no longer record events to the Security log, the computer will shut down and will no longer be available to provide network services." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 90% or less: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.4.13"] + - pci_dss: ["10.7"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> n:^(\d+) compare <= 90' + + - id: 26202 + title: "Ensure 'Configure DNS over HTTPS (DoH) name resolution' is set to 'Enabled: Allow DoH' or higher." + description: "This setting determines if DNS over HTTPS (DoH) is used by the system. DNS over HTTPS (DoH) is a protocol for performing remote Domain Name System (DNS) resolution over the Hypertext Transfer Protocol Secure (HTTPS). For additional information on DNS over HTTPS (DoH), visit: Secure DNS Client over HTTPS (DoH) on Windows Server 2022 | Microsoft Docs. The recommended state for this setting is: Enabled: Allow DoH. Configuring this setting to Enabled: Require DoH also conforms to the benchmark." + rationale: "DNS over HTTPS (DoH) helps protect against DNS spoofing. Spoofing makes a transmission appear to come from a user other than the user who performed the action. It can also help prevent man-in-the-middle (MitM) attacks because the session in-between is encrypted." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Allow DoH (configuring to Enabled: Require DoH also conforms to the benchmark): Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Configure DNS over HTTPS (DoH) name resolution. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DnsClient.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.4.1"] + - cis_csc: ["3.10"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> DoHPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> DoHPolicy -> r:^2$|^3$' + + - id: 26203 + title: "Ensure 'Turn off multicast name resolution' is set to 'Enabled'." + description: "LLMNR is a secondary name resolution protocol. With LLMNR, queries are sent using multicast over a local network link on a single subnet from a client computer to another client computer on the same subnet that also has LLMNR enabled. LLMNR does not require a DNS server or DNS client configuration, and provides name resolution in scenarios in which conventional DNS name resolution is not possible. The recommended state for this setting is: Enabled." + rationale: "An attacker can listen on a network for these LLMNR (UDP/5355) or NBT-NS (UDP/137) broadcasts and respond to them, tricking the host into thinking that it knows the location of the requested system. Note: To completely mitigate local name resolution poisoning, in addition to this setting, the properties of each installed NIC should also be set to Disable NetBIOS over TCP/IP (on the WINS tab in the NIC properties). Unfortunately, there is no global setting to achieve this that automatically applies to all NICs - it is a per-NIC setting that varies with different NIC hardware installations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Turn off multicast name resolution. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DnsClient.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.4.2"] + - cis_csc: ["4.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast -> 0' + + - id: 26204 + title: "Ensure 'Enable Font Providers' is set to 'Disabled'." + description: "This policy setting determines whether Windows is allowed to download fonts and font catalog data from an online font provider. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment the IT department should be managing the changes to the system configuration, to ensure all changes are tested and approved." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Fonts\\Enable Font Providers. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.5.1"] + - cis_csc: ["16.5"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableFontProviders' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableFontProviders -> 0' + + - id: 26205 + title: "Ensure 'Enable insecure guest logons' is set to 'Disabled'." + description: "This policy setting determines if the SMB client will allow insecure guest logons to an SMB server. The recommended state for this setting is: Disabled." + rationale: "Insecure guest logons are used by file servers to allow unauthenticated access to shared folders." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Lanman Workstation\\Enable insecure guest logons. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template LanmanWorkstation.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.8.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation -> AllowInsecureGuestAuth' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation -> AllowInsecureGuestAuth -> 0' + + - id: 26206 + title: "Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'." + description: "This policy setting changes the operational behavior of the Mapper I/O network protocol driver. LLTDIO allows a computer to discover the topology of a network it's connected to. It also allows a computer to initiate Quality-of-Service requests such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Mapper I/O (LLTDIO) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> 0' + + - id: 26207 + title: "Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'." + description: "This policy setting changes the operational behavior of the Responder network protocol driver. The Responder allows a computer to participate in Link Layer Topology Discovery requests so that it can be discovered and located on the network. It also allows a computer to participate in Quality-of-Service activities such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Responder (RSPNDR) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.9.2"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> 0' + + - id: 26208 + title: "Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'." + description: "The Peer Name Resolution Protocol (PNRP) allows for distributed resolution of a name to an IPv6 address and port number. The protocol operates in the context of clouds. A cloud is a set of peer computers that can communicate with each other by using the same IPv6 scope. Peer-to-Peer protocols allow for applications in the areas of RTC, collaboration, content distribution and distributed processing. The recommended state for this setting is: Enabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to peer-to-peer networking." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Microsoft Peer-to-Peer Networking Services\\Turn off Microsoft Peer-to-Peer Networking Services. Note: This Group Policy path is provided by the Group Policy template P2P-pnrp.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.10.2"] + - cis_csc: ["4.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> 1' + + - id: 26209 + title: "Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'." + description: "You can use this procedure to control a user's ability to install and configure a Network Bridge. The recommended state for this setting is: Enabled." + rationale: "The Network Bridge setting, if enabled, allows users to create a Layer 2 Media Access Control (MAC) bridge, enabling them to connect two or more physical network segments together. A Network Bridge thus allows a computer that has connections to two different networks to share data between those networks. In an enterprise managed environment, where there is a need to control network traffic to only authorized paths, allowing users to create a Network Bridge increases the risk and attack surface from the bridged network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit installation and configuration of Network Bridge on your DNS domain network. Note: This Group Policy path is provided by the Group Policy template NetworkConnections.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.11.2"] + - cis_csc: ["12.2"] + - pci_dss: ["1.3.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA -> 0' + + - id: 26210 + title: "Ensure 'Prohibit use of Internet Connection Sharing on your DNS domain network' is set to 'Enabled'." + description: "Although this 'legacy' setting traditionally applied to the use of Internet Connection Sharing (ICS) in Windows 2000, Windows XP & Server 2003, this setting now freshly applies to the Mobile Hotspot feature in Windows 10 & Server 2016. The recommended state for this setting is: Enabled." + rationale: "Non-administrators should not be able to turn on the Mobile Hotspot feature and open their Internet connectivity up to nearby mobile devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit use of Internet Connection Sharing on your DNS domain network. Note: This Group Policy path is provided by the Group Policy template NetworkConnections.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.11.3"] + - cis_csc: ["4.8"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_ShowSharedAccessUI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_ShowSharedAccessUI -> 0' + + - id: 26211 + title: "Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'." + description: "This policy setting determines whether to require domain users to elevate when setting a network's location. The recommended state for this setting is: Enabled." + rationale: "Allowing regular users to set a network location increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Require domain users to elevate when setting a network's location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template NetworkConnections.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.11.4"] + - cis_csc: ["5.4"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation -> 1' + + - id: 26212 + title: 'Ensure ''Hardened UNC Paths'' is set to ''Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares''.' + description: 'This policy setting configures secure access to UNC paths. The recommended state for this setting is: Enabled, with Require Mutual Authentication and Require Integrity set for all NETLOGON and SYSVOL shares. Note: If the environment exclusively contains Windows 8.0 / Server 2012 (non-R2) or newer systems, then the "Privacy" setting may (optionally) also be set to enable SMB encryption. However, using SMB encryption will render the targeted share paths completely inaccessible by older OSes, so only use this additional option with caution and thorough testing.' + rationale: "In February 2015, Microsoft released a new control mechanism to mitigate a security risk in Group Policy as part of the MS15-011 / MSKB 3000483 security update. This mechanism requires both the installation of the new security update and also the deployment of specific group policy settings to all computers on the domain from Windows Vista / Server 2008 (non-R2) or newer (the associated security patch to enable this feature was not released for Server 2003). A new group policy template (NetworkProvider.admx/adml) was also provided with the security update. Once the new GPO template is in place, the following are the minimum requirements to remediate the Group Policy security risk: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Note: A reboot may be required after the setting is applied to a client machine to access the above paths." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with the following paths configured, at a minimum: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Provider\\Hardened UNC Paths. Note: This Group Policy path does not exist by default. An additional Group Policy template (NetworkProvider.admx/adml) is required." + compliance: + - cis: ["18.5.14.1"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\NETLOGON' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\SYSVOL' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\NETLOGON -> r:RequireMutualAuthentication=1, RequireIntegrity=1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\SYSVOL -> r:RequireMutualAuthentication=1, RequireIntegrity=1' + + - id: 26213 + title: "Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')." + description: "Internet Protocol version 6 (IPv6) is a set of protocols that computers use to exchange information over the Internet and over home and business networks. IPv6 allows for many more IP addresses to be assigned than IPv4 did. Older networking, hosts and operating systems may not support IPv6 natively. The recommended state for this setting is: DisabledComponents - 0xff (255)" + rationale: "Since the vast majority of private enterprise managed networks have no need to utilize IPv6 (because they have access to private IPv4 addressing), disabling IPv6 components removes a possible attack surface that is also harder to monitor the traffic on. As a result, we recommend configuring IPv6 to a Disabled state when it is not needed." + remediation: "To establish the recommended configuration, set the following Registry value to 0xff (255) (DWORD): HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TCPIP6\\Parameters:DisabledComponents. Note: This change does not take effect until the computer has been restarted. Note #2: Although Microsoft does not provide an ADMX template to configure this registry value, a custom .ADM template (Disable-IPv6-Components-KB929852.adm) is provided in the CIS Benchmark Remediation Kit to facilitate its configuration. Be aware though that simply turning off the group policy setting in the .ADM template will not \"undo\" the change once applied. Instead, the opposite setting must be applied to change the registry value to the opposite state." + compliance: + - cis: ["18.5.19.2.1"] + - cis_csc: ["4.8"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> 255' + + - id: 26214 + title: "Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'." + description: "This policy setting allows the configuration of wireless settings using Windows Connect Now (WCN). The WCN Registrar enables the discovery and configuration of devices over Ethernet (UPnP) over in-band 802.11 Wi-Fi through the Windows Portable Device API (WPD) and via USB Flash drives. Additional options are available to allow discovery and configuration over a specific medium. The recommended state for this setting is: Disabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to user configuration of wireless settings." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Configuration of wireless settings using Windows Connect Now. Note: This Group Policy path is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.20.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> 0' + + - id: 26215 + title: "Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'." + description: "This policy setting prohibits access to Windows Connect Now (WCN) wizards. The recommended state for this setting is: Enabled." + rationale: "Allowing standard users to access the Windows Connect Now wizard increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Prohibit access of the Windows Connect Now wizards. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.20.2"] + - cis_csc: ["4.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> 1' + + - id: 26216 + title: "Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled: 3 = Prevent Wi-Fi when on Ethernet'." + description: "This policy setting prevents computers from establishing multiple simultaneous connections to either the Internet or to a Windows domain. The recommended state for this setting is: Enabled: 3 = Prevent Wi-Fi when on Ethernet." + rationale: "Preventing bridged network connections can help prevent a user unknowingly allowing traffic to route between internal and external networks, which risks exposure to sensitive internal data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3 = Prevent Wi-Fi when on Ethernet: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Minimize the number of simultaneous connections to the Internet or a Windows Domain. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WCM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates. It was updated with a new Minimize Policy Options sub-setting starting with the Windows 10 Release 1903 Administrative Templates." + compliance: + - cis: ["18.5.21.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections -> 3' + + - id: 26217 + title: "Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled'." + description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time. The recommended state for this setting is: Enabled." + rationale: "The potential concern is that a user would unknowingly allow network traffic to flow between the insecure public network and the enterprise managed network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Prohibit connection to non-domain networks when connected to domain authenticated network. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WCM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.21.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain -> 1' + + - id: 26218 + title: "Ensure 'Allow Windows to automatically connect to suggested open hotspots, to networks shared by contacts, and to hotspots offering paid services' is set to 'Disabled'." + description: 'This policy setting determines whether users can enable the following WLAN settings: Connect to suggested open hotspots, Connect to networks shared by my contacts, and Enable paid services. - Connect to suggested open hotspots enables Windows to automatically connect users to open hotspots it knows about by crowdsourcing networks that other people using Windows have connected to. - Connect to networks shared by my contacts enables Windows to automatically connect to networks that the user''s contacts have shared with them, and enables users on this device to share networks with their contacts. - Enable paid services enables Windows to temporarily connect to open hotspots to determine if paid services are available. The recommended state for this setting is: Disabled. Note: These features are also known by the name "Wi-Fi Sense".' + rationale: "Automatically connecting to an open hotspot or network can introduce the system to a rogue network with malicious intent." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\WLAN Service\\WLAN Settings\\Allow Windows to automatically connect to suggested open hotspots, to networks shared by contacts, and to hotspots offering paid services. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template wlansvc.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.23.2.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config -> AutoConnectAllowedOEM' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WcmSvc\wifinetworkmanager\config -> AutoConnectAllowedOEM -> 0' + + - id: 26219 + title: "Ensure 'Allow Print Spooler to accept client connections' is set to 'Disabled'." + description: "This policy setting controls whether the Print Spooler service will accept client connections. The recommended state for this setting is: Disabled. Note: The Print Spooler service must be restarted for changes to this policy to take effect." + rationale: "Disabling the ability for the Print Spooler service to accept client connections mitigates remote attacks against the PrintNightmare vulnerability (CVE-2021-34527) and other remote Print Spooler attacks. However, this recommendation does not mitigate against local attacks on the Print Spooler service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Allow Print Spooler to accept client connections. Note: This Group Policy path is provided by the Group Policy template printing2.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RegisterSpoolerRemoteRpcEndPoint' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RegisterSpoolerRemoteRpcEndPoint -> 2' + + - id: 26220 + title: "Ensure 'Point and Print Restrictions: When installing drivers for a new connection' is set to 'Enabled: Show warning and elevation prompt'." + description: "This policy setting controls whether computers will show a warning and a security elevation prompt when users create a new printer connection using Point and Print. The recommended state for this setting is: Enabled: Show warning and elevation prompt. Note: On August 10, 2021, Microsoft announced a Point and Print Default Behavior Change which modifies the default Point and Print driver installation and update behavior to require Administrator privileges. This is documented in KB5005652—Manage new Point and Print default driver installation behavior (CVE-2021-34481). This change overrides all Point and Print Group Policy settings and ensures that only Administrators can install printer drivers from a print server using Point and Print." + rationale: "Enabling Windows User Account Control (UAC) for the installation of new print drivers can help mitigate the PrintNightmare vulnerability (CVE-2021-34527) and other Print Spooler attacks. Although the Point and Print default driver installation behavior overrides this setting, it is important to configure this as a backstop in the event that behavior is reversed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Show warning and elevation prompt: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Point and Print Restrictions: When installing drivers for a new connection. Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint' + - 'not r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> NoWarningNoElevationOnInstall' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> NoWarningNoElevationOnInstall -> 0' + + - id: 26221 + title: "Ensure 'Point and Print Restrictions: When updating drivers for an existing connection' is set to 'Enabled: Show warning and elevation prompt'." + description: "This policy setting controls whether computers will show a warning and a security elevation prompt when users are updating drivers for an existing connection using Point and Print. The recommended state for this setting is: Enabled: Show warning and elevation prompt. Note: On August 10, 2021, Microsoft announced a Point and Print Default Behavior Change which modifies the default Point and Print driver installation and update behavior to require Administrator privileges. This is documented in KB5005652—Manage new Point and Print default driver installation behavior (CVE-2021-34481). This change overrides all Point and Print Group Policy settings and ensures that only Administrators can install printer drivers from a print server using Point and Print." + rationale: "Enabling Windows User Account Control (UAC) for updating existing print drivers can help mitigate the PrintNightmare vulnerability (CVE-2021-34527) and other Print Spooler attacks. Although the Point and Print default driver installation behavior overrides this setting, it is important to configure this as a backstop in the event that behavior is reversed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Show warning and elevation prompt: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Point and Print Restrictions: When updating drivers for an existing connection. Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint' + - 'not r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> UpdatePromptSettings' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> UpdatePromptSettings -> 0' + + - id: 26222 + title: "Ensure 'Turn off notifications network usage' is set to 'Enabled'." + description: "This policy setting blocks applications from using the network to send notifications to update tiles, tile badges, toast, or raw notifications. This policy setting turns off the connection between Windows and the Windows Push Notification Service (WNS). This policy setting also stops applications from being able to poll application services to update tiles. The recommended state for this setting is: Enabled." + rationale: "Windows Push Notification Services (WNS) is a mechanism to receive 3rd-party notifications and updates from the cloud/Internet. In a high security environment, external systems, especially those hosted outside the organization, should be prevented from having an impact on the secure workstations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Start Menu and Taskbar\\Turn off notifications network usage. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WPN.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.7.1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -> NoCloudApplicationNotification' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -> NoCloudApplicationNotification -> 1' + + - id: 26223 + title: "Ensure 'Include command line in process creation events' is set to 'Enabled'." + description: "This policy setting controls whether the process creation command line text is logged in security audit events when a new process has been created. The recommended state for this setting is: Enabled. Note: This feature that this setting controls was not originally supported in workstation OSes older than Windows 8.1. However, in February 2015 Microsoft added support for the feature to Windows 7 and Windows 8.0 via an update - KB3004375. Therefore, this setting is also important to set on those older OSes." + rationale: "Capturing process command line information in event logs can be very valuable when performing forensic investigations of attack incidents." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Audit Process Creation\\Include command line in process creation events. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AuditSettings.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.3.1"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled -> 1' + + - id: 26224 + title: "Ensure 'Encryption Oracle Remediation' is set to 'Enabled: Force Updated Clients'." + description: "Some versions of the CredSSP protocol that is used by some applications (such as Remote Desktop Connection) are vulnerable to an encryption oracle attack against the client. This policy controls compatibility with vulnerable clients and servers and allows you to set the level of protection desired for the encryption oracle vulnerability. The recommended state for this setting is: Enabled: Force Updated Clients." + rationale: "This setting is important to mitigate the CredSSP encryption oracle vulnerability, for which information was published by Microsoft on 03/13/2018 in CVE-2018-0886 | CredSSP Remote Code Execution Vulnerability. All versions of Windows from Windows Vista onwards are affected by this vulnerability, and will be compatible with this recommendation provided that they have been patched at least through May 2018 (or later)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Force Updated Clients: Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Encryption Oracle Remediation. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1803 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.4.1"] + - cis_csc: ["7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters -> AllowEncryptionOracle' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters -> AllowEncryptionOracle -> 0' + + - id: 26225 + title: "Ensure 'Remote host allows delegation of non-exportable credentials' is set to 'Enabled'." + description: "Remote host allows delegation of non-exportable credentials. When using credential delegation, devices provide an exportable version of credentials to the remote host. This exposes users to the risk of credential theft from attackers on the remote host. The Restricted Admin Mode and Windows Defender Remote Credential Guard features are two options to help protect against this risk. The recommended state for this setting is: Enabled. Note: More detailed information on Windows Defender Remote Credential Guard and how it compares to Restricted Admin Mode can be found at this link: Protect Remote Desktop credentials with Windows Defender Remote Credential Guard (Windows 10) | Microsoft Docs" + rationale: "Restricted Admin Mode was designed to help protect administrator accounts by ensuring that reusable credentials are not stored in memory on remote devices that could potentially be compromised. Windows Defender Remote Credential Guard helps you protect your credentials over a Remote Desktop connection by redirecting Kerberos requests back to the device that is requesting the connection. Both features should be enabled and supported, as they reduce the chance of credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Remote host allows delegation of non-exportable credentials. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.4.2"] + - cis_csc: ["10.5"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds -> 1' + + - id: 26226 + title: "Ensure 'Turn On Virtualization Based Security' is set to 'Enabled'." + description: "This policy setting specifies whether Virtualization Based Security is enabled. Virtualization Based Security uses the Windows Hypervisor to provide support for security services. The recommended state for this setting is: Enabled. Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Kerberos, NTLM, and Credential manager isolate secrets by using virtualization-based security. Previous versions of Windows stored secrets in the Local Security Authority (LSA). Prior to Windows 10, the LSA stored secrets used by the operating system in its process memory. With Windows Defender Credential Guard enabled, the LSA process in the operating system talks to a new component called the isolated LSA process that stores and protects those secrets. Data stored by the isolated LSA process is protected using virtualization-based security and is not accessible to the rest of the operating system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.5.1"] + - cis_csc: ["10.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> EnableVirtualizationBasedSecurity' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> EnableVirtualizationBasedSecurity -> 1' + + - id: 26227 + title: "Ensure 'Turn On Virtualization Based Security: Select Platform Security Level' is set to 'Secure Boot and DMA Protection'." + description: "This policy setting specifies whether Virtualization Based Security is enabled. Virtualization Based Security uses the Windows Hypervisor to provide support for security services. The recommended state for this setting is: Secure Boot and DMA Protection. Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Secure Boot can help reduce the risk of bootloader attacks and in conjunction with DMA protections to help protect data from being scraped from memory." + remediation: "To establish the recommended configuration via GP, set the following UI path to Secure Boot and DMA Protection: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Select Platform Security Level. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.5.2"] + - cis_csc: ["10.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> RequirePlatformSecurityFeatures' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> RequirePlatformSecurityFeatures -> 3' + + - id: 26228 + title: "Ensure 'Turn On Virtualization Based Security: Virtualization Based Protection of Code Integrity' is set to 'Enabled with UEFI lock'." + description: "This setting enables virtualization based protection of Kernel Mode Code Integrity. When this is enabled, kernel mode memory protections are enforced and the Code Integrity validation path is protected by the Virtualization Based Security feature. The recommended state for this setting is: Enabled with UEFI lock. Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "The Enabled with UEFI lock option ensures that Virtualization Based Protection of Code Integrity cannot be disabled remotely." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with UEFI lock: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Virtualization Based Protection of Code Integrity. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.5.3"] + - cis_csc: ["10.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HypervisorEnforcedCodeIntegrity' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HypervisorEnforcedCodeIntegrity -> 1' + + - id: 26229 + title: "Ensure 'Turn On Virtualization Based Security: Require UEFI Memory Attributes Table' is set to 'True (checked)'." + description: "This option will only enable Virtualization Based Protection of Code Integrity on devices with UEFI firmware support for the Memory Attributes Table. Devices without the UEFI Memory Attributes Table may have firmware that is incompatible with Virtualization Based Protection of Code Integrity which in some cases can lead to crashes or data loss or incompatibility with certain plug-in cards. If not setting this option the targeted devices should be tested to ensure compatibility. The recommended state for this setting is: True (checked). Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "This setting will help protect this control from being enabled on a system that is not compatible which could lead to a crash or data loss." + remediation: "To establish the recommended configuration via GP, set the following UI path to TRUE: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Require UEFI Memory Attributes Table. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.5.4"] + - cis_csc: ["10.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HVCIMATRequired' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HVCIMATRequired -> 1' + + - id: 26230 + title: "Ensure 'Turn On Virtualization Based Security: Credential Guard Configuration' is set to 'Enabled with UEFI lock'." + description: 'This setting lets users turn on Credential Guard with virtualization-based security to help protect credentials. The "Enabled with UEFI lock" option ensures that Credential Guard cannot be disabled remotely. In order to disable the feature, you must set the Group Policy to "Disabled" as well as remove the security functionality from each computer, with a physically present user, in order to clear configuration persisted in UEFI. The recommended state for this setting is: Enabled with UEFI lock. Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs.' + rationale: "The Enabled with UEFI lock option ensures that Credential Guard cannot be disabled remotely." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with UEFI lock: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Credential Guard Configuration. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.5.5"] + - cis_csc: ["10.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> LsaCfgFlags' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> LsaCfgFlags -> 1' + + - id: 26231 + title: "Ensure 'Turn On Virtualization Based Security: Secure Launch Configuration' is set to 'Enabled'." + description: "Secure Launch protects the Virtualization Based Security environment from exploited vulnerabilities in device firmware. The recommended state for this setting is: Enabled. Note: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Secure Launch changes the way Windows boots to use Intel Trusted Execution Technology (TXT) and Runtime BIOS Resilience features to prevent firmware exploits from being able to impact the security of the Windows Virtualization Based Security environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Secure Launch Configuration. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.5.6"] + - cis_csc: ["10.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> ConfigureSystemGuardLaunch' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> ConfigureSystemGuardLaunch -> 1' + + - id: 26232 + title: "Ensure 'Prevent device metadata retrieval from the Internet' is set to 'Enabled'." + description: "This policy setting allows you to prevent Windows from retrieving device metadata from the Internet. The recommended state for this setting is: Enabled. Note: This will not prevent the installation of basic hardware drivers, but does prevent associated 3rd-party utility software from automatically being installed under the context of the SYSTEM account." + rationale: "Installation of software should be conducted by an authorized system administrator and not a standard user. Allowing automatic 3rd-party software installations under the context of the SYSTEM account has potential for allowing unauthorized access via backdoors or installation software bugs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Installation\\Prevent device metadata retrieval from the Internet. Note: This Group Policy path is provided by the Group Policy template DeviceInstallation.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates, or with the Group Policy template DeviceSetup.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata -> PreventDeviceMetadataFromNetwork' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata -> PreventDeviceMetadataFromNetwork -> 1' + + - id: 26233 + title: "Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'." + description: "This policy setting allows you to specify which boot-start drivers are initialized based on a classification determined by an Early Launch Antimalware boot-start driver. The Early Launch Antimalware boot-start driver can return the following classifications for each boot-start driver: - Good: The driver has been signed and has not been tampered with. - Bad: The driver has been identified as malware. It is recommended that you do not allow known bad drivers to be initialized. - Bad, but required for boot: The driver has been identified as malware, but the computer cannot successfully boot without loading this driver. - Unknown: This driver has not been attested to by your malware detection application and has not been classified by the Early Launch Antimalware boot-start driver. If you enable this policy setting you will be able to choose which boot-start drivers to initialize the next time the computer is started. If your malware detection application does not include an Early Launch Antimalware bootstart driver or if your Early Launch Antimalware boot-start driver has been disabled, this setting has no effect and all boot-start drivers are initialized. The recommended state for this setting is: Enabled: Good, unknown and bad but critical." + rationale: "This policy setting helps reduce the impact of malware that has already infected your system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Good, unknown and bad but critical: Computer Configuration\\Policies\\Administrative Templates\\System\\Early Launch Antimalware\\Boot-Start Driver Initialization Policy. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template EarlyLaunchAM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.14.1"] + - cis_csc: ["10.5"] + - pci_dss: ["5.1.1"] + - nist_800_53: ["SI.3"] + - tsc: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy -> 3' + + - id: 26234 + title: "Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'." + description: 'The "Do not apply during periodic background processing" option prevents the system from updating affected policies in the background while the computer is in use. When background updates are disabled, policy changes will not take effect until the next user logon or system restart. The recommended state for this setting is: Enabled: FALSE (unchecked).' + rationale: "Setting this option to false (unchecked) will ensure that domain policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Do not apply during periodic background processing option to FALSE (unchecked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy -> 0' + + - id: 26235 + title: "Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'." + description: 'The "Process even if the Group Policy objects have not changed" option updates and reapplies policies even if the policies have not changed. The recommended state for this setting is: Enabled: TRUE (checked).' + rationale: "Setting this option to true (checked) will ensure unauthorized changes that might have been configured locally are forced to match the domain-based Group Policy settings again." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Process even if the Group Policy objects have not changed option to TRUE (checked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.3"] + - pci_dss: ["11.5.1"] + - tsc: ["PI1.4", "PI1.5", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges -> 0' + + - id: 26236 + title: "Ensure 'Continue experiences on this device' is set to 'Disabled'." + description: "This policy setting determines whether the Windows device is allowed to participate in cross-device experiences (continue experiences). The recommended state for this setting is: Disabled." + rationale: "A cross-device experience is when a system can access app and send messages to other devices. In an enterprise managed environment only trusted systems should be communicating within the network. Access to any other system should be prohibited." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Continue experiences on this device. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableCdp' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableCdp -> 0' + + - id: 26237 + title: "Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'." + description: "This policy setting prevents Group Policy from being updated while the computer is in use. This policy setting applies to Group Policy for computers, users and Domain Controllers. The recommended state for this setting is: Disabled." + rationale: "This setting ensures that group policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Turn off background refresh of Group Policy. Note: This Group Policy path is provided by the Group Policy template GroupPolicy.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.21.5"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy' + + - id: 26238 + title: "Ensure 'Turn off access to the Store' is set to 'Enabled'." + description: "This policy setting specifies whether to use the Store service for finding an application to open a file with an unhandled file type or protocol association. When a user opens a file type or protocol that is not associated with any applications on the computer, the user is given the choice to select a local application or use the Store service to find an application. The recommended state for this setting is: Enabled." + rationale: "The Store service is a retail outlet built into Windows, primarily for consumer use. In an enterprise managed environment the IT department should be managing the installation of all applications to reduce the risk of the installation of vulnerable software." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off access to the Store. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ICM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.22.1.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoUseStoreOpenWith -> 1' + + - id: 26239 + title: "Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'." + description: "This policy setting controls whether the computer can download print driver packages over HTTP. To set up HTTP printing, printer drivers that are not available in the standard operating system installation might need to be downloaded over HTTP. The recommended state for this setting is: Enabled." + rationale: "Users might download drivers that include malicious code." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off downloading of print drivers over HTTP. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.2"] + - cis_csc: ["2.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> 1' + + - id: 26240 + title: "Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'." + description: "This setting turns off data sharing from the handwriting recognition personalization tool. The handwriting recognition personalization tool enables Tablet PC users to adapt handwriting recognition to their own writing style by providing writing samples. The tool can optionally share user writing samples with Microsoft to improve handwriting recognition in future versions of Windows. The tool generates reports and transmits them to Microsoft over a secure connection. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting personalization data sharing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ShapeCollector.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.22.1.3"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> 1' + + - id: 26241 + title: "Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'." + description: "Turns off the handwriting recognition error reporting tool. The handwriting recognition error reporting tool enables users to report errors encountered in Tablet PC Input Panel. The tool generates error reports and transmits them to Microsoft over a secure connection. Microsoft uses these error reports to improve handwriting recognition in future versions of Windows. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting recognition error reporting. Note: This Group Policy path is provided by the Group Policy template InkWatson.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> 1' + + - id: 26242 + title: "Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'." + description: "This policy setting specifies whether the Internet Connection Wizard can connect to Microsoft to download a list of Internet Service Providers (ISPs). The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> 1' + + - id: 26243 + title: "Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'." + description: "This policy setting controls whether Windows will download a list of providers for the Web publishing and online ordering wizards. The recommended state for this setting is: Enabled." + rationale: "Although the risk is minimal, enabling this setting will reduce the possibility of a user unknowingly downloading malicious content through this feature." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet download for Web publishing and online ordering wizards. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> 1' + + - id: 26244 + title: "Ensure 'Turn off printing over HTTP' is set to 'Enabled'." + description: "This policy setting allows you to disable the client computer's ability to print over HTTP, which allows the computer to print to printers on the intranet as well as the Internet. The recommended state for this setting is: Enabled. Note: This control affects printing over both HTTP and HTTPS." + rationale: "Information that is transmitted over HTTP through this capability is not protected and can be intercepted by malicious users. For this reason, it is not often used in enterprise managed environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off printing over HTTP. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> 1' + + - id: 26245 + title: "Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'." + description: "This policy setting specifies whether the Windows Registration Wizard connects to Microsoft.com for online registration. The recommended state for this setting is: Enabled." + rationale: "Users in an enterprise managed environment should not be registering their own copies of Windows, providing their own PII in the process." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Registration if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> 1' + + - id: 26246 + title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'." + description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches. The recommended state for this setting is: Enabled." + rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for. This risk is very low because even if this setting is enabled users still must submit search queries to the desired search engine in order to perform searches." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Search Companion content file updates. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' + + - id: 26247 + title: 'Ensure ''Turn off the "Order Prints" picture task'' is set to ''Enabled''.' + description: 'This policy setting specifies whether the "Order Prints Online" task is available from Picture Tasks in Windows folders. The Order Prints Online Wizard is used to download a list of providers and allow users to order prints online. The recommended state for this setting is: Enabled.' + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Order Prints\" picture task. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.10"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> 1' + + - id: 26248 + title: 'Ensure ''Turn off the "Publish to Web" task for files and folders'' is set to ''Enabled''.' + description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders. The Web Publishing wizard is used to download a list of providers and allow users to publish content to the Web. The recommended state for this setting is: Enabled." + rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Publish to Web\" task for files and folders. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.11"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' + + - id: 26249 + title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'." + description: "This policy setting specifies whether the Windows Customer Experience Improvement Program can collect anonymous information about how Windows is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to improve features that are most used and to detect flaws so that they can be corrected more quickly. Enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the Windows Messenger Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.12"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' + + - id: 26250 + title: "Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'." + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> 0' + + - id: 26251 + title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'." + description: "This policy setting controls whether or not errors are reported to Microsoft. Error Reporting is used to report information about a system or application that has failed or has stopped responding and is used to improve the quality of the product. The recommended state for this setting is: Enabled." + rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Error Reporting. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.14"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' + + - id: 26252 + title: "Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic'." + description: "This policy setting allows you to set support for Kerberos to attempt authentication using the certificate for the device to the domain. Support for device authentication using certificate will require connectivity to a DC in the device account domain which supports certificate authentication for computer accounts. The recommended state for this setting is: Enabled: Automatic." + rationale: "Having stronger device authentication with the use of certificates is strongly encouraged over standard username and password authentication. Having this set to Automatic will allow certificate based authentication to be used whenever possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Automatic: Computer Configuration\\Policies\\Administrative Templates\\System\\Kerberos\\Support device authentication using certificate. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Kerberos.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.25.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitBehavior -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitEnabled -> 1' + + - id: 26253 + title: "Ensure 'Enumeration policy for external devices incompatible with Kernel DMA Protection' is set to 'Enabled: Block All'." + description: "This policy is intended to provide additional security against external DMA-capable devices. It allows for more control over the enumeration of external DMA-capable devices that are not compatible with DMA Remapping/device memory isolation and sandboxing. The recommended state for this setting is: Enabled: Block All. Note: This policy does not apply to 1394, PCMCIA or ExpressCard devices. The protection also only applies to Windows 10 R1803 or higher, and also requires a UEFI BIOS to function. Note #2: More information on this feature is available at this link: Kernel DMA Protection for Thunderbolt™ 3 (Windows 10) | Microsoft Docs." + rationale: "Device memory sandboxing allows the OS to leverage the I/O Memory Management Unit (IOMMU) of a device to block unpermitted I/O, or memory access, by the peripheral." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block All: Computer Configuration\\Policies\\Administrative Templates\\System\\Kernel DMA Protection\\Enumeration policy for external devices incompatible with Kernel DMA Protection. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DmaGuard.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.26.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Kernel DMA Protection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Kernel DMA Protection -> DeviceEnumerationPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Kernel DMA Protection -> DeviceEnumerationPolicy -> 0' + + - id: 26254 + title: "Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'." + description: "This policy prevents automatic copying of user input methods to the system account for use on the sign-in screen. The user is restricted to the set of input methods that are enabled in the system account. The recommended state for this setting is: Enabled." + rationale: "This is a way to increase the security of the system account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Locale Services\\Disallow copying of user input methods to the system account for sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.27.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> 1' + + - id: 26255 + title: "Ensure 'Block user from showing account details on sign-in' is set to 'Enabled'." + description: "This policy prevents the user from showing account details (email address or user name) on the sign-in screen. The recommended state for this setting is: Enabled." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the workstation through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Block user from showing account details on sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockUserFromShowingAccountDetailsOnSignin' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockUserFromShowingAccountDetailsOnSignin -> 1' + + - id: 26256 + title: "Ensure 'Do not display network selection UI' is set to 'Enabled'." + description: "This policy setting allows you to control whether anyone can interact with available networks UI on the logon screen. The recommended state for this setting is: Enabled." + rationale: "An unauthorized user could disconnect the PC from the network or can connect the PC to other available networks without signing into Windows." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not display network selection UI. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI -> 1' + + - id: 26257 + title: "Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'." + description: "This policy setting prevents connected users from being enumerated on domain-joined computers. The recommended state for this setting is: Enabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not enumerate connected users on domain-joined computers. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.3"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers -> 1' + + - id: 26258 + title: "Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled'." + description: "This policy setting allows local users to be enumerated on domain-joined computers. The recommended state for this setting is: Disabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Enumerate local users on domain-joined computers. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers -> 0' + + - id: 26259 + title: "Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled'." + description: "This policy setting allows you to prevent app notifications from appearing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "App notifications might display sensitive business or personal data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off app notifications on the lock screen. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications -> 1' + + - id: 26260 + title: "Ensure 'Turn off picture password sign-in' is set to 'Enabled'." + description: "This policy setting allows you to control whether a domain user can sign in using a picture password. The recommended state for this setting is: Enabled. Note: If the picture password feature is permitted, the user's domain password is cached in the system vault when using it." + rationale: "Picture passwords bypass the requirement for a typed complex password. In a shared work environment, a simple shoulder surf where someone observed the on-screen gestures would allow that person to gain access to the system without the need to know the complex password. Vertical monitor screens with an image are much more visible at a distance than horizontal key strokes, increasing the likelihood of a successful observation of the mouse gestures." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off picture password sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.6"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword -> 1' + + - id: 26261 + title: "Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'." + description: "This policy setting allows you to control whether a domain user can sign in using a convenience PIN. In Windows 10, convenience PIN was replaced with Passport, which has stronger security properties. To configure Passport for domain users, use the policies under Computer Configuration\\Administrative Templates\\Windows Components\\Microsoft Passport for Work. Note: The user's domain password will be cached in the system vault when using this feature. The recommended state for this setting is: Disabled." + rationale: "A PIN is created from a much smaller selection of characters than a password, so in most cases a PIN will be much less robust than a password." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn on convenience PIN sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn on PIN sign-in, but it was renamed starting with the Windows 10 Release 1511 Administrative Templates." + compliance: + - cis: ["18.8.28.7"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon -> 0' + + - id: 26262 + title: "Ensure 'Allow Clipboard synchronization across devices' is set to 'Disabled'." + description: "This setting determines whether Clipboard contents can be synchronized across devices. The recommended state for this setting is: Disabled." + rationale: "In high security environments, clipboard data should stay local to the system and not synced across devices, as it may contain very sensitive information that must be contained locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\OS Policies\\Allow Clipboard synchronization across devices. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template OSPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.31.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowCrossDeviceClipboard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowCrossDeviceClipboard -> 0' + + - id: 26263 + title: "Ensure 'Allow upload of User Activities' is set to 'Disabled'." + description: "This policy setting determines whether published User Activities can be uploaded to the cloud. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\OS Policies\\Allow upload of User Activities. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template OSPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1803 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.31.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> UploadUserActivities' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> UploadUserActivities -> 0' + + - id: 26264 + title: "Ensure 'Allow network connectivity during connected-standby (on battery)' is set to 'Disabled'." + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, on battery and in a sleep state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (on battery). Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.34.6.1"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> DCSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> DCSettingIndex -> 0' + + - id: 26265 + title: "Ensure 'Allow network connectivity during connected-standby (plugged in)' is set to 'Disabled'." + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, plugged in and in a sleep state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (plugged in). Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.34.6.2"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> ACSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> ACSettingIndex -> 0' + + - id: 26266 + title: "Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'." + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (on battery). Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.34.6.5"] + - cis_csc: ["4.3"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex -> 1' + + - id: 26267 + title: "Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'." + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (plugged in). Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.34.6.6"] + - cis_csc: ["4.3"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex -> 1' + + - id: 26268 + title: "Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'." + description: "This policy setting allows you to turn on or turn off Offer (Unsolicited) Remote Assistance on this computer. Help desk and support personnel will not be able to proactively offer assistance, although they can still respond to user assistance requests. The recommended state for this setting is: Disabled." + rationale: "A user might be tricked and accept an unsolicited Remote Assistance offer from a malicious user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Offer Remote Assistance. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.36.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited -> 0' + + - id: 26269 + title: "Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'." + description: "This policy setting allows you to turn on or turn off Solicited (Ask for) Remote Assistance on this computer. The recommended state for this setting is: Disabled." + rationale: "There is slight risk that a rogue administrator will gain access to another user's desktop session, however, they cannot connect to a user's computer unannounced or control it without permission from the user. When an expert tries to connect, the user can still choose to deny the connection or give the expert view-only privileges. The user must explicitly click the Yes button to allow the expert to remotely control the workstation." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Solicited Remote Assistance. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.36.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp -> 0' + + - id: 26270 + title: "Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled'." + description: "This policy setting controls whether RPC clients authenticate with the Endpoint Mapper Service when the call they are making contains authentication information. The Endpoint Mapper Service on computers running Windows NT4 (all service packs) cannot process authentication information supplied in this manner. This policy setting can cause a specific issue with 1-way forest trusts if it is applied to the trusting domain DCs (see Microsoft KB3073942), so we do not recommend applying it to Domain Controllers. Note: This policy will not in effect until the system is rebooted. The recommended state for this setting is: Enabled." + rationale: "Anonymous access to RPC services could result in accidental disclosure of information to unauthenticated users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Enable RPC Endpoint Mapper Client Authentication. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RPC.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.37.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution -> 1' + + - id: 26271 + title: "Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated'." + description: 'This policy setting controls how the RPC server runtime handles unauthenticated RPC clients connecting to RPC servers. This policy setting impacts all RPC applications. In a domain environment this policy setting should be used with caution as it can impact a wide range of functionality including group policy processing itself. Reverting a change to this policy setting can require manual intervention on each affected machine. This policy setting should never be applied to a Domain Controller. A client will be considered an authenticated client if it uses a named pipe to communicate with the server or if it uses RPC Security. RPC Interfaces that have specifically requested to be accessible by unauthenticated clients may be exempt from this restriction, depending on the selected value for this policy setting. -- "None" allows all RPC clients to connect to RPC Servers running on the machine on which the policy setting is applied. -- "Authenticated" allows only authenticated RPC Clients (per the definition above) to connect to RPC Servers running on the machine on which the policy setting is applied. Exemptions are granted to interfaces that have requested them. -- "Authenticated without exceptions" allows only authenticated RPC Clients (per the definition above) to connect to RPC Servers running on the machine on which the policy setting is applied. No exceptions are allowed. This value has the potential to cause serious problems and is not recommended.'' Note: This policy setting will not be applied until the system is rebooted. The recommended state for this setting is: Enabled: Authenticated.' + rationale: "Unauthenticated RPC communication can create a security vulnerability." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Authenticated: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Restrict Unauthenticated RPC clients. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RPC.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.37.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients -> 1' + + - id: 26272 + title: "Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'." + description: "This policy setting configures Microsoft Support Diagnostic Tool (MSDT) interactive communication with the support provider. MSDT gathers diagnostic data for analysis by support professionals. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Microsoft Support Diagnostic Tool\\Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSDT.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.48.5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> 0' + + - id: 26273 + title: "Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'." + description: "This policy setting specifies whether to enable or disable tracking of responsiveness events. The recommended state for this setting is: Disabled." + rationale: "When enabled the aggregated data of a given event will be transmitted to Microsoft. The option exists to restrict this feature for a specific user, set the consent level, and designate specific programs for which error reports could be sent. However, centrally restricting the ability to execute PerfTrack to limit the potential for unauthorized or undesired usage, data leakage, or unintentional communications is highly recommended." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Windows Performance PerfTrack\\Enable/Disable PerfTrack. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PerformancePerftrack.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.48.11.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> 0' + + - id: 26274 + title: "Ensure 'Turn off the advertising ID' is set to 'Enabled'." + description: "This policy setting turns off the advertising ID, preventing apps from using the ID for experiences across apps. The recommended state for this setting is: Enabled." + rationale: "Tracking user activity for advertising purposes, even anonymously, may be a privacy concern. In an enterprise managed environment, applications should not need or require tracking for targeted advertising." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\User Profiles\\Turn off the advertising ID. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template UserProfiles.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.50.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> 1' + + - id: 26275 + title: "Ensure 'Enable Windows NTP Client' is set to 'Enabled'." + description: "This policy setting specifies whether the Windows NTP Client is enabled. Enabling the Windows NTP Client allows your computer to synchronize its computer clock with other NTP servers. You might want to disable this service if you decide to use a third-party time provider. The recommended state for this setting is: Enabled." + rationale: "A reliable and accurate account of time is important for a number of services and security requirements, including but not limited to distributed applications, authentication services, multi-user databases and logging services. The use of an NTP client (with secure operation) establishes functional accuracy and is a focal point when reviewing security relevant events." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Client. Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.53.1.1"] + - cis_csc: ["8.4"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> 1' + + - id: 26276 + title: "Ensure 'Enable Windows NTP Server' is set to 'Disabled'." + description: "This policy setting allows you to specify whether the Windows NTP Server is enabled. The recommended state for this setting is: Disabled." + rationale: "The configuration of proper time synchronization is critically important in an enterprise managed environment both due to the sensitivity of Kerberos authentication timestamps and also to ensure accurate security logging." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Server. Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.53.1.2"] + - cis_csc: ["8.4"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled -> 0' + + - id: 26277 + title: "Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled'." + description: "Manages a Windows app's ability to share data between users who have installed the app. Data is shared through the SharedLocal folder. This folder is available through the Windows.Storage API. The recommended state for this setting is: Disabled." + rationale: "Users of a system could accidentally share sensitive data with other users on the same system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Package Deployment\\Allow a Windows app to share application data between users. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppxPackageManager.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.4.1"] + - cis_csc: ["3.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager -> AllowSharedLocalAppData' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager -> AllowSharedLocalAppData -> 0' + + - id: 26278 + title: "Ensure 'Prevent non-admin users from installing packaged Windows apps' is set to 'Enabled'." + description: "This setting manages non-Administrator users' ability to install Windows app packages. The recommended state for this setting is: Enabled." + rationale: "In a corporate managed environment, application installations should be managed centrally by IT staff, not by end users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Package Deployment\\Prevent non-admin users from installing packaged Windows apps. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppxPackageManager.admx/adml that is included with the Microsoft Windows 10 Release 2004 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.4.2"] + - cis_csc: ["2.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Appx' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Appx -> BlockNonAdminUserInstall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Appx -> BlockNonAdminUserInstall -> 1' + + - id: 26279 + title: "Ensure 'Let Windows apps activate with voice while the system is locked' is set to 'Enabled: Force Deny'." + description: "This policy setting specifies whether Windows apps can be activated by voice (apps and Cortana) while the system is locked. The recommended state for this setting is: Enabled: Force Deny." + rationale: "Access to any computer resource should not be allowed when the device is locked." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Force Deny: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Privacy\\Let Windows apps activate with voice while the system is locked. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppPrivacy.admx/adml that is included with the Microsoft Windows 10 Release 1903 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy -> LetAppsActivateWithVoiceAboveLock' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy -> LetAppsActivateWithVoiceAboveLock -> 2' + + - id: 26280 + title: "Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'." + description: "This policy setting lets you control whether Microsoft accounts are optional for Windows Store apps that require an account to sign in. This policy only affects Windows Store apps that support it. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting allows an organization to use their enterprise user accounts instead of using their Microsoft accounts when accessing Windows store apps. This provides the organization with greater control over relevant credentials. Microsoft accounts cannot be centrally managed and as such enterprise credential security policies cannot be applied to them, which could put any information accessed by using Microsoft accounts at risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App runtime\\Allow Microsoft accounts to be optional. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppXRuntime.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.6.1"] + - cis_csc: ["5.6"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional -> 1' + + - id: 26281 + title: "Ensure 'Block launching Universal Windows apps with Windows Runtime API access from hosted content.' is set to 'Enabled'." + description: "This policy setting controls whether Microsoft Store apps with Windows Runtime API access directly from web content can be launched. The recommended state for this setting is: Enabled." + rationale: "Blocking apps from the web with direct access to the Windows API can prevent malicious apps from being run on a system. Only system administrators should be installing approved applications." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App runtime\\Block launching Universal Windows apps with Windows Runtime API access from hosted content. Note: A reboot may be required after the setting is applied. Note #2: This Group Policy path may not exist by default. It is provided by the Group Policy template AppXRuntime.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer). Note #3: In older Microsoft Windows Administrative Templates, this setting was initially named Block launching Windows Store apps with Windows Runtime API access from hosted content., but it was renamed starting with the Windows 10 Release 1803 Administrative Templates" + compliance: + - cis: ["18.9.6.2"] + - cis_csc: ["2.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> BlockHostedAppAccessWinRT' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> BlockHostedAppAccessWinRT -> 1' + + - id: 26282 + title: "Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'." + description: "This policy setting disallows AutoPlay for MTP devices like cameras or phones. The recommended state for this setting is: Enabled." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Disallow Autoplay for non-volume devices. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.8.1"] + - cis_csc: ["10.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume -> 1' + + - id: 26283 + title: "Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'." + description: "This policy setting sets the default behavior for Autorun commands. Autorun commands are generally stored in autorun.inf files. They often launch the installation program or other routines. The recommended state for this setting is: Enabled: Do not execute any autorun commands." + rationale: "Prior to Windows Vista, when media containing an autorun command is inserted, the system will automatically execute the program without user intervention. This creates a major security concern as code may be executed without user's knowledge. The default behavior starting with Windows Vista is to prompt the user whether autorun command is to be run. The autorun command is represented as a handler in the Autoplay dialog." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Do not execute any autorun commands: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Set the default behavior for AutoRun. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.8.2"] + - cis_csc: ["10.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun -> 1' + + - id: 26284 + title: "Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'." + description: "Autoplay starts to read from a drive as soon as you insert media in the drive, which causes the setup file for programs or audio media to start immediately. An attacker could use this feature to launch a program to damage the computer or data on the computer. Autoplay is disabled by default on some removable drive types, such as floppy disk and network drives, but not on CD-ROM drives. Note: You cannot use this policy setting to enable Autoplay on computer drives in which it is disabled by default, such as floppy disk and network drives. The recommended state for this setting is: Enabled: All drives." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: All drives: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Turn off Autoplay. Note: This Group Policy path is provided by the Group Policy template AutoPlay.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.8.3"] + - cis_csc: ["10.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun -> 255' + + - id: 26285 + title: "Ensure 'Configure enhanced anti-spoofing' is set to 'Enabled'." + description: "This policy setting determines whether enhanced anti-spoofing is configured for devices which support it. The recommended state for this setting is: Enabled." + rationale: "Enterprise managed environments are now supporting a wider range of mobile devices, increasing the security on these devices will help protect against unauthorized access on your network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Biometrics\\Facial Features\\Configure enhanced anti-spoofing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Biometrics.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Windows 10 Release 1511 and Windows 10 Release 1607 & Server 2016 Administrative Templates, this setting was initially named Use enhanced anti-spoofing when available. It was renamed to Configure enhanced anti-spoofing starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.10.1.1"] + - cis_csc: ["10.5"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures -> EnhancedAntiSpoofing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures -> EnhancedAntiSpoofing -> 1' + + - id: 26286 + title: "Ensure 'Allow Use of Camera' is set to 'Disabled'." + description: "This policy setting controls whether the use of Camera devices on the machine are permitted. The recommended state for this setting is: Disabled." + rationale: "Cameras in a high security environment can pose serious privacy and data exfiltration risks - they should be disabled to help mitigate that risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Camera\\Allow Use of Camera. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Camera.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.12.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera -> AllowCamera' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera -> AllowCamera -> 0' + + - id: 26287 + title: "Ensure 'Turn off cloud consumer account state content' is set to 'Enabled'." + description: "This policy setting determines whether cloud consumer account state content is allowed in all Windows experiences. The recommended state for this setting is: Enabled." + rationale: "The use of consumer accounts in an enterprise managed environment is not good security practice as it could lead to possible data leakage." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off cloud consumer account state content. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.14.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableConsumerAccountStateContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableConsumerAccountStateContent -> 1' + + - id: 26288 + title: "Ensure 'Turn off cloud optimized content' is set to 'Enabled'." + description: "This policy setting turns off cloud optimized content in all Windows experiences. The recommended state for this setting is: Enabled." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off cloud optimized content. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 10 Release 20H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.14.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableCloudOptimizedContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableCloudOptimizedContent -> 1' + + - id: 26289 + title: "Ensure 'Turn off Microsoft consumer experiences' is set to 'Enabled'." + description: "This policy setting turns off experiences that help consumers make the most of their devices and Microsoft account. The recommended state for this setting is: Enabled. Note: Per Microsoft TechNet, this policy setting only applies to Windows 10 Enterprise and Windows 10 Education editions." + rationale: "Having apps silently install in an enterprise managed environment is not good security practice - especially if the apps send data back to a 3rd party." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off Microsoft consumer experiences. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.14.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableWindowsConsumerFeatures' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableWindowsConsumerFeatures -> 1' + + - id: 26290 + title: "Ensure 'Require pin for pairing' is set to 'Enabled: First Time' OR 'Enabled: Always'." + description: "This policy setting controls whether or not a PIN is required for pairing to a wireless display device. The recommended state for this setting is: Enabled: First Time OR Enabled: Always." + rationale: "If this setting is not configured or disabled then a PIN would not be required when pairing wireless display devices to the system, increasing the risk of unauthorized use." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: First Time OR Enabled: Always: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Connect\\Require pin for pairing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WirelessDisplay.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). The new Choose one of the following actions sub-option was later added as of the Windows 10 Release 1809 Administrative Templates. Choosing Enabled in the older templates is the equivalent of choosing Enabled: First Time in the newer templates." + compliance: + - cis: ["18.9.15.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing -> r:^1$|^2$' + + - id: 26291 + title: "Ensure 'Do not display the password reveal button' is set to 'Enabled'." + description: "This policy setting allows you to configure the display of the password reveal button in password entry user experiences. The recommended state for this setting is: Enabled." + rationale: "This is a useful feature when entering a long and complex password, especially when using a touchscreen. The potential risk is that someone else may see your password while surreptitiously observing your screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Do not display the password reveal button. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredUI.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.1"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal -> 1' + + - id: 26292 + title: "Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'." + description: "This policy setting controls whether administrator accounts are displayed when a user attempts to elevate a running application. The recommended state for this setting is: Disabled." + rationale: "Users could see the list of administrator accounts, making it slightly easier for a malicious user who has logged onto a console session to try to crack the passwords of those accounts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Enumerate administrator accounts on elevation. Note: This Group Policy path is provided by the Group Policy template CredUI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.16.2"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators -> 0' + + - id: 26293 + title: "Ensure 'Prevent the use of security questions for local accounts' is set to 'Enabled'." + description: "This policy setting controls whether security questions can be used to reset local account passwords. The security question feature does not apply to domain accounts, only local accounts on the workstation. The recommended state for this setting is: Enabled." + rationale: "Users could establish security questions that are easily guessed or sleuthed by observing the user’s social media accounts, making it easier for a malicious actor to change the local user account password and gain access to the computer as that user account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Prevent the use of security questions for local accounts. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredUI.admx/adml that is included with the Microsoft Windows 10 Release 1903 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> NoLocalPasswordResetQuestions' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> NoLocalPasswordResetQuestions -> 1' + + - id: 26294 + title: "Ensure 'Allow Diagnostic Data' is set to 'Enabled: Diagnostic data off (not recommended)' or 'Enabled: Send required diagnostic data'." + description: "This policy setting determines the amount of diagnostic and usage data reported to Microsoft: - A value of (0) Diagnostic data off (not recommended). Using this value, no diagnostic data is sent from the device. This value is only supported on Enterprise, Education, and Server editions. If you choose this setting, devices in your organization will still be secure. - A value of (1) Send required diagnostic data. This is the minimum diagnostic data necessary to keep Windows secure, up to date, and performing as expected. Using this value disables the Optional diagnostic data control in the Settings app. - A value of (3)Send optional diagnostic data. Additional diagnostic data is collected that helps us to detect, diagnose and fix issues, as well as make product improvements. Required diagnostic data will always be included when you choose to send optional diagnostic data. Optional diagnostic data can also include diagnostic log files and crash dumps. Use the Limit Dump Collection and the Limit Diagnostic Log Collection policies for more granular control of what optional diagnostic data is sent. Windows telemetry settings apply to the Windows operating system and some first party apps. This setting does not apply to third party apps running on Windows 10/11. The recommended state for this setting is: Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data. Note: If your organization relies on Windows Update, the minimum recommended setting is Required diagnostic data. Because no Windows Update information is collected when diagnostic data is off, important information about update failures is not sent. Microsoft uses this information to fix the causes of those failures and improve the quality of updates. Note #2: The Configure diagnostic data opt-in settings user interface group policy can be used to prevent end users from changing their data collection settings. Note #3: Enhanced diagnostic data setting is not available on Windows 11 and Windows Server 2022 and has been replaced with policies that can control the amount of optional diagnostic data that is sent. For more information on these settings visit Manage diagnostic data using Group Policy and MDM" + rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Allow Diagnostic Data. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow Telemetry, but it was renamed to Allow Diagnostic Data starting with the Windows 11 Release 21H2 Administrative Templates." + compliance: + - cis: ["18.9.17.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry -> r:^0$|^1$' + + - id: 26295 + title: "Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage'." + description: "This policy setting controls whether the Connected User Experience and Telemetry service can automatically use an authenticated proxy to send data back to Microsoft. The recommended state for this setting is: Enabled: Disable Authenticated Proxy usage." + rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Authenticated Proxy usage: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableEnterpriseAuthProxy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableEnterpriseAuthProxy -> 1' + + - id: 26296 + title: "Ensure 'Disable OneSettings Downloads' is set to 'Enabled'." + description: "This policy setting controls whether Windows attempts to connect with the OneSettings service to download configuration settings. The recommended state for this setting is: Enabled." + rationale: "Sending data to a 3rd party vendor is a security concern and should only be done on an as-needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Disable OneSettings Downloads. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableOneSettingsDownloads' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableOneSettingsDownloads -> 1' + + - id: 26297 + title: "Ensure 'Do not show feedback notifications' is set to 'Enabled'." + description: "This policy setting allows an organization to prevent its devices from showing feedback questions from Microsoft. The recommended state for this setting is: Enabled." + rationale: "Users should not be sending any feedback to 3rd party vendors in an enterprise managed environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Do not show feedback notifications. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template FeedbackNotifications.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DoNotShowFeedbackNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DoNotShowFeedbackNotifications -> 1' + + - id: 26298 + title: "Ensure 'Enable OneSettings Auditing' is set to 'Enabled'." + description: "This policy setting controls whether Windows records attempts to connect with the OneSettings service to the Operational EventLog. The recommended state for this setting is: Enabled." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Enable OneSettings Auditing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.5"] + - cis_csc: ["8.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> EnableOneSettingsAuditing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> EnableOneSettingsAuditing -> 1' + + - id: 26299 + title: "Ensure 'Limit Diagnostic Log Collection' is set to 'Enabled'." + description: "This policy setting controls whether additional diagnostic logs are collected when more information is needed to troubleshoot a problem on the device. The recommended state for this setting is: Enabled. Note: Diagnostic logs are only sent when the device has been configured to send optional diagnostic data. Diagnostic data is limited with recommendation Allow Diagnostic Data is set to Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data to send only basic information." + rationale: "Sending data to a 3rd-party vendor is a security concern and should only be done on an as-needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Limit Diagnostic Log Collection. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDiagnosticLogCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDiagnosticLogCollection -> 1' + + - id: 26300 + title: "Ensure 'Limit Dump Collection' is set to 'Enabled'." + description: "This policy setting limits the type of dumps that can be collected when more information is needed to troubleshoot a problem. The recommended state for this setting is: Enabled. Note: Dumps are only sent when the device has been configured to send optional diagnostic data. Diagnostic data is limited with recommendation Ensure Allow Diagnostic Data is set to Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data to send only basic information." + rationale: "Sending data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Limit Dump Collection. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.7"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDumpCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDumpCollection -> 1' + + - id: 26301 + title: "Ensure 'Toggle user control over Insider builds' is set to 'Disabled'." + description: 'This policy setting determines whether users can access the Insider build controls in the Advanced Options for Windows Update. These controls are located under "Get Insider builds," and enable users to make their devices available for downloading and installing Windows preview software. The recommended state for this setting is: Disabled. Note: This policy setting applies only to devices running Windows 10 Pro or Windows 10 Enterprise, up until Release 1703. For Release 1709 or newer, Microsoft encourages using the Manage preview builds setting (recommendation title ‘Manage preview builds’). We have kept this setting in the benchmark to ensure that any older builds of Windows 10 in the environment are still enforced.' + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Toggle user control over Insider builds. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AllowBuildPreview.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.17.8"] + - cis_csc: ["2.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> AllowBuildPreview' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> AllowBuildPreview -> 0' + + - id: 26302 + title: "Ensure 'Download Mode' is NOT set to 'Enabled: Internet'." + description: "This policy setting specifies the download method that Delivery Optimization can use in downloads of Windows Updates, Apps and App updates. The following methods are supported: - 0 = HTTP only, no peering. - 1 = HTTP blended with peering behind the same NAT. - 2 = HTTP blended with peering across a private group. Peering occurs on devices in the same Active Directory Site (if exist) or the same domain by default. When this option is selected, peering will cross NATs. To create a custom group use Group ID in combination with Mode 2. - 3 = HTTP blended with Internet Peering. - 99 = Simple download mode with no peering. Delivery Optimization downloads using HTTP only and does not attempt to contact the Delivery Optimization cloud services. - 100 = Bypass mode. Do not use Delivery Optimization and use BITS instead. The recommended state for this setting is any value EXCEPT: Enabled: Internet (3). Note: The default on all SKUs other than Enterprise, Enterprise LTSB or Education is Enabled: Internet (3), so on other SKUs, be sure to set this to a different value." + rationale: "Due to privacy concerns and security risks, updates should only be downloaded directly from Microsoft, or from a trusted machine on the internal network that received its updates from a trusted source and approved by the network administrator." + remediation: "To establish the recommended configuration via GP, set the following UI path to any value other than Enabled: Internet (3): Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Delivery Optimization\\Download Mode. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeliveryOptimization.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.18.1"] + - cis_csc: ["7.3"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization -> DODownloadMode -> r:^3$' + + - id: 26303 + title: "Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Control Event Log behavior when the log file reaches its maximum size. Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.1.1"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention -> 0' + + - id: 26304 + title: "Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Specify the maximum log file size (KB). Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.1.2"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> n:^(\d+) compare >= 32768' + + - id: 26305 + title: "Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Control Event Log behavior when the log file reaches its maximum size. Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.2.1"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention -> 0' + + - id: 26306 + title: "Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 196,608 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 196,608 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Specify the maximum log file size (KB). Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.2.2"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> n:^(\d+) compare >= 196608' + + - id: 26307 + title: "Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Control Event Log behavior when the log file reaches its maximum size. Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.3.1"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention -> 0' + + - id: 26308 + title: "Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Specify the maximum log file size (KB). Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.3.2"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> n:^(\d+) compare >= 32768' + + - id: 26309 + title: "Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Control Event Log behavior when the log file reaches its maximum size. Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.4.1"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention -> 0' + + - id: 26310 + title: "Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Specify the maximum log file size (KB). Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.27.4.2"] + - cis_csc: ["8.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> n:^(\d+) compare >= 32768' + + - id: 26311 + title: "Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'." + description: "Disabling Data Execution Prevention can allow certain legacy plug-in applications to function without terminating Explorer. The recommended state for this setting is: Disabled. Note: Some legacy plug-in applications and other software may not function with Data Execution Prevention and will require an exception to be defined for that specific plug- in/software." + rationale: "Data Execution Prevention is an important security feature supported by Explorer that helps to limit the impact of certain types of malware." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off Data Execution Prevention for Explorer. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Explorer.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.31.2"] + - cis_csc: ["10.5"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention -> 0' + + - id: 26312 + title: "Ensure 'Turn off heap termination on corruption' is set to 'Disabled'." + description: "Without heap termination on corruption, legacy plug-in applications may continue to function when a File Explorer session has become corrupt. Ensuring that heap termination on corruption is active will prevent this. The recommended state for this setting is: Disabled." + rationale: "Allowing an application to function after its session has become corrupt increases the risk posture to the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off heap termination on corruption. Note: This Group Policy path is provided by the Group Policy template Explorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.31.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption -> 0' + + - id: 26313 + title: "Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'." + description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." + rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off shell protocol protected mode. Note: This Group Policy path is provided by the Group Policy template WindowsExplorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.31.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior -> 0' + + - id: 26314 + title: "Ensure 'Prevent the computer from joining a homegroup' is set to 'Enabled'." + description: "By default, users can add their computer to a HomeGroup on a home network. The recommended state for this setting is: Enabled. Note: The HomeGroup feature is available in all workstation releases of Windows from Windows 7 through Windows 10 Release 1709. Microsoft removed the feature completely starting with Windows 10 Release 1803. However, if your environment still contains any Windows 10 Release 1709 (or older) workstations, then this setting remains important to disable HomeGroup on those systems." + rationale: "While resources on a domain-joined computer cannot be shared with a HomeGroup, information from the domain-joined computer can be leaked to other computers in the HomeGroup." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\HomeGroup\\Prevent the computer from joining a homegroup. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sharing.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.36.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HomeGroup' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HomeGroup -> DisableHomeGroup' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HomeGroup -> DisableHomeGroup -> 1' + + - id: 26315 + title: "Ensure 'Turn off location' is set to 'Enabled'." + description: "This policy setting turns off the location feature for the computer. The recommended state for this setting is: Enabled." + rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Turn off location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sensors.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.41.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> 1' + + - id: 26316 + title: "Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled'." + description: "This policy setting allows backup and restore of cellular text messages to Microsoft's cloud services. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Messaging\\Allow Message Service Cloud Sync. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Messaging.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.45.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging -> AllowMessageSync' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging -> AllowMessageSync -> 0' + + - id: 26317 + title: "Ensure 'Block all consumer Microsoft account user authentication' is set to 'Enabled'." + description: "This setting determines whether applications and services on the device can utilize new consumer Microsoft account authentication via the Windows OnlineID and WebAccountManager APIs. The recommended state for this setting is: Enabled." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used on their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft accounts\\Block all consumer Microsoft account user authentication. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSAPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.46.1"] + - cis_csc: ["5.3"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount -> DisableUserAuth' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount -> DisableUserAuth -> 1' + + - id: 26318 + title: "Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled'." + description: "This policy setting configures a local override for the configuration to join Microsoft Active Protection Service (MAPS), which Microsoft renamed to Windows Defender Antivirus Cloud Protection Service and then Microsoft Defender Antivirus Cloud Protection Service. This setting can only be set by Group Policy. The recommended state for this setting is: Disabled." + rationale: "The decision on whether or not to participate in Microsoft MAPS / Microsoft Defender Antivirus Cloud Protection Service for malicious software reporting should be made centrally in an enterprise managed environment, so that all computers within it behave consistently in that regard. Configuring this setting to Disabled ensures that the decision remains centrally managed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\MAPS\\Configure local setting override for reporting to Microsoft MAPS. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.4.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting -> 0' + + - id: 26319 + title: "Ensure 'Join Microsoft MAPS' is set to 'Disabled'." + description: "This policy setting allows you to join Microsoft Active Protection Service (MAPS), which Microsoft renamed to Windows Defender Antivirus Cloud Protection Service and then Microsoft Defender Antivirus Cloud Protection Service. Microsoft MAPS / Microsoft Defender Antivirus Cloud Protection Service is the online community that helps you choose how to respond to potential threats. The community also helps stop the spread of new malicious software infections. You can choose to send basic or additional information about detected software. Additional information helps Microsoft create new definitions and help it to protect your computer. Possible options are: - (0x0) Disabled (default) - (0x1) Basic membership - (0x2) Advanced membership Basic membership will send basic information to Microsoft about software that has been detected including where the software came from the actions that you apply or that are applied automatically and whether the actions were successful. Advanced membership in addition to basic information will send more information to Microsoft about malicious software spyware and potentially unwanted software including the location of the software file names how the software operates and how it has impacted your computer. The recommended state for this setting is: Disabled." + rationale: "The information that would be sent can include things like location of detected items on your computer if harmful software was removed. The information would be automatically collected and sent. In some instances personal information might unintentionally be sent to Microsoft. However, Microsoft states that it will not use this information to identify you or contact you. For privacy reasons in high security environments, it is best to prevent these data submissions altogether." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\MAPS\\Join Microsoft MAPS. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.4.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting' + + - id: 26320 + title: "Ensure 'Configure Attack Surface Reduction rules' is set to 'Enabled'." + description: "This policy setting controls the state for the Attack Surface Reduction (ASR) rules. The recommended state for this setting is: Enabled." + rationale: "Attack surface reduction helps prevent actions and apps that are typically used by exploit-seeking malware to infect machines." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Microsoft Defender Exploit Guard\\Attack Surface Reduction\\Configure Attack Surface Reduction rules. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.5.1.1"] + - cis_csc: ["10.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR -> ExploitGuard_ASR_Rules' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR -> ExploitGuard_ASR_Rules -> 1' + + - id: 26321 + title: "Ensure 'Configure Attack Surface Reduction rules: Set the state for each ASR rule' is configured." + description: "This policy setting sets the Attack Surface Reduction rules. The recommended state for this setting is: 26190899-1602-49e8-8b27-eb1d0a1ce869 - 1 (Block Office communication application from creating child processes) 3b576869-a4ec-4529-8536-b80a7769e899 - 1 (Block Office applications from creating executable content) 5beb7efe-fd9a-4556-801d-275e5ffc04cc - 1 (Block execution of potentially obfuscated scripts) 75668c1f-73b5-4cf0-bb93-3ecf5cb7cc84 - 1 (Block Office applications from injecting code into other processes) 7674ba52-37eb-4a4f-a9a1-f0f9a1619a2c - 1 (Block Adobe Reader from creating child processes) 92e97fa1-2edf-4476-bdd6-9dd0b4dddc7b - 1 (Block Win32 API calls from Office macro) 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 - 1 (Block credential stealing from the Windows local security authority subsystem (lsass.exe)) b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4 - 1 (Block untrusted and unsigned processes that run from USB) be9ba2d9-53ea-4cdc-84e5-9b1eeee46550 - 1 (Block executable content from email client and webmail) d3e037e1-3eb8-44c8-a917-57927947596d - 1 (Block JavaScript or VBScript from launching downloaded executable content) d4f940ab-401b-4efc-aadc-ad5f3c50688a - 1 (Block Office applications from creating child processes) e6db77e5-3df2-4cf1-b95a-636979351e5b - 1 (Block persistence through WMI event subscription) Note: More information on ASR rules can be found at the following link: Use Attack surface reduction rules to prevent malware infection | Microsoft Docs" + rationale: "Attack surface reduction helps prevent actions and apps that are typically used by exploit-seeking malware to infect machines." + remediation: "To establish the recommended configuration via GP, set the following UI path so that 26190899-1602-49e8-8b27-eb1d0a1ce869, 3b576869-a4ec-4529-8536-b80a7769e899, 5beb7efe-fd9a-4556-801d-275e5ffc04cc, 75668c1f-73b5-4cf0-bb93-3ecf5cb7cc84, 7674ba52-37eb-4a4f-a9a1-f0f9a1619a2c, 92e97fa1-2edf-4476-bdd6-9dd0b4dddc7b, 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2, b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4, be9ba2d9-53ea-4cdc-84e5-9b1eeee46550, d3e037e1-3eb8-44c8-a917-57927947596d, d4f940ab-401b-4efc-aadc-ad5f3c50688a, and e6db77e5-3df2-4cf1-b95a-636979351e5b are each set to a value of 1: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Microsoft Defender Exploit Guard\\Attack Surface Reduction\\Configure Attack Surface Reduction rules: Set the state for each ASR rule. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.5.1.2"] + - cis_csc: ["10.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D4F940AB-401B-4EFC-AADC-AD5F3C50688A' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 3B576869-A4EC-4529-8536-B80A7769E899' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D3E037E1-3EB8-44C8-A917-57927947596D' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 26190899-1602-49E8-8B27-eB1D0A1CE869' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 7674BA52-37EB-4A4F-A9A1-F0F9A1619A2C' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 9E6C4E1F-7D60-472F-bA1A-A39EF669E4B2' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D4F940AB-401B-4EFC-AADC-AD5F3C50688A -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 3B576869-A4EC-4529-8536-B80A7769E899 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D3E037E1-3EB8-44C8-A917-57927947596D -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 26190899-1602-49E8-8B27-eB1D0A1CE869 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 7674BA52-37EB-4A4F-A9A1-F0F9A1619A2C -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 9E6C4E1F-7D60-472F-bA1A-A39EF669E4B2 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4 -> 1' + + - id: 26322 + title: "Ensure 'Prevent users and apps from accessing dangerous websites' is set to 'Enabled: Block'." + description: "This policy setting controls Microsoft Defender Exploit Guard network protection. The recommended state for this setting is: Enabled: Block." + rationale: "This setting can help prevent employees from using any application to access dangerous domains that may host phishing scams, exploit-hosting sites, and other malicious content on the Internet." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Windows Defender Exploit Guard\\Network Protection\\Prevent users and apps from accessing dangerous websites. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.5.3.1"] + - cis_csc: ["9.3", "10.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection -> EnableNetworkProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection -> EnableNetworkProtection -> 1' + + - id: 26323 + title: "Ensure 'Enable file hash computation feature' is set to 'Enabled'." + description: "This setting determines whether hash values are computed for files scanned by Microsoft Defender. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to monitor for suspicious and known malicious activity. File hashes are a reliable way of detecting changes to files, and can speed up the scan process by skipping files that have not changed since they were last scanned and determined to be safe. A changed file hash can also be cause for additional scrutiny." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\MpEngine\\Enable file hash computation feature. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.6.1"] + - cis_csc: ["10.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine -> EnableFileHashComputation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine -> EnableFileHashComputation -> 1' + + - id: 26324 + title: "Ensure 'Scan all downloaded files and attachments' is set to 'Enabled'." + description: "This policy setting configures scanning for all downloaded files and attachments. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Scan all downloaded files and attachments. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.9.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableIOAVProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableIOAVProtection -> 0' + + - id: 26325 + title: "Ensure 'Turn off real-time protection' is set to 'Disabled'." + description: "This policy setting configures real-time protection prompts for known malware detection. Microsoft Defender Antivirus alerts you when malware or potentially unwanted software attempts to install itself or to run on your computer. The recommended state for this setting is: Disabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Turn off real-time protection. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.9.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableRealtimeMonitoring' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableRealtimeMonitoring -> 0' + + - id: 26326 + title: "Ensure 'Turn on behavior monitoring' is set to 'Enabled'." + description: "This policy setting allows you to configure behavior monitoring for Microsoft Defender Antivirus. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Turn on behavior monitoring. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.9.3"] + - cis_csc: ["10.7"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableBehaviorMonitoring' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableBehaviorMonitoring -> 0' + + - id: 26327 + title: "Ensure 'Turn on script scanning' is set to 'Enabled'." + description: "This policy setting allows script scanning to be turned on/off. Script scanning intercepts scripts then scans them before they are executed on the system. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Turn on script scanning. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.9.4"] + - cis_csc: ["10.7"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableScriptScanning' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableScriptScanning -> 0' + + - id: 26328 + title: "Ensure 'Configure Watson events' is set to 'Disabled'." + description: "This policy setting allows you to configure whether or not Watson events are sent. The recommended state for this setting is: Disabled." + rationale: "Watson events are the reports that get sent to Microsoft when a program or service crashes or fails, including the possibility of automatic submission. Preventing this information from being sent can help reduce privacy concerns." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Reporting\\Configure Watson events. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.11.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts -> 1' + + - id: 26329 + title: "Ensure 'Scan removable drives' is set to 'Enabled'." + description: "This policy setting allows you to manage whether or not to scan for malicious software and unwanted software in the contents of removable drives, such as USB flash drives, when running a full scan. The recommended state for this setting is: Enabled." + rationale: "It is important to ensure that any present removable drives are always included in any type of scan, as removable drives are more likely to contain malicious software brought in to the enterprise managed environment from an external, unmanaged computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Scan\\Scan removable drives. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.12.1"] + - cis_csc: ["10.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning -> 0' + + - id: 26330 + title: "Ensure 'Turn on e-mail scanning' is set to 'Enabled'." + description: "This policy setting allows you to configure e-mail scanning. When e-mail scanning is enabled, the engine will parse the mailbox and mail files, according to their specific format, in order to analyze the mail bodies and attachments. Several e-mail formats are currently supported, for example: pst (Outlook), dbx, mbx, mime (Outlook Express), binhex (Mac). The recommended state for this setting is: Enabled." + rationale: "Incoming e-mails should be scanned by an antivirus solution such as Microsoft Defender Antivirus, as email attachments are a commonly used attack vector to infiltrate computers with malicious software." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Scan\\Turn on e-mail scanning. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.12.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning -> 0' + + - id: 26331 + title: "Ensure 'Configure detection for potentially unwanted applications' is set to 'Enabled: Block'." + description: "This policy setting controls detection and action for Potentially Unwanted Applications (PUA), which are sneaky unwanted application bundlers or their bundled applications, that can deliver adware or malware. The recommended state for this setting is: Enabled: Block. For more information, see this link: Block potentially unwanted applications with Microsoft Defender Antivirus | Microsoft Docs" + rationale: "Potentially unwanted applications can increase the risk of your network being infected with malware, cause malware infections to be harder to identify, and can waste IT resources in cleaning up the applications. They should be blocked from installation." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Configure detection for potentially unwanted applications. Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.47.15"] + - cis_csc: ["2.5", "10.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> PUAProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> PUAProtection -> 1' + + - id: 26332 + title: "Ensure 'Turn off Microsoft Defender AntiVirus' is set to 'Disabled'." + description: "This policy setting turns off Microsoft Defender Antivirus. If the setting is configured to Disabled, Microsoft Defender Antivirus runs and computers are scanned for malware and other potentially unwanted software. The recommended state for this setting is: Disabled." + rationale: "It is important to ensure a current, updated antivirus product is scanning each computer for malicious file activity. Microsoft provides a competent solution out of the box in Microsoft Defender Antivirus. Organizations that choose to purchase a reputable 3rd-party antivirus solution may choose to exempt themselves from this recommendation in lieu of the commercial alternative." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Turn off Microsoft Defender AntiVirus. Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn off Windows Defender, but it was renamed to Windows Defender Antivirus starting with the Windows 10 Release 1703 Administrative Templates. It was again renamed to Turn off Microsoft Defender Antivirus starting with the Windows 10 Release 2004 Administrative Templates." + compliance: + - cis: ["18.9.47.16"] + - cis_csc: ["10.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> DisableAntiSpyware' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> DisableAntiSpyware -> 0' + + - id: 26333 + title: "Ensure 'Enable news and interests on the taskbar' is set to 'Disabled'." + description: "This policy setting specifies whether the news and interests feature is allowed on the device. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, apps and features such as news and interests on the Windows taskbar should be treated as a possible security risk due to the potential of data being sent back to 3rd parties, such as Microsoft. In addition, the app may display inappropriate news and interests within the feed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\News and interests\\Enable news and interests on the taskbar. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Feeds.admx/adml that is included with the Microsoft Windows 10 Release 21H1 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.57.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds -> EnableFeeds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds -> EnableFeeds -> 0' + + - id: 26334 + title: "Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'." + description: "This policy setting lets you prevent apps and features from working with files on OneDrive using the Next Generation Sync Client. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting prevents users from accidentally (or intentionally) uploading confidential or sensitive corporate information to the OneDrive cloud service using the Next Generation Sync Client. Note: This security concern applies to any cloud-based file storage application installed on a workstation, not just the one supplied with Windows." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\OneDrive\\Prevent the usage of OneDrive for file storage. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template SkyDrive.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer). However, we strongly recommend you only use the version included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Older versions of the templates had conflicting settings in different template files for both OneDrive & SkyDrive, until it was cleaned up properly in the above version. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Prevent the usage of SkyDrive for file storage, but it was renamed starting with the Windows 10 RTM (Release 1507) Administrative Templates." + compliance: + - cis: ["18.9.58.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC -> 1' + + - id: 26335 + title: "Ensure 'Turn off Push To Install service' is set to 'Enabled'." + description: "This policy setting controls whether users can push Apps to the device from the Microsoft Store App running on other devices or the web. The recommended state for this setting is: Enabled." + rationale: "In a high security managed environment, application installations should be managed centrally by IT staff, not by end users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Push to Install\\Turn off Push To Install service. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PushToInstall.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.64.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall -> DisablePushToInstall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall -> DisablePushToInstall -> 1' + + - id: 26336 + title: "Ensure 'Do not allow passwords to be saved' is set to 'Enabled'." + description: "This policy setting helps prevent Remote Desktop clients from saving passwords on a computer. The recommended state for this setting is: Enabled. Note: If this policy setting was previously configured as Disabled or Not configured, any previously saved passwords will be deleted the first time a Remote Desktop client disconnects from any server." + rationale: "An attacker with physical access to the computer may be able to break the protection guarding saved passwords. An attacker who compromises a user's account and connects to their computer could use saved passwords to gain access to additional hosts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Connection Client\\Do not allow passwords to be saved. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.2.2"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving -> 1' + + - id: 26337 + title: "Ensure 'Allow users to connect remotely by using Remote Desktop Services' is set to 'Disabled'." + description: "This policy setting allows you to configure remote access to computers by using Remote Desktop Services. The recommended state for this setting is: Disabled." + rationale: "Any account with the Allow log on through Remote Desktop Services user right can log on to the remote console of the computer. If you do not restrict access to legitimate users who need to log on to the console of the computer, unauthorized users could download and execute malicious code to elevate their privileges." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Connections\\Allow users to connect remotely by using Remote Desktop Services. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow users to connect remotely using Terminal Services, but it was renamed to Allow users to connect remotely using Remote Desktop Services in the Windows 7 & Server 2008 R2 Administrative Templates. It was finally renamed (again) to Allow users to connect remotely by using Remote Desktop Services starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.65.3.2.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDenyTSConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDenyTSConnections -> 1' + + - id: 26338 + title: "Ensure 'Allow UI Automation redirection' is set to 'Disabled'." + description: "This policy setting determines whether User Interface (UI) Automation client applications running on the local computer can access UI elements on the server. UI Automation gives programs access to most UI elements, which allows use of assistive technology products like Magnifier and Narrator that need to interact with the UI in order to work properly. UI information also allows automated test scripts to interact with the UI. For example, the local computer's Narrator and Magnifier clients can be used to interact with UI on a web page opened in a remote session. The recommended state for this setting is: Disabled. Note: Remote Desktop sessions don't currently support UI Automation redirection." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for UI Automation redirection within a Remote Desktop session is rare, and not supported at this time, but it makes sense to reduce the number of unexpected avenues for malicious activity to occur." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Allow UI Automation redirection. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template TerminalServer.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.65.3.3.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> EnableUiaRedirection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> EnableUiaRedirection -> 0' + + - id: 26339 + title: "Ensure 'Do not allow COM port redirection' is set to 'Enabled'." + description: "This policy setting specifies whether to prevent the redirection of data to client COM ports from the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for COM port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow COM port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.3.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> 1' + + - id: 26340 + title: "Ensure 'Do not allow drive redirection' is set to 'Enabled'." + description: "This policy setting prevents users from sharing the local drives on their client computers to Remote Desktop Servers that they access. Mapped drives appear in the session folder tree in Windows Explorer in the following format: \\\\TSClient\\$ If local drives are shared they are left vulnerable to intruders who want to exploit the data that is stored on them. The recommended state for this setting is: Enabled." + rationale: "Data could be forwarded from the user's Remote Desktop Services session to the user's local computer without any direct user interaction. Malicious software already present on a compromised server would have direct and stealthy disk access to the user's local computer during the Remote Desktop session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow drive redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.3.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm -> 1' + + - id: 26341 + title: "Ensure 'Do not allow location redirection' is set to 'Enabled'." + description: "This policy setting controls the redirection of location data to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for location data redirection within a Remote Desktop session is rare, so it makes sense to reduce the number of unexpected avenues for malicious activity to occur." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow location redirection. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template TerminalServer.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.65.3.3.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLocationRedir' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLocationRedir -> 1' + + - id: 26342 + title: "Ensure 'Do not allow LPT port redirection' is set to 'Enabled'." + description: "This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for LPT port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow LPT port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.3.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> 1' + + - id: 26343 + title: "Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'." + description: "This policy setting allows you to control the redirection of supported Plug and Play devices, such as Windows Portable Devices, to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for Plug and Play device redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow supported Plug and Play device redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.3.6"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> 1' + + - id: 26344 + title: "Ensure 'Always prompt for password upon connection' is set to 'Enabled'." + description: "This policy setting specifies whether Remote Desktop Services always prompts the client computer for a password upon connection. You can use this policy setting to enforce a password prompt for users who log on to Remote Desktop Services, even if they already provided the password in the Remote Desktop Connection client. The recommended state for this setting is: Enabled." + rationale: "Users have the option to store both their username and password when they create a new Remote Desktop Connection shortcut. If the server that runs Remote Desktop Services allows users who have used this feature to log on to the server but not enter their password, then it is possible that an attacker who has gained physical access to the user's computer could connect to a Remote Desktop Server through the Remote Desktop Connection shortcut, even though they may not know the user's password." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Always prompt for password upon connection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In the Microsoft Windows Vista Administrative Templates, this setting was named Always prompt client for password upon connection, but it was renamed starting with the Windows Server 2008 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.65.3.9.1"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword -> 1' + + - id: 26345 + title: "Ensure 'Require secure RPC communication' is set to 'Enabled'." + description: "This policy setting allows you to specify whether Remote Desktop Services requires secure Remote Procedure Call (RPC) communication with all clients or allows unsecured communication. You can use this policy setting to strengthen the security of RPC communication with clients by allowing only authenticated and encrypted requests. The recommended state for this setting is: Enabled." + rationale: "Allowing unsecure RPC communication can exposes the server to man in the middle attacks and data disclosure attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require secure RPC communication. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.9.2"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic -> 1' + + - id: 26346 + title: "Ensure 'Require use of specific security layer for remote (RDP) connections' is set to 'Enabled: SSL'." + description: "This policy setting specifies whether to require the use of a specific security layer to secure communications between clients and RD Session Host servers during Remote Desktop Protocol (RDP) connections. The recommended state for this setting is: Enabled: SSL. Note: In spite of this setting being labeled SSL, it is actually enforcing Transport Layer Security (TLS) version 1.0, not the older (and less secure) SSL protocol." + rationale: "The native Remote Desktop Protocol (RDP) encryption is now considered a weak protocol, so enforcing the use of stronger Transport Layer Security (TLS) encryption for all RDP communications between clients and RD Session Host servers is preferred." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: SSL: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require use of specific security layer for remote (RDP) connections. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.9.3"] + - cis_csc: ["3.10"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> SecurityLayer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> SecurityLayer -> 2' + + - id: 26347 + title: "Ensure 'Require user authentication for remote connections by using Network Level Authentication' is set to 'Enabled'." + description: "This policy setting allows you to specify whether to require user authentication for remote connections to the RD Session Host server by using Network Level Authentication. The recommended state for this setting is: Enabled." + rationale: "Requiring that user authentication occur earlier in the remote connection process enhances security." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require user authentication for remote connections by using Network Level Authentication. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In the Microsoft Windows Vista Administrative Templates, this setting was initially named Require user authentication using RDP 6.0 for remote connections, but it was renamed starting with the Windows Server 2008 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.65.3.9.4"] + - cis_csc: ["3.10"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> UserAuthentication' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> UserAuthentication -> 1' + + - id: 26348 + title: "Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'." + description: "This policy setting specifies whether to require the use of a specific encryption level to secure communications between client computers and RD Session Host servers during Remote Desktop Protocol (RDP) connections. This policy only applies when you are using native RDP encryption. However, native RDP encryption (as opposed to SSL encryption) is not recommended. This policy does not apply to SSL encryption. The recommended state for this setting is: Enabled: High Level." + rationale: "If Remote Desktop client connections that use low level encryption are allowed, it is more likely that an attacker will be able to decrypt any captured Remote Desktop Services network traffic." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: High Level: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Set client connection encryption level. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.9.5"] + - cis_csc: ["3.10"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel -> 3' + + - id: 26349 + title: "Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less, but not Never (0)'." + description: "This policy setting allows you to specify the maximum amount of time that an active Remote Desktop Services session can be idle (without user input) before it is automatically disconnected. The recommended state for this setting is: Enabled: 15 minutes or less, but not Never (0)." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of inactive sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 15 minutes or less, but not Never (0): Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for active but idle Remote Desktop Services sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Set time limit for active but idle Terminal Services sessions, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.65.3.10.1"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - https://workbench.cisecurity.org/benchmarks/766 + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare <= 900000' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare != 0' + + - id: 26350 + title: "Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'." + description: "This policy setting allows you to configure a time limit for disconnected Remote Desktop Services sessions. The recommended state for this setting is: Enabled: 1 minute." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of disconnected but still active sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. This setting is important to ensure a disconnected session is properly terminated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 minute: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for disconnected sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.65.3.10.2"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> 60000' + + - id: 26351 + title: "Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'." + description: "This policy setting specifies whether Remote Desktop Services retains a user's per-session temporary folders at logoff. The recommended state for this setting is: Disabled." + rationale: "Sensitive information could be contained inside the temporary folders and visible to other administrators that log into the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not delete temp folders upon exit. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Do not delete temp folder upon exit, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.65.3.11.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit -> 1' + + - id: 26352 + title: "Ensure 'Prevent downloading of enclosures' is set to 'Enabled'." + description: "This policy setting prevents the user from having enclosures (file attachments) downloaded from an RSS feed to the user's computer. The recommended state for this setting is: Enabled." + rationale: "Allowing attachments to be downloaded through the RSS feed can introduce files that could have malicious intent." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\RSS Feeds\\Prevent downloading of enclosures. Note: This Group Policy path is provided by the Group Policy template InetRes.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Turn off downloading of enclosures, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.66.1"] + - cis_csc: ["9.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload -> 1' + + - id: 26353 + title: "Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search'." + description: "This policy setting allows search and Cortana to search cloud sources like OneDrive and SharePoint. The recommended state for this setting is: Enabled: Disable Cloud Search." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Cloud Search: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cloud Search. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.67.2"] + - cis_csc: ["4.8"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCloudSearch' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCloudSearch -> 0' + + - id: 26354 + title: "Ensure 'Allow Cortana' is set to 'Disabled'." + description: "This policy setting specifies whether Cortana is allowed on the device. The recommended state for this setting is: Disabled." + rationale: "If Cortana is enabled, sensitive information could be contained in search history and sent out to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cortana. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.67.3"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCortana' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCortana -> 0' + + - id: 26355 + title: "Ensure 'Allow Cortana above lock screen' is set to 'Disabled'." + description: "This policy setting determines whether or not the user can interact with Cortana using speech while the system is locked. The recommended state for this setting is: Disabled." + rationale: "Access to any computer resource should not be allowed when the device is locked." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cortana above lock screen. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.67.4"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCortanaAboveLock' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCortanaAboveLock -> 0' + + - id: 26356 + title: "Ensure 'Allow indexing of encrypted files' is set to 'Disabled'." + description: "This policy setting controls whether encrypted items are allowed to be indexed. When this setting is changed, the index is rebuilt completely. Full volume encryption (such as BitLocker Drive Encryption or a non-Microsoft solution) must be used for the location of the index to maintain security for encrypted files. The recommended state for this setting is: Disabled." + rationale: "Indexing and allowing users to search encrypted files could potentially reveal confidential data stored within the encrypted files." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow indexing of encrypted files. Note: This Group Policy path is provided by the Group Policy template Search.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.67.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems -> 0' + + - id: 26357 + title: "Ensure 'Allow search and Cortana to use location' is set to 'Disabled'." + description: "This policy setting specifies whether search and Cortana can provide location aware search and Cortana results. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment, allowing Cortana and Search to have access to location data is unnecessary. Organizations likely do not want this information shared out." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow search and Cortana to use location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.67.6"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowSearchToUseLocation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowSearchToUseLocation -> 0' + + - id: 26358 + title: "Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'." + description: "The Key Management Service (KMS) is a Microsoft license activation method that entails setting up a local server to store the software licenses. The KMS server itself needs to connect to Microsoft to activate the KMS service, but subsequent on-network clients can activate Microsoft Windows OS and/or their Microsoft Office via the KMS server instead of connecting directly to Microsoft. This policy setting lets you opt-out of sending KMS client activation data to Microsoft automatically. The recommended state for this setting is: Enabled." + rationale: "Even though the KMS licensing method does not require KMS clients to connect to Microsoft, they still send KMS client activation state data to Microsoft automatically. Preventing this information from being sent can help reduce privacy concerns in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Software Protection Platform\\Turn off KMS Client Online AVS Validation. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AVSValidationGP.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.72.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> 1' + + - id: 26359 + title: "Ensure 'Disable all apps from Microsoft Store' is set to 'Disabled'." + description: "This setting configures the launch of all apps from the Microsoft Store that came pre-installed or were downloaded. The recommended state for this setting is: Disabled. Note: This policy setting only applies to Windows 10 Enterprise and Windows 10 Education editions. Note #2: The name of this setting and the Enabled/Disabled values are incorrectly worded - logically, the title implies that configuring it to Enabled will disable all apps from the Microsoft Store, and configuring it to Disabled will enable all apps from the Microsoft Store. The opposite is true (and is consistent with the GPME help text). This is a logical wording mistake by Microsoft in the Administrative Template." + rationale: "The Store service is a retail outlet built into Windows, primarily for consumer use. In an enterprise managed environment the IT department should be managing the installation of all applications to reduce the risk of the installation of vulnerable software." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Disable all apps from Microsoft Store. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsStore.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable all apps from Windows Store, but it was renamed starting with the Windows 10 Release 1803 Administrative Templates." + compliance: + - cis: ["18.9.75.1"] + - cis_csc: ["2.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> DisableStoreApps' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> DisableStoreApps -> 1' + + - id: 26360 + title: "Ensure 'Only display the private store within the Microsoft Store' is set to 'Enabled'." + description: "This policy setting denies access to the retail catalog in the Microsoft Store, but displays the private store. The recommended state for this setting is: Enabled." + rationale: "Allowing the private store will allow an organization to control the apps that users have access to add to a system. This will help ensure that unapproved malicious apps are not running on a system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Only display the private store within the Microsoft Store. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsStore.admx/adml that is included with the Microsoft Windows 10 Release 1607 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Only display the private store within the Windows Store app, but it was renamed starting with the Windows 10 Release 1803 Administrative Templates." + compliance: + - cis: ["18.9.75.2"] + - cis_csc: ["2.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> RequirePrivateStoreOnly' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> RequirePrivateStoreOnly -> 1' + + - id: 26361 + title: "Ensure 'Turn off Automatic Download and Install of updates' is set to 'Disabled'." + description: "This setting enables or disables the automatic download and installation of Microsoft Store app updates. The recommended state for this setting is: Disabled." + rationale: "Keeping your system properly patched can help protect against 0 day vulnerabilities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Turn off Automatic Download and Install of updates. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinStoreUI.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates, or by the Group Policy template WindowsStore.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.75.3"] + - cis_csc: ["7.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> AutoDownload' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> AutoDownload -> 4' + + - id: 26362 + title: "Ensure 'Turn off the offer to update to the latest version of Windows' is set to 'Enabled'." + description: "Enables or disables the Microsoft Store offer to update to the latest version of Windows. The recommended state for this setting is: Enabled." + rationale: "Unplanned OS upgrades can lead to more preventable support calls. The IT department should be managing and approving all upgrades and updates." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Turn off the offer to update to the latest version of Windows. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinStoreUI.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates, or by the Group Policy template WindowsStore.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.75.4"] + - cis_csc: ["7.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> DisableOSUpgrade' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> DisableOSUpgrade -> 1' + + - id: 26363 + title: "Ensure 'Turn off the Store application' is set to 'Enabled'." + description: "This setting denies or allows access to the Store application. The recommended state for this setting is: Enabled. Note: Per Microsoft TechNet and MSKB 3135657, this policy setting does not apply to any Windows 10 editions other than Enterprise and Education." + rationale: "Only applications approved by an IT department should be installed. Allowing users to install 3rd party applications can lead to missed patches and potential zero day vulnerabilities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Store\\Turn off the Store application. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinStoreUI.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates, or by the Group Policy template WindowsStore.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.75.5"] + - cis_csc: ["2.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - https://docs.microsoft.com/en-us/windows/client-management/group-policies-for-enterprise-and-education-editions + - https://support.microsoft.com/en-us/help/3135657/can-t-disable-windows-store-in-windows-10-pro-through-group-policy + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> RemoveWindowsStore' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsStore -> RemoveWindowsStore -> 1' + + - id: 26364 + title: "Ensure 'Allow widgets' is set to 'Disabled'." + description: "This policy setting specifies whether the widgets feature is allowed on the device. The widgets feature provides information such as, weather, news, sports, stocks, traffic, and entertainment (not an inclusive list). The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, apps and features such as widgets on the Windows taskbar should be treated as a possible security risk due to the potential of data being sent back to 3rd parties, such as Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Widgets\\Allow Widgets. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template NewsAndInterests.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.81.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Dsh' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Dsh -> AllowNewsAndInterests' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Dsh -> AllowNewsAndInterests -> 0' + + - id: 26365 + title: "Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass'." + description: "This policy setting allows you to manage the behavior of Windows Defender SmartScreen. Windows Defender SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. Some information is sent to Microsoft about files and programs run on PCs with this feature enabled. The recommended state for this setting is: Enabled: Warn and prevent bypass." + rationale: "Windows Defender SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. However, due to the fact that some information is sent to Microsoft about files and programs run on PCs some organizations may prefer to disable it." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Warn and prevent bypass: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender SmartScreen\\Explorer\\Configure Windows Defender SmartScreen. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsExplorer.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Configure Windows SmartScreen, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.85.1.1"] + - cis_csc: ["10.5"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> ShellSmartScreenLevel' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> ShellSmartScreenLevel -> Block' + + - id: 26366 + title: "Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled'." + description: "This setting lets you decide whether to turn on SmartScreen Filter. SmartScreen Filter provides warning messages to help protect your employees from potential phishing scams and malicious software. The recommended state for this setting is: Enabled." + rationale: "SmartScreen serves an important purpose as it helps to warn users of possible malicious sites and files. Allowing users to turn off this setting can make the browser become more vulnerable to compromise." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender SmartScreen\\Microsoft Edge\\Configure Windows Defender SmartScreen. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer). Note #2: In the Microsoft Windows 10 RTM (Release 1507) Administrative Templates, this setting was initially named Allows you to configure SmartScreen. In the Microsoft Windows 10 Release 1511 Administrative Templates, it was renamed to Turn off the SmartScreen Filter. In the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates, it was renamed (again) to Configure SmartScreen Filter. Finally, it was given its current name of Configure Windows Defender SmartScreen starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.85.2.1"] + - cis_csc: ["10.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter -> EnabledV9' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter -> EnabledV9 -> 1' + + - id: 26367 + title: "Ensure 'Prevent bypassing Windows Defender SmartScreen prompts for sites' is set to 'Enabled'." + description: "This setting lets you decide whether employees can override the SmartScreen Filter warnings about potentially malicious websites. The recommended state for this setting is: Enabled." + rationale: "SmartScreen will warn an employee if a website is potentially malicious. Enabling this setting prevents these warnings from being bypassed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender SmartScreen\\Microsoft Edge\\Prevent bypassing Windows Defender SmartScreen prompts for sites. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MicrosoftEdge.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Microsoft Windows 10 Release 1511 Administrative Templates, this setting was initially named Don't allow SmartScreen Filter warning overrides. In the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates, this setting was renamed to Prevent bypassing SmartScreen prompts for sites. Finally, it was given its current name of Prevent bypassing Windows Defender SmartScreen prompts for sites starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.85.2.2"] + - cis_csc: ["10.5"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter -> PreventOverride' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter -> PreventOverride -> 1' + + - id: 26368 + title: "Ensure 'Enables or disables Windows Game Recording and Broadcasting' is set to 'Disabled'." + description: "This setting enables or disables the Windows Game Recording and Broadcasting features. The recommended state for this setting is: Disabled." + rationale: "If this setting is allowed, users could record and broadcast session info to external sites, which is both a risk of accidentally exposing sensitive company data (on-screen) outside the company as well as a privacy concern." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Game Recording and Broadcasting\\Enables or disables Windows Game Recording and Broadcasting. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GameDVR.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.87.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR -> AllowGameDVR' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\GameDVR -> AllowGameDVR -> 0' + + - id: 26369 + title: "Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled'." + description: "This policy setting determines whether suggested apps in Windows Ink Workspace are allowed. The recommended state for this setting is: Disabled." + rationale: "This Microsoft feature is designed to collect data and suggest apps based on that data collected. Disabling this setting will help ensure your data is not shared with any third party." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow suggested apps in Windows Ink Workspace. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.89.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowSuggestedAppsInWindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowSuggestedAppsInWindowsInkWorkspace -> 0' + + - id: 26370 + title: "Ensure 'Allow Windows Ink Workspace' is set to 'Enabled: On, but disallow access above lock' OR 'Disabled' but not 'Enabled: On'." + description: "This policy setting determines whether Windows Ink items are allowed above the lock screen. The recommended state for this setting is: Enabled: On, but disallow access above lock OR Disabled." + rationale: "Allowing any apps to be accessed while system is locked is not recommended. If this feature is permitted, it should only be accessible once a user authenticates with the proper credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: On, but disallow access above lock OR Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow Windows Ink Workspace. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.89.2"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace -> r:^0$|^1$' + + - id: 26371 + title: "Ensure 'Allow user control over installs' is set to 'Disabled'." + description: "This setting controls whether users are permitted to change installation options that typically are available only to system administrators. The security features of Windows Installer normally prevent users from changing installation options that are typically reserved for system administrators, such as specifying the directory to which files are installed. If Windows Installer detects that an installation package has permitted the user to change a protected option, it stops the installation and displays a message. These security features operate only when the installation program is running in a privileged security context in which it has access to directories denied to the user. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment, only IT staff with administrative rights should be installing or changing software on a system. Allowing users the ability to have any control over installs can risk unapproved software from being installed or removed from a system, which could cause the system to become vulnerable to compromise." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Allow user control over installs. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Enable user control over installs, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.90.1"] + - cis_csc: ["2.5"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl -> 0' + + - id: 26372 + title: "Ensure 'Always install with elevated privileges' is set to 'Disabled'." + description: "This setting controls whether or not Windows Installer should use system permissions when it installs any program on the system. Note: This setting appears both in the Computer Configuration and User Configuration folders. To make this setting effective, you must enable the setting in both folders. Caution: If enabled, skilled users can take advantage of the permissions this setting grants to change their privileges and gain permanent access to restricted files and folders. Note that the User Configuration version of this setting is not guaranteed to be secure. The recommended state for this setting is: Disabled." + rationale: "Users with limited privileges can exploit this feature by creating a Windows Installer installation package that creates a new local account that belongs to the local built-in Administrators group, adds their current account to the local built-in Administrators group, installs malicious software, or performs other unauthorized activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Always install with elevated privileges. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.90.2"] + - cis_csc: ["5.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated -> 0' + + - id: 26373 + title: "Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'." + description: "This policy setting controls whether Web-based programs are allowed to install software on the computer without notifying the user. The recommended state for this setting is: Disabled." + rationale: "Suppressing the system warning can pose a security risk and increase the attack surface on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Prevent Internet Explorer security prompt for Windows Installer scripts. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable IE security prompt for Windows Installer scripts, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.90.3"] + - cis_csc: ["2.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> 0' + + - id: 26374 + title: "Ensure 'Sign-in and lock last interactive user automatically after a restart' is set to 'Disabled'." + description: "This policy setting controls whether a device will automatically sign-in the last interactive user after Windows Update restarts the system. The recommended state for this setting is: Disabled." + rationale: "Disabling this feature will prevent the caching of user's credentials and unauthorized use of the device, and also ensure the user is aware of the restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Logon Options\\Sign-in and lock last interactive user automatically after a restart. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinLogon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Sign-in last interactive user automatically after a system-initiated restart, but it was renamed starting with the Windows 10 Release 1903 Administrative Templates." + compliance: + - cis: ["18.9.91.1"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn -> 1' + + - id: 26375 + title: "Ensure 'Turn on PowerShell Script Block Logging' is set to 'Enabled'." + description: "This policy setting enables logging of all PowerShell script input to the Applications and Services Logs\\Microsoft\\Windows\\PowerShell\\Operational Event Log channel. The recommended state for this setting is: Enabled. Note: If logging of Script Block Invocation Start/Stop Events is enabled (option box checked), PowerShell will log additional events when invocation of a command, script block, function, or script starts or stops. Enabling this option generates a high volume of event logs. CIS has intentionally chosen not to make a recommendation for this option, since it generates a large volume of events. If an organization chooses to enable the optional setting (checked), this also conforms to the benchmark." + rationale: "Logs of PowerShell script input can be very valuable when performing forensic investigations of PowerShell attack incidents to determine what occurred." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Script Block Logging. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.100.1"] + - cis_csc: ["8.8"] + - pci_dss: ["12.3.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging -> 1' + + - id: 26376 + title: "Ensure 'Turn on PowerShell Transcription' is set to 'Disabled'." + description: "This Policy setting lets you capture the input and output of Windows PowerShell commands into text-based transcripts. The recommended state for this setting is: Disabled." + rationale: "If this setting is enabled there is a risk that passwords could get stored in plain text in the PowerShell_transcript output file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Transcription. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.100.2"] + - pci_dss: ["12.3.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting -> 0' + + - id: 26377 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client uses Basic authentication. The recommended state for this setting is: Disabled. Note: Clients that use Microsoft's Exchange Online service (Office 365) will require an exception to this recommendation, to instead have this setting set to Enabled. Exchange Online uses Basic authentication over HTTPS, and so the Exchange Online authentication traffic will still be safely encrypted." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow Basic authentication. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.1.1"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic -> 0' + + - id: 26378 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow unencrypted traffic. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.1.2"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic -> 0' + + - id: 26379 + title: "Ensure 'Disallow Digest authentication' is set to 'Enabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client will not use Digest authentication. The recommended state for this setting is: Enabled." + rationale: "Digest authentication is less robust than other authentication methods available in WinRM, an attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Disallow Digest authentication. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.1.3"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest -> 0' + + - id: 26380 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service accepts Basic authentication from a remote client. The recommended state for this setting is: Disabled." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow Basic authentication. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.2.1"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic -> 0' + + - id: 26381 + title: "Ensure 'Allow remote server management through WinRM' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port. The recommended state for this setting is: Disabled." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Management (WinRM) service on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow automatic configuration of listeners, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.102.2.2"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> 0' + + - id: 26382 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow unencrypted traffic. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.2.3"] + - cis_csc: ["3.10"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic -> 0' + + - id: 26383 + title: "Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service will allow RunAs credentials to be stored for any plug-ins. The recommended state for this setting is: Enabled. Note: If you enable and then disable this policy setting, any values that were previously configured for RunAsPassword will need to be reset." + rationale: "Although the ability to store RunAs credentials is a convenient feature it increases the risk of account compromise slightly. For example, if you forget to lock your desktop before leaving it unattended for a few minutes another person could access not only the desktop of your computer but also any hosts you manage via WinRM with cached RunAs credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Disallow WinRM from storing RunAs credentials. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.102.2.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs -> 1' + + - id: 26384 + title: "Ensure 'Allow Remote Shell Access' is set to 'Disabled'." + description: "This policy setting allows you to manage configuration of remote access to all supported shells to execute scripts and commands. The recommended state for this setting is: Disabled. Note: The GPME help text for this setting is incorrectly worded, implying that configuring it to Enabled will reject new Remote Shell connections, and setting it to Disabled will allow Remote Shell connections. The opposite is true (and is consistent with the title of the setting). This is a wording mistake by Microsoft in the Administrative Template." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Shell on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Shell\\Allow Remote Shell Access. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteShell.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.103.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> 0' + + - id: 26385 + title: "Ensure 'Allow clipboard sharing with Windows Sandbox' is set to 'Disabled'." + description: 'This policy setting enables or disables clipboard sharing with the Windows sandbox. The recommended state for this setting is: Disabled. Note: The Windows Sandbox feature was first introduced in Windows 10 R1903, and allows a temporary "clean install" virtual instance of Windows to be run inside the host, for the ostensible purpose of testing applications without making changes to the host.' + rationale: "Disabling copy and paste decreases the attack surface exposed by the Windows Sandbox and possible exposure of untrusted applications to the internal network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Sandbox\\Allow clipboard sharing with Windows Sandbox. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsSandbox.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.104.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Sandbox' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Sandbox -> AllowClipboardRedirection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Sandbox -> AllowClipboardRedirection -> 0' + + - id: 26386 + title: "Ensure 'Allow networking in Windows Sandbox' is set to 'Disabled'." + description: 'This policy setting enables or disables networking in the Windows Sandbox. Networking is achieved by creating a virtual switch on the host, and connecting the Windows Sandbox to it via a virtual Network Interface Card (NIC). The recommended state for this setting is: Disabled. Note: The Windows Sandbox feature was first introduced in Windows 10 R1903, and allows a temporary "clean install" virtual instance of Windows to be run inside the host, for the ostensible purpose of testing applications without making changes to the host.' + rationale: "Disabling network access decreases the attack surface exposed by the Windows Sandbox and exposure of untrusted applications to the internal network. Note: Per Microsoft, enabling networking in the Windows Sandbox can expose untrusted applications to the internal network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Sandbox\\Allow networking in Windows Sandbox. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsSandbox.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.104.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Sandbox' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Sandbox -> AllowNetworking' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Sandbox -> AllowNetworking -> 0' + + - id: 26387 + title: "Ensure 'Prevent users from modifying settings' is set to 'Enabled'." + description: "This policy setting prevent users from making changes to the Exploit protection settings area in the Windows Security settings. The recommended state for this setting is: Enabled." + rationale: "Only authorized IT staff should be able to make changes to the exploit protection settings in order to ensure the organizations specific configuration is not modified." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Security\\App and browser protection\\Prevent users from modifying settings. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefenderSecurityCenter.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.105.2.1"] + - cis_csc: ["10.5"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection -> DisallowExploitProtectionOverride' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection -> DisallowExploitProtectionOverride -> 1' + + - id: 26388 + title: "Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'." + description: "This policy setting specifies that Automatic Updates will wait for computers to be restarted by the users who are logged on to them to complete a scheduled installation. The recommended state for this setting is: Disabled. Note: This setting applies only when you configure Automatic Updates to perform scheduled update installations. If you configure the Configure Automatic Updates setting to Disabled, this setting has no effect." + rationale: "Some security updates require that the computer be restarted to complete an installation. If the computer cannot restart automatically, then the most recent update will not completely install and no new updates will download to the computer until it is restarted. Without the auto-restart functionality, users who are not security-conscious may choose to indefinitely delay the restart, therefore keeping the computer in a less secure state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Legacy Policies\\No auto-restart with logged on users for scheduled automatic updates installations. Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named No auto-restart for scheduled Automatic Updates installations, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.108.1.1"] + - cis_csc: ["7.3"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers -> 0' + + - id: 26389 + title: "Ensure 'Configure Automatic Updates' is set to 'Enabled'." + description: 'This policy setting specifies whether computers in your environment will receive security updates from Windows Update or WSUS. If you configure this policy setting to Enabled, the operating system will recognize when a network connection is available and then use the network connection to search Windows Update or your designated intranet site for updates that apply to them. After you configure this policy setting to Enabled, select one of the following three options in the Configure Automatic Updates Properties dialog box to specify how the service will work: 2 - Notify for download and auto install (Notify before downloading any updates) 3 - Auto download and notify for install (Download the updates automatically and notify when they are ready to be installed.) (Default setting) 4 - Auto download and schedule the install (Automatically download updates and install them on the schedule specified below.)) 5 - Allow local admin to choose setting (Leave decision on above choices up to the local Administrators (Not Recommended)) The recommended state for this setting is: Enabled. Note: The sub-setting "Configure automatic updating:" has 4 possible values - all of them are valid depending on specific organizational needs, however if feasible we suggest using a value of 4 - Auto download and schedule the install. This suggestion is not a scored requirement. Note #2: Organizations that utilize a 3rd-party solution for patching may choose to exempt themselves from this recommendation, and instead configure it to Disabled so that the native Windows Update mechanism does not interfere with the 3rd-party patching process.' + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage end user experience\\Configure Automatic Updates. Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.108.2.1"] + - cis_csc: ["7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> 0' + + - id: 26390 + title: "Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'." + description: "This policy setting specifies when computers in your environment will receive security updates from Windows Update or WSUS. The recommended state for this setting is: 0 - Every day. Note: This setting is only applicable if 4 - Auto download and schedule the install is selected in recommendation 'Configure Automatic Updates'. It will have no impact if any other option is selected." + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to 0 - Every day: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage end user experience\\Configure Automatic Updates: Scheduled install day. Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.108.2.2"] + - cis_csc: ["7.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> 4' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay -> 0' + + - id: 26391 + title: 'Ensure ''Remove access to "Pause updates" feature'' is set to ''Enabled''.' + description: 'This policy removes access to "Pause updates" feature. The recommended state for this setting is: Enabled.' + rationale: "In order to ensure security and system updates are applied, system administrators should control when updates are applied to systems." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage end user experience\\Remove access to \"Pause updates\" feature. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.108.2.3"] + - cis_csc: ["7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> SetDisablePauseUXAccess' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> SetDisablePauseUXAccess -> 1' + + - id: 26392 + title: "Ensure 'Manage preview builds' is set to 'Disabled'." + description: "This policy setting manage which updates that are receive prior to the update being released. Dev Channel: Ideal for highly technical users. Insiders in the Dev Channel will receive builds from our active development branch that is earliest in a development cycle. These builds are not matched to a specific Windows 10 release. Beta Channel: Ideal for feature explorers who want to see upcoming Windows 10 features. Your feedback will be especially important here as it will help our engineers ensure key issues are fixed before a major release. Release Preview Channel (default): Insiders in the Release Preview Channel will have access to the upcoming release of Windows 10 prior to it being released to the world. These builds are supported by Microsoft. The Release Preview Channel is where we recommend companies preview and validate upcoming Windows 10 releases before broad deployment within their organization. The recommended state for this setting is: Disabled. Note: Preview Build enrollment requires a telemetry level setting of 2 or higher and your domain registered on insider.windows.com. For additional information on Preview Builds, see: https://aka.ms/wipforbiz" + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage updates offered from Windows Update\\Manage preview builds. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.108.4.1"] + - cis_csc: ["2.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuildsPolicyValue' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuildsPolicyValue -> 1' + + - id: 26393 + title: "Ensure 'Select when Preview Builds and Feature Updates are received' is set to 'Enabled: 180 or more days'." + description: 'This policy setting determines when Preview Build or Feature Updates are received. Defer Updates This enables devices to defer taking the next Feature Update available to your channel for up to 14 days for all the pre-release channels and up to 365 days for the Semi-Annual Channel. Or, if the device is updating from the Semi-Annual Channel, a version for the device to move to and/or stay on until the policy is updated or the device reaches end of service can be specified. Note: If you set both policies, the version specified will take precedence and the deferrals will not be in effect. Please see the Windows Release Information page for OS version information. Pause Updates To prevent Feature Updates from being received on their scheduled time, you can temporarily pause Feature Updates. The pause will remain in effect for 35 days from the specified start date or until the field is cleared (Quality Updates will still be offered). Note: If the "Allow Diagnostic Data" (formerly "Allow Telemetry") policy is set to 0, this policy will have no effect. Note #2: Starting with Windows 10 R1607, Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering. More information on Dual Scan is available at these links: - Demystifying "Dual Scan" - WSUS Product Team Blog - Improving Dual Scan on 1607 - WSUS Product Team Blog Note #3: Prior to Windows 10 R1703, values above 180 days are not recognized by the OS. Starting with Windows 10 R1703, the maximum number of days you can defer is 365 days.' + rationale: "In a production environment, it is preferred to only use software and features that are publicly available, after they have gone through rigorous testing in beta." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 180 or more days: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage updates offered from Windows Update\\Windows Update for Business\\Select when Preview Builds and Feature Updates are received. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Select when Feature Updates are received, but it was renamed to Select when Preview Builds and Feature Updates are received starting with the Windows 10 Release 1709 Administrative Templates." + compliance: + - cis: ["18.9.108.4.2"] + - cis_csc: ["2.5", "7.3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdates' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdatesPeriodInDays' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdatesPeriodInDays -> n:^(\d+) compare >= 180' + + - id: 26394 + title: "Ensure 'Select when Quality Updates are received' is set to 'Enabled: 0 days'." + description: 'This settings controls when Quality Updates are received. The recommended state for this setting is: Enabled: 0 days. Note: If the "Allow Diagnostic Data" (formerly "Allow Telemetry") policy is set to 0, this policy will have no effect. Note #2: Starting with Windows 10 R1607, Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering. More information on Dual Scan is available at these links: - Demystifying "Dual Scan" - WSUS Product Team Blog - Improving Dual Scan on 1607 - WSUS Product Team Blog' + rationale: "Quality Updates can contain important bug fixes and/or security patches, and should be installed as soon as possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled:0 days: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Windows Update for Business\\Select when Quality Updates are received Note: This Group Policy path does not exist by default. An updated Group Policy template (WindowsUpdate.admx/adml) is required - it is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.108.4.3"] + - cis_csc: ["7.3"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdatesPeriodInDays -> 0' diff --git a/etc/ruleset/sca/windows/cis_win2012r2.yml b/etc/ruleset/sca/windows/cis_win2012r2.yml new file mode 100644 index 0000000000..b2a6df7d84 --- /dev/null +++ b/etc/ruleset/sca/windows/cis_win2012r2.yml @@ -0,0 +1,4106 @@ +# Security Configuration Assessment +# CIS Checks for Windows 2012 R2 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for Microsoft Windows Server 2012 R2 v2.3.0 - 03-30-2018 + +policy: + id: "cis_win2012r2" + file: "cis_win2012r2.yml" + name: "CIS Microsoft Windows Server 2012 R2 Benchmark v2.3.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows Server 2012 R2." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform is Windows Server 2012 R2" + description: "Requirements for running the CIS benchmark under Windows Server 2012 R2" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows Server 2012 R2' + +checks: + # Section 1.1 - Password Policies + - id: 15000 + title: "Ensure 'Maximum password age' is set to '60 or fewer days, but not 0'" + description: "This policy setting defines how long a user can use their password before it expires. Values for this policy setting range from 0 to 999 days. If you set the value to 0, the password will never expire. Because attackers can crack passwords, the more frequently you change the password the less opportunity an attacker has to use a cracked password. However, the lower this value is set, the higher the potential for an increase in calls to help desk support due to users having to change their password or forgetting which password is current. The recommended state for this setting is 60 or fewer days, but not 0." + rationale: "The longer a password exists the higher the likelihood that it will be compromised by a brute force attack, by an attacker gaining general knowledge about the user, or by the user sharing the password. Configuring the Maximum password age setting to 0 so that users are never required to change their passwords is a major security risk because that allows a compromised password to be used by the malicious user for as long as the valid user is authorized access." + remediation: "To establish the recommended configuration via GP, set the following UI path to 60 or fewer days, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Maximum password age." + compliance: + - cis: ["1.1.2"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - "CCE-37167-4" + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> n:^(\d+) compare <= 60' + + # Section 2.3 - Security Options + - id: 15001 + title: "Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts'" + description: "This policy setting prevents users from adding new Microsoft accounts on this computer. The recommended state for this setting is: Users can't add or log on with Microsoft accounts." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used to log onto their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + remediation: "To establish the recommended configuration via GP, set the following UI path to Users can't add or log on with Microsoft accounts: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Block Microsoft accounts." + compliance: + - cis: ["2.3.1.2"] + - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + references: + - "CCE-36147-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> 3' + + - id: 15002 + title: "Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'" + description: "This policy setting determines whether local accounts that are not password protected can be used to log on from locations other than the physical computer console. If you enable this policy setting, local accounts that have blank passwords will not be able to log on to the network from remote client computers. Such accounts will only be able to log on at the keyboard of the computer. The recommended state for this setting is: Enabled." + rationale: "Blank passwords are a serious threat to computer security and should be forbidden through both organizational policy and suitable technical measures. In fact, the default settings for Active Directory domains require complex passwords of at least seven characters. However, if users with the ability to create new accounts bypass your domainbased password policies, they could create accounts with blank passwords. For example, a user could build a stand-alone computer, create one or more accounts with blank passwords, and then join the computer to the domain. The local accounts with blank passwords would still function. Anyone who knows the name of one of these unprotected accounts could then use it to log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Limit local account use of blank passwords to console logon only." + compliance: + - cis: ["2.3.1.4"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "CCE-37615-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse -> 1' + + - id: 15003 + title: "Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'" + description: "This policy setting allows administrators to enable the more precise auditing capabilities present in Windows Vista. The Audit Policy settings available in Windows Server 2003 Active Directory do not yet contain settings for managing the new auditing subcategories. To properly apply the auditing policies prescribed in this baseline, the Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings setting needs to be configured to Enabled. The recommended state for this setting is: Enabled. *Important*: Be very cautious about audit settings that can generate a large volume of traffic. For example, if you enable either success or failure auditing for all of the Privilege Use subcategories, the high volume of audit events generated can make it difficult to find other types of entries in the Security log. Such a configuration could also have a significant impact on system performance." + rationale: "Prior to the introduction of auditing subcategories in Windows Vista, it was difficult to track events at a per-system or per-user level. The larger event categories created too many events and the key information that needed to be audited was difficult to find." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings." + compliance: + - cis: ["2.3.2.1"] + - cis_csc: ["6.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-37850-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy -> 1' + + - id: 15004 + title: "Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'" + description: "This policy setting determines whether the system shuts down if it is unable to log Security events. It is a requirement for Trusted Computer System Evaluation Criteria (TCSEC)-C2 and Common Criteria certification to prevent auditable events from occurring if the audit system is unable to log them. Microsoft has chosen to meet this requirement by halting the system and displaying a stop message if the auditing system experiences a failure. When this policy setting is enabled, the system will be shut down if a security audit cannot be logged for any reason. If the Audit: Shut down system immediately if unable to log security audits setting is enabled, unplanned system failures can occur. The administrative burden can be significant, especially if you also configure the Retention method for the Security log to Do not overwrite events (clear log manually). This configuration causes a repudiation threat (a backup operator could deny that they backed up or restored data) to become a denial of service (DoS) vulnerability, because a server could be forced to shut down if it is overwhelmed with logon events and other security events that are written to the Security log. Also, because the shutdown is not graceful, it is possible that irreparable damage to the operating system, applications, or data could result. Although the NTFS file system guarantees its integrity when an ungraceful computer shutdown occurs, it cannot guarantee that every data file for every application will still be in a usable form when the computer restarts. The recommended state for this setting is: Disabled." + rationale: "If the computer is unable to record events to the Security log, critical evidence or important troubleshooting information may not be available for review after a security incident. Also, an attacker could potentially generate a large volume of Security log events to purposely force a computer shutdown." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Shut down system immediately if unable to log security audits." + compliance: + - cis: ["2.3.2.2"] + - cis_csc: ["6"] + - pci_dss: ["2.2.4", "10.7"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-35907-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 0' + + - id: 15005 + title: "Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators'" + description: "This policy setting determines who is allowed to format and eject removable NTFS media. You can use this policy setting to prevent unauthorized users from removing data on one computer to access it on another computer on which they have local administrator privileges. The recommended state for this setting is: Administrators." + rationale: "Users may be able to move data on removable disks to a different computer where they have administrative privileges. The user could then take ownership of any file, grant themselves full control, and view or modify any file. The fact that most removable storage devices will eject media by pressing a mechanical button diminishes the advantage of this policy setting." + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators and Interactive Users: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Allowed to format and eject removable media." + default_value: "Disabled." + compliance: + - cis: ["2.3.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-37701-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD -> 0' + + - id: 15006 + title: "Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'" + description: "For a computer to print to a shared printer, the driver for that shared printer must be installed on the local computer. This security setting determines who is allowed to install a printer driver as part of connecting to a shared printer. The recommended state for this setting is: Enabled. Note: This setting does not affect the ability to add a local printer. This setting does not affect Administrators." + rationale: "It may be appropriate in some organizations to allow users to install printer drivers on their own workstations. However, you should allow only Administrators, not users, to do so on servers, because printer driver installation on a server may unintentionally cause the computer to become less stable. A malicious user could install inappropriate printer drivers in a deliberate attempt to damage the computer, or a user might accidentally install malicious software that masquerades as a printer driver. It is feasible for an attacker to disguise a Trojan horse program as a printer driver. The program may appear to users as if they must use it to print, but such a program could unleash malicious code on your computer network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Prevent users from installing printer drivers." + compliance: + - cis: ["2.3.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4", "2,2,5"] + - nist_800_53: ["CM.1"] + - tsc: ["CC6.3", "CC5.2"] + references: + - "CCE-37942-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> 1' + + - id: 15007 + title: "Ensure 'Domain controller: Allow server operators to schedule tasks' is set to 'Disabled' (DC only)" + description: "This policy setting determines whether members of the Server Operators group are allowed to submit jobs by means of the AT schedule facility. The impact of this policy setting configuration should be small for most organizations. Users, including those in the Server Operators group, will still be able to create jobs by means of the Task Scheduler Wizard, but those jobs will run in the context of the account with which the user authenticates when they set up the job. Note: An AT Service Account can be modified to select a different account rather than the LOCAL SYSTEM account. To change the account, open System Tools, click Scheduled Tasks, and then click Accessories folder. Then click AT Service Account on the Advanced menu. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting, jobs that are created by server operators by means of the AT service will execute in the context of the account that runs that service. By default, that is the local SYSTEM account. If you enable this policy setting, server operators could perform tasks that SYSTEM is able to do but that they would typically not be able to do, such as add their account to the local Administrators group." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Allow server operators to schedule tasks." + compliance: + - cis: ["2.3.5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-37848-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SubmitControl -> 0' + + - id: 15008 + title: "Ensure 'Domain controller: LDAP server signing requirements' is set to 'Require signing' (DC only)" + description: "This policy setting determines whether the Lightweight Directory Access Protocol (LDAP) server requires LDAP clients to negotiate data signing. The recommended state for this setting is: Require signing. Note: Domain member computers must have Network security: LDAP signing requirements (Rule 2.3.11.8) set to Negotiate signing or higher. If not, they will fail to authenticate once the above Require signing value is configured on the Domain Controllers. Fortunately, Negotiate signing is the default in the client configuration. Note #2: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are shipped with Windows XP Professional use LDAP simple bind or LDAP simple bind through SSL to talk to a Domain Controller. Note #3: Before enabling this setting, you should first ensure that there are no clients (including server-based applications) that are configured to authenticate with Active Directory via unsigned LDAP, because changing this setting will break those applications. Such applications should first be reconfigured to use signed LDAP, Secure LDAP (LDAPS), or IPsec-protected connections." + rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks. In such attacks, an intruder captures packets between the server and the client, modifies them, and then forwards them to the client. Where LDAP servers are concerned, an attacker could cause a client to make decisions that are based on false records from the LDAP directory. To lower the risk of such an intrusion in an organization's network, you can implement strong physical security measures to protect the network infrastructure. Also, you could implement Internet Protocol security (IPsec) authentication header mode (AH), which performs mutual authentication and packet integrity for IP traffic to make all types of man- in-the-middle attacks extremely difficult. Additionally, allowing the use of regular, unsigned LDAP permits credentials to be received over the network in clear text, which could very easily result in the interception of account passwords by other systems on the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require signing: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: LDAP server signing requirements." + compliance: + - cis: ["2.3.5.2"] + - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - https://blogs.technet.microsoft.com/russellt/2016/01/13/identifying-clear-text-ldap-binds-to-your-dcs/ + - "CCE-35904-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters -> LDAPServerIntegrity -> 2' + + - id: 15009 + title: "Ensure 'Domain controller: Refuse machine account password changes' is set to 'Disabled' (DC only)" + description: "This security setting determines whether Domain Controllers will refuse requests from member computers to change computer account passwords. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting on all Domain Controllers in a domain, domain members will not be able to change their computer account passwords, and those passwords will be more susceptible to attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Refuse machine account password changes." + compliance: + - cis: ["2.3.5.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - "CCE-36921-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RefusePasswordChange -> 0' + + - id: 15010 + title: "Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'" + description: "This policy setting determines whether all secure channel traffic that is initiated by the domain member must be signed or encrypted. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt or sign secure channel data (always)." + compliance: + - cis: ["2.3.6.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36142-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal -> 1' + + - id: 15011 + title: "Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'" + description: "This policy setting determines whether a domain member should attempt to negotiate encryption for all secure channel traffic that it initiates. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt secure channel data (when possible)." + compliance: + - cis: ["2.3.6.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37130-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel -> 1' + + - id: 15012 + title: "Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'" + description: "This policy setting determines whether a domain member should attempt to negotiate whether all secure channel traffic that it initiates must be digitally signed. Digital signatures protect the traffic from being modified by anyone who captures the data as it traverses the network. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally sign secure channel data (when possible)." + compliance: + - cis: ["2.3.6.3"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37222-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel -> 1' + + - id: 15013 + title: "Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'" + description: "This policy setting determines whether a domain member can periodically change its computer account password. Computers that cannot automatically change their account passwords are potentially vulnerable, because an attacker might be able to determine the password for the system's domain account. The recommended state for this setting is: Disabled." + rationale: "The default configuration for Windows Server 2003-based computers that belong to a domain is that they are automatically required to change the passwords for their accounts every 30 days. If you disable this policy setting, computers that run Windows Server 2003 will retain the same passwords as their computer accounts. Computers that are no longer able to automatically change their account password are at risk from an attacker who could determine the password for the computer's domain account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Disable machine account password changes." + compliance: + - cis: ["2.3.6.4"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - "CCE-37508-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange -> 0' + + - id: 15014 + title: "Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'" + description: "When this policy setting is enabled, a secure channel can only be established with Domain Controllers that are capable of encrypting secure channel data with a strong (128-bit) session key. To enable this policy setting, all Domain Controllers in the domain must be able to encrypt secure channel data with a strong key, which means all Domain Controllers must be running Microsoft Windows 2000 or newer. The recommended state for this setting is: Enabled." + rationale: "Session keys that are used to establish secure channel communications between Domain Controllers and member computers are much stronger in Windows 2000 than they were in previous Microsoft operating systems. Whenever possible, you should take advantage of these stronger session keys to help protect secure channel communications from attacks that attempt to hijack network sessions and eavesdropping. (Eavesdropping is a form of hacking in which network data is read or altered in transit. The data can be modified to hide or change the sender, or be redirected.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Require strong (Windows 2000 or later) session key." + compliance: + - cis: ["2.3.6.6"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37614-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey -> 1' + + - id: 15015 + title: "Ensure 'Interactive logon: Do not display last user name' is set to 'Enabled'" + description: "This policy setting determines whether the account name of the last user to log on to the client computers in your organization will be displayed in each computer's respective Windows logon screen. Enable this policy setting to prevent intruders from collecting account names visually from the screens of desktop or laptop computers in your organization. The recommended state for this setting is: Enabled." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Do not display last user name." + compliance: + - cis: ["2.3.7.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-36056-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName -> 1' + + - id: 15016 + title: "Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'" + description: "This policy setting determines whether users must press CTRL+ALT+DEL before they log on. The recommended state for this setting is: Disabled." + rationale: "Microsoft developed this feature to make it easier for users with certain types of physical impairments to log on to computers that run Windows. If users are not required to press CTRL+ALT+DEL, they are susceptible to attacks that attempt to intercept their passwords. If CTRL+ALT+DEL is required before logon, user passwords are communicated by means of a trusted path. An attacker could install a Trojan horse program that looks like the standard Windows logon dialog box and capture the user's password. The attacker would then be able to log on to the compromised account with whatever level of privilege that user has." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Do not require CTRL+ALT+DEL" + compliance: + - cis: ["2.3.7.2"] + - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-37637-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD -> 0' + + - id: 15017 + title: "Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'" + description: "Windows notices inactivity of a logon session, and if the amount of inactive time exceeds the inactivity limit, then the screen saver will run, locking the session. The recommended state for this setting is: 900 or fewer second(s), but not 0. Note: A value of 0 does not conform to the benchmark as it disables the machine inactivity limit." + rationale: "If a user forgets to lock their computer when they walk away it's possible that a passerby will hijack it." + remediation: "To establish the recommended configuration via GP, set the following UI path to 900 or fewer seconds, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Machine inactivity limit." + compliance: + - cis: ["2.3.7.3"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - "CCE-38235-8" + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 0' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> n:^(\d+) compare <= 900' + + - id: 15018 + title: "Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)'" + description: "This policy setting determines whether a user can log on to a Windows domain using cached account information. Logon information for domain accounts can be cached locally to allow users to log on even if a Domain Controller cannot be contacted. This policy setting determines the number of unique users for whom logon information is cached locally. If this value is set to 0, the logon cache feature is disabled. An attacker who is able to access the file system of the server could locate this cached information and use a brute force attack to determine user passwords. The recommended state for this setting is: 4 or fewer logon(s) ." + rationale: "The number that is assigned to this policy setting indicates the number of users whose logon information the computer will cache locally. If the number is set to 4, then the computer caches logon information for 4 users. When a 5th user logs on to the computer, the server overwrites the oldest cached logon session. Users who access the computer console will have their logon credentials cached on that computer. An attacker who is able to access the file system of the computer could locate this cached information and use a brute force attack to attempt to determine user passwords. To mitigate this type of attack, Windows encrypts the information and obscures its physical location." + remediation: "To establish the recommended configuration via GP, set the following UI path to 4 or fewer logon(s) : Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Number of previous logons to cache (in case domain controller is not available)" + compliance: + - cis: ["2.3.7.6"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - "CCE-37439-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> n:^(\d+) compare <= 4' + + - id: 15019 + title: "Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'" + description: "This policy setting determines how far in advance users are warned that their password will expire. It is recommended that you configure this policy setting to at least 5 days but no more than 14 days to sufficiently warn users when their passwords will expire. The recommended state for this setting is: between 5 and 14 days." + rationale: "It is recommended that user passwords be configured to expire periodically. Users will need to be warned that their passwords are going to expire, or they may inadvertently be locked out of the computer when their passwords expire. This condition could lead to confusion for users who access the network locally, or make it impossible for users to access your organization's network through dial-up or virtual private network (VPN) connections." + remediation: "To establish the recommended configuration via GP, set the following UI path to a value between 5 and 14 days: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Prompt user to change password before expiration." + compliance: + - cis: ["2.3.7.7"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - "CCE-37622-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare >= 5' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare >= 5 && n:^(\d+) compare <= 14' + + - id: 15020 + title: "Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled'" + description: "Logon information is required to unlock a locked computer. For domain accounts, this security setting determines whether it is necessary to contact a Domain Controller to unlock a computer. The recommended state for this setting is: Enabled ." + rationale: "By default, the computer caches in memory the credentials of any users who are authenticated locally. The computer uses these cached credentials to authenticate anyone who attempts to unlock the console. When cached credentials are used, any changes that have recently been made to the account - such as user rights assignments, account lockout, or the account being disabled - are not considered or applied after the account is authenticated. User privileges are not updated, and (more importantly) disabled accounts are still able to unlock the console of the computer." + remediation: "To implement the recommended configuration via GP, set the following UI path to Enabled:Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Require Domain Controller Authentication to unlock workstation" + compliance: + - cis: ["2.3.7.8"] + - cis_csc: ["16.9"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + references: + - "CCE-38240-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ForceUnlockLogon -> 1' + + - id: 15021 + title: "Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher" + description: "This policy setting determines what happens when the smart card for a logged-on user is removed from the smart card reader. The recommended state for this setting is: Lock Workstation. Configuring this setting to Force Logoff or Disconnect if a Remote Desktop Services session also conforms to the benchmark." + rationale: "Users sometimes forget to lock their workstations when they are away from them, allowing the possibility for malicious users to access their computers. If smart cards are used for authentication, the computer should automatically lock itself when the card is removed to ensure that only the user with the smart card is accessing resources using those credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Lock Workstation (or, if applicable for your environment, Force Logoff or Disconnect if a Remote Desktop Services session): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Smart card removal behavior." + compliance: + - cis: ["2.3.7.9"] + - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + references: + - "CCE-38333-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption -> r:^1$|^2$|^3$' + + - id: 15022 + title: "Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'" + description: "This policy setting determines whether packet signing is required by the SMB client component. Note: When Windows Vista-based computers have this policy setting enabled and they connect to file or print shares on remote servers, it is important that the setting is synchronized with its companion setting, Microsoft network server: Digitally sign communications (always), on those servers. For more information about these settings, see the 'Microsoft network client and server: Digitally sign communications (four related settings)' section in Chapter 5 of the Threats and Countermeasures guide. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (always)." + compliance: + - cis: ["2.3.8.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36325-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> 1' + + - id: 15023 + title: "Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'" + description: "This policy setting determines whether the SMB client will attempt to negotiate SMB packet signing. Note: Enabling this policy setting on SMB clients on your network makes them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (if server agrees)." + compliance: + - cis: ["2.3.8.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36269-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> 1' + + - id: 15024 + title: "Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'" + description: "This policy setting determines whether the SMB redirector will send plaintext passwords during authentication to third-party SMB servers that do not support password encryption. It is recommended that you disable this policy setting unless there is a strong business case to enable it. If this policy setting is enabled, unencrypted passwords will be allowed across the network. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting, the server can transmit passwords in plaintext across the network to other computers that offer SMB services, which is a significant security risk. These other computers may not use any of the SMB security mechanisms that are included with Windows Server 2003." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Send unencrypted password to third-party SMB servers." + compliance: + - cis: ["2.3.8.3"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37863-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword -> 0' + + - id: 15025 + title: "Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0'" + description: "This policy setting allows you to specify the amount of continuous idle time that must pass in an SMB session before the session is suspended because of inactivity. Administrators can use this policy setting to control when a computer suspends an inactive SMB session. If client activity resumes, the session is automatically reestablished. A value of 0 appears to allow sessions to persist indefinitely. The maximum value is 99999, which is over 69 days; in effect, this value disables the setting. The recommended state for this setting is: 15 or fewer minute(s), but not 0." + rationale: "Each SMB session consumes server resources, and numerous null sessions will slow the server or possibly cause it to fail. An attacker could repeatedly establish SMB sessions until the server's SMB services become slow or unresponsive." + remediation: "To establish the recommended configuration via GP, set the following UI path to 15 or fewer minute(s), but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Amount of idle time required before suspending session." + compliance: + - cis: ["2.3.9.1"] + - cis_csc: ["3"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - "CCE-38046-9" + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> 0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> n:^(\d+) compare <= 15' + + - id: 15026 + title: "Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'" + description: "This policy setting determines whether packet signing is required by the SMB server component. Enable this policy setting in a mixed environment to prevent downstream clients from using the workstation as a network server. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (always)." + compliance: + - cis: ["2.3.9.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37864-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature -> 1' + + - id: 15027 + title: "Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'" + description: "This policy setting determines whether the SMB server will negotiate SMB packet signing with clients that request it. If no signing request comes from the client, a connection will be allowed without a signature if the Microsoft network server: Digitally sign communications (always) setting is not enabled. Note: Enable this policy setting on SMB clients on your network to make them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (if client agrees)." + compliance: + - cis: ["2.3.9.3"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-35988-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature -> 1' + + - id: 15028 + title: "Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'" + description: "This security setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Network security: Force logoff when logon hours expire (Rule 2.3.11.6). If your organization configures logon hours for users, this policy setting is necessary to ensure they are effective. The recommended state for this setting is: Enabled." + rationale: "If your organization configures logon hours for users, then it makes sense to enable this policy setting. Otherwise, users who should not have access to network resources outside of their logon hours may actually be able to continue to use those resources with sessions that were established during allowed hours." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Disconnect clients when logon hours expire." + compliance: + - cis: ["2.3.9.4"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-37972-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' + + - id: 15029 + title: "Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher" + description: "This policy setting controls the level of validation a computer with shared folders or printers (the server) performs on the service principal name (SPN) that is provided by the client computer when it establishes a session using the server message block (SMB) protocol. The server message block (SMB) protocol provides the basis for file and print sharing and other networking operations, such as remote Windows administration. The SMB protocol supports validating the SMB server service principal name (SPN) within the authentication blob provided by a SMB client to prevent a class of attacks against SMB servers referred to as SMB relay attacks. This setting will affect both SMB1 and SMB2. The recommended state for this setting is: Accept if provided by client . Configuring this setting to Required from client also conforms to the benchmark. Note: Since the release of the MS KB3161561 security patch, this setting can cause significant issues (such as replication problems, group policy editing issues and blue screen crashes) on Domain Controllers when used simultaneously with UNC path hardening (i.e. Rule 18.5.14.1). CIS therefore recommends against deploying this setting on Domain Controllers." + rationale: "The identity of a computer can be spoofed to gain unauthorized access to network resources." + remediation: "To establish the recommended configuration via GP, set the following UI path to Accept if provided by client (configuring to Required from client also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Server SPN target name validation level" + compliance: + - cis: ["2.3.9.5"] + - cis_csc: ["14"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - https://support.microsoft.com/en-us/help/3161561/ms16-075-and-ms16-076-description-of-the-security-update-for-windows-n + - "CCE-36170-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel -> n:^(\d+) compare >= 1' + + # Section 2.3 - Security Options + + - id: 15030 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled'" + description: "This policy setting controls the ability of anonymous users to enumerate the accounts in the Security Accounts Manager (SAM). If you enable this policy setting, users with anonymous connections will not be able to enumerate domain account user names on the systems in your environment. This policy setting also allows additional restrictions on anonymous connections. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts." + compliance: + - cis: ["2.3.10.2"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36316-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM -> 1' + + - id: 15031 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled'" + description: "This policy setting controls the ability of anonymous users to enumerate SAM accounts as well as shares. If you enable this policy setting, anonymous users will not be able to enumerate domain account user names and network share names on the systems in your environment. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information)" + remediation: "To establish the recommended configuration via GP, set the following U path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts and shares." + compliance: + - cis: ["2.3.10.3"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36316-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous -> 1' + + - id: 15032 + title: "Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'" + description: "This policy setting determines whether Credential Manager (formerly called Stored User Names and Passwords) saves passwords or credentials for later use when it gains domain authentication. The recommended state for this setting is: Enabled. Note: Changes to this setting will not take effect until Windows is restarted." + rationale: "Passwords that are cached can be accessed by the user when logged on to the computer. Although this information may sound obvious, a problem can arise if the user unknowingly executes hostile code that reads the passwords and forwards them to another, unauthorized user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow storage of passwords and credentials for network authentication." + compliance: + - cis: ["2.3.10.4"] + - cis_csc: ["16.14"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-38119-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> 1' + + - id: 15033 + title: "Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'" + description: "This policy setting determines what additional permissions are assigned for anonymous connections to the computer. The recommended state for this setting is: Disabled." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords, perform social engineering attacks, or launch DoS attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Let Everyone permissions apply to anonymous users." + compliance: + - cis: ["2.3.10.5"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36148-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 0' + + - id: 15034 + title: "Configure 'Network access: Named Pipes that can be accessed anonymously'" + description: "This policy setting determines which communication sessions, or pipes, will have attributes and permissions that allow anonymous access. The recommended state for this setting is: - Level 1 - Domain Controller. The recommended state for this setting is: LSARPC, NETLOGON, SAMR and (when the legacy Computer Browser service is enabled) BROWSER. - Level 1 - Member Server. The recommended state for this setting is: (i.e. None), or (when the legacy Computer Browser service is enabled) BROWSER. Note: A Member Server that holds the Remote Desktop Services Role with Remote Desktop Licensing Role Service will require a special exception to this recommendation, to allow the HydraLSPipe and TermServLicensing Named Pipes to be accessed anonymously." + rationale: "Limiting named pipes that can be accessed anonymously will reduce the attack surface of the system." + remediation: "To establish the recommended configuration via GP, configure the following UI path: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Named Pipes that can be accessed anonymously." + compliance: + - cis: ["2.3.10.6"] + - cis_csc: ["14.1", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-38258-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:lsarpc && r:netlogon && r:samr' + + - id: 15035 + title: "Configure 'Network access: Remotely accessible registry paths'" + description: "This policy setting determines which registry paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: This setting does not exist in Windows XP. There was a setting with that name in Windows XP, but it is called 'Network access: Remotely accessible registry paths and sub- paths' in Windows Server 2003, Windows Vista, and Windows Server 2008 (non-R2). Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value." + rationale: "The registry is a database that contains computer configuration information, and much of the information is sensitive. An attacker could use this information to facilitate unauthorized activities. To reduce the risk of such an attack, suitable ACLs are assigned throughout the registry to help protect it from access by unauthorized users." + remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\ProductOptions | System\\CurrentControlSet\\Control\\Server Applications | Software\\Microsoft\\Windows NT\\CurrentVersion. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Remotely accessible registry paths." + compliance: + - cis: ["2.3.10.7"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-37194-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:System\\CurrentControlSet\\Control\\ProductOptions' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Server Applications' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion' + + - id: 15036 + title: "Configure 'Network access: Remotely accessible registry paths and sub-paths'" + description: "This policy setting determines which registry paths and sub-paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: In Windows XP this setting is called 'Network access: Remotely accessible registry paths,' the setting with that same name in Windows Vista, Windows Server 2008 (non-R2), and Windows Server 2003 does not exist in Windows XP. Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value." + rationale: "The registry contains sensitive computer configuration information that could be used by an attacker to facilitate unauthorized activities. The fact that the default ACLs assigned throughout the registry are fairly restrictive and help to protect the registry from access by unauthorized users reduces the risk of such an attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\Print\\Printers | System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server | Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows | NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex | System\\CurrentControlSet\\Control\\Terminal Server | System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig | System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration | Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib | System\\CurrentControlSet\\Services\\SysmonLog | Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local | Policies\\Security Options\\Network access: Remotely accessible registry paths | and sub-paths. When a server holds the Active Directory Certificate Services Role with Certification Authority Role Service, the above list should also include: System\\CurrentControlSet\\Services\\CertSvc. When a server has the WINS Server Feature installed, the above list should also include: System\\CurrentControlSet\\Services\\WINS" + compliance: + - cis: ["2.3.10.8"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36347-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Print\\Printers' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Services\\SysmonLog' + + - id: 15037 + title: "Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'" + description: "When enabled, this policy setting restricts anonymous access to only those shares and pipes that are named in the Network access: Named pipes that can be accessed anonymously and Network access: Shares that can be accessed anonymously settings. This policy setting controls null session access to shares on your computers by adding RestrictNullSessAccess with the value 1 in the HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanManServer\\Parameters registry key. This registry value toggles null session shares on or off to control whether the server service restricts unauthenticated clients' access to named resources. The recommended state for this setting is: Enabled." + rationale: "Null sessions are a weakness that can be exploited through shares (including the default shares) on computers in your environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict anonymous access to Named Pipes and Shares." + compliance: + - cis: ["2.3.10.9"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36021-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess -> 1' + + - id: 15038 + title: "Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'" + description: "This policy setting determines which network shares can be accessed by anonymous users. The default configuration for this policy setting has little effect because all users have to be authenticated before they can access shared resources on the server. The recommended state for this setting is: (i.e. None)." + rationale: "It is very dangerous to allow any values in this setting. Any shares that are listed can be accessed by any network user, which could lead to the exposure or corruption of sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to (i.e. None): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Shares that can be accessed anonymously." + compliance: + - cis: ["2.3.10.10"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-38095-6" + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> r:\.' + - id: 15039 + title: "Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'" + description: "This policy setting determines how network logons that use local accounts are authenticated. The Classic option allows precise control over access to resources, including the ability to assign different types of access to different users for the same resource. The Guest only option allows you to treat all users equally. In this context, all users authenticate as Guest only to receive the same access level to a given resource. The recommended state for this setting is: Classic - local users authenticate as themselves. Note: This setting does not affect interactive logons that are performed remotely by using such services as Telnet or Remote Desktop Services (formerly called Terminal Services)." + rationale: "With the Guest only model, any user who can authenticate to your computer over the network does so with guest privileges, which probably means that they will not have write access to shared resources on that computer. Although this restriction does increase security, it makes it more difficult for authorized users to access shared resources on those computers because ACLs on those resources must include access control entries (ACEs) for the Guest account. With the Classic model, local accounts should be password protected. Otherwise, if Guest access is enabled, anyone can use those user accounts to access shared system resources." + remediation: "To establish the recommended configuration via GP, set the following UI path to Classic - local users authenticate as themselves: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Sharing and security model for local accounts." + compliance: + - cis: ["2.3.10.11"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1.3"] + - tsc: ["CC6.4"] + references: + - "CCE-37623-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest -> 0' + + - id: 15040 + title: "Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'" + description: "This policy setting determines whether Local System services that use Negotiate when reverting to NTLM authentication can use the computer identity. This policy is supported on at least Windows 7 or Windows Server 2008 R2. The recommended state for this setting is: Enabled." + rationale: "When connecting to computers running versions of Windows earlier than Windows Vista or Windows Server 2008 (non-R2), services running as Local System and using SPNEGO (Negotiate) that revert to NTLM use the computer identity. In Windows 7, if you are connecting to a computer running Windows Server 2008 or Windows Vista, then a system service uses either the computer identity or a NULL session. When connecting with a NULL session, a system-generated session key is created, which provides no protection but allows applications to sign and encrypt data without errors. When connecting with the computer identity, both signing and encryption is supported in order to provide data protection." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow Local System to use computer identity for NTLM." + compliance: + - cis: ["2.3.11.1"] + - cis_csc: ["14", "16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-38341-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> UseMachineId -> 1' + + - id: 15041 + title: "Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'" + description: "This policy setting determines whether NTLM is allowed to fall back to a NULL session when used with LocalSystem. The recommended state for this setting is: Disabled." + rationale: "NULL sessions are less secure because by definition they are unauthenticated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow LocalSystem NULL session fallback." + compliance: + - cis: ["2.3.11.2"] + - cis_csc: ["14"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37035-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback -> 0' + + - id: 15042 + title: "Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'" + description: "This setting determines if online identities are able to authenticate to this computer. The Public Key Cryptography Based User-to-User (PKU2U) protocol introduced in Windows 7 and Windows Server 2008 R2 is implemented as a security support provider (SSP). The SSP enables peer-to-peer authentication, particularly through the Windows 7 media and file sharing feature called Homegroup, which permits sharing between computers that are not members of a domain. With PKU2U, a new extension was introduced to the Negotiate authentication package, Spnego.dll. In previous versions of Windows, Negotiate decided whether to use Kerberos or NTLM for authentication. The extension SSP for Negotiate, Negoexts.dll, which is treated as an authentication protocol by Windows, supports Microsoft SSPs including PKU2U. When computers are configured to accept authentication requests by using online IDs, Negoexts.dll calls the PKU2U SSP on the computer that is used to log on. The PKU2U SSP obtains a local certificate and exchanges the policy between the peer computers. When validated on the peer computer, the certificate within the metadata is sent to the logon peer for validation and associates the user's certificate to a security token and the logon process completes. The recommended state for this setting is: Disabled." + rationale: "The PKU2U protocol is a peer-to-peer authentication protocol - authentication should be managed centrally in most managed networks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network Security: Allow PKU2U authentication requests to this computer to use online identities." + compliance: + - cis: ["2.3.11.3"] + - cis_csc: ["16.9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-38047-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID -> 0' + + - id: 15043 + title: "Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types'" + description: "This policy setting allows you to set the encryption types that Kerberos is allowed to use. The recommended state for this setting is: AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types. Note: Some legacy applications and OSes may require RC4_HMAC_MD5 - we recommend you test in your environment and verify whether you can safely remove it. For the purposes of scoring we have allowed the use of RC4_HMAC_MD5 as an optional setting." + rationale: "he strength of each encryption algorithm varies from one to the next, choosing stronger algorithms will reduce the risk of compromise however doing so may cause issues when the computer attempts to authenticate with systems that do not support them." + remediation: "To establish the recommended configuration via GP, set the following UI path to AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Configure encryption types allowed for Kerberos." + compliance: + - cis: ["2.3.11.4"] + - cis_csc: ["16.14"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37755-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> r:r:2147483644|2147483640' + + - id: 15044 + title: "Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'" + description: "This policy setting determines whether the LAN Manager (LM) hash value for the new password is stored when the password is changed. The LM hash is relatively weak and prone to attack compared to the cryptographically stronger Microsoft Windows NT hash. Since LM hashes are stored on the local computer in the security database, passwords can then be easily compromised if the database is attacked. Note: Older operating systems and some third-party applications may fail when this policy setting is enabled. Also, note that the password will need to be changed on all accounts after you enable this setting to gain the proper benefit. The recommended state for this setting is: Enabled." + rationale: "The SAM file can be targeted by attackers who seek access to username and password hashes. Such attacks use special tools to crack passwords, which can then be used to impersonate users and gain access to resources on your network. These types of attacks will not be prevented if you enable this policy setting, but it will be much more difficult for these types of attacks to succeed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Do not store LAN Manager hash value on next password change." + compliance: + - cis: ["2.3.11.5"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-36326-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash -> 1' + + - id: 15045 + title: "Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'" + description: "This policy setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Microsoft network server: Disconnect clients when logon hours expire (Rule 2.3.9.4). The recommended state for this setting is: Enabled. Note: This recommendation is unscored because there is not a documented registry value that corresponds to it. We still strongly encourage that it be configured as Enabled, to ensure that logon hours (when configured) are properly enforced." + rationale: "If this setting is disabled, a user could remain connected to the computer outside of their allotted logon hours." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Force logoff when logon hours expire." + compliance: + - cis: ["2.3.11.6"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36270-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' + + - id: 15046 + title: "Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'" + description: "LAN Manager (LM) was a family of early Microsoft client/server software (predating Windows NT) that allowed users to link personal computers together on a single network. LM network capabilities included transparent file and print sharing, user security features, and network administration tools. In Active Directory domains, the Kerberos protocol is the default authentication protocol. However, if the Kerberos protocol is not negotiated for some reason, Active Directory will use LM, NTLM, or NTLMv2. LAN Manager authentication includes the LM, NTLM, and NTLM version 2 (NTLMv2) variants, and is the protocol that is used to authenticate all Windows clients when they perform the following operations: -Join a domain -Authenticate between Active Directory forests -Authenticate to down-level domains -Authenticate to computers that do not run Windows 2000, Windows Server 2003, or Windows XP -Authenticate to computers that are not in the domain. The Network security: LAN Manager authentication level setting determines which challenge/response authentication protocol is used for network logons. This choice affects the level of authentication protocol used by clients, the level of session security negotiated, and the level of authentication accepted by servers. The recommended state for this setting is: Send NTLMv2 response only. Refuse LM & NTLM." + rationale: "Windows 2000 and Windows XP clients were configured by default to send LM and NTLM authentication responses (Windows 95-based and Windows 98-based clients only send LM). The default settings in OSes predating Windows Vista / Windows Server 2008 (non- R2) allowed all clients to authenticate with servers and use their resources. However, this meant that LM responses - the weakest form of authentication response - were sent over the network, and it was potentially possible for attackers to sniff that traffic to more easily reproduce the user's password. The Windows 95, Windows 98, and Windows NT operating systems cannot use the Kerberos version 5 protocol for authentication. For this reason, in a Windows Server 2003 domain, these computers authenticate by default with both the LM and NTLM protocols for network authentication. You can enforce a more secure authentication protocol for Windows 95, Windows 98, and Windows NT by using NTLMv2. For the logon process, NTLMv2 uses a secure channel to protect the authentication process. Even if you use NTLMv2 for older clients and servers, Windows-based clients and servers that are members of the domain will use the Kerberos authentication protocol to authenticate with Windows Server 2003 or newer Domain Controllers. For these reasons, it is strongly preferred to restrict the use of LM & NTLM (non-v2) as much as possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Send NTLMv2 response only. Refuse LM & NTLM: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LAN Manager authentication level." + compliance: + - cis: ["2.3.11.7"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36173-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 5' + + - id: 15047 + title: "Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher" + description: "This policy setting determines the level of data signing that is requested on behalf of clients that issue LDAP BIND requests. Note: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are included with Windows XP Professional use ldap_simple_bind or ldap_simple_bind_s to communicate with a Domain Controller. The recommended state for this setting is: Negotiate signing. Configuring this setting to Require signing also conforms to the benchmark." + rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks in which an intruder captures the packets between the client and server, modifies them, and then forwards them to the server. For an LDAP server, this susceptibility means that an attacker could cause a server to make decisions that are based on false or altered data from the LDAP queries. To lower this risk in your network, you can implement strong physical security measures to protect the network infrastructure. Also, you can make all types of man-in-the-middle attacks extremely difficult if you require digital signatures on all network packets by means of IPsec authentication headers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Negotiate signing (configuring to Require signing also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LDAP client signing requirements." + compliance: + - cis: ["2.3.11.8"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36858-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> n:^(\d+) compare >= 1' + + - id: 15048 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" + description: "This policy setting determines which behaviors are allowed by clients for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable both options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. In other words, these options help protect against man-in-the-middle attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) clients." + compliance: + - cis: ["2.3.11.9"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37553-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec -> 537395200' + + - id: 15049 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" + description: "This policy setting determines which behaviors are allowed by servers for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable all of the options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. That is, these options help protect against man-in-the-middle attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) servers." + compliance: + - cis: ["2.3.11.10"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - https://workbench.cisecurity.org/benchmarks/288 + - "CCE-37835-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec -> 537395200' + + - id: 15050 + title: "Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled'" + description: "This policy setting determines whether a computer can be shut down when a user is not logged on. If this policy setting is enabled, the shutdown command is available on the Windows logon screen. It is recommended to disable this policy setting to restrict the ability to shut down the computer to users with credentials on the system. The recommended state for this setting is: Disabled. Note: In Server 2008 R2 and older versions, this setting had no impact on Remote Desktop (RDP) / Terminal Services sessions - it only affected the local console. However, Microsoft changed the behavior in Windows Server 2012 (non-R2) and above, where if set to Enabled, RDP sessions are also allowed to shut down or restart the server." + rationale: "Users who can access the console locally could shut down the computer. Attackers could also walk to the local console and restart the server, which would cause a temporary DoS condition. Attackers could also shut down the server and leave all of its applications and services unavailable. As noted in the Description above, the Denial of Service (DoS) risk of enabling this setting dramatically increases in Windows Server 2012 (non-R2) and above, as even remote users could then shut down or restart the server from the logon screen of an RDP session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Shutdown: Allow system to be shut down without having to log on." + compliance: + - cis: ["2.3.13.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36788-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ShutdownWithoutLogon -> 0' + + - id: 15051 + title: "Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'" + description: "This policy setting determines whether case insensitivity is enforced for all subsystems. The Microsoft Win32 subsystem is case insensitive. However, the kernel supports case sensitivity for other subsystems, such as the Portable Operating System Interface for UNIX (POSIX). Because Windows is case insensitive (but the POSIX subsystem will support case sensitivity), failure to enforce this policy setting makes it possible for a user of the POSIX subsystem to create a file with the same name as another file by using mixed case to label it. Such a situation can block access to these files by another user who uses typical Win32 tools, because only one of the files will be available. The recommended state for this setting is: Enabled." + rationale: "Because Windows is case-insensitive but the POSIX subsystem will support case sensitivity, failure to enable this policy setting would make it possible for a user of that subsystem to create a file with the same name as another file but with a different mix of upper and lower case letters. Such a situation could potentially confuse users when they try to access such files from normal Win32 tools because only one of the files will be available." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Require case insensitivity for non- Windows subsystems." + compliance: + - cis: ["2.3.15.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-37885-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive -> 1' + + - id: 15052 + title: "Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'" + description: "This policy setting determines the strength of the default discretionary access control list (DACL) for objects. Active Directory maintains a global list of shared system resources, such as DOS device names, mutexes, and semaphores. In this way, objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and what permissions are granted. The recommended state for this setting is: Enabled." + rationale: "This setting determines the strength of the default DACL for objects. Windows maintains a global list of shared computer resources so that objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and with what permissions." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)." + compliance: + - cis: ["2.3.15.2"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-37644-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode -> 1' + + - id: 15053 + title: "Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'" + description: "This policy setting controls the behavior of Admin Approval Mode for the built-in Administrator account. The recommended state for this setting is: Enabled." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. An attack vector for these programs was to discover the password of the account named 'Administrator' because that user account was created for all installations of Windows. To address this risk, in Windows Vista and newer, the built-in Administrator account is now disabled by default. In a default installation of a new computer, accounts with administrative control over the computer are initially set up in one of two ways: - If the computer is not joined to a domain, the first user account you create has the equivalent permissions as a local administrator. -If the computer is joined to a domain, no local administrator accounts are created. The Enterprise or Domain Administrator must log on to the computer and create one if a local administrator account is warranted. Once Windows is installed, the built-in Administrator account may be manually enabled, but we strongly recommend that this account remain disabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Admin Approval Mode for the Built-in Administrator account." + compliance: + - cis: ["2.3.17.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36494-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken -> 1' + + - id: 15054 + title: "Ensure 'User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop' is set to 'Disabled'" + description: "This policy setting controls whether User Interface Accessibility (UIAccess or UIA) programs can automatically disable the secure desktop for elevation prompts used by a standard user. The recommended state for this setting is: Disabled." + rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting allows the administrator to perform operations that require elevated privileges while connected via Remote Assistance. This increases security in that organizations can use UAC even when end user support is provided remotely. However, it also reduces security by adding the risk that an administrator might allow an unprivileged user to share elevated privileges for an application that the administrator needs to use during the Remote Desktop session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop." + compliance: + - cis: ["2.3.17.2"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36863-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableUIADesktopToggle -> 0' + + - id: 15055 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'" + description: "This policy setting controls the behavior of the elevation prompt for administrators. The recommended state for this setting is: Prompt for consent on the secure desktop." + rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting raises awareness to the administrator of elevated privilege operations and permits the administrator to prevent a malicious program from elevating its privilege when the program attempts to do so." + remediation: "To establish the recommended configuration via GP, set the following UI path to Prompt for consent on the secure desktop: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode." + compliance: + - cis: ["2.3.17.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-37029-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> 2' + + - id: 15056 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'" + description: "This policy setting controls the behavior of the elevation prompt for standard users. The recommended state for this setting is: Automatically deny elevation requests." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious programs running under elevated credentials without the user or administrator being aware of their activity. This setting raises awareness to the user that a program requires the use of elevated privilege operations and requires that the user be able to supply administrative credentials in order for the program to run." + remediation: "To establish the recommended configuration via GP, set the following UI path to Automatically deny elevation requests: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for standard users." + compliance: + - cis: ["2.3.17.4"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1.2"] + - tsc: ["CC6.4"] + references: + - "CCE-36864-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser -> 0' + + - id: 15057 + title: "Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'" + description: "This policy setting controls the behavior of application installation detection for the computer. The recommended state for this setting is: Enabled." + rationale: "Some malicious software will attempt to install itself after being given permission to run. For example, malicious software with a trusted application shell. The user may have given permission for the program to run because the program is trusted, but if they are then prompted for installation of an unknown component this provides another way of trapping the software before it can do damage." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Detect application installations and prompt for elevation." + compliance: + - cis: ["2.3.17.5"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36533-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 1' + + - id: 15058 + title: "Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'" + description: "This policy setting controls whether applications that request to run with a User Interface Accessibility (UIAccess) integrity level must reside in a secure location in the file system. Secure locations are limited to the following: ...\\Program Files\\, including subfolders; ...\\Windows\\system32\\; ...\\Program Files (x86)\\, including subfolders (for 64-bit versions of Windows). Note: Windows enforces a public key infrastructure (PKI) signature check on any interactive application that requests to run with a UIAccess integrity level regardless of the state of this security setting. The recommended state for this setting is: Enabled." + rationale: "UIAccess Integrity allows an application to bypass User Interface Privilege Isolation (UIPI) restrictions when an application is elevated in privilege from a standard user to an administrator. This is required to support accessibility features such as screen readers that are transmitting user interfaces to alternative forms. A process that is started with UIAccess rights has the following abilities: -To set the foreground window. -To drive any application window using SendInput function. -To use read input for all integrity levels using low-level hooks, raw input, GetKeyState, GetAsyncKeyState, and GetKeyboardInput. -To set journal hooks. -To uses AttachThreadInput to attach a thread to a higher integrity input queue." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Only elevate UIAccess applications that are installed in secure locations." + compliance: + - cis: ["2.3.17.6"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-37057-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths -> 1' + + - id: 15059 + title: "Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'" + description: "This policy setting controls the behavior of all User Account Control (UAC) policy settings for the computer. If you change this policy setting, you must restart your computer. The recommended state for this setting is: Enabled. Note: If this policy setting is disabled, the Security Center notifies you that the overall security of the operating system has been reduced." + rationale: "This is the setting that turns on or off UAC. If this setting is disabled, UAC will not be used and any security benefits and risk mitigations that are dependent on UAC will not be present on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Run all administrators in Admin Approval Mode." + compliance: + - cis: ["2.3.17.7"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36869-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA -> 1' + + - id: 15060 + title: "Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'" + description: "This policy setting controls whether the elevation request prompt is displayed on the interactive user's desktop or the secure desktop. The recommended state for this setting is: Enabled." + rationale: "Standard elevation prompt dialog boxes can be spoofed, which may cause users to disclose their passwords to malicious software. The secure desktop presents a very distinct appearance when prompting for elevation, where the user desktop dims, and the elevation prompt UI is more prominent. This increases the likelihood that users who become accustomed to the secure desktop will recognize a spoofed elevation prompt dialog box and not fall for the trick." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Switch to the secure desktop when prompting for elevation." + compliance: + - cis: ["2.3.17.8"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36866-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop -> 1' + + - id: 15061 + title: "Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'" + description: "This policy setting controls whether application write failures are redirected to defined registry and file system locations. This policy setting mitigates applications that run as administrator and write run-time application data to: - %ProgramFiles% - %Windir% - %Windir%\\system32 - HKEY_LOCAL_MACHINE\\Software. The recommended state for this setting is: Enabled." + rationale: "This setting reduces vulnerabilities by ensuring that legacy applications only write data to permitted locations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Virtualize file and registry write failures to per-user locations." + compliance: + - cis: ["2.3.17.9"] + - pci_dss: ["6.5.8"] + - tsc: ["CC6.1"] + references: + - "CCE-37064-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization -> 1' + + ############################################### + # 9 Windows Firewall with Advanced Security + ############################################### + ############################################### + # 9.1 Domain Profile + ############################################### + # 9.1.1 Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On' + - id: 15062 + title: "Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)'" + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Firewall state." + compliance: + - cis: ["9.1.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-36062-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall -> 1' + + # 9.1.2 Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)' + - id: 15063 + title: "Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)'" + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Inbound connections." + compliance: + - cis: ["9.1.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-38117-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction -> 1' + + # 9.1.3 Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)' + - id: 15064 + title: "Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)'" + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default)." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Outbound connections." + compliance: + - cis: ["9.1.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-36146-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction -> 0' + + # 9.1.4 Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No' + - id: 15065 + title: "Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'" + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.1.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-38041-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications -> 1' + + # 9.1.5 Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log' + + - id: 15066 + title: "Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log'" + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.1.5"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37482-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\domainfw.log' + + # 9.1.6 Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater' + + - id: 15067 + title: "Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater'" + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.1.6"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-36088-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + # 9.1.7 Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes' + - id: 15068 + title: "Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.1.7"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37523-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets -> 1' + + # 9.1.8 Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes' + - id: 15069 + title: "Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.1.8"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-36393-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections -> 1' + + ############################################### + # 9.2 Private Profile + ############################################### + + # 9.2.1 Ensure 'Windows Firewall: Private: Firewall state' is set to 'On' + - id: 15070 + title: "Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)'" + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Firewall state." + compliance: + - cis: ["9.2.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-38239-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall -> 1' + + # 9.2.2 Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)' + - id: 15071 + title: "Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)'" + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Inbound connections." + compliance: + - cis: ["9.2.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-38042-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction -> 1' + + # 9.2.3 Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)' + - id: 15072 + title: "Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)'" + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Outbound connections." + compliance: + - cis: ["9.2.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-38332-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction -> 0' + + # 9.2.4 Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)' + - id: 15073 + title: "Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'" + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.2.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-37621-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications -> 1' + + # 9.2.5 Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log' + - id: 15074 + title: "Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log'" + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.2.5"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37569-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\privatefw.log' + + # 9.2.6 Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater' + - id: 15075 + title: "Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater'" + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.2.6"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-38178-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + # 9.2.7 Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes' + - id: 15076 + title: "Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.2.7"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-35972-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets -> 1' + + # 9.2.8 Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes' + - id: 15077 + title: "Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.2.8"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37387-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections -> 1' + + ############################################### + # 9.3 Public Profile + ############################################### + + # 9.3.1 Ensure 'Windows Firewall: Public: Firewall state' is set to 'On' + - id: 15078 + title: "Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'" + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Firewall state." + compliance: + - cis: ["9.3.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-37862-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall -> 1' + + # 9.3.2 Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)' + - id: 15079 + title: "Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)'" + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Inbound connections." + compliance: + - cis: ["9.3.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-36057-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction -> 1' + + # 9.3.3 Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)' + - id: 15080 + title: "Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)'" + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Outbound connections." + compliance: + - cis: ["9.3.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-37434-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction -> 0' + + # 9.3.4 Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No' + - id: 15081 + title: "Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No'" + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No." + rationale: "Some organizations may prefer to avoid alarming users when firewall rules block certain types of network activity. However, notifications can be helpful when troubleshooting network issues involving the firewall." + remediation: "To establish the recommended configuration via GP, set the following UI path to 'No': Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.3.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-38043-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications -> 1' + + # 9.3.5 Ensure 'Windows Firewall: Public: Apply local firewall rules' is set to 'No' + - id: 15082 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'" + description: "This setting controls whether local administrators are allowed to create local firewall rules that apply together with firewall rules configured by Group Policy. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "iWhen in the Public profile, there should be no special local firewall exceptions per computer. These settings should be managed by a centralized policy." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local firewall rules." + compliance: + - cis: ["9.3.5"] + - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-37861-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge -> 0' + + # 9.3.6 Ensure 'Windows Firewall: Public: Apply local connection security rules' is set to 'No' + - id: 15083 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'" + description: "This setting controls whether local administrators are allowed to create connection security rules that apply together with connection security rules configured by Group Policy. The recommended state for this setting is: No." + rationale: "Users with administrative privileges might create firewall rules that expose the system to remote attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local connection security rules." + compliance: + - cis: ["9.3.6"] + - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-36268-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0' + + # 9.3.7 Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log' + - id: 15084 + title: "Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log'" + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.3.7"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37266-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\publicfw.log' + + # 9.3.8 Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater'' + - id: 15085 + title: "Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater'" + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.3.8"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-36395-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + # 9.3.9 Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'' + - id: 15086 + title: "Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.3.9"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37265-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets -> 1' + + # 9.3.10 Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'' + - id: 15087 + title: "Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.3.10"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-36394-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections -> 1' + + # Section 18.1 - Control Panel + - id: 15088 + title: "Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'" + description: "Disables the lock screen camera toggle switch in PC Settings and prevents a camera from being invoked on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen camera extends the protection afforded by the lock screen to camera features." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen camera. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38347-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera -> 1' + + - id: 15089 + title: "Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'" + description: "Disables the lock screen slide show settings in PC Settings and prevents a slide show from playing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen slide show extends the protection afforded by the lock screen to slide show contents." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen slide show. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38348-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow -> 1' + + # Section 18.2 - LAPS + + - id: 15090 + title: "Ensure LAPS AdmPwd GPO Extension / CSE is installed" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "In order to utilize LAPS, a minor Active Directory Schema update is required, and a Group Policy Client Side Extension (CSE) must be installed on each managed computer. When LAPS is installed, the file AdmPwd.dll must be present in the following location and registered in Windows (the LAPS AdmPwd GPO Extension / CSE installation does this for you): C:\\Program Files\\LAPS\\CSE\\AdmPwd.dll" + compliance: + - cis: ["18.2.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + + - id: 15091 + title: "Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Do not allow password expiration time longer than required by policy Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.2"] + - cis_csc: ["16.2"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled -> 1' + + - id: 15092 + title: "Ensure 'Enable Local Admin Password Management' is set to 'Enabled'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Enable Local Admin Password Management Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.3"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled -> 1' + + - id: 15093 + title: "Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: Large letters + small letters + numbers + special characters. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Complexity option to Large letters + small letters + numbers + special characters: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.4"] + - cis_csc: ["5.7"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity -> 4' + + - id: 15094 + title: "Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 15 or more. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Length option to 15 or more: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.5"] + - cis_csc: ["5.7"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> n:^(\d+) compare >= 15' + + - id: 15095 + title: "Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 30 or fewer. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Age (Days) option to 30 or fewer: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.6"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> n:^(\d+) compare <= 30' + + # Section 18.3 - MS Security Guide + - id: 15096 + title: "Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled'" + description: "This setting controls whether local accounts can be used for remote administration via network logon (e.g., NET USE, connecting to C$, etc.). Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Enabling this policy significantly reduces that risk. Enabled: Applies UAC token-filtering to local accounts on network logons. Membership in powerful group such as Administrators is disabled and powerful privileges are removed from the resulting access token. This configures the LocalAccountTokenFilterPolicy registry value to 0. This is the default behavior for Windows. Disabled: Allows local accounts to have full administrative rights when authenticating via network logon, by configuring the LocalAccountTokenFilterPolicy registry value to 1. For more information about local accounts and credential theft, review the 'Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques' documents. For more information about LocalAccountTokenFilterPolicy, see Microsoft Knowledge Base article 951016: Description of User Account Control and remote restrictions in Windows Vista. The recommended state for this setting is: Enabled." + rationale: "Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Ensuring this policy is Enabled significantly reduces that risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Apply UAC restrictions to local accounts on network logons Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft." + compliance: + - cis: ["18.3.1"] + - cis_csc: ["5.8"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - https://www.microsoft.com/en-us/download/details.aspx?id=36036 + - https://support.microsoft.com/en-us/help/951016/description-of-user-account-control-and-remote-restrictions-in-windows + - https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/ + - "CCE-37069-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy -> 0' + + - id: 15097 + title: "Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver'" + description: "This setting configures the start type for the Server Message Block version 1 (SMBv1) client driver service ( MRxSmb10 ), which is recommended to be disabled. The recommended state for this setting is: Enabled: Disable driver. Note: Do not, under any circumstances, configure this overall setting as Disabled , as doing so will delete the underlying registry entry altogether, which will cause serious problems." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable driver : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 client driver. Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required - it is available from Microsoft" + compliance: + - cis: ["18.3.2"] + - cis_csc: ["9.1"] + references: + - https://www.microsoft.com/en-us/download/details.aspx?id=36036 + - https://blogs.technet.microsoft.com/filecab/2017/06/01/smb1-product-clearinghouse/ + - https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/ + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start -> 4' + + - id: 15098 + title: "Ensure 'Configure SMB v1 server' is set to 'Disabled'" + description: "This setting configures the server-side processing of the Server Message Block version 1 (SMBv1) protocol. The recommended state for this setting is: Disabled ." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 server Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "https://techcommunity.microsoft.com/t5/storage-at-microsoft/stop-using-smb1/ba-p/425858" + - "https://docs.microsoft.com/en-us/archive/blogs/staysafe/disable-smb-v1-in-managed-environments-with-ad-group-policy" + - "https://docs.microsoft.com/en-us/archive/blogs/secguide/disabling-smbv1-through-group-policy" + - "https://docs.microsoft.com/en-us/archive/blogs/secguide/security-baseline-for-windows-10-creators-update-v1703-final" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1 -> 0' + + - id: 15099 + title: "Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled'" + description: "Windows includes support for Structured Exception Handling Overwrite Protection (SEHOP). We recommend enabling this feature to improve the security profile of the computer. The recommended state for this setting is: Enabled ." + rationale: "This feature is designed to block exploits that use the Structured Exception Handler (SEH) overwrite technique. This protection mechanism is provided at run-time. Therefore, it helps protect applications regardless of whether they have been compiled with the latest improvements, such as the /SAFESEH option." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Enable Structured Exception Handling Overwrite Protection (SEHOP) Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.4"] + - cis_csc: ["8.4"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + references: + - "https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/" + - "https://support.microsoft.com/en-us/help/956607/how-to-enable-structured-exception-handling-overwrite-protection-sehop" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation -> 0' + + - id: 15100 + title: "Ensure 'WDigest Authentication' is set to 'Disabled'" + description: "When WDigest authentication is enabled, Lsass.exe retains a copy of the user's plaintext password in memory, where it can be at risk of theft. If this setting is not configured, WDigest authentication is disabled in Windows 8.1 and in Windows Server 2012 R2; it is enabled by default in earlier versions of Windows and Windows Server. The recommended state for this setting is: Disabled." + rationale: "Preventing the plaintext storage of credentials in memory may reduce opportunity for credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\WDigest Authentication (disabling may require KB2871997) Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft." + compliance: + - cis: ["18.3.5"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - https://www.microsoft.com/en-us/download/details.aspx?id=36036 + - https://support.microsoft.com/en-us/help/2871997/microsoft-security-advisory-update-to-improve-credentials-protection-a + - https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/ + - "CCE-38444-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential -> 0' + + # Section 18.4 - MSS (Legacy) + - id: 15101 + title: "Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled'" + description: "This setting is separate from the Welcome screen feature in Windows XP and Windows Vista; if that feature is disabled, this setting is not disabled. If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks to which the computer is connected. Also, if you enable automatic logon, the password is stored in the registry in plaintext, and the specific registry key that stores this value is remotely readable by the Authenticated Users group. The recommended state for this setting is: Disabled." + rationale: "If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks that the computer is connected to. Also, if you enable automatic logon, the password is stored in the registry in plaintext. The specific registry key that stores this setting is remotely readable by the Authenticated Users group. As a result, this entry is appropriate only if the computer is physically secured and if you ensure that untrusted users cannot remotely see the registry." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - https://support.microsoft.com/en-us/help/324737/how-to-turn-on-automatic-logon-in-windows + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-37067-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> 0' + + - id: 15102 + title: "Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should follow through the network. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.2"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-36871-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting -> 2' + + - id: 15103 + title: "Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should take through the network. It is recommended to configure this setting to Not Defined for enterprise environments and to Highest Protection for high security environments to completely disable source routing. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.3"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-36535-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting -> 2' + + - id: 15104 + title: "Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'" + description: "Internet Control Message Protocol (ICMP) redirects cause the IPv4 stack to plumb host routes. These routes override the Open Shortest Path First (OSPF) generated routes. The recommended state for this setting is: Disabled." + rationale: "This behavior is expected. The problem is that the 10 minute time-out period for the ICMP redirect-plumbed routes temporarily creates a network situation in which traffic will no longer be routed properly for the affected host. Ignoring such ICMP redirects will limit the system's exposure to attacks that will impact its ability to participate on the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.4"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - nist_800_53: ["SC.5"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-37988-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect -> 0' + + # Section 18.4 - MSS (Legacy) + - id: 15105 + title: "Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes'" + description: "This value controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet. If the remote computer is still reachable, it acknowledges the keep-alive packet. The recommended state for this setting is: Enabled: 300,000 or 5 minutes (recommended)." + rationale: "An attacker who is able to connect to network applications could establish numerous connections to cause a DoS condition." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 300,000 or 5 minutes (recommended): Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.5"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + - nist_800_53: ["SC.5"] + references: + - "CCE-36868-8" + - "https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> 300000' + + - id: 15106 + title: "Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'" + description: "NetBIOS over TCP/IP is a network protocol that among other things provides a way to easily resolve NetBIOS names that are registered on Windows-based systems to the IP addresses that are configured on those systems. This setting determines whether the computer releases its NetBIOS name when it receives a name-release request. The recommended state for this setting is: Enabled." + rationale: "The NetBT protocol is designed not to use authentication, and is therefore vulnerable to spoofing. Spoofing makes a transmission appear to come from a user other than the user who performed the action. A malicious user could exploit the unauthenticated nature of the protocol to send a name-conflict datagram to a target computer, which would cause the computer to relinquish its name and not respond to queries. An attacker could send a request over the network and query a computer to release its NetBIOS name. As with any change that could affect applications, it is recommended that you test this change in a non-production environment before you change the production environment. The result of such an attack could be to cause intermittent connectivity issues on the target computer, or even to prevent the use of Network Neighborhood, domain logons, the NET SEND command, or additional NetBIOS name resolution." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.6"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-36879-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand -> 1' + + - id: 15107 + title: "Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'" + description: "This setting is used to enable or disable the Internet Router Discovery Protocol (IRDP), which allows the system to detect and configure default gateway addresses automatically as described in RFC 1256 on a per-interface basis. The recommended state for this setting is: Disabled." + rationale: "An attacker who has gained control of a computer on the same network segment could configure a computer on the network to impersonate a router. Other computers with IRDP enabled would then attempt to route their traffic through the already compromised computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS). Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.7"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + - nist_800_53: ["SC.5"] + references: + - "CCE-38065-9" + - "https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> 0' + + - id: 15108 + title: "Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'" + description: "The DLL search order can be configured to search for DLLs that are requested by running processes in one of two ways: -Search folders specified in the system path first, and then search the current working folder. -Search current working folder first, and then search the folders specified in the system path. When enabled, the registry value is set to 1. With a setting of 1, the system first searches the folders that are specified in the system path and then searches the current working folder. When disabled the registry value is set to 0 and the system first searches the current working folder and then searches the folders that are specified in the system path. Applications will be forced to search for DLLs in the system path first. For applications that require unique versions of these DLLs that are included with the application, this entry could cause performance or stability problems. The recommended state for this setting is: Enabled." + rationale: "If a user unknowingly executes hostile code that was packaged with additional files that include modified versions of system DLLs, the hostile code could load its own versions of those DLLs and potentially increase the type and degree of damage the code can render." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.8"] + - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-36351-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode -> 1' + + - id: 15109 + title: "Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds'" + description: "Windows includes a grace period between when the screen saver is launched and when the console is actually locked automatically when screen saver locking is enabled. The recommended state for this setting is: Enabled: 5 or fewer seconds." + rationale: "The default grace period that is allowed for user movement before the screen saver lock takes effect is five seconds. If you leave the default grace period configuration, your computer is vulnerable to a potential attack from someone who could approach the console and attempt to log on to the computer before the lock takes effect. An entry to the registry can be made to adjust the length of the grace period." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 5 or fewer seconds: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.9"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-37993-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> n:^(\d+) compare <= 5' + + - id: 15110 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.10"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + - nist_800_53: ["SC.5"] + references: + - "CCE-37846-3" + - "https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' + + - id: 15111 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted. Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.11"] + - cis_csc: ["9"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + references: + - "CCE-36051-1" + - "https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' + + - id: 15112 + title: "Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less'" + description: "This setting can generate a security audit in the Security event log when the log reaches a user-defined threshold. The recommended state for this setting is: Enabled: 90% or less. Note: If log settings are configured to Overwrite events as needed or Overwrite events older than x days, this event will not be generated." + rationale: "If the Security log reaches 90 percent of its capacity and the computer has not been configured to overwrite events as needed, more recent events will not be written to the log. If the log reaches its capacity and the computer has been configured to shut down when it can no longer record events to the Security log, the computer will shut down and will no longer be available to provide network services." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 90% or less: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.12"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-36880-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> n:^(\d+) compare <= 90' + + # Section 18.5 - Network + + - id: 15113 + title: "Ensure 'Turn off multicast name resolution' is set to 'Enabled'" + description: "LLMNR is a secondary name resolution protocol. With LLMNR, queries are sent using multicast over a local network link on a single subnet from a client computer to another client computer on the same subnet that also has LLMNR enabled. LLMNR does not require a DNS server or DNS client configuration, and provides name resolution in scenarios in which conventional DNS name resolution is not possible. The recommended state for this setting is: Enabled ." + rationale: "An attacker can listen on a network for these LLMNR (UDP/5355) or NBT-NS (UDP/137) broadcasts and respond to them, tricking the host into thinking that it knows the location of the requested system. Note: To completely mitigate local name resolution poisoning, in addition to this setting, the properties of each installed NIC should also be set to Disable NetBIOS over TCP/IP (on the WINS tab in the NIC properties). Unfortunately, there is no global setting to achieve this that automatically applies to all NICs - it is a per-NIC setting that varies with different NIC hardware installations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Turn off multicast name resolution Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DnsClient.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.4.2"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37450-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast -> 0' + + - id: 15114 + title: "Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'" + description: "This policy setting changes the operational behavior of the Mapper I/O network protocol driver. LLTDIO allows a computer to discover the topology of a network it's connected to. It also allows a computer to initiate Quality-of-Service requests such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Mapper I/O (LLTDIO) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.9.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38170-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitLLTDIOOnPrivateNet -> 0' + + - id: 15115 + title: "Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'" + description: "This policy setting changes the operational behavior of the Responder network protocol driver. The Responder allows a computer to participate in Link Layer Topology Discovery requests so that it can be discovered and located on the network. It also allows a computer to participate in Quality-of-Service activities such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Responder (RSPNDR) driver. Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.9.2"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37959-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitRspndrOnPrivateNet -> 0' + + - id: 15116 + title: "Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'" + description: "The Peer Name Resolution Protocol (PNRP) allows for distributed resolution of a name to an IPv6 address and port number. The protocol operates in the context of clouds. A cloud is a set of peer computers that can communicate with each other by using the same IPv6 scope. Peer-to-Peer protocols allow for applications in the areas of RTC, collaboration, content distribution and distributed processing. The recommended state for this setting is: Enabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to peer-to-peer networking." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Microsoft Peer-to-Peer Networking Services\\Turn off Microsoft Peer-to-Peer Networking Services. Note: This Group Policy path is provided by the Group Policy template P2P- pnrp.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.10.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37699-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> 1' + + - id: 15117 + title: "Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'" + description: "You can use this procedure to controls user's ability to install and configure a Network Bridge. The recommended state for this setting is: Enabled." + rationale: "The Network Bridge setting, if enabled, allows users to create a Layer 2 Media Access Control (MAC) bridge, enabling them to connect two or more physical network segments together. A Network Bridge thus allows a computer that has connections to two different networks to share data between those networks. In an enterprise managed environment, where there is a need to control network traffic to only authorized paths, allowing users to create a Network Bridge increases the risk and attack surface from the bridged network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit installation and configuration of Network Bridge on your DNS domain network Note: This Group Policy path is provided by the Group Policy template NetworkConnections.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.11.2"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + references: + - "CCE-38002-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA -> 0' + + - id: 15118 + title: "Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'" + description: "This policy setting determines whether to require domain users to elevate when setting a network's location. The recommended state for this setting is: Enabled." + rationale: "Allowing regular users to set a network location increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Require domain users to elevate when setting a network's location Note: This Group Policy path may not exist by default. It is provided by the Group Policy template NetworkConnections.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.11.3"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + references: + - "CCE-38188-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation -> 1' + + - id: 15119 + title: 'Ensure ''Hardened UNC Paths'' is set to ''Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares''' + description: 'This policy setting configures secure access to UNC paths. The recommended state for this setting is: Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares .' + rationale: "In February 2015, Microsoft released a new control mechanism to mitigate a security risk in Group Policy as part of the MS15-011 / MSKB 3000483 security update. This mechanism requires both the installation of the new security update and also the deployment of specific group policy settings to all computers on the domain from Windows Vista / Server 2008 (non-R2) or newer (the associated security patch to enable this feature was not released for Server 2003). A new group policy template ( NetworkProvider.admx/adml ) was also provided with the security update. Once the new GPO template is in place, the following are the minimum requirements to remediate the Group Policy security risk: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with the following paths configured, at a minimum: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Provider\\Hardened UNC Paths Note: This Group Policy path does not exist by default. An additional Group Policy template ( NetworkProvider.admx/adml ) is required" + compliance: + - cis: ["18.5.14.1"] + - cis_csc: ["3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\NETLOGON -> r:RequireMutualAuthentication=1 && r:RequireIntegrity=1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\SYSVOL -> r:RequireMutualAuthentication=1 && r:RequireIntegrity=1' + + # Section 18.5 - Network + - id: 15120 + title: "Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')" + description: "Internet Protocol version 6 (IPv6) is a set of protocols that computers use to exchange information over the Internet and over home and business networks. IPv6 allows for many more IP addresses to be assigned than IPv4 did. Older networking, hosts and operating systems may not support IPv6 natively. The recommended state for this setting is: DisabledComponents - 0xff (255)" + rationale: "Since the vast majority of private enterprise managed networks have no need to utilize IPv6 (because they have access to private IPv4 addressing), disabling IPv6 components reduces a possible attack surface that is also harder to monitor the traffic on. As a result, we recommend configuring IPv6 to a Disabled state when it is not needed." + remediation: "To establish the recommended configuration, set the following Registry value to 0xff (255) (DWORD): HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TCPIP6\\Parameters:DisabledComponents. Note: This change does not take effect until the computer has been restarted. Note #2: Although Microsoft does not provide an ADMX template to configure this registry value, a custom .ADM template (Disable-IPv6-Components-KB929852.adm) is provided in the CIS Benchmark Remediation Kit to facilitate its configuration. Be aware though that simply turning off the group policy setting in the .ADM template will not \"undo\" the change once applied. Instead, the opposite setting must be applied to change the registry value to the opposite state." + compliance: + - cis: ["18.5.19.2.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> 255' + + - id: 15121 + title: "Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'" + description: "This policy setting allows the configuration of wireless settings using Windows Connect Now (WCN). The WCN Registrar enables the discovery and configuration of devices over Ethernet (UPnP) over in-band 802.11 Wi-Fi through the Windows Portable Device API (WPD) and via USB Flash drives. Additional options are available to allow discovery and configuration over a specific medium. The recommended state for this setting is: Disabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to user configuration of wireless settings." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Configuration of wireless settings using Windows Connect Now. Note: This Group Policy path is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.20.1"] + - cis_csc: ["15.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37481-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> 0' + + - id: 15122 + title: "Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'" + description: "This policy setting prohibits access to Windows Connect Now (WCN) wizards. The recommended state for this setting is: Enabled." + rationale: "Allowing standard users to access the Windows Connect Now wizard increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network\\Windows Connect Now\\Prohibit access of the Windows Connect Now wizards. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.20.2"] + - cis_csc: ["15.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36109-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> 1' + + - id: 15123 + title: "Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled'" + description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time. The recommended state for this setting is: Enabled." + rationale: "Blocking simultaneous connections can help prevent a user unknowingly allowing network traffic to flow between the Internet and the enterprise managed network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Minimize the number of simultaneous connections to the Internet or a Windows Domain Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WCM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.21.1"] + - cis_csc: ["12"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + references: + - "CCE-38338-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections -> 1' + + # Section 18.5.21 - Windows Connection Manager + - id: 15124 + title: "Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled'" + description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time." + rationale: "The potential concern is that a user would unknowingly allow network traffic to flow between the insecure public network and the enterprise managed network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\Network\\Windows Connection Manager\\Prohibit connection to non-domain networks when connected to domain authenticated network." + compliance: + - cis: ["18.5.21.2"] + - cis_csc: ["12"] + - pci_dss: ["2.2.4", "1.3.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2", "CC6.1"] + references: + - "CCE-37627-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain -> 1' + + # Section 18.8 - System + - id: 15125 + title: "Ensure 'Include command line in process creation events' is set to 'Disabled'" + description: "This policy setting determines what information is logged in security audit events when a new process has been created. The recommended state for this setting is: Disabled." + rationale: "When this policy setting is enabled, any user who has read access to the security events can read the command-line arguments for any successfully created process. Command-line arguments may contain sensitive or private information such as passwords or user data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Audit Process Creation\\Include command line in process creation events Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AuditSettings.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.3.1"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-36925-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled -> 0' + + - id: 15126 + title: "Ensure 'Remote host allows delegation of non-exportable credentials' is set to 'Enabled'" + description: "Remote host allows delegation of non-exportable credentials. When using credential delegation, devices provide an exportable version of credentials to the remote host. This exposes users to the risk of credential theft from attackers on the remote host. The Restricted Admin Mode and Windows Defender Remote Credential Guard features are two options to help protect against this risk. The recommended state for this setting is: Enabled ." + rationale: "Restricted Admin Mode was designed to help protect administrator accounts by ensuring that reusable credentials are not stored in memory on remote devices that could potentially be compromised. Windows Defender Remote Credential Guard helps you protect your credentials over a Remote Desktop connection by redirecting Kerberos requests back to the device that is requesting the connection. Both features should be enabled and supported, as they reduce the chance of credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Remote host allows delegation of non-exportable credentials Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.4.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "https://docs.microsoft.com/en-us/windows/access-protection/remote-credential-guard" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds -> 1' + + - id: 15127 + title: "Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'" + description: "This policy setting allows you to specify which boot-start drivers are initialized based on a classification determined by an Early Launch Antimalware boot-start driver. The Early Launch Antimalware boot-start driver can return the following classifications for each boot-start driver: -Good: The driver has been signed and has not been tampered with. -Bad: The driver has been identified as malware. It is recommended that you do not allow known bad drivers to be initialized. -Bad, but required for boot: The driver has been identified as malware, but the computer cannot successfully boot without loading this driver. -Unknown: This driver has not been attested to by your malware detection application and has not been classified by the Early Launch Antimalware boot-start driver. If you enable this policy setting you will be able to choose which boot-start drivers to initialize the next time the computer is started. If your malware detection application does not include an Early Launch Antimalware boot- start driver or if your Early Launch Antimalware boot-start driver has been disabled, this setting has no effect and all boot-start drivers are initialized. The recommended state for this setting is: Enabled: Good, unknown and bad but critical." + rationale: "This policy setting helps reduce the impact of malware that has already infected your system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Good, unknown and bad but critical: Computer Configuration\\Policies\\Administrative Templates\\System\\Early Launch Antimalware\\Boot-Start Driver Initialization Policy Note: This Group Policy path may not exist by default. It is provided by the Group Policy template EarlyLaunchAM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.14.1"] + - cis_csc: ["8"] + - pci_dss: ["5.1.1"] + - nist_800_53: ["SI.3"] + - tsc: ["CC6.8"] + references: + - "CCE-37912-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy -> 3' + + - id: 15128 + title: "Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'" + description: "The 'Do not apply during periodic background processing' option prevents the system from updating affected policies in the background while the computer is in use. When background updates are disabled, policy changes will not take effect until the next user logon or system restart. The recommended state for this setting is: Enabled: FALSE (unchecked)." + rationale: "Setting this option to false (unchecked) will ensure that domain policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Do not apply during periodic background processing option to FALSE (unchecked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.2"] + - cis_csc: ["3.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36169-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy -> 0' + + - id: 15129 + title: "Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'" + description: "The 'Process even if the Group Policy objects have not changed' option updates and reapplies policies even if the policies have not changed. The recommended state for this setting is: Enabled: TRUE (checked)." + rationale: "Setting this option to true (checked) will ensure unauthorized changes that might have been configured locally are forced to match the domain-based Group Policy settings again." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Process even if the Group Policy objects have not changed option to TRUE (checked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.3"] + - cis_csc: ["3.7"] + - pci_dss: ["11.5.1"] + - tsc: ["PI1.4", "PI1.5", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: + - "CCE-36169-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges -> 0' + + - id: 15130 + title: "Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'" + description: "This policy setting prevents Group Policy from being updated while the computer is in use. This policy setting applies to Group Policy for computers, users and Domain Controllers. The recommended state for this setting is: Disabled." + rationale: "This setting ensures that group policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Turn off background refresh of Group Policy Note: This Group Policy path is provided by the Group Policy template GroupPolicy.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.21.4"] + - cis_csc: ["3.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-37712-7" + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy' + + # Section 18.8 - System + - id: 15131 + title: "Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'" + description: "This policy setting controls whether the computer can download print driver packages over HTTP. To set up HTTP printing, printer drivers that are not available in the standard operating system installation might need to be downloaded over HTTP. The recommended state for this setting is: Enabled." + rationale: "Users might download drivers that include malicious code." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off downloading of print drivers over HTTP Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.1"] + - cis_csc: ["2"] + - pci_dss: ["6"] + - nist_800_53: ["SI.3"] + references: + - "CCE-36625-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> 1' + + - id: 15132 + title: "Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'" + description: "This setting turns off data sharing from the handwriting recognition personalization tool. The handwriting recognition personalization tool enables Tablet PC users to adapt handwriting recognition to their own writing style by providing writing samples. The tool can optionally share user writing samples with Microsoft to improve handwriting recognition in future versions of Windows. The tool generates reports and transmits them to Microsoft over a secure connection. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting personalization data sharing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ShapeCollector.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.22.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37911-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> 1' + + - id: 15133 + title: "Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'" + description: "Turns off the handwriting recognition error reporting tool. The handwriting recognition error reporting tool enables users to report errors encountered in Tablet PC Input Panel. The tool generates error reports and transmits them to Microsoft over a secure connection. Microsoft uses these error reports to improve handwriting recognition in future versions of Windows. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting recognition error reporting. Note: This Group Policy path is provided by the Group Policy template InkWatson.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36203-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> 1' + + - id: 15134 + title: "Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'" + description: "This policy setting specifies whether the Internet Connection Wizard can connect to Microsoft to download a list of Internet Service Providers (ISPs). The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37163-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> 1' + + - id: 15135 + title: "Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'" + description: "This policy setting controls whether Windows will download a list of providers for the Web publishing and online ordering wizards. The recommended state for this setting is: Enabled." + rationale: "Although the risk is minimal, enabling this setting will reduce the possibility of a user unknowingly downloading malicious content through this feature." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet download for Web publishing and online ordering wizards Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.5"] + - cis_csc: ["7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36096-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> 1' + + - id: 15136 + title: "Ensure 'Turn off printing over HTTP' is set to 'Enabled'" + description: "This policy setting allows you to disable the client computer's ability to print over HTTP, which allows the computer to print to printers on the intranet as well as the Internet. The recommended state for this setting is: Enabled." + rationale: "Information that is transmitted over HTTP through this capability is not protected and can be intercepted by malicious users. For this reason, it is not often used in enterprise managed environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off printing over HTTP Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.6"] + - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36920-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> 1' + + - id: 15137 + title: "Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'" + description: "This policy setting specifies whether the Windows Registration Wizard connects to Microsoft.com for online registration. The recommended state for this setting is: Enabled." + rationale: "Users in an enterprise managed environment should not be registering their own copies of Windows, providing their own PII in the process." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Registration if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36352-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> 1' + + - id: 15138 + title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'" + description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches. The recommended state for this setting is: Enabled." + rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for. This risk is very low because even if this setting is enabled users still must submit search queries to the desired search engine in order to perform searches." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Search Companion content file updates. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.8"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36884-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' + + - id: 15139 + title: 'Ensure ''Turn off the "Order Prints" picture task'' is set to ''Enabled''' + description: 'This policy setting specifies whether the "Order Prints Online" task is available from Picture Tasks in Windows folders. The Order Prints Online Wizard is used to download a list of providers and allow users to order prints online. The recommended state for this setting is: Enabled.' + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Order Prints\" picture task. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.9"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38275-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> 1' + + - id: 15140 + title: 'Ensure ''Turn off the "Publish to Web" task for files and folders'' is set to ''Enabled''' + description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders. The Web Publishing wizard is used to download a list of providers and allow users to publish content to the Web. The recommended state for this setting is: Enabled." + rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Publish to Web\" task for files and folders Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.10"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37090-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' + + - id: 15141 + title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'" + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the Windows Messenger Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.11"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36628-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' + + - id: 15142 + title: "Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'" + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.12"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36174-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> 0' + + - id: 15143 + title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'" + description: "This policy setting controls whether or not errors are reported to Microsoft. Error Reporting is used to report information about a system or application that has failed or has stopped responding and is used to improve the quality of the product. The recommended state for this setting is: Enabled." + rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Error Reporting. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.13"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-35964-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PCHealth\ErrorReporting -> DoReport -> 0' + + - id: 15144 + title: "Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'" + description: "This policy prevents automatic copying of user input methods to the system account for use on the sign-in screen. The user is restricted to the set of input methods that are enabled in the system account. The recommended state for this setting is: Enabled." + rationale: "This is a way to increase the security of the system account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Locale Services\\Disallow copying of user input methods to the system account for sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.26.1"] + - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36343-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> 1' + + - id: 15145 + title: "Ensure 'Do not display network selection UI' is set to 'Enabled'" + description: "This policy setting allows you to control whether anyone can interact with available networks UI on the logon screen. The recommended state for this setting is: Enabled." + rationale: "An unauthorized user could disconnect the PC from the network or can connect the PC to other available networks without signing into Windows." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not display network selection UI Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.27.1"] + - cis_csc: ["5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38353-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI -> 1' + + - id: 15146 + title: "Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'" + description: "This policy setting prevents connected users from being enumerated on domain-joined computers. The recommended state for this setting is: Enabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not enumerate connected users on domain-joined computers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.27.2"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37838-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers -> 1' + + - id: 15147 + title: "Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled'" + description: "This policy setting allows local users to be enumerated on domain-joined computers. The recommended state for this setting is: Disabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Enumerate local users on domain-joined computers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.27.3"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-35894-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers -> 0' + + - id: 15148 + title: "Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled'" + description: "This policy setting allows you to prevent app notifications from appearing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "App notifications might display sensitive business or personal data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off app notifications on the lock screen Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.27.4"] + - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-35893-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications -> 1' + + - id: 15149 + title: "Ensure 'Turn off picture password sign-in' is set to 'Enabled'" + description: "This policy setting allows you to control whether a domain user can sign in using a picture password. The recommended state for this setting is: Enabled . Note: If the picture password feature is permitted, the user's domain password is cached in the system vault when using it." + rationale: "Picture passwords bypass the requirement for a typed complex password. In a shared work environment, a simple shoulder surf where someone observed the on-screen gestures would allow that person to gain access to the system without the need to know the complex password. Vertical monitor screens with an image are much more visible at a distance than horizontal key strokes, increasing the likelihood of a successful observation of the mouse gestures." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off picture password sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.27.5"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword -> 1' + + - id: 15150 + title: "Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'" + description: "This policy setting allows you to control whether a domain user can sign in using a convenience PIN. In Windows 10, convenience PIN was replaced with Passport, which has stronger security properties. To configure Passport for domain users, use the policies under Computer Configuration\\Administrative Templates\\Windows Components\\Microsoft Passport for Work. Note: The user's domain password will be cached in the system vault when using this feature. The recommended state for this setting is: Disabled." + rationale: "A PIN is created from a much smaller selection of characters than a password, so in most cases a PIN will be much less robust than a password." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn on convenience PIN sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn on PIN sign-in, but it was renamed starting with the Windows 10 Release 1511 Administrative Templates." + compliance: + - cis: ["18.8.27.6"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "CCE-37528-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon -> 0' + + - id: 15151 + title: "Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'" + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (on battery) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.33.6.1"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "CCE-36881-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex -> 1' + + - id: 15152 + title: "Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'" + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (plugged in) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.33.6.2"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "CCE-37066-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex -> 1' + + - id: 15153 + title: "Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'" + description: "This policy setting allows you to turn on or turn off Offer (Unsolicited) Remote Assistance on this computer. Help desk and support personnel will not be able to proactively offer assistance, although they can still respond to user assistance requests. The recommended state for this setting is: Disabled." + rationale: "A user might be tricked and accept an unsolicited Remote Assistance offer from a malicious user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Offer Remote Assistance Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.35.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36388-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited -> 0' + + - id: 15154 + title: "Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'" + description: "This policy setting allows you to turn on or turn off Solicited (Ask for) Remote Assistance on this computer. The recommended state for this setting is: Disabled." + rationale: "There is slight risk that a rogue administrator will gain access to another user's desktop session, however, they cannot connect to a user's computer unannounced or control it without permission from the user. When an expert tries to connect, the user can still choose to deny the connection or give the expert view-only privileges. The user must explicitly click the Yes button to allow the expert to remotely control the workstation." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Solicited Remote Assistance Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.35.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37281-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp -> 0' + + # Section 18.8.36 - Remote Procedure Call + - id: 15155 + title: "Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled'" + description: "This policy setting controls whether RPC clients authenticate with the Endpoint Mapper Service when the call they are making contains authentication information. The Endpoint Mapper Service on computers running Windows NT4 (all service packs) cannot process authentication information supplied in this manner. This policy setting can cause a specific issue with 1-way forest trusts if it is applied to the trusting domain DCs (see Microsoft KB3073942), so we do not recommend applying it to Domain Controllers. Note: This policy will not be in effect until the system is rebooted. The recommended state for this setting is: Enabled." + rationale: "Anonymous access to RPC services could result in accidental disclosure of information to unauthenticated users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Enable RPC Endpoint Mapper Client Authentication Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RPC.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.36.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - https://support.microsoft.com/en-us/help/3073942/rpc-endpoint-mapper-client-authentication-prevents-users-and-groups-fr + - "CCE-37346-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution -> 1' + + - id: 15156 + title: "Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated'" + description: "This policy setting controls how the RPC server runtime handles unauthenticated RPC clients connecting to RPC servers." + rationale: "Unauthenticated RPC communication can create a security vulnerability." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Authenticated: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Restrict Unauthenticated RPC clients." + compliance: + - cis: ["18.8.36.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-36559-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients -> 1' + + - id: 15157 + title: "Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'" + description: "This policy setting configures Microsoft Support Diagnostic Tool (MSDT) interactive communication with the support provider. MSDT gathers diagnostic data for analysis by support professionals. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Microsoft Support Diagnostic Tool\\Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSDT.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.44.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38161-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> 0' + + - id: 15158 + title: "Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'" + description: "This policy setting specifies whether to enable or disable tracking of responsiveness events. The recommended state for this setting is: Disabled." + rationale: "When enabled the aggregated data of a given event will be transmitted to Microsoft. The option exists to restrict this feature for a specific user, set the consent level, and designate specific programs for which error reports could be sent. However, centrally restricting the ability to execute PerfTrack to limit the potential for unauthorized or undesired usage, data leakage, or unintentional communications is highly recommended." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Windows Performance PerfTrack\\Enable/Disable PerfTrack. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PerformancePerftrack.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.44.11.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36648-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> 0' + + - id: 15159 + title: "Ensure 'Turn off the advertising ID' is set to 'Enabled'" + description: "This policy setting turns off the advertising ID, preventing apps from using the ID for experiences across apps. The recommended state for this setting is: Enabled." + rationale: "Tracking user activity for advertising purposes, even anonymously, may be a privacy concern. In an enterprise managed environment, applications should not need or require tracking for targeted advertising." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\User Profiles\\Turn off the advertising ID. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template UserProfiles.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.46.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36931-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> 1' + + - id: 15160 + title: "Ensure 'Enable Windows NTP Client' is set to 'Enabled'" + description: "This policy setting specifies whether the Windows NTP Client is enabled. Enabling the Windows NTP Client allows your computer to synchronize its computer clock with other NTP servers. You might want to disable this service if you decide to use a third-party time provider. The recommended state for this setting is: Enabled." + rationale: "A reliable and accurate account of time is important for a number of services and security requirements, including but not limited to distributed applications, authentication services, multi-user databases and logging services. The use of an NTP client (with secure operation) establishes functional accuracy and is a focal point when reviewing security relevant events." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Client. Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.49.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC7.2"] + references: + - "CCE-37843-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> 1' + + - id: 15161 + title: "Ensure 'Enable Windows NTP Server' is set to 'Disabled'" + description: "This policy setting allows you to specify whether the Windows NTP Server is enabled." + rationale: "The configuration of proper time synchronization is critically important in an enterprise managed environment both due to the sensitivity of Kerberos authentication timestamps and also to ensure accurate security logging." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Server." + compliance: + - cis: ["18.8.49.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.3", "CC7.2"] + references: + - "CCE-37319-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled -> 0' + + # Section 18.9 - Windows Components + - id: 15162 + title: "Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'" + description: "This policy setting lets you control whether Microsoft accounts are optional for Windows Store apps that require an account to sign in. This policy only affects Windows Store apps that support it. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting allows an organization to use their enterprise user accounts instead of using their Microsoft accounts when accessing Windows store apps. This provides the organization with greater control over relevant credentials. Microsoft accounts cannot be centrally managed and as such enterprise credential security policies cannot be applied to them, which could put any information accessed by using Microsoft accounts at risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App runtime\\Allow Microsoft accounts to be optional Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppXRuntime.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.6.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + references: + - "CCE-38354-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional -> 1' + + - id: 15163 + title: "Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'" + description: "This policy setting disallows AutoPlay for MTP devices like cameras or phones. The recommended state for this setting is: Enabled." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Disallow Autoplay for non-volume devices Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.8.1"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-37636-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume -> 1' + + - id: 15164 + title: "Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'" + description: "This policy setting sets the default behavior for Autorun commands. Autorun commands are generally stored in autorun.inf files. They often launch the installation program or other routines. The recommended state for this setting is: Enabled: Do not execute any autorun commands." + rationale: "Prior to Windows Vista, when media containing an autorun command is inserted, the system will automatically execute the program without user intervention. This creates a major security concern as code may be executed without user's knowledge. The default behavior starting with Windows Vista is to prompt the user whether autorun command is to be run. The autorun command is represented as a handler in the Autoplay dialog." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Do not execute any autorun commands: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Set the default behavior for AutoRun Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.8.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-38217-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun -> 1' + + - id: 15165 + title: "Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'" + description: "Autoplay starts to read from a drive as soon as you insert media in the drive, which causes the setup file for programs or audio media to start immediately. An attacker could use this feature to launch a program to damage the computer or data on the computer. Autoplay is disabled by default on some removable drive types, such as floppy disk and network drives, but not on CD-ROM drives. Note: You cannot use this policy setting to enable Autoplay on computer drives in which it is disabled by default, such as floppy disk and network drives. The recommended state for this setting is: Enabled: All drives." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: All drives: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Turn off Autoplay Note: This Group Policy path is provided by the Group Policy template AutoPlay.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.8.3"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36875-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun -> 255' + + - id: 15166 + title: "Ensure 'Do not display the password reveal button' is set to 'Enabled'" + description: "This policy setting allows you to configure the display of the password reveal button in password entry user experiences. The recommended state for this setting is: Enabled." + rationale: "This is a useful feature when entering a long and complex password, especially when using a touchscreen. The potential risk is that someone else may see your password while surreptitiously observing your screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Do not display the password reveal button Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredUI.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.15.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-37534-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal -> 1' + + - id: 15167 + title: "Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'" + description: "This policy setting controls whether administrator accounts are displayed when a user attempts to elevate a running application. The recommended state for this setting is: Disabled." + rationale: "Users could see the list of administrator accounts, making it slightly easier for a malicious user who has logged onto a console session to try to crack the passwords of those accounts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Enumerate administrator accounts on elevation Note: This Group Policy path is provided by the Group Policy template CredUI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.15.2"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-36512-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators -> 0' + + - id: 15168 + title: "Ensure 'Default Action and Mitigation Settings' is set to 'Enabled' (plus subsettings)" + description: "This setting configures the default action after detection and advanced ROP mitigation. The recommended state for this setting is: Default Action and Mitigation Settings - Enabled; Deep Hooks - Enabled; Anti Detours - Enabled; Banned Functions - Enabled; Exploit Action - User Configured" + rationale: "These advanced mitigations for ROP mitigations apply to all configured software in EMET: Deep Hooks protects critical APIs and the subsequent lower level APIs used by the top level critical API. Anti Detours renders ineffective exploits that evade hooks by executing a copy of the hooked function prologue and then jump to the function past the prologue. Banned Functions will block calls to ntdll!LdrHotPatchRoutine to mitigate potential exploits abusing the API." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\Default Action and Mitigation Settings .Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.2"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-38427-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> AntiDetours -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> BannedFunctions -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> DeepHooks -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> ExploitAction -> 2' + + - id: 15169 + title: "Ensure 'Default Protections for Internet Explorer' is set to 'Enabled'" + description: "This setting determines if recommended EMET mitigations are applied to Internet Explorer. The recommended state for this setting is: Enabled ." + rationale: "Applying EMET mitigations to Internet Explorer will help reduce the reliability of exploits that target it." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\Default Protections for Internet Explorer Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.3"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-38428-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Internet Explorer\iexplore.exe' + + - id: 15170 + title: "Ensure 'Default Protections for Popular Software' is set to 'Enabled'" + description: "This setting determines if recommended EMET mitigations are applied to the following popular software: 7-Zip; Adobe Photoshop; Foxit Reader; Google Chrome; Google Talk; iTunes; Microsoft Live Writer;Microsoft Lync Communicator ;Microsoft Photo Gallery ;Microsoft SkyDrive; mIRC; Mozilla Firefox; Mozilla Thunderbird; Opera;Pidgin ;QuickTime Player; RealPlayer; Safari; Skype; VideoLAN VLC; Winamp; Windows Live Mail; Windows Media Player; WinRAR; WinZip. The recommended state for this setting is: Enabled ." + rationale: "Applying EMET mitigations to popular software packages will help reduce the reliability of exploits that target them." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\Default Protections for Popular Software Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.4"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36750-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\7-Zip\7z.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\7-Zip\7zFM.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\7-Zip\7zG.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Adobe\Adobe Photoshop CS*\Photoshop.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Foxit Reader\Foxit Reader.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Google\Chrome\Application\chrome.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Google\Google Talk\googletalk.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\iTunes\iTunes.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Microsoft Lync\communicator.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\mIRC\mirc.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Mozilla Firefox\firefox.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Mozilla Firefox\plugin-container.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Mozilla Thunderbird\plugin-container.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Mozilla Thunderbird\thunderbird.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Opera\*\opera.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Opera\opera.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Pidgin\pidgin.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\QuickTime\QuickTimePlayer.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Real\RealPlayer\realconverter.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Real\RealPlayer\realplay.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Safari\Safari.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\SkyDrive\SkyDrive.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Skype\Phone\Skype.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\VideoLAN\VLC\vlc.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Winamp\winamp.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Windows Live\Mail\wlmail.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Windows Live\Photo Gallery\WLXPhotoGallery.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Windows Live\Writer\WindowsLiveWriter.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Windows Media Player\wmplayer.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\WinRAR\rar.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\WinRAR\unrar.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\WinRAR\winrar.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\WinZip\winzip32.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\WinZip\winzip64.exe' + + - id: 15171 + title: "Ensure 'Default Protections for Recommended Software' is set to 'Enabled'" + description: "This setting determines if recommended EMET mitigations are applied to the following software: Adobe Acrobat; Adobe Acrobat Reader; Microsoft Office suite applications; Oracle Java; WordPad. The recommended state for this setting is: Enabled ." + rationale: "Applying EMET mitigations to recommended software will help reduce the reliability of exploits that target them." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\Default Protections for Recommended Software Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.5"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36515-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Adobe\*\Reader\AcroRd32.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Adobe\Acrobat*\Acrobat\Acrobat.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Java\jre*\bin\java.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Java\jre*\bin\javaw.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Java\jre*\bin\javaws.exe' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\EXCEL.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\INFOPATH.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\LYNC.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\MSACCESS.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\MSPUB.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\OIS.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\OUTLOOK.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\POWERPNT.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\PPTVIEW.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\VISIO.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\VPREVIEW.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\OFFICE1*\WINWORD.EXE' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\Defaults -> *\Windows NT\Accessories\wordpad.exe' + + - id: 15172 + title: "Ensure 'System ASLR' is set to 'Enabled: Application Opt-In'" + description: "This setting determines how applications become enrolled in Address Space Layout Randomization (ASLR). The recommended state for this setting is: Enabled: Application Opt-In ." + rationale: "ASLR reduces the predictability of process memory, which in-turn helps reduce the reliability of exploits targeting memory corruption vulnerabilities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Application Opt-In :Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\System ASLR Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.6"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-38437-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> ASLR -> 3' + + - id: 15173 + title: "Ensure 'System DEP' is set to 'Enabled: Application Opt-Out'" + description: "This setting determines how applications become enrolled in Data Execution Protection (DEP). The recommended state for this setting is: Enabled: Application Opt-Out ." + rationale: "DEP marks pages of application memory as non-executable, which reduces a given exploit's ability to run attacker-controlled code." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Application Opt-Out : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\System DEP Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.7"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-38438-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> DEP -> 2' + + - id: 15174 + title: "Ensure 'System SEHOP' is set to 'Enabled: Application Opt-Out'" + description: "This setting determines how applications become enrolled in Structured Exception Handler Overwrite Protection (SEHOP). The recommended state for this setting is: Enabled: Application Opt-Out ." + rationale: "When a software component suffers from a memory corruption vulnerability, an exploit may be able to overwrite memory that contains data structures that control how the software handles exceptions. By corrupting these structures in a controlled manner, an exploit may be able to execute arbitrary code. SEHOP verifies the integrity of those structures before they are used to handle exceptions, which reduces the reliability of exploits that leverage structured exception handler overwrites." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Application Opt-Out : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\EMET\\System SEHOP Note: This Group Policy path does not exist by default. An additional Group Policy template ( EMET.admx/adml ) is required - it is included with Microsoft Enhanced Mitigation Experience Toolkit (EMET)." + compliance: + - cis: ["18.9.24.7"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-38438-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EMET\SysSettings -> SEHOP -> 2' + + - id: 15175 + title: "Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.1.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37775-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention -> 0' + + - id: 15176 + title: "Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.1.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37948-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> n:^(\d+) compare >= 32768' + + - id: 15177 + title: "Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.2.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37145-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention -> 0' + + - id: 15178 + title: "Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'" + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 196,608 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 196,608 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.2.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37695-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> n:^(\d+) compare >= 196608' + + - id: 15179 + title: "Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.3.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-38276-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention -> 0' + + - id: 15180 + title: "Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.3.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37526-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> n:^(\d+) compare >= 32768' + + - id: 15181 + title: "Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.4.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-36160-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention -> 0' + + - id: 15182 + title: "Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.4.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-36092-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> n:^(\d+) compare >= 32768' + + - id: 15183 + title: "Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'" + description: "Disabling Data Execution Prevention can allow certain legacy plug-in applications to function without terminating Explorer. The recommended state for this setting is: Disabled." + rationale: "Data Execution Prevention is an important security feature supported by Explorer that helps to limit the impact of certain types of malware." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off Data Execution Prevention for Explorer Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Explorer.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.30.2"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-37809-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention -> 0' + + - id: 15184 + title: "Ensure 'Turn off heap termination on corruption' is set to 'Disabled'" + description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." + rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off shell protocol protected mode Note: This Group Policy path is provided by the Group Policy template WindowsExplorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.30.3"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36660-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption -> 0' + + - id: 15185 + title: "Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'" + description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." + rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off shell protocol protected mode Note: This Group Policy path is provided by the Group Policy template WindowsExplorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.30.4"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36809-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior -> 0' + + # Section 18.9 - System + + # Section 18.9.39 - Location and Sensors + - id: 15186 + title: "Ensure 'Turn off Windows Location Provider' is set to 'Enabled'" + description: "This policy setting turns off the Windows Location Provider feature for the computer." + rationale: "This setting affects the Windows Location Provider feature (e.g. GPS or other location tracking)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Windows Location Provider\\Turn off Windows Location Provider." + compliance: + - cis: ["18.9.39.1.1"] + references: + - "CCE-38225-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableWindowsLocationProvider -> 1' + + - id: 15187 + title: "Ensure 'Turn off location' is set to 'Enabled'" + description: "This policy setting turns off the location feature for the computer. The recommended state for this setting is: Enabled." + rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Turn off location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sensors.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.39.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36886-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> 1' + + - id: 15188 + title: "Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'" + description: "This policy setting lets you prevent apps and features from working with files on OneDrive using the Next Generation Sync Client. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting prevents users from accidentally uploading confidential or sensitive corporate information to the OneDrive cloud service using the Next Generation Sync Client." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\OneDrive\\Prevent the usage of OneDrive for file storage Note: This Group Policy path may not exist by default. It is provided by the Group Policy template SkyDrive.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer). However, we strongly recommend you only use the version included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Older versions of the templates had conflicting settings in different template files for both OneDrive & SkyDrive, until it was cleaned up properly in the above version. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Prevent the usage of SkyDrive for file storage, but it was renamed starting with the Windows 10 RTM (Release 1507) Administrative Templates." + compliance: + - cis: ["18.9.52.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36939-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC -> 1' + + - id: 15189 + title: "Ensure 'Prevent the usage of OneDrive for file storage on Windows 8.1' is set to 'Enabled'" + description: "This policy setting lets you prevent apps and features from working with files on OneDrive using the legacy OneDrive/SkyDrive client. The recommended state for this setting is: Enabled. Note: Despite the name of this setting, it is applicable to the legacy OneDrive client on any Windows OS." + rationale: "Enabling this setting prevents users from accidentally uploading confidential or sensitive corporate information to the OneDrive cloud service using the legacy OneDrive/SkyDrive client." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\OneDrive\\Prevent the usage of OneDrive for file storage on Windows 8.1 Note: This Group Policy path may not exist by default. It is provided by the Group Policy template SkyDrive.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). We strongly recommend you only use either that version of the template or a newer one. Older versions of the templates had conflicting settings in different template files for both OneDrive & SkyDrive, until it was cleaned up properly in the above version." + compliance: + - cis: ["18.9.52.2"] + - cis_csc: ["13"] + - pci_dss: ["12.3.8"] + references: + - "CCE-36939-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Onedrive -> DisableFileSync -> 1' + + - id: 15190 + title: "Ensure 'Do not allow passwords to be saved' is set to 'Enabled'" + description: "This policy setting helps prevent Remote Desktop clients from saving passwords on a computer. The recommended state for this setting is: Enabled. Note: If this policy setting was previously configured as Disabled or Not configured, any previously saved passwords will be deleted the first time a Remote Desktop client disconnects from any server." + rationale: "An attacker with physical access to the computer may be able to break the protection guarding saved passwords. An attacker who compromises a user's account and connects to their computer could use saved passwords to gain access to additional hosts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Connection Client\\Do not allow passwords to be saved Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.2.2"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + references: + - "CCE-36223-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving -> 1' + + - id: 15191 + title: "Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'" + description: "This policy setting allows you to restrict users to a single Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "This setting ensures that users & administrators who Remote Desktop to a server will continue to use the same session - if they disconnect and reconnect, they will go back to the same session they were using before, preventing the creation of a second simultaneous session. This both prevents unnecessary resource usage by having the server host unnecessary additional sessions (which would put extra load on the server) and also ensures a consistency of experience for the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Connections\\Restrict Remote Desktop Services users to a single Remote Desktop Services session. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Restrict Terminal Services users to a single remote session, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.58.3.2.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-37708-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fSingleSessionPerUser -> 1' + + - id: 15192 + title: "Ensure 'Do not allow COM port redirection' is set to 'Enabled'" + description: "This policy setting specifies whether to prevent the redirection of data to client COM ports from the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for COM port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow COM port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.3.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37696-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> 1' + + - id: 15193 + title: "Ensure 'Do not allow drive redirection' is set to 'Enabled'" + description: "This policy setting prevents users from sharing the local drives on their client computers to Remote Desktop Servers that they access. Mapped drives appear in the session folder tree in Windows Explorer in the following format: \\\\TSClient\\$ If local drives are shared they are left vulnerable to intruders who want to exploit the data that is stored on them. The recommended state for this setting is: Enabled." + rationale: "Data could be forwarded from the user's Remote Desktop Services session to the user's local computer without any direct user interaction. Malicious software already present on a compromised server would have direct and stealthy disk access to the user's local computer during the Remote Desktop session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow drive redirection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.3.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36509-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm -> 1' + + - id: 15194 + title: "Ensure 'Do not allow LPT port redirection' is set to 'Enabled'" + description: "This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for LPT port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow LPT port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.3.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37778-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> 1' + + - id: 15195 + title: "Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'" + description: "This policy setting allows you to control the redirection of supported Plug and Play devices, such as Windows Portable Devices, to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for Plug and Play device redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow supported Plug and Play device redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.3.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37477-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> 1' + + - id: 15196 + title: "Ensure 'Always prompt for password upon connection' is set to 'Enabled'" + description: "This policy setting specifies whether Remote Desktop Services always prompts the client computer for a password upon connection. You can use this policy setting to enforce a password prompt for users who log on to Remote Desktop Services, even if they already provided the password in the Remote Desktop Connection client. The recommended state for this setting is: Enabled." + rationale: "Users have the option to store both their username and password when they create a new Remote Desktop Connection shortcut. If the server that runs Remote Desktop Services allows users who have used this feature to log on to the server but not enter their password, then it is possible that an attacker who has gained physical access to the user's computer could connect to a Remote Desktop Server through the Remote Desktop Connection shortcut, even though they may not know the user's password." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Always prompt for password upon connection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In the Microsoft Windows Vista Administrative Templates, this setting was named Always prompt client for password upon connection, but it was renamed starting with the Windows Server 2008 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.58.3.9.1"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-37929-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword -> 1' + + - id: 15197 + title: "Ensure 'Require secure RPC communication' is set to 'Enabled'" + description: "This policy setting allows you to specify whether Remote Desktop Services requires secure Remote Procedure Call (RPC) communication with all clients or allows unsecured communication. You can use this policy setting to strengthen the security of RPC communication with clients by allowing only authenticated and encrypted requests. The recommended state for this setting is: Enabled." + rationale: "Allowing unsecure RPC communication can exposes the server to man in the middle attacks and data disclosure attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require secure RPC communication Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.9.2"] + - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-37567-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic -> 1' + + - id: 15198 + title: "Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'" + description: "This policy setting specifies whether to require the use of a specific encryption level to secure communications between client computers and RD Session Host servers during Remote Desktop Protocol (RDP) connections. This policy only applies when you are using native RDP encryption. However, native RDP encryption (as opposed to SSL encryption) is not recommended. This policy does not apply to SSL encryption. The recommended state for this setting is: Enabled: High Level." + rationale: "If Remote Desktop client connections that use low level encryption are allowed, it is more likely that an attacker will be able to decrypt any captured Remote Desktop Services network traffic." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: High Level: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Set client connection encryption level Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.9.3"] + - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-36627-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel -> 3' + + - id: 15199 + title: "Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less'" + description: "This policy setting allows you to specify the maximum amount of time that an active Remote Desktop Services session can be idle (without user input) before it is automatically disconnected. The recommended state for this setting is: Enabled: 15 minutes or less." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of inactive sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 15 minutes or less: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for active but idle Remote Desktop Services sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Set time limit for active but idle Terminal Services sessions, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.58.3.10.1"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - "CCE-37562-6" + - https://workbench.cisecurity.org/benchmarks/766 + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare <= 900000' + + - id: 15200 + title: "Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'" + description: "This policy setting allows you to configure a time limit for disconnected Remote Desktop Services sessions. The recommended state for this setting is: Enabled: 1 minute." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of disconnected but still active sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. This setting is important to ensure a disconnected session is properly terminated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 minute: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for disconnected sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.10.2"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + references: + - "CCE-37949-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> 60000' + + - id: 15201 + title: "Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'" + description: "This policy setting specifies whether Remote Desktop Services retains a user's per-session temporary folders at logoff. The recommended state for this setting is: Disabled." + rationale: "Sensitive information could be contained inside the temporary folders and visible to other administrators that log into the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not delete temp folders upon exit Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Do not delete temp folder upon exit, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.58.3.11.1"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-37946-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit -> 1' + + - id: 15202 + title: "Ensure 'Do not use temporary folders per session' is set to 'Disabled'" + description: "By default, Remote Desktop Services creates a separate temporary folder on the RD Session Host server for each active session that a user maintains on the RD Session Host server. The temporary folder is created on the RD Session Host server in a Temp folder under the user's profile folder and is named with the sessionid. This temporary folder is used to store individual temporary files. To reclaim disk space, the temporary folder is deleted when the user logs off from a session. The recommended state for this setting is: Disabled." + rationale: "Disabling this setting keeps the cached data independent for each session, both reducing the chance of problems from shared cached data between sessions, and keeping possibly sensitive data separate to each user session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not use temporary folders per session Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.58.3.11.2"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-38180-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> PerSessionTempDir -> 1' + + - id: 15203 + title: "Ensure 'Prevent downloading of enclosures' is set to 'Enabled'" + description: "This policy setting prevents the user from having enclosures (file attachments) downloaded from an RSS feed to the user's computer. The recommended state for this setting is: Enabled." + rationale: "Allowing attachments to be downloaded through the RSS feed can introduce files that could have malicious intent." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\RSS Feeds\\Prevent downloading of enclosures Note: This Group Policy path is provided by the Group Policy template InetRes.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Turn off downloading of enclosures, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.59.1"] + - cis_csc: ["7.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-37126-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload -> 1' + + - id: 15204 + title: "Ensure 'Allow indexing of encrypted files' is set to 'Disabled'" + description: "This policy setting controls whether encrypted items are allowed to be indexed. When this setting is changed, the index is rebuilt completely. Full volume encryption (such as BitLocker Drive Encryption or a non-Microsoft solution) must be used for the location of the index to maintain security for encrypted files. The recommended state for this setting is: Disabled." + rationale: "Indexing and allowing users to search encrypted files could potentially reveal confidential data stored within the encrypted files." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow indexing of encrypted files Note: This Group Policy path is provided by the Group Policy template Search.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.60.2"] + - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38277-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems -> 0' + + - id: 15205 + title: "Ensure 'Set what information is shared in Search' is set to 'Enabled: Anonymous info'" + description: "Various levels of information can be shared with Bing in Search, to include user information and location. Configuring this setting prevents users from selecting the level of information shared and enables the most restrictive selection. The recommended state for this setting is: Enabled: Anonymous info." + rationale: "Limiting the search information shared with Microsoft Bing enhances privacy and security." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Anonymous info: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Set what information is shared in Search. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.60.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36937-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> ConnectedSearchPrivacy -> 3' + + - id: 15206 + title: "Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'" + description: "The Key Management Service (KMS) is a Microsoft license activation method that entails setting up a local server to store the software licenses. The KMS server itself needs to connect to Microsoft to activate the KMS service, but subsequent on-network clients can activate Microsoft Windows OS and/or their Microsoft Office via the KMS server instead of connecting directly to Microsoft. This policy setting lets you opt-out of sending KMS client activation data to Microsoft automatically. The recommended state for this setting is: Enabled." + rationale: "Even though the KMS licensing method does not require KMS clients to connect to Microsoft, they still send KMS client activation state data to Microsoft automatically. Preventing this information from being sent can help reduce privacy concerns in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Software Protection Platform\\Turn off KMS Client Online AVS Validation. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AVSValidationGP.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.65.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> 1' + + # Section - 18.9.76.9 - Reporting + + - id: 15207 + title: "Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled'" + description: 'This policy setting configures a local override for the configuration to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to "Windows Defender Antivirus Cloud Protection Service". This setting can only be set by Group Policy. The recommended state for this setting is: Disabled .' + rationale: "The decision on whether or not to participate in Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service for malicious software reporting should be made centrally in an enterprise managed environment, so that all computers within it behave consistently in that regard. Configuring this setting to Disabled ensures that the decision remains centrally managed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Configure local setting override for reporting to Microsoft MAPS Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.3.1"] + - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-36940-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting -> 0' + + - id: 15208 + title: "Ensure 'Join Microsoft MAPS' is set to 'Disabled'" + description: "This policy setting allows you to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to 'Windows Defender Antivirus Cloud Protection Service'. Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service is the online community that helps you choose how to respond to potential threats. The community also helps stop the spread of new malicious software infections. You can choose to send basic or additional information about detected software. Additional information helps Microsoft create new definitions and help it to protect your computer. Possible options are: - (0x0) Disabled (default) - (0x1) Basic membership - (0x2) Advanced membership Basic membership will send basic information to Microsoft about software that has been detected including where the software came from the actions that you apply or that are applied automatically and whether the actions were successful. Advanced membership in addition to basic information will send more information to Microsoft about malicious software spyware and potentially unwanted software including the location of the software file names how the software operates and how it has impacted your computer. The recommended state for this setting is: Disabled." + rationale: "The information that would be sent can include things like location of detected items on your computer if harmful software was removed. The information would be automatically collected and sent. In some instances personal information might unintentionally be sent to Microsoft. However, Microsoft states that it will not use this information to identify you or contact you. For privacy reasons in high security environments, it is best to prevent these data submissions altogether." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Join Microsoft MAPS. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.3.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting' + + - id: 15209 + title: "Ensure 'Turn on behavior monitoring' is set to 'Enabled'" + description: "This policy setting allows you to configure behavior monitoring for Windows Defender Antivirus. The recommended state for this setting is: Enabled ." + rationale: "When running an antivirus solution such as Windows Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Real-Time Protection\\Turn on behavior monitoring Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.7.1"] + - cis_csc: ["8.1"] + - pci_dss: ["5.2"] + references: + - "CCE-38389-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection -> DisableBehaviorMonitoring -> 0' + + - id: 15210 + title: "Ensure 'Configure Watson events' is set to 'Disabled'" + description: "This policy setting allows you to configure whether or not Watson events are sent." + rationale: "Watson events are the reports that get sent to Microsoft when a program or service crashes or fails, including the possibility of automatic submission." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Reporting\\Configure Watson events." + compliance: + - cis: ["18.9.76.9.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36950-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts -> 1' + + - id: 15211 + title: "Ensure 'Scan removable drives' is set to 'Enabled'" + description: "This policy setting allows you to manage whether or not to scan for malicious software and unwanted software in the contents of removable drives, such as USB flash drives, when running a full scan. The recommended state for this setting is: Enabled ." + rationale: "It is important to ensure that any present removable drives are always included in any type of scan, as removable drives are more likely to contain malicious software brought in to the enterprise managed environment from an external, unmanaged computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Scan\\Scan removable drives Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.10.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-38409-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning -> 0' + + - id: 15212 + title: "Ensure 'Turn on e-mail scanning' is set to 'Enabled'" + description: "This policy setting allows you to configure e-mail scanning. When e-mail scanning is enabled, the engine will parse the mailbox and mail files, according to their specific format, in order to analyze the mail bodies and attachments. Several e-mail formats are currently supported, for example: pst (Outlook), dbx, mbx, mime (Outlook Express), binhex (Mac). The recommended state for this setting is: Enabled ." + rationale: "Incoming e-mails should be scanned by an antivirus solution such as Windows Defender Antivirus, as email attachments are a commonly used attack vector to infiltrate computers with malicious software." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Scan\\Turn on e-mail scanning Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.76.10.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-36958-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning -> 0' + + - id: 15213 + title: "Ensure 'Turn off Windows Defender AntiVirus' is set to 'Disabled'" + description: "This policy setting turns off Windows Defender Antivirus. If the setting is configured to Disabled, Windows Defender Antivirus runs and computers are scanned for malware and other potentially unwanted software. The recommended state for this setting is: Disabled ." + rationale: "It is important to ensure a current, updated antivirus product is scanning each computer for malicious file activity. Microsoft provides a competent solution out of the box in Windows Defender Antivirus. Organizations that choose to purchase a reputable 3rd-party antivirus solution may choose to exempt themselves from this recommendation in lieu of the commercial alternative." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Turn off Windows Defender AntiVirus Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn off Windows Defender, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.76.14"] + - cis_csc: ["8.1"] + - pci_dss: ["5.2"] + - tsc: ["CC6.8"] + references: + - "CCE-36082-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> DisableAntiSpyware -> 0' + + - id: 15214 + title: "Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass'" + description: "This policy setting allows you to manage the behavior of Windows SmartScreen. Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. Some information is sent to Microsoft about files and programs run on PCs with this feature enabled. The recommended state for this setting is: Enabled: Warn and prevent bypass." + rationale: "Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. However, due to the fact that some information is sent to Microsoft about files and programs run on PCs some organizations may prefer to disable it." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Warn and prevent bypass: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender SmartScreen\\Explorer\\Configure Windows Defender SmartScreen Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsExplorer.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Configure Windows SmartScreen, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.80.1.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-35859-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen -> 2' + + - id: 15215 + title: "Ensure 'Configure Default consent' is set to 'Enabled: Always ask before sending data'" + description: "This setting allows you to set the default consent handling for error reports. The recommended state for this setting is: Enabled: Always ask before sending data." + rationale: "Error reports may contain sensitive information and should not be sent to anyone automatically." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Always ask before sending data: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Error Reporting\\Consent\\Configure Default consent Note: This Group Policy path is provided by the Group Policy template ErrorReporting.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.81.2.1"] + - cis_csc: ["13"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-37112-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting\Consent -> DefaultConsent -> 1' + + - id: 15216 + title: "Ensure 'Automatically send memory dumps for OS-generated error reports' is set to 'Disabled'" + description: "This policy setting controls whether memory dumps in support of OS-generated error reports can be sent to Microsoft automatically. This policy does not apply to error reports generated by 3rd-party products, or additional data other than memory dumps. The recommended state for this setting is: Disabled." + rationale: "Memory dumps may contain sensitive information and should not be automatically sent to anyone." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Error Reporting\\Automatically send memory dumps for OS- generated error reports Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ErrorReporting.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.81.3"] + - cis_csc: ["13"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36978-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> AutoApproveOSDumps -> 0' + + - id: 15217 + title: "Ensure 'Allow user control over installs' is set to 'Disabled'" + description: "This setting controls whether users are permitted to change installation options that typically are available only to system administrators. The security features of Windows Installer normally prevent users from changing installation options that are typically reserved for system administrators, such as specifying the directory to which files are installed. If Windows Installer detects that an installation package has permitted the user to change a protected option, it stops the installation and displays a message. These security features operate only when the installation program is running in a privileged security context in which it has access to directories denied to the user. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment, only IT staff with administrative rights should be installing or changing software on a system. Allowing users the ability to have any control over installs can risk unapproved software from being installed or removed from a system, which could cause the system to become vulnerable to compromise." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Allow user control over installs Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Enable user control over installs, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.85.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36400-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl -> 0' + + - id: 15218 + title: "Ensure 'Always install with elevated privileges' is set to 'Disabled'" + description: "This setting controls whether or not Windows Installer should use system permissions when it installs any program on the system. Note: This setting appears both in the Computer Configuration and User Configuration folders. To make this setting effective, you must enable the setting in both folders. Caution: If enabled, skilled users can take advantage of the permissions this setting grants to change their privileges and gain permanent access to restricted files and folders. Note that the User Configuration version of this setting is not guaranteed to be secure. The recommended state for this setting is: Disabled." + rationale: "Users with limited privileges can exploit this feature by creating a Windows Installer installation package that creates a new local account that belongs to the local built-in Administrators group, adds their current account to the local built-in Administrators group, installs malicious software, or performs other unauthorized activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Always install with elevated privileges Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.85.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36919-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated -> 0' + + - id: 15219 + title: "Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'" + description: "This policy setting controls whether Web-based programs are allowed to install software on the computer without notifying the user. The recommended state for this setting is: Disabled." + rationale: "Suppressing the system warning can pose a security risk and increase the attack surface on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Prevent Internet Explorer security prompt for Windows Installer scripts. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable IE security prompt for Windows Installer scripts, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.85.3"] + - cis_csc: ["7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37524-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> 0' + + - id: 15220 + title: "Ensure 'Sign-in last interactive user automatically after a system-initiated restart' is set to 'Disabled'" + description: "This policy setting controls whether a device will automatically sign-in the last interactive user after Windows Update restarts the system. The recommended state for this setting is: Disabled." + rationale: "Disabling this feature will prevent the caching of user's credentials and unauthorized use of the device, and also ensure the user is aware of the restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Logon Options\\Sign-in last interactive user automatically after a system-initiated restart Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinLogon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.86.1"] + - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + references: + - "CCE-36977-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn -> 1' + + - id: 15221 + title: "Ensure 'Turn on PowerShell Script Block Logging' is set to 'Disabled'" + description: "This policy setting enables logging of all PowerShell script input to the Microsoft-Windows- PowerShell/Operational event log. The recommended state for this setting is: Disabled. Note: In Microsoft's own hardening guidance, they recommend the opposite value, Enabled, because having this data logged improves investigations of PowerShell attack incidents. However, the default ACL on the PowerShell Operational log allows Interactive User (i.e. any logged on user) to read it, and therefore possibly expose passwords or other sensitive information to unauthorized users. If Microsoft locks down the default ACL on that log in the future (e.g. to restrict it only to Administrators), then we will revisit this recommendation in a future release." + rationale: "There are potential risks of capturing passwords in the PowerShell logs. This setting should only be needed for debugging purposes, and not in normal operation, it is important to ensure this is set to Disabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Script Block Logging Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.95.1"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging -> 0' + + - id: 15222 + title: "Ensure 'Turn on PowerShell Transcription' is set to 'Disabled'" + description: "This Policy setting lets you capture the input and output of Windows PowerShell commands into text-based transcripts. The recommended state for this setting is: Disabled." + rationale: "If this setting is enabled there is a risk that passwords could get stored in plain text in the PowerShell_transcript output file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Transcription Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.95.2"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting -> 0' + + - id: 15223 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client uses Basic authentication. The recommended state for this setting is: Disabled." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow Basic authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.1.1"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36310-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic -> 0' + + - id: 15224 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow unencrypted traffic Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.1.2"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37726-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic -> 0' + + - id: 15225 + title: "Ensure 'Disallow Digest authentication' is set to 'Enabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client will not use Digest authentication. The recommended state for this setting is: Enabled." + rationale: "Digest authentication is less robust than other authentication methods available in WinRM, an attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Disallow Digest authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.1.3"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-38318-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest -> 0' + + - id: 15226 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service accepts Basic authentication from a remote client. The recommended state for this setting is: Disabled." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow Basic authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.2.1"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36254-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic -> 0' + + - id: 15227 + title: "Ensure 'Allow remote server management through WinRM' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port. The recommended state for this setting is: Disabled." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Management (WinRM) service on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow automatic configuration of listeners, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.97.2.2"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37927-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> 0' + + - id: 15228 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow unencrypted traffic Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.2.3"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-38223-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic -> 0' + + - id: 15229 + title: "Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service will allow RunAs credentials to be stored for any plug-ins. The recommended state for this setting is: Enabled. Note: If you enable and then disable this policy setting, any values that were previously configured for RunAsPassword will need to be reset." + rationale: "Although the ability to store RunAs credentials is a convenient feature it increases the risk of account compromise slightly. For example, if you forget to lock your desktop before leaving it unattended for a few minutes another person could access not only the desktop of your computer but also any hosts you manage via WinRM with cached RunAs credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Disallow WinRM from storing RunAs credentials Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.97.2.4"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + references: + - "CCE-36000-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs -> 1' + + - id: 15230 + title: "Ensure 'Allow Remote Shell Access' is set to 'Disabled'" + description: "This policy setting allows you to manage configuration of remote access to all supported shells to execute scripts and commands. The recommended state for this setting is: Disabled. Note: The GPME help text for this setting is incorrectly worded, implying that configuring it to Enabled will reject new Remote Shell connections, and setting it to Disabled will allow Remote Shell connections. The opposite is true (and is consistent with the title of the setting). This is a wording mistake by Microsoft in the Administrative Template." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Shell on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Shell\\Allow Remote Shell Access. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteShell.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.98.1"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36499-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> 0' + + - id: 15231 + title: "Ensure 'Configure Automatic Updates' is set to 'Enabled'" + description: "This policy setting specifies whether computers in your environment will receive security updates from Windows Update or WSUS. If you configure this policy setting to Enabled, the operating system will recognize when a network connection is available and then use the network connection to search Windows Update or your designated intranet site for updates that apply to them. After you configure this policy setting to Enabled, select one of the following three options in the Configure Automatic Updates Properties dialog box to specify how the service will work: - 2 - Notify for download and auto install (Notify before downloading any updates) - 3 - Auto download and notify for install (Download the updates automatically and notify when they are ready to be installed.) (Default setting) - 4 - Auto download and schedule the install (Automatically download updates and install them on the schedule specified below.)) - 5 - Allow local admin to choose setting (Leave decision on above choices up to the local Administrators (Not Recommended)) The recommended state for this setting is: Enabled. Note: The sub-setting 'Configure automatic updating:' has 4 possible values - all of them are valid depending on specific organizational needs, however if feasible we suggest using a value of 4 - Auto download and schedule the install. This suggestion is not a scored requirement. Note #2: Organizations that utilize a 3rd-party solution for patching may choose to exempt themselves from this setting, and instead configure it to Disabled so that the native Windows Update mechanism does not interfere with the 3rd-party patching process." + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Configure Automatic Updates Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.101.2"] + - cis_csc: ["4.5"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36172-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> 0' + + - id: 15232 + title: "Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'" + description: "This policy setting specifies when computers in your environment will receive security updates from Windows Update or WSUS. The recommended state for this setting is: 0 - Every day. Note: This setting is only applicable if 4 - Auto download and schedule the install is selected in Rule 18.9.101.2. It will have no impact if any other option is selected." + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to 0 - Every day: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Configure Automatic Updates: Scheduled install day Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.101.3"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + references: + - "CCE-36172-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay -> 0' + + - id: 15233 + title: "Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'" + description: "This policy setting specifies that Automatic Updates will wait for computers to be restarted by the users who are logged on to them to complete a scheduled installation. The recommended state for this setting is: Disabled. Note: This setting applies only when you configure Automatic Updates to perform scheduled update installations. If you configure the Configure Automatic Updates setting to Disabled, this setting has no effect." + rationale: "Some security updates require that the computer be restarted to complete an installation. If the computer cannot restart automatically, then the most recent update will not completely install and no new updates will download to the computer until it is restarted. Without the auto-restart functionality, users who are not security-conscious may choose to indefinitely delay the restart, therefore keeping the computer in a less secure state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\No auto-restart with logged on users for scheduled automatic updates installations Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named No auto-restart for scheduled Automatic Updates installations, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.101.4"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + references: + - "CCE-37027-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers -> 0' diff --git a/etc/ruleset/sca/windows/cis_win2016.yml b/etc/ruleset/sca/windows/cis_win2016.yml new file mode 100644 index 0000000000..c30a8ca637 --- /dev/null +++ b/etc/ruleset/sca/windows/cis_win2016.yml @@ -0,0 +1,6861 @@ +# Security Configuration Assessment +# CIS Checks for Windows 2016 +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for Microsoft Windows Server 2016 v2.0.0 - 04-14-2023 + +policy: + id: "cis_win2016" + file: "cis_win2016.yml" + name: "CIS Microsoft Windows Server 2016 v2.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows Server 2016." + disclaimer: "Please note that the rules provide accurate results for Windows Server 2016 Operating Systems with the System language set to English. The SCA policy will work with other languages but the results will be less accurate due to some of the rules that depend on the System language." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform is Windows Server 2016" + description: "Requirements for running the CIS benchmark under Windows Server 2016" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows Server 2016' + +checks: + ############################################### + # 1 Account Policies + ############################################### + # 1.1 Password Policy + ############################################### + # 1.1.1 (L1) Ensure 'Enforce password history' is set to '24 or more password(s)'. (Automated) - Not Implemented + + # 1.1.2 (L1) Ensure 'Maximum password age' is set to '365 or fewer days, but not 0'. (Automated) + - id: 16000 + title: "Ensure 'Maximum password age' is set to '365 or fewer days, but not 0'." + description: "This policy setting defines how long a user can use their password before it expires. Values for this policy setting range from 0 to 999 days. If you set the value to 0, the password will never expire. Because attackers can crack passwords, the more frequently you change the password the less opportunity an attacker has to use a cracked password. However, the lower this value is set, the higher the potential for an increase in calls to help desk support due to users having to change their password or forgetting which password is current. The recommended state for this setting is 365 or fewer days, but not 0. Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "The longer a password exists the higher the likelihood that it will be compromised by a brute force attack, by an attacker gaining general knowledge about the user, or by the user sharing the password. Configuring the Maximum password age setting to 0 so that users are never required to change their passwords is a major security risk because that allows a compromised password to be used by the malicious user for as long as the valid user has authorized access." + impact: "If the Maximum password age setting is too low, users are required to change their passwords very often. Such a configuration can reduce security in the organization, because users might write their passwords in an insecure location or lose them. If the value for this policy setting is too high, the level of security within an organization is reduced because it allows potential attackers more time in which to discover user passwords or to use compromised accounts." + remediation: "To establish the recommended configuration via GP, set the following UI path to 365 or fewer days, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Maximum password age." + references: + - "https://www.cisecurity.org/white-papers/cis-password-policy-guide/" + compliance: + - cis: ["1.1.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["16.10"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> n:^(\d+) compare <= 365' + + # 1.1.3 (L1) Ensure 'Minimum password age' is set to '1 or more day(s)'. (Automated) - Not Implemented + # 1.1.4 (L1) Ensure 'Minimum password length' is set to '14 or more character(s)'. (Automated) - Not Implemented + # 1.1.5 (L1) Ensure 'Password must meet complexity requirements' is set to 'Enabled'. (Automated) - Not Implemented + # 1.1.6 (L1) Ensure 'Store passwords using reversible encryption' is set to 'Disabled'. (Automated) - Not Implemented + ############################################## + # 1.2 Account Lockout Policy + ############################################## + # 1.2.1 (L1) Ensure 'Account lockout duration' is set to '15 or more minute(s)'. (Automated) - Not Implemented + # 1.2.2 (L1) Ensure 'Account lockout threshold' is set to '5 or fewer invalid logon attempt(s), but not 0'. (Automated) - Not Implemented + # 1.2.3 (L1) Ensure 'Allow Administrator account lockout' is set to 'Enabled'. (Manual) - Not Implemented + # 1.2.4 (L1) Ensure 'Reset account lockout counter after' is set to '15 or more minute(s)'. (Automated) - Not Implemented + ################################# + # 2 Local Policies + ################################# + # 2.1 Audit Policy + ################################# + # 2.2 User Rights Assignment + ################################# + # 2.2.1 (L1) Ensure 'Access Credential Manager as a trusted caller' is set to 'No One'. (Automated) - Not Implemented + # 2.2.2 (L1) Ensure 'Access this computer from the network' is set to 'Administrators, Authenticated Users, ENTERPRISE DOMAIN CONTROLLERS' (DC only). (Automated) - Not Implemented + # 2.2.3 (L1) Ensure 'Access this computer from the network' is set to 'Administrators, Authenticated Users' (MS only). (Automated) - Not Implemented + # 2.2.4 (L1) Ensure 'Act as part of the operating system' is set to 'No One'. (Automated) - Not Implemented + # 2.2.5 (L1) Ensure 'Add workstations to domain' is set to 'Administrators' (DC only). (Automated) - Not Implemented + # 2.2.6 (L1) Ensure 'Adjust memory quotas for a process' is set to 'Administrators, LOCAL SERVICE, NETWORK SERVICE'. (Automated) - Not Implemented + # 2.2.7 (L1) Ensure 'Allow log on locally' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.8 (L1) Ensure 'Allow log on through Remote Desktop Services' is set to 'Administrators' (DC only). (Automated) - Not Implemented + # 2.2.9 (L1) Ensure 'Allow log on through Remote Desktop Services' is set to 'Administrators, Remote Desktop Users' (MS only). (Automated) - Not Implemented + # 2.2.10 (L1) Ensure 'Back up files and directories' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.11 (L1) Ensure 'Change the system time' is set to 'Administrators, LOCAL SERVICE'. (Automated) - Not Implemented + # 2.2.12 (L1) Ensure 'Change the time zone' is set to 'Administrators, LOCAL SERVICE'. (Automated) - Not Implemented + # 2.2.13 (L1) Ensure 'Create a pagefile' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.14 (L1) Ensure 'Create a token object' is set to 'No One'. (Automated) - Not Implemented + # 2.2.15 (L1) Ensure 'Create global objects' is set to 'Administrators, LOCAL SERVICE, NETWORK SERVICE, SERVICE'. (Automated) - Not Implemented + # 2.2.16 (L1) Ensure 'Create permanent shared objects' is set to 'No One'. (Automated) - Not Implemented + # 2.2.17 (L1) Ensure 'Create symbolic links' is set to 'Administrators' (DC only). (Automated) - Not Implemented + # 2.2.18 (L1) Ensure 'Create symbolic links' is set to 'Administrators, NT VIRTUAL MACHINE\Virtual Machines' (MS only). (Automated) - Not Implemented + # 2.2.19 (L1) Ensure 'Debug programs' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.20 (L1) Ensure 'Deny access to this computer from the network' to include 'Guests' (DC only). (Automated) - Not Implemented + # 2.2.21 (L1) Ensure 'Deny access to this computer from the network' to include 'Guests, Local account and member of Administrators group' (MS only). (Automated) - Not Implemented + # 2.2.22 (L1) Ensure 'Deny log on as a batch job' to include 'Guests'. (Automated) - Not Implemented + # 2.2.23 (L1) Ensure 'Deny log on as a service' to include 'Guests'. (Automated) - Not Implemented + # 2.2.24 (L1) Ensure 'Deny log on locally' to include 'Guests'. (Automated) - Not Implemented + # 2.2.25 (L1) Ensure 'Deny log on through Remote Desktop Services' to include 'Guests' (DC only). (Automated) - Not Implemented + # 2.2.26 (L1) Ensure 'Deny log on through Remote Desktop Services' is set to 'Guests, Local account' (MS only). (Automated) - Not Implemented + # 2.2.27 (L1) Ensure 'Enable computer and user accounts to be trusted for delegation' is set to 'Administrators' (DC only). (Automated) - Not Implemented + # 2.2.28 (L1) Ensure 'Enable computer and user accounts to be trusted for delegation' is set to 'No One' (MS only). (Automated) - Not Implemented + # 2.2.29 (L1) Ensure 'Force shutdown from a remote system' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.30 (L1) Ensure 'Generate security audits' is set to 'LOCAL SERVICE, NETWORK SERVICE'. (Automated) - Not Implemented + # 2.2.31 (L1) Ensure 'Impersonate a client after authentication' is set to 'Administrators, LOCAL SERVICE, NETWORK SERVICE, SERVICE' (DC only). (Automated) - Not Implemented + # 2.2.33 (L1) Ensure 'Increase scheduling priority' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.34 (L1) Ensure 'Load and unload device drivers' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.35 (L1) Ensure 'Lock pages in memory' is set to 'No One'. (Automated) - Not Implemented + # 2.2.36 (L2) Ensure 'Log on as a batch job' is set to 'Administrators' (DC Only). (Automated) - Not Implemented + # 2.2.38 (L1) Ensure 'Manage auditing and security log' is set to 'Administrators' (MS only). (Automated) - Not Implemented + # 2.2.39 (L1) Ensure 'Modify an object label' is set to 'No One'. (Automated) - Not Implemented + # 2.2.40 (L1) Ensure 'Modify firmware environment values' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.41 (L1) Ensure 'Perform volume maintenance tasks' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.42 (L1) Ensure 'Profile single process' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.43 (L1) Ensure 'Profile system performance' is set to 'Administrators, NT SERVICE\WdiServiceHost'. (Automated) - Not Implemented + # 2.2.44 (L1) Ensure 'Replace a process level token' is set to 'LOCAL SERVICE, NETWORK SERVICE'. (Automated) - Not Implemented + # 2.2.45 (L1) Ensure 'Restore files and directories' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.46 (L1) Ensure 'Shut down the system' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.47 (L1) Ensure 'Synchronize directory service data' is set to 'No One' (DC only). (Automated) - Not Implemented + # 2.2.48 (L1) Ensure 'Take ownership of files or other objects' is set to 'Administrators'. (Automated) - Not Implemented + + ####################################### + # 2.3 Security Options + ####################################### + # 2.3.1 Accounts + ####################################### + # 2.3.1.1 (L1) Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts'. (Automated) + - id: 16001 + title: "Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts'." + description: "This policy setting prevents users from adding new Microsoft accounts on this computer. The recommended state for this setting is: Users can't add or log on with Microsoft accounts." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used to log onto their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + impact: "Users will not be able to log onto the computer with their Microsoft account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Users can't add or log on with Microsoft accounts: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Block Microsoft accounts." + compliance: + - cis: ["2.3.1.1"] + - cis_csc_v7: ["16.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> 3' + + # 2.3.1.2 (L1) Ensure 'Accounts: Guest account status' is set to 'Disabled' (MS only). (Automated) + - id: 16002 + title: "Ensure 'Accounts: Guest account status' is set to 'Disabled' (MS only)." + description: "This policy setting determines whether the Guest account is enabled or disabled. The Guest account allows unauthenticated network users to gain access to the system. The recommended state for this setting is: Disabled. Note: This setting will have no impact when applied to the Domain Controllers organizational unit via group policy because Domain Controllers have no local account database. It can be configured at the domain level via group policy, similar to account lockout and password policy settings." + rationale: "The default Guest account allows unauthenticated network users to log on as Guest with no password. These unauthorized users could access any resources that are accessible to the Guest account over the network. This capability means that any network shares with permissions that allow access to the Guest account, the Guests group, or the Everyone group will be accessible over the network, which could lead to the exposure or corruption of data." + impact: "All network users will need to authenticate before they can access shared resources. If you disable the Guest account and the Network Access: Sharing and Security Model option is set to Guest Only, network logons, such as those performed by the Microsoft Network Server (SMB Service), will fail. This policy setting should have little impact on most organizations because it is the default setting in Microsoft Windows 2000, Windows XP, and Windows Server™ 2003." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Guest account status." + compliance: + - cis: ["2.3.1.2"] + - cis_csc_v8: ["4.7"] + - cis_csc_v7: ["16.8"] + - iso_27001-2013: ["A.9.2.1"] + - pci_dss_v3.2.1: ["2.1", "2.1.1"] + - pci_dss_v4.0: ["2.2.2", "2.3.1"] + - soc_2: ["CC6.3"] + condition: any + rules: + - 'c:net user guest -> r:Account active\s+No' + - 'c:net user guest -> r:The user name could not be found.' + + # 2.3.1.3 (L1) Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'. (Automated) + - id: 16003 + title: "Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'." + description: "This policy setting determines whether local accounts that are not password protected can be used to log on from locations other than the physical computer console. If you enable this policy setting, local accounts that have blank passwords will not be able to log on to the network from remote client computers. Such accounts will only be able to log on at the keyboard of the computer. The recommended state for this setting is: Enabled." + rationale: "Blank passwords are a serious threat to computer security and should be forbidden through both organizational policy and suitable technical measures. In fact, the default settings for Active Directory domains require complex passwords of at least seven characters. However, if users with the ability to create new accounts bypass your domain-based password policies, they could create accounts with blank passwords. For example, a user could build a stand-alone computer, create one or more accounts with blank passwords, and then join the computer to the domain. The local accounts with blank passwords would still function. Anyone who knows the name of one of these unprotected accounts could then use it to log on." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Limit local account use of blank passwords to console logon only." + compliance: + - cis: ["2.3.1.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse -> 1' + + # 2.3.1.4 (L1) Configure 'Accounts: Rename administrator account'. (Automated) - Not Implemented + # 2.3.1.5 (L1) Configure 'Accounts: Rename guest account'. (Automated) - Not Implemented + ############################# + # 2.3.2 Audit + ############################# + # 2.3.2.1 (L1) Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled' (Automated) + - id: 16004 + title: "Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'." + description: "This policy setting allows administrators to enable the more precise auditing capabilities present in Windows Vista. The Audit Policy settings available in Windows Server 2003 Active Directory do not yet contain settings for managing the new auditing subcategories. To properly apply the auditing policies prescribed in this baseline, the Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings setting needs to be configured to Enabled. The recommended state for this setting is: Enabled. Important: Be very cautious about audit settings that can generate a large volume of traffic. For example, if you enable either success or failure auditing for all of the Privilege Use subcategories, the high volume of audit events generated can make it difficult to find other types of entries in the Security log. Such a configuration could also have a significant impact on system performance." + rationale: "Prior to the introduction of auditing subcategories in Windows Vista, it was difficult to track events at a per-system or per-user level. The larger event categories created too many events and the key information that needed to be audited was difficult to find." + impact: None - this is the default behavior. + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings." + references: + - "https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing#to-ensure-that-advanced-audit-policy-configuration-settings-are-not-overwritten" + compliance: + - cis: ["2.3.2.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_4.0: ["9.4.5", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy -> 1' + + # 2.3.2.2 (L1) Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'. (Automated) + - id: 16005 + title: "Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'." + description: "This policy setting determines whether the system shuts down if it is unable to log Security events. It is a requirement for Trusted Computer System Evaluation Criteria (TCSEC)-C2 and Common Criteria certification to prevent auditable events from occurring if the audit system is unable to log them. Microsoft has chosen to meet this requirement by halting the system and displaying a stop message if the auditing system experiences a failure. When this policy setting is enabled, the system will be shut down if a security audit cannot be logged for any reason. If the Audit: Shut down system immediately if unable to log security audits setting is enabled, unplanned system failures can occur. The administrative burden can be significant, especially if you also configure the Retention method for the Security log to Do not overwrite events (clear log manually). This configuration causes a repudiation threat (a backup operator could deny that they backed up or restored data) to become a denial of service (DoS) vulnerability, because a server could be forced to shut down if it is overwhelmed with logon events and other security events that are written to the Security log. Also, because the shutdown is not graceful, it is possible that irreparable damage to the operating system, applications, or data could result. Although the NTFS file system guarantees its integrity when an ungraceful computer shutdown occurs, it cannot guarantee that every data file for every application will still be in a usable form when the computer restarts. The recommended state for this setting is: Disabled." + rationale: "If the computer is unable to record events to the Security log, critical evidence or important troubleshooting information may not be available for review after a security incident. Also, an attacker could potentially generate a large volume of Security log events to purposely force a computer shutdown." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Shut down system immediately if unable to log security audits." + compliance: + - cis: ["2.3.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 0' + + ########################### + # 2.3.3 DCOM + ########################### + # 2.3.4 Devices + ########################### + # 2.3.4.1 (L1) Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators'. (Automated) + - id: 16006 + title: "Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators'." + description: "This policy setting determines who is allowed to format and eject removable NTFS media. You can use this policy setting to prevent unauthorized users from removing data on one computer to access it on another computer on which they have local administrator privileges. The recommended state for this setting is: Administrators." + rationale: "Users may be able to move data on removable disks to a different computer where they have administrative privileges. The user could then take ownership of any file, grant themselves full control, and view or modify any file. The fact that most removable storage devices will eject media by pressing a mechanical button diminishes the advantage of this policy setting." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Allowed to format and eject removable media." + compliance: + - cis: ["2.3.4.1"] + - cis_csc_v7: ["13.7"] + - iso_27001-2013: ["A.8.3.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD -> 0' + + # 2.3.4.2 (L1) Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'. (Automated) + - id: 16007 + title: "Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'." + description: "For a computer to print to a shared printer, the driver for that shared printer must be installed on the local computer. This security setting determines who is allowed to install a printer driver as part of connecting to a shared printer. The recommended state for this setting is: Enabled. Note: This setting does not affect the ability to add a local printer. This setting does not affect Administrators." + rationale: "It may be appropriate in some organizations to allow users to install printer drivers on their own workstations. However, you should allow only Administrators, not users, to do so on servers, because printer driver installation on a server may unintentionally cause the computer to become less stable. A malicious user could install inappropriate printer drivers in a deliberate attempt to damage the computer, or a user might accidentally install malicious software that masquerades as a printer driver. It is feasible for an attacker to disguise a Trojan horse program as a printer driver. The program may appear to users as if they must use it to print, but such a program could unleash malicious code on your computer network." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Prevent users from installing printer drivers." + compliance: + - cis: ["2.3.4.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> 1' + + ########################### + # 2.3.5 Domain controller + ########################### + # 2.3.5.1 (L1) Ensure 'Domain controller: Allow server operators to schedule tasks' is set to 'Disabled' (DC only). (Automated) + - id: 16008 + title: "Ensure 'Domain controller: Allow server operators to schedule tasks' is set to 'Disabled' (DC only)." + description: "This policy setting determines whether members of the Server Operators group are allowed to submit jobs by means of the AT schedule facility. The impact of this policy setting configuration should be small for most organizations. Users, including those in the Server Operators group, will still be able to create jobs by means of the Task Scheduler Wizard, but those jobs will run in the context of the account with which the user authenticates when they set up the job. Note: An AT Service Account can be modified to select a different account rather than the LOCAL SYSTEM account. To change the account, open System Tools, click Scheduled Tasks, and then click Accessories folder. Then click AT Service Account on the Advanced menu. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting, jobs that are created by server operators by means of the AT service will execute in the context of the account that runs that service. By default, that is the local SYSTEM account. If you enable this policy setting, server operators could perform tasks that SYSTEM is able to do but that they would typically not be able to do, such as add their account to the local Administrators group." + impact: "None - this is the default behavior. Note that users (including those in the Server Operators group) are still able to create jobs by means of the Task Scheduler Wizard. However, those jobs will run in the context of the account that the user authenticates with when setting up the job." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Allow server operators to schedule tasks." + compliance: + - cis: ["2.3.5.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> SubmitControl' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> SubmitControl -> 0' + + # 2.3.5.2 (L1) Ensure 'Domain controller: Allow vulnerable Netlogon secure channel connections' is set to 'Not Configured' (DC Only). (Automated) + - id: 16009 + title: "Ensure 'Domain controller: Allow vulnerable Netlogon secure channel connections' is set to 'Not Configured' (DC Only)." + description: "This security setting determines whether the domain controller bypasses secure RPC for Netlogon secure channel connections for specified machine accounts. When deployed, this policy should be applied to all domain controllers in a forest by enabling the policy on the domain controllers OU. When the Create Vulnerable Connections list (allow list) is configured: - Given allow permission, the domain controller will allow accounts to use a Netlogon secure channel without secure RPC. - Given deny permission, the domain controller will require accounts to use a Netlogon secure channel with secure RPC which is the same as the default (not necessary). Note: Warning from Microsoft - enabling this policy will expose your domain-joined devices and can expose your Active Directory forest to risk. This policy should be used as a temporary measure for 3rd-party devices as you deploy updates. Once a 3rd-party device is updated to support using secure RPC with Netlogon secure channels, the account should be removed from the Create Vulnerable Connections list. To better understand the risk of configuring accounts to be allowed to use vulnerable Netlogon secure channel connections, please visit How to manage the changes in Netlogon secure channel connections associated with CVE-2020-1472. The recommended state for this setting is: Not Configured." + rationale: "Enabling this policy will expose your domain-joined devices and can expose your Active Directory forest to security risks. It is highly recommended that this setting not be used (i.e. be left completely unconfigured) so as not to add risk." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Not Configured: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Allow vulnerable Netlogon secure channel connections." + references: + - "https://go.microsoft.com/fwlink/?linkid=2133485" + compliance: + - cis: ["2.3.5.2"] + condition: none + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters -> VulnerableChannelAllowList' + + # 2.3.5.3 (L1) Ensure 'Domain controller: LDAP server channel binding token requirements' is set to 'Always' (DC Only). (Automated) + - id: 16010 + title: "Ensure 'Domain controller: LDAP server channel binding token requirements' is set to 'Always' (DC Only)." + description: "This setting determines whether the LDAP server (Domain Controller) enforces validation of Channel Binding Tokens (CBT) received in LDAP bind requests that are sent over SSL/TLS (i.e. LDAPS). The recommended state for this setting is: Always. Note: All LDAP clients must have the CVC-2017-8563 security update to be compatible with Domain Controllers that have this setting enabled. More information on this setting is available at: MSKB 4520412: 2020 LDAP channel binding and LDAP signing requirements for Windows." + rationale: 'Requiring Channel Binding Tokens (CBT) can prevent an attacker who is able to capture users'' authentication credentials (e.g. OAuth tokens, session identifiers, etc.) from reusing those credentials in another TLS session. This also helps to increase protection against "man-in-the-middle" attacks using LDAP authentication over SSL/TLS (LDAPS).' + impact: "All LDAP clients must provide channel binding information over SSL/TLS (i.e. LDAPS). The LDAP server (Domain Controller) rejects authentication requests from clients that do not do so. Clients must have the CVC-2017-8563 security update to support this feature, and may have compatibility issues with this setting without the security update. This may also mean that LDAP authentication requests over SSL/TLS that previously worked may stop working until the security update is installed. When first deploying this setting, you may initially want to only set it to the alternate setting of When supported (instead of Always) on all Domain Controllers. This alternate, interim setting enables support for LDAP client channel binding but does not require it. Then set one DC that is not currently being targeted by LDAP clients to Always, and test each of the critical LDAP clients against that DC (and remediating as necessary), before deploying Always to the rest of the DCs. We also recommend using the new Event ID 3039 on your Domain Controllers (added with the March 2020 security update) to help locate clients that do not use Channel Binding Tokens (CBT) in their LDAPS connections. This new Event ID requires increasing the logging level of the 16 LDAP Interface Events portion of the NTDS service diagnostics to a value of 2 (Basic). For more information, please see Table 2: CBT events at this link: MSKB 4520412: 2020 LDAP channel binding and LDAP signing requirements for Windows Older OSes such as Windows XP, Windows Server 2003, Windows Vista and Windows Server 2008 (non-R2), will first require patches for Microsoft Security Advisory 973811, as well as all associated fixes, in order to be compatible with domain controllers that have this setting deployed. Note: Only Always is actually considered compliant to the CIS benchmark." + remediation: "To establish the recommended configuration via GP, set the following UI path to Always: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: LDAP server channel binding token requirements Note: This Group Policy path requires the installation of the March 2020 (or later) Windows security update. With that update, Microsoft added this setting to the built-in OS security template." + compliance: + - cis: ["2.3.5.3"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["16.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters -> LdapEnforceChannelBinding' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters -> LdapEnforceChannelBinding -> 2' + + # 2.3.5.4 (L1) Ensure 'Domain controller: LDAP server signing requirements' is set to 'Require signing' (DC only). (Automated) + - id: 16011 + title: "Ensure 'Domain controller: LDAP server signing requirements' is set to 'Require signing' (DC only)." + description: "This policy setting determines whether the Lightweight Directory Access Protocol (LDAP) server requires LDAP clients to negotiate data signing. The recommended state for this setting is: Require signing. Note: Domain member computers must have Network security: LDAP signing requirements (Rule 2.3.11.8) set to Negotiate signing or higher. If not, they will fail to authenticate once the above Require signing value is configured on the Domain Controllers. Fortunately, Negotiate signing is the default in the client configuration. Note #2: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are shipped with Windows XP Professional use LDAP simple bind or LDAP simple bind through SSL to talk to a Domain Controller. Note #3: Before enabling this setting, you should first ensure that there are no clients (including server-based applications) that are configured to authenticate with Active Directory via unsigned LDAP, because changing this setting will break those applications. Such applications should first be reconfigured to use signed LDAP, Secure LDAP (LDAPS), or IPsec-protected connections. For more information on how to identify whether your DCs are being accessed via unsigned LDAP (and where those accesses are coming from), see this Microsoft TechNet blog article: Identifying Clear Text LDAP binds to your DC's - Practical Windows Security." + rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks. In such attacks, an intruder captures packets between the server and the client, modifies them, and then forwards them to the client. Where LDAP servers are concerned, an attacker could cause a client to make decisions that are based on false records from the LDAP directory. To lower the risk of such an intrusion in an organization's network, you can implement strong physical security measures to protect the network infrastructure. Also, you could implement Internet Protocol security (IPsec) authentication header mode (AH), which performs mutual authentication and packet integrity for IP traffic to make all types of man-in-the-middle attacks extremely difficult. Additionally, allowing the use of regular, unsigned LDAP permits credentials to be received over the network in clear text, which could very easily result in the interception of account passwords by other systems on the network." + impact: "Unless TLS/SSL is being used, the LDAP data signing option must be negotiated. Clients that do not support LDAP signing will be unable to run LDAP queries against the Domain Controllers. All Windows 2000-based computers in your organization that are managed from Windows Server 2003-based or Windows XP-based computers and that use Windows NT Challenge/Response (NTLM) authentication must have Windows 2000 Service Pack 3 (SP3) installed. Alternatively, these clients must have a registry change. For information about this registry change, see Microsoft Knowledge Base article 325465: Windows 2000 domain controllers require SP3 or later when using Windows Server 2003 administration tools. Also, some non-Microsoft operating systems do not support LDAP signing. If you enable this policy setting, client computers that use those operating systems may be unable to access domain resources." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require signing: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: LDAP server signing requirements." + compliance: + - cis: ["2.3.5.4"] + - cis_csc_v8: ["3.10"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters -> LDAPServerIntegrity' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters -> LDAPServerIntegrity -> 2' + + # 2.3.5.5 (L1) Ensure 'Domain controller: Refuse machine account password changes' is set to 'Disabled' (DC only). (Automated) + - id: 16012 + title: "Ensure 'Domain controller: Refuse machine account password changes' is set to 'Disabled' (DC only)." + description: "This security setting determines whether Domain Controllers will refuse requests from member computers to change computer account passwords. The recommended state for this setting is: Disabled. Note: Some problems can occur as a result of machine account password expiration, particularly if a machine is reverted to a previous point-in-time state, as is common with virtual machines. Depending on how far back the reversion is, the older machine account password stored on the machine may no longer be recognized by the domain controllers, and therefore the computer loses its domain trust. This can also disrupt non-persistent VDI implementations, and devices with write filters that disallow permanent changes to the OS volume. Some organizations may choose to exempt themselves from this recommendation and disable machine account password expiration for these situations." + rationale: "If you enable this policy setting on all Domain Controllers in a domain, domain members will not be able to change their computer account passwords, and those passwords will be more susceptible to attack." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Refuse machine account password changes." + compliance: + - cis: ["2.3.5.5"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RefusePasswordChange' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RefusePasswordChange -> 0' + + ######################## + # 2.3.6 Domain member + ######################## + # 2.3.6.1 (L1) Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'. (Automated) + - id: 16013 + title: "Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'." + description: "This policy setting determines whether all secure channel traffic that is initiated by the domain member must be signed or encrypted. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + impact: "None - this is the default behavior. However, only Windows NT 4.0 with Service Pack 6a (SP6a) and subsequent versions of the Windows operating system support digital encryption and signing of the secure channel. Windows 98 Second Edition clients do not support it unless they have Dsclient installed. Therefore, you cannot enable the Domain member: Digitally encrypt or sign secure channel data (always) setting on Domain Controllers that support Windows 98 clients as members of the domain. Potential impacts can include the following: - The ability to create or delete trust relationships with clients running versions of Windows earlier than Windows NT 4.0 with SP6a will be disabled. - Logons from clients running versions of Windows earlier than Windows NT 4.0 with SP6a will be disabled. - The ability to authenticate other domains' users from a Domain Controller running a version of Windows earlier than Windows NT 4.0 with SP6a in a trusted domain will be disabled. You can enable this policy setting after you eliminate all Windows 9x clients from the domain and upgrade all Windows NT 4.0 servers and Domain Controllers from trusted/trusting domains to Windows NT 4.0 with SP6a." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt or sign secure channel data (always)." + compliance: + - cis: ["2.3.6.1"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal -> 1' + + # 2.3.6.2 (L1) Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'. (Automated) + - id: 16014 + title: "Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'." + description: "This policy setting determines whether a domain member should attempt to negotiate encryption for all secure channel traffic that it initiates. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + impact: "None - this is the default behavior. However, only Windows NT 4.0 Service Pack 6a (SP6a) and subsequent versions of the Windows operating system support digital encryption and signing of the secure channel. Windows 98 Second Edition clients do not support it unless they have Dsclient installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt secure channel data (when possible)." + compliance: + - cis: ["2.3.6.2"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel -> 1' + + # 2.3.6.3 (L1) Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'. (Automated) + - id: 16015 + title: "Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'." + description: "This policy setting determines whether a domain member should attempt to negotiate whether all secure channel traffic that it initiates must be digitally signed. Digital signatures protect the traffic from being modified by anyone who captures the data as it traverses the network. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + impact: "None - this is the default behavior. However, only Windows NT 4.0 with Service Pack 6a (SP6a) and subsequent versions of the Windows operating system support digital encryption and signing of the secure channel. Windows 98 Second Edition clients do not support it unless they have Dsclient installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally sign secure channel data (when possible)." + compliance: + - cis: ["2.3.6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel -> 1' + + # 2.3.6.4 (L1) Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'. (Automated) + - id: 16016 + title: "Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'." + description: "This policy setting determines whether a domain member can periodically change its computer account password. Computers that cannot automatically change their account passwords are potentially vulnerable, because an attacker might be able to determine the password for the system's domain account. The recommended state for this setting is: Disabled. Note: Some problems can occur as a result of machine account password expiration, particularly if a machine is reverted to a previous point-in-time state, as is common with virtual machines. Depending on how far back the reversion is, the older machine account password stored on the machine may no longer be recognized by the domain controllers, and therefore the computer loses its domain trust. This can also disrupt non-persistent VDI implementations, and devices with write filters that disallow permanent changes to the OS volume. Some organizations may choose to exempt themselves from this recommendation and disable machine account password expiration for these situations." + rationale: "The default configuration for Windows Server 2003-based computers that belong to a domain is that they are automatically required to change the passwords for their accounts every 30 days. If you disable this policy setting, computers that run Windows Server 2003 will retain the same passwords as their computer accounts. Computers that are no longer able to automatically change their account password are at risk from an attacker who could determine the password for the computer's domain account." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Disable machine account password changes." + compliance: + - cis: ["2.3.6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange -> 0' + + # 2.3.6.5 (L1) Ensure 'Domain member: Maximum machine account password age' is set to '30 or fewer days, but not 0'. (Automated) + - id: 16017 + title: "Ensure 'Domain member: Maximum machine account password age' is set to '30 or fewer days, but not 0'." + description: "This policy setting determines the maximum allowable age for a computer account password. By default, domain members automatically change their domain passwords every 30 days. The recommended state for this setting is: 30 or fewer days, but not 0. Note: A value of 0 does not conform to the benchmark as it disables maximum password age. Note #2: Some problems can occur as a result of machine account password expiration, particularly if a machine is reverted to a previous point-in-time state, as is common with virtual machines. Depending on how far back the reversion is, the older machine account password stored on the machine may no longer be recognized by the domain controllers, and therefore the computer loses its domain trust. This can also disrupt non-persistent VDI implementations, and devices with write filters that disallow permanent changes to the OS volume. Some organizations may choose to exempt themselves from this recommendation and disable machine account password expiration for these situations." + rationale: "In Active Directory-based domains, each computer has an account and password just like every user. By default, the domain members automatically change their domain password every 30 days. If you increase this interval significantly, or set it to 0 so that the computers no longer change their passwords, an attacker will have more time to undertake a brute force attack to guess the passwords of computer accounts." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to 30 or fewer days, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Maximum machine account password age." + compliance: + - cis: ["2.3.6.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> n:^(\d+) compare <= 30' + + # 2.3.6.6 (L1) Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'. (Automated) + - id: 16018 + title: "Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'." + description: "When this policy setting is enabled, a secure channel can only be established with Domain Controllers that are capable of encrypting secure channel data with a strong (128-bit) session key. To enable this policy setting, all Domain Controllers in the domain must be able to encrypt secure channel data with a strong key, which means all Domain Controllers must be running Microsoft Windows 2000 or newer. The recommended state for this setting is: Enabled." + rationale: "Session keys that are used to establish secure channel communications between Domain Controllers and member computers are much stronger in Windows 2000 than they were in previous Microsoft operating systems. Whenever possible, you should take advantage of these stronger session keys to help protect secure channel communications from attacks that attempt to hijack network sessions and eavesdropping. (Eavesdropping is a form of hacking in which network data is read or altered in transit. The data can be modified to hide or change the sender, or be redirected.)." + impact: "None - this is the default behavior. However, computers will not be able to join Windows NT 4.0 domains, and trusts between Active Directory domains and Windows NT-style domains may not work properly. Also, Domain Controllers with this setting configured will not allow older pre-Windows 2000 clients (that that do not support this policy setting) to join the domain." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Require strong (Windows 2000 or later) session key." + compliance: + - cis: ["2.3.6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey -> 1' + + ########################## + # 2.3.7 Interactive logon + ########################## + # 2.3.7.1 (L1) Ensure 'Interactive logon: Do not display last user name' is set to 'Enabled'. (Automated) + - id: 16019 + title: "Ensure 'Interactive logon: Do not display last user name' is set to 'Enabled'." + description: "This policy setting determines whether the account name of the last user to log on to the client computers in your organization will be displayed in each computer's respective Windows logon screen. Enable this policy setting to prevent intruders from collecting account names visually from the screens of desktop or laptop computers in your organization. The recommended state for this setting is: Enabled." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + impact: "The name of the last user to successfully log on will not be displayed in the Windows logon screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Do not display last user name Note: In newer versions of Microsoft Windows Server, starting with Windows Server 2019, this setting was renamed Interactive logon: Don't display last signed-in." + compliance: + - cis: ["2.3.7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName -> 1' + + # 2.3.7.2 (L1) Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'. (Automated) + - id: 16020 + title: "Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'." + description: "This policy setting determines whether users must press CTRL+ALT+DEL before they log on. The recommended state for this setting is: Disabled." + rationale: "Microsoft developed this feature to make it easier for users with certain types of physical impairments to log on to computers that run Windows. If users are not required to press CTRL+ALT+DEL, they are susceptible to attacks that attempt to intercept their passwords. If CTRL+ALT+DEL is required before logon, user passwords are communicated by means of a trusted path. An attacker could install a Trojan horse program that looks like the standard Windows logon dialog box and capture the user's password. The attacker would then be able to log on to the compromised account with whatever level of privilege that user has." + impact: "Users must press CTRL+ALT+DEL before they log on to Windows unless they use a smart card for Windows logon. A smart card is a tamper-proof device that stores security information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Do not require CTRL+ALT+DEL." + compliance: + - cis: ["2.3.7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD -> 0' + + # 2.3.7.3 (L1) Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'. (Automated) + - id: 16021 + title: "Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'." + description: "Windows notices inactivity of a logon session, and if the amount of inactive time exceeds the inactivity limit, then the screen saver will run, locking the session. The recommended state for this setting is: 900 or fewer second(s), but not 0. Note: A value of 0 does not conform to the benchmark as it disables the machine inactivity limit." + rationale: "If a user forgets to lock their computer when they walk away it's possible that a passerby will hijack it." + impact: "The screen saver will automatically activate when the computer has been unattended for the amount of time specified. The impact should be minimal since the screen saver is enabled by default." + remediation: "To establish the recommended configuration via GP, set the following UI path to 900 or fewer seconds, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Machine inactivity limit." + compliance: + - cis: ["2.3.7.3"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 0' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> n:^(\d+) compare <= 900' + + # 2.3.7.4 (L1) Configure 'Interactive logon: Message text for users attempting to log on'. (Automated) - Not Implemented + # 2.3.7.5 (L1) Configure 'Interactive logon: Message title for users attempting to log on'. (Automated) - Not Implemented + + # 2.3.7.6 (L2) Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)' (MS only) (Automated) + - id: 16022 + title: "Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)' (MS only)." + description: "This policy setting determines whether a user can log on to a Windows domain using cached account information. Logon information for domain accounts can be cached locally to allow users to log on even if a Domain Controller cannot be contacted. This policy setting determines the number of unique users for whom logon information is cached locally. If this value is set to 0, the logon cache feature is disabled. An attacker who is able to access the file system of the server could locate this cached information and use a brute force attack to determine user passwords. The recommended state for this setting is: 4 or fewer logon(s)." + rationale: "The number that is assigned to this policy setting indicates the number of users whose logon information the computer will cache locally. If the number is set to 4, then the computer caches logon information for 4 users. When a 5th user logs on to the computer, the server overwrites the oldest cached logon session. Users who access the computer console will have their logon credentials cached on that computer. An attacker who is able to access the file system of the computer could locate this cached information and use a brute force attack to attempt to determine user passwords. To mitigate this type of attack, Windows encrypts the information and obscures its physical location." + impact: "Users will be unable to log on to any computers if there is no Domain Controller available to authenticate them. Organizations may want to configure this value to 2 for end-user computers, especially for mobile users. A configuration value of 2 means that the user's logon information will still be in the cache, even if a member of the IT department has recently logged on to their computer to perform system maintenance. This method allows users to log on to their computers when they are not connected to the organization's network." + remediation: "To establish the recommended configuration via GP, set the following UI path to 4 or fewer logon(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Number of previous logons to cache (in case domain controller is not available)." + compliance: + - cis: ["2.3.7.7"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> n:^(\d+) compare <= 4' + + # 2.3.7.7 (L1) Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'. (Automated) + - id: 16023 + title: "Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'." + description: "This policy setting determines how far in advance users are warned that their password will expire. It is recommended that you configure this policy setting to at least 5 days but no more than 14 days to sufficiently warn users when their passwords will expire. The recommended state for this setting is: between 5 and 14 days." + rationale: "It is recommended that user passwords be configured to expire periodically. Users will need to be warned that their passwords are going to expire, or they may inadvertently be locked out of the computer when their passwords expire. This condition could lead to confusion for users who access the network locally, or make it impossible for users to access your organization's network through dial-up or virtual private network (VPN) connections." + impact: "Users will see a dialog box prompt to change their password each time that they log on to the domain when their password is configured to expire between 5 and 14 days." + remediation: "To establish the recommended configuration via GP, set the following UI path to a value between 5 and 14 days: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Prompt user to change password before expiration." + compliance: + - cis: ["2.3.7.7"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare >= 5 && n:^(\d+) compare <= 14' + + # 2.3.7.8 (L1) Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled' (MS only). (Automated) + - id: 16024 + title: "Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled' (MS only)." + description: "Logon information is required to unlock a locked computer. For domain accounts, this security setting determines whether it is necessary to contact a Domain Controller to unlock a computer. The recommended state for this setting is: Enabled." + rationale: "By default, the computer caches in memory the credentials of any users who are authenticated locally. The computer uses these cached credentials to authenticate anyone who attempts to unlock the console. When cached credentials are used, any changes that have recently been made to the account - such as user rights assignments, account lockout, or the account being disabled - are not considered or applied after the account is authenticated. User privileges are not updated, and (more importantly) disabled accounts are still able to unlock the console of the computer." + impact: "When the console on a computer is locked, either by a user or automatically by a screen saver time-out, the console can only be unlocked if a Domain Controller is available to re-authenticate the domain account that is being used to unlock the computer. If no Domain Controller is available, the user cannot unlock the computer." + remediation: "To implement the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Require Domain Controller Authentication to unlock workstation." + compliance: + - cis: ["2.3.7.8"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ForceUnlockLogon' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ForceUnlockLogon -> 1' + + # 2.3.7.9 (L1) Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher. (Automated) + - id: 16025 + title: "Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher." + description: "This policy setting determines what happens when the smart card for a logged-on user is removed from the smart card reader. The recommended state for this setting is: Lock Workstation. Configuring this setting to Force Logoff or Disconnect if a Remote Desktop Services session also conforms to the benchmark." + rationale: "Users sometimes forget to lock their workstations when they are away from them, allowing the possibility for malicious users to access their computers. If smart cards are used for authentication, the computer should automatically lock itself when the card is removed to ensure that only the user with the smart card is accessing resources using those credentials." + impact: "If you select Lock Workstation, the workstation is locked when the smart card is removed, allowing users to leave the area, take their smart card with them, and still maintain a protected session. If you select Force Logoff, users are automatically logged off when their smart card is removed. If you select Disconnect if a Remote Desktop Services session, removal of the smart card disconnects the session without logging the users off. This allows the user to insert the smart card and resume the session later, or at another smart card reader-equipped computer, without having to log on again. If the session is local, this policy will function identically to Lock Workstation. Enforcing this setting on computers used by people who must log onto multiple computers in order to perform their duties could be frustrating and lower productivity. For example, if network administrators are limited to a single account but need to log into several computers simultaneously in order to effectively manage the network enforcing this setting will limit them to logging onto one computer at a time. For these reasons it is recommended that this setting only be enforced on workstations used for purposes commonly associated with typical users such as document creation and email." + remediation: "To establish the recommended configuration via GP, set the following UI path to Lock Workstation (or, if applicable for your environment, Force Logoff or Disconnect if a Remote Desktop Services session): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Smart card removal behavior." + compliance: + - cis: ["2.3.7.9"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption -> r:^1$|^2$|^3$' + + ############################################### + # 2.3.8 Microsoft network client + ############################################### + # 2.3.8.1 (L1) Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'. (Automated) + - id: 16026 + title: "Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'." + description: 'This policy setting determines whether packet signing is required by the SMB client component. Note: When Windows Vista-based computers have this policy setting enabled and they connect to file or print shares on remote servers, it is important that the setting is synchronized with its companion setting, Microsoft network server: Digitally sign communications (always), on those servers. For more information about these settings, see the "Microsoft network client and server - Digitally sign communications (four related settings)" section in Chapter 5 of the Threats and Countermeasures guide. The recommended state for this setting is - Enabled.' + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + impact: "The Microsoft network client will not communicate with a Microsoft network server unless that server agrees to perform SMB packet signing. The Windows 2000 Server, Windows 2000 Professional, Windows Server 2003, Windows XP Professional and Windows Vista implementations of the SMB file and print sharing protocol support mutual authentication, which prevents session hijacking attacks and supports message authentication to prevent man-in-the-middle attacks. SMB signing provides this authentication by placing a digital signature into each SMB, which is then verified by both the client and the server. Implementation of SMB signing may negatively affect performance, because each packet needs to be signed and verified. If these settings are enabled on a server that is performing multiple roles, such as a small business server that is serving as a Domain Controller, file server, print server, and application server performance may be substantially slowed. Additionally, if you configure computers to ignore all unsigned SMB communications, older applications and operating systems will not be able to connect. However, if you completely disable all SMB signing, computers will be vulnerable to session hijacking attacks. When SMB signing policies are enabled on Domain Controllers running Windows Server 2003 and member computers running Windows Vista SP1 or Windows Server 2008 group policy processing will fail. A hotfix is available from Microsoft that resolves this issue; see Microsoft Knowledge Base article 950876 for more details: Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (always)." + compliance: + - cis: ["2.3.8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> 1' + + # 2.3.8.2 (L1) Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'. (Automated) + - id: 16027 + title: "Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'." + description: "This policy setting determines whether the SMB client will attempt to negotiate SMB packet signing. Note: Enabling this policy setting on SMB clients on your network makes them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + impact: "None - this is the default behavior. The Windows 2000 Server, Windows 2000 Professional, Windows Server 2003, Windows XP Professional and Windows Vista implementations of the SMB file and print sharing protocol support mutual authentication, which prevents session hijacking attacks and supports message authentication to prevent man-in-the-middle attacks. SMB signing provides this authentication by placing a digital signature into each SMB, which is then verified by both the client and the server. Implementation of SMB signing may negatively affect performance, because each packet needs to be signed and verified. If these settings are enabled on a server that is performing multiple roles, such as a small business server that is serving as a Domain Controller, file server, print server, and application server performance may be substantially slowed. Additionally, if you configure computers to ignore all unsigned SMB communications, older applications and operating systems will not be able to connect. However, if you completely disable all SMB signing, computers will be vulnerable to session hijacking attacks. When SMB signing policies are enabled on Domain Controllers running Windows Server 2003 and member computers running Windows Vista SP1 or Windows Server 2008 group policy processing will fail. A hotfix is available from Microsoft that resolves this issue; see Microsoft Knowledge Base article 950876 for more details: Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (if server agrees)." + compliance: + - cis: ["2.3.8.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> 1' + + # 2.3.8.3 (L1) Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'. (Automated) + - id: 16028 + title: "Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'." + description: "This policy setting determines whether the SMB redirector will send plaintext passwords during authentication to third-party SMB servers that do not support password encryption. It is recommended that you disable this policy setting unless there is a strong business case to enable it. If this policy setting is enabled, unencrypted passwords will be allowed across the network. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting, the server can transmit passwords in plaintext across the network to other computers that offer SMB services, which is a significant security risk. These other computers may not use any of the SMB security mechanisms that are included with Windows Server 2003." + impact: "None - this is the default behavior. Some very old applications and operating systems such as MS-DOS, Windows for Workgroups 3.11, and Windows 95a may not be able to communicate with the servers in your organization by means of the SMB protocol." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Send unencrypted password to third-party SMB servers." + compliance: + - cis: ["2.3.8.3"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword -> 1' + + ############################################ + # 2.3.9 Microsoft network server + ############################################ + # 2.3.9.1 (L1) Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s)'. (Automated) + - id: 16029 + title: "Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s)'." + description: "This policy setting allows you to specify the amount of continuous idle time that must pass in an SMB session before the session is suspended because of inactivity. Administrators can use this policy setting to control when a computer suspends an inactive SMB session. If client activity resumes, the session is automatically reestablished. The maximum value is 99999, which is over 69 days; in effect, this value disables the setting. The recommended state for this setting is: 15 or fewer minute(s)." + rationale: "Each SMB session consumes server resources, and numerous null sessions will slow the server or possibly cause it to fail. An attacker could repeatedly establish SMB sessions until the server's SMB services become slow or unresponsive." + impact: "There will be little impact because SMB sessions will be re-established automatically if the client resumes activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to 15 or fewer minute(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Amount of idle time required before suspending session." + compliance: + - cis: ["2.3.9.1"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> 0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> n:^(\d+) compare <= 15' + + # 2.3.9.2 (L1) Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'. (Automated) + - id: 16030 + title: "Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'." + description: "This policy setting determines whether packet signing is required by the SMB server component. Enable this policy setting in a mixed environment to prevent downstream clients from using the workstation as a network server. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + impact: "The Microsoft network server will not communicate with a Microsoft network client unless that client agrees to perform SMB packet signing. The Windows 2000 Server, Windows 2000 Professional, Windows Server 2003, Windows XP Professional and Windows Vista implementations of the SMB file and print sharing protocol support mutual authentication, which prevents session hijacking attacks and supports message authentication to prevent man-in-the-middle attacks. SMB signing provides this authentication by placing a digital signature into each SMB, which is then verified by both the client and the server. Implementation of SMB signing may negatively affect performance, because each packet needs to be signed and verified. If these settings are enabled on a server that is performing multiple roles, such as a small business server that is serving as a Domain Controller, file server, print server, and application server performance may be substantially slowed. Additionally, if you configure computers to ignore all unsigned SMB communications, older applications and operating systems will not be able to connect. However, if you completely disable all SMB signing, computers will be vulnerable to session hijacking attacks. When SMB signing policies are enabled on Domain Controllers running Windows Server 2003 and member computers running Windows Vista SP1 or Windows Server 2008 group policy processing will fail. A hotfix is available from Microsoft that resolves this issue; see Microsoft Knowledge Base article 950876 for more details: Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (always)." + compliance: + - cis: ["2.3.9.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> 1' + + # 2.3.9.3 (L1) Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'. (Automated) + - id: 16031 + title: "Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'." + description: "This policy setting determines whether the SMB server will negotiate SMB packet signing with clients that request it. If no signing request comes from the client, a connection will be allowed without a signature if the Microsoft network server: Digitally sign communications (always) setting is not enabled. Note: Enable this policy setting on SMB clients on your network to make them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + impact: "The Microsoft network server will negotiate SMB packet signing as requested by the client. That is, if packet signing has been enabled on the client, packet signing will be negotiated. The Windows 2000 Server, Windows 2000 Professional, Windows Server 2003, Windows XP Professional and Windows Vista implementations of the SMB file and print sharing protocol support mutual authentication, which prevents session hijacking attacks and supports message authentication to prevent man-in-the-middle attacks. SMB signing provides this authentication by placing a digital signature into each SMB, which is then verified by both the client and the server. Implementation of SMB signing may negatively affect performance, because each packet needs to be signed and verified. If these settings are enabled on a server that is performing multiple roles, such as a small business server that is serving as a Domain Controller, file server, print server, and application server performance may be substantially slowed. Additionally, if you configure computers to ignore all unsigned SMB communications, older applications and operating systems will not be able to connect. However, if you completely disable all SMB signing, computers will be vulnerable to session hijacking attacks. When SMB signing policies are enabled on Domain Controllers running Windows Server 2003 and member computers running Windows Vista SP1 or Windows Server 2008 group policy processing will fail. A hotfix is available from Microsoft that resolves this issue; see Microsoft Knowledge Base article 950876 for more details: Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (if client agrees)." + compliance: + - cis: ["2.3.9.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> 1' + + # 2.3.9.4 (L1) Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'. (Automated) + - id: 16032 + title: "Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'." + description: "This security setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Network security: Force logoff when logon hours expire (Rule 2.3.11.6). If your organization configures logon hours for users, this policy setting is necessary to ensure they are effective. The recommended state for this setting is: Enabled." + rationale: "If your organization configures logon hours for users, then it makes sense to enable this policy setting. Otherwise, users who should not have access to network resources outside of their logon hours may actually be able to continue to use those resources with sessions that were established during allowed hours." + impact: "None - this is the default behavior. If logon hours are not used in your organization, this policy setting will have no impact. If logon hours are used, existing user sessions will be forcibly terminated when their logon hours expire." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Disconnect clients when logon hours expire." + compliance: + - cis: ["2.3.9.4"] + - cis_csc_v8: ["5.6"] + - cis_csc_v7: ["16.13"] + - nist_sp_800-53: ["AC-2(1)"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableForcedLogOff' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableForcedLogOff -> 1' + + # 2.3.9.5 (L1) Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher (MS only). (Automated) + - id: 16033 + title: "Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher (MS only)." + description: "This policy setting controls the level of validation a computer with shared folders or printers (the server) performs on the service principal name (SPN) that is provided by the client computer when it establishes a session using the server message block (SMB) protocol. The server message block (SMB) protocol provides the basis for file and print sharing and other networking operations, such as remote Windows administration. The SMB protocol supports validating the SMB server service principal name (SPN) within the authentication blob provided by a SMB client to prevent a class of attacks against SMB servers referred to as SMB relay attacks. This setting will affect both SMB1 and SMB2. The recommended state for this setting is: Accept if provided by client. Configuring this setting to Required from client also conforms to the benchmark. Note: Since the release of the MS KB3161561 security patch, this setting can cause significant issues (such as replication problems, group policy editing issues and blue screen crashes) on Domain Controllers when used simultaneously with UNC path hardening (i.e. Rule 18.5.14.1). CIS therefore recommends against deploying this setting on Domain Controllers." + rationale: "The identity of a computer can be spoofed to gain unauthorized access to network resources." + impact: "All Windows operating systems support both a client-side SMB component and a server-side SMB component. This setting affects the server SMB behavior, and its implementation should be carefully evaluated and tested to prevent disruptions to file and print serving capabilities. If configured to Accept if provided by client, the SMB server will accept and validate the SPN provided by the SMB client and allow a session to be established if it matches the SMB server's list of SPN's for itself. If the SPN does NOT match, the session request for that SMB client will be denied. If configured to Required from client, the SMB client MUST send a SPN name in session setup, and the SPN name provided MUST match the SMB server that is being requested to establish a connection. If no SPN is provided by client, or the SPN provided does not match, the session is denied." + remediation: "To establish the recommended configuration via GP, set the following UI path to Accept if provided by client (configuring to Required from client also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Server SPN target name validation level." + compliance: + - cis: ["2.3.9.5"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> SMBServerNameHardeningLevel' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel -> n:^(\d+) compare >= 1' + + ################################## + # 2.3.10 Network access + ################################## + # 2.3.10.1 (L1) Ensure 'Network access: Allow anonymous SID/Name translation' is set to 'Disabled'. (Automated) + - id: 16034 + title: "Ensure 'Network access: Allow anonymous SID/Name translation' is set to 'Disabled'." + description: "This policy setting determines whether an anonymous user can request security identifier (SID) attributes for another user, or use a SID to obtain its corresponding user name. The recommended state for this setting is: Disabled." + rationale: "If this policy setting is enabled, a user with local access could use the well-known Administrator's SID to learn the real name of the built-in Administrator account, even if it has been renamed. That person could then use the account name to initiate a password guessing attack." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Allow anonymous SID/Name translation." + compliance: + - cis: ["2.3.10.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> TurnOffAnonymousBlock' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> TurnOffAnonymousBlock -> 0' + + # 2.3.10.2 (L1) Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled' (MS only). (Automated) + - id: 16035 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled' (MS only)." + description: "This policy setting controls the ability of anonymous users to enumerate the accounts in the Security Accounts Manager (SAM). If you enable this policy setting, users with anonymous connections will not be able to enumerate domain account user names on the systems in your environment. This policy setting also allows additional restrictions on anonymous connections. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)." + impact: "None - this is the default behavior. It will be impossible to establish trusts with Windows NT 4.0-based domains. Also, client computers that run older versions of the Windows operating system such as Windows NT 3.51 and Windows 95 will experience problems when they try to use resources on the server." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts." + compliance: + - cis: ["2.3.10.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM -> 1' + + # 2.3.10.3 (L1) Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled' (MS only). (Automated) + - id: 16036 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled' (MS only)." + description: "This policy setting controls the ability of anonymous users to enumerate SAM accounts as well as shares. If you enable this policy setting, anonymous users will not be able to enumerate domain account user names and network share names on the systems in your environment. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)." + impact: "It will be impossible to establish trusts with Windows NT 4.0-based domains. Also, client computers that run older versions of the Windows operating system such as Windows NT 3.51 and Windows 95 will experience problems when they try to use resources on the server. Users who access file and print servers anonymously will be unable to list the shared network resources on those servers; the users will have to authenticate before they can view the lists of shared folders and printers. However, even with this policy setting enabled, anonymous users will have access to resources with permissions that explicitly include the built-in group, ANONYMOUS LOGON." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts and shares." + compliance: + - cis: ["2.3.10.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous ' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous -> 1' + + # 2.3.10.4 (L2) Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'. (Automated) + - id: 16037 + title: "Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'." + description: "This policy setting determines whether Credential Manager (formerly called Stored User Names and Passwords) saves passwords or credentials for later use when it gains domain authentication. The recommended state for this setting is: Enabled. Note: Changes to this setting will not take effect until Windows is restarted." + rationale: "Passwords that are cached can be accessed by the user when logged on to the computer. Although this information may sound obvious, a problem can arise if the user unknowingly executes hostile code that reads the passwords and forwards them to another, unauthorized user." + impact: "Credential Manager will not store passwords and credentials on the computer. Users will be forced to enter passwords whenever they log on to their Passport account or other network resources that aren't accessible to their domain account. Testing has shown that clients running Windows Vista or Windows Server 2008 will be unable to connect to Distributed File System (DFS) shares in untrusted domains. Enabling this setting also makes it impossible to specify alternate credentials for scheduled tasks, this can cause a variety of problems. For example, some third-party backup products will no longer work. This policy setting should have no impact on users who access network resources that are configured to allow access with their Active Directory-based domain account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow storage of passwords and credentials for network authentication." + compliance: + - cis: ["2.3.10.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> DisableDomainCreds' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> 1' + + # 2.3.10.5 (L1) Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'. (Automated) + - id: 16038 + title: "Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'." + description: "This policy setting determines what additional permissions are assigned for anonymous connections to the computer. The recommended state for this setting is: Disabled." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords, perform social engineering attacks, or launch DoS attacks." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Let Everyone permissions apply to anonymous users." + compliance: + - cis: ["2.3.10.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 0' + + # 2.3.10.6 (L1) Configure 'Network access: Named Pipes that can be accessed anonymously' (DC only). (Automated) + - id: 16039 + title: "Configure 'Network access: Named Pipes that can be accessed anonymously' (DC only)." + description: "This policy setting determines which communication sessions, or pipes, will have attributes and permissions that allow anonymous access. The recommended state for this setting is: LSARPC, NETLOGON, SAMR and (when the legacy Computer Browser service is enabled) BROWSER. Note: A Member Server that holds the Remote Desktop Services Role with Remote Desktop Licensing Role Service will require a special exception to this recommendation, to allow the HydraLSPipe and TermServLicensing Named Pipes to be accessed anonymously." + rationale: "Limiting named pipes that can be accessed anonymously will reduce the attack surface of the system." + impact: "Null session access over named pipes will be disabled unless they are included, and applications that rely on this feature or on unauthenticated access to named pipes will no longer function. The BROWSER named pipe may need to be added to this list if the Computer Browser service is needed for supporting legacy components. The Computer Browser service is disabled by default." + remediation: "To establish the recommended configuration via GP, configure the following UI path: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Named Pipes that can be accessed anonymously." + compliance: + - cis: ["2.3.10.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:LSARPC && r:NETLOGON && r:SAMR' + + # 2.3.10.7 (L1) Configure 'Network access: Named Pipes that can be accessed anonymously' (MS only). (Automated) - Not Implemented + + # 2.3.10.8 (L1) Configure 'Network access: Remotely accessible registry paths' is configured. (Automated) + - id: 16040 + title: "Configure 'Network access: Remotely accessible registry paths' is configured." + description: "This policy setting determines which registry paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: This setting does not exist in Windows XP. There was a setting with that name in Windows XP, but it is called \"Network access: Remotely accessible registry paths and sub-paths\" in Windows Server 2003, Windows Vista, and Windows Server 2008 (non-R2). Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value. The recommended state for this setting is: System\\CurrentControlSet\\Control\\ProductOptions System\\CurrentControlSet\\Control\\Server Applications Software\\Microsoft\\Windows NT\\CurrentVersion." + rationale: "The registry is a database that contains computer configuration information, and much of the information is sensitive. An attacker could use this information to facilitate unauthorized activities. To reduce the risk of such an attack, suitable ACLs are assigned throughout the registry to help protect it from access by unauthorized users." + impact: "None - this is the default behavior. However, if you remove the default registry paths from the list of accessible ones, remote management tools such as the Microsoft Baseline Security Analyzer and Microsoft Systems Management Server could fail, as they require remote access to the registry to properly monitor and manage computers. Note: If you want to allow remote access, you must also enable the Remote Registry service." + remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\ProductOptions System\\CurrentControlSet\\Control\\Server Applications Software\\Microsoft\\Windows NT\\CurrentVersion Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Remotely accessible registry paths." + compliance: + - cis: ["2.3.10.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:System\\CurrentControlSet\\Control\\ProductOptions|System\\CurrentControlSet\\Control\\Server Applications|Software\\Microsoft\\Windows NT\\CurrentVersion' + + # 2.3.10.9 (L1) Configure 'Network access: Remotely accessible registry paths and sub-paths' is configured. (Automated) + - id: 16041 + title: "Configure 'Network access: Remotely accessible registry paths and sub-paths' is configured." + description: "This policy setting determines which registry paths and sub-paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: In Windows XP this setting is called \"Network access: Remotely accessible registry paths,\" the setting with that same name in Windows Vista, Windows Server 2008 (non-R2), and Windows Server 2003 does not exist in Windows XP. Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value. The recommended state for this setting is: System\\CurrentControlSet\\Control\\Print\\Printers System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex System\\CurrentControlSet\\Control\\Terminal Server System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib System\\CurrentControlSet\\Services\\SysmonLog The recommended state for servers that hold the Active Directory Certificate Services Role with Certification Authority Role Service includes the above list and: System\\CurrentControlSet\\Services\\CertSvc The recommended state for servers that have the WINS Server Feature installed includes the above list and: System\\CurrentControlSet\\Services\\WINS." + rationale: "The registry contains sensitive computer configuration information that could be used by an attacker to facilitate unauthorized activities. The fact that the default ACLs assigned throughout the registry are fairly restrictive and help to protect the registry from access by unauthorized users reduces the risk of such an attack." + impact: "None - this is the default behavior. However, if you remove the default registry paths from the list of accessible ones, remote management tools such as the Microsoft Baseline Security Analyzer and Microsoft Systems Management Server could fail, as they require remote access to the registry to properly monitor and manage computers. Note: If you want to allow remote access, you must also enable the Remote Registry service." + remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\Print\\Printers System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex System\\CurrentControlSet\\Control\\Terminal Server System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib System\\CurrentControlSet\\Services\\SysmonLog Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Remotely accessible registry paths and sub-paths When a server holds the Active Directory Certificate Services Role with Certification Authority Role Service, the above list should also include: System\\CurrentControlSet\\Services\\CertSvc. When a server has the WINS Server Feature installed, the above list should also include: System\\CurrentControlSet\\Services\\WINS." + compliance: + - cis: ["2.3.10.9"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Print|Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows|System\\CurrentControlSet\\Control\\Print\\Printers|System\\CurrentControlSet\\Services\\Eventlog|Software\\Microsoft\\OLAP Server|System\\CurrentControlSet\\Control\\ContentIndex|System\\CurrentControlSet\\Control\\Terminal Server|System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig|System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration|Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib|System\\CurrentControlSet\\Services\\SysmonLog|System\\CurrentControlSet\\Services\\CertSvc|System\\CurrentControlSet\\Services\\WINS' + + # 2.3.10.10 (L1) Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'. (Automated) + - id: 16042 + title: "Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'." + description: "When enabled, this policy setting restricts anonymous access to only those shares and pipes that are named in the Network access: Named pipes that can be accessed anonymously and Network access: Shares that can be accessed anonymously settings. This policy setting controls null session access to shares on your computers by adding RestrictNullSessAccess with the value 1 in the HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\LanManServer\\Parameters registry key. This registry value toggles null session shares on or off to control whether the server service restricts unauthenticated clients' access to named resources. The recommended state for this setting is: Enabled." + rationale: "Null sessions are a weakness that can be exploited through shares (including the default shares) on computers in your environment." + impact: "None - this is the default behavior. If you choose to enable this setting and are supporting Windows NT 4.0 domains, you should check if any of the named pipes are required to maintain trust relationships between the domains, and then add the pipe to the Network access: Named pipes that can be accessed anonymously list: - COMNAP: SNA session access - COMNODE: SNA session access - SQL\\QUERY: SQL instance access - SPOOLSS: Spooler service - LLSRPC: License Logging service - NETLOGON: Net Logon service - LSARPC: LSA access - SAMR: Remote access to SAM objects - BROWSER: Computer Browser service Previous to the release of Windows Server 2003 with Service Pack 1 (SP1) these named pipes were allowed anonymous access by default, but with the increased hardening in Windows Server 2003 with SP1 these pipes must be explicitly added if needed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict anonymous access to Named Pipes and Shares." + compliance: + - cis: ["2.3.10.10"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess -> 1' + + # 2.3.10.11 (L1) Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow' (MS only). (Automated) + - id: 16043 + title: "Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow' (MS only)." + description: 'This policy setting allows you to restrict remote RPC connections to SAM. The recommended state for this setting is: Administrators: Remote Access: Allow. Note: A Windows 10 R1607, Server 2016 or newer OS is required to access and set this value in Group Policy. Note #2: This setting was originally only supported on Windows Server 2016 and newer, then support for it was added to Windows Server 2008 R2 and newer via the March 2017 security patches. Note #3: If your organization is using Azure Advanced Threat Protection (APT), the service account, "AATP Service" will need to be added to the recommendation configuration. For more information on adding the "AATP Service" account please see Configure SAM-R to enable lateral movement path detection in Microsoft Defender for Identity | Microsoft Docs.' + rationale: "To ensure that an unauthorized user cannot anonymously list local account names or groups and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators: Remote Access: Allow: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict clients allowed to make remote calls to SAM." + compliance: + - cis: ["2.3.10.11"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> restrictremotesam' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> restrictremotesam -> O:BAG:BAD:(A;;RC;;;BA)' + + # 2.3.10.12 (L1) Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'. (Automated) + - id: 16044 + title: "Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'." + description: "This policy setting determines which network shares can be accessed by anonymous users. The default configuration for this policy setting has little effect because all users have to be authenticated before they can access shared resources on the server. The recommended state for this setting is: (i.e. None)." + rationale: "It is very dangerous to allow any values in this setting. Any shares that are listed can be accessed by any network user, which could lead to the exposure or corruption of sensitive data." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to (i.e. None): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Shares that can be accessed anonymously." + compliance: + - cis: ["2.3.10.12"] + - cis_csc_v7: ["14.6"] + - iso_27001-2013: ["A.9.1.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> r:\.' + + # 2.3.10.13 (L1) Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'. (Automated) + - id: 16045 + title: "Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'." + description: "This policy setting determines how network logons that use local accounts are authenticated. The Classic option allows precise control over access to resources, including the ability to assign different types of access to different users for the same resource. The Guest only option allows you to treat all users equally. In this context, all users authenticate as Guest only to receive the same access level to a given resource. The recommended state for this setting is: Classic - local users authenticate as themselves. Note: This setting does not affect interactive logons that are performed remotely by using such services as Telnet or Remote Desktop Services (formerly called Terminal Services)." + rationale: "With the Guest only model, any user who can authenticate to your computer over the network does so with guest privileges, which probably means that they will not have write access to shared resources on that computer. Although this restriction does increase security, it makes it more difficult for authorized users to access shared resources on those computers because ACLs on those resources must include access control entries (ACEs) for the Guest account. With the Classic model, local accounts should be password protected. Otherwise, if Guest access is enabled, anyone can use those user accounts to access shared system resources." + impact: "None - this is the default configuration for domain-joined computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Classic - local users authenticate as themselves: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Sharing and security model for local accounts." + compliance: + - cis: ["2.3.10.13"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest -> 0' + + # 2.3.11.1 (L1) Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'. (Automated) + - id: 16046 + title: "Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'." + description: "This policy setting determines whether Local System services that use Negotiate when reverting to NTLM authentication can use the computer identity. This policy is supported on at least Windows 7 or Windows Server 2008 R2. The recommended state for this setting is: Enabled." + rationale: "When connecting to computers running versions of Windows earlier than Windows Vista or Windows Server 2008 (non-R2), services running as Local System and using SPNEGO (Negotiate) that revert to NTLM use the computer identity. In Windows 7, if you are connecting to a computer running Windows Server 2008 or Windows Vista, then a system service uses either the computer identity or a NULL session. When connecting with a NULL session, a system-generated session key is created, which provides no protection but allows applications to sign and encrypt data without errors. When connecting with the computer identity, both signing and encryption is supported in order to provide data protection." + impact: "Services running as Local System that use Negotiate when reverting to NTLM authentication will use the computer identity. This might cause some authentication requests between Windows operating systems to fail and log an error." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow Local System to use computer identity for NTLM." + compliance: + - cis: ["2.3.11.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> UseMachineId' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> UseMachineId -> 1' + + # 2.3.11.2 (L1) Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'. (Automated) + - id: 16047 + title: "Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'." + description: "This policy setting determines whether NTLM is allowed to fall back to a NULL session when used with LocalSystem. The recommended state for this setting is: Disabled." + rationale: "NULL sessions are less secure because by definition they are unauthenticated." + impact: "Any applications that require NULL sessions for LocalSystem will not work as designed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow LocalSystem NULL session fallback." + compliance: + - cis: ["2.3.11.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback -> 0' + + # 2.3.11.3 (L1) Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'. (Automated) + - id: 16048 + title: "Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'." + description: "This setting determines if online identities are able to authenticate to this computer. The Public Key Cryptography Based User-to-User (PKU2U) protocol introduced in Windows 7 and Windows Server 2008 R2 is implemented as a security support provider (SSP). The SSP enables peer-to-peer authentication, particularly through the Windows 7 media and file sharing feature called HomeGroup, which permits sharing between computers that are not members of a domain. With PKU2U, a new extension was introduced to the Negotiate authentication package, Spnego.dll. In previous versions of Windows, Negotiate decided whether to use Kerberos or NTLM for authentication. The extension SSP for Negotiate, Negoexts.dll, which is treated as an authentication protocol by Windows, supports Microsoft SSPs including PKU2U. When computers are configured to accept authentication requests by using online IDs, Negoexts.dll calls the PKU2U SSP on the computer that is used to log on. The PKU2U SSP obtains a local certificate and exchanges the policy between the peer computers. When validated on the peer computer, the certificate within the metadata is sent to the logon peer for validation and associates the user's certificate to a security token and the logon process completes. The recommended state for this setting is: Disabled." + rationale: "The PKU2U protocol is a peer-to-peer authentication protocol - authentication should be managed centrally in most managed networks." + impact: "None - this is the default configuration for domain-joined computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network Security: Allow PKU2U authentication requests to this computer to use online identities." + compliance: + - cis: ["2.3.11.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID -> 0' + + # 2.3.11.4 (L1) Ensure 'Network security: Configure encryption types allowed for Kerberos' is set to 'AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types' (Automated) + - id: 16049 + title: "Ensure 'Network security: Configure encryption types allowed for Kerberos' is set to 'AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types'." + description: "This policy setting allows you to set the encryption types that Kerberos is allowed to use. The recommended state for this setting is: AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types. Note: Some legacy applications and OSes may still require RC4_HMAC_MD5 - we recommend you test in your environment and verify whether you can safely remove it." + rationale: "The strength of each encryption algorithm varies from one to the next, choosing stronger algorithms will reduce the risk of compromise however doing so may cause issues when the computer attempts to authenticate with systems that do not support them." + impact: "If not selected, the encryption type will not be allowed. This setting may affect compatibility with client computers or services and applications. Multiple selections are permitted. Note: Some legacy applications and OSes may still require RC4_HMAC_MD5 - we recommend you test in your environment and verify whether you can safely remove it. Note #2: Windows Server 2008 (non-R2) and below allow DES for Kerberos by default, but later OS versions do not. Note #3: Some prerequisites might need to be met on Domain Controllers to support Kerberos AES 128 and 256 bit encryption types, as well as enabling support for Kerberos AES 128 and 256 bit on user accounts (in account options) for this recommendation to work correctly. Note #4: If your organization uses Azure Files, please note that Microsoft did not introduce AES 256 Kerberos encryption support for it until AD DS authentication module v0.2.2. Please see this link for more information: https://docs.microsoft.com/en-us/azure/storage/files/ storage-troubleshoot-windows-file-connection-problems#azure-files-on-premises-ad-ds-authentication-support-for-aes-256-kerberos-encryption." + remediation: "To establish the recommended configuration via GP, set the following UI path to AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Configure encryption types allowed for Kerberos." + reference: + - "https://docs.microsoft.com/en-us/azure/storage/files/storage-troubleshoot-windows-file-connection-problems#azure-files-on-premises-ad-ds-authentication-support-for-aes-256-kerberos-encryption" + compliance: + - cis: ["2.3.11.4"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cis_csc_v7: ["18.5"] + - cmmc_v2.0: ["AC.L2-3.1.17", "AC.L2-3.1.13", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.8", "SC.L2-3.13.15"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> r:2147483644|2147483640' + + # 2.3.11.5 (L1) Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'. (Automated) + - id: 16050 + title: "Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'." + description: "This policy setting determines whether the LAN Manager (LM) hash value for the new password is stored when the password is changed. The LM hash is relatively weak and prone to attack compared to the cryptographically stronger Microsoft Windows NT hash. Since LM hashes are stored on the local computer in the security database, passwords can then be easily compromised if the database is attacked. Note: Older operating systems and some third-party applications may fail when this policy setting is enabled. Also, note that the password will need to be changed on all accounts after you enable this setting to gain the proper benefit. The recommended state for this setting is: Enabled." + rationale: "The SAM file can be targeted by attackers who seek access to username and password hashes. Such attacks use special tools to crack passwords, which can then be used to impersonate users and gain access to resources on your network. These types of attacks will not be prevented if you enable this policy setting, but it will be much more difficult for these types of attacks to succeed." + impact: "None - this is the default behavior. Earlier operating systems such as Windows 95, Windows 98, and Windows ME as well as some third-party applications will fail." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Do not store LAN Manager hash value on next password change." + compliance: + - cis: ["2.3.11.5"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash -> 1' + + # 2.3.11.6 (L1) Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'. (Manual) + - id: 16051 + title: "Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'." + description: "This policy setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Microsoft network server: Disconnect clients when logon hours expire (Rule 2.3.9.4). The recommended state for this setting is: Enabled." + rationale: "If this setting is disabled, a user could remain connected to the computer outside of their allotted logon hours." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Force logoff when logon hours expire." + compliance: + - cis: ["2.3.11.6"] + - cis_csc_v8: ["5.6"] + - cis_csc_v7: ["16.13"] + - nist_sp_800-53: ["AC-2(1)"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' + + # 2.3.11.7 (L1) Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'. (Automated) + - id: 16052 + title: "Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'." + description: "LAN Manager (LM) was a family of early Microsoft client/server software (predating Windows NT) that allowed users to link personal computers together on a single network. LM network capabilities included transparent file and print sharing, user security features, and network administration tools. In Active Directory domains, the Kerberos protocol is the default authentication protocol. However, if the Kerberos protocol is not negotiated for some reason, Active Directory will use LM, NTLM, or NTLMv2. LAN Manager authentication includes the LM, NTLM, and NTLM version 2 (NTLMv2) variants, and is the protocol that is used to authenticate all Windows clients when they perform the following operations: - Join a domain - Authenticate between Active Directory forests - Authenticate to down-level domains - Authenticate to computers that do not run Windows 2000, Windows Server 2003, or Windows XP - Authenticate to computers that are not in the domain The Network security: LAN Manager authentication level setting determines which challenge/response authentication protocol is used for network logons. This choice affects the level of authentication protocol used by clients, the level of session security negotiated, and the level of authentication accepted by servers. The recommended state for this setting is: Send NTLMv2 response only. Refuse LM & NTLM." + rationale: "Windows 2000 and Windows XP clients were configured by default to send LM and NTLM authentication responses (Windows 95-based and Windows 98-based clients only send LM). The default settings in OSes predating Windows Vista / Windows Server 2008 (non-R2) allowed all clients to authenticate with servers and use their resources. However, this meant that LM responses - the weakest form of authentication response - were sent over the network, and it was potentially possible for attackers to sniff that traffic to more easily reproduce the user's password. The Windows 95, Windows 98, and Windows NT operating systems cannot use the Kerberos version 5 protocol for authentication. For this reason, in a Windows Server 2003 domain, these computers authenticate by default with both the LM and NTLM protocols for network authentication. You can enforce a more secure authentication protocol for Windows 95, Windows 98, and Windows NT by using NTLMv2. For the logon process, NTLMv2 uses a secure channel to protect the authentication process. Even if you use NTLMv2 for older clients and servers, Windows-based clients and servers that are members of the domain will use the Kerberos authentication protocol to authenticate with Windows Server 2003 or newer Domain Controllers. For these reasons, it is strongly preferred to restrict the use of LM & NTLM (non-v2) as much as possible." + impact: "Clients use NTLMv2 authentication only and use NTLMv2 session security if the server supports it; Domain Controllers refuse LM and NTLM (accept only NTLMv2 authentication). Clients that do not support NTLMv2 authentication will not be able to authenticate in the domain and access domain resources by using LM and NTLM." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Send NTLMv2 response only. Refuse LM & NTLM: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LAN Manager authentication level." + compliance: + - cis: ["2.3.11.7"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["18.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 5' + + # 2.3.11.8 (L1) Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher. (Automated) + - id: 16053 + title: "Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher." + description: "This policy setting determines the level of data signing that is requested on behalf of clients that issue LDAP BIND requests. Note: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are included with Windows XP Professional use ldap_simple_bind or ldap_simple_bind_s to communicate with a Domain Controller. The recommended state for this setting is: Negotiate signing. Configuring this setting to Require signing also conforms to the benchmark." + rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks in which an intruder captures the packets between the client and server, modifies them, and then forwards them to the server. For an LDAP server, this susceptibility means that an attacker could cause a server to make decisions that are based on false or altered data from the LDAP queries. To lower this risk in your network, you can implement strong physical security measures to protect the network infrastructure. Also, you can make all types of man-in-the-middle attacks extremely difficult if you require digital signatures on all network packets by means of IPsec authentication headers." + impact: "None - this is the default behavior. However, if you choose instead to configure the server to require LDAP signatures then you must also configure the client. If you do not configure the client it will not be able to communicate with the server, which could cause many features to fail, including user authentication, Group Policy, and logon scripts, because the caller will be told that the LDAP BIND command request failed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Negotiate signing (configuring to Require signing also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LDAP client signing requirements." + compliance: + - cis: ["2.3.11.8"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["18.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> n:(\d+) compare >= 1' + + # 2.3.11.9 (L1) Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption' + - id: 16054 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'." + description: "This policy setting determines which behaviors are allowed by clients for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable both options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. In other words, these options help protect against man-in-the-middle attacks." + impact: "NTLM connections will fail if NTLMv2 protocol and strong encryption (128-bit) are not both negotiated. Client applications that are enforcing these settings will be unable to communicate with older servers that do not support them." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) clients." + compliance: + - cis: ["2.3.11.9"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["18.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec -> 537395200' + + # 2.3.11.10 (L1) Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption' (Automated)' + - id: 16055 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'." + description: "This policy setting determines which behaviors are allowed by servers for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable all of the options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. That is, these options help protect against man-in-the-middle attacks." + impact: "NTLM connections will fail if NTLMv2 protocol and strong encryption (128-bit) are not both negotiated. Server applications that are enforcing these settings will be unable to communicate with older servers that do not support them." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) servers." + compliance: + - cis: ["2.3.11.10"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["18.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec -> 537395200' + + # 2.3.13.1 (L1) Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled'. (Automated) + - id: 16056 + title: "Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled'." + description: "This policy setting determines whether a computer can be shut down when a user is not logged on. If this policy setting is enabled, the shutdown command is available on the Windows logon screen. It is recommended to disable this policy setting to restrict the ability to shut down the computer to users with credentials on the system. The recommended state for this setting is: Disabled. Note: In Server 2008 R2 and older versions, this setting had no impact on Remote Desktop (RDP) / Terminal Services sessions - it only affected the local console. However, Microsoft changed the behavior in Windows Server 2012 (non-R2) and above, where if set to Enabled, RDP sessions are also allowed to shut down or restart the server." + rationale: "Users who can access the console locally could shut down the computer. Attackers could also walk to the local console and restart the server, which would cause a temporary DoS condition. Attackers could also shut down the server and leave all of its applications and services unavailable. As noted in the Description above, the Denial of Service (DoS) risk of enabling this setting dramatically increases in Windows Server 2012 (non-R2) and above, as even remote users could then shut down or restart the server from the logon screen of an RDP session." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Shutdown: Allow system to be shut down without having to log on." + compliance: + - cis: ["2.3.13.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ShutdownWithoutLogon' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ShutdownWithoutLogon -> 0' + + # 2.3.15.1 (L1) Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'. (Automated) + - id: 16057 + title: "Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'." + description: "This policy setting determines whether case insensitivity is enforced for all subsystems. The Microsoft Win32 subsystem is case insensitive. However, the kernel supports case sensitivity for other subsystems, such as the Portable Operating System Interface for UNIX (POSIX). Because Windows is case insensitive (but the POSIX subsystem will support case sensitivity), failure to enforce this policy setting makes it possible for a user of the POSIX subsystem to create a file with the same name as another file by using mixed case to label it. Such a situation can block access to these files by another user who uses typical Win32 tools, because only one of the files will be available. The recommended state for this setting is: Enabled." + rationale: "Because Windows is case-insensitive but the POSIX subsystem will support case sensitivity, failure to enable this policy setting would make it possible for a user of that subsystem to create a file with the same name as another file but with a different mix of upper and lower case letters. Such a situation could potentially confuse users when they try to access such files from normal Win32 tools because only one of the files will be available." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Require case insensitivity for non - Windows subsystems." + compliance: + - cis: ["2.3.15.1"] + - cis_csc_v8: ["4.1", "5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - hipaa: ["164.312(a)(2)(i)"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "8.1", "8.1.1"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "12.5.2", "2.1.1", "2.2.1"] + - soc_2: ["CC6.1", "CC6.2", "CC6.3", "CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive -> 1' + + # 2.3.15.2 (L1) Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'. (Automated) + - id: 16058 + title: "Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'." + description: "This policy setting determines the strength of the default discretionary access control list (DACL) for objects. Active Directory maintains a global list of shared system resources, such as DOS device names, mutexes, and semaphores. In this way, objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and what permissions are granted. The recommended state for this setting is: Enabled." + rationale: "This setting determines the strength of the default DACL for objects. Windows maintains a global list of shared computer resources so that objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and with what permissions." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)." + compliance: + - cis: ["2.3.15.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode -> 1' + + # 2.3.17.1 (L1) Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'. (Automated) + - id: 16059 + title: "Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'." + description: "This policy setting controls the behavior of Admin Approval Mode for the built-in Administrator account. The recommended state for this setting is: Enabled." + rationale: 'One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. An attack vector for these programs was to discover the password of the account named "Administrator" because that user account was created for all installations of Windows. To address this risk, in Windows Vista or newer, the built-in Administrator account is now disabled by default. In a default installation of a new computer, accounts with administrative control over the computer are initially set up in one of two ways: - - If the computer is not joined to a domain, the first user account you create has the equivalent permissions as a local administrator. If the computer is joined to a domain, no local administrator accounts are created. The Enterprise or Domain Administrator must log on to the computer and create one if a local administrator account is warranted. Once Windows is installed, the built-in Administrator account may be manually enabled, but we strongly recommend that this account remain disabled.' + impact: "The built-in Administrator account uses Admin Approval Mode. Users that log on using the local Administrator account will be prompted for consent whenever a program requests an elevation in privilege, just like any other user would." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Admin Approval Mode for the Built-in Administrator account." + compliance: + - cis: ["2.3.17.1"] + - cis_csc_v7: ["4.3"] + - iso_27001-2013: ["A.9.2.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken -> 1' + + # 2.3.17.2 (L1) Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop' or higher (Automated) + - id: 16060 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop' or higher." + description: "This policy setting controls the behavior of the elevation prompt for administrators. The recommended state for this setting is: Prompt for consent on the secure desktop. Configuring this setting to Prompt for credentials on the secure desktop also conforms to the benchmark." + rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting raises awareness to the administrator of elevated privilege operations and permits the administrator to prevent a malicious program from elevating its privilege when the program attempts to do so." + impact: "When an operation (including execution of a Windows binary) requires elevation of privilege, the user is prompted on the secure desktop to select either Permit or Deny. If the user selects Permit, the operation continues with the user's highest available privilege." + remediation: "To establish the recommended configuration via GP, set the following UI path to Prompt for consent on the secure desktop or Prompt for credentials on the secure desktop: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode." + compliance: + - cis: ["2.3.17.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> r:^2$' + + # 2.3.17.3 (L1) Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'. (Automated) + - id: 16061 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'." + description: "This policy setting controls the behavior of the elevation prompt for standard users. The recommended state for this setting is: Automatically deny elevation requests." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious programs running under elevated credentials without the user or administrator being aware of their activity. This setting raises awareness to the user that a program requires the use of elevated privilege operations and requires that the user be able to supply administrative credentials in order for the program to run." + impact: 'When an operation requires elevation of privilege, a configurable access denied error message is displayed. An enterprise that is running desktops as standard user may choose this setting to reduce help desk calls. Note: With this setting configured as recommended, the default error message displayed when a user attempts to perform an operation or run a program requiring privilege elevation (without Administrator rights) is "This program will not run. This program is blocked by group policy. For more information, contact your system administrator." Some users who are not used to seeing this message may believe that the operation or program they attempted to run is specifically blocked by group policy, as that is what the message seems to imply. This message may therefore result in user questions as to why that specific operation/program is blocked, when in fact, the problem is that they need to perform the operation or run the program with an Administrative account (or "Run as Administrator" if it is already an Administrator account), and they are not doing that.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Automatically deny elevation requests: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for standard users." + compliance: + - cis: ["2.3.17.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser -> 0' + + # 2.3.17.4 (L1) Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'. (Automated) + - id: 16062 + title: "Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'." + description: "This policy setting controls the behavior of application installation detection for the computer. The recommended state for this setting is: Enabled." + rationale: "Some malicious software will attempt to install itself after being given permission to run. For example, malicious software with a trusted application shell. The user may have given permission for the program to run because the program is trusted, but if they are then prompted for installation of an unknown component this provides another way of trapping the software before it can do damage." + impact: "When an application installation package is detected that requires elevation of privilege, the user is prompted to enter an administrative user name and password. If the user enters valid credentials, the operation continues with the applicable privilege." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Detect application installations and prompt for elevation." + compliance: + - cis: ["2.3.17.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 1' + + # 2.3.17.5 (L1) Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'. (Automated) + - id: 16063 + title: "Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'." + description: "This policy setting controls whether applications that request to run with a User Interface Accessibility (UIAccess) integrity level must reside in a secure location in the file system. Secure locations are limited to the following: ...\\Program Files\\, including subfolders; ...\\Windows\\system32\\; ...\\Program Files (x86)\\, including subfolders (for 64-bit versions of Windows). Note: Windows enforces a public key infrastructure (PKI) signature check on any interactive application that requests to run with a UIAccess integrity level regardless of the state of this security setting. The recommended state for this setting is: Enabled." + rationale: "UIAccess Integrity allows an application to bypass User Interface Privilege Isolation (UIPI) restrictions when an application is elevated in privilege from a standard user to an administrator. This is required to support accessibility features such as screen readers that are transmitting user interfaces to alternative forms. A process that is started with UIAccess rights has the following abilities: - To set the foreground window. - To drive any application window using SendInput function. - To use read input for all integrity levels using low-level hooks, raw input, GetKeyState, GetAsyncKeyState, and GetKeyboardInput. - To set journal hooks. - To uses AttachThreadInput to attach a thread to a higher integrity input queue." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Only elevate UIAccess applications that are installed in secure locations." + compliance: + - cis: ["2.3.17.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths -> 1' + + # 2.3.17.6 (L1) Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'. (Automated) + - id: 16064 + title: "Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'." + description: "This policy setting controls the behavior of all User Account Control (UAC) policy settings for the computer. If you change this policy setting, you must restart your computer. The recommended state for this setting is: Enabled. Note: If this policy setting is disabled, the Security Center notifies you that the overall security of the operating system has been reduced." + rationale: "This is the setting that turns on or off UAC. If this setting is disabled, UAC will not be used and any security benefits and risk mitigations that are dependent on UAC will not be present on the system." + impact: "None - this is the default behavior. Users and administrators will need to learn to work with UAC prompts and adjust their work habits to use least privilege operations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Run all administrators in Admin Approval Mode." + compliance: + - cis: ["2.3.17.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA -> 1' + + # 2.3.17.7 (L1) Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'. (Automated) + - id: 16065 + title: "Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'." + description: "This policy setting controls whether the elevation request prompt is displayed on the interactive user's desktop or the secure desktop. The recommended state for this setting is: Enabled." + rationale: "Standard elevation prompt dialog boxes can be spoofed, which may cause users to disclose their passwords to malicious software. The secure desktop presents a very distinct appearance when prompting for elevation, where the user desktop dims, and the elevation prompt UI is more prominent. This increases the likelihood that users who become accustomed to the secure desktop will recognize a spoofed elevation prompt dialog box and not fall for the trick." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Switch to the secure desktop when prompting for elevation." + compliance: + - cis: ["2.3.17.7"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop -> 1' + + # 2.3.17.8 (L1) Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'. (Automated) + - id: 16066 + title: "Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'." + description: "This policy setting controls whether application write failures are redirected to defined registry and file system locations. This policy setting mitigates applications that run as administrator and write run-time application data to: - %ProgramFiles% - %windir% - %windir%\\System32 - HKEY_LOCAL_MACHINE\\SOFTWARE The recommended state for this setting is: Enabled." + rationale: "This setting reduces vulnerabilities by ensuring that legacy applications only write data to permitted locations." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Virtualize file and registry write failures to per-user locations." + compliance: + - cis: ["2.3.17.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization -> 1' + + # 5.1 (L1) Ensure 'Print Spooler (Spooler)' is set to 'Disabled' (DC only). (Automated) + - id: 16067 + title: "Ensure 'Print Spooler (Spooler)' is set to 'Disabled' (DC only)." + description: "This service spools print jobs and handles interaction with printers. The recommended state for this setting is: Disabled." + rationale: "Disabling the Print Spooler (Spooler) service mitigates the PrintNightmare vulnerability (CVE-2021-34527) and other attacks against the service." + impact: "Domain Controllers will not be able to prune published printers from Active Directory. By default, Domain Controllers prune printer objects from Active Directory if the computer that published them doesn't respond to contact requests. Domain Controllers will not be able to act as a print server, sharing printers for clients. Applications on and users logged in at Domain Controllers will not be able to print, including printing to files (such as Adobe Portable Document Format (PDF)) which uses the Print Spooler service." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Print Spooler." + references: + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527" + compliance: + - cis: ["5.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler -> Start -> 4' + + # 5.2 (L2) Ensure 'Print Spooler (Spooler)' is set to 'Disabled' (MS only). (Automated) + - id: 16068 + title: "Ensure 'Print Spooler (Spooler)' is set to 'Disabled' (MS only)." + description: "This service spools print jobs and handles interaction with printers. The recommended state for this setting is: Disabled." + rationale: "Disabling the Print Spooler (Spooler) service mitigates the PrintNightmare vulnerability (CVE-2021-34527) and other attacks against the service." + impact: "Member Servers will not be able to act as a print server, sharing printers for clients. Applications on and users logged in to Member Servers will not be able to print, including printing to files (such as Adobe Portable Document Format (PDF)) which uses the Print Spooler service." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Print Spooler." + references: + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527" + compliance: + - cis: ["5.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler -> Start -> 4' + + ############################################### + # 9 Windows Firewall with Advanced Security + ############################################### + + ############################################### + # 9.1 Domain Profile + ############################################### + + # 9.1.1 (L1) Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)'. (Automated) + - id: 16069 + title: "Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)'." + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Firewall state." + compliance: + - cis: ["9.1.1"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall -> 1' + + # 9.1.2 (L1) Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)'. (Automated) + - id: 16070 + title: "Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)'." + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Inbound connections." + compliance: + - cis: ["9.1.2"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction -> 1' + + # 9.1.3 (L1) Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)'. (Automated) + - id: 16071 + title: "Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)'." + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default)." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Outbound connections." + compliance: + - cis: ["9.1.3"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction -> 0' + + # 9.1.4 (L1) Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'. (Automated) + - id: 16072 + title: "Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'." + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + impact: "Windows Firewall will not display a notification when a program is blocked from receiving inbound connections." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.1.4"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications -> 1' + + # 9.1.5 (L1) Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SystemRoot%\System32\logfiles\firewall\domainfw.log'. (Automated) + - id: 16073 + title: "Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SystemRoot%\\System32\\logfiles\\firewall\\domainfw.log'." + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SystemRoot%\\System32\\logfiles\\firewall\\domainfw.log." + rationale: "If Windows Firewall events are not recorded it may be difficult or impossible for Administrators to analyze system issues or unauthorized activities of malicious users. Microsoft stores all firewall events as one file on the system (pfirewall.log). To improve logging, separate each firewall profile (domain, private, public) into its own distinct log file (domainfw.log, privatefw.log, publicfw.log) for better organization and identification of specific issues within each profile." + impact: "The log file will be stored in the specified file." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SystemRoot%\\System32\\logfiles\\firewall\\domainfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Name." + compliance: + - cis: ["9.1.5"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\domainfw.log' + + # 9.1.6 (L1) Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16,384 KB or greater'. (Automated) + - id: 16074 + title: "Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16,384 KB or greater'." + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "The log file size will be limited to the specified size, old events will be overwritten by newer ones when the limit is reached." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.1.6"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + # 9.1.7 (L1) Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'. (Automated) + - id: 16075 + title: "Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Information about dropped packets will be recorded in the firewall log file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.1.7"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets -> 1' + + # 9.1.8 (L1) Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'. (Automated) + - id: 16076 + title: "Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Information about successful connections will be recorded in the firewall log file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.1.8"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections -> 1' + + ############################################### + # 9.2 Private Profile + ############################################### + + # 9.2.1 (L1) Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)'. (Automated) + - id: 16077 + title: "Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)'." + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Firewall state." + compliance: + - cis: ["9.2.1"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall -> 1' + + # 9.2.2 (L1) Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)'. (Automated) + - id: 16078 + title: "Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)'." + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Inbound connections." + compliance: + - cis: ["9.2.2"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction -> 1' + + # 9.2.3 (L1) Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)'. (Automated) + - id: 16079 + title: "Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)'." + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Outbound connections." + compliance: + - cis: ["9.2.3"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction -> 0' + + # 9.2.4 (L1) Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'. (Automated) + - id: 16080 + title: "Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'." + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + impact: "Windows Firewall will not display a notification when a program is blocked from receiving inbound connections." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.2.4"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications -> 1' + + # 9.2.5 (L1) Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SystemRoot%\System32\logfiles\firewall\privatefw.log'. (Automated) + - id: 16081 + title: "Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SystemRoot%\\System32\\logfiles\\firewall\\privatefw.log'." + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SystemRoot%\\System32\\logfiles\\firewall\\privatefw.log." + rationale: "If Windows Firewall events are not recorded it may be difficult or impossible for Administrators to analyze system issues or unauthorized activities of malicious users. Microsoft stores all firewall events as one file on the system (pfirewall.log). To improve logging, separate each firewall profile (domain, private, public) into its own distinct log file (domainfw.log, privatefw.log, publicfw.log) for better organization and identification of specific issues within each profile." + impact: "The log file will be stored in the specified file." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SystemRoot%\\System32\\logfiles\\firewall\\privatefw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Name." + compliance: + - cis: ["9.2.5"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\privatefw.log' + + # 9.2.6 (L1) Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16,384 KB or greater'. (Automated) + - id: 16082 + title: "Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16,384 KB or greater'." + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "The log file size will be limited to the specified size, old events will be overwritten by newer ones when the limit is reached." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.2.6"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + # 9.2.7 (L1) Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'. (Automated) + - id: 16083 + title: "Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Information about dropped packets will be recorded in the firewall log file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.2.7"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets -> 1' + + # 9.2.8 (L1) Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes'. (Automated) + - id: 16084 + title: "Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Information about successful connections will be recorded in the firewall log file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.2.8"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections -> 1' + + ############################################### + # 9.3 Public Profile + ############################################### + + # 9.3.1 (L1) Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'. (Automated) + - id: 16085 + title: "Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'." + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Firewall state." + compliance: + - cis: ["9.3.1"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall -> 1' + + # 9.3.2 (L1) Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)'. (Automated) + - id: 16086 + title: "Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)'." + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Inbound connections." + compliance: + - cis: ["9.3.2"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction -> 1' + + # 9.3.3 (L1) Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)'. (Automated) + - id: 16087 + title: "Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)'." + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Outbound connections." + compliance: + - cis: ["9.3.3"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction -> 0' + + # 9.3.4 (L1) Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No'. (Automated) + - id: 16088 + title: "Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No'." + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No." + rationale: "Some organizations may prefer to avoid alarming users when firewall rules block certain types of network activity. However, notifications can be helpful when troubleshooting network issues involving the firewall." + impact: "Windows Firewall will not display a notification when a program is blocked from receiving inbound connections." + remediation: "To establish the recommended configuration via GP, set the following UI path to 'No': Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.3.4"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications -> 1' + + # 9.3.5 (L1) Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'. (Automated) + - id: 16089 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'." + description: "This setting controls whether local administrators are allowed to create local firewall rules that apply together with firewall rules configured by Group Policy. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "When in the Public profile, there should be no special local firewall exceptions per computer. These settings should be managed by a centralized policy." + impact: "Administrators can still create firewall rules, but the rules will not be applied." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local firewall rules." + compliance: + - cis: ["9.3.5"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge -> 0' + + # 9.3.6 (L1) Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'. (Automated) + - id: 16090 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'." + description: "This setting controls whether local administrators are allowed to create connection security rules that apply together with connection security rules configured by Group Policy. The recommended state for this setting is: No." + rationale: "Users with administrative privileges might create firewall rules that expose the system to remote attack." + impact: "Administrators can still create local connection security rules, but the rules will not be applied." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local connection security rules." + compliance: + - cis: ["9.3.6"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0' + + # 9.3.7 (L1) Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SystemRoot%\System32\logfiles\firewall\publicfw.log'. (Automated) + - id: 16091 + title: "Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SystemRoot%\\System32\\logfiles\\firewall\\publicfw.log'." + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SystemRoot%\\System32\\logfiles\\firewall\\publicfw.log." + rationale: "If Windows Firewall events are not recorded it may be difficult or impossible for Administrators to analyze system issues or unauthorized activities of malicious users. Microsoft stores all firewall events as one file on the system (pfirewall.log). To improve logging, separate each firewall profile (domain, private, public) into its own distinct log file (domainfw.log, privatefw.log, publicfw.log) for better organization and identification of specific issues within each profile." + impact: "The log file will be stored in the specified file." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SystemRoot%\\System32\\logfiles\\firewall\\publicfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Name." + compliance: + - cis: ["9.3.7"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\publicfw.log' + + # 9.3.8 (L1) Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16,384 KB or greater'. (Automated) + - id: 16092 + title: "Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16,384 KB or greater'." + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "The log file size will be limited to the specified size, old events will be overwritten by newer ones when the limit is reached." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.3.8"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + # 9.3.9 (L1) Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'. (Automated) + - id: 16093 + title: "Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Information about dropped packets will be recorded in the firewall log file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.3.9"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets -> 1' + + # 9.3.10 (L1) Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'. (Automated) + - id: 16094 + title: "Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Information about successful connections will be recorded in the firewall log file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.3.10"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections -> 1' + + ############################################### + # 17 Advanced Audit Policy Configuration + ############################################### + + # 17.1.1 (L1) Ensure 'Audit Credential Validation' is set to 'Success and Failure'. (Automated) + - id: 16095 + title: "Ensure 'Audit Credential Validation' is set to 'Success and Failure'." + description: "This subcategory reports the results of validation tests on credentials submitted for a user account logon request. These events occur on the computer that is authoritative for the credentials. For domain accounts, the Domain Controller is authoritative, whereas for local accounts, the local computer is authoritative. In domain environments, most of the Account Logon events occur in the Security log of the Domain Controllers that are authoritative for the domain accounts. However, these events can occur on other computers in the organization when local accounts are used to log on. Events for this subcategory include: - 4774: An account was mapped for logon. - 4775: An account could not be mapped for logon. - 4776: The Domain Controller attempted to validate the credentials for an account. - 4777: The Domain Controller failed to validate the credentials for an account. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Logon\\Audit Credential Validation." + compliance: + - cis: ["17.1.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.12"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Credential Validation" -> r:Success and Failure' + + # 17.1.2 (L1) Ensure 'Audit Kerberos Authentication Service' is set to 'Success and Failure' (DC Only). (Automated) + - id: 16096 + title: "Ensure 'Audit Kerberos Authentication Service' is set to 'Success and Failure' (DC Only)." + description: "This subcategory reports the results of events generated after a Kerberos authentication TGT request. Kerberos is a distributed authentication service that allows a client running on behalf of a user to prove its identity to a server without sending data across the network. This helps mitigate an attacker or server from impersonating a user. - 4768: A Kerberos authentication ticket (TGT) was requested. - 4771: Kerberos pre-authentication failed. - 4772: A Kerberos authentication ticket request failed. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Logon\\Audit Kerberos Authentication Service." + compliance: + - cis: ["17.1.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Kerberos Authentication Service" -> r:Success and Failure' + + # 17.1.3 (L1) Ensure 'Audit Kerberos Service Ticket Operations' is set to 'Success and Failure' (DC Only). (Automated) + - id: 16097 + title: "Ensure 'Audit Kerberos Service Ticket Operations' is set to 'Success and Failure' (DC Only)." + description: "This subcategory reports the results of events generated by Kerberos authentication ticket-granting ticket (TGT) requests. Kerberos Service Ticket requests (TGS requests) occur as part of service use and access requests by specific accounts. Auditing these events will record the IP address from which the account requested TGS, when TGS was requested, and which encryption type was used. - 4769: A Kerberos service ticket was requested. - 4770: A Kerberos service ticket was renewed. - 4773: A Kerberos service ticket request failed. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Logon\\Audit Kerberos Service Ticket Operations." + compliance: + - cis: ["17.1.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Kerberos Service Ticket Operations" -> r:Success and Failure' + + # 17.2.1 (L1) Ensure 'Audit Application Group Management' is set to 'Success and Failure'. (Automated) + - id: 16098 + title: "Ensure 'Audit Application Group Management' is set to 'Success and Failure'." + description: "This policy setting allows you to audit events generated by changes to application groups such as the following: - Application group is created, changed, or deleted. - Member is added or removed from an application group. Application groups are utilized by Windows Authorization Manager, which is a flexible framework created by Microsoft for integrating role-based access control (RBAC) into applications. More information on Windows Authorization Manager is available at MSDN - Windows Authorization Manager. The recommended state for this setting is: Success and Failure." + rationale: "Auditing events in this category may be useful when investigating an incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Application Group Management." + compliance: + - cis: ["17.2.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Application Group Management" -> r:Success and Failure' + + # 17.2.2 (L1) Ensure 'Audit Computer Account Management' is set to include 'Success' (DC only). (Automated) + - id: 16099 + title: "Ensure 'Audit Computer Account Management' is set to include 'Success' (DC only)." + description: "This subcategory reports each event of computer account management, such as when a computer account is created, changed, deleted, renamed, disabled, or enabled. Events for this subcategory include: - 4741: A computer account was created. - 4742: A computer account was changed. - 4743: A computer account was deleted. The recommended state for this setting is to include: Success." + rationale: "Auditing events in this category may be useful when investigating an incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Computer Account Management." + compliance: + - cis: ["17.2.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Computer Account Management" -> r:Success' + + # 17.2.3 (L1) Ensure 'Audit Distribution Group Management' is set to include 'Success' (DC only). (Automated) + - id: 16100 + title: "Ensure 'Audit Distribution Group Management' is set to include 'Success' (DC only)." + description: "This subcategory reports each event of distribution group management, such as when a distribution group is created, changed, or deleted or when a member is added to or removed from a distribution group. If you enable this Audit policy setting, administrators can track events to detect malicious, accidental, and authorized creation of group accounts. Events for this subcategory include: - 4744: A security-disabled local group was created. - 4745: A security-disabled local group was changed. - 4746: A member was added to a security-disabled local group. - 4747: A member was removed from a security-disabled local group. - 4748: A security-disabled local group was deleted. - 4749: A security-disabled global group was created. - 4750: A security-disabled global group was changed. - 4751: A member was added to a security-disabled global group. - 4752: A member was removed from a security-disabled global group. - 4753: A security-disabled global group was deleted. - 4759: A security-disabled universal group was created. - 4760: A security-disabled universal group was changed. - 4761: A member was added to a security-disabled universal group. - 4762: A member was removed from a security-disabled universal group. - 4763: A security-disabled universal group was deleted. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may provide an organization with insight when investigating an incident. For example, when a given unauthorized user was added to a sensitive distribution group." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Distribution Group Management." + compliance: + - cis: ["17.2.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Distribution Group Management" -> r:Success' + + # 17.2.4 (L1) Ensure 'Audit Other Account Management Events' is set to include 'Success' (DC only). (Automated) + - id: 16101 + title: "Ensure 'Audit Other Account Management Events' is set to include 'Success' (DC only)." + description: "This subcategory reports other account management events. Events for this subcategory include: - 4782: The password hash an account was accessed. - 4793: The Password Policy Checking API was called. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Other Account Management Events." + compliance: + - cis: ["17.2.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Other Account Management Events" -> r:Success' + + # 17.2.5 (L1) Ensure 'Audit Security Group Management' is set to include 'Success'. (Automated) + - id: 16102 + title: "Ensure 'Audit Security Group Management' is set to include 'Success'." + description: "This subcategory reports each event of security group management, such as when a security group is created, changed, or deleted or when a member is added to or removed from a security group. If you enable this Audit policy setting, administrators can track events to detect malicious, accidental, and authorized creation of security group accounts. Events for this subcategory include: - 4727: A security-enabled global group was created. - 4728: A member was added to a security-enabled global group. - 4729: A member was removed from a security-enabled global group. - 4730: A security-enabled global group was deleted. - 4731: A security-enabled local group was created. - 4732: A member was added to a security-enabled local group. - 4733: A member was removed from a security-enabled local group. - 4734: A security-enabled local group was deleted. - 4735: A security-enabled local group was changed. - 4737: A security-enabled global group was changed. - 4754: A security-enabled universal group was created. - 4755: A security-enabled universal group was changed. - 4756: A member was added to a security-enabled universal group. - 4757: A member was removed from a security-enabled universal group. - 4758: A security-enabled universal group was deleted. - 4764: A group's type was changed. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Security Group Management." + compliance: + - cis: ["17.2.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.6"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1", "A.9.2.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Security Group Management" -> r:Success' + + # 17.2.6 (L1) Ensure 'Audit User Account Management' is set to 'Success and Failure'. (Automated) + - id: 16103 + title: "Ensure 'Audit User Account Management' is set to 'Success and Failure'." + description: "This subcategory reports each event of user account management, such as when a user account is created, changed, or deleted; a user account is renamed, disabled, or enabled; or a password is set or changed. If you enable this Audit policy setting, administrators can track events to detect malicious, accidental, and authorized creation of user accounts. Events for this subcategory include: - 4720: A user account was created. - 4722: A user account was enabled. - 4723: An attempt was made to change an account's password. - 4724: An attempt was made to reset an account's password. - 4725: A user account was disabled. - 4726: A user account was deleted. - 4738: A user account was changed. - 4740: A user account was locked out. - 4765: SID History was added to an account. - 4766: An attempt to add SID History to an account failed. - 4767: A user account was unlocked. - 4780: The ACL was set on accounts which are members of administrators groups. - 4781: The name of an account was changed: - 4794: An attempt was made to set the Directory Services Restore Mode. - 5376: Credential Manager credentials were backed up. - 5377: Credential Manager credentials were restored from a backup. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit User Account Management." + compliance: + - cis: ["17.2.6"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"User Account Management" -> r:Success and Failure' + + # 17.3.1 (L1) Ensure 'Audit PNP Activity' is set to include 'Success'. (Automated) + - id: 16104 + title: "Ensure 'Audit PNP Activity' is set to include 'Success'." + description: "This policy setting allows you to audit when plug and play detects an external device. The recommended state for this setting is to include: Success. Note: A Windows 10, Server 2016 or newer OS is required to access and set this value in Group Policy." + rationale: "Enabling this setting will allow a user to audit events when a device is plugged into a system. This can help alert IT staff if unapproved devices are plugged in." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Detailed Tracking\\Audit PNP Activity." + compliance: + - cis: ["17.3.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"PNP Activity" -> r:Success' + + # 17.3.2 (L1) Ensure 'Audit Process Creation' is set to include 'Success'. (Automated) + - id: 16105 + title: "Ensure 'Audit Process Creation' is set to include 'Success'." + description: "This subcategory reports the creation of a process and the name of the program or user that created it. Events for this subcategory include: - 4688: A new process has been created. - 4696: A primary token was assigned to process. Refer to Microsoft Knowledge Base article 947226: Description of security events in Windows Vista and in Windows Server 2008 for the most recent information about this setting. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Detailed Tracking\\Audit Process Creation." + compliance: + - cis: ["17.3.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Process Creation" -> r:Success' + + # 17.4.1 (L1) Ensure 'Audit Directory Service Access' is set to include 'Failure' (DC only). (Automated) + - id: 16106 + title: "Ensure 'Audit Directory Service Access' is set to include 'Failure' (DC only)." + description: "This subcategory reports when an AD DS object is accessed. Only objects with SACLs cause audit events to be generated, and only when they are accessed in a manner that matches their SACL. These events are similar to the directory service access events in previous versions of Windows Server. This subcategory applies only to Domain Controllers. Events for this subcategory include: - 4662 : An operation was performed on an object. The recommended state for this setting is to include: Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\DS Access\\Audit Directory Service Access." + compliance: + - cis: ["17.4.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Directory Service Access" -> r:Failure' + + # 17.4.2 (L1) Ensure 'Audit Directory Service Changes' is set to include 'Success' (DC only). (Automated) + - id: 16107 + title: "Ensure 'Audit Directory Service Changes' is set to include 'Success' (DC only)." + description: "This subcategory reports changes to objects in Active Directory Domain Services (AD DS). The types of changes that are reported are create, modify, move, and undelete operations that are performed on an object. DS Change auditing, where appropriate, indicates the old and new values of the changed properties of the objects that were changed. Only objects with SACLs cause audit events to be generated, and only when they are accessed in a manner that matches their SACL. Some objects and properties do not cause audit events to be generated due to settings on the object class in the schema. This subcategory applies only to Domain Controllers. Events for this subcategory include: - 5136 : A directory service object was modified. - 5137 : A directory service object was created. - 5138 : A directory service object was undeleted. - 5139 : A directory service object was moved. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\DS Access\\Audit Directory Service Changes." + compliance: + - cis: ["17.4.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Directory Service Changes" -> r:Success' + + # 17.5.1 (L1) Ensure 'Audit Account Lockout' is set to include 'Failure'. (Automated) + - id: 16108 + title: "Ensure 'Audit Account Lockout' is set to include 'Failure'." + description: "This subcategory reports when a user's account is locked out as a result of too many failed logon attempts. Events for this subcategory include: - 4625: An account failed to log on. The recommended state for this setting is to include: Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Account Lockout." + compliance: + - cis: ["17.5.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.6"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1", "A.9.2.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Account Lockout" -> r:Failure' + + # 17.5.2 (L1) Ensure 'Audit Group Membership' is set to include 'Success'. (Automated) + - id: 16109 + title: "Ensure 'Audit Group Membership' is set to include 'Success'." + description: "This policy allows you to audit the group membership information in the user's logon token. Events in this subcategory are generated on the computer on which a logon session is created. For an interactive logon, the security audit event is generated on the computer that the user logged on to. For a network logon, such as accessing a shared folder on the network, the security audit event is generated on the computer hosting the resource. The recommended state for this setting is to include: Success. Note: A Windows 10, Server 2016 or newer OS is required to access and set this value in Group Policy." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Group Membership." + compliance: + - cis: ["17.5.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Group Membership" -> r:Success' + + # 17.5.3 (L1) Ensure 'Audit Logoff' is set to include 'Success'. (Automated) + - id: 16110 + title: "Ensure 'Audit Logoff' is set to include 'Success'." + description: "This subcategory reports when a user logs off from the system. These events occur on the accessed computer. For interactive logons, the generation of these events occurs on the computer that is logged on to. If a network logon takes place to access a share, these events generate on the computer that hosts the accessed resource. If you configure this setting to No auditing, it is difficult or impossible to determine which user has accessed or attempted to access organization computers. Events for this subcategory include: - 4634: An account was logged off. - 4647: User initiated logoff. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Logoff." + compliance: + - cis: ["17.5.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Logoff" -> r:Success' + + # 17.5.4 (L1) Ensure 'Audit Logon' is set to 'Success and Failure'. (Automated) + - id: 16111 + title: "Ensure 'Audit Logon' is set to 'Success and Failure'." + description: "This subcategory reports when a user attempts to log on to the system. These events occur on the accessed computer. For interactive logons, the generation of these events occurs on the computer that is logged on to. If a network logon takes place to access a share, these events generate on the computer that hosts the accessed resource. If you configure this setting to No auditing, it is difficult or impossible to determine which user has accessed or attempted to access organization computers. Events for this subcategory include: - 4624: An account was successfully logged on. - 4625: An account failed to log on. - 4648: A logon was attempted using explicit credentials. - 4675: SIDs were filtered. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Logon." + compliance: + - cis: ["17.5.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Logon" -> r:Success and Failure' + + # 17.5.5 (L1) Ensure 'Audit Other Logon/Logoff Events' is set to 'Success and Failure'. (Automated) + - id: 16112 + title: "Ensure 'Audit Other Logon/Logoff Events' is set to 'Success and Failure'." + description: "This subcategory reports other logon/logoff-related events, such as Remote Desktop Services session disconnects and reconnects, using RunAs to run processes under a different account, and locking and unlocking a workstation. Events for this subcategory include: - 4649: A replay attack was detected. - 4778: A session was reconnected to a Window Station. - 4779: A session was disconnected from a Window Station. - 4800: The workstation was locked. - 4801: The workstation was unlocked. - 4802: The screen saver was invoked. - 4803: The screen saver was dismissed. - 5378: The requested credentials delegation was disallowed by policy. - 5632: A request was made to authenticate to a wireless network. - 5633: A request was made to authenticate to a wired network. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Other Logon/Logoff Events." + compliance: + - cis: ["17.5.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Other Logon/Logoff Events" -> r:Success and Failure' + + # 17.5.6 (L1) Ensure 'Audit Special Logon' is set to include 'Success'. (Automated) + - id: 16113 + title: "Ensure 'Audit Special Logon' is set to include 'Success'." + description: "This subcategory reports when a special logon is used. A special logon is a logon that has administrator-equivalent privileges and can be used to elevate a process to a higher level. Events for this subcategory include: - 4964 : Special groups have been assigned to a new logon. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Special Logon." + compliance: + - cis: ["17.5.6"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Special Logon" -> r:Success' + + # 17.6.1 (L1) Ensure 'Audit Detailed File Share' is set to include 'Failure'. (Automated) + - id: 16114 + title: "Ensure 'Audit Detailed File Share' is set to include 'Failure'." + description: "This subcategory allows you to audit attempts to access files and folders on a shared folder. Events for this subcategory include: - 5145: network share object was checked to see whether client can be granted desired access. The recommended state for this setting is to include: Failure." + rationale: "Auditing the Failures will log which unauthorized users attempted (and failed) to get access to a file or folder on a network share on this computer, which could possibly be an indication of malicious intent." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit Detailed File Share." + compliance: + - cis: ["17.6.1"] + - cis_csc_v8: ["3.3", "8.5"] + - cis_csc_v7: ["6.3", "14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1", "A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "7.1", "9.4.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Detailed File Share" -> r:Failure' + + # 17.6.2 (L1) Ensure 'Audit File Share' is set to 'Success and Failure'. (Automated) + - id: 16115 + title: "Ensure 'Audit File Share' is set to 'Success and Failure'." + description: "This policy setting allows you to audit attempts to access a shared folder. The recommended state for this setting is: Success and Failure. Note: There are no system access control lists (SACLs) for shared folders. If this policy setting is enabled, access to all shared folders on the system is audited." + rationale: "In an enterprise managed environment, it's important to track deletion, creation, modification, and access events for network shares. Any unusual file sharing activity may be useful in an investigation of potentially malicious activity." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit File Share." + compliance: + - cis: ["17.6.2"] + - cis_csc_v8: ["3.3", "8.5"] + - cis_csc_v7: ["6.3", "14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1", "A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "7.1", "9.4.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"File Share" -> r:Success and Failure' + + # 17.6.3 (L1) Ensure 'Audit Other Object Access Events' is set to 'Success and Failure'. (Automated) + - id: 16116 + title: "Ensure 'Audit Other Object Access Events' is set to 'Success and Failure'." + description: "This policy setting allows you to audit events generated by the management of task scheduler jobs or COM+ objects. For scheduler jobs, the following are audited: - Job created. - Job deleted. - Job enabled. - Job disabled. - Job updated. For COM+ objects, the following are audited: - Catalog object added. - Catalog object updated. - Catalog object deleted. The recommended state for this setting is: Success and Failure." + rationale: "The unexpected creation of scheduled tasks and COM+ objects could potentially be an indication of malicious activity. Since these types of actions are generally low volume, it may be useful to capture them in the audit logs for use during an investigation." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit Other Object Access Events." + compliance: + - cis: ["17.6.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Audit Other Object Access Events" -> r:Success and Failure' + + # 17.6.4 (L1) Ensure 'Audit Removable Storage' is set to 'Success and Failure'. (Automated) + - id: 16117 + title: "Ensure 'Audit Removable Storage' is set to 'Success and Failure'." + description: "This policy setting allows you to audit user attempts to access file system objects on a removable storage device. A security audit event is generated only for all objects for all types of access requested. If you configure this policy setting, an audit event is generated each time an account accesses a file system object on a removable storage. Success audits record successful attempts and Failure audits record unsuccessful attempts. If you do not configure this policy setting, no audit event is generated when an account accesses a file system object on a removable storage. The recommended state for this setting is: Success and Failure. Note: A Windows 8.0, Server 2012 (non-R2) or newer OS is required to access and set this value in Group Policy." + rationale: "Auditing removable storage may be useful when investigating an incident. For example, if an individual is suspected of copying sensitive information onto a USB drive." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit Removable Storage." + compliance: + - cis: ["17.6.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Removable Storage" -> r:Success and Failure' + + # 17.7.1 (L1) Ensure 'Audit Audit Policy Change' is set to include 'Success'. (Automated) + - id: 16118 + title: "Ensure 'Audit Audit Policy Change' is set to include 'Success'." + description: "This subcategory reports changes in audit policy including SACL changes. Events for this subcategory include: - 4715: The audit policy (SACL) on an object was changed. - 4719: System audit policy was changed. - 4902: The Per-user audit policy table was created. - 4904: An attempt was made to register a security event source. - 4905: An attempt was made to unregister a security event source. - 4906: The CrashOnAuditFail value has changed. - 4907: Auditing settings on object were changed. - 4908: Special Groups Logon table modified. - 4912: Per User Audit Policy was changed. The recommended state for this setting is include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Audit Policy Change." + compliance: + - cis: ["17.7.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2", "A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Audit Policy Change" -> r:Success' + + # 17.7.2 (L1) Ensure 'Audit Authentication Policy Change' is set to include 'Success'. (Automated) + - id: 16119 + title: "Ensure 'Audit Authentication Policy Change' is set to include 'Success'." + description: "This subcategory reports changes in authentication policy. Events for this subcategory include: - 4706: A new trust was created to a domain. - 4707: A trust to a domain was removed. - 4713: Kerberos policy was changed. - 4716: Trusted domain information was modified. - 4717: System security access was granted to an account. - 4718: System security access was removed from an account. - 4739: Domain Policy was changed. - 4864: A namespace collision was detected. - 4865: A trusted forest information entry was added. - 4866: A trusted forest information entry was removed. - 4867: A trusted forest information entry was modified. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Authentication Policy Change." + compliance: + - cis: ["17.7.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2", "A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Authentication Policy Change" -> r:Success' + + # 17.7.3 (L1) Ensure 'Audit Authorization Policy Change' is set to include 'Success'. (Automated) + - id: 16120 + title: "Ensure 'Audit Authorization Policy Change' is set to include 'Success'." + description: "This subcategory reports changes in authorization policy. Events for this subcategory include: - 4703: A user right was adjusted. - 4704: A user right was assigned. - 4705: A user right was removed. - 4670: Permissions on an object were changed. - 4911: Resource attributes of the object were changed. - 4913: Central Access Policy on the object was changed. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Authorization Policy Change." + compliance: + - cis: ["17.7.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2", "A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Authorization Policy Change" -> r:Success' + + # 17.7.4 (L1) Ensure 'Audit MPSSVC Rule-Level Policy Change' is set to 'Success and Failure'. (Automated) + - id: 16121 + title: "Ensure 'Audit MPSSVC Rule-Level Policy Change' is set to 'Success and Failure'." + description: "This subcategory determines whether the operating system generates audit events when changes are made to policy rules for the Microsoft Protection Service (MPSSVC.exe). Events for this subcategory include: - 4944: The following policy was active when the Windows Firewall started. - 4945: A rule was listed when the Windows Firewall started. - 4946: A change has been made to Windows Firewall exception list. A rule was added. - 4947: A change has been made to Windows Firewall exception list. A rule was modified. - 4948: A change has been made to Windows Firewall exception list. A rule was deleted. - 4949: Windows Firewall settings were restored to the default values. - 4950: A Windows Firewall setting has changed. - 4951: A rule has been ignored because its major version number was not recognized by Windows Firewall. - 4952: Parts of a rule have been ignored because its minor version number was not recognized by Windows Firewall. The other parts of the rule will be enforced. - 4953: A rule has been ignored by Windows Firewall because it could not parse the rule. - 4954: Windows Firewall Group Policy settings have changed. The new settings have been applied. - 4956: Windows Firewall has changed the active profile. - 4957: Windows Firewall did not apply the following rule. - 4958: Windows Firewall did not apply the following rule because the rule referred to items not configured on this computer. The recommended state for this setting is : Success and Failure." + rationale: "Changes to firewall rules are important for understanding the security state of the computer and how well it is protected against network attacks." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit MPSSVC Rule - Level Policy Change." + compliance: + - cis: ["17.7.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"MPSSVC Rule-Level Policy Change" -> r:Success and Failure' + + # 17.7.5 (L1) Ensure 'Audit Other Policy Change Events' is set to include 'Failure'. (Automated) + - id: 16122 + title: "Ensure 'Audit Other Policy Change Events' is set to include 'Failure'." + description: "This subcategory contains events about EFS Data Recovery Agent policy changes, changes in Windows Filtering Platform filter, status on Security policy settings updates for local Group Policy settings, Central Access Policy changes, and detailed troubleshooting events for Cryptographic Next Generation (CNG) operations. - 5063: A cryptographic provider operation was attempted. - 5064: A cryptographic context operation was attempted. - 5065: A cryptographic context modification was attempted. - 5066: A cryptographic function operation was attempted. - 5067: A cryptographic function modification was attempted. - 5068: A cryptographic function provider operation was attempted. - 5069: A cryptographic function property operation was attempted. - 5070: A cryptographic function property modification was attempted. - 6145: One or more errors occurred while processing security policy in the group policy objects. The recommended state for this setting is to include: Failure." + rationale: "This setting can help detect errors in applied Security settings which came from Group Policy, and failure events related to Cryptographic Next Generation (CNG) functions." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Other Policy Change Events." + compliance: + - cis: ["17.7.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Other Policy Change Events" -> r:Failure' + + # 17.8.1 (L1) Ensure 'Audit Sensitive Privilege Use' is set to 'Success and Failure'. (Automated) + - id: 16123 + title: "Ensure 'Audit Sensitive Privilege Use' is set to 'Success and Failure'." + description: "This subcategory reports when a user account or service uses a sensitive privilege. A sensitive privilege includes the following user rights: - Act as part of the operating system - Back up files and directories - Create a token object - Debug programs - Enable computer and user accounts to be trusted for delegation - Generate security audits - - Load and unload device drivers - Manage auditing and security log - Modify firmware environment values - Replace a process-level token - Restore files and directories - Take ownership of files or other objects Impersonate a client after authentication Auditing this subcategory will create a high volume of events. Events for this subcategory include: - 4672: Special privileges assigned to new logon. - 4673: A privileged service was called. - 4674: An operation was attempted on a privileged object. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Privilege Use\\Audit Sensitive Privilege Use." + compliance: + - cis: ["17.8.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Sensitive Privilege Use" -> r:Success and Failure' + + # 17.9.1 (L1) Ensure 'Audit IPsec Driver' is set to 'Success and Failure'. (Automated) + - id: 16124 + title: "Ensure 'Audit IPsec Driver' is set to 'Success and Failure'." + description: "This subcategory reports on the activities of the Internet Protocol security (IPsec) driver. Events for this subcategory include: - 4960: IPsec dropped an inbound packet that failed an integrity check. If this problem persists, it could indicate a network issue or that packets are being modified in transit to this computer. Verify that the packets sent from the remote computer are the same as those received by this computer. This error might also indicate interoperability problems with other IPsec implementations. - 4961: IPsec dropped an inbound packet that failed a replay check. If this problem persists, it could indicate a replay attack against this computer. - 4962: IPsec dropped an inbound packet that failed a replay check. The inbound packet had too low a sequence number to ensure it was not a replay. - 4963: IPsec dropped an inbound clear text packet that should have been secured. This is usually due to the remote computer changing its IPsec policy without informing this computer. This could also be a spoofing attack attempt. - 4965: IPsec received a packet from a remote computer with an incorrect Security Parameter Index (SPI). This is usually caused by malfunctioning hardware that is corrupting packets. If these errors persist, verify that the packets sent from the remote computer are the same as those received by this computer. This error may also indicate interoperability problems with other IPsec implementations. In that case, if connectivity is not impeded, then these events can be ignored. - 5478: IPsec Services has started successfully. - 5479: IPsec Services has been shut down successfully. The shutdown of IPsec Services can put the computer at greater risk of network attack or expose the computer to potential security risks. - 5480: IPsec Services failed to get the complete list of network interfaces on the computer. This poses a potential security risk because some of the network interfaces may not get the protection provided by the applied IPsec filters. Use the IP Security Monitor snap-in to diagnose the problem. - 5483: IPsec Services failed to initialize RPC server. IPsec Services could not be started. - 5484: IPsec Services has experienced a critical failure and has been shut down. The shutdown of IPsec Services can put the computer at greater risk of network attack or expose the computer to potential security risks. - 5485: IPsec Services failed to process some IPsec filters on a plug-and-play event for network interfaces. This poses a potential security risk because some of the network interfaces may not get the protection provided by the applied IPsec filters. Use the IP Security Monitor snap-in to diagnose the problem. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit IPsec Driver." + compliance: + - cis: ["17.9.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"IPsec Driver" -> r:Success and Failure' + + # 17.9.2 (L1) Ensure 'Audit Other System Events' is set to 'Success and Failure'. (Automated) + - id: 16125 + title: "Ensure 'Audit Other System Events' is set to 'Success and Failure'." + description: "This subcategory reports on other system events. Events for this subcategory include: - 5024 : The Windows Firewall Service has started successfully. - 5025 : The Windows Firewall Service has been stopped. - 5027 : The Windows Firewall Service was unable to retrieve the security policy from the local storage. The service will continue enforcing the current policy. - 5028 : The Windows Firewall Service was unable to parse the new security policy. The service will continue with currently enforced policy. - 5029: The Windows Firewall Service failed to initialize the driver. The service will continue to enforce the current policy. - 5030: The Windows Firewall Service failed to start. - 5032: Windows Firewall was unable to notify the user that it blocked an application from accepting incoming connections on the network. - 5033 : The Windows Firewall Driver has started successfully. - 5034 : The Windows Firewall Driver has been stopped. - 5035 : The Windows Firewall Driver failed to start. - 5037 : The Windows Firewall Driver detected critical runtime error. Terminating. - 5058: Key file operation. - 5059: Key migration operation. The recommended state for this setting is: Success and Failure." + rationale: "Capturing these audit events may be useful for identifying when the Windows Firewall is not performing as expected." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit Other System Events." + compliance: + - cis: ["17.9.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Other System Events" -> r:Success and Failure' + + # 17.9.3 (L1) Ensure 'Audit Security State Change' is set to include 'Success'. (Automated) + - id: 16126 + title: "Ensure 'Audit Security State Change' is set to include 'Success'." + description: "This subcategory reports changes in security state of the system, such as when the security subsystem starts and stops. Events for this subcategory include: - 4608: Windows is starting up. - 4609: Windows is shutting down. - 4616: The system time was changed. - 4621: Administrator recovered system from CrashOnAuditFail. Users who are not administrators will now be allowed to log on. Some auditable activity might not have been recorded. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit Security State Change." + compliance: + - cis: ["17.9.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Security State Change" -> r:Success' + + # 17.9.4 (L1) Ensure 'Audit Security System Extension' is set to include 'Success'. (Automated) + - id: 16127 + title: "Ensure 'Audit Security System Extension' is set to include 'Success'." + description: "This subcategory reports the loading of extension code such as authentication packages by the security subsystem. Events for this subcategory include: - 4610: An authentication package has been loaded by the Local Security Authority. - 4611: A trusted logon process has been registered with the Local Security Authority. - 4614: A notification package has been loaded by the Security Account Manager. - 4622: A security package has been loaded by the Local Security Authority. - 4697: A service was installed in the system. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit Security System Extension." + compliance: + - cis: ["17.9.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"Security System Extension" -> r:Success' + + # 17.9.5 (L1) Ensure 'Audit System Integrity' is set to 'Success and Failure'. (Automated) + - id: 16128 + title: "Ensure 'Audit System Integrity' is set to 'Success and Failure'." + description: "This subcategory reports on violations of integrity of the security subsystem. Events for this subcategory include: - 4612 : Internal resources allocated for the queuing of audit messages have been exhausted, leading to the loss of some audits. - 4615 : Invalid use of LPC port. - 4618 : A monitored security event pattern has occurred. - 4816 : RPC detected an integrity violation while decrypting an incoming message. - 5038 : Code integrity determined that the image hash of a file is not valid. The file could be corrupt due to unauthorized modification or the invalid hash could indicate a potential disk device error. - 5056: A cryptographic self test was performed. - 5057: A cryptographic primitive operation failed. - 5060: Verification operation failed. - 5061: Cryptographic operation. - 5062: A kernel-mode cryptographic self test was performed. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit System Integrity." + compliance: + - cis: ["17.9.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol /get /subcategory:"System Integrity" -> r:Success and Failure' + + ############################################### + # 18 Administrative Templates (Computer) + ############################################### + ############################################### + # 18.1 Control Panel + ############################################### + + # 18.1.1.1 (L1) Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'. (Automated) + - id: 16129 + title: "Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'." + description: "Disables the lock screen camera toggle switch in PC Settings and prevents a camera from being invoked on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen camera extends the protection afforded by the lock screen to camera features." + impact: "If you enable this setting, users will no longer be able to enable or disable lock screen camera access in PC Settings, and the camera cannot be invoked on the lock screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen camera Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera -> 1' + + # 18.1.1.2 (L1) Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'. (Automated) + - id: 16130 + title: "Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'." + description: "Disables the lock screen slide show settings in PC Settings and prevents a slide show from playing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen slide show extends the protection afforded by the lock screen to slide show contents." + impact: "If you enable this setting, users will no longer be able to modify slide show settings in PC Settings, and no slide show will ever start." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen slide show Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow -> 1' + + # 18.1.2.2 (L1) Ensure 'Allow users to enable online speech recognition services' is set to 'Disabled'. (Automated) + - id: 16131 + title: "Ensure 'Allow users to enable online speech recognition services' is set to 'Disabled'." + description: "This policy enables the automatic learning component of input personalization that includes speech, inking, and typing. Automatic learning enables the collection of speech and handwriting patterns, typing history, contacts, and recent calendar information. It is required for the use of Cortana. Some of this collected information may be stored on the user's OneDrive, in the case of inking and typing; some of the information will be uploaded to Microsoft to personalize speech. The recommended state for this setting is: Disabled." + rationale: "If this setting is Enabled sensitive information could be stored in the cloud or sent to Microsoft." + impact: "Automatic learning of speech, inking, and typing stops and users cannot change its value via PC Settings." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Regional and Language Options\\Allow users to enable online speech recognition services Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow input personalization, but it was renamed to Allow users to enable online speech recognition services starting with the Windows 10 R1809 & Server 2019 Administrative Templates." + compliance: + - cis: ["18.1.2.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization -> AllowInputPersonalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization -> AllowInputPersonalization -> 0' + + # 18.1.3 (L2) Ensure 'Allow Online Tips' is set to 'Disabled'. (Automated) + - id: 16132 + title: "Ensure 'Allow Online Tips' is set to 'Disabled'." + description: "This policy setting configures the retrieval of online tips and help for the Settings app. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any third-party since this data could contain sensitive information." + impact: "Settings will not contact Microsoft content services to retrieve tips and help content." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Allow Online Tips Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanel.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.3"] + - cis_csc_v7: ["9.2", "9.3"] + - iso_27001-2013: ["A.13.1.1", "A.13.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> AllowOnlineTips' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> AllowOnlineTips -> 0' + + # 18.3.1 (L1) Ensure LAPS AdmPwd GPO Extension / CSE is installed (MS only). (Automated) + - id: 16133 + title: "Ensure LAPS AdmPwd GPO Extension / CSE is installed (MS only)." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. Note: Organizations that utilize third-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + impact: "No impact. When installed and registered properly, AdmPwd.dll takes no action unless given appropriate GPO commands during Group Policy refresh. It is not a memory-resident agent or service. In a disaster recovery scenario where Active Directory is not available, the local Administrator password will not be retrievable and a local password reset using a tool (such as Microsoft's Disaster and Recovery Toolset (DaRT) Recovery Image) may be necessary." + remediation: "In order to utilize LAPS, a minor Active Directory Schema update is required, and a Group Policy Client Side Extension (CSE) must be installed on each managed computer. When LAPS is installed, the file AdmPwd.dll must be present in the following location and registered in Windows (the LAPS AdmPwd GPO Extension / CSE installation does this for you): C:\\Program Files\\LAPS\\CSE\\AdmPwd.dll." + compliance: + - cis: ["18.3.1"] + - cis_csc_v8: ["5.2", "5.4"] + - cis_csc_v7: ["4.4", "16.2"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "IA.L2-3.5.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + + # 18.3.2 (L1) Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled' (MS only). (Automated) + - id: 16134 + title: "Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled' (MS only)." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize third-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + impact: 'Planned password expiration longer than password age dictated by "Password Settings" policy is NOT allowed.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Do not allow password expiration time longer than required by policy Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.3.2"] + - cis_csc_v7: ["16.10"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled -> 1' + + # 18.3.3 (L1) Ensure 'Enable Local Admin Password Management' is set to 'Enabled' (MS only). (Automated) + - id: 16135 + title: "Ensure 'Enable Local Admin Password Management' is set to 'Enabled' (MS only)." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + impact: "The local administrator password is managed (provided that the LAPS AdmPwd GPO Extension / CSE is installed on the target computer (see recommendation Ensure LAPS AdmPwd GPO Extension / CSE is installed), the Active Directory domain schema and account permissions have been properly configured on the domain). In a disaster recovery scenario where Active Directory is not available, the local Administrator password will not be retrievable and a local password reset using a tool (such as Microsoft's Disaster and Recovery Toolset (DaRT) Recovery Image) may be necessary." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Enable Local Admin Password Management Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.3.3"] + - cis_csc_v8: ["5.2", "5.4"] + - cis_csc_v7: ["4.4", "16.2"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "IA.L2-3.5.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled -> 1' + + # 18.3.4 (L1) Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters' (MS only). (Automated) + - id: 16136 + title: "Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters' (MS only)." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: Large letters + small letters + numbers + special characters. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + impact: "LAPS-generated passwords will be required to contain large letters + small letters + numbers + special characters." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Complexity option to Large letters + small letters + numbers + special characters: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.3.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity -> 4' + + # 18.3.5 (L1) Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more' (MS only). (Automated) + - id: 16137 + title: "Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more' (MS only)." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 15 or more. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + impact: "LAPS-generated passwords will be required to have a length of 15 characters (or more, if selected)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Length option to 15 or more: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.3.5"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> n:^(\d+) compare >= 15' + + # 18.3.6 (L1) Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer' (MS only). (Automated) + - id: 16138 + title: "Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer' (MS only)." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 30 or fewer. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + impact: "LAPS-generated passwords will be required to have a maximum age of 30 days (or fewer, if selected)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Age (Days) option to 30 or fewer: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.3.6"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["16.10"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> n:^(\d+) compare <= 30' + + # 18.4.1 (L1) Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled' (MS only). (Automated) + - id: 16139 + title: "Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled' (MS only)." + description: 'This setting controls whether local accounts can be used for remote administration via network logon (e.g., NET USE, connecting to C$, etc.). Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Enabling this policy significantly reduces that risk. Enabled: Applies UAC token-filtering to local accounts on network logons. Membership in powerful group such as Administrators is disabled and powerful privileges are removed from the resulting access token. This configures the LocalAccountTokenFilterPolicy registry value to 0. This is the default behavior for Windows. Disabled: Allows local accounts to have full administrative rights when authenticating via network logon, by configuring the LocalAccountTokenFilterPolicy registry value to 1. For more information about local accounts and credential theft, review the "Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques" documents. For more information about LocalAccountTokenFilterPolicy, see Microsoft Knowledge Base article 951016: Description of User Account Control and remote restrictions in Windows Vista. The recommended state for this setting is: Enabled.' + rationale: "Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Ensuring this policy is Enabled significantly reduces that risk." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Apply UAC restrictions to local accounts on network logons Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link." + compliance: + - cis: ["18.4.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy -> 0' + + # 18.4.2 (L1) Ensure 'Configure RPC packet level privacy setting for incoming connections' is set to 'Enabled'. (Automated) + - id: 16140 + title: "Ensure 'Configure RPC packet level privacy setting for incoming connections' is set to 'Enabled'." + description: "This policy setting controls packet level privacy for Remote Procedure Call (RPC) incoming connections. The recommended state for this setting is: Enabled." + rationale: "A security bypass vulnerability (CVE-2021-1678 | Windows Print Spooler Spoofing Vulnerability) exists in the way the Printer RPC binding handles authentication for the remote Winspool interface. Enabling the RPC packet level privacy setting for incoming connections enforces the server-side to increase the authentication level to minimize this vulnerability." + impact: "None - this is default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure RPC packet level privacy setting for incoming connections Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link." + references: + - "https://support.microsoft.com/en-us/topic/managing-deployment-of-printer-rpc-binding-changes-for-cve-2021-1678-kb4599464-12a69652-30b9-3d61-d9f7-7201623a8b25" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-1678" + compliance: + - cis: ["18.4.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print -> RpcAuthnLevelPrivacyEnabled' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print -> RpcAuthnLevelPrivacyEnabled -> 1' + + # 18.4.3 (L1) Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver (recommended)'. (Automated) + - id: 16141 + title: "Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver (recommended)'." + description: "This setting configures the start type for the Server Message Block version 1 (SMBv1) client driver service (MRxSmb10), which is recommended to be disabled. The recommended state for this setting is: Enabled: Disable driver (recommended). Note: Do not, under any circumstances, configure this overall setting as Disabled, as doing so will delete the underlying registry entry altogether, which will cause serious problems." + rationale: 'Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3. More information on this can be found at the following links: Stop using SMB1 | Storage at Microsoft Disable SMB v1 in Managed Environments with Group Policy - "Stay Safe" Cyber Security Blog Disabling SMBv1 through Group Policy - Microsoft Security Guidance blog.' + impact: "Some legacy OSes (e.g. Windows XP, Server 2003 or older), applications and appliances may no longer be able to communicate with the system once SMBv1 is disabled. We recommend careful testing be performed to determine the impact prior to configuring this as a widespread control, and where possible, remediate any incompatibilities found with the vendor of the incompatible system. Microsoft is also maintaining a thorough (although not comprehensive) list of known SMBv1 incompatibilities at this link: SMB1 Product Clearinghouse | Storage at Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable driver (recommended): Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 client driver Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link." + compliance: + - cis: ["18.4.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2", "14.3"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start -> 4' + + # 18.4.4 (L1) Ensure 'Configure SMB v1 server' is set to 'Disabled'. (Automated) + - id: 16142 + title: "Ensure 'Configure SMB v1 server' is set to 'Disabled'." + description: "This setting configures the server-side processing of the Server Message Block version 1 (SMBv1) protocol. The recommended state for this setting is: Disabled." + rationale: 'Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3. More information on this can be found at the following links: Stop using SMB1 | Storage at Microsoft Disable SMB v1 in Managed Environments with Group Policy - "Stay Safe" Cyber Security Blog Disabling SMBv1 through Group Policy - Microsoft Security Guidance blog.' + impact: "Some legacy OSes (e.g. Windows XP, Server 2003 or older), applications and appliances may no longer be able to communicate with the system once SMBv1 is disabled. We recommend careful testing be performed to determine the impact prior to configuring this as a widespread control, and where possible, remediate any incompatibilities found with the vendor of the incompatible system. Microsoft is also maintaining a thorough (although not comprehensive) list of known SMBv1 incompatibilities at this link: SMB1 Product Clearinghouse | Storage at Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 server Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link." + compliance: + - cis: ["18.4.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2", "14.3"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1 -> 0' + + # 18.4.5 (L1) Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled'. (Automated) + - id: 16143 + title: "Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled'." + description: "Windows includes support for Structured Exception Handling Overwrite Protection (SEHOP). We recommend enabling this feature to improve the security profile of the computer. The recommended state for this setting is: Enabled." + rationale: "This feature is designed to block exploits that use the Structured Exception Handler (SEH) overwrite technique. This protection mechanism is provided at run-time. Therefore, it helps protect applications regardless of whether they have been compiled with the latest improvements, such as the /SAFESEH option." + impact: "After you enable SEHOP, existing versions of Cygwin, Skype, and Armadillo-protected applications may not work correctly." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Enable Structured Exception Handling Overwrite Protection (SEHOP) Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link. More information is available at MSKB 956607: How to enable Structured Exception Handling Overwrite Protection (SEHOP) in Windows operating systems." + compliance: + - cis: ["18.4.5"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation -> 0' + + # 18.4.6 (L1) Ensure 'LSA Protection' is set to 'Enabled'. (Automated) + - id: 16144 + title: "Ensure 'LSA Protection' is set to 'Enabled'." + description: "This policy setting controls whether the Local Security Authority Server Service (LSASS) process runs protected. The Local Security Authority (LSA), which includes the Local Security Authority Server Service (LSASS) process, validates users for local and remote sign-ins and enforces local security policies. The recommended state for this setting is: Enabled. Note: This setting only applies to Windows Server 2012 R2 (and newer) except for Windows Server 2022 (and newer). See policy setting Configure LSASS to run as a protected process." + rationale: "The Windows Server 2012 R2 (and newer) provides additional protection for the LSA to prevent reading memory and code injection by non-protected processes. Enabling this setting provides added security for the credentials that LSA stores and manages." + impact: "If additional LSA protection is enabled, Administrators will not be able to debug a custom LSA plugin. A debugger cannot be attached to LSASS when it's a protected process. In general, there's no supported way to debug a running protected process." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\LSA Protection Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link." + references: + - "https://learn.microsoft.com/en-us/windows-server/security/credentials-protection-and-management/configuring-additional-lsa-protection" + compliance: + - cis: ["18.4.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RunAsPPL' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RunAsPPL -> 1' + + # 18.4.7 (L1) Ensure 'NetBT NodeType configuration' is set to 'Enabled: P-node (recommended)'. (Automated) + - id: 16145 + title: "Ensure 'NetBT NodeType configuration' is set to 'Enabled: P-node (recommended)'." + description: "This setting determines which method NetBIOS over TCP/IP (NetBT) uses to register and resolve names. The available methods are: - The B-node (broadcast) method only uses broadcasts. - The P-node (point-to-point) method only uses name queries to a name server (WINS). - The M-node (mixed) method broadcasts first, then queries a name server (WINS) if broadcast failed. - The H-node (hybrid) method queries a name server (WINS) first, then broadcasts if the query failed. The recommended state for this setting is: Enabled: P-node (recommended) (point-to-point). Note: Resolution through LMHOSTS or DNS follows these methods. If the NodeType registry value is present, it overrides any DhcpNodeType registry value. If neither NodeType nor DhcpNodeType is present, the computer uses B-node (broadcast) if there are no WINS servers configured for the network, or H-node (hybrid) if there is at least one WINS server configured." + rationale: "In order to help mitigate the risk of NetBIOS Name Service (NBT-NS) poisoning attacks, setting the node type to P-node (point-to-point) will prevent the system from sending out NetBIOS broadcasts." + impact: "NetBIOS name resolution queries will require a defined and available WINS server for external NetBIOS name resolution. If a WINS server is not defined or not reachable, and the desired hostname is not defined in the local cache, local LMHOSTS or HOSTS files, NetBIOS name resolution will fail." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: P-node (recommended): Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\NetBT NodeType configuration Note: This change does not take effect until the computer has been restarted. Note #2: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link. Please note that this setting is only available in the Security baseline (FINAL) for Windows 10 v1903 and Windows Server v1903 (or newer) release of SecGuide.admx/adml, so if you previously downloaded this template, you may need to update it from a newer Microsoft baseline to get this new NetBT NodeType configuration setting." + compliance: + - cis: ["18.4.7"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NodeType' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NodeType -> 2' + + # 18.4.8 (L1) Ensure 'WDigest Authentication' is set to 'Disabled'. (Automated) + - id: 16146 + title: "Ensure 'WDigest Authentication' is set to 'Disabled'." + description: 'When WDigest authentication is enabled, Lsass.exe retains a copy of the user''s plaintext password in memory, where it can be at risk of theft. If this setting is not configured, WDigest authentication is disabled in Windows 8.1 and in Windows Server 2012 R2; it is enabled by default in earlier versions of Windows and Windows Server. For more information about local accounts and credential theft, review the "Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques" documents. For more information about UseLogonCredential, see Microsoft Knowledge Base article 2871997: Microsoft Security Advisory Update to improve credentials protection and management May 13, 2014. The recommended state for this setting is: Disabled.' + rationale: "Preventing the plaintext storage of credentials in memory may reduce opportunity for credential theft." + impact: "None - this is also the default configuration for Server 2012 R2 or newer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\WDigest Authentication (disabling may require KB2871997) Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link." + compliance: + - cis: ["18.4.8"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential -> 0' + + # 18.5.1 (L1) Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled'. (Automated) + - id: 16147 + title: "Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled'." + description: "This setting is separate from the Welcome screen feature in Windows XP and Windows Vista; if that feature is disabled, this setting is not disabled. If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks to which the computer is connected. Also, if you enable automatic logon, the password is stored in the registry in plaintext, and the specific registry key that stores this value is remotely readable by the Authenticated Users group. For additional information, see Microsoft Knowledge Base article 324737: How to turn on automatic logon in Windows. The recommended state for this setting is: Disabled." + rationale: "If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks that the computer is connected to. Also, if you enable automatic logon, the password is stored in the registry in plaintext. The specific registry key that stores this setting is remotely readable by the Authenticated Users group. As a result, this entry is appropriate only if the computer is physically secured and if you ensure that untrusted users cannot remotely see the registry." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.1"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> 0' + + # 18.5.2 (L1) Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' (Automated) + - id: 16148 + title: "Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'." + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should follow through the network. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + impact: "All incoming source routed packets will be dropped." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + reference: + - "https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/" + compliance: + - cis: ["18.5.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting -> 2' + + # 18.5.3 (L1) Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' (Automated) + - id: 16149 + title: "Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'." + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should take through the network. It is recommended to configure this setting to Not Defined for enterprise environments and to Highest Protection for high security environments to completely disable source routing. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + impact: "All incoming source routed packets will be dropped." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + reference: + - "https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/" + compliance: + - cis: ["18.5.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting -> 2' + + # 18.5.4 (L1) Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'. (Automated) + - id: 16150 + title: "Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'." + description: "Internet Control Message Protocol (ICMP) redirects cause the IPv4 stack to plumb host routes. These routes override the Open Shortest Path First (OSPF) generated routes. The recommended state for this setting is: Disabled." + rationale: "This behavior is expected. The problem is that the 10 minute time-out period for the ICMP redirect-plumbed routes temporarily creates a network situation in which traffic will no longer be routed properly for the affected host. Ignoring such ICMP redirects will limit the system's exposure to attacks that will impact its ability to participate on the network." + impact: "When Routing and Remote Access Service (RRAS) is configured as an autonomous system boundary router (ASBR), it does not correctly import connected interface subnet routes. Instead, this router injects host routes into the OSPF routes. However, the OSPF router cannot be used as an ASBR router, and when connected interface subnet routes are imported into OSPF the result is confusing routing tables with strange routing paths." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect -> 0' + + # 18.5.5 (L2) Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes (recommended)'. (Automated) + - id: 16151 + title: "Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes (recommended)'." + description: "This value controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet. If the remote computer is still reachable, it acknowledges the keep-alive packet. The recommended state for this setting is: Enabled: 300,000 or 5 minutes (recommended)." + rationale: "An attacker who is able to connect to network applications could establish numerous connections to cause a DoS condition." + impact: "Keep-alive packets are not sent by default by Windows. However, some applications may configure the TCP stack flag that requests keep-alive packets. For such configurations, you can lower this value from the default setting of two hours to five minutes to disconnect inactive sessions more quickly." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 300,000 or 5 minutes (recommended): Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> 300000' + + # 18.5.6 (L1) Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'. (Automated) + - id: 16152 + title: "Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'." + description: "NetBIOS over TCP/IP is a network protocol that among other things provides a way to easily resolve NetBIOS names that are registered on Windows-based systems to the IP addresses that are configured on those systems. This setting determines whether the computer releases its NetBIOS name when it receives a name-release request. The recommended state for this setting is: Enabled." + rationale: "The NetBT protocol is designed not to use authentication, and is therefore vulnerable to spoofing. Spoofing makes a transmission appear to come from a user other than the user who performed the action. A malicious user could exploit the unauthenticated nature of the protocol to send a name-conflict datagram to a target computer, which would cause the computer to relinquish its name and not respond to queries. An attacker could send a request over the network and query a computer to release its NetBIOS name. As with any change that could affect applications, it is recommended that you test this change in a non-production environment before you change the production environment. The result of such an attack could be to cause intermittent connectivity issues on the target computer, or even to prevent the use of Network Neighborhood, domain logons, the NET SEND command, or additional NetBIOS name resolution." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.6"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand -> 1' + + # 18.5.7 (L2) Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'. (Automated) + - id: 16153 + title: "Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'." + description: "This setting is used to enable or disable the Internet Router Discovery Protocol (IRDP), which allows the system to detect and configure default gateway addresses automatically as described in RFC 1256 on a per-interface basis. The recommended state for this setting is: Disabled." + rationale: "An attacker who has gained control of a computer on the same network segment could configure a computer on the network to impersonate a router. Other computers with IRDP enabled would then attempt to route their traffic through the already compromised computer." + impact: "Windows will not automatically detect and configure default gateway addresses on the computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> 0' + + # 18.5.8 (L1) Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'. (Automated) + - id: 16154 + title: "Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'." + description: "The DLL search order can be configured to search for DLLs that are requested by running processes in one of two ways: - Search folders specified in the system path first, and then search the current working folder. - Search current working folder first, and then search the folders specified in the system path. When enabled, the registry value is set to 1. With a setting of 1, the system first searches the folders that are specified in the system path and then searches the current working folder. When disabled the registry value is set to 0 and the system first searches the current working folder and then searches the folders that are specified in the system path. Applications will be forced to search for DLLs in the system path first. For applications that require unique versions of these DLLs that are included with the application, this entry could cause performance or stability problems. The recommended state for this setting is: Enabled. Note: More information on how Safe DLL search mode works is available at this link: Dynamic-Link Library Search Order - Windows applications | Microsoft Docs." + rationale: "If a user unknowingly executes hostile code that was packaged with additional files that include modified versions of system DLLs, the hostile code could load its own versions of those DLLs and potentially increase the type and degree of damage the code can render." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.8"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode -> 1' + + # 18.5.9 Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds' (Automated) + - id: 16155 + title: "Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds'." + description: "Windows includes a grace period between when the screen saver is launched and when the console is actually locked automatically when screen saver locking is enabled. The recommended state for this setting is: Enabled: 5 or fewer seconds." + rationale: "The default grace period that is allowed for user movement before the screen saver lock takes effect is five seconds. If you leave the default grace period configuration, your computer is vulnerable to a potential attack from someone who could approach the console and attempt to log on to the computer before the lock takes effect. An entry to the registry can be made to adjust the length of the grace period." + impact: "Users will have to enter their passwords to resume their console sessions as soon as the grace period ends after screen saver activation." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 5 or fewer seconds: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.9"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> n:^(\d+) compare <= 5' + + # 18.5.10 (L2) Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'. (Automated) + - id: 16156 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'." + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + impact: "TCP starts a retransmission timer when each outbound segment is passed to the IP. If no acknowledgment is received for the data in a given segment before the timer expires, then the segment is retransmitted up to three times." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.10"] + - cis_csc_v8: ["4.2"] + - cis_csc_v7: ["11.1"] + - cmmc_v2.0: ["CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.3", "CM.L2-3.4.6", "CM.L2-3.4.7", "SC.L2-3.13.6"] + - nist_sp_800-53: ["AC-18(1)", "AC-18(3)", "CM-2", "CM-6", "CM-7", "CM-7(1)", "CM-9"] + - pci_dss_v3.2.1: ["1.1.1", "1.2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.4.2", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' + + # 18.5.11 (L2) Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'. (Automated) + - id: 16157 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'." + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + impact: "TCP starts a retransmission timer when each outbound segment is passed to the IP. If no acknowledgment is received for the data in a given segment before the timer expires, then the segment is retransmitted up to three times." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.11"] + - cis_csc_v7: ["9.2"] + - iso_27001-2013: ["A.13.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' + + # 18.5.12 (L1) Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less' (Automated) + - id: 16158 + title: "Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less'." + description: "This setting can generate a security audit in the Security event log when the log reaches a user-defined threshold. The recommended state for this setting is: Enabled: 90% or less. Note: If log settings are configured to Overwrite events as needed or Overwrite events older than x days, this event will not be generated." + rationale: "If the Security log reaches 90 percent of its capacity and the computer has not been configured to overwrite events as needed, more recent events will not be written to the log. If the log reaches its capacity and the computer has been configured to shut down when it can no longer record events to the Security log, the computer will shut down and will no longer be available to provide network services." + impact: "An audit event will be generated when the Security log reaches the 90% percent full threshold (or whatever lower value may be set) unless the log is configured to overwrite events as needed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 90% or less: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.12"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.3", "6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> n:^(\d+) compare <= 90' + + # 18.6.4.1 (L1) Ensure 'Configure NetBIOS settings' is set to 'Enabled: Disable NetBIOS name resolution on public networks'. (Automated) + - id: 16159 + title: "Ensure 'Configure NetBIOS settings' is set to 'Enabled: Disable NetBIOS name resolution on public networks'." + description: "This policy setting specifies if the Domain Name System (DNS) client will perform name resolution over Network Basic Input/Output System (NetBIOS). NetBIOS is a legacy name resolution method for internal Microsoft networking that predates the use of DNS for that purpose (pre-Active Directory). Some legacy applications still require the use of NetBIOS for full functionality. The recommended state for this setting is: Enabled: Disable NetBIOS name resolution on public networks. Configuring this setting to Enabled: Disable NetBIOS name resolution also conforms to the benchmark." + rationale: 'NetBIOS does not perform authentication and can allow remote attackers to cause a denial of service by sending spoofed Name Conflicts or Name Release datagrams. This is also known as "NetBIOS Name Server Protocol Spoofing". Preventing the use of NetBIOS on public networks reduces the attack surface.' + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable NetBIOS name resolution on public networks: Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Configure NetBIOS settings." + compliance: + - cis: ["18.6.4.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableNetbios' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableNetbios -> 1' + + # 18.6.4.2 (L1) Ensure 'Turn off multicast name resolution' is set to 'Enabled'. (Automated) + - id: 16160 + title: "Ensure 'Turn off multicast name resolution' is set to 'Enabled'." + description: "LLMNR is a secondary name resolution protocol. With LLMNR, queries are sent using multicast over a local network link on a single subnet from a client computer to another client computer on the same subnet that also has LLMNR enabled. LLMNR does not require a DNS server or DNS client configuration, and provides name resolution in scenarios in which conventional DNS name resolution is not possible. The recommended state for this setting is: Enabled." + rationale: "An attacker can listen on a network for these LLMNR (UDP/5355) or NBT-NS (UDP/137) broadcasts and respond to them, tricking the host into thinking that it knows the location of the requested system. Note: To completely mitigate local name resolution poisoning, in addition to this setting, the properties of each installed NIC should also be set to Disable NetBIOS over TCP/IP (on the WINS tab in the NIC properties). Unfortunately, there is no global setting to achieve this that automatically applies to all NICs - it is a per-NIC setting that varies with different NIC hardware installations." + impact: "In the event DNS is unavailable a system will be unable to request it from other systems on the same subnet." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Turn off multicast name resolution Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DnsClient.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.6.4.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast -> 1' + + # 18.6.5.1 (L2) Ensure 'Enable Font Providers' is set to 'Disabled'. (Automated) + - id: 16161 + title: "Ensure 'Enable Font Providers' is set to 'Disabled'." + description: "This policy setting determines whether Windows is allowed to download fonts and font catalog data from an online font provider. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment the IT department should be managing the changes to the system configuration, to ensure all changes are tested and approved." + impact: "Windows will not connect to an online font provider and will only enumerate locally-installed fonts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Fonts\\Enable Font Providers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.6.5.1"] + - cis_csc_v8: ["16.5"] + - cis_csc_v7: ["18.4"] + - pci_dss_v3.2.1: ["6.2"] + - pci_dss_v4.0: ["12.3.4", "6.3.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableFontProviders' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableFontProviders -> 0' + + # 18.6.8.1 (L1) Ensure 'Enable insecure guest logons' is set to 'Disabled'. (Automated) + - id: 16162 + title: "Ensure 'Enable insecure guest logons' is set to 'Disabled'." + description: "This policy setting determines if the SMB client will allow insecure guest logons to an SMB server. The recommended state for this setting is: Disabled." + rationale: "Insecure guest logons are used by file servers to allow unauthenticated access to shared folders." + impact: "The SMB client will reject insecure guest logons. This was not originally the default behavior in older versions of Windows, but Microsoft changed the default behavior starting with Windows Server 2016 R1709: Guest access in SMB2 disabled by default in Windows 10 and Windows Server 2016." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Lanman Workstation\\Enable insecure guest logons Note: This Group Policy path may not exist by default. It is provided by the Group Policy template LanmanWorkstation.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.6.8.1"] + - cis_csc_v7: ["9.2"] + - iso_27001-2013: ["A.13.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation -> AllowInsecureGuestAuth' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation -> AllowInsecureGuestAuth -> 0' + + # 18.6.9.1 (L2) Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'. (Automated) + - id: 16163 + title: "Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'." + description: "This policy setting changes the operational behavior of the Mapper I/O network protocol driver. LLTDIO allows a computer to discover the topology of a network it's connected to. It also allows a computer to initiate Quality-of-Service requests such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Mapper I/O (LLTDIO) driver Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.9.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitLLTDIOOnPrivateNet -> 0' + + # 18.6.9.2 (L2) Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'. (Automated) + - id: 16164 + title: "Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'." + description: "This policy setting changes the operational behavior of the Responder network protocol driver. The Responder allows a computer to participate in Link Layer Topology Discovery requests so that it can be discovered and located on the network. It also allows a computer to participate in Quality-of-Service activities such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Responder (RSPNDR) driver Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.9.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitRspndrOnPrivateNet -> 0' + + # 18.6.10.2 (L2) Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'. (Automated) + - id: 16165 + title: "Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'." + description: "The Peer Name Resolution Protocol (PNRP) allows for distributed resolution of a name to an IPv6 address and port number. The protocol operates in the context of clouds. A cloud is a set of peer computers that can communicate with each other by using the same IPv6 scope. Peer-to-Peer protocols allow for applications in the areas of RTC, collaboration, content distribution and distributed processing. The recommended state for this setting is: Enabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to peer-to-peer networking." + impact: "Microsoft Peer-to-Peer Networking Services are turned off in their entirety, and all applications dependent on them will stop working." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Microsoft Peer-to-Peer Networking Services\\Turn off Microsoft Peer-to-Peer Networking Services Note: This Group Policy path is provided by the Group Policy template P2P - pnrp.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.10.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> 1' + + # 18.6.11.2 (L1) Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'. (Automated) + - id: 16166 + title: "Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'." + description: "You can use this procedure to control a user's ability to install and configure a Network Bridge. The recommended state for this setting is: Enabled." + rationale: "The Network Bridge setting, if enabled, allows users to create a Layer 2 Media Access Control (MAC) bridge, enabling them to connect two or more physical network segments together. A Network Bridge thus allows a computer that has connections to two different networks to share data between those networks. In an enterprise managed environment, where there is a need to control network traffic to only authorized paths, allowing users to create a Network Bridge increases the risk and attack surface from the bridged network." + impact: "Users cannot create or configure a Network Bridge." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit installation and configuration of Network Bridge on your DNS domain network Note: This Group Policy path is provided by the Group Policy template NetworkConnections.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.11.2"] + - cis_csc_v8: ["4.8", "12.2"] + - cis_csc_v7: ["11.3"] + - cmmc_v2.0: ["AC.L1-3.1.2", "AC.L1-3.1.20", "AC.L1-3.1.22", "AC.L2-3.1.14", "AC.L2-3.1.16", "AC.L2-3.1.17", "AC.L2-3.1.3", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.5", "SC.L2-3.13.2", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["CP-6", "CP-7", "PL-8"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "1.2.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "1.3.1", "1.3.2", "1.3.3", "1.4.4", "11.4.5", "2.2.4", "6.4.1", "7.1", "7.2.5.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA -> 0' + + # 18.6.11.3 (L1) Ensure 'Prohibit use of Internet Connection Sharing on your DNS domain network' is set to 'Enabled'. (Automated) + - id: 16167 + title: "Ensure 'Prohibit use of Internet Connection Sharing on your DNS domain network' is set to 'Enabled'." + description: 'Although this "legacy" setting traditionally applied to the use of Internet Connection Sharing (ICS) in Windows 2000, Windows XP & Server 2003, this setting now freshly applies to the Mobile Hotspot feature in Windows 10 & Server 2016. The recommended state for this setting is: Enabled.' + rationale: "Non-administrators should not be able to turn on the Mobile Hotspot feature and open their Internet connectivity up to nearby mobile devices." + impact: "Mobile Hotspot cannot be enabled or configured by Administrators and non-Administrators alike." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit use of Internet Connection Sharing on your DNS domain network Note: This Group Policy path is provided by the Group Policy template NetworkConnections.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.11.3"] + - cis_csc_v8: ["4.8", "12.2"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.2", "AC.L1-3.1.20", "AC.L1-3.1.22", "AC.L2-3.1.14", "AC.L2-3.1.16", "AC.L2-3.1.17", "AC.L2-3.1.3", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.5", "SC.L2-3.13.2", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CP-6", "CP-7", "PL-8"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "1.2.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "1.3.1", "1.3.2", "1.3.3", "1.4.4", "11.4.5", "2.2.4", "6.4.1", "7.1", "7.2.5.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_ShowSharedAccessUI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_ShowSharedAccessUI -> 1' + + # 18.6.11.4 (L1) Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'. (Automated) + - id: 16168 + title: "Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'." + description: "This policy setting determines whether to require domain users to elevate when setting a network's location. The recommended state for this setting is: Enabled." + rationale: "Allowing regular users to set a network location increases the risk and attack surface." + impact: "Domain users must elevate when setting a network's location." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Require domain users to elevate when setting a network's location Note: This Group Policy path may not exist by default. It is provided by the Group Policy template NetworkConnections.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.6.11.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation -> 1' + + # 18.6.14.1 (L1) Ensure 'Hardened UNC Paths' is set to 'Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares' (Automated) + - id: 16169 + title: 'Ensure ''Hardened UNC Paths'' is set to ''Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares''.' + description: 'This policy setting configures secure access to UNC paths. The recommended state for this setting is: Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares. Note: If the environment exclusively contains Windows 8.0 / Server 2012 (non-R2) or newer systems, then the "Privacy" setting may (optionally) also be set to enable SMB encryption. However, using SMB encryption will render the targeted share paths completely inaccessible by older OSes, so only use this additional option with caution and thorough testing.' + rationale: "In February 2015, Microsoft released a new control mechanism to mitigate a security risk in Group Policy as part of the MS15-011 / MSKB 3000483 security update. This mechanism requires both the installation of the new security update and also the deployment of specific group policy settings to all computers on the domain from Windows Vista / Server 2008 (non-R2) or newer (the associated security patch to enable this feature was not released for Server 2003). A new group policy template (NetworkProvider.admx/adml) was also provided with the security update. Once the new GPO template is in place, the following are the minimum requirements to remediate the Group Policy security risk: \\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Note: A reboot may be required after the setting is applied to a client machine to access the above paths. Additional guidance on the deployment of this security setting is available from the Microsoft Premier Field Engineering (PFE) Platforms TechNet Blog here: Guidance on Deployment of MS15-011 and MS15-014." + impact: "Windows only allows access to the specified UNC paths after fulfilling additional security requirements." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with the following paths configured, at a minimum: \\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Provider\\Hardened UNC Paths Note: This Group Policy path does not exist by default. An additional Group Policy template (NetworkProvider.admx/adml) is required - it is included with the MS15-011 / MSKB 3000483 security update or with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.6.14.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\NETLOGON -> r:RequireMutualAuthentication=1 && r:RequireIntegrity=1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\SYSVOL -> r:RequireMutualAuthentication=1 && r:RequireIntegrity=1' + + # 18.6.19.2.1 (L2) Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)'). (Automated) + - id: 16170 + title: "Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')." + description: "Internet Protocol version 6 (IPv6) is a set of protocols that computers use to exchange information over the Internet and over home and business networks. IPv6 allows for many more IP addresses to be assigned than IPv4 did. Older networking, hosts and operating systems may not support IPv6 natively. The recommended state for this setting is: DisabledComponents - 0xff (255)." + rationale: "Since the vast majority of private enterprise managed networks have no need to utilize IPv6 (because they have access to private IPv4 addressing), disabling IPv6 components removes a possible attack surface that is also harder to monitor the traffic on. As a result, we recommend configuring IPv6 to a Disabled state when it is not needed." + impact: "Connectivity to other systems using IPv6 will no longer operate, and software that depends on IPv6 will cease to function. Examples of Microsoft applications that may use IPv6 include: Remote Assistance, HomeGroup, DirectAccess, Windows Mail. This registry change is documented in Microsoft Knowledge Base article 929852: How to disable IPv6 or its components in Windows. Note: This registry change does not take effect until the next reboot." + remediation: "To establish the recommended configuration, set the following Registry value to 0xff (255) (DWORD): HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TCPIP6\\Parameters:Disabl edComponents Note: This change does not take effect until the computer has been restarted. Note #2: Although Microsoft does not provide an ADMX template to configure this registry value, a custom .ADM template (Disable-IPv6-Components-KB929852.adm) is provided in the CIS Benchmark Remediation Kit to facilitate its configuration. Be aware though that simply turning off the group policy setting in the .ADM template will not \"undo\" the change once applied. Instead, the opposite setting must be applied to change the registry value to the opposite state." + compliance: + - cis: ["18.6.19.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> 255' + + # 18.6.20.1 (L2) Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'. (Automated) + - id: 16171 + title: "Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'." + description: "This policy setting allows the configuration of wireless settings using Windows Connect Now (WCN). The WCN Registrar enables the discovery and configuration of devices over Ethernet (UPnP) over in-band 802.11 Wi-Fi through the Windows Portable Device API (WPD) and via USB Flash drives. Additional options are available to allow discovery and configuration over a specific medium. The recommended state for this setting is: Disabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to user configuration of wireless settings." + impact: "WCN operations are disabled over all media." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Configuration of wireless settings using Windows Connect Now Note: This Group Policy path is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.20.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["15.4", "15.5"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.8.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> 0' + + # 18.6.20.2 (L2) Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'. (Automated) + - id: 16172 + title: "Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'." + description: "This policy setting prohibits access to Windows Connect Now (WCN) wizards. The recommended state for this setting is: Enabled." + rationale: "Allowing standard users to access the Windows Connect Now wizard increases the risk and attack surface." + impact: 'The WCN wizards are turned off and users have no access to any of the wizard tasks. All the configuration related tasks including "Set up a wireless router or access point" and "Add a wireless device" are disabled.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Prohibit access of the Windows Connect Now wizards Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.6.20.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> 1' + + # 18.6.21.1 (L1) Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled: 1 = Minimize simultaneous connections' (Automated) + - id: 16173 + title: "Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled: 1 = Minimize simultaneous connections'." + description: "This policy setting prevents computers from establishing multiple simultaneous connections to either the Internet or to a Windows domain. The recommended state for this setting is: Enabled: 1 = Minimize simultaneous connections." + rationale: "Preventing bridged network connections can help prevent a user unknowingly allowing traffic to route between internal and external networks, which risks exposure to sensitive internal data." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 = Minimize simultaneous connections: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Minimize the number of simultaneous connections to the Internet or a Windows Domain Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WCM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates. It was updated with a new Minimize Policy Options sub-setting starting with the Windows 10 Release 1903 Administrative Templates." + compliance: + - cis: ["18.6.21.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["15.5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.2"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections -> 1' + + # 18.6.21.2 (L2) Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled' (MS only). (Automated) + - id: 16174 + title: "Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled' (MS only)." + description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time. The recommended state for this setting is: Enabled." + rationale: "The potential concern is that a user would unknowingly allow network traffic to flow between the insecure public network and the enterprise managed network." + impact: "The computer responds to automatic and manual network connection attempts based on the following circumstances: Automatic connection attempts - When the computer is already connected to a domain based network, all automatic connection attempts to non-domain networks are blocked. - When the computer is already connected to a non-domain based network, automatic connection attempts to domain based networks are blocked. Manual connection attempts - When the computer is already connected to either a non-domain based network or a domain based network over media other than Ethernet, and a user attempts to create a manual connection to an additional network in violation of this policy setting, the existing network connection is disconnected and the manual connection is allowed. - When the computer is already connected to either a non-domain based network or a domain based network over Ethernet, and a user attempts to create a manual connection to an additional network in violation of this policy setting, the existing Ethernet connection is maintained and the manual connection attempt is blocked." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Prohibit connection to non-domain networks when connected to domain authenticated network Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WCM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.6.21.2"] + - cis_csc_v7: ["12.4"] + - iso_27001-2013: ["A.13.1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain -> 1' + + # 18.7.1 (L1) Ensure 'Allow Print Spooler to accept client connections' is set to 'Disabled'. (Automated) + - id: 16175 + title: "Ensure 'Allow Print Spooler to accept client connections' is set to 'Disabled'." + description: "This policy setting controls whether the Print Spooler service will accept client connections. The recommended state for this setting is: Disabled. Note: The Print Spooler service must be restarted for changes to this policy to take effect. Warning: An exception to this recommendation must be made for print servers in order for them to function properly. Users will not be able to print to the server when client connections are disabled." + rationale: "Disabling the ability for the Print Spooler service to accept client connections mitigates remote attacks against the PrintNightmare vulnerability (CVE-2021-34527) and other remote Print Spooler attacks. However, this recommendation does not mitigate against local attacks on the Print Spooler service." + impact: "Provided that the Print Spooler service is not disabled, applications on and users logged in to servers will continue to be able to print from the server. However, the Print Spooler service will not accept client connections or allow users to share printers. Note that all printers that were already shared will continue to be shared. Warning: An exception to this recommendation must be made for print servers in order for them to function properly. Users will not be able to print to the server when client connections are disabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Printers:Allow Print Spooler to accept client connections Note: This Group Policy path is provided by the Group Policy template Printing2.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + references: + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527" + compliance: + - cis: ["18.7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RegisterSpoolerRemoteRpcEndPoint' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RegisterSpoolerRemoteRpcEndPoint -> 0' + + # 18.7.2 (L1) Ensure 'Configure Redirection Guard' is set to 'Enabled: Redirection Guard Enabled'. (Automated) + - id: 16176 + title: "Ensure 'Configure Redirection Guard' is set to 'Enabled: Redirection Guard Enabled'." + description: "This policy setting determines whether Redirection Guard is enabled for the print spooler. Redirection Guard can prevent file redirections from being used within the print spooler. The recommended state for this setting is: Enabled: Redirection Guard Enabled." + rationale: "This setting prevents non-administrators from redirecting files within the print spooler process." + impact: "None - this is default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Redirection Guard Enabled: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Configure Redirection Guard Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + references: + - "https://techcommunity.microsoft.com/t5/microsoft-security-baselines/windows-11-version-22h2-security-baseline/ba-p/3632520" + compliance: + - cis: ["18.7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RedirectionguardPolicy' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RedirectionguardPolicy -> 1' + + # 18.7.3 (L1) Ensure 'Configure RPC connection settings: Protocol to use for outgoing RPC connections' is set to 'Enabled: RPC over TCP'. (Automated) + - id: 16177 + title: "Ensure 'Configure RPC connection settings: Protocol to use for outgoing RPC connections' is set to 'Enabled: RPC over TCP'." + description: "This policy setting controls which protocol and protocol settings to use for outgoing Remote Procedure Call (RPC) connections to a remote print spooler. The recommended state for this setting is: Enabled: RPC over TCP." + rationale: "This setting prevents the use of named pipes for RPC connections to the print spooler and forces the use of TCP which is a more secure communication method." + impact: "Warning: Many existing print configurations may be using the older named pipes protocol and therefore will cease to function." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: RPC over TCP: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Configure RPC connection settings: Protocol to use for outgoing RPC connections Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + references: + - "https://learn.microsoft.com/en-us/troubleshoot/windows-client/printing/windows-11-rpc-connection-updates-for-print#allow-rpc-over-tcp-communication" + compliance: + - cis: ["18.7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC -> RpcUseNamedPipeProtocol' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC -> RpcUseNamedPipeProtocol -> 1' + + # 18.7.4 (L1) Ensure 'Configure RPC connection settings: Use authentication for outgoing RPC connections' is set to 'Enabled: Default'. (Automated) + - id: 16178 + title: "Ensure 'Configure RPC connection settings: Use authentication for outgoing RPC connections' is set to 'Enabled: Default'." + description: "This policy setting controls which protocol and protocol settings to use for outgoing Remote Procedure Call (RPC) connections to a remote print spooler. The recommended state for this setting is: Enabled: Default." + rationale: "This setting can prevent the use of named pipes for RPC connections to the print spooler and forces the use of TCP which is a more secure communication method." + impact: "Warning: Many existing print configurations may be using the older named pipes protocol and therefore will cease to function." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Default: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Configure RPC connection settings: Use authentication for outgoing RPC connections Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + references: + - "https://learn.microsoft.com/en-us/troubleshoot/windows-client/printing/windows-11-rpc-connection-updates-for-print#allow-rpc-over-tcp-communication" + compliance: + - cis: ["18.7.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC -> RpcAuthentication' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC -> RpcAuthentication -> 1' + + # 18.7.5 (L1) Ensure 'Configure RPC listener settings: Protocols to allow for incoming RPC connections' is set to 'Enabled: RPC over TCP'. (Automated) + - id: 16179 + title: "Ensure 'Configure RPC listener settings: Protocols to allow for incoming RPC connections' is set to 'Enabled: RPC over TCP'." + description: "This policy setting controls which protocols incoming Remote Procedure Call (RPC) connections to the print spooler are allowed to use. The recommended state for this setting is: Enabled: RPC over TCP." + rationale: "This setting can prevent the use of named pipes for RPC connections to the print spooler and forces the use of TCP which is a more secure communication method." + impact: "Warning: Many existing print configurations may be using the older named pipes protocol and therefore will cease to function." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: RCP over TCP: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Configure RPC listener settings: Configure protocol options for incoming RPC connections Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + compliance: + - cis: ["18.7.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC -> RpcProtocols' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC -> RpcProtocols -> 1' + + # 18.7.6 (L1) Ensure 'Configure RPC listener settings: Authentication protocol to use for incoming RPC connections:' is set to 'Enabled: Negotiate' or higher (Automated) + - id: 16180 + title: "Ensure 'Configure RPC listener settings: Authentication protocol to use for incoming RPC connections:' is set to 'Enabled: Negotiate' or higher." + description: "This policy setting controls which protocols incoming Remote Procedure Call (RPC) connections to the print spooler are allowed to use. The recommended state for this setting is: Enabled: Negotiate or higher." + rationale: "This setting can prevent the use of named pipes for RPC connections to the print spooler and forces the use of TCP which is a more secure communication method." + impact: "Warning: Many existing print configurations may be using the older named pipes protocol and therefore will cease to function." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Negotiate or higher: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Configure RPC listener settings: Configure protocol options for incoming RPC connections Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + compliance: + - cis: ["18.7.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC -> ForceKerberosForRpc' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC -> ForceKerberosForRpc -> 1' + + # 18.7.7 (L1) Ensure 'Configure RPC over TCP port' is set to 'Enabled: 0'. (Automated) + - id: 16181 + title: "Ensure 'Configure RPC over TCP port' is set to 'Enabled: 0'." + description: "This policy setting controls which port is used for RPC over TCP for incoming connections to the print spooler and outgoing connections to remote print spoolers. The recommended state for this setting is: Enabled: 0." + rationale: "Using dynamic ports for printing makes it more difficult for an attacker to know which port is being used and therefore which port to attack." + impact: "If your current print environment is configured for a specific TCP port, this setting may require a firewall change (if applicable) for continued printing." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 0: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Configure RPC over TCP port Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + compliance: + - cis: ["18.7.7"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC -> RpcTcpPort' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\RPC -> RpcTcpPort -> 0' + + # 18.7.8 (L1) Ensure 'Limits print driver installation to Administrators' is set to 'Enabled'. (Automated) + - id: 16182 + title: "Ensure 'Limits print driver installation to Administrators' is set to 'Enabled'." + description: "This policy setting controls whether users who aren't Administrators can install print drivers on the system. The recommended state for this setting is: Enabled. Note: On August 10, 2021, Microsoft announced a Point and Print Default Behavior Change which modifies the default Point and Print driver installation and update behavior to require Administrator privileges. This is documented in KB5005652 - Manage new Point and Print default driver installation behavior (CVE-2021-34481)." + rationale: "Restricting the installation of print drives to Administrators can help mitigate the PrintNightmare vulnerability (CVE-2021-34527) and other Print Spooler attacks." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Administrative Templates\\Printers\\Limits print driver installation to Administrators Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (and newer)." + references: + - "https://support.microsoft.com/en-us/topic/kb5005010-restricting-installation-of-new-printer-drivers-after-applying-the-july-6-2021-updates-31b91c02-05bc-4ada-a7ea-183b129578a7" + - "https://support.microsoft.com/en-gb/topic/kb5005652-manage-new-point-and-print-default-driver-installation-behavior-cve-2021-34481-873642bf-2634-49c5-a23b-6d8e9a302872" + compliance: + - cis: ["18.7.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> RestrictDriverInstallationToAdministrators' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> RestrictDriverInstallationToAdministrators -> 1' + + # 18.7.9 (L1) Ensure 'Manage processing of Queue-specific files' is set to 'Enabled: Limit Queue-specific files to Color profiles'. (Automated) + - id: 16183 + title: "Ensure 'Manage processing of Queue-specific files' is set to 'Enabled: Limit Queue-specific files to Color profiles'." + description: "This policy setting manages how queue-specific files are processed during printer installation. At printer installation time, a vendor-supplied installation application can specify a set of files, of any type, to be associated with a particular print queue. The files are downloaded to each client that connects to the print server. The recommended state for this setting is: Enabled: Limit Queue-specific files to Color profiles." + rationale: "A Windows Print Spooler Remote Code Execution Vulnerability (CVE-2021-36958) exists when the Windows Print Spooler service improperly performs privileged file operations. An attacker who successfully exploits this vulnerability could run arbitrary code with SYSTEM privileges and then install programs; view, change, or delete data; or create new accounts with full user rights." + impact: "None - this is default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Limit Queue-specific files to Color profiles: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Manage processing of Queue-specific files Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + references: + - "https://learn.microsoft.com/en-us/windows-hardware/drivers/print/installing-queue-specific-files" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-36958" + compliance: + - cis: ["18.7.9"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> CopyFilesPolicy' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> CopyFilesPolicy -> 1' + + # 18.7.10 (L1) Ensure 'Point and Print Restrictions: When installing drivers for a new connection' is set to 'Enabled: Show warning and elevation prompt'. (Automated) + - id: 16184 + title: "Ensure 'Point and Print Restrictions: When installing drivers for a new connection' is set to 'Enabled: Show warning and elevation prompt'." + description: "This policy setting controls whether computers will show a warning and a security elevation prompt when users create a new printer connection using Point and Print. The recommended state for this setting is: Enabled: Show warning and elevation prompt. Note: On August 10, 2021, Microsoft announced a Point and Print Default Behavior Change which modifies the default Point and Print driver installation and update behavior to require Administrator privileges. This is documented in KB5005652 - Manage new Point and Print default driver installation behavior (CVE-2021-34481). This change overrides all Point and Print Group Policy settings and ensures that only Administrators can install printer drivers from a print server using Point and Print." + rationale: "Enabling Windows User Account Control (UAC) for the installation of new print drivers can help mitigate the PrintNightmare vulnerability (CVE-2021-34527) and other Print Spooler attacks. Although the Point and Print default driver installation behavior overrides this setting, it is important to configure this as a backstop in the event that behavior is reversed." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Show warning and elevation prompt: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Point and Print Restrictions: When installing drivers for a new connection Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + references: + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-1675" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34481" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-36958" + - "https://msrc-blog.microsoft.com/2021/08/10/point-and-print-default-behavior-change/" + - "https://support.microsoft.com/en-us/topic/kb5005652-manage-new-point-and-print-default-driver-installation-behavior-cve-2021-34481-873642bf-2634-49c5-a23b-6d8e9a302872" + compliance: + - cis: ["18.7.10"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> NoWarningNoElevationOnInstall' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> NoWarningNoElevationOnInstall -> 1' + + # 18.7.11 (L1) Ensure 'Point and Print Restrictions: When updating drivers for an existing connection' is set to 'Enabled: Show warning and elevation prompt'. (Automated) + - id: 16185 + title: "Ensure 'Point and Print Restrictions: When updating drivers for an existing connection' is set to 'Enabled: Show warning and elevation prompt'." + description: "This policy setting controls whether computers will show a warning and a security elevation prompt when users are updating drivers for an existing connection using Point and Print. The recommended state for this setting is: Enabled: Show warning and elevation prompt. Note: On August 10, 2021, Microsoft announced a Point and Print Default Behavior Change which modifies the default Point and Print driver installation and update behavior to require Administrator privileges. This is documented in KB5005652 - Manage new Point and Print default driver installation behavior (CVE-2021-34481). This change overrides all Point and Print Group Policy settings and ensures that only Administrators can install printer drivers from a print server using Point and Print." + rationale: "Enabling Windows User Account Control (UAC) for updating existing print drivers can help mitigate the PrintNightmare vulnerability (CVE-2021-34527) and other Print Spooler attacks. Although the Point and Print default driver installation behavior overrides this setting, it is important to configure this as a backstop in the event that behavior is reversed." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Show warning and elevation prompt: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Point and Print Restrictions: When updating drivers for an existing connection Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + references: + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-1675" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34481" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-36958" + - "https://msrc-blog.microsoft.com/2021/08/10/point-and-print-default-behavior-change" + - "https://support.microsoft.com/en-us/topic/kb5005652-manage-new-point-and-print-default-driver-installation-behavior-cve-2021-34481-873642bf-2634-49c5-a23b-6d8e9a302872" + compliance: + - cis: ["18.7.11"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> UpdatePromptSettings' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> UpdatePromptSettings -> 1' + + # 18.8.1.1 (L2) Ensure 'Turn off notifications network usage' is set to 'Enabled'. (Automated) + - id: 16186 + title: "Ensure 'Turn off notifications network usage' is set to 'Enabled'." + description: "This policy setting blocks applications from using the network to send notifications to update tiles, tile badges, toast, or raw notifications. This policy setting turns off the connection between Windows and the Windows Push Notification Service (WNS). This policy setting also stops applications from being able to poll application services to update tiles. The recommended state for this setting is: Enabled." + rationale: "Windows Push Notification Services (WNS) is a mechanism to receive third-party notifications and updates from the cloud/Internet. In a high security environment, external systems, especially those hosted outside the organization, should be prevented from having an impact on the secure workstations." + impact: "Applications and system features will not be able receive notifications from the network from WNS or via notification polling APIs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Start Menu and Taskbar\\Turn off notifications network usage Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WPN.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -> NoCloudApplicationNotification' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -> NoCloudApplicationNotification -> 1' + + # 18.9.3.1 (L1) Ensure 'Include command line in process creation events' is set to 'Enabled'. (Automated) + - id: 16187 + title: "Ensure 'Include command line in process creation events' is set to 'Enabled'." + description: "This policy setting controls whether the process creation command line text is logged in security audit events when a new process has been created. The recommended state for this setting is: Enabled. Note: This feature that this setting controls was not originally supported in server OSes older than Windows Server 2012 R2. However, in February 2015 Microsoft added support for the feature to Windows Server 2008 R2 and Windows Server 2012 (non-R2) via an update - KB3004375. Therefore, this setting is also important to set on those older OSes." + rationale: "Capturing process command line information in event logs can be very valuable when performing forensic investigations of attack incidents." + impact: 'Process command line information will be included in the event logs, which can contain sensitive or private information such as passwords or user data. Warning: There are potential risks of capturing credentials and sensitive information which could be exposed to users who have read-access to event logs. Microsoft provides a feature called "Protected Event Logging" to better secure event log data. For assistance with protecting event logging, visit: About Logging Windows - PowerShell | Microsoft Docs.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Audit Process Creation\\Include command line in process creation events Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AuditSettings.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_logging_windows?view=powershell-7.2#protected-event-logging" + compliance: + - cis: ["18.9.3.1"] + - cis_csc_v8: ["8.8"] + - cis_csc_v7: ["8.8"] + - iso_27001-2013: ["A.12.14.1"] + - soc_2: ["CC5.2", "CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled -> 1' + + # 18.9.4.1 (L1) Ensure 'Encryption Oracle Remediation' is set to 'Enabled: Force Updated Clients'. (Automated) + - id: 16188 + title: "Ensure 'Encryption Oracle Remediation' is set to 'Enabled: Force Updated Clients'." + description: "Some versions of the CredSSP protocol that is used by some applications (such as Remote Desktop Connection) are vulnerable to an encryption oracle attack against the client. This policy controls compatibility with vulnerable clients and servers and allows you to set the level of protection desired for the encryption oracle vulnerability. The recommended state for this setting is: Enabled: Force Updated Clients." + rationale: "This setting is important to mitigate the CredSSP encryption oracle vulnerability, for which information was published by Microsoft on 03/13/2018 in CVE-2018-0886 | CredSSP Remote Code Execution Vulnerability. All versions of Windows Server from Server 2008 (non-R2) onwards are affected by this vulnerability, and will be compatible with this recommendation provided that they have been patched up through May 2018 (or later)." + impact: "Client applications which use CredSSP will not be able to fall back to the insecure versions and services using CredSSP will not accept unpatched clients. This setting should not be deployed until all remote hosts support the newest version, which is achieved by ensuring that all Microsoft security updates at least through May 2018 are installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Force Updated Clients: Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Encryption Oracle Remediation Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1803 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.4.1"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters -> AllowEncryptionOracle' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters -> AllowEncryptionOracle -> 1' + + # 18.9.4.2 (L1) Ensure 'Remote host allows delegation of non- exportable credentials' is set to 'Enabled'. (Automated) + - id: 16189 + title: "Ensure 'Remote host allows delegation of non- exportable credentials' is set to 'Enabled'." + description: "Remote host allows delegation of non-exportable credentials. When using credential delegation, devices provide an exportable version of credentials to the remote host. This exposes users to the risk of credential theft from attackers on the remote host. The Restricted Admin Mode and Windows Defender Remote Credential Guard features are two options to help protect against this risk. The recommended state for this setting is: Enabled. Note: More detailed information on Windows Defender Remote Credential Guard and how it compares to Restricted Admin Mode can be found at this link: Protect Remote Desktop credentials with Windows Defender Remote Credential Guard (Windows 10) | Microsoft Docs." + rationale: "Restricted Admin Mode was designed to help protect administrator accounts by ensuring that reusable credentials are not stored in memory on remote devices that could potentially be compromised. Windows Defender Remote Credential Guard helps you protect your credentials over a Remote Desktop connection by redirecting Kerberos requests back to the device that is requesting the connection. Both features should be enabled and supported, as they reduce the chance of credential theft." + impact: "The host will support the Restricted Admin Mode and Windows Defender Remote Credential Guard features." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Remote host allows delegation of non-exportable credentials Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/windows/security/identity-protection/remote-credential-guard" + compliance: + - cis: ["18.9.4.2"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["16.5"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds -> 1' + + # 18.9.5.1 (NG) Ensure 'Turn On Virtualization Based Security' is set to 'Enabled'. (Automated) + - id: 16190 + title: "Ensure 'Turn On Virtualization Based Security' is set to 'Enabled'." + description: "This policy setting specifies whether Virtualization Based Security is enabled. Virtualization Based Security uses the Windows Hypervisor to provide support for security services. The recommended state for this setting is: Enabled Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Kerberos, NTLM, and Credential manager isolate secrets by using virtualization-based security. Previous versions of Windows stored secrets in the Local Security Authority (LSA). Prior to Windows 10, the LSA stored secrets used by the operating system in its process memory. With Windows Defender Credential Guard enabled, the LSA process in the operating system talks to a new component called the isolated LSA process that stores and protects those secrets. Data stored by the isolated LSA process is protected using virtualization-based security and is not accessible to the rest of the operating system." + impact: "Warning: All drivers on the system must be compatible with this feature or the system may crash. Ensure that this policy setting is only deployed to computers which are known to be compatible. Warning #2: Enabling Windows Defender Credential Guard on Domain Controllers is not supported. The domain controller hosts authentication services which integrate with processes isolated when Windows Defender Credential Guard is enabled, causing crashes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.1"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> EnableVirtualizationBasedSecurity' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> EnableVirtualizationBasedSecurity -> 1' + + # 18.9.5.2 (NG) Ensure 'Turn On Virtualization Based Security: Select Platform Security Level' is set to 'Secure Boot' or higher. (Automated) + - id: 16191 + title: "Ensure 'Turn On Virtualization Based Security: Select Platform Security Level' is set to 'Secure Boot' or higher." + description: "This policy setting specifies whether Virtualization Based Security (VBS) is enabled. VBS uses the Windows Hypervisor to provide support for security services. The recommended state for this setting is: Secure Boot or Secure Boot and DMA Protection. Note: VBS requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Secure Boot can help reduce the risk of bootloader attacks and in conjunction with DMA protections to help protect data from being scraped from memory." + impact: "Choosing the Secure Boot option provides the system with as much protection as is supported by the computer's hardware. A system with input/output memory management units (IOMMUs) will have Secure Boot with DMA protection. A system without IOMMUs will simply have Secure Boot enabled without DMA protection. Choosing the Secure Boot with DMA protection option requires the system to have IOMMUs in order to enable VBS. Without IOMMU hardware support, VBS will be disabled. Warning: All drivers on the system must be compatible with this feature or the system may crash. Ensure that this policy setting is only deployed to computers which are known to be compatible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Secure Boot or Secure Boot and DMA Protection: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Select Platform Security Level Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.2"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> RequirePlatformSecurityFeatures -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> RequirePlatformSecurityFeatures -> 3' + + # 18.9.5.3 (NG) Ensure 'Turn On Virtualization Based Security: Virtualization Based Protection of Code Integrity' is set to 'Enabled with UEFI lock'. (Automated) + - id: 16192 + title: "Ensure 'Turn On Virtualization Based Security: Virtualization Based Protection of Code Integrity' is set to 'Enabled with UEFI lock'." + description: "This setting enables virtualization based protection of Kernel Mode Code Integrity. When this is enabled, kernel mode memory protections are enforced and the Code Integrity validation path is protected by the Virtualization Based Security feature. The recommended state for this setting is: Enabled with UEFI lock Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "The Enabled with UEFI lock option ensures that Virtualization Based Protection of Code Integrity cannot be disabled remotely." + impact: "Warning: All drivers on the system must be compatible with this feature or the system may crash. Ensure that this policy setting is only deployed to computers which are known to be compatible. Warning #2: Once this setting is turned on and active, Virtualization Based Security cannot be disabled solely via GPO or any other remote method. After removing the setting from GPO, the features must also be manually disabled locally at the machine using the steps provided at this link: Manage Windows Defender Credential Guard (Windows 10) | Microsoft Docs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with UEFI lock: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Virtualization Based Protection of Code Integrity Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.3"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HypervisorEnforcedCodeIntegrity' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HypervisorEnforcedCodeIntegrity -> 1' + + # 18.9.5.4 (NG) Ensure 'Turn On Virtualization Based Security: Require UEFI Memory Attributes Table' is set to 'True (checked)'. (Automated) + - id: 16193 + title: "Ensure 'Turn On Virtualization Based Security: Require UEFI Memory Attributes Table' is set to 'True (checked)'." + description: "This option will only enable Virtualization Based Protection of Code Integrity on devices with UEFI firmware support for the Memory Attributes Table. Devices without the UEFI Memory Attributes Table may have firmware that is incompatible with Virtualization Based Protection of Code Integrity which in some cases can lead to crashes or data loss or incompatibility with certain plug-in cards. If not setting this option the targeted devices should be tested to ensure compatibility. The recommended state for this setting is: True (checked) Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "This setting will help protect this control from being enabled on a system that is not compatible which could lead to a crash or data loss." + impact: "Warning: All drivers on the system must be compatible with this feature or the system may crash. Ensure that this policy setting is only deployed to computers which are known to be compatible." + remediation: "To establish the recommended configuration via GP, set the following UI path to TRUE: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Require UEFI Memory Attributes Table Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.4"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HVCIMATRequired' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HVCIMATRequired -> 1' + + # 18.9.5.5 (NG) Ensure 'Turn On Virtualization Based Security: Credential Guard Configuration' is set to 'Enabled with UEFI lock' (MS Only). (Automated) + - id: 16194 + title: "Ensure 'Turn On Virtualization Based Security: Credential Guard Configuration' is set to 'Enabled with UEFI lock' (MS Only)." + description: 'This setting lets users turn on Credential Guard with virtualization-based security to help protect credentials. The "Enabled with UEFI lock" option ensures that Credential Guard cannot be disabled remotely. In order to disable the feature, you must set the Group Policy to "Disabled" as well as remove the security functionality from each computer, with a physically present user, in order to clear configuration persisted in UEFI. The recommended state for this setting is: Enabled with UEFI lock, but only on Member Servers (not Domain Controllers). Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs.' + rationale: "The Enabled with UEFI lock option ensures that Credential Guard cannot be disabled remotely." + impact: "Warning: All drivers on the system must be compatible with this feature or the system may crash. Ensure that this policy setting is only deployed to computers which are known to be compatible. Warning #2: Enabling Windows Defender Credential Guard on Domain Controllers is not supported. The domain controller hosts authentication services which integrate with processes isolated when Windows Defender Credential Guard is enabled, causing crashes. Warning #3: Once this setting is turned on and active, Credential Guard cannot be disabled solely via GPO or any other remote method. After removing the setting from GPO, the features must also be manually disabled locally at the machine using the steps provided at this link: Manage Windows Defender Credential Guard (Windows 10) | Microsoft Docs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with UEFI lock (on Member Servers only): Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Credential Guard Configuration Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.5"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> LsaCfgFlags' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> LsaCfgFlags -> 3' + + # 18.9.5.6 (NG) Ensure 'Turn On Virtualization Based Security: Credential Guard Configuration' is set to 'Disabled' (DC Only). (Automated) + - id: 16195 + title: "Ensure 'Turn On Virtualization Based Security: Credential Guard Configuration' is set to 'Disabled' (DC Only)." + description: "This setting lets users turn on Credential Guard with virtualization-based security to help protect credentials. The recommended state for this setting is: Disabled on Domain Controllers. Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Credential Guard is not useful on Domain Controllers and can cause crashes on them." + impact: "None - this is the default behavior. Warning: Enabling Windows Defender Credential Guard on Domain Controllers is not supported. The domain controller hosts authentication services which integrate with processes isolated when Windows Defender Credential Guard is enabled, causing crashes. Manage Windows Defender Credential Guard (Windows 10) | Microsoft Docs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Credential Guard Configuration Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.6"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> LsaCfgFlags' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> LsaCfgFlags -> 0' + + # 18.9.5.7 (NG) Ensure 'Turn On Virtualization Based Security: Secure Launch Configuration' is set to 'Enabled'. (Automated) + - id: 16196 + title: "Ensure 'Turn On Virtualization Based Security: Secure Launch Configuration' is set to 'Enabled'." + description: "Secure Launch protects the Virtualization Based Security environment from exploited vulnerabilities in device firmware. The recommended state for this setting is: Enabled. Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Secure Launch changes the way windows boots to use Intel Trusted Execution Technology (TXT) and Runtime BIOS Resilience features to prevent firmware exploits from being able to impact the security of the Windows Virtualization Based Security environment." + impact: "Warning: All drivers on the system must be compatible with this feature or the system may crash. Ensure that this policy setting is only deployed to computers which are known to be compatible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Secure Launch Configuration Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.7"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> ConfigureSystemGuardLaunch' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> ConfigureSystemGuardLaunch -> 1' + + # 18.9.7.2 (L1) Ensure 'Prevent device metadata retrieval from the Internet' is set to 'Enabled'. (Automated) + - id: 16197 + title: "Ensure 'Prevent device metadata retrieval from the Internet' is set to 'Enabled'." + description: "This policy setting allows you to prevent Windows from retrieving device metadata from the Internet. The recommended state for this setting is: Enabled. Note: This will not prevent the installation of basic hardware drivers, but does prevent associated third-party utility software from automatically being installed under the context of the SYSTEM account." + rationale: "Installation of software should be conducted by an authorized system administrator and not a standard user. Allowing automatic third-party software installations under the context of the SYSTEM account has potential for allowing unauthorized access via backdoors or installation software bugs." + impact: "Standard users without administrator privileges will not be able to install associated third-party utility software for peripheral devices. This may limit the use of advanced features of those devices unless/until an administrator installs the associated utility software for the device." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Installation\\Prevent device metadata retrieval from the Internet Note: This Group Policy path is provided by the Group Policy template DeviceInstallation.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates, or with the Group Policy template DeviceSetup.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.7.2"] + - cis_csc_v7: ["18.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata -> PreventDeviceMetadataFromNetwork' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata -> PreventDeviceMetadataFromNetwork -> 1' + + # 18.9.13.1 (L1) Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'. (Automated) + - id: 16198 + title: "Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'." + description: "This policy setting allows you to specify which boot-start drivers are initialized based on a classification determined by an Early Launch Antimalware boot-start driver. The Early Launch Antimalware boot-start driver can return the following classifications for each boot-start driver: - Good: The driver has been signed and has not been tampered with. - Bad: The driver has been identified as malware. It is recommended that you do not allow known bad drivers to be initialized. - Bad, but required for boot: The driver has been identified as malware, but the computer cannot successfully boot without loading this driver. - Unknown: This driver has not been attested to by your malware detection application and has not been classified by the Early Launch Antimalware boot-start driver. If you enable this policy setting you will be able to choose which boot-start drivers to initialize the next time the computer is started. If your malware detection application does not include an Early Launch Antimalware boot-start driver or if your Early Launch Antimalware boot-start driver has been disabled, this setting has no effect and all boot-start drivers are initialized. The recommended state for this setting is: Enabled: Good, unknown and bad but critical." + rationale: "This policy setting helps reduce the impact of malware that has already infected your system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Good, unknown and bad but critical: Computer Configuration\\Policies\\Administrative Templates\\System\\Early Launch Antimalware\\Boot-Start Driver Initialization Policy Note: This Group Policy path may not exist by default. It is provided by the Group Policy template EarlyLaunchAM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.13.1"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy -> 3' + + # 18.9.19.2 (L1) Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'. (Automated) + - id: 16199 + title: "Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'." + description: 'The "Do not apply during periodic background processing" option prevents the system from updating affected policies in the background while the computer is in use. When background updates are disabled, policy changes will not take effect until the next user logon or system restart. The recommended state for this setting is: Enabled: FALSE (unchecked).' + rationale: "Setting this option to false (unchecked) will ensure that domain policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + impact: "Group Policies will be reapplied every time they are refreshed, which could have a slight impact on performance." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Do not apply during periodic background processing option to FALSE (unchecked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.19.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.2"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy -> 0' + + # 18.9.19.3 (L1) Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'. (Automated) + - id: 16200 + title: "Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'." + description: 'The "Process even if the Group Policy objects have not changed" option updates and reapplies policies even if the policies have not changed. The recommended state for this setting is: Enabled: TRUE (checked).' + rationale: "Setting this option to true (checked) will ensure unauthorized changes that might have been configured locally are forced to match the domain-based Group Policy settings again." + impact: "Group Policies will be reapplied even if they have not been changed, which could have a slight impact on performance." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Process even if the Group Policy objects have not changed option to TRUE (checked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.19.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.2"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges -> 0' + + # 18.9.19.4 (L1) Ensure 'Continue experiences on this device' is set to 'Disabled'. (Automated) + - id: 16201 + title: "Ensure 'Continue experiences on this device' is set to 'Disabled'." + description: "This policy setting determines whether the Windows device is allowed to participate in cross-device experiences (continue experiences). The recommended state for this setting is: Disabled." + rationale: "A cross-device experience is when a system can access app and send messages to other devices. In an enterprise managed environment only trusted systems should be communicating within the network. Access to any other system should be prohibited." + impact: "The Windows device will not be discoverable by other devices, and cannot participate in cross-device experiences." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Continue experiences on this device Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.19.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableCdp' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableCdp -> 0' + + # 18.9.19.5 (L1) Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'. (Automated) + - id: 16202 + title: "Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'." + description: "This policy setting prevents Group Policy from being updated while the computer is in use. This policy setting applies to Group Policy for computers, users and Domain Controllers. The recommended state for this setting is: Disabled." + rationale: "This setting ensures that group policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Turn off background refresh of Group Policy Note: This Group Policy path is provided by the Group Policy template GroupPolicy.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.19.5"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.2"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy -> 0' + + # 18.9.20.1.1 (L1) Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'. (Automated) + - id: 16203 + title: "Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'." + description: "This policy setting controls whether the computer can download print driver packages over HTTP. To set up HTTP printing, printer drivers that are not available in the standard operating system installation might need to be downloaded over HTTP. The recommended state for this setting is: Enabled." + rationale: "Users might download drivers that include malicious code." + impact: "Print drivers cannot be downloaded over HTTP. Note: This policy setting does not prevent the client computer from printing to printers on the intranet or the Internet over HTTP. It only prohibits downloading drivers that are not already installed locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off downloading of print drivers over HTTP Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.1"] + - cis_csc_v8: ["2.5"] + - cis_csc_v7: ["2.7"] + - cmmc_v2.0: ["CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "CM.L2-3.4.9"] + - iso_27001-2013: ["A.12.1.2", "A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-7(5)"] + - pci_dss_v4.0: ["1.2.5", "2.2.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> 1' + + # 18.9.20.1.2 (L2) Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'. (Automated) + - id: 16204 + title: "Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'." + description: "This setting turns off data sharing from the handwriting recognition personalization tool. The handwriting recognition personalization tool enables Tablet PC users to adapt handwriting recognition to their own writing style by providing writing samples. The tool can optionally share user writing samples with Microsoft to improve handwriting recognition in future versions of Windows. The tool generates reports and transmits them to Microsoft over a secure connection. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + impact: "Tablet PC users cannot choose to share writing samples from the handwriting recognition personalization tool with Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting personalization data sharing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ShapeCollector.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.20.1.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> 1' + + # 18.9.20.1.3 (L2) Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'. (Automated) + - id: 16205 + title: "Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'." + description: "Turns off the handwriting recognition error reporting tool. The handwriting recognition error reporting tool enables users to report errors encountered in Tablet PC Input Panel. The tool generates error reports and transmits them to Microsoft over a secure connection. Microsoft uses these error reports to improve handwriting recognition in future versions of Windows. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + impact: "Users cannot start the handwriting recognition error reporting tool or send error reports to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting recognition error reporting Note: This Group Policy path is provided by the Group Policy template InkWatson.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> 1' + + # 18.9.20.1.4 (L2) Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'. (Automated) + - id: 16206 + title: "Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'." + description: "This policy setting specifies whether the Internet Connection Wizard can connect to Microsoft to download a list of Internet Service Providers (ISPs). The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + impact: 'The "Choose a list of Internet Service Providers" path in the Internet Connection Wizard causes the wizard to exit. This prevents users from retrieving the list of ISPs, which resides on Microsoft servers.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> 1' + + # 18.9.20.1.5 (L1) Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'. (Automated) + - id: 16207 + title: "Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'." + description: "This policy setting controls whether Windows will download a list of providers for the Web publishing and online ordering wizards. The recommended state for this setting is: Enabled." + rationale: "Although the risk is minimal, enabling this setting will reduce the possibility of a user unknowingly downloading malicious content through this feature." + impact: "Windows is prevented from downloading providers; only the service providers cached in the local registry are displayed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet download for Web publishing and online ordering wizards Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> 1' + + # 18.9.20.1.6 (L2) Ensure 'Turn off printing over HTTP' is set to 'Enabled'. (Automated) + - id: 16208 + title: "Ensure 'Turn off printing over HTTP' is set to 'Enabled'." + description: "This policy setting allows you to disable the client computer's ability to print over HTTP, which allows the computer to print to printers on the intranet as well as the Internet. The recommended state for this setting is: Enabled. Note: This control affects printing over both HTTP and HTTPS." + rationale: "Information that is transmitted over HTTP through this capability is not protected and can be intercepted by malicious users. For this reason, it is not often used in enterprise managed environments." + impact: "The client computer will not be able to print to Internet printers over HTTP or HTTPS. Note: This policy setting affects the client side of Internet printing only. Regardless of how it is configured, a computer could act as an Internet Printing server and make its shared printers available through HTTP." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off printing over HTTP Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["13.3"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> 1' + + # 18.9.20.1.7 (L2) Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'. (Automated) + - id: 16209 + title: "Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'." + description: "This policy setting specifies whether the Windows Registration Wizard connects to Microsoft.com for online registration. The recommended state for this setting is: Enabled." + rationale: "Users in an enterprise managed environment should not be registering their own copies of Windows, providing their own PII in the process." + impact: "Users are blocked from connecting to Microsoft.com for online registration and they cannot register their copy of Windows online." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Registration if URL connection is referring to Microsoft.com Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> 1' + + # 18.9.20.1.8 (L2) Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'. (Automated) + - id: 16210 + title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'." + description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches. The recommended state for this setting is: Enabled." + rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for. This risk is very low because even if this setting is enabled users still must submit search queries to the desired search engine in order to perform searches." + impact: "Search Companion does not download content updates during searches. Note: Internet searches will still send the search text and information about the search to Microsoft and the chosen search provider. If you select Classic Search, the Search Companion feature will be unavailable. You can select Classic Search by clicking Start, Search, Change Preferences, and then Change Internet Search Behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Search Companion content file updates Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' + + # 18.9.20.1.9 (L2) Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'. (Automated) + - id: 16211 + title: 'Ensure ''Turn off the "Order Prints" picture task'' is set to ''Enabled''.' + description: 'This policy setting specifies whether the "Order Prints Online" task is available from Picture Tasks in Windows folders. The Order Prints Online Wizard is used to download a list of providers and allow users to order prints online. The recommended state for this setting is: Enabled.' + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + impact: 'The task "Order Prints Online" is removed from Picture Tasks in File Explorer folders.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Order Prints\" picture task Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> 1' + + # 18.9.20.1.10 (L2) Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'. (Automated) + - id: 16212 + title: 'Ensure ''Turn off the "Publish to Web" task for files and folders'' is set to ''Enabled''.' + description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders. The recommended state for this setting is: Enabled." + rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." + impact: 'The "Publish to Web" task is removed from File and Folder tasks in Windows folders.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Publish to Web\" task for files and folders Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' + + # 18.9.20.1.11 (L2) Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'. (Automated) + - id: 16213 + title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'." + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + impact: "Windows Messenger will not collect usage information, and the user settings to enable the collection of usage information will not be shown." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the Windows Messenger Customer Experience Improvement Program Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' + + # 18.9.20.1.12 (L2) Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'. (Automated) + - id: 16214 + title: "Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'." + description: "This policy setting specifies whether the Windows Customer Experience Improvement Program can collect anonymous information about how Windows is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to improve features that are most used and to detect flaws so that they can be corrected more quickly. Enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + impact: "All users are opted out of the Windows Customer Experience Improvement Program." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Customer Experience Improvement Program Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> 0' + + # 18.9.20.1.13 (L2) Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'. (Automated) + - id: 16215 + title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'." + description: "This policy setting controls whether or not errors are reported to Microsoft. Error Reporting is used to report information about a system or application that has failed or has stopped responding and is used to improve the quality of the product. The recommended state for this setting is: Enabled." + rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." + impact: "Users are not given the option to report errors to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Error Reporting Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' + + # 18.9.23.1 (L2) Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic'. (Automated) + - id: 16216 + title: "Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic'." + description: "This policy setting allows you to set support for Kerberos to attempt authentication using the certificate for the device to the domain. Support for device authentication using certificate will require connectivity to a DC in the device account domain which supports certificate authentication for computer accounts. The recommended state for this setting is: Enabled: Automatic." + rationale: "Having stronger device authentication with the use of certificates is strongly encouraged over standard username and password authentication. Having this set to Automatic will allow certificate based authentication to be used whenever possible." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Automatic: Computer Configuration\\Policies\\Administrative Templates\\System\\Kerberos\\Support device authentication using certificate Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Kerberos.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.23.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitBehavior' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitBehavior -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitEnabled -> 1' + + # 18.9.26.1 (L2) Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'. (Automated) + - id: 16217 + title: "Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'." + description: "This policy prevents automatic copying of user input methods to the system account for use on the sign-in screen. The user is restricted to the set of input methods that are enabled in the system account. The recommended state for this setting is: Enabled." + rationale: "This is a way to increase the security of the system account." + impact: "Users will have input methods enabled for the system account on the sign-in page." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Locale Services\\Disallow copying of user input methods to the system account for sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.26.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> 1' + + # 18.9.27.1 (L1) Ensure 'Block user from showing account details on sign-in' is set to 'Enabled'. (Automated) + - id: 16218 + title: "Ensure 'Block user from showing account details on sign-in' is set to 'Enabled'." + description: "This policy prevents the user from showing account details (email address or user name) on the sign-in screen. The recommended state for this setting is: Enabled." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + impact: "The user cannot choose to show account details on the sign-in screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Block user from showing account details on sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.27.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockUserFromShowingAccountDetailsOnSignin' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockUserFromShowingAccountDetailsOnSignin -> 1' + + # 18.9.27.2 (L1) Ensure 'Do not display network selection UI' is set to 'Enabled'. (Automated) + - id: 16219 + title: "Ensure 'Do not display network selection UI' is set to 'Enabled'." + description: "This policy setting allows you to control whether anyone can interact with available networks UI on the logon screen. The recommended state for this setting is: Enabled." + rationale: "An unauthorized user could disconnect the PC from the network or can connect the PC to other available networks without signing into Windows." + impact: "The PC's network connectivity state cannot be changed without signing into Windows." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not display network selection UI Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.27.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI -> 1' + + # 18.9.27.3 (L1) Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'. (Automated) + - id: 16220 + title: "Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'." + description: "This policy setting prevents connected users from being enumerated on domain-joined computers. The recommended state for this setting is: Enabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + impact: "The Logon UI will not enumerate any connected users on domain-joined computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not enumerate connected users on domain-joined computers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.27.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers -> 1' + + # 18.9.27.4 (L1) Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled' (MS only). (Automated) + - id: 16221 + title: "Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled' (MS only)." + description: "This policy setting allows local users to be enumerated on domain-joined computers. The recommended state for this setting is: Disabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Enumerate local users on domain-joined computers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.27.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers -> 0' + + # 18.9.27.5 (L1) Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled'. (Automated) + - id: 16222 + title: "Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled'." + description: "This policy setting allows you to prevent app notifications from appearing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "App notifications might display sensitive business or personal data." + impact: "No app notifications are displayed on the lock screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off app notifications on the lock screen Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.27.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications -> 1' + + # 18.9.27.6 (L1) Ensure 'Turn off picture password sign-in' is set to 'Enabled'. (Automated) + - id: 16223 + title: "Ensure 'Turn off picture password sign-in' is set to 'Enabled'." + description: "This policy setting allows you to control whether a domain user can sign in using a picture password. The recommended state for this setting is: Enabled. Note: If the picture password feature is permitted, the user's domain password is cached in the system vault when using it." + rationale: "Picture passwords bypass the requirement for a typed complex password. In a shared work environment, a simple shoulder surf where someone observed the on-screen gestures would allow that person to gain access to the system without the need to know the complex password. Vertical monitor screens with an image are much more visible at a distance than horizontal key strokes, increasing the likelihood of a successful observation of the mouse gestures." + impact: "Users will not be able to set up or sign in with a picture password." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off picture password sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.27.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword -> 1' + + # 18.9.27.7 (L1) Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'. (Automated) + - id: 16224 + title: "Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'." + description: "This policy setting allows you to control whether a domain user can sign in using a convenience PIN. In Windows 10, convenience PIN was replaced with Passport, which has stronger security properties. To configure Passport for domain users, use the policies under Computer Configuration\\Administrative Templates\\Windows Components\\Microsoft Passport for Work. Note: The user's domain password will be cached in the system vault when using this feature. The recommended state for this setting is: Disabled." + rationale: "A PIN is created from a much smaller selection of characters than a password, so in most cases a PIN will be much less robust than a password." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn on convenience PIN sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn on PIN sign-in, but it was renamed starting with the Windows 10 Release 1511 Administrative Templates." + compliance: + - cis: ["18.9.27.7"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon -> 0' + + # 18.9.32.6.1 (L2) Ensure 'Allow network connectivity during connected-standby (on battery)' is set to 'Disabled'. (Automated) + - id: 16225 + title: "Ensure 'Allow network connectivity during connected-standby (on battery)' is set to 'Disabled'." + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, on battery and in a sleep state." + impact: "Network connectivity in standby (while on battery) is not guaranteed. This connectivity restriction currently only applies to WLAN networks only, but is subject to change (according to Microsoft)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (on battery) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.32.6.1"] + - cis_csc_v7: ["9.2"] + - iso_27001-2013: ["A.13.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> DCSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> DCSettingIndex -> 0' + + # 18.9.32.6.2 (L2) Ensure 'Allow network connectivity during connected-standby (plugged in)' is set to 'Disabled'. (Automated) + - id: 16226 + title: "Ensure 'Allow network connectivity during connected-standby (plugged in)' is set to 'Disabled'." + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, plugged in and in a sleep state." + impact: "Network connectivity in standby (while plugged in) is not guaranteed. This connectivity restriction currently only applies to WLAN networks only, but is subject to change (according to Microsoft)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (plugged in) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.32.6.2"] + - cis_csc_v7: ["9.2"] + - iso_27001-2013: ["A.13.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> ACSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> ACSettingIndex -> 0' + + # 18.9.32.6.3 (L1) Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'. (Automated) + - id: 16227 + title: "Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'." + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (on battery) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.32.6.3"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex -> 1' + + # 18.9.32.6.4 (L1) Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'. (Automated) + - id: 16228 + title: "Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'." + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (plugged in) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.32.6.4"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex -> 1' + + # 18.9.34.1 (L1) Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'. (Automated) + - id: 16229 + title: "Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'." + description: "This policy setting allows you to turn on or turn off Offer (Unsolicited) Remote Assistance on this computer. Help desk and support personnel will not be able to proactively offer assistance, although they can still respond to user assistance requests. The recommended state for this setting is: Disabled." + rationale: "A user might be tricked and accept an unsolicited Remote Assistance offer from a malicious user." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Offer Remote Assistance Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.34.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited -> 0' + + # 18.9.34.2 (L1) Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'. (Automated) + - id: 16230 + title: "Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'." + description: "This policy setting allows you to turn on or turn off Solicited (Ask for) Remote Assistance on this computer. The recommended state for this setting is: Disabled." + rationale: "There is slight risk that a rogue administrator will gain access to another user's desktop session, however, they cannot connect to a user's computer unannounced or control it without permission from the user. When an expert tries to connect, the user can still choose to deny the connection or give the expert view-only privileges. The user must explicitly click the Yes button to allow the expert to remotely control the workstation." + impact: "Users on this computer cannot use e-mail or file transfer to ask someone for help. Also, users cannot use instant messaging programs to allow connections to this computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Solicited Remote Assistance Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.34.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp -> 0' + + # 18.9.35.1 (L1) Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled' (MS only). (Automated) + - id: 16231 + title: "Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled' (MS only)." + description: "This policy setting controls whether RPC clients authenticate with the Endpoint Mapper Service when the call they are making contains authentication information. The Endpoint Mapper Service on computers running Windows NT4 (all service packs) cannot process authentication information supplied in this manner. This policy setting can cause a specific issue with 1-way forest trusts if it is applied to the trusting domain DCs (see Microsoft KB3073942), so we do not recommend applying it to Domain Controllers. Note: This policy will not be in effect until the system is rebooted. The recommended state for this setting is: Enabled." + rationale: "Anonymous access to RPC services could result in accidental disclosure of information to unauthenticated users." + impact: "RPC clients will authenticate to the Endpoint Mapper Service for calls that contain authentication information. Clients making such calls will not be able to communicate with the Windows NT4 Server Endpoint Mapper Service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Enable RPC Endpoint Mapper Client Authentication Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RPC.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.35.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution -> 1' + + # 18.9.35.2 (L2) Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated' (MS only). (Automated) + - id: 16232 + title: "Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated' (MS only)." + description: 'This policy setting controls how the RPC server runtime handles unauthenticated RPC clients connecting to RPC servers. This policy setting impacts all RPC applications. In a domain environment this policy setting should be used with caution as it can impact a wide range of functionality including group policy processing itself. Reverting a change to this policy setting can require manual intervention on each affected machine. This policy setting should never be applied to a Domain Controller. A client will be considered an authenticated client if it uses a named pipe to communicate with the server or if it uses RPC Security. RPC Interfaces that have specifically requested to be accessible by unauthenticated clients may be exempt from this restriction, depending on the selected value for this policy setting. -- "None" allows all RPC clients to connect to RPC Servers running on the machine on which the policy setting is applied. -- "Authenticated" allows only authenticated RPC Clients (per the definition above) to connect to RPC Servers running on the machine on which the policy setting is applied. Exemptions are granted to interfaces that have requested them. -- "Authenticated without exceptions" allows only authenticated RPC Clients (per the definition above) to connect to RPC Servers running on the machine on which the policy setting is applied. No exceptions are allowed. This value has the potential to cause serious problems and is not recommended. Note: This policy setting will not be applied until the system is rebooted. The recommended state for this setting is: Enabled: Authenticated.' + rationale: "Unauthenticated RPC communication can create a security vulnerability." + impact: "Only authenticated RPC Clients will be allowed to connect to RPC servers running on the machine on which the policy setting is applied. Exemptions are granted to interfaces that have requested them." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Authenticated: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Restrict Unauthenticated RPC clients Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RPC.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.35.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients -> 1' + + # 18.9.38.1 (L1) Ensure 'Configure validation of ROCA-vulnerable WHfB keys during authentication' is set to 'Enabled: Audit' or higher (DC only). (Automated) + - id: 16233 + title: "Ensure 'Configure validation of ROCA-vulnerable WHfB keys during authentication' is set to 'Enabled: Audit' or higher (DC only)." + description: 'This policy setting allows you to configure how Domain Controllers handle Windows Hello for Business (WHfB) keys that are vulnerable to the "Return of Coppersmith''s attack" (ROCA) vulnerability. If this policy setting is enabled the following options are supported: Ignore: During authentication the Domain Controller will not probe any WHfB keys for the ROCA vulnerability. Audit: During authentication the Domain Controller will emit audit events for WHfB keys that are subject to the ROCA vulnerability (authentications will still succeed). Block: During authentication the Domain Controller will block the use of WHfB keys that are subject to the ROCA vulnerability (vulnerable authentications will fail). The recommended state for this setting is: Enabled: Audit. Configuring this setting to Enabled: Block also conforms to the benchmark. Note: This setting only takes effect on Domain Controllers. Note #2: A reboot is not required for changes to this setting to take effect.' + rationale: 'The "Return of Coppersmith''s attack" or ROCA vulnerability is a cryptographic weakness in a widely used cryptographic library. An attacker can reveal secret keys (offline with no physical access to the affected device) on certified devices using this library. For more information on this vulnerability, visit ADV170012 - Security Update Guide - Microsoft - Vulnerability in TPM could allow Security Feature Bypass.' + impact: "This setting may affect vulnerable Trusted Platform Module (TPMs). To avoid issues, this setting should not be set to Block until appropriate mitigations have been performed, for example patching of vulnerable TPMs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Audit (configuring to Enabled: Block also conforms to the benchmark): Computer Configuration\\Policies\\Administrative Templates\\System\\Security Account Manager\\Configure validation of ROCA-vulnerable WHfB keys during authentication Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sam.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + references: + - "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-15361" + - "https://nvd.nist.gov/vuln/detail/CVE-2017-15361" + compliance: + - cis: ["18.9.38.1"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\SAM' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\SAM -> SamNGCKeyROCAValidation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\SAM -> SamNGCKeyROCAValidation -> n:(\d+) compare >= 1' + + # 18.9.46.5.1 (L2) Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'. (Automated) + - id: 16234 + title: "Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'." + description: "This policy setting configures Microsoft Support Diagnostic Tool (MSDT) interactive communication with the support provider. MSDT gathers diagnostic data for analysis by support professionals. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any third-party since this data could contain sensitive information." + impact: "MSDT cannot run in support mode, and no data can be collected or sent to the support provider." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Microsoft Support Diagnostic Tool\\Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSDT.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.46.5.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> 0' + + # 18.9.46.11.1 (L2) Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'. (Automated) + - id: 16235 + title: "Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'." + description: "This policy setting specifies whether to enable or disable tracking of responsiveness events. The recommended state for this setting is: Disabled." + rationale: "When enabled the aggregated data of a given event will be transmitted to Microsoft. The option exists to restrict this feature for a specific user, set the consent level, and designate specific programs for which error reports could be sent. However, centrally restricting the ability to execute PerfTrack to limit the potential for unauthorized or undesired usage, data leakage, or unintentional communications is highly recommended." + impact: "Responsiveness events are not processed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Windows Performance PerfTrack\\Enable/Disable PerfTrack Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PerformancePerftrack.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.46.11.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> 0' + + # 18.9.48.1 (L2) Ensure 'Turn off the advertising ID' is set to 'Enabled'. (Automated) + - id: 16236 + title: "Ensure 'Turn off the advertising ID' is set to 'Enabled'." + description: "This policy setting turns off the advertising ID, preventing apps from using the ID for experiences across apps. The recommended state for this setting is: Enabled." + rationale: "Tracking user activity for advertising purposes, even anonymously, may be a privacy concern. In an enterprise managed environment, applications should not need or require tracking for targeted advertising." + impact: "The advertising ID is turned off. Apps can't use the ID for experiences across apps." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\User Profiles\\Turn off the advertising ID Note: This Group Policy path may not exist by default. It is provided by the Group Policy template UserProfiles.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.48.1"] + - cis_csc_v7: ["9.2"] + - iso_27001-2013: ["A.13.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> 1' + + # 18.9.50.1.1 (L2) Ensure 'Enable Windows NTP Client' is set to 'Enabled'. (Automated) + - id: 16237 + title: "Ensure 'Enable Windows NTP Client' is set to 'Enabled'." + description: "This policy setting specifies whether the Windows NTP Client is enabled. Enabling the Windows NTP Client allows your computer to synchronize its computer clock with other NTP servers. You might want to disable this service if you decide to use a third-party time provider. The recommended state for this setting is: Enabled." + rationale: "A reliable and accurate account of time is important for a number of services and security requirements, including but not limited to distributed applications, authentication services, multi-user databases and logging services. The use of an NTP client (with secure operation) establishes functional accuracy and is a focal point when reviewing security relevant events." + impact: "You can set the local computer clock to synchronize time with NTP servers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Client Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.50.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> 1' + + # 18.9.50.1.2 (L2) Ensure 'Enable Windows NTP Server' is set to 'Disabled' (MS only). (Automated) + - id: 16238 + title: "Ensure 'Enable Windows NTP Server' is set to 'Disabled' (MS only)." + description: "This policy setting allows you to specify whether the Windows NTP Server is enabled. The recommended state for this setting is: Disabled. Note: In most enterprise managed environments, you should not disable the Windows NTP Server on Domain Controllers, as it is very important for the operation of NT5DS (domain hierarchy-based) time synchronization." + rationale: "The configuration of proper time synchronization is critically important in an enterprise managed environment both due to the sensitivity of Kerberos authentication timestamps and also to ensure accurate security logging." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Server Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.50.1.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled -> 0' + + # 18.10.3.1 (L2) Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled'. (Automated) + - id: 16239 + title: "Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled'." + description: "Manages a Windows app's ability to share data between users who have installed the app. Data is shared through the SharedLocal folder. This folder is available through the Windows.Storage API. The recommended state for this setting is: Disabled." + rationale: "Users of a system could accidentally share sensitive data with other users on the same system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Package Deployment\\Allow a Windows app to share application data between users Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppxPackageManager.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager -> AllowSharedLocalAppData' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager -> AllowSharedLocalAppData -> 0' + + # 18.10.5.1 (L1) Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'. (Automated) + - id: 16240 + title: "Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'." + description: "This policy setting lets you control whether Microsoft accounts are optional for Windows Store apps that require an account to sign in. This policy only affects Windows Store apps that support it. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting allows an organization to use their enterprise user accounts instead of using their Microsoft accounts when accessing Windows store apps. This provides the organization with greater control over relevant credentials. Microsoft accounts cannot be centrally managed and as such enterprise credential security policies cannot be applied to them, which could put any information accessed by using Microsoft accounts at risk." + impact: "Windows Store apps that typically require a Microsoft account to sign in will allow users to sign in with an enterprise account instead." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App runtime\\Allow Microsoft accounts to be optional Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppXRuntime.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.5.1"] + - cis_csc_v8: ["5.6"] + - cis_csc_v7: ["16.2"] + - nist_sp_800-53: ["AC-2(1)"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional -> 1' + + # 18.10.7.1 (L1) Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'. (Automated) + - id: 16241 + title: "Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'." + description: "This policy setting disallows AutoPlay for MTP devices like cameras or phones. The recommended state for this setting is: Enabled." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + impact: "AutoPlay will not be allowed for MTP devices like cameras or phones." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Disallow Autoplay for non-volume devices Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.7.1"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume -> 1' + + # 18.10.7.2 (L1) Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'. (Automated) + - id: 16242 + title: "Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'." + description: "This policy setting sets the default behavior for Autorun commands. Autorun commands are generally stored in autorun.inf files. They often launch the installation program or other routines. The recommended state for this setting is: Enabled: Do not execute any autorun commands." + rationale: "Prior to Windows Vista, when media containing an autorun command is inserted, the system will automatically execute the program without user intervention. This creates a major security concern as code may be executed without user's knowledge. The default behavior starting with Windows Vista is to prompt the user whether autorun command is to be run. The autorun command is represented as a handler in the Autoplay dialog." + impact: "AutoRun commands will be completely disabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Do not execute any autorun commands: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Set the default behavior for AutoRun Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.7.2"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun -> 1' + + # 18.10.7.3 (L1) Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'. (Automated) + - id: 16243 + title: "Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'." + description: "Autoplay starts to read from a drive as soon as you insert media in the drive, which causes the setup file for programs or audio media to start immediately. An attacker could use this feature to launch a program to damage the computer or data on the computer. Autoplay is disabled by default on some removable drive types, such as floppy disk and network drives, but not on CD-ROM drives. Note: You cannot use this policy setting to enable Autoplay on computer drives in which it is disabled by default, such as floppy disk and network drives. The recommended state for this setting is: Enabled: All drives." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + impact: "Autoplay will be disabled - users will have to manually launch setup or installation programs that are provided on removable media." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: All drives: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Turn off Autoplay Note: This Group Policy path is provided by the Group Policy template AutoPlay.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.7.3"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun -> 255' + + # 18.10.8.1.1 (L1) Ensure 'Configure enhanced anti-spoofing' is set to 'Enabled'. (Automated) + - id: 16244 + title: "Ensure 'Configure enhanced anti-spoofing' is set to 'Enabled'." + description: "This policy setting determines whether enhanced anti-spoofing is configured for devices which support it. The recommended state for this setting is: Enabled." + rationale: "Enterprise managed environments are now supporting a wider range of mobile devices, increasing the security on these devices will help protect against unauthorized access on your network." + impact: "Windows will require all users on the device to use anti-spoofing for facial features, on devices which support it." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Biometrics\\Facial Features\\Configure enhanced anti-spoofing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Biometrics.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Windows 10 Release 1511 and Windows 10 Release 1607 & Server 2016 Administrative Templates, this setting was initially named Use enhanced anti-spoofing when available. It was renamed to Configure enhanced anti-spoofing starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.10.8.1.1"] + - cis_csc_v8: ["10.5"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures -> EnhancedAntiSpoofing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures -> EnhancedAntiSpoofing -> 1' + + # 18.10.10.1 (L2) Ensure 'Allow Use of Camera' is set to 'Disabled'. (Automated) + - id: 16245 + title: "Ensure 'Allow Use of Camera' is set to 'Disabled'." + description: "This policy setting controls whether the use of Camera devices on the machine are permitted. The recommended state for this setting is: Disabled." + rationale: "Cameras in a high security environment can pose serious privacy and data exfiltration risks - they should be disabled to help mitigate that risk." + impact: "Users will not be able to utilize the camera on a system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Camera\\Allow Use of Camera Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Camera.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.10.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera -> AllowCamera' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera -> AllowCamera -> 0' + + # 18.10.12.1 (L1) Ensure 'Turn off cloud consumer account state content' is set to 'Enabled'. (Automated) + - id: 16246 + title: "Ensure 'Turn off cloud consumer account state content' is set to 'Enabled'." + description: "This policy setting determines whether cloud consumer account state content is allowed in all Windows experiences. The recommended state for this setting is: Enabled." + rationale: "The use of consumer accounts in an enterprise managed environment is not good security practice as it could lead to possible data leakage." + impact: "Users will not be able to use Microsoft consumer accounts on the system, and associated Windows experiences will instead present default fallback content." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off cloud consumer account state content Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.12.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableConsumerAccountStateContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableConsumerAccountStateContent -> 1' + + # 18.10.12.2 (L1) Ensure 'Turn off Microsoft consumer experiences' is set to 'Enabled'. (Automated) + - id: 16247 + title: "Ensure 'Turn off Microsoft consumer experiences' is set to 'Enabled'." + description: "This policy setting turns off experiences that help consumers make the most of their devices and Microsoft account. The recommended state for this setting is: Enabled. Note: Per Microsoft TechNet, this policy setting only applies to Windows 10 Enterprise and Windows 10 Education editions." + rationale: "Having apps silently install in an enterprise managed environment is not good security practice - especially if the apps send data back to a third-party." + impact: "Users will no longer see personalized recommendations from Microsoft and notifications about their Microsoft account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off Microsoft consumer experiences Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.12.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableWindowsConsumerFeatures' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableWindowsConsumerFeatures -> 1' + + # 18.10.13.1 (L1) Ensure 'Require pin for pairing' is set to 'Enabled: First Time' OR 'Enabled: Always'. (Automated) + - id: 16248 + title: "Ensure 'Require pin for pairing' is set to 'Enabled: First Time' OR 'Enabled: Always'." + description: "This policy setting controls whether or not a PIN is required for pairing to a wireless display device. The recommended state for this setting is: Enabled: First Time OR Enabled: Always." + rationale: "If this setting is not configured or disabled then a PIN would not be required when pairing wireless display devices to the system, increasing the risk of unauthorized use." + impact: "The pairing ceremony for connecting to new wireless display devices will always require a PIN." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: First Time OR Enabled: Always: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Connect\\Require pin for pairing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WirelessDisplay.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). The new Choose one of the following actions sub-option was later added as of the Windows 10 Release 1809 Administrative Templates. Choosing Enabled in the older templates is the equivalent of choosing Enabled: First Time in the newer templates." + compliance: + - cis: ["18.10.13.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing -> r:^1$|^2$' + + # 18.10.14.1 (L1) Ensure 'Do not display the password reveal button' is set to 'Enabled'. (Automated) + - id: 16249 + title: "Ensure 'Do not display the password reveal button' is set to 'Enabled'." + description: "This policy setting allows you to configure the display of the password reveal button in password entry user experiences. The recommended state for this setting is: Enabled." + rationale: "This is a useful feature when entering a long and complex password, especially when using a touchscreen. The potential risk is that someone else may see your password while surreptitiously observing your screen." + impact: "The password reveal button will not be displayed after a user types a password in the password entry text box." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Do not display the password reveal button Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredUI.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.14.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal -> 1' + + # 18.10.14.2 (L1) Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'. (Automated) + - id: 16250 + title: "Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'." + description: "This policy setting controls whether administrator accounts are displayed when a user attempts to elevate a running application. The recommended state for this setting is: Disabled." + rationale: "Users could see the list of administrator accounts, making it slightly easier for a malicious user who has logged onto a console session to try to crack the passwords of those accounts." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Enumerate administrator accounts on elevation Note: This Group Policy path is provided by the Group Policy template CredUI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.14.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators -> 0' + + # 18.10.15.1 (L1) Ensure 'Allow Diagnostic Data' is set to 'Enabled: Diagnostic data off (not recommended)' or 'Enabled: Send required diagnostic data'. (Automated) + - id: 16251 + title: "Ensure 'Allow Diagnostic Data' is set to 'Enabled: Diagnostic data off (not recommended)' or 'Enabled: Send required diagnostic data'." + description: "This policy setting determines the amount of diagnostic and usage data reported to Microsoft: - A value of (0) Diagnostic data off (not recommended). Using this value, no diagnostic data is sent from the device. This value is only supported on Enterprise, Education, and Server editions. If you choose this setting, devices in your organization will still be secure. - A value of (1) Send required diagnostic data. This is the minimum diagnostic data necessary to keep Windows secure, up to date, and performing as expected. Using this value disables the Optional diagnostic data control in the Settings app. - A value of (3)Send optional diagnostic data. Additional diagnostic data is collected that helps us to detect, diagnose and fix issues, as well as make product improvements. Required diagnostic data will always be included when you choose to send optional diagnostic data. Optional diagnostic data can also include diagnostic log files and crash dumps. Use the Limit Dump Collection and the Limit Diagnostic Log Collection policies for more granular control of what optional diagnostic data is sent. Windows telemetry settings apply to the Windows operating system and some first party apps. This setting does not apply to third party apps running on Windows 10/11. The recommended state for this setting is: Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data. Note: If your organization relies on Windows Update, the minimum recommended setting is Required diagnostic data. Because no Windows Update information is collected when diagnostic data is off, important information about update failures is not sent. Microsoft uses this information to fix the causes of those failures and improve the quality of updates. Note #2: The Configure diagnostic data opt-in settings user interface group policy can be used to prevent end users from changing their data collection settings. Note #3: Enhanced diagnostic data setting is not available on Windows 11 and Windows Server 2022 and has been replaced with policies that can control the amount of optional diagnostic data that is sent. For more information on these settings visit Manage diagnostic data using Group Policy and MDM." + rationale: "Sending any data to a third-party vendor is a security concern and should only be done on an as needed basis." + impact: "Note that setting values of 0 or 1 will degrade certain experiences on the device." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Allow Diagnostic Data Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow Telemetry, but it was renamed to Allow Diagnostic Data starting with the Windows 11 Release 21H2 Administrative Templates." + references: + - "https://docs.microsoft.com/en-us/windows/privacy/configure-windows-diagnostic-data-in-your-organization" + compliance: + - cis: ["18.10.15.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry -> 1' + + # 18.10.15.2 (L2) Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage' (Automated) + - id: 16252 + title: "Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage'." + description: "This policy setting controls whether the Connected User Experience and Telemetry service can automatically use an authenticated proxy to send data back to Microsoft. The recommended state for this setting is: Enabled: Disable Authenticated Proxy usage." + rationale: "Sending any data to a third-party vendor is a security concern and should only be done on an as needed basis." + impact: "The Connected User Experience and Telemetry service will be blocked from automatically using an authenticated proxy." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Authenticated Proxy usage: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableEnterpriseAuthProxy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableEnterpriseAuthProxy -> 1' + + # 18.10.15.3 (L1) Ensure 'Disable OneSettings Downloads' is set to 'Enabled'. (Automated) + - id: 16253 + title: "Ensure 'Disable OneSettings Downloads' is set to 'Enabled'." + description: "This policy setting controls whether Windows attempts to connect with the OneSettings service to download configuration settings. The recommended state for this setting is: Enabled." + rationale: "Sending data to a third-party vendor is a security concern and should only be done on an as-needed basis." + impact: "Windows will not connect to the OneSettings service to download configuration settings." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Disable OneSettings Downloads Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableOneSettingsDownloads' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableOneSettingsDownloads -> 1' + + # 18.10.15.4 (L1) Ensure 'Do not show feedback notifications' is set to 'Enabled'. (Automated) + - id: 16254 + title: "Ensure 'Do not show feedback notifications' is set to 'Enabled'." + description: "This policy setting allows an organization to prevent its devices from showing feedback questions from Microsoft. The recommended state for this setting is: Enabled." + rationale: "Users should not be sending any feedback to third-party vendors in an enterprise managed environment." + impact: "Users will no longer see feedback notifications through the Windows Feedback app." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Do not show feedback notifications Note: This Group Policy path may not exist by default. It is provided by the Group Policy template FeedbackNotifications.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DoNotShowFeedbackNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DoNotShowFeedbackNotifications -> 1' + + # 18.10.15.5 (L1) Ensure 'Enable OneSettings Auditing' is set to 'Enabled'. (Automated) + - id: 16255 + title: "Ensure 'Enable OneSettings Auditing' is set to 'Enabled'." + description: "This policy setting controls whether Windows records attempts to connect with the OneSettings service to the Event Log. The recommended state for this setting is: Enabled." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Windows will record attempts to connect with the OneSettings service to the Applications and Services Logs\\Microsoft\\Windows\\Privacy-Auditing\\Operational Event Log channel." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Enable OneSettings Auditing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.5"] + - cis_csc_v8: ["6.3"] + - cis_csc_v7: ["8.5"] + - iso_27001-2013: ["A.12.2.1"] + - pci_dss_v3.2.1: ["8.3"] + - soc_2: ["CC6.1", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> EnableOneSettingsAuditing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> EnableOneSettingsAuditing -> 1' + + # 18.10.15.6 (L1) Ensure 'Limit Diagnostic Log Collection' is set to 'Enabled'. (Automated) + - id: 16256 + title: "Ensure 'Limit Diagnostic Log Collection' is set to 'Enabled'." + description: "This policy setting controls whether additional diagnostic logs are collected when more information is needed to troubleshoot a problem on the device. The recommended state for this setting is: Enabled. Note: Diagnostic logs are only sent when the device has been configured to send optional diagnostic data. Diagnostic data is limited when recommendation Allow Diagnostic Data is set to Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data to send only basic information." + rationale: "Sending data to a third-party vendor is a security concern and should only be done on an as-needed basis." + impact: "Diagnostic logs and information such as crash dumps will not be collected for transmission to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Limit Diagnostic Log Collection Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDiagnosticLogCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDiagnosticLogCollection -> 1' + + # 18.10.15.7 (L1) Ensure 'Limit Dump Collection' is set to 'Enabled'. (Automated) + - id: 16257 + title: "Ensure 'Limit Dump Collection' is set to 'Enabled'." + description: "This policy setting limits the type of memory dumps that can be collected when more information is needed to troubleshoot a problem. The recommended state for this setting is: Enabled. Note: Memory dumps are only sent when the device has been configured to send optional diagnostic data. Diagnostic data is limited when recommendation Allow Diagnostic Data is set to Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data to send only basic information." + rationale: "Memory dumps can contain sensitive information - sending such data to a third-party vendor is a security concern and should only be done on an as-needed basis." + impact: "Windows Error Reporting will not send full and/or heap memory dumps to Microsoft - they will be limited to kernel mini and/or user mode triage memory dumps (if sending optional diagnostic data is permitted)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Limit Dump Collection Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.7"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDumpCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDumpCollection -> 1' + + # 18.10.15.8 (L1) Ensure 'Toggle user control over Insider builds' is set to 'Disabled'. (Automated) + - id: 16258 + title: "Ensure 'Toggle user control over Insider builds' is set to 'Disabled'." + description: 'This policy setting determines whether users can access the Insider build controls in the Advanced Options for Windows Update. These controls are located under "Get Insider builds," and enable users to make their devices available for downloading and installing Windows preview software. The recommended state for this setting is: Disabled. Note: This policy setting applies only to devices running Windows Server 2016, up until Release 1703. For Release 1709 or newer, Microsoft encourages using the Manage preview builds setting (recommendation title ''Manage preview builds''). We have kept this setting in the benchmark to ensure that any older builds of Windows Server 2016 in the environment are still enforced.' + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + impact: 'The item "Get Insider builds" will be unavailable.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Toggle user control over Insider builds Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AllowBuildPreview.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.8"] + - cis_csc_v8: ["2.5"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "CM.L2-3.4.9"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-7(5)"] + - pci_dss_v4.0: ["1.2.5", "2.2.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> AllowBuildPreview' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> AllowBuildPreview -> 0' + + # 18.10.26.1.1 (L1) Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'. (Automated) + - id: 16259 + title: "Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.1.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention -> 0' + + # 18.10.26.1.2 (L1) Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'. (Automated) + - id: 16260 + title: "Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "When event logs fill to capacity, they will stop recording information unless the retention method for each is set so that the computer will overwrite the oldest entries with the most recent ones. To mitigate the risk of loss of recent data, you can configure the retention method so that older events are overwritten as needed. The consequence of this configuration is that older events will be removed from the logs. Attackers can take advantage of such a configuration, because they can generate a large number of extraneous events to overwrite any evidence of their attack. These risks can be somewhat reduced if you automate the archival and backup of event log data. Ideally, all specifically monitored events should be sent to a server that uses Microsoft System Center Operations Manager (SCOM) or some other automated monitoring tool. Such a configuration is particularly important because an attacker who successfully compromises a server could clear the Security log. If all events are sent to a monitoring server, then you will be able to gather forensic information about the attacker's activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.1.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> n:^(\d+) compare >= 32768' + + # 18.10.26.2.1 (L1) Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'. (Automated) + - id: 16261 + title: "Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention -> 0' + + # 18.10.26.2.2 (L1) Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'. (Automated) + - id: 16262 + title: "Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 196,608 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "When event logs fill to capacity, they will stop recording information unless the retention method for each is set so that the computer will overwrite the oldest entries with the most recent ones. To mitigate the risk of loss of recent data, you can configure the retention method so that older events are overwritten as needed. The consequence of this configuration is that older events will be removed from the logs. Attackers can take advantage of such a configuration, because they can generate a large number of extraneous events to overwrite any evidence of their attack. These risks can be somewhat reduced if you automate the archival and backup of event log data. Ideally, all specifically monitored events should be sent to a server that uses Microsoft System Center Operations Manager (SCOM) or some other automated monitoring tool. Such a configuration is particularly important because an attacker who successfully compromises a server could clear the Security log. If all events are sent to a monitoring server, then you will be able to gather forensic information about the attacker's activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 196,608 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> n:^(\d+) compare >= 196608' + + # 18.10.26.3.1 (L1) Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'. (Automated) + - id: 16263 + title: "Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.3.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention -> 0' + + # 18.10.26.3.2 (L1) Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'. (Automated) + - id: 16264 + title: "Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "When event logs fill to capacity, they will stop recording information unless the retention method for each is set so that the computer will overwrite the oldest entries with the most recent ones. To mitigate the risk of loss of recent data, you can configure the retention method so that older events are overwritten as needed. The consequence of this configuration is that older events will be removed from the logs. Attackers can take advantage of such a configuration, because they can generate a large number of extraneous events to overwrite any evidence of their attack. These risks can be somewhat reduced if you automate the archival and backup of event log data. Ideally, all specifically monitored events should be sent to a server that uses Microsoft System Center Operations Manager (SCOM) or some other automated monitoring tool. Such a configuration is particularly important because an attacker who successfully compromises a server could clear the Security log. If all events are sent to a monitoring server, then you will be able to gather forensic information about the attacker's activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.3.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> n:^(\d+) compare >= 32768' + + # 18.10.26.4.1 (L1) Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'. (Automated) + - id: 16265 + title: "Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.4.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention -> 0' + + # 18.10.26.4.2 (L1) Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'. (Automated) + - id: 16266 + title: "Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "When event logs fill to capacity, they will stop recording information unless the retention method for each is set so that the computer will overwrite the oldest entries with the most recent ones. To mitigate the risk of loss of recent data, you can configure the retention method so that older events are overwritten as needed. The consequence of this configuration is that older events will be removed from the logs. Attackers can take advantage of such a configuration, because they can generate a large number of extraneous events to overwrite any evidence of their attack. These risks can be somewhat reduced if you automate the archival and backup of event log data. Ideally, all specifically monitored events should be sent to a server that uses Microsoft System Center Operations Manager (SCOM) or some other automated monitoring tool. Such a configuration is particularly important because an attacker who successfully compromises a server could clear the Security log. If all events are sent to a monitoring server, then you will be able to gather forensic information about the attacker's activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.4.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> n:^(\d+) compare >= 32768' + + # 18.10.29.2 (L1) Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'. (Automated) + - id: 16267 + title: "Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'." + description: "Disabling Data Execution Prevention can allow certain legacy plug-in applications to function without terminating Explorer. The recommended state for this setting is: Disabled. Note: Some legacy plug-in applications and other software may not function with Data Execution Prevention and will require an exception to be defined for that specific plug-in/software." + rationale: "Data Execution Prevention is an important security feature supported by Explorer that helps to limit the impact of certain types of malware." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off Data Execution Prevention for Explorer Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Explorer.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.29.2"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention -> 0' + + # 18.10.29.3 (L1) Ensure 'Turn off heap termination on corruption' is set to 'Disabled'. (Automated) + - id: 16268 + title: "Ensure 'Turn off heap termination on corruption' is set to 'Disabled'." + description: "Without heap termination on corruption, legacy plug-in applications may continue to function when a File Explorer session has become corrupt. Ensuring that heap termination on corruption is active will prevent this. The recommended state for this setting is: Disabled." + rationale: "Allowing an application to function after its session has become corrupt increases the risk posture to the system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off heap termination on corruption Note: This Group Policy path is provided by the Group Policy template Explorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.29.3"] + - cis_csc_v7: ["8.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption -> 0' + + # 18.10.29.4 (L1) Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'. (Automated) + - id: 16269 + title: "Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'." + description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." + rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off shell protocol protected mode Note: This Group Policy path is provided by the Group Policy template WindowsExplorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.29.4"] + - cis_csc_v7: ["8.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior -> 0' + + # 18.10.37.1 (L2) Ensure 'Turn off location' is set to 'Enabled'. (Automated) + - id: 16270 + title: "Ensure 'Turn off location' is set to 'Enabled'." + description: "This policy setting turns off the location feature for the computer. The recommended state for this setting is: Enabled." + rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." + impact: "The location feature is turned off, and all programs on the computer are prevented from using location information from the location feature." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Turn off location Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sensors.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.37.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> 1' + + # 18.10.41.1 (L2) Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled'. (Automated) + - id: 16271 + title: "Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled'." + description: "This policy setting allows backup and restore of cellular text messages to Microsoft's cloud services. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, data should never be sent to any third-party since this data could contain sensitive information." + impact: "Cellular text messages will not be backed up to (or restored from) Microsoft's cloud services." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Messaging\\Allow Message Service Cloud Sync Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Messaging.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.41.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging -> AllowMessageSync' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging -> AllowMessageSync -> 0' + + # 18.10.42.1 (L1) Ensure 'Block all consumer Microsoft account user authentication' is set to 'Enabled'. (Automated) + - id: 16272 + title: "Ensure 'Block all consumer Microsoft account user authentication' is set to 'Enabled'." + description: "This setting determines whether applications and services on the device can utilize new consumer Microsoft account authentication via the Windows OnlineID and WebAccountManager APIs. The recommended state for this setting is: Enabled." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used on their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + impact: "All applications and services on the device will be prevented from new authentications using consumer Microsoft accounts via the Windows OnlineID and WebAccountManager APIs. Authentications performed directly by the user in web browsers or in apps that use OAuth will remain unaffected." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft accounts\\Block all consumer Microsoft account user authentication Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSAPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.42.1"] + - cis_csc_v8: ["5.3"] + - cis_csc_v7: ["16.8"] + - cmmc_v2.0: ["IA.L2-3.5.6"] + - iso_27001-2013: ["A.9.2.1"] + - nist_sp_800-53: ["AC-2(3)"] + - pci_dss_v3.2.1: ["8.1.4"] + - pci_dss_v4.0: ["8.3.7"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount -> DisableUserAuth' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount -> DisableUserAuth -> 1' + + # 18.10.43.5.1 (L1) Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled'. (Automated) + - id: 16273 + title: "Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled'." + description: 'This policy setting configures a local override for the configuration to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to "Microsft Defender Antivirus Cloud Protection Service". This setting can only be set by Group Policy. The recommended state for this setting is: Disabled.' + rationale: "The decision on whether or not to participate in Microsoft MAPS / Microsoft Defender Antivirus Cloud Protection Service for malicious software reporting should be made centrally in an enterprise managed environment, so that all computers within it behave consistently in that regard. Configuring this setting to Disabled ensures that the decision remains centrally managed." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\MAPS\\Configure local setting override for reporting to Microsoft MAPS Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.5.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting -> 0' + + # 18.10.43.5.2 (L2) Ensure 'Join Microsoft MAPS' is set to 'Disabled'. (Automated) + - id: 16274 + title: "Ensure 'Join Microsoft MAPS' is set to 'Disabled'." + description: "This policy setting allows you to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to Windows Defender Antivirus Cloud Protection Service and then Microsoft Defender Antivirus Cloud Protection Service. Microsoft MAPS / Microsoft Defender Antivirus Cloud Protection Service is the online community that helps you choose how to respond to potential threats. The community also helps stop the spread of new malicious software infections. You can choose to send basic or additional information about detected software. Additional information helps Microsoft create new definitions and help it to protect your computer. Possible options are: - - - (0x0) Disabled (default) (0x1) Basic membership (0x2) Advanced membership Basic membership will send basic information to Microsoft about software that has been detected including where the software came from the actions that you apply or that are applied automatically and whether the actions were successful. Advanced membership in addition to basic information will send more information to Microsoft about malicious software spyware and potentially unwanted software including the location of the software file names how the software operates and how it has impacted your computer. The recommended state for this setting is: Disabled." + rationale: "The information that would be sent can include things like location of detected items on your computer if harmful software was removed. The information would be automatically collected and sent. In some instances personal information might unintentionally be sent to Microsoft. However, Microsoft states that it will not use this information to identify you or contact you. For privacy reasons in high security environments, it is best to prevent these data submissions altogether." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\MAPS\\Join Microsoft MAPS Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.5.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting -> 0' + + # 18.10.43.6.1.1 (L1) Ensure 'Configure Attack Surface Reduction rules' is set to 'Enabled'. (Automated) + - id: 16275 + title: "Ensure 'Configure Attack Surface Reduction rules' is set to 'Enabled'." + description: "This policy setting controls the state for the Attack Surface Reduction (ASR) rules. The recommended state for this setting is: Enabled." + rationale: "Attack surface reduction helps prevent actions and apps that are typically used by exploit-seeking malware to infect machines." + impact: "When a rule is triggered, a notification will be displayed from the Action Center." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Microsoft Defender Exploit Guard\\Attack Surface Reduction\\Configure Attack Surface Reduction rules Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.6.1.1"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR -> ExploitGuard_ASR_Rules' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR -> ExploitGuard_ASR_Rules -> 1' + + # 18.10.43.6.1.2 (L1) Ensure 'Configure Attack Surface Reduction rules: Set the state for each ASR rule' is configured. (Automated) + - id: 16276 + title: "Ensure 'Configure Attack Surface Reduction rules: Set the state for each ASR rule' is configured." + description: "This policy setting sets the Attack Surface Reduction rules. The recommended state for this setting is: 26190899-1602-49e8-8b27-eb1d0a1ce869 - 1 (Block Office communication application from creating child processes) 3b576869-a4ec-4529-8536-b80a7769e899 - 1 (Block Office applications from creating executable content) 56a863a9-875e-4185-98a7-b882c64b5ce5 - 1 (Block abuse of exploited vulnerable signed drivers) 5beb7efe-fd9a-4556-801d-275e5ffc04cc - 1 (Block execution of potentially obfuscated scripts) 75668c1f-73b5-4cf0-bb93-3ecf5cb7cc84 - 1 (Block Office applications from injecting code into other processes) 7674ba52-37eb-4a4f-a9a1-f0f9a1619a2c - 1 (Block Adobe Reader from creating child processes) 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 - 1 (Block credential stealing from the Windows local security authority subsystem (lsass.exe)) b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4 - 1 (Block untrusted and unsigned processes that run from USB) be9ba2d9-53ea-4cdc-84e5-9b1eeee46550 - 1 (Block executable content from email client and webmail) d4f940ab-401b-4efc-aadc-ad5f3c50688a - 1 (Block Office applications from creating child processes) Note: More information on ASR rules can be found at the following link: Use Attack surface reduction rules to prevent malware infection | Microsoft Docs." + rationale: "Attack surface reduction helps prevent actions and apps that are typically used by exploit-seeking malware to infect machines." + impact: "When a rule is triggered, a notification will be displayed from the Action Center. Note: The following rules apply to Windows Server 2019 and 2022, but do not apply to Windows Server 2012 R2 and 2016: 92e97fa1-2edf-4476-bdd6-9dd0b4dddc7b (Block Win32 API calls from Office macro), d3e037e1-3eb8-44c8-a917-57927947596d (Block JavaScript or VBScript from launching downloaded executable content), and e6db77e5-3df2-4cf1-b95a-636979351e5b (Block persistence through WMI event subscription)." + remediation: "To establish the recommended configuration via GP, set the following UI path so that 26190899-1602-49e8-8b27-eb1d0a1ce869, 3b576869-a4ec-4529-8536-b80a7769e899, 56a863a9-875e-4185-98a7-b882c64b5ce5, 5beb7efe-fd9a-4556-801d-275e5ffc04cc, 75668c1f-73b5-4cf0-bb93-3ecf5cb7cc84, 7674ba52-37eb-4a4f-a9a1-f0f9a1619a2c, 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2, b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4, be9ba2d9-53ea-4cdc-84e5-9b1eeee46550, and d4f940ab-401b-4efc-aadc-ad5f3c50688a are each set to a value of 1: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Microsoft Defender Exploit Guard\\Attack Surface Reduction\\Configure Attack Surface Reduction rules: Set the state for each ASR rule Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.6.1.2"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D4F940AB-401B-4EFC-AADC-AD5F3C50688A' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 3B576869-A4EC-4529-8536-B80A7769E899' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D3E037E1-3EB8-44C8-A917-57927947596D' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 26190899-1602-49E8-8B27-eB1D0A1CE869' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 7674BA52-37EB-4A4F-A9A1-F0F9A1619A2C' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 9E6C4E1F-7D60-472F-bA1A-A39EF669E4B2' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D4F940AB-401B-4EFC-AADC-AD5F3C50688A -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 3B576869-A4EC-4529-8536-B80A7769E899 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D3E037E1-3EB8-44C8-A917-57927947596D -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 26190899-1602-49E8-8B27-eB1D0A1CE869 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 7674BA52-37EB-4A4F-A9A1-F0F9A1619A2C -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 9E6C4E1F-7D60-472F-bA1A-A39EF669E4B2 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4 -> 1' + + # 18.10.43.6.3.1 (L1) Ensure 'Prevent users and apps from accessing dangerous websites' is set to 'Enabled: Block'. (Automated) + - id: 16277 + title: "Ensure 'Prevent users and apps from accessing dangerous websites' is set to 'Enabled: Block'." + description: "This policy setting controls Microsoft Defender Exploit Guard network protection. The recommended state for this setting is: Enabled: Block." + rationale: "This setting can help prevent employees from using any application to access dangerous domains that may host phishing scams, exploit-hosting sites, and other malicious content on the Internet." + impact: "Users and applications will not be able to access dangerous domains." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Microsoft Defender Exploit Guard\\Network Protection\\Prevent users and apps from accessing dangerous websites Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.6.3.1"] + - cis_csc_v8: ["9.3", "10.5"] + - cis_csc_v7: ["7.4", "8.3"] + - cmmc_v2.0: ["SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.1.6", "1.4", "11.4"] + - pci_dss_v4.0: ["1.2.6", "1.4.2"] + - soc_2: ["CC5.2", "CC6.6", "CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection -> EnableNetworkProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection -> EnableNetworkProtection -> 1' + + # 18.10.43.7.1 (L2) Ensure 'Enable file hash computation feature' is set to 'Enabled'. (Automated) + - id: 16278 + title: "Ensure 'Enable file hash computation feature' is set to 'Enabled'." + description: "This setting determines whether hash values are computed for files scanned by Microsoft Defender. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to monitor for suspicious and known malicious activity. File hashes are a reliable way of detecting changes to files, and can speed up the scan process by skipping files that have not changed since they were last scanned and determined to be safe. A changed file hash can also be cause for additional scrutiny." + impact: "This setting could cause performance degradation during initial deployment and for users where new executable content is frequently being created (such as software developers), or where applications are frequently installed or updated. For more information on this setting, please visit Security baseline (FINAL): Windows 10 and Windows Server, version 2004 - Microsoft Tech Community - 1543631. Note: The impact of this setting should be monitored closely during deployment to ensure user and system performance impact is within acceptable limits." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\MpEngine\\Enable file hash computation feature Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 2004 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.7.1"] + - cis_csc_v8: ["10.1"] + - cis_csc_v7: ["8.1"] + - cmmc_v2.0: ["SI.L1-3.14.2"] + - hipaa: ["164.308(a)(5)(ii)(B)"] + - iso_27001-2013: ["A.12.2.1"] + - pci_dss_v3.2.1: ["5.1"] + - pci_dss_v4.0: ["5.1.1", "5.2.1", "5.2.2", "5.3.2"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine -> EnableFileHashComputation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine -> EnableFileHashComputation -> 1' + + # 18.10.43.10.1 (L1) Ensure 'Scan all downloaded files and attachments' is set to 'Enabled'. (Automated) + - id: 16279 + title: "Ensure 'Scan all downloaded files and attachments' is set to 'Enabled'." + description: "This policy setting configures scanning for all downloaded files and attachments. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Scan all downloaded files and attachments Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-antivirus/configure-real-time-protection-microsoft-defender-antivirus" + compliance: + - cis: ["18.10.43.10.1"] + - cis_csc_v7: ["8.1"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableIOAVProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableIOAVProtection -> 0' + + # 18.10.43.10.2 (L1) Ensure 'Turn off real-time protection' is set to 'Disabled'. (Automated) + - id: 16280 + title: "Ensure 'Turn off real-time protection' is set to 'Disabled'." + description: "This policy setting configures real-time protection prompts for known malware detection. Microsoft Defender Antivirus alerts you when malware or potentially unwanted software attempts to install itself or to run on your computer. The recommended state for this setting is: Disabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Turn off real - time protection Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-antivirus/configure-real-time-protection-microsoft-defender-antivirus" + compliance: + - cis: ["18.10.43.10.2"] + - cis_csc_v7: ["8.1"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableRealtimeMonitoring' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableRealtimeMonitoring -> 0' + + # 18.10.43.10.3 (L1) Ensure 'Turn on behavior monitoring' is set to 'Enabled'. (Automated) + - id: 16281 + title: "Ensure 'Turn on behavior monitoring' is set to 'Enabled'." + description: "This policy setting allows you to configure behavior monitoring for Microsoft Defender Antivirus. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + impact: "None - this is the default configuration." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Turn on behavior monitoring Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.10.3"] + - cis_csc_v8: ["10.7"] + - cis_csc_v7: ["8.1"] + - iso_27001-2013: ["A.12.2.1"] + - pci_dss_v4.0: ["5.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableBehaviorMonitoring' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableBehaviorMonitoring -> 0' + + # 18.10.43.10.4 (L1) Ensure 'Turn on script scanning' is set to 'Enabled'. (Automated) + - id: 16282 + title: "Ensure 'Turn on script scanning' is set to 'Enabled'." + description: "This policy setting allows script scanning to be turned on/off. Script scanning intercepts scripts then scans them before they are executed on the system. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Turn on script scanning Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/configure-advanced-scan-types-microsoft-defender-antivirus?view=o365-worldwide" + compliance: + - cis: ["18.10.43.10.4"] + - cis_csc_v8: ["10.7"] + - cis_csc_v7: ["8.1"] + - iso_27001-2013: ["A.12.2.1"] + - pci_dss_v4.0: ["5.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableScriptScanning' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableScriptScanning -> 0' + + # 18.10.43.12.1 (L2) Ensure 'Configure Watson events' is set to 'Disabled'. (Automated) + - id: 16283 + title: "Ensure 'Configure Watson events' is set to 'Disabled'." + description: "This policy setting allows you to configure whether or not Watson events are sent. The recommended state for this setting is: Disabled." + rationale: "Watson events are the reports that get sent to Microsoft when a program or service crashes or fails, including the possibility of automatic submission. Preventing this information from being sent can help reduce privacy concerns." + impact: "Watson events will not be sent to Microsoft automatically when a program or service crashes or fails." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Reporting\\Configure Watson events Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.12.1"] + - cis_csc_v7: ["13.3"] + - iso_27001-2013: ["A.13.1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts -> 1' + + # 18.10.43.13.1 (L1) Ensure 'Scan removable drives' is set to 'Enabled'. (Automated) + - id: 16284 + title: "Ensure 'Scan removable drives' is set to 'Enabled'." + description: "This policy setting allows you to manage whether or not to scan for malicious software and unwanted software in the contents of removable drives, such as USB flash drives, when running a full scan. The recommended state for this setting is: Enabled." + rationale: "It is important to ensure that any present removable drives are always included in any type of scan, as removable drives are more likely to contain malicious software brought in to the enterprise managed environment from an external, unmanaged computer." + impact: "Removable drives will be scanned during any type of scan by Microsoft Defender Antivirus." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Scan\\Scan removable drives Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.13.1"] + - cis_csc_v8: ["10.4"] + - cis_csc_v7: ["8.4"] + - cmmc_v2.0: ["SC.L2-3.13.13", "SI.L1-3.14.5"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + - pci_dss_v4.0: ["5.3.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning -> 0' + + # 18.10.43.13.2 (L1) Ensure 'Turn on e-mail scanning' is set to 'Enabled'. (Automated) + - id: 16285 + title: "Ensure 'Turn on e-mail scanning' is set to 'Enabled'." + description: "This policy setting allows you to configure e-mail scanning. When e-mail scanning is enabled, the engine will parse the mailbox and mail files, according to their specific format, in order to analyze the mail bodies and attachments. Several e-mail formats are currently supported, for example: pst (Outlook), dbx, mbx, mime (Outlook Express), binhex (Mac). The recommended state for this setting is: Enabled." + rationale: "Incoming e-mails should be scanned by an antivirus solution such as Microsoft Defender Antivirus, as email attachments are a commonly used attack vector to infiltrate computers with malicious software." + impact: "E-mail scanning by Microsoft Defender Antivirus will be enabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Scan\\Turn on e-mail scanning Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.13.2"] + - cis_csc_v7: ["8.1"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning -> 0' + + # 18.10.43.16 (L1) Ensure 'Configure detection for potentially unwanted applications' is set to 'Enabled: Block'. (Automated) + - id: 16286 + title: "Ensure 'Configure detection for potentially unwanted applications' is set to 'Enabled: Block'." + description: "This policy setting controls detection and action for Potentially Unwanted Applications (PUA), which are sneaky unwanted application bundlers or their bundled applications, that can deliver adware or malware. The recommended state for this setting is: Enabled: Block. For more information, see this link: Block potentially unwanted applications with Microsoft Defender Antivirus | Microsoft Docs." + rationale: "Potentially unwanted applications can increase the risk of your network being infected with malware, cause malware infections to be harder to identify, and can waste IT resources in cleaning up the applications. They should be blocked from installation." + impact: "Applications that are identified by Microsoft as PUA will be blocked at download and install time." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Configure detection for potentially unwanted applications Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.16"] + - cis_csc_v8: ["10.6"] + - cis_csc_v7: ["2.7", "8.1"] + - iso_27001-2013: ["A.12.1.2", "A.12.2.1", "A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["11.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> PUAProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> PUAProtection -> 1' + + # 18.10.43.17 (L1) Ensure 'Turn off Microsoft Defender AntiVirus' is set to 'Disabled'. (Automated) + - id: 16287 + title: "Ensure 'Turn off Microsoft Defender AntiVirus' is set to 'Disabled'." + description: "This policy setting turns off Microsoft Defender Antivirus. If the setting is configured to Disabled, Microsoft Defender Antivirus runs and computers are scanned for malware and other potentially unwanted software. The recommended state for this setting is: Disabled." + rationale: "It is important to ensure a current, updated antivirus product is scanning each computer for malicious file activity. Microsoft provides a competent solution out of the box in Microsoft Defender Antivirus. Organizations that choose to purchase a reputable third-party antivirus solution may choose to exempt themselves from this recommendation in lieu of the commercial alternative." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Turn off Microsoft Defender AntiVirus Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn off Windows Defender, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates. It was again renamed to Windows Defender Antivirus starting with the Windows 10 Release 2004 Administrative Templates." + compliance: + - cis: ["18.10.43.17"] + - cis_csc_v8: ["10.6"] + - cis_csc_v7: ["8.1"] + - iso_27001-2013: ["A.12.2.1"] + - pci_dss_v3.2.1: ["11.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsDefender' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsDefender -> DisableAntiSpyware' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsDefender -> DisableAntiSpyware -> 0' + + # 18.10.51.1 (L1) Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'. (Automated) + - id: 16288 + title: "Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'." + description: "This policy setting lets you prevent apps and features from working with files on OneDrive using the Next Generation Sync Client. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting prevents users from accidentally (or intentionally) uploading confidential or sensitive corporate information to the OneDrive cloud service using the Next Generation Sync Client. Note: This security concern applies to any cloud-based file storage application installed on a server, not just the one supplied with Windows Server." + impact: "Users can't access OneDrive from the OneDrive app and file picker. Windows Store apps can't access OneDrive using the WinRT API. OneDrive doesn't appear in the navigation pane in File Explorer. OneDrive files aren't kept in sync with the cloud. Users can't automatically upload photos and videos from the camera roll folder. Note: If your organization uses Office 365, be aware that this setting will prevent users from saving files to OneDrive/SkyDrive. Note #2: If your organization has decided to implement OneDrive for Business and therefore needs to except itself from this recommendation, we highly suggest that you also obtain and utilize the OneDrive.admx/adml template that is bundled with the latest OneDrive client, as noted at this link (this template is not included with the Windows Administrative Templates). Two alternative OneDrive settings in particular from that template are worth your consideration: - Allow syncing OneDrive accounts for only specific organizations - a computer - based setting that restricts OneDrive client connections to only approved tenant IDs. - Prevent users from synchronizing personal OneDrive accounts - a user-based setting that prevents use of consumer OneDrive (i.e. non-business)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\OneDrive\\Prevent the usage of OneDrive for file storage Note: This Group Policy path may not exist by default. It is provided by the Group Policy template SkyDrive.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer). However, we strongly recommend you only use the version included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Older versions of the templates had conflicting settings in different template files for both OneDrive & SkyDrive, until it was cleaned up properly in the above version. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Prevent the usage of SkyDrive for file storage, but it was renamed starting with the Windows 10 RTM (Release 1507) Administrative Templates." + compliance: + - cis: ["18.10.51.1"] + - cis_csc_v7: ["13.4"] + - iso_27001-2013: ["A.13.2.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC -> 1' + + # 18.10.56.1 (L2) Ensure 'Turn off Push To Install service' is set to 'Enabled'. (Automated) + - id: 16289 + title: "Ensure 'Turn off Push To Install service' is set to 'Enabled'." + description: "This policy setting controls whether users can push Apps to the device from the Microsoft Store App running on other devices or the web. The recommended state for this setting is: Enabled." + rationale: "In a high security managed environment, application installations should be managed centrally by IT staff, not by end users." + impact: "Users will not be able to push Apps to this device from the Microsoft Store running on other devices or the web." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Push to Install\\Turn off Push To Install service Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PushToInstall.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.56.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall -> DisablePushToInstall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall -> DisablePushToInstall -> 1' + + # 18.10.57.2.2 (L1) Ensure 'Do not allow passwords to be saved' is set to 'Enabled'. (Automated) + - id: 16290 + title: "Ensure 'Do not allow passwords to be saved' is set to 'Enabled'." + description: "This policy setting helps prevent Remote Desktop clients from saving passwords on a computer. The recommended state for this setting is: Enabled. Note: If this policy setting was previously configured as Disabled or Not configured, any previously saved passwords will be deleted the first time a Remote Desktop client disconnects from any server." + rationale: "An attacker with physical access to the computer may be able to break the protection guarding saved passwords. An attacker who compromises a user's account and connects to their computer could use saved passwords to gain access to additional hosts." + impact: "The password saving checkbox will be disabled for Remote Desktop clients and users will not be able to save passwords." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Connection Client\\Do not allow passwords to be saved Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.2.2"] + - cis_csc_v7: ["16.11"] + - iso_27001-2013: ["A.8.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving -> 1' + + # 18.10.57.3.2.1 (L2) Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'. (Automated) + - id: 16291 + title: "Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'." + description: "This policy setting allows you to restrict users to a single Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "This setting ensures that users & administrators who Remote Desktop to a server will continue to use the same session - if they disconnect and reconnect, they will go back to the same session they were using before, preventing the creation of a second simultaneous session. This both prevents unnecessary resource usage by having the server host unnecessary additional sessions (which would put extra load on the server) and also ensures a consistency of experience for the user." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Connections\\Restrict Remote Desktop Services users to a single Remote Desktop Services session Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Restrict Terminal Services users to a single remote session, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.10.57.3.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fSingleSessionPerUser' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fSingleSessionPerUser -> 1' + + # 18.10.57.3.3.1 (L2) Ensure 'Do not allow COM port redirection' is set to 'Enabled'. (Automated) + - id: 16292 + title: "Ensure 'Do not allow COM port redirection' is set to 'Enabled'." + description: "This policy setting specifies whether to prevent the redirection of data to client COM ports from the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for COM port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + impact: "Users in a Remote Desktop Services session will not be able to redirect server data to local (client) COM ports." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow COM port redirection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.3.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> 1' + + # 18.10.57.3.3.2 (L1) Ensure 'Do not allow drive redirection' is set to 'Enabled'. (Automated) + - id: 16293 + title: "Ensure 'Do not allow drive redirection' is set to 'Enabled'." + description: "This policy setting prevents users from sharing the local drives on their client computers to Remote Desktop Servers that they access. Mapped drives appear in the session folder tree in Windows Explorer in the following format: \\\\TSClient\\$ If local drives are shared they are left vulnerable to intruders who want to exploit the data that is stored on them. The recommended state for this setting is: Enabled." + rationale: "Data could be forwarded from the user's Remote Desktop Services session to the user's local computer without any direct user interaction. Malicious software already present on a compromised server would have direct and stealthy disk access to the user's local computer during the Remote Desktop session." + impact: "Drive redirection will not be possible. In most situations, traditional network drive mapping to file shares (including administrative shares) performed manually by the connected user will serve as a capable substitute to still allow file transfers when needed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow drive redirection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm -> 1' + + # 18.10.57.3.3.3 (L2) Ensure 'Do not allow LPT port redirection' is set to 'Enabled'. (Automated) + - id: 16294 + title: "Ensure 'Do not allow LPT port redirection' is set to 'Enabled'." + description: "This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for LPT port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + impact: "Users in a Remote Desktop Services session will not be able to redirect server data to local (client) LPT ports." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow LPT port redirection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> 1' + + # 18.10.57.3.3.4 (L2) Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'. (Automated) + - id: 16295 + title: "Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'." + description: "This policy setting allows you to control the redirection of supported Plug and Play devices, such as Windows Portable Devices, to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for Plug and Play device redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + impact: "Users in a Remote Desktop Services session will not be able to redirect their supported (local client) Plug and Play devices to the remote computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow supported Plug and Play device redirection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.3.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> 1' + + # 18.10.57.3.9.1 (L1) Ensure 'Always prompt for password upon connection' is set to 'Enabled'. (Automated) + - id: 16296 + title: "Ensure 'Always prompt for password upon connection' is set to 'Enabled'." + description: "This policy setting specifies whether Remote Desktop Services always prompts the client computer for a password upon connection. You can use this policy setting to enforce a password prompt for users who log on to Remote Desktop Services, even if they already provided the password in the Remote Desktop Connection client. The recommended state for this setting is: Enabled." + rationale: "Users have the option to store both their username and password when they create a new Remote Desktop Connection shortcut. If the server that runs Remote Desktop Services allows users who have used this feature to log on to the server but not enter their password, then it is possible that an attacker who has gained physical access to the user's computer could connect to a Remote Desktop Server through the Remote Desktop Connection shortcut, even though they may not know the user's password." + impact: "Users cannot automatically log on to Remote Desktop Services by supplying their passwords in the Remote Desktop Connection client. They will be prompted for a password to log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Always prompt for password upon connection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In the Microsoft Windows Vista Administrative Templates, this setting was named Always prompt client for password upon connection, but it was renamed starting with the Windows Server 2008 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.57.3.9.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword -> 1' + + # 18.10.57.3.9.2 (L1) Ensure 'Require secure RPC communication' is set to 'Enabled'. (Automated) + - id: 16297 + title: "Ensure 'Require secure RPC communication' is set to 'Enabled'." + description: "This policy setting allows you to specify whether Remote Desktop Services requires secure Remote Procedure Call (RPC) communication with all clients or allows unsecured communication. You can use this policy setting to strengthen the security of RPC communication with clients by allowing only authenticated and encrypted requests. The recommended state for this setting is: Enabled." + rationale: "Allowing unsecure RPC communication can exposes the server to man in the middle attacks and data disclosure attacks." + impact: "Remote Desktop Services accepts requests from RPC clients that support secure requests, and does not allow unsecured communication with untrusted clients." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require secure RPC communication Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.9.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic -> 1' + + # 18.10.57.3.9.3 (L1) Ensure 'Require use of specific security layer for remote (RDP) connections' is set to 'Enabled: SSL'. (Automated) + - id: 16298 + title: "Ensure 'Require use of specific security layer for remote (RDP) connections' is set to 'Enabled: SSL'." + description: "This policy setting specifies whether to require the use of a specific security layer to secure communications between clients and RD Session Host servers during Remote Desktop Protocol (RDP) connections. The recommended state for this setting is: Enabled: SSL. Note: In spite of this setting being labeled SSL, it is actually enforcing Transport Layer Security (TLS) version 1.0, not the older (and less secure) SSL protocol." + rationale: "The native Remote Desktop Protocol (RDP) encryption is now considered a weak protocol, so enforcing the use of stronger Transport Layer Security (TLS) encryption for all RDP communications between clients and RD Session Host servers is preferred." + impact: "TLS 1.0 will be required to authenticate to the RD Session Host server. If TLS is not supported, the connection fails. Note: By default, this setting will use a self-signed certificate for RDP connections. If your organization has established the use of a Public Key Infrastructure (PKI) for SSL/TLS encryption, then we recommend that you also configure the Server authentication certificate template setting to instruct RDP to use a certificate from your PKI instead of a self-signed one. Note that the certificate template used for this purpose must have “Client Authentication” configured as an Intended Purpose. Note also that a valid, non-expired certificate using the specified template must already be installed on the server for it to work. Note #2: Some third party two-factor authentication solutions (e.g. RSA Authentication Agent) can be negatively affected by this setting, as the SSL/TLS security layer will expect the user's Windows password upon initial connection attempt (before the RDP logon screen), and once successfully authenticated, pass the credential along to that Windows session on the RDP host (to complete the login). If a two-factor agent is present and expecting a different credential at the RDP logon screen, this initial connection may result in a failed logon attempt, and also effectively cause a “double logon” requirement for each and every new RDP session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: SSL: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require use of specific security layer for remote (RDP) connections Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.9.3"] + - cis_csc_v8: ["3.10"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> SecurityLayer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> SecurityLayer -> 2' + + # 18.10.57.3.9.4 (L1) Ensure 'Require user authentication for remote connections by using Network Level Authentication' is set to 'Enabled'. (Automated) + - id: 16299 + title: "Ensure 'Require user authentication for remote connections by using Network Level Authentication' is set to 'Enabled'." + description: "This policy setting allows you to specify whether to require user authentication for remote connections to the RD Session Host server by using Network Level Authentication. The recommended state for this setting is: Enabled." + rationale: "Requiring that user authentication occur earlier in the remote connection process enhances security." + impact: "Only client computers that support Network Level Authentication can connect to the RD Session Host server. Note: Some third party two-factor authentication solutions (e.g. RSA Authentication Agent) can be negatively affected by this setting, as Network Level Authentication will expect the user's Windows password upon initial connection attempt (before the RDP logon screen), and once successfully authenticated, pass the credential along to that Windows session on the RDP host (to complete the login). If a two-factor agent is present and expecting a different credential at the RDP logon screen, this initial connection may result in a failed logon attempt, and also effectively cause a “double logon” requirement for each and every new RDP session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require user authentication for remote connections by using Network Level Authentication Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In the Microsoft Windows Vista Administrative Templates, this setting was initially named Require user authentication using RDP 6.0 for remote connections, but it was renamed starting with the Windows Server 2008 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.57.3.9.4"] + - cis_csc_v8: ["3.10"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> UserAuthentication' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> UserAuthentication -> 1' + + # 18.10.57.3.9.5 (L1) Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'. (Automated) + - id: 16300 + title: "Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'." + description: "This policy setting specifies whether to require the use of a specific encryption level to secure communications between client computers and RD Session Host servers during Remote Desktop Protocol (RDP) connections. This policy only applies when you are using native RDP encryption. However, native RDP encryption (as opposed to SSL encryption) is not recommended. This policy does not apply to SSL encryption. The recommended state for this setting is: Enabled: High Level." + rationale: "If Remote Desktop client connections that use low level encryption are allowed, it is more likely that an attacker will be able to decrypt any captured Remote Desktop Services network traffic." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: High Level: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Set client connection encryption level Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.9.5"] + - cis_csc_v8: ["3.10"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel -> 3' + + # 18.10.57.3.10.1 (L2) Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less, but not Never (0)'. (Automated) + - id: 16301 + title: "Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less, but not Never (0)'." + description: "This policy setting allows you to specify the maximum amount of time that an active Remote Desktop Services session can be idle (without user input) before it is automatically disconnected. The recommended state for this setting is: Enabled: 15 minutes or less, but not Never (0)." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of inactive sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. In addition, session timeouts that are misconfigured or set for a long period of time can leave the system open to an attacker hijacking the session." + impact: "Remote Desktop Services will automatically disconnect active but idle sessions after 15 minutes (or the specified amount of time). The user receives a warning two minutes before the session disconnects, which allows the user to press a key or move the mouse to keep the session active. Note that idle session time limits do not apply to console sessions." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 15 minutes or less, but not Never (0): Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for active but idle Remote Desktop Services sessions Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Set time limit for active but idle Terminal Services sessions, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.10.57.3.10.1"] + - cis_csc_v7: ["16.11"] + - iso_27001-2013: ["A.8.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare <= 900000' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare != 0' + + # 18.10.57.3.10.2 (L2) Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'. (Automated) + - id: 16302 + title: "Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'." + description: "This policy setting allows you to configure a time limit for disconnected Remote Desktop Services sessions. The recommended state for this setting is: Enabled: 1 minute." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of disconnected but still active sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. This setting is important to ensure a disconnected session is properly terminated. In addition, session timeouts that are misconfigured or set for a long period of time can leave the system open to an attacker hijacking the session." + impact: "Disconnected Remote Desktop sessions are deleted from the server after 1 minute. Note that disconnected session time limits do not apply to console sessions." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 minute: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for disconnected sessions Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.10.2"] + - cis_csc_v7: ["16.11"] + - iso_27001-2013: ["A.8.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> 60000' + + # 18.10.57.3.11.1 (L1) Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'. (Automated) + - id: 16303 + title: "Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'." + description: "This policy setting specifies whether Remote Desktop Services retains a user's per-session temporary folders at logoff. The recommended state for this setting is: Disabled." + rationale: "Sensitive information could be contained inside the temporary folders and visible to other administrators that log into the system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not delete temp folders upon exit Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Do not delete temp folder upon exit, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.57.3.11.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit -> 1' + + # 18.10.57.3.11.2 (L1) Ensure 'Do not use temporary folders per session' is set to 'Disabled'. (Automated) + - id: 16304 + title: "Ensure 'Do not use temporary folders per session' is set to 'Disabled'." + description: "By default, Remote Desktop Services creates a separate temporary folder on the RD Session Host server for each active session that a user maintains on the RD Session Host server. The temporary folder is created on the RD Session Host server in a Temp folder under the user's profile folder and is named with the sessionid. This temporary folder is used to store individual temporary files. To reclaim disk space, the temporary folder is deleted when the user logs off from a session. The recommended state for this setting is: Disabled." + rationale: "Disabling this setting keeps the cached data independent for each session, both reducing the chance of problems from shared cached data between sessions, and keeping possibly sensitive data separate to each user session." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not use temporary folders per session Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.11.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> PerSessionTempDir' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> PerSessionTempDir -> 1' + + # 18.10.58.1 (L1) Ensure 'Prevent downloading of enclosures' is set to 'Enabled'. (Automated) + - id: 16305 + title: "Ensure 'Prevent downloading of enclosures' is set to 'Enabled'." + description: "This policy setting prevents the user from having enclosures (file attachments) downloaded from an RSS feed to the user's computer. The recommended state for this setting is: Enabled." + rationale: "Allowing attachments to be downloaded through the RSS feed can introduce files that could have malicious intent." + impact: "Users cannot set the Feed Sync Engine to download an enclosure through the Feed property page. Developers cannot change the download setting through feed APIs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\RSS Feeds\\Prevent downloading of enclosures Note: This Group Policy path is provided by the Group Policy template InetRes.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Turn off downloading of enclosures, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.58.1"] + - cis_csc_v8: ["9.4"] + - cis_csc_v7: ["7.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8"] + - iso_27001-2013: ["A.12.6.2"] + - nist_sp_800-53: ["CM-10", "CM-11", "SC-18"] + - pci_dss_v4.0: ["2.2.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload -> 1' + + # 18.10.59.2 (L2) Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search'. (Automated) + - id: 16306 + title: "Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search'." + description: "This policy setting allows search and Cortana to search cloud sources like OneDrive and SharePoint. The recommended state for this setting is: Enabled: Disable Cloud Search." + rationale: "Due to privacy concerns, data should never be sent to any third-party since this data could contain sensitive information." + impact: "Search and Cortana will not be permitted to search cloud sources like OneDrive and SharePoint." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Cloud Search: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cloud Search Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.59.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCloudSearch' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCloudSearch -> 0' + + # 18.10.59.3 (L1) Ensure 'Allow indexing of encrypted files' is set to 'Disabled'. (Automated) + - id: 16307 + title: "Ensure 'Allow indexing of encrypted files' is set to 'Disabled'." + description: "This policy setting controls whether encrypted items are allowed to be indexed. When this setting is changed, the index is rebuilt completely. Full volume encryption (such as BitLocker Drive Encryption or a non-Microsoft solution) must be used for the location of the index to maintain security for encrypted files. The recommended state for this setting is: Disabled." + rationale: "Indexing and allowing users to search encrypted files could potentially reveal confidential data stored within the encrypted files." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow indexing of encrypted files Note: This Group Policy path is provided by the Group Policy template Search.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.59.3"] + - cis_csc_v7: ["14.8"] + - iso_27001-2013: ["A.10.1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems -> 0' + + # 18.10.59.4 (L2) Ensure 'Allow search highlights' is set to 'Disabled'. (Automated) + - id: 16308 + title: "Ensure 'Allow search highlights' is set to 'Disabled'." + description: "This policy setting controls search highlights in the start menu search box and in search home. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, data should never be sent to or received by any third-party since this data could contain sensitive information." + impact: 'Interesting, "informative", and "noteworthy" information about the current date will not be displayed (by Microsoft) to the user.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow search highlights Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.59.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> EnableDynamicContentInWSB' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> EnableDynamicContentInWSB -> 0' + + # 18.10.63.1 (L2) Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'. (Automated) + - id: 16309 + title: "Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'." + description: "The Key Management Service (KMS) is a Microsoft license activation method that entails setting up a local server to store the software licenses. The KMS server itself needs to connect to Microsoft to activate the KMS service, but subsequent on-network clients can activate Microsoft Windows OS and/or their Microsoft Office via the KMS server instead of connecting directly to Microsoft. This policy setting lets you opt-out of sending KMS client activation data to Microsoft automatically. The recommended state for this setting is: Enabled." + rationale: "Even though the KMS licensing method does not require KMS clients to connect to Microsoft, they still send KMS client activation state data to Microsoft automatically. Preventing this information from being sent can help reduce privacy concerns in high security environments." + impact: "The computer is prevented from sending data to Microsoft regarding its KMS client activation state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Software Protection Platform\\Turn off KMS Client Online AVS Validation Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AVSValidationGP.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.63.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> 1' + + # 18.10.76.2.1 (L1) Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass'. (Automated) + - id: 16310 + title: "Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass'." + description: "This policy setting allows you to manage the behavior of Windows SmartScreen. Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. Some information is sent to Microsoft about files and programs run on PCs with this feature enabled. The recommended state for this setting is: Enabled: Warn and prevent bypass." + rationale: "Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. However, due to the fact that some information is sent to Microsoft about files and programs run on PCs some organizations may prefer to disable it." + impact: "Users will be warned before they are allowed to run unrecognized programs downloaded from the Internet." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Warn and prevent bypass: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender SmartScreen\\Explorer\\Configure Windows Defender SmartScreen Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsExplorer.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Configure Windows SmartScreen, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.10.76.2.1"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> ShellSmartScreenLevel' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> ShellSmartScreenLevel -> Block' + + # 18.10.80.1 (L2) Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled'. (Automated) + - id: 16311 + title: "Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled'." + description: "This policy setting determines whether suggested apps in Windows Ink Workspace are allowed. The recommended state for this setting is: Disabled." + rationale: "This Microsoft feature is designed to collect data and suggest apps based on that data collected. Disabling this setting will help ensure your data is not shared with any third party." + impact: "The suggested apps in Windows Ink Workspace will not be allowed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow suggested apps in Windows Ink Workspace Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.80.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowSuggestedAppsInWindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowSuggestedAppsInWindowsInkWorkspace -> 0' + + # 18.10.80.2 (L1) Ensure 'Allow Windows Ink Workspace' is set to 'Enabled: On, but disallow access above lock' OR 'Enabled: Disabled'. (Automated) + - id: 16312 + title: "Ensure 'Allow Windows Ink Workspace' is set to 'Enabled: On, but disallow access above lock' OR 'Enabled: Disabled'." + description: "This policy setting determines whether Windows Ink items are allowed above the lock screen. The recommended state for this setting is: Enabled: On, but disallow access above lock OR Enabled: Disabled." + rationale: "Allowing any apps to be accessed while system is locked is not recommended. If this feature is permitted, it should only be accessible once a user authenticates with the proper credentials." + impact: "Windows Ink Workspace will not be permitted above the lock screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: On, but disallow access above lock OR Enabled: Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow Windows Ink Workspace Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.80.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace -> 1' + + # 18.10.81.1 (L1) Ensure 'Allow user control over installs' is set to 'Disabled'. (Automated) + - id: 16313 + title: "Ensure 'Allow user control over installs' is set to 'Disabled'." + description: "This setting controls whether users are permitted to change installation options that typically are available only to system administrators. The security features of Windows Installer normally prevent users from changing installation options that are typically reserved for system administrators, such as specifying the directory to which files are installed. If Windows Installer detects that an installation package has permitted the user to change a protected option, it stops the installation and displays a message. These security features operate only when the installation program is running in a privileged security context in which it has access to directories denied to the user. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment, only IT staff with administrative rights should be installing or changing software on a system. Allowing users the ability to have any control over installs can risk unapproved software from being installed or removed from a system, which could cause the system to become vulnerable to compromise." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Allow user control over installs Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Enable user control over installs, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.81.1"] + - cis_csc_v8: ["2.5"] + - cmmc_v2.0: ["CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "CM.L2-3.4.9"] + - nist_sp_800-53: ["CM-7(5)"] + - pci_dss_v4.0: ["1.2.5", "2.2.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl -> 0' + + # 18.10.81.2 (L1) Ensure 'Always install with elevated privileges' is set to 'Disabled'. (Automated) + - id: 16314 + title: "Ensure 'Always install with elevated privileges' is set to 'Disabled'." + description: "This setting controls whether or not Windows Installer should use system permissions when it installs any program on the system. Note: This setting appears both in the Computer Configuration and User Configuration folders. To make this setting effective, you must enable the setting in both folders. Caution: If enabled, skilled users can take advantage of the permissions this setting grants to change their privileges and gain permanent access to restricted files and folders. Note that the User Configuration version of this setting is not guaranteed to be secure. The recommended state for this setting is: Disabled." + rationale: "Users with limited privileges can exploit this feature by creating a Windows Installer installation package that creates a new local account that belongs to the local built-in Administrators group, adds their current account to the local built-in Administrators group, installs malicious software, or performs other unauthorized activities." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Always install with elevated privileges Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.81.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated -> 0' + + # 18.10.81.3 (L2) Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'. (Automated) + - id: 16315 + title: "Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'." + description: "This policy setting controls whether Web-based programs are allowed to install software on the computer without notifying the user. The recommended state for this setting is: Disabled." + rationale: "Suppressing the system warning can pose a security risk and increase the attack surface on the system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Prevent Internet Explorer security prompt for Windows Installer scripts Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable IE security prompt for Windows Installer scripts, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.81.3"] + - cis_csc_v8: ["2.5"] + - cmmc_v2.0: ["CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "CM.L2-3.4.9"] + - nist_sp_800-53: ["CM-7(5)"] + - pci_dss_v4.0: ["1.2.5", "2.2.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> 0' + + # 18.10.82.1 (L1) Ensure 'Sign-in and lock last interactive user automatically after a restart' is set to 'Disabled'. (Automated) + - id: 16316 + title: "Ensure 'Sign-in and lock last interactive user automatically after a restart' is set to 'Disabled'." + description: "This policy setting controls whether a device will automatically sign-in the last interactive user after Windows Update restarts the system. The recommended state for this setting is: Disabled." + rationale: "Disabling this feature will prevent the caching of user's credentials and unauthorized use of the device, and also ensure the user is aware of the restart." + impact: "The device does not store the user's credentials for automatic sign-in after a Windows Update restart. The users' lock screen apps are not restarted after the system restarts. The user is required to present the logon credentials in order to proceed after restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Logon Options\\Sign-in and lock last interactive user automatically after a restart Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinLogon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Sign-in last interactive user automatically after a system-initiated restart, but it was renamed starting with the Windows 10 Release 1903 Administrative Templates." + compliance: + - cis: ["18.10.82.1"] + - cis_csc_v7: ["16.11"] + - iso_27001-2013: ["A.8.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn -> 1' + + # 18.10.87.1 (L1) Ensure 'Turn on PowerShell Script Block Logging' is set to 'Enabled'. (Automated) + - id: 16317 + title: "Ensure 'Turn on PowerShell Script Block Logging' is set to 'Enabled'." + description: "This policy setting enables logging of all PowerShell script input to the Applications and Services Logs\\Microsoft\\Windows\\PowerShell\\Operational Event Log channel. The recommended state for this setting is: Enabled. Note: If logging of Script Block Invocation Start/Stop Events is enabled (option box checked), PowerShell will log additional events when invocation of a command, script block, function, or script starts or stops. Enabling this option generates a high volume of event logs. CIS has intentionally chosen not to make a recommendation for this option, since it generates a large volume of events. If an organization chooses to enable the optional setting (checked), this also conforms to the benchmark." + rationale: "Logs of PowerShell script input can be very valuable when performing forensic investigations of PowerShell attack incidents to determine what occurred." + impact: "PowerShell script input will be logged to the Applications and Services Logs\\Microsoft\\Windows\\PowerShell\\Operational Event Log channel, which can contain credentials and sensitive information. Warning: There are potential risks of capturing credentials and sensitive information in the PowerShell logs, which could be exposed to users who have read-access to those logs. Microsoft provides a feature called \"Protected Event Logging\" to better secure event log data. For assistance with protecting event logging, visit: About Logging Windows - PowerShell | Microsoft Docs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Script Block Logging Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_logging_windows?view=powershell-7.2#protected-event-logging" + compliance: + - cis: ["18.10.87.1"] + - cis_csc_v8: ["8.8"] + - cis_csc_v7: ["8.8"] + - iso_27001-2013: ["A.12.14.1"] + - soc_2: ["CC5.2", "CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging -> 1' + + # 18.10.87.2 (L1) Ensure 'Turn on PowerShell Transcription' is set to 'Enabled'. (Automated) + - id: 16318 + title: "Ensure 'Turn on PowerShell Transcription' is set to 'Enabled'." + description: "This Policy setting lets you capture the input and output of Windows PowerShell commands into text-based transcripts. The recommended state for this setting is: Enabled." + rationale: "PowerShell transcript input can be very valuable when performing forensic investigations of PowerShell attack incidents to determine what occurred." + impact: "PowerShell transcript input will be logged to the PowerShell_transcript output file, which is saved to the My Documents folder of each users' profile by default. Warning: There are potential risks of capturing credentials and sensitive information in the PowerShell_transcript output file, which could be exposed to users who have read-access to the file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Transcription Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_group_policy_settings?view=powershell-7.2#turn-on-powershell-transcription" + compliance: + - cis: ["18.10.87.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting -> 1' + + # 18.10.89.1.1 (L1) Ensure 'Allow Basic authentication' is set to 'Disabled'. (Automated) + - id: 16319 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client uses Basic authentication. The recommended state for this setting is: Disabled." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow Basic authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.89.1.1"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["16.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic -> 0' + + # 18.10.89.1.2 (L1) Ensure 'Allow unencrypted traffic' is set to 'Disabled'. (Automated) + - id: 16320 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow unencrypted traffic Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.89.1.2"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic -> 0' + + # 18.10.89.1.3 (L1) Ensure 'Disallow Digest authentication' is set to 'Enabled'. (Automated) + - id: 16321 + title: "Ensure 'Disallow Digest authentication' is set to 'Enabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client will not use Digest authentication. The recommended state for this setting is: Enabled." + rationale: "Digest authentication is less robust than other authentication methods available in WinRM, an attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + impact: "The WinRM client will not use Digest authentication." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Disallow Digest authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.89.1.3"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["16.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest -> 0' + + # 18.10.89.2.1 (L1) Ensure 'Allow Basic authentication' is set to 'Disabled'. (Automated) + - id: 16322 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service accepts Basic authentication from a remote client. The recommended state for this setting is: Disabled." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow Basic authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.89.2.1"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["16.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic -> 0' + + # 18.10.89.2.2 (L2) Ensure 'Allow remote server management through WinRM' is set to 'Disabled'. (Automated) + - id: 16323 + title: "Ensure 'Allow remote server management through WinRM' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port. The recommended state for this setting is: Disabled." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Management (WinRM) service on trusted networks and when feasible employ additional controls such as IPsec." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow automatic configuration of listeners, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.89.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> 0' + + # 18.10.89.2.3 (L1) Ensure 'Allow unencrypted traffic' is set to 'Disabled'. (Automated) + - id: 16324 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow unencrypted traffic Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.89.2.3"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic -> 0' + + # 18.10.89.2.4 (L1) Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'. (Automated) + - id: 16325 + title: "Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service will allow RunAs credentials to be stored for any plug-ins. The recommended state for this setting is: Enabled. Note: If you enable and then disable this policy setting, any values that were previously configured for RunAsPassword will need to be reset." + rationale: "Although the ability to store RunAs credentials is a convenient feature it increases the risk of account compromise slightly. For example, if you forget to lock your desktop before leaving it unattended for a few minutes another person could access not only the desktop of your computer but also any hosts you manage via WinRM with cached RunAs credentials." + impact: "The WinRM service will not allow the RunAsUser or RunAsPassword configuration values to be set for any plug-ins. If a plug-in has already set the RunAsUser and RunAsPassword configuration values, the RunAsPassword configuration value will be erased from the credential store on the computer. If this setting is later Disabled again, any values that were previously configured for RunAsPassword will need to be reset." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Disallow WinRM from storing RunAs credentials Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.89.2.4"] + - cis_csc_v7: ["14.3"] + - iso_27001-2013: ["A.13.1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs -> 1' + + # 18.10.90.1 (L2) Ensure 'Allow Remote Shell Access' is set to 'Disabled'. (Automated) + - id: 16326 + title: "Ensure 'Allow Remote Shell Access' is set to 'Disabled'." + description: "This policy setting allows you to manage configuration of remote access to all supported shells to execute scripts and commands. The recommended state for this setting is: Disabled. Note: The GPME help text for this setting is incorrectly worded, implying that configuring it to Enabled will reject new Remote Shell connections, and setting it to Disabled will allow Remote Shell connections. The opposite is true (and is consistent with the title of the setting). This is a wording mistake by Microsoft in the Administrative Template." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Shell on trusted networks and when feasible employ additional controls such as IPsec." + impact: "New Remote Shell connections are not allowed and are rejected by the server. Note: On Server 2012 (non-R2) and newer, due to design changes in the OS after Server 2008 R2, configuring this setting as prescribed will prevent the ability to add or remove Roles and Features (even locally) via the GUI. We therefore recommend that the necessary Roles and Features be installed prior to configuring this setting on a Level 2 server. Alternatively, Roles and Features can still be added or removed using the PowerShell commands Add-WindowsFeature or Remove-WindowsFeature in the Server Manager module, even with this setting configured." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Shell\\Allow Remote Shell Access Note: This Group Policy path is provided by the Group Policy template WindowsRemoteShell.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.90.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> 0' + + # 18.10.92.2.1 (L1) Ensure 'Prevent users from modifying settings' is set to 'Enabled'. (Automated) + - id: 16327 + title: "Ensure 'Prevent users from modifying settings' is set to 'Enabled'." + description: "This policy setting prevent users from making changes to the Exploit protection settings area in the Windows Security settings. The recommended state for this setting is: Enabled." + rationale: "Only authorized IT staff should be able to make changes to the exploit protection settings in order to ensure the organizations specific configuration is not modified." + impact: "Local users cannot make changes in the Exploit protection settings area." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Security\\App and browser protection\\Prevent users from modifying settings Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefenderSecurityCenter.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.92.2.1"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection -> DisallowExploitProtectionOverride' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection -> DisallowExploitProtectionOverride -> 1' + + # 18.10.93.1.1 (L1) Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'. (Automated) + - id: 16328 + title: "Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'." + description: "This policy setting specifies that Automatic Updates will wait for computers to be restarted by the users who are logged on to them to complete a scheduled installation. The recommended state for this setting is: Disabled. Note: This setting applies only when you configure Automatic Updates to perform scheduled update installations. If you configure the Configure Automatic Updates setting to Disabled, this setting has no effect." + rationale: "Some security updates require that the computer be restarted to complete an installation. If the computer cannot restart automatically, then the most recent update will not completely install and no new updates will download to the computer until it is restarted. Without the auto-restart functionality, users who are not security-conscious may choose to indefinitely delay the restart, therefore keeping the computer in a less secure state." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Legacy Policies\\No auto-restart with logged on users for scheduled automatic updates installations Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named No auto-restart for scheduled Automatic Updates installations, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.10.93.1.1"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers -> 0' + + # 18.10.93.2.1 (L1) Ensure 'Configure Automatic Updates' is set to 'Enabled'. (Automated) + - id: 16329 + title: "Ensure 'Configure Automatic Updates' is set to 'Enabled'." + description: 'This policy setting specifies whether computers in your environment will receive security updates from Windows Update or WSUS. If you configure this policy setting to Enabled, the operating system will recognize when a network connection is available and then use the network connection to search Windows Update or your designated intranet site for updates that apply to them. After you configure this policy setting to Enabled, select one of the following three options in the Configure Automatic Updates Properties dialog box to specify how the service will work: - 2 - Notify for download and auto install (Notify before downloading any updates) - 3 - Auto download and notify for install (Download the updates automatically and notify when they are ready to be installed.) (Default setting) - 4 - Auto download and schedule the install (Automatically download updates and install them on the schedule specified below.)) - 5 - Allow local admin to choose setting (Leave decision on above choices up to the local Administrators (Not Recommended)) The recommended state for this setting is: Enabled. Note: The sub-setting "Configure automatic updating:" has 4 possible values - all of them are valid depending on specific organizational needs, however if feasible we suggest using a value of 4 - Auto download and schedule the install. This suggestion is not a scored requirement. Note #2: Organizations that utilize a third-party solution for patching may choose to exempt themselves from this recommendation, and instead configure it to Disabled so that the native Windows Update mechanism does not interfere with the third-party patching process.' + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + impact: "Critical operating system updates and service packs will be installed as necessary." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage end user experience\\Configure Automatic Updates Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.93.2.1"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> 0' + + # 18.10.93.2.2 (L1) Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'. (Automated) + - id: 16330 + title: "Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'." + description: "This policy setting specifies when computers in your environment will receive security updates from Windows Update or WSUS. The recommended state for this setting is: 0 - Every day. Note: This setting is only applicable if 4 - Auto download and schedule the install is selected in recommendation 'Configure Automatic Updates'. It will have no impact if any other option is selected." + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + impact: "If 4 - Auto download and schedule the install is selected in recommendation 'Configure Automatic Updates', critical operating system updates and service packs will automatically download every day (at 3:00 A.M., by default)." + remediation: "To establish the recommended configuration via GP, set the following UI path to 0 - Every day: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage end user experience\\Configure Automatic Updates: Scheduled install day Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.93.2.2"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay -> 0' + + # 18.10.93.4.1 (L1) Ensure 'Manage preview builds' is set to 'Disabled'. (Automated) + - id: 16331 + title: "Ensure 'Manage preview builds' is set to 'Disabled'." + description: "This policy setting manage which updates that are receive prior to the update being released. Dev Channel: Ideal for highly technical users. Insiders in the Dev Channel will receive builds from our active development branch that is earliest in a development cycle. These builds are not matched to a specific Windows 10 release. Beta Channel: Ideal for feature explorers who want to see upcoming Windows 10 features. Your feedback will be especially important here as it will help our engineers ensure key issues are fixed before a major release. Release Preview Channel (default): Insiders in the Release Preview Channel will have access to the upcoming release of Windows 10 prior to it being released to the world. These builds are supported by Microsoft. The Release Preview Channel is where we recommend companies preview and validate upcoming Windows 10 releases before broad deployment within their organization. The recommended state for this setting is: Disabled. Note: Preview Build enrollment requires a telemetry level setting of 2 or higher and your domain registered on insider.windows.com. For additional information on Preview Builds, see: https://aka.ms/wipforbiz." + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + impact: "Preview builds are prevented from installing on the device." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage updates offered from Windows Update\\Manage preview builds Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/windows-insider/business/manage-builds" + compliance: + - cis: ["18.10.93.4.1"] + - cis_csc_v8: ["2.5"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "CM.L2-3.4.9"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-7(5)"] + - pci_dss_v4.0: ["1.2.5", "2.2.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuildsPolicyValue' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuildsPolicyValue -> 0' + + # 18.10.93.4.2 (L1) Ensure 'Select when Preview Builds and Feature Updates are received' is set to 'Enabled: 180 or more days'. (Automated) + - id: 16332 + title: "Ensure 'Select when Preview Builds and Feature Updates are received' is set to 'Enabled: 180 or more days'." + description: 'This policy setting determines when Preview Build or Feature Updates are received. Defer Updates This enables devices to defer taking the next Feature Update available to your channel for up to 14 days for all the pre-release channels and up to 365 days for the Semi-Annual Channel. Or, if the device is updating from the Semi-Annual Channel, a version for the device to move to and/or stay on until the policy is updated or the device reaches end of service can be specified. Note: If you set both policies, the version specified will take precedence and the deferrals will not be in effect. Please see the Windows Release Information page for OS version information. Pause Updates To prevent Feature Updates from being received on their scheduled time, you can temporarily pause Feature Updates. The pause will remain in effect for 35 days from the specified start date or until the field is cleared (Quality Updates will still be offered). Note: If the "Allow Diagnostic Data" (formerly "Allow Telemetry") policy is set to 0, this policy will have no effect. Note #2: Starting with Windows 10 R1607, Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering. More information on Dual Scan is available at these links: - Demystifying "Dual Scan" - WSUS Product Team Blog - Improving Dual Scan on 1607 - WSUS Product Team Blog Note #3: Prior to Windows 10 R1703, values above 180 days are not recognized by the OS. Starting with Windows 10 R1703, the maximum number of days you can defer is 365 days.' + rationale: "In a production environment, it is preferred to only use software and features that are publicly available, after they have gone through rigorous testing in beta." + impact: "Feature Updates will be delayed until they are publicly released to general public by Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 180 or more days: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage updates offered from Windows Update\\Select when Preview Builds and Feature Updates are received Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Select when Feature Updates are received, but it was renamed to Select when Preview Builds and Feature Updates are received starting with the Windows 10 Release 1709 Administrative Templates." + compliance: + - cis: ["18.10.93.4.2"] + - cis_csc_v8: ["2.5", "7.3"] + - cis_csc_v7: ["2.4"] + - cmmc_v2.0: ["CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "CM.L2-3.4.9", "SI.L1-3.14.1"] + - iso_27001-2013: ["A.8.1.1"] + - nist_sp_800-53: ["CM-7(5)", "SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - pci_dss_v4.0: ["1.2.5", "2.2.4"] + - soc_2: ["CC6.8", "CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdatesPeriodInDays -> n:^(\d+) compare >= 180' + + # 18.10.93.4.3 (L1) Ensure 'Select when Quality Updates are received' is set to 'Enabled: 0 days'. (Automated) + - id: 16333 + title: "Ensure 'Select when Quality Updates are received' is set to 'Enabled: 0 days'." + description: 'This settings controls when Quality Updates are received. The recommended state for this setting is: Enabled: 0 days. Note: If the "Allow Diagnostic Data" (formerly "Allow Telemetry") policy is set to 0, this policy will have no effect. Note #2: Starting with Windows Server 2016 RTM (Release 1607), Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering. More information on Dual Scan is available at these links: - Demystifying "Dual Scan" - WSUS Product Team Blog - Improving Dual Scan on 1607 - WSUS Product Team Blog.' + rationale: "Quality Updates can contain important bug fixes and/or security patches, and should be installed as soon as possible." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled:0 days: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage updates offered from Windows Update\\Select when Quality Updates are received Note: This Group Policy path does not exist by default. An updated Group Policy template (WindowsUpdate.admx/adml) is required - it is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.93.4.3"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdatesPeriodInDays -> 0' + + # 19.1.3.1 (L1) Ensure 'Enable screen saver' is set to 'Enabled'. (Automated) - Not Implemented + # 19.1.3.2 (L1) Ensure 'Password protect the screen saver' is set to 'Enabled'. (Automated) - Not Implemented + # 19.1.3.3 (L1) Ensure 'Screen saver timeout' is set to 'Enabled: 900 seconds or fewer, but not 0'. (Automated) - Not Implemented + # 19.5.1.1 (L1) Ensure 'Turn off toast notifications on the lock screen' is set to 'Enabled'. (Automated) - Not Implemented + # 19.6.6.1.1 (L2) Ensure 'Turn off Help Experience Improvement Program' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.4.1 (L1) Ensure 'Do not preserve zone information in file attachments' is set to 'Disabled'. (Automated) - Not Implemented + # 19.7.4.2 (L1) Ensure 'Notify antivirus programs when opening attachments' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.7.1 (L1) Ensure 'Configure Windows spotlight on lock screen' is set to Disabled'. (Automated) - Not Implemented + # 19.7.7.2 (L1) Ensure 'Do not suggest third-party content in Windows spotlight' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.7.3 (L2) Ensure 'Do not use diagnostic data for tailored experiences' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.7.4 (L2) Ensure 'Turn off all Windows spotlight features' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.7.5 (L1) Ensure 'Turn off Spotlight collection on Desktop' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.25.1 (L1) Ensure 'Prevent users from sharing files within their profile.' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.40.1 (L1) Ensure 'Always install with elevated privileges' is set to 'Disabled'. (Automated) - Not Implemented + # 19.7.42.2.1 (L2) Ensure 'Prevent Codec Download' is set to 'Enabled'. (Automated) - Not Implemented diff --git a/etc/ruleset/sca/windows/cis_win2019.yml b/etc/ruleset/sca/windows/cis_win2019.yml new file mode 100644 index 0000000000..314ea36408 --- /dev/null +++ b/etc/ruleset/sca/windows/cis_win2019.yml @@ -0,0 +1,4770 @@ +# Security Configuration Assessment +# CIS Checks for Windows 2016 RTM +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for Microsoft Windows Server 2019 RTM (Release 1809) v1.0.1 - 11-22-2019 + +policy: + id: "cis_win2019" + file: "cis_win2019.yml" + name: "CIS Microsoft Windows Server 2019 Benchmark v1.0.1" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows Server 2019." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform is Windows Server 2019 RTM" + description: "Requirements for running the CIS benchmark under Windows Server 2019 RTM" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows Server 2019' + +checks: + ############################################### + # 1 Account Policies + ############################################### + ############################################### + # 1.1 Password Policy + ############################################### + + # 1.1.2 Maximum password age (Scored) + - id: 16500 + title: "Ensure 'Maximum password age' is set to '60 or fewer days, but not 0'" + description: "This policy setting defines how long a user can use their password before it expires. Values for this policy setting range from 0 to 999 days. If you set the value to 0, the password will never expire. Because attackers can crack passwords, the more frequently you change the password the less opportunity an attacker has to use a cracked password. However, the lower this value is set, the higher the potential for an increase in calls to help desk support due to users having to change their password or forgetting which password is current. The recommended state for this setting is 60 or fewer days, but not 0." + rationale: "The longer a password exists the higher the likelihood that it will be compromised by a brute force attack, by an attacker gaining general knowledge about the user, or by the user sharing the password. Configuring the Maximum password age setting to 0 so that users are never required to change their passwords is a major security risk because that allows a compromised password to be used by the malicious user for as long as the valid user is authorized access." + remediation: "To establish the recommended configuration via GP, set the following UI path to 60 or fewer days, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Maximum password age." + compliance: + - cis: ["1.1.2"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - "CCE-37167-4" + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> n:^(\d+) compare <= 60' + + ############################################### + # 2 Local Policies + ############################################### + ############################################### + # 2.3 Security Options + ############################################### + + # 2.3.1.2 Accounts: Block Microsoft accounts (Scored) + - id: 16501 + title: "Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts" + description: "This policy setting prevents users from adding new Microsoft accounts on this computer. The recommended state for this setting is: Users can't add or log on with Microsoft accounts." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used to log onto their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + remediation: "To establish the recommended configuration via GP, set the following UI path to Users can't add or log on with Microsoft accounts : Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Block Microsoft accounts." + compliance: + - cis: ["2.3.1.2"] + - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + references: + - "CCE-36147-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> 3' + + # 2.3.1.4 Accounts: Limit local account use of blank passwords to console logon only (Scored) + - id: 16502 + title: "Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'" + description: "This policy setting determines whether local accounts that are not password protected can be used to log on from locations other than the physical computer console. If you enable this policy setting, local accounts that have blank passwords will not be able to log on to the network from remote client computers. Such accounts will only be able to log on at the keyboard of the computer. The recommended state for this setting is: Enabled." + rationale: "Blank passwords are a serious threat to computer security and should be forbidden through both organizational policy and suitable technical measures. In fact, the default settings for Active Directory domains require complex passwords of at least seven characters. However, if users with the ability to create new accounts bypass your domainbased password policies, they could create accounts with blank passwords. For example, a user could build a stand-alone computer, create one or more accounts with blank passwords, and then join the computer to the domain. The local accounts with blank passwords would still function. Anyone who knows the name of one of these unprotected accounts could then use it to log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Limit local account use of blank passwords to console logon only." + compliance: + - cis: ["2.3.1.4"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "CCE-37615-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse -> 1' + + # 2.3.2.1 Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings (Scored) + - id: 16503 + title: "Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'" + description: "This policy setting allows administrators to enable the more precise auditing capabilities present in Windows Vista. The Audit Policy settings available in Windows Server 2003 Active Directory do not yet contain settings for managing the new auditing subcategories. To properly apply the auditing policies prescribed in this baseline, the Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings setting needs to be configured to Enabled. The recommended state for this setting is: Enabled. *Important*: Be very cautious about audit settings that can generate a large volume of traffic. For example, if you enable either success or failure auditing for all of the Privilege Use subcategories, the high volume of audit events generated can make it difficult to find other types of entries in the Security log. Such a configuration could also have a significant impact on system performance." + rationale: "Prior to the introduction of auditing subcategories in Windows Vista, it was difficult to track events at a per-system or per-user level. The larger event categories created too many events and the key information that needed to be audited was difficult to find." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings." + compliance: + - cis: ["2.3.2.1"] + - cis_csc: ["6.2"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-37850-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy -> 1' + + # 2.3.2.2 Audit: Shut down system immediately if unable to log security audits (Scored) + - id: 16504 + title: "Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'" + description: "This policy setting determines whether the system shuts down if it is unable to log Security events. It is a requirement for Trusted Computer System Evaluation Criteria (TCSEC)-C2 and Common Criteria certification to prevent auditable events from occurring if the audit system is unable to log them. Microsoft has chosen to meet this requirement by halting the system and displaying a stop message if the auditing system experiences a failure. When this policy setting is enabled, the system will be shut down if a security audit cannot be logged for any reason. The recommended state for this setting is: Disabled." + rationale: "If the computer is unable to record events to the Security log, critical evidence or important troubleshooting information may not be available for review after a security incident. Also, an attacker could potentially generate a large volume of Security log events to purposely force a computer shutdown." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Shut down system immediately if unable to log security audits." + compliance: + - cis: ["2.3.2.2"] + - cis_csc: ["6"] + - pci_dss: ["10.7"] + references: + - "CCE-35907-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 0' + + # 2.3.4.1 Devices: Allowed to format and eject removable media (Scored) + - id: 16505 + title: "Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators'" + description: "This policy setting determines who is allowed to format and eject removable NTFS media. You can use this policy setting to prevent unauthorized users from removing data on one computer to access it on another computer on which they have local administrator privileges. The recommended state for this setting is: Administrators." + rationale: "Users may be able to move data on removable disks to a different computer where they have administrative privileges. The user could then take ownership of any file, grant themselves full control, and view or modify any file. The fact that most removable storage devices will eject media by pressing a mechanical button diminishes the advantage of this policy setting." + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators and Interactive Users: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Allowed to format and eject removable media." + compliance: + - cis: ["2.3.4.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-37701-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD -> 0' + + # 2.3.4.2 Devices: Prevent users from installing printer drivers (Scored) + - id: 16506 + title: "Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'" + description: "For a computer to print to a shared printer, the driver for that shared printer must be installed on the local computer. This security setting determines who is allowed to install a printer driver as part of connecting to a shared printer. The recommended state for this setting is: Enabled. Note: This setting does not affect the ability to add a local printer. This setting does not affect Administrators." + rationale: "It may be appropriate in some organizations to allow users to install printer drivers on their own workstations. However, you should allow only Administrators, not users, to do so on servers, because printer driver installation on a server may unintentionally cause the computer to become less stable. A malicious user could install inappropriate printer drivers in a deliberate attempt to damage the computer, or a user might accidentally install malicious software that masquerades as a printer driver. It is feasible for an attacker to disguise a Trojan horse program as a printer driver. The program may appear to users as if they must use it to print, but such a program could unleash malicious code on your computer network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Prevent users from installing printer drivers." + compliance: + - cis: ["2.3.4.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4", "2.2.5"] + - nist_800_53: ["CM.1"] + - tsc: ["CC6.3", "CC5.2"] + references: + - "CCE-37942-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> 1' + + # 2.3.5.1 Domain controller: Allow server operators to schedule tasks (Scored) + - id: 16507 + title: "Ensure 'Domain controller: Allow server operators to schedule tasks' is set to 'Disabled' (DC only)" + description: "This policy setting determines whether members of the Server Operators group are allowed to submit jobs by means of the AT schedule facility. The impact of this policy setting configuration should be small for most organizations. Users, including those in the Server Operators group, will still be able to create jobs by means of the Task Scheduler Wizard, but those jobs will run in the context of the account with which the user authenticates when they set up the job. Note: An AT Service Account can be modified to select a different account rather than the LOCAL SYSTEM account. To change the account, open System Tools, click Scheduled Tasks, and then click Accessories folder. Then click AT Service Account on the Advanced menu. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting, jobs that are created by server operators by means of the AT service will execute in the context of the account that runs that service. By default, that is the local SYSTEM account. If you enable this policy setting, server operators could perform tasks that SYSTEM is able to do but that they would typically not be able to do, such as add their account to the local Administrators group." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Allow server operators to schedule tasks." + compliance: + - cis: ["2.3.5.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-37848-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SubmitControl -> 0' + + # 2.3.5.2 Domain controller: LDAP server signing requirements (Scored) + - id: 16508 + title: "Ensure 'Domain controller: LDAP server signing requirements' is set to 'Require signing' (DC only)" + description: "This policy setting determines whether the Lightweight Directory Access Protocol (LDAP) server requires LDAP clients to negotiate data signing. The recommended state for this setting is: Require signing. Note: Domain member computers must have Network security: LDAP signing requirements (Rule 2.3.11.8) set to Negotiate signing or higher. If not, they will fail to authenticate once the above Require signing value is configured on the Domain Controllers. Fortunately, Negotiate signing is the default in the client configuration. Note #2: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are shipped with Windows XP Professional use LDAP simple bind or LDAP simple bind through SSL to talk to a Domain Controller. Note #3: Before enabling this setting, you should first ensure that there are no clients (including server-based applications) that are configured to authenticate with Active Directory via unsigned LDAP, because changing this setting will break those applications. Such applications should first be reconfigured to use signed LDAP, Secure LDAP (LDAPS), or IPsec-protected connections." + rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks. In such attacks, an intruder captures packets between the server and the client, modifies them, and then forwards them to the client. Where LDAP servers are concerned, an attacker could cause a client to make decisions that are based on false records from the LDAP directory. To lower the risk of such an intrusion in an organization's network, you can implement strong physical security measures to protect the network infrastructure. Also, you could implement Internet Protocol security (IPsec) authentication header mode (AH), which performs mutual authentication and packet integrity for IP traffic to make all types of man- in-the-middle attacks extremely difficult. Additionally, allowing the use of regular, unsigned LDAP permits credentials to be received over the network in clear text, which could very easily result in the interception of account passwords by other systems on the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require signing: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: LDAP server signing requirements." + compliance: + - cis: ["2.3.5.2"] + - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - https://blogs.technet.microsoft.com/russellt/2016/01/13/identifying-clear-text-ldap-binds-to-your-dcs/ + - "CCE-35904-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Parameters -> LDAPServerIntegrity -> 2' + + # 2.3.5.3 Domain controller: Refuse machine account password changes (Scored) + - id: 16509 + title: "Ensure 'Domain controller: Refuse machine account password changes' is set to 'Disabled' (DC only)" + description: "This security setting determines whether Domain Controllers will refuse requests from member computers to change computer account passwords. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting on all Domain Controllers in a domain, domain members will not be able to change their computer account passwords, and those passwords will be more susceptible to attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Refuse machine account password changes." + compliance: + - cis: ["2.3.5.3"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - "CCE-36921-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RefusePasswordChange -> 0' + + # 2.3.6.1 Domain member: Digitally encrypt or sign secure channel data (always) (Scored) + - id: 16510 + title: "Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'" + description: "This policy setting determines whether all secure channel traffic that is initiated by the domain member must be signed or encrypted. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt or sign secure channel data (always)." + compliance: + - cis: ["2.3.6.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36142-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal -> 1' + + # 2.3.6.2 Domain member: Digitally encrypt secure channel data (when possible) (Scored) + - id: 16511 + title: "Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'" + description: "This policy setting determines whether a domain member should attempt to negotiate encryption for all secure channel traffic that it initiates. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt secure channel data (when possible)." + compliance: + - cis: ["2.3.6.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37130-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel -> 1' + + # 2.3.6.3 Domain member: Digitally sign secure channel data (when possible) (Scored) + - id: 16512 + title: "Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'" + description: "This policy setting determines whether a domain member should attempt to negotiate whether all secure channel traffic that it initiates must be digitally signed. Digital signatures protect the traffic from being modified by anyone who captures the data as it traverses the network. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally sign secure channel data (when possible)." + compliance: + - cis: ["2.3.6.3"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37222-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel -> 1' + + # 2.3.6.4 Domain member: Disable machine account password changes (Scored) + - id: 16513 + title: "Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'" + description: "This policy setting determines whether a domain member can periodically change its computer account password. Computers that cannot automatically change their account passwords are potentially vulnerable, because an attacker might be able to determine the password for the system's domain account. The recommended state for this setting is: Disabled." + rationale: "The default configuration for Windows Server 2003-based computers that belong to a domain is that they are automatically required to change the passwords for their accounts every 30 days. If you disable this policy setting, computers that run Windows Server 2003 will retain the same passwords as their computer accounts. Computers that are no longer able to automatically change their account password are at risk from an attacker who could determine the password for the computer's domain account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Disable machine account password changes." + compliance: + - cis: ["2.3.6.4"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - "CCE-37508-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange -> 0' + + # 2.3.6.6 Domain member: Require strong (Windows 2000 or later) session key (Scored) + - id: 16514 + title: "Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'" + description: "When this policy setting is enabled, a secure channel can only be established with Domain Controllers that are capable of encrypting secure channel data with a strong (128-bit) session key. To enable this policy setting, all Domain Controllers in the domain must be able to encrypt secure channel data with a strong key, which means all Domain Controllers must be running Microsoft Windows 2000 or newer. The recommended state for this setting is: Enabled." + rationale: "Session keys that are used to establish secure channel communications between Domain Controllers and member computers are much stronger in Windows 2000 than they were in previous Microsoft operating systems. Whenever possible, you should take advantage of these stronger session keys to help protect secure channel communications from attacks that attempt to hijack network sessions and eavesdropping. (Eavesdropping is a form of hacking in which network data is read or altered in transit. The data can be modified to hide or change the sender, or be redirected.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Require strong (Windows 2000 or later) session key." + compliance: + - cis: ["2.3.6.6"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37614-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey -> 1' + + # 2.3.7.1 Interactive logon: Do not require CTRL+ALT+DEL (Scored) + - id: 16515 + title: "Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'" + description: "This policy setting determines whether users must press CTRL+ALT+DEL before they log on. The recommended state for this setting is: Disabled." + rationale: "Microsoft developed this feature to make it easier for users with certain types of physical impairments to log on to computers that run Windows. If users are not required to press CTRL+ALT+DEL, they are susceptible to attacks that attempt to intercept their passwords. If CTRL+ALT+DEL is required before logon, user passwords are communicated by means of a trusted path. An attacker could install a Trojan horse program that looks like the standard Windows logon dialog box and capture the user's password. The attacker would then be able to log on to the compromised account with whatever level of privilege that user has." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Do not require CTRL+ALT+DEL" + compliance: + - cis: ["2.3.7.1"] + - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-37637-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD -> 0' + + # 2.3.7.2 Interactive logon: Do not display last user name (Scored) + - id: 16516 + title: "Ensure 'Interactive logon: Don't display last signed-in' is set to 'Enabled'" + description: "This policy setting determines whether the account name of the last user to log on to the client computers in your organization will be displayed in each computer's respective Windows logon screen. Enable this policy setting to prevent intruders from collecting account names visually from the screens of desktop or laptop computers in your organization. The recommended state for this setting is: Enabled." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Don't display last signed-in." + compliance: + - cis: ["2.3.7.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-36056-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName -> 1' + + # 2.3.7.3 Interactive logon: Machine inactivity limit (Scored) + - id: 16517 + title: "Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'" + description: "Windows notices inactivity of a logon session, and if the amount of inactive time exceeds the inactivity limit, then the screen saver will run, locking the session. The recommended state for this setting is: 900 or fewer second(s), but not 0. Note: A value of 0 does not conform to the benchmark as it disables the machine inactivity limit." + rationale: "If a user forgets to lock their computer when they walk away it's possible that a passerby will hijack it." + remediation: "To establish the recommended configuration via GP, set the following UI path to 900 or fewer seconds, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Machine inactivity limit." + compliance: + - cis: ["2.3.7.3"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - "CCE-38235-8" + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 0' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> n:^(\d+) compare <= 900' + + # 2.3.7.6 - Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s) + - id: 16518 + title: "Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)'" + description: "This policy setting determines whether a user can log on to a Windows domain using cached account information." + rationale: "The number that is assigned to this policy setting indicates the number of users whose logon information the computer will cache locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to 4 or fewer logon(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Number of previous logons to cache (in case domain controller is not available)." + compliance: + - cis: ["2.3.7.6"] + - cis_csc: ["16"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "CCE-38240-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> r:^0$|^1$|^2$|^3$|^4$' + + # 2.3.7.7 Interactive logon: Prompt user to change password before expiration (Scored) + - id: 16519 + title: "Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'" + description: "This policy setting determines how far in advance users are warned that their password will expire. It is recommended that you configure this policy setting to at least 5 days but no more than 14 days to sufficiently warn users when their passwords will expire. The recommended state for this setting is: between 5 and 14 days." + rationale: "It is recommended that user passwords be configured to expire periodically. Users will need to be warned that their passwords are going to expire, or they may inadvertently be locked out of the computer when their passwords expire. This condition could lead to confusion for users who access the network locally, or make it impossible for users to access your organization's network through dial-up or virtual private network (VPN) connections." + remediation: "To establish the recommended configuration via GP, set the following UI path to a value between 5 and 14 days: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Prompt user to change password before expiration." + compliance: + - cis: ["2.3.7.7"] + - cis_csc: ["16"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + references: + - "CCE-37622-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare >= 5 && n:^(\d+) compare <= 14' + + # 2.3.7.8 (L1) Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled' (MS only) (Scored) + - id: 16520 + title: "Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled'" + description: "Logon information is required to unlock a locked computer. For domain accounts, this security setting determines whether it is necessary to contact a Domain Controller to unlock a computer. The recommended state for this setting is: Enabled ." + rationale: "By default, the computer caches in memory the credentials of any users who are authenticated locally. The computer uses these cached credentials to authenticate anyone who attempts to unlock the console. When cached credentials are used, any changes that have recently been made to the account - such as user rights assignments, account lockout, or the account being disabled - are not considered or applied after the account is authenticated. User privileges are not updated, and (more importantly) disabled accounts are still able to unlock the console of the computer." + remediation: "To implement the recommended configuration via GP, set the following UI path to Enabled:Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Require Domain Controller Authentication to unlock workstation" + compliance: + - cis: ["2.3.7.8"] + - cis_csc: ["16.9"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + references: + - "CCE-38240-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ForceUnlockLogon -> 1' + + # 2.3.7.9 Interactive logon: Smart card removal behavior (Scored) + - id: 16521 + title: "Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher" + description: "This policy setting determines what happens when the smart card for a logged-on user is removed from the smart card reader. The recommended state for this setting is: Lock Workstation. Configuring this setting to Force Logoff or Disconnect if a Remote Desktop Services session also conforms to the benchmark." + rationale: "Users sometimes forget to lock their workstations when they are away from them, allowing the possibility for malicious users to access their computers. If smart cards are used for authentication, the computer should automatically lock itself when the card is removed to ensure that only the user with the smart card is accessing resources using those credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Lock Workstation (or, if applicable for your environment, Force Logoff or Disconnect if a Remote Desktop Services session): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Smart card removal behavior." + compliance: + - cis: ["2.3.7.9"] + - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + references: + - "CCE-38333-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption -> r:^1$|^2$|^3$' + + # 2.3.8.1 Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled' + - id: 16522 + title: "Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'" + description: "This policy setting determines whether packet signing is required by the SMB client component. Note: When Windows Vista-based computers have this policy setting enabled and they connect to file or print shares on remote servers, it is important that the setting is synchronized with its companion setting, Microsoft network server: Digitally sign communications (always), on those servers. For more information about these settings, see the 'Microsoft network client and server: Digitally sign communications (four related settings)' section in Chapter 5 of the Threats and Countermeasures guide. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (always)." + compliance: + - cis: ["2.3.8.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36325-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> 1' + + # 2.3.8.2 Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled' + - id: 16523 + title: "Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'" + description: "This policy setting determines whether the SMB client will attempt to negotiate SMB packet signing. Note: Enabling this policy setting on SMB clients on your network makes them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (if server agrees)." + compliance: + - cis: ["2.3.8.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36269-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> 1' + + # 2.3.8.3 Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled' + - id: 16524 + title: "Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'" + description: "This policy setting determines whether the SMB redirector will send plaintext passwords during authentication to third-party SMB servers that do not support password encryption. It is recommended that you disable this policy setting unless there is a strong business case to enable it. If this policy setting is enabled, unencrypted passwords will be allowed across the network. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting, the server can transmit passwords in plaintext across the network to other computers that offer SMB services, which is a significant security risk. These other computers may not use any of the SMB security mechanisms that are included with Windows Server 2003." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Send unencrypted password to third-party SMB servers." + compliance: + - cis: ["2.3.8.3"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37863-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword -> 0' + + # 2.3.9.1 Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0' + - id: 16525 + title: "Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0'" + description: "This policy setting allows you to specify the amount of continuous idle time that must pass in an SMB session before the session is suspended because of inactivity. Administrators can use this policy setting to control when a computer suspends an inactive SMB session. If client activity resumes, the session is automatically reestablished. A value of 0 appears to allow sessions to persist indefinitely. The maximum value is 99999, which is over 69 days; in effect, this value disables the setting. The recommended state for this setting is: 15 or fewer minute(s), but not 0." + rationale: "Each SMB session consumes server resources, and numerous null sessions will slow the server or possibly cause it to fail. An attacker could repeatedly establish SMB sessions until the server's SMB services become slow or unresponsive." + remediation: "To establish the recommended configuration via GP, set the following UI path to 15 or fewer minute(s), but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Amount of idle time required before suspending session." + compliance: + - cis: ["2.3.9.1"] + - cis_csc: ["3"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - "CCE-38046-9" + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> 0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> n:^(\d+) compare <= 15' + + # 2.3.9.2 Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled' + - id: 16526 + title: "Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'" + description: "This policy setting determines whether packet signing is required by the SMB server component. Enable this policy setting in a mixed environment to prevent downstream clients from using the workstation as a network server. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (always)." + compliance: + - cis: ["2.3.9.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37864-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature -> 1' + + # 2.3.9.3 Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled' + - id: 16527 + title: "Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'" + description: "This policy setting determines whether the SMB server will negotiate SMB packet signing with clients that request it. If no signing request comes from the client, a connection will be allowed without a signature if the Microsoft network server: Digitally sign communications (always) setting is not enabled. Note: Enable this policy setting on SMB clients on your network to make them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (if client agrees)." + compliance: + - cis: ["2.3.9.3"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-35988-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature -> 1' + + # 2.3.9.4 Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled' + - id: 16528 + title: "Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'" + description: "This security setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Network security: Force logoff when logon hours expire (Rule 2.3.11.6). If your organization configures logon hours for users, this policy setting is necessary to ensure they are effective. The recommended state for this setting is: Enabled." + rationale: "If your organization configures logon hours for users, then it makes sense to enable this policy setting. Otherwise, users who should not have access to network resources outside of their logon hours may actually be able to continue to use those resources with sessions that were established during allowed hours." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Disconnect clients when logon hours expire." + compliance: + - cis: ["2.3.9.4"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-37972-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' + + # 2.3.9.5 Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher + - id: 16529 + title: "Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher" + description: "This policy setting controls the level of validation a computer with shared folders or printers (the server) performs on the service principal name (SPN) that is provided by the client computer when it establishes a session using the server message block (SMB) protocol. The server message block (SMB) protocol provides the basis for file and print sharing and other networking operations, such as remote Windows administration. The SMB protocol supports validating the SMB server service principal name (SPN) within the authentication blob provided by a SMB client to prevent a class of attacks against SMB servers referred to as SMB relay attacks. This setting will affect both SMB1 and SMB2. The recommended state for this setting is: Accept if provided by client. Configuring this setting to Required from client also conforms to the benchmark. Note: Since the release of the MS KB3161561 security patch, this setting can cause significant issues (such as replication problems, group policy editing issues and blue screen crashes) on Domain Controllers when used simultaneously with UNC path hardening (i.e. Rule 18.5.14.1). CIS therefore recommends against deploying this setting on Domain Controllers." + rationale: "The identity of a computer can be spoofed to gain unauthorized access to network resources." + remediation: "To establish the recommended configuration via GP, set the following UI path to Accept if provided by client (configuring to Required from client also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Server SPN target name validation level." + compliance: + - cis: ["2.3.9.5"] + - cis_csc: ["14"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - https://support.microsoft.com/en-us/help/3161561/ms16-075-and-ms16-076-description-of-the-security-update-for-windows-n + - "CCE-36170-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel -> n:^(\d+) compare >= 1' + + # 2.3.10.2 Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled' + - id: 16530 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled'" + description: "This policy setting controls the ability of anonymous users to enumerate the accounts in the Security Accounts Manager (SAM). If you enable this policy setting, users with anonymous connections will not be able to enumerate domain account user names on the systems in your environment. This policy setting also allows additional restrictions on anonymous connections. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts." + compliance: + - cis: ["2.3.10.2"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36316-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM -> 1' + + # 2.3.10.3 Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled' + - id: 16531 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled'" + description: "This policy setting controls the ability of anonymous users to enumerate SAM accounts as well as shares. If you enable this policy setting, anonymous users will not be able to enumerate domain account user names and network share names on the systems in your environment. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information)" + remediation: "To establish the recommended configuration via GP, set the following U path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts and shares." + compliance: + - cis: ["2.3.10.3"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36316-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous -> 1' + + # 2.3.10.4 (L2) Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled' (Scored) + - id: 16532 + title: "Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'" + description: "This policy setting determines whether Credential Manager (formerly called Stored User Names and Passwords) saves passwords or credentials for later use when it gains domain authentication. The recommended state for this setting is: Enabled. Note: Changes to this setting will not take effect until Windows is restarted." + rationale: "Passwords that are cached can be accessed by the user when logged on to the computer. Although this information may sound obvious, a problem can arise if the user unknowingly executes hostile code that reads the passwords and forwards them to another, unauthorized user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow storage of passwords and credentials for network authentication." + compliance: + - cis: ["2.3.10.4"] + - cis_csc: ["16.14"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-38119-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> 1' + + # 2.3.10.5 Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled' + - id: 16533 + title: "Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'" + description: "This policy setting determines what additional permissions are assigned for anonymous connections to the computer. The recommended state for this setting is: Disabled." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords, perform social engineering attacks, or launch DoS attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Let Everyone permissions apply to anonymous users." + compliance: + - cis: ["2.3.10.5"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36148-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 0' + + # 2.3.10.6 Configure 'Network access: Named Pipes that can be accessed anonymously' + - id: 16534 + title: "Configure 'Network access: Named Pipes that can be accessed anonymously'" + description: "This policy setting determines which communication sessions, or pipes, will have attributes and permissions that allow anonymous access. The recommended state for this setting is: (Domain Controller) LSARPC, NETLOGON, SAMR (Member Server) (i.e. None), or (when the legacy Computer Browser service is enabled) BROWSER. Note: A Member Server that holds the Remote Desktop Services Role with Remote Desktop Licensing Role Service will require a special exception to this recommendation, to allow the HydraLSPipe and TermServLicensing Named Pipes to be accessed anonymously." + rationale: "Limiting named pipes that can be accessed anonymously will reduce the attack surface of the system." + remediation: "To establish the recommended configuration via GP, configure the following UI path: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Named Pipes that can be accessed anonymously." + compliance: + - cis: ["2.3.10.6"] + - cis_csc: ["14.1", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-38258-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:LSARPC && r:NETLOGON && r:SAMR' + + # 2.3.10.8 Configure 'Network access: Remotely accessible registry paths' + - id: 16535 + title: "Configure 'Network access: Remotely accessible registry paths'" + description: "This policy setting determines which registry paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: This setting does not exist in Windows XP. There was a setting with that name in Windows XP, but it is called 'Network access: Remotely accessible registry paths and sub- paths' in Windows Server 2003, Windows Vista, and Windows Server 2008 (non-R2). Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value." + rationale: "The registry is a database that contains computer configuration information, and much of the information is sensitive. An attacker could use this information to facilitate unauthorized activities. To reduce the risk of such an attack, suitable ACLs are assigned throughout the registry to help protect it from access by unauthorized users." + remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\ProductOptions | System\\CurrentControlSet\\Control\\Server Applications | Software\\Microsoft\\Windows NT\\CurrentVersion. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Remotely accessible registry paths." + compliance: + - cis: ["2.3.10.8"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-37194-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedExactPaths -> Machine -> r:System\\CurrentControlSet\\Control\\ProductOptions|System\\CurrentControlSet\\Control\\Server Applications|Software\\Microsoft\\Windows NT\\CurrentVersion' + + # 2.3.10.9 Configure 'Network access: Remotely accessible registry paths and sub-paths' + - id: 16536 + title: "Configure 'Network access: Remotely accessible registry paths and sub-paths'" + description: "This policy setting determines which registry paths and sub-paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: In Windows XP this setting is called 'Network access: Remotely accessible registry paths,' the setting with that same name in Windows Vista, Windows Server 2008 (non-R2), and Windows Server 2003 does not exist in Windows XP. Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value." + rationale: "The registry contains sensitive computer configuration information that could be used by an attacker to facilitate unauthorized activities. The fact that the default ACLs assigned throughout the registry are fairly restrictive and help to protect the registry from access by unauthorized users reduces the risk of such an attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\Print\\Printers | System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server | Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows | NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex | System\\CurrentControlSet\\Control\\Terminal Server | System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig | System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration | Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib | System\\CurrentControlSet\\Services\\SysmonLog | Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local | Policies\\Security Options\\Network access: Remotely accessible registry paths | and sub-paths. When a server holds the Active Directory Certificate Services Role with Certification Authority Role Service, the above list should also include: System\\CurrentControlSet\\Services\\CertSvc. When a server has the WINS Server Feature installed, the above list should also include: System\\CurrentControlSet\\Services\\WINS" + compliance: + - cis: ["2.3.10.9"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36347-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Print|Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows|System\\CurrentControlSet\\Control\\Print\\Printers|System\\CurrentControlSet\\Services\\Eventlog|Software\\Microsoft\\OLAP Server|System\\CurrentControlSet\\Control\\ContentIndex|System\\CurrentControlSet\\Control\\Terminal Server|System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig|System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration|Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib|System\\CurrentControlSet\\Services\\SysmonLog|System\\CurrentControlSet\\Services\\CertSvc|System\\CurrentControlSet\\Services\\WINS' + + # 2.3.10.10 Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled' + - id: 16537 + title: "Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'" + description: "When enabled, this policy setting restricts anonymous access to only those shares and pipes that are named in the Network access: Named pipes that can be accessed anonymously and Network access: Shares that can be accessed anonymously settings. This policy setting controls null session access to shares on your computers by adding RestrictNullSessAccess with the value 1 in the HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\LanManServer\\Parameters registry key. This registry value toggles null session shares on or off to control whether the server service restricts unauthenticated clients' access to named resources. The recommended state for this setting is: Enabled." + rationale: "Null sessions are a weakness that can be exploited through shares (including the default shares) on computers in your environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict anonymous access to Named Pipes and Shares." + compliance: + - cis: ["2.3.10.10"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36021-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess -> 1' + + # 2.3.10.11 Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow' (MS only) + - id: 16538 + title: "Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow'" + description: "This policy setting allows you to restrict remote RPC connections to SAM. The recommended state for this setting is: Administrators: Remote Access: Allow . Note: A Windows 10 R1607, Server 2016 or newer OS is required to access and set this value in Group Policy." + rationale: "To ensure that an unauthorized user cannot anonymously list local account names or groups and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)" + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators: Remote Access: Allow: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict clients allowed to make remote calls to SAM" + compliance: + - cis: ["2.3.10.11"] + - cis_csc: ["5.1", "9.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> restrictremotesam -> O:BAG:BAD:(A;;RC;;;BA)' + + # 2.3.10.12 Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None' + - id: 16539 + title: "Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'" + description: "This policy setting determines which network shares can be accessed by anonymous users. The default configuration for this policy setting has little effect because all users have to be authenticated before they can access shared resources on the server. The recommended state for this setting is: (i.e. None)" + rationale: "It is very dangerous to allow any values in this setting. Any shares that are listed can be accessed by any network user, which could lead to the exposure or corruption of sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to (i.e. None): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Shares that can be accessed anonymously." + compliance: + - cis: ["2.3.10.12"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-38095-6" + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> r:\.' + + # 2.3.10.13 Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves' + - id: 16540 + title: "Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'" + description: "This policy setting determines how network logons that use local accounts are authenticated. The Classic option allows precise control over access to resources, including the ability to assign different types of access to different users for the same resource. The Guest only option allows you to treat all users equally. In this context, all users authenticate as Guest only to receive the same access level to a given resource. The recommended state for this setting is: Classic - local users authenticate as themselves. Note: This setting does not affect interactive logons that are performed remotely by using such services as Telnet or Remote Desktop Services (formerly called Terminal Services)" + rationale: "With the Guest only model, any user who can authenticate to your computer over the network does so with guest privileges, which probably means that they will not have write access to shared resources on that computer. Although this restriction does increase security, it makes it more difficult for authorized users to access shared resources on those computers because ACLs on those resources must include access control entries (ACEs) for the Guest account. With the Classic model, local accounts should be password protected. Otherwise, if Guest access is enabled, anyone can use those user accounts to access shared system resources." + remediation: "To establish the recommended configuration via GP, set the following UI path to Classic - local users authenticate as themselves: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Sharing and security model for local accounts." + compliance: + - cis: ["2.3.10.13"] + - cis_csc: ["14", "16"] + - pci_dss: ["7.1.3"] + - tsc: ["CC6.4"] + references: + - "CCE-37623-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest -> 0' + + # 2.3.11.1 Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled' + - id: 16541 + title: "Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'" + description: "This policy setting determines whether Local System services that use Negotiate when reverting to NTLM authentication can use the computer identity. This policy is supported on at least Windows 7 or Windows Server 2008 R2. The recommended state for this setting is: Enabled." + rationale: "When connecting to computers running versions of Windows earlier than Windows Vista or Windows Server 2008 (non-R2), services running as Local System and using SPNEGO (Negotiate) that revert to NTLM use the computer identity. In Windows 7, if you are connecting to a computer running Windows Server 2008 or Windows Vista, then a system service uses either the computer identity or a NULL session. When connecting with a NULL session, a system-generated session key is created, which provides no protection but allows applications to sign and encrypt data without errors. When connecting with the computer identity, both signing and encryption is supported in order to provide data protection." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow Local System to use computer identity for NTLM." + compliance: + - cis: ["2.3.11.1"] + - cis_csc: ["14", "16"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-38341-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> UseMachineId -> 1' + + # 2.3.11.2 Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled' + - id: 16542 + title: "Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'" + description: "This policy setting determines whether NTLM is allowed to fall back to a NULL session when used with LocalSystem. The recommended state for this setting is: Disabled." + rationale: "NULL sessions are less secure because by definition they are unauthenticated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow LocalSystem NULL session fallback." + compliance: + - cis: ["2.3.11.2"] + - cis_csc: ["14"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37035-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback -> 0' + + # 2.3.11.3 Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled' + - id: 16543 + title: "Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'" + description: "This setting determines if online identities are able to authenticate to this computer. The Public Key Cryptography Based User-to-User (PKU2U) protocol introduced in Windows 7 and Windows Server 2008 R2 is implemented as a security support provider (SSP). The SSP enables peer-to-peer authentication, particularly through the Windows 7 media and file sharing feature called Homegroup, which permits sharing between computers that are not members of a domain. With PKU2U, a new extension was introduced to the Negotiate authentication package, Spnego.dll. In previous versions of Windows, Negotiate decided whether to use Kerberos or NTLM for authentication. The extension SSP for Negotiate, Negoexts.dll, which is treated as an authentication protocol by Windows, supports Microsoft SSPs including PKU2U. When computers are configured to accept authentication requests by using online IDs, Negoexts.dll calls the PKU2U SSP on the computer that is used to log on. The PKU2U SSP obtains a local certificate and exchanges the policy between the peer computers. When validated on the peer computer, the certificate within the metadata is sent to the logon peer for validation and associates the user's certificate to a security token and the logon process completes. The recommended state for this setting is: Disabled." + rationale: "The PKU2U protocol is a peer-to-peer authentication protocol - authentication should be managed centrally in most managed networks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network Security: Allow PKU2U authentication requests to this computer to use online identities." + compliance: + - cis: ["2.3.11.3"] + - cis_csc: ["16.9"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-38047-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID -> 0' + + # 2.3.11.4 Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types' + - id: 16544 + title: "Ensure 'Network Security: Configure encryption types allowed for Kerberos' is set to 'RC4_HMAC_MD5, AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types'" + description: "This policy setting allows you to set the encryption types that Kerberos is allowed to use. The recommended state for this setting is: AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types. Note: Some legacy applications and OSes may require RC4_HMAC_MD5 - we recommend you test in your environment and verify whether you can safely remove it. For the purposes of scoring we have allowed the use of RC4_HMAC_MD5 as an optional setting." + rationale: "The strength of each encryption algorithm varies from one to the next, choosing stronger algorithms will reduce the risk of compromise however doing so may cause issues when the computer attempts to authenticate with systems that do not support them." + remediation: "To establish the recommended configuration via GP, set the following UI path to AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Configure encryption types allowed for Kerberos." + compliance: + - cis: ["2.3.11.4"] + - cis_csc: ["16.14"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + references: + - "CCE-37755-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> r:2147483644|2147483640' + + # 2.3.11.5 Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled' + - id: 16545 + title: "Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'" + description: "This policy setting determines whether the LAN Manager (LM) hash value for the new password is stored when the password is changed. The LM hash is relatively weak and prone to attack compared to the cryptographically stronger Microsoft Windows NT hash. Since LM hashes are stored on the local computer in the security database, passwords can then be easily compromised if the database is attacked. Note: Older operating systems and some third-party applications may fail when this policy setting is enabled. Also, note that the password will need to be changed on all accounts after you enable this setting to gain the proper benefit. The recommended state for this setting is: Enabled." + rationale: "The SAM file can be targeted by attackers who seek access to username and password hashes. Such attacks use special tools to crack passwords, which can then be used to impersonate users and gain access to resources on your network. These types of attacks will not be prevented if you enable this policy setting, but it will be much more difficult for these types of attacks to succeed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Do not store LAN Manager hash value on next password change." + compliance: + - cis: ["2.3.11.5"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-36326-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash -> 1' + + # 2.3.11.6 Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled' + - id: 16546 + title: "Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'" + description: "This policy setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Microsoft network server: Disconnect clients when logon hours expire (Rule 2.3.9.4). The recommended state for this setting is: Enabled. Note: This recommendation is unscored because there is not a documented registry value that corresponds to it. We still strongly encourage that it be configured as Enabled, to ensure that logon hours (when configured) are properly enforced." + rationale: "If this setting is disabled, a user could remain connected to the computer outside of their allotted logon hours." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Force logoff when logon hours expire." + compliance: + - cis: ["2.3.11.6"] + - cis_csc: ["16"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36270-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' + + # 2.3.11.7 Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM' + - id: 16547 + title: "Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'" + description: "LAN Manager (LM) was a family of early Microsoft client/server software (predating Windows NT) that allowed users to link personal computers together on a single network. LM network capabilities included transparent file and print sharing, user security features, and network administration tools. In Active Directory domains, the Kerberos protocol is the default authentication protocol. However, if the Kerberos protocol is not negotiated for some reason, Active Directory will use LM, NTLM, or NTLMv2. LAN Manager authentication includes the LM, NTLM, and NTLM version 2 (NTLMv2) variants, and is the protocol that is used to authenticate all Windows clients when they perform the following operations: -Join a domain -Authenticate between Active Directory forests -Authenticate to down-level domains -Authenticate to computers that do not run Windows 2000, Windows Server 2003, or Windows XP -Authenticate to computers that are not in the domain. The Network security: LAN Manager authentication level setting determines which challenge/response authentication protocol is used for network logons. This choice affects the level of authentication protocol used by clients, the level of session security negotiated, and the level of authentication accepted by servers. The recommended state for this setting is: Send NTLMv2 response only. Refuse LM & NTLM." + rationale: "Windows 2000 and Windows XP clients were configured by default to send LM and NTLM authentication responses (Windows 95-based and Windows 98-based clients only send LM). The default settings in OSes predating Windows Vista / Windows Server 2008 (non- R2) allowed all clients to authenticate with servers and use their resources. However, this meant that LM responses - the weakest form of authentication response - were sent over the network, and it was potentially possible for attackers to sniff that traffic to more easily reproduce the user's password. The Windows 95, Windows 98, and Windows NT operating systems cannot use the Kerberos version 5 protocol for authentication. For this reason, in a Windows Server 2003 domain, these computers authenticate by default with both the LM and NTLM protocols for network authentication. You can enforce a more secure authentication protocol for Windows 95, Windows 98, and Windows NT by using NTLMv2. For the logon process, NTLMv2 uses a secure channel to protect the authentication process. Even if you use NTLMv2 for older clients and servers, Windows-based clients and servers that are members of the domain will use the Kerberos authentication protocol to authenticate with Windows Server 2003 or newer Domain Controllers. For these reasons, it is strongly preferred to restrict the use of LM & NTLM (non-v2) as much as possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Send NTLMv2 response only. Refuse LM & NTLM: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LAN Manager authentication level." + compliance: + - cis: ["2.3.11.7"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36173-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 5' + + # 2.3.11.8 Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher + - id: 16548 + title: "Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher" + description: "This policy setting determines the level of data signing that is requested on behalf of clients that issue LDAP BIND requests. Note: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are included with Windows XP Professional use ldap_simple_bind or ldap_simple_bind_s to communicate with a Domain Controller. The recommended state for this setting is: Negotiate signing. Configuring this setting to Require signing also conforms to the benchmark." + rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks in which an intruder captures the packets between the client and server, modifies them, and then forwards them to the server. For an LDAP server, this susceptibility means that an attacker could cause a server to make decisions that are based on false or altered data from the LDAP queries. To lower this risk in your network, you can implement strong physical security measures to protect the network infrastructure. Also, you can make all types of man-in-the-middle attacks extremely difficult if you require digital signatures on all network packets by means of IPsec authentication headers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Negotiate signing (configuring to Require signing also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LDAP client signing requirements." + compliance: + - cis: ["2.3.11.8"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36858-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> n:(\d+) compare >= 1' + + # 2.3.11.9 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption' + - id: 16549 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" + description: "This policy setting determines which behaviors are allowed by clients for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable both options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. In other words, these options help protect against man-in-the-middle attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) clients." + compliance: + - cis: ["2.3.11.9"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37553-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinClientSec -> 537395200' + + # 2.3.11.10 Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption' + - id: 16550 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'" + description: "This policy setting determines which behaviors are allowed by servers for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable all of the options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. That is, these options help protect against man-in-the-middle attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) servers." + compliance: + - cis: ["2.3.11.10"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - https://workbench.cisecurity.org/benchmarks/288 + - "CCE-37835-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec -> 537395200' + + # 2.3.13.1 Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled' + - id: 16551 + title: "Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled'" + description: "This policy setting determines whether a computer can be shut down when a user is not logged on. If this policy setting is enabled, the shutdown command is available on the Windows logon screen. It is recommended to disable this policy setting to restrict the ability to shut down the computer to users with credentials on the system. The recommended state for this setting is: Disabled. Note: In Server 2008 R2 and older versions, this setting had no impact on Remote Desktop (RDP) / Terminal Services sessions - it only affected the local console. However, Microsoft changed the behavior in Windows Server 2012 (non-R2) and above, where if set to Enabled, RDP sessions are also allowed to shut down or restart the server." + rationale: "Users who can access the console locally could shut down the computer. Attackers could also walk to the local console and restart the server, which would cause a temporary DoS condition. Attackers could also shut down the server and leave all of its applications and services unavailable. As noted in the Description above, the Denial of Service (DoS) risk of enabling this setting dramatically increases in Windows Server 2012 (non-R2) and above, as even remote users could then shut down or restart the server from the logon screen of an RDP session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Shutdown: Allow system to be shut down without having to log on." + compliance: + - cis: ["2.3.13.1"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36788-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ShutdownWithoutLogon -> 0' + + # 2.3.15.1 Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled' + - id: 16552 + title: "Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'" + description: "This policy setting determines whether case insensitivity is enforced for all subsystems. The Microsoft Win32 subsystem is case insensitive. However, the kernel supports case sensitivity for other subsystems, such as the Portable Operating System Interface for UNIX (POSIX). Because Windows is case insensitive (but the POSIX subsystem will support case sensitivity), failure to enforce this policy setting makes it possible for a user of the POSIX subsystem to create a file with the same name as another file by using mixed case to label it. Such a situation can block access to these files by another user who uses typical Win32 tools, because only one of the files will be available. The recommended state for this setting is: Enabled." + rationale: "Because Windows is case-insensitive but the POSIX subsystem will support case sensitivity, failure to enable this policy setting would make it possible for a user of that subsystem to create a file with the same name as another file but with a different mix of upper and lower case letters. Such a situation could potentially confuse users when they try to access such files from normal Win32 tools because only one of the files will be available." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Require case insensitivity for non- Windows subsystems." + compliance: + - cis: ["2.3.15.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-37885-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive -> 1' + + # 2.3.15.2 Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled' + - id: 16553 + title: "Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'" + description: "This policy setting determines the strength of the default discretionary access control list (DACL) for objects. Active Directory maintains a global list of shared system resources, such as DOS device names, mutexes, and semaphores. In this way, objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and what permissions are granted. The recommended state for this setting is: Enabled." + rationale: "This setting determines the strength of the default DACL for objects. Windows maintains a global list of shared computer resources so that objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and with what permissions." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)" + compliance: + - cis: ["2.3.15.2"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-37644-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode -> 1' + + # 2.3.17.1 Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled' + - id: 16554 + title: "Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'" + description: "This policy setting controls the behavior of Admin Approval Mode for the built-in Administrator account. The recommended state for this setting is: Enabled." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. An attack vector for these programs was to discover the password of the account named 'Administrator' because that user account was created for all installations of Windows. To address this risk, in Windows Vista and newer, the built-in Administrator account is now disabled by default. In a default installation of a new computer, accounts with administrative control over the computer are initially set up in one of two ways: - If the computer is not joined to a domain, the first user account you create has the equivalent permissions as a local administrator. - If the computer is joined to a domain, no local administrator accounts are created. The Enterprise or Domain Administrator must log on to the computer and create one if a local administrator account is warranted. Once Windows is installed, the built-in Administrator account may be manually enabled, but we strongly recommend that this account remain disabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Admin Approval Mode for the Built-in Administrator account." + compliance: + - cis: ["2.3.17.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36494-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken -> 1' + + # 2.3.17.2 Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop' + - id: 16555 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'" + description: "This policy setting controls the behavior of the elevation prompt for administrators. The recommended state for this setting is: Prompt for consent on the secure desktop." + rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting raises awareness to the administrator of elevated privilege operations and permits the administrator to prevent a malicious program from elevating its privilege when the program attempts to do so." + remediation: "To establish the recommended configuration via GP, set the following UI path to Prompt for consent on the secure desktop: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode." + compliance: + - cis: ["2.3.17.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-37029-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> r:^2$' + + # 2.3.17.3 Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests' + - id: 16556 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'" + description: "This policy setting controls the behavior of the elevation prompt for standard users. The recommended state for this setting is: Automatically deny elevation requests." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious programs running under elevated credentials without the user or administrator being aware of their activity. This setting raises awareness to the user that a program requires the use of elevated privilege operations and requires that the user be able to supply administrative credentials in order for the program to run." + remediation: "To establish the recommended configuration via GP, set the following UI path to Automatically deny elevation requests: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for standard users." + compliance: + - cis: ["2.3.17.3"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1.2"] + - tsc: ["CC6.4"] + references: + - "CCE-36864-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser -> 0' + + # 2.3.17.4 Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled' + - id: 16557 + title: "Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'" + description: "This policy setting controls the behavior of application installation detection for the computer. The recommended state for this setting is: Enabled." + rationale: "Some malicious software will attempt to install itself after being given permission to run. For example, malicious software with a trusted application shell. The user may have given permission for the program to run because the program is trusted, but if they are then prompted for installation of an unknown component this provides another way of trapping the software before it can do damage." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Detect application installations and prompt for elevation." + compliance: + - cis: ["2.3.17.4"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36533-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 1' + + # 2.3.17.5 Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled' + - id: 16558 + title: "Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'" + description: "This policy setting controls whether applications that request to run with a User Interface Accessibility (UIAccess) integrity level must reside in a secure location in the file system. Secure locations are limited to the following: ...\\Program Files\\, including subfolders; ...\\Windows\\system32\\; ...\\Program Files (x86)\\, including subfolders (for 64-bit versions of Windows). Note: Windows enforces a public key infrastructure (PKI) signature check on any interactive application that requests to run with a UIAccess integrity level regardless of the state of this security setting. The recommended state for this setting is: Enabled." + rationale: "UIAccess Integrity allows an application to bypass User Interface Privilege Isolation (UIPI) restrictions when an application is elevated in privilege from a standard user to an administrator. This is required to support accessibility features such as screen readers that are transmitting user interfaces to alternative forms. A process that is started with UIAccess rights has the following abilities: - To set the foreground window. - To drive any application window using SendInput function. - To use read input for all integrity levels using low-level hooks, raw input, GetKeyState, GetAsyncKeyState, and GetKeyboardInput. - To set journal hooks. - To uses AttachThreadInput to attach a thread to a higher integrity input queue." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Only elevate UIAccess applications that are installed in secure locations." + compliance: + - cis: ["2.3.17.5"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-37057-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths -> 1' + + # 2.3.17.6 Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled' + - id: 16559 + title: "Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'" + description: "This policy setting controls the behavior of all User Account Control (UAC) policy settings for the computer. If you change this policy setting, you must restart your computer. The recommended state for this setting is: Enabled. Note: If this policy setting is disabled, the Security Center notifies you that the overall security of the operating system has been reduced." + rationale: "This is the setting that turns on or off UAC. If this setting is disabled, UAC will not be used and any security benefits and risk mitigations that are dependent on UAC will not be present on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Run all administrators in Admin Approval Mode." + compliance: + - cis: ["2.3.17.6"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36869-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA -> 1' + + # 2.3.17.7 Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled' + - id: 16560 + title: "Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'" + description: "This policy setting controls whether the elevation request prompt is displayed on the interactive user's desktop or the secure desktop. The recommended state for this setting is: Enabled." + rationale: "Standard elevation prompt dialog boxes can be spoofed, which may cause users to disclose their passwords to malicious software. The secure desktop presents a very distinct appearance when prompting for elevation, where the user desktop dims, and the elevation prompt UI is more prominent. This increases the likelihood that users who become accustomed to the secure desktop will recognize a spoofed elevation prompt dialog box and not fall for the trick." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Switch to the secure desktop when prompting for elevation." + compliance: + - cis: ["2.3.17.7"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36866-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop -> 1' + + # 2.3.17.8 Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled' + - id: 16561 + title: "Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'" + description: "This policy setting controls whether application write failures are redirected to defined registry and file system locations. This policy setting mitigates applications that run as administrator and write run-time application data to: - %ProgramFiles% - %Windir% - %Windir%\\system32 - HKEY_LOCAL_MACHINE\\Software. The recommended state for this setting is: Enabled." + rationale: "This setting reduces vulnerabilities by ensuring that legacy applications only write data to permitted locations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Virtualize file and registry write failures to per-user locations." + compliance: + - cis: ["2.3.17.8"] + - pci_dss: ["6.5.8"] + - tsc: ["CC6.1"] + references: + - "CCE-37064-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization -> 1' + + ############################################### + # 9 Windows Firewall with Advanced Security + ############################################### + + ############################################### + # 9.1 Domain Profile + ############################################### + + # 9.1.1 Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)' + - id: 16562 + title: "Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)'" + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Firewall state." + compliance: + - cis: ["9.1.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-36062-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall -> 1' + + # 9.1.2 Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)' + - id: 16563 + title: "Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)'" + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Inbound connections." + compliance: + - cis: ["9.1.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-38117-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction -> 1' + + # 9.1.3 Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)' + - id: 16564 + title: "Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)'" + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default)." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Outbound connections." + compliance: + - cis: ["9.1.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-36146-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction -> 0' + + # 9.1.4 Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No' + - id: 16565 + title: "Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'" + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.1.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-38041-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications -> 1' + + # 9.1.5 Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\domainfw.log' + - id: 16566 + title: "Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log'" + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\domainfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.1.5"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37482-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\domainfw.log' + + # 9.1.6 Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater' + - id: 16567 + title: "Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16384 KB or greater'" + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.1.6"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-36088-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + # 9.1.7 Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes' + - id: 16568 + title: "Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.1.7"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37523-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets -> 1' + + # 9.1.8 Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes' + - id: 16569 + title: "Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.1.8"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-36393-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections -> 1' + + ############################################### + # 9.2 Private Profile + ############################################### + + # 9.2.1 Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)' + - id: 16570 + title: "Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)'" + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Firewall state." + compliance: + - cis: ["9.2.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-38239-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall -> 1' + + # 9.2.2 Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)' + - id: 16571 + title: "Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)'" + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Inbound connections." + compliance: + - cis: ["9.2.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-38042-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction -> 1' + + # 9.2.3 Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)' + - id: 16572 + title: "Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)'" + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Outbound connections." + compliance: + - cis: ["9.2.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-38332-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction -> 0' + + # 9.2.4 Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No' + - id: 16573 + title: "Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'" + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.2.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-37621-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications -> 1' + + # 9.2.5 Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\privatefw.log' + - id: 16574 + title: "Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log'" + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\privatefw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.2.5"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37569-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\privatefw.log' + + # 9.2.6 Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater' + - id: 16575 + title: "Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16384 KB or greater'" + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.2.6"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-38178-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + # 9.2.7 Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes' + - id: 16576 + title: "Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.2.7"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-35972-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets -> 1' + + # 9.2.8 Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes' + - id: 16577 + title: "Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.2.8"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37387-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections -> 1' + + ############################################### + # 9.3 Public Profile + ############################################### + + # 9.3.1 Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)' + - id: 16578 + title: "Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'" + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Firewall state." + compliance: + - cis: ["9.3.1"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-37862-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall -> 1' + + # 9.3.2 Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)' + - id: 16579 + title: "Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)'" + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Inbound connections." + compliance: + - cis: ["9.3.2"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-36057-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction -> 1' + + # 9.3.3 Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)' + - id: 16580 + title: "Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)'" + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Outbound connections." + compliance: + - cis: ["9.3.3"] + - cis_csc: ["9.2"] + - pci_dss: ["1.2.3"] + - tsc: ["CC6.1"] + references: + - "CCE-37434-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction -> 0' + + # 9.3.4 Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No' + - id: 16581 + title: "Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No'" + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No." + rationale: "Some organizations may prefer to avoid alarming users when firewall rules block certain types of network activity. However, notifications can be helpful when troubleshooting network issues involving the firewall." + remediation: "To establish the recommended configuration via GP, set the following UI path to 'No': Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.3.4"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-38043-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications -> 1' + + # 9.3.5 Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No' + - id: 16582 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'" + description: "This setting controls whether local administrators are allowed to create local firewall rules that apply together with firewall rules configured by Group Policy. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "iWhen in the Public profile, there should be no special local firewall exceptions per computer. These settings should be managed by a centralized policy." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local firewall rules." + compliance: + - cis: ["9.3.5"] + - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-37861-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge -> 0' + + # 9.3.6 Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No' + - id: 16583 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'" + description: "This setting controls whether local administrators are allowed to create connection security rules that apply together with connection security rules configured by Group Policy. The recommended state for this setting is: No." + rationale: "Users with administrative privileges might create firewall rules that expose the system to remote attack." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local connection security rules." + compliance: + - cis: ["9.3.6"] + - cis_csc: ["5.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-36268-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0' + + # 9.3.7 Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\publicfw.log' + - id: 16584 + title: "Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log'" + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SYSTEMROOT%\\System32\\logfiles\\firewall\\publicfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Name" + compliance: + - cis: ["9.3.7"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37266-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\publicfw.log' + + # 9.3.8 Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater' + - id: 16585 + title: "Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16384 KB or greater'" + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.3.8"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-36395-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + # 9.3.9 Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes' + - id: 16586 + title: "Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.3.9"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37265-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets -> 1' + + # 9.3.9 Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes' + - id: 16587 + title: "Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'" + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.3.10"] + - cis_csc: ["6.2"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-36394-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections -> 1' + + ############################################### + # 17 Advanced Audit Policy Configuration + ############################################### + + ############################################### + # 18 Administrative Templates (Computer) + ############################################### + ############################################### + # 18.1 Control Panel + ############################################### + # 18.1.1.1 (L1) Ensure 'Prevent enabling lock screen camera' is set to 'Enabled' + - id: 16588 + title: "Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'" + description: "Disables the lock screen camera toggle switch in PC Settings and prevents a camera from being invoked on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen camera extends the protection afforded by the lock screen to camera features." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen camera. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38347-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera -> 1' + + # 18.1.1.2 Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled' + - id: 16589 + title: "Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'" + description: "Disables the lock screen slide show settings in PC Settings and prevents a slide show from playing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen slide show extends the protection afforded by the lock screen to slide show contents." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen slide show. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38348-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow -> 1' + # 18.1.2.2 Ensure 'Allow input personalization' is set to 'Disabled' + - id: 16590 + title: "Ensure 'Allow input personalization' is set to 'Disabled'" + description: "This policy enables the automatic learning component of input personalization that includes speech, inking, and typing. Automatic learning enables the collection of speech and handwriting patterns, typing history, contacts, and recent calendar information. It is required for the use of Cortana. Some of this collected information may be stored on the user's OneDrive, in the case of inking and typing; some of the information will be uploaded to Microsoft to personalize speech. The recommended state for this setting is: Disabled." + rationale: "If this setting is Enabled sensitive information could be stored in the cloud or sent to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Regional and Language Options\\Allow input personalization Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.1.2.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38347-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization -> AllowInputPersonalization -> 0' + + # 18.1.3 Ensure 'Allow Online Tips' is set to 'Disabled' (Scored) + - id: 16591 + title: "Ensure 'Allow Online Tips' is set to 'Disabled'" + description: "This policy setting configures the retrieval of online tips and help for the Settings app. The recommended state for this setting is: Disabled ." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Allow Online Tips Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanel.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.3"] + - cis_csc: ["9.1"] + - pci_dss: ["1.3.4"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> AllowOnlineTips -> 0' + + ############################################### + # Section 18.2 - LAPS + ############################################### + # 18.2.1 Ensure LAPS AdmPwd GPO Extension / CSE is installed + - id: 16592 + title: "Ensure LAPS AdmPwd GPO Extension / CSE is installed" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "In order to utilize LAPS, a minor Active Directory Schema update is required, and a Group Policy Client Side Extension (CSE) must be installed on each managed computer. When LAPS is installed, the file AdmPwd.dll must be present in the following location and registered in Windows (the LAPS AdmPwd GPO Extension / CSE installation does this for you): C:\\Program Files\\LAPS\\CSE\\AdmPwd.dll" + compliance: + - cis: ["18.2.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + + # 18.2.2 Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled' + - id: 16593 + title: "Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Do not allow password expiration time longer than required by policy Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.2"] + - cis_csc: ["16.2"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled -> 1' + + # 18.2.3 Ensure 'Enable Local Admin Password Management' is set to 'Enabled' + - id: 16594 + title: "Ensure 'Enable Local Admin Password Management' is set to 'Enabled'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Enable Local Admin Password Management Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.3"] + - cis_csc: ["16.9"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled -> 1' + + # 18.2.4 Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters' + - id: 16595 + title: "Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: Large letters + small letters + numbers + special characters. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Complexity option to Large letters + small letters + numbers + special characters: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.4"] + - cis_csc: ["5.7"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity -> 4' + + # 18.2.5 Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more' + - id: 16596 + title: "Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 15 or more. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Length option to 15 or more: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.5"] + - cis_csc: ["5.7"] + - pci_dss: ["8.2.3"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> n:^(\d+) compare >= 15' + + # 18.2.6 Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer' + - id: 16597 + title: "Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer'" + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 30 or fewer. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Age (Days) option to 30 or fewer: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.2.6"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2.4"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> n:^(\d+) compare <= 30' + + ############################################### + # Section 18.3 - MS Security Guide + ############################################### + # 18.3.1 Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled' + - id: 16598 + title: "Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled'" + description: "This setting controls whether local accounts can be used for remote administration via network logon (e.g., NET USE, connecting to C$, etc.). Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Enabling this policy significantly reduces that risk. Enabled: Applies UAC token-filtering to local accounts on network logons. Membership in powerful group such as Administrators is disabled and powerful privileges are removed from the resulting access token. This configures the LocalAccountTokenFilterPolicy registry value to 0. This is the default behavior for Windows. Disabled: Allows local accounts to have full administrative rights when authenticating via network logon, by configuring the LocalAccountTokenFilterPolicy registry value to 1. For more information about local accounts and credential theft, review the 'Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques' documents. For more information about LocalAccountTokenFilterPolicy, see Microsoft Knowledge Base article 951016: Description of User Account Control and remote restrictions in Windows Vista. The recommended state for this setting is: Enabled." + rationale: "Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Ensuring this policy is Enabled significantly reduces that risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Apply UAC restrictions to local accounts on network logons Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft." + compliance: + - cis: ["18.3.1"] + - cis_csc: ["5.8"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - https://www.microsoft.com/en-us/download/details.aspx?id=36036 + - https://support.microsoft.com/en-us/help/951016/description-of-user-account-control-and-remote-restrictions-in-windows + - https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/ + - "CCE-37069-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy -> 1' + + # 18.3.2 (L1) Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver' + - id: 16599 + title: "Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver'" + description: "This setting configures the start type for the Server Message Block version 1 (SMBv1) client driver service ( MRxSmb10 ), which is recommended to be disabled. The recommended state for this setting is: Enabled: Disable driver. Note: Do not, under any circumstances, configure this overall setting as Disabled , as doing so will delete the underlying registry entry altogether, which will cause serious problems." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable driver : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 client driver Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "https://techcommunity.microsoft.com/t5/storage-at-microsoft/stop-using-smb1/ba-p/425858" + - "https://docs.microsoft.com/en-us/archive/blogs/staysafe/disable-smb-v1-in-managed-environments-with-ad-group-policy" + - "https://docs.microsoft.com/en-us/archive/blogs/secguide/disabling-smbv1-through-group-policy" + - "https://docs.microsoft.com/en-us/archive/blogs/secguide/security-baseline-for-windows-10-creators-update-v1703-final" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start -> 1' + + # 18.3.3 Ensure 'Configure SMB v1 server' is set to 'Disabled' (Scored) + - id: 16600 + title: "Ensure 'Configure SMB v1 server' is set to 'Disabled'" + description: "This setting configures the server-side processing of the Server Message Block version 1 (SMBv1) protocol. The recommended state for this setting is: Disabled ." + rationale: "Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 server Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "https://techcommunity.microsoft.com/t5/storage-at-microsoft/stop-using-smb1/ba-p/425858" + - "https://docs.microsoft.com/en-us/archive/blogs/staysafe/disable-smb-v1-in-managed-environments-with-ad-group-policy" + - "https://docs.microsoft.com/en-us/archive/blogs/secguide/disabling-smbv1-through-group-policy" + - "https://docs.microsoft.com/en-us/archive/blogs/secguide/security-baseline-for-windows-10-creators-update-v1703-final" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1 -> 0' + + # 18.3.4 Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled' + - id: 16601 + title: "Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled'" + description: "Windows includes support for Structured Exception Handling Overwrite Protection (SEHOP). We recommend enabling this feature to improve the security profile of the computer. The recommended state for this setting is: Enabled ." + rationale: "This feature is designed to block exploits that use the Structured Exception Handler (SEH) overwrite technique. This protection mechanism is provided at run-time. Therefore, it helps protect applications regardless of whether they have been compiled with the latest improvements, such as the /SAFESEH option." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Enable Structured Exception Handling Overwrite Protection (SEHOP) Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.4"] + - cis_csc: ["8.4"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + references: + - "https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/" + - "https://support.microsoft.com/en-us/help/956607/how-to-enable-structured-exception-handling-overwrite-protection-sehop" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation -> 0' + + # 18.3.5 (L1) Ensure 'Extended Protection for LDAP Authentication (Domain Controllers only)' is set to 'Enabled: Enabled, always (recommended)' (DC Only) (Scored) + - id: 16602 + title: "Ensure 'Extended Protection for LDAP Authentication (Domain Controllers only)' is set to 'Enabled: Enabled, always (recommended)'" + description: "This setting controls LDAP authentication over SSL/TLS to help make it more secure. The recommended state for this setting is: Enabled: Enabled, always (recommended) . Note: All LDAP clients must have the CVC-2017-8563 security update to be compatible with Domain Controllers that have this setting enabled." + rationale: "Configuring the LdapEnforceChannelBinding registry value can help to increase protection against 'man-in-the-middle attacks'. " + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Enabled, always (recommended) : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Extended Protection for LDAP Authentication (Domain Controllers only) Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.5"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CVC-2017-8563" + - "https://support.microsoft.com/en-us/help/4034879/how-to-add-the-ldapenforcechannelbinding-registry-entry" + - "https://blogs.technet.microsoft.com/secguide/2018/11/20/security-baseline-final-for-windows-10-v1809-and-windows-server-2019/" + - "https://technet.microsoft.com/library/security/973811" + - "https://support.microsoft.com/en-us/help/4034879/how-to-add-the-ldapenforcechannelbinding-registry-entry" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters -> LdapEnforceChannelBinding -> 2' + + # 18.3.6 Ensure 'WDigest Authentication' is set to 'Disabled' + - id: 16603 + title: "Ensure 'WDigest Authentication' is set to 'Disabled'" + description: "When WDigest authentication is enabled, Lsass.exe retains a copy of the user's plaintext password in memory, where it can be at risk of theft. If this setting is not configured, WDigest authentication is disabled in Windows 8.1 and in Windows Server 2012 R2; it is enabled by default in earlier versions of Windows and Windows Server." + rationale: "Preventing the plaintext storage of credentials in memory may reduce opportunity for credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\WDigest Authentication (disabling may require KB2871997) Note: This Group Policy path does not exist by default. An additional Group Policy template ( SecGuide.admx/adml ) is required" + compliance: + - cis: ["18.3.6"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "http://www.microsoft.com/en-us/download/details.aspx?id=36036" + - "https://support.microsoft.com/en-us/kb/2871997" + - "https://blogs.technet.microsoft.com/secguide/2017/08/30/security-baseline-for-windows-10-creators-update-v1703-final/" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential -> 0' + + ############################################### + # 18.4 MSS (Legacy) + ############################################### + # 18.4.1 Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled' + - id: 16604 + title: "Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled'" + description: "This setting is separate from the Welcome screen feature in Windows XP and Windows Vista; if that feature is disabled, this setting is not disabled. If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks to which the computer is connected. Also, if you enable automatic logon, the password is stored in the registry in plaintext, and the specific registry key that stores this value is remotely readable by the Authenticated Users group. The recommended state for this setting is: Disabled." + rationale: "If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks that the computer is connected to. Also, if you enable automatic logon, the password is stored in the registry in plaintext. The specific registry key that stores this setting is remotely readable by the Authenticated Users group. As a result, this entry is appropriate only if the computer is physically secured and if you ensure that untrusted users cannot remotely see the registry." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - https://support.microsoft.com/en-us/help/324737/how-to-turn-on-automatic-logon-in-windows + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-37067-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> 0' + + # 18.4.2 Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' + - id: 16605 + title: "Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should follow through the network. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.2"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-36871-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting -> 2' + + # 18.4.3 Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' + - id: 16606 + title: "Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'" + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should take through the network. It is recommended to configure this setting to Not Defined for enterprise environments and to Highest Protection for high security environments to completely disable source routing. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.3"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-36535-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting -> 2' + + # 18.4.4 Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled' + - id: 16607 + title: "Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'" + description: "Internet Control Message Protocol (ICMP) redirects cause the IPv4 stack to plumb host routes. These routes override the Open Shortest Path First (OSPF) generated routes. The recommended state for this setting is: Disabled." + rationale: "This behavior is expected. The problem is that the 10 minute time-out period for the ICMP redirect-plumbed routes temporarily creates a network situation in which traffic will no longer be routed properly for the affected host. Ignoring such ICMP redirects will limit the system's exposure to attacks that will impact its ability to participate on the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.4"] + - cis_csc: ["9"] + - nist_800_53: ["SC.5"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-37988-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect -> 0' + + # 18.4.5 Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes' + - id: 16608 + title: "Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes (recommended)'" + description: "This value controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet." + rationale: "An attacker who is able to connect to network applications could establish numerous connections to cause a DoS condition." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 300,000 or 5 minutes (recommended): Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds." + compliance: + - cis: ["18.4.5"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + - nist_800_53: ["SC.5"] + references: + - "CCE-36868-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> 300000' + + # 18.4.6 Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled' + - id: 16609 + title: "Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'" + description: "NetBIOS over TCP/IP is a network protocol that among other things provides a way to easily resolve NetBIOS names that are registered on Windows-based systems to the IP addresses that are configured on those systems. This setting determines whether the computer releases its NetBIOS name when it receives a name-release request. The recommended state for this setting is: Enabled." + rationale: "The NetBT protocol is designed not to use authentication, and is therefore vulnerable to spoofing. Spoofing makes a transmission appear to come from a user other than the user who performed the action. A malicious user could exploit the unauthenticated nature of the protocol to send a name-conflict datagram to a target computer, which would cause the computer to relinquish its name and not respond to queries. An attacker could send a request over the network and query a computer to release its NetBIOS name. As with any change that could affect applications, it is recommended that you test this change in a non-production environment before you change the production environment. The result of such an attack could be to cause intermittent connectivity issues on the target computer, or even to prevent the use of Network Neighborhood, domain logons, the NET SEND command, or additional NetBIOS name resolution." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.6"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.6"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-36879-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand -> 1' + + # 18.4.7 Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled' + - id: 16610 + title: "Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'" + description: "This setting is used to enable or disable the Internet Router Discovery Protocol (IRDP), which allows the system to detect and configure default gateway addresses automatically as described in RFC 1256 on a per-interface basis." + rationale: "An attacker who has gained control of a computer on the same network segment could configure a computer on the network to impersonate a router." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)." + compliance: + - cis: ["18.4.7"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + - nist_800_53: ["SC.5"] + references: + - "CCE-38065-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> 0' + + # 18.4.8 Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled' + - id: 16611 + title: "Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'" + description: "The DLL search order can be configured to search for DLLs that are requested by running processes in one of two ways: -Search folders specified in the system path first, and then search the current working folder. -Search current working folder first, and then search the folders specified in the system path. When enabled, the registry value is set to 1. With a setting of 1, the system first searches the folders that are specified in the system path and then searches the current working folder. When disabled the registry value is set to 0 and the system first searches the current working folder and then searches the folders that are specified in the system path. Applications will be forced to search for DLLs in the system path first. For applications that require unique versions of these DLLs that are included with the application, this entry could cause performance or stability problems. The recommended state for this setting is: Enabled." + rationale: "If a user unknowingly executes hostile code that was packaged with additional files that include modified versions of system DLLs, the hostile code could load its own versions of those DLLs and potentially increase the type and degree of damage the code can render." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.8"] + - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-36351-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode -> 1' + + # 18.4.9 Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds' + - id: 16612 + title: "Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds'" + description: "Windows includes a grace period between when the screen saver is launched and when the console is actually locked automatically when screen saver locking is enabled. The recommended state for this setting is: Enabled: 5 or fewer seconds." + rationale: "The default grace period that is allowed for user movement before the screen saver lock takes effect is five seconds. If you leave the default grace period configuration, your computer is vulnerable to a potential attack from someone who could approach the console and attempt to log on to the computer before the lock takes effect. An entry to the registry can be made to adjust the length of the grace period." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 5 or fewer seconds: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.9"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-37993-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> n:^(\d+) compare <= 5' + + # 18.4.10 Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3' + - id: 16613 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted." + compliance: + - cis: ["18.4.10"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + - nist_800_53: ["SC.5"] + references: + - "CCE-37846-3" + - "https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' + + # 18.4.11 Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3' + - id: 16614 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'" + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted." + compliance: + - cis: ["18.4.11"] + - cis_csc: ["9"] + - pci_dss: ["1.3.3"] + - tsc: ["A1.1", "CC6.1", "CC7.2"] + - nist_800_53: ["SC.5"] + references: + - "CCE-36051-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' + + # 18.4.12 Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less' + - id: 16615 + title: "Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less'" + description: "This setting can generate a security audit in the Security event log when the log reaches a user-defined threshold. The recommended state for this setting is: Enabled: 90% or less. Note: If log settings are configured to Overwrite events as needed or Overwrite events older than x days, this event will not be generated." + rationale: "If the Security log reaches 90 percent of its capacity and the computer has not been configured to overwrite events as needed, more recent events will not be written to the log. If the log reaches its capacity and the computer has been configured to shut down when it can no longer record events to the Security log, the computer will shut down and will no longer be available to provide network services." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 90% or less: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.4.12"] + - cis_csc: ["6.3"] + - pci_dss: ["10.7"] + references: + - https://blogs.technet.microsoft.com/secguide/2016/10/02/the-mss-settings/ + - "CCE-36880-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> n:^(\d+) compare <= 90' + + ############################################### + # 18.5 Network + ############################################### + # 18.5.4.1 Set 'NetBIOS node type' to 'P-node' (Ensure NetBT Parameter 'NodeType' is set to '0x2 (2)') + - id: 16616 + title: "Set 'NetBIOS node type' to 'P-node' (Ensure NetBT Parameter 'NodeType' is set to '0x2 (2)')" + description: "This parameter determines which method NetBIOS over TCP/IP (NetBT) will use to register and resolve names. A B-node (broadcast) system only uses broadcasts. A P-node (point-to-point) system uses only name queries to a name server (WINS). An M-node (mixed) system broadcasts first, then queries the name server (WINS). An H-node (hybrid) system queries the name server (WINS) first, then broadcasts. The recommended state for this setting is: NodeType - 0x2 (2) (P-node / point-to-point)." + rationale: "In order to help mitigate the risk of NetBIOS Name Service (NBT-NS) poisoning attacks, setting the node type to P-node will prevent the system from sending out NetBIOS broadcasts." + remediation: "To establish the recommended configuration, set the following Registry value to 0x2 (2) (DWORD) : HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Services\\NetBT\\Parameters:NodeType" + compliance: + - cis: ["18.5.4.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NetBT\Parameters -> NodeType -> 2' + + # 18.5.4.2 Ensure 'Turn off multicast name resolution' is set to 'Enabled' + - id: 16617 + title: "Ensure 'Turn off multicast name resolution' is set to 'Enabled'" + description: "LLMNR is a secondary name resolution protocol. With LLMNR, queries are sent using multicast over a local network link on a single subnet from a client computer to another client computer on the same subnet that also has LLMNR enabled. LLMNR does not require a DNS server or DNS client configuration, and provides name resolution in scenarios in which conventional DNS name resolution is not possible. The recommended state for this setting is: Enabled ." + rationale: "An attacker can listen on a network for these LLMNR (UDP/5355) or NBT-NS (UDP/137) broadcasts and respond to them, tricking the host into thinking that it knows the location of the requested system. Note: To completely mitigate local name resolution poisoning, in addition to this setting, the properties of each installed NIC should also be set to Disable NetBIOS over TCP/IP (on the WINS tab in the NIC properties). Unfortunately, there is no global setting to achieve this that automatically applies to all NICs - it is a per-NIC setting that varies with different NIC hardware installations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Turn off multicast name resolution ote: This Group Policy path may not exist by default. It is provided by the Group Policy template DnsClient.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.4.2"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37450-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast -> 0' + + ############################################### + # 18.5.5 Fonts + ############################################### + # 18.5.5.1 Ensure 'Enable Font Providers' is set to 'Disabled' (Scored) + - id: 16618 + title: "Ensure 'Enable Font Providers' is set to 'Disabled'" + description: "This policy setting determines whether Windows is allowed to download fonts and font catalog data from an online font provider.The recommended state for this setting is: Disabled ." + rationale: "In an enterprise managed environment the IT department should be managing the changes to the system configuration, to ensure all changes are tested and approved." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Network\\Fonts\\Enable Font Providers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.5.1"] + - cis_csc: ["3", "13"] + - pci_dss: ["6.4.5"] + - tsc: ["CC6.6", "CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableFontProviders -> 0' + + # 18.5.8.1 Ensure 'Enable insecure guest logons' is set to 'Disabled' + - id: 16619 + title: "Ensure 'Enable insecure guest logons' is set to 'Disabled'" + description: "This policy setting determines if the SMB client will allow insecure guest logons to an SMB server. The recommended state for this setting is: Disabled ." + rationale: "Insecure guest logons are used by file servers to allow unauthenticated access to shared folders." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\LanmanWorkstation\\Enable insecure guest logons Note: This Group Policy path may not exist by default. It is provided by the Group Policy template LanmanWorkstation.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.8.1"] + - cis_csc: ["9.1"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation -> AllowInsecureGuestAuth -> 0' + + # Section 18.5.9 - Link-Layer Topology Discovery + # 18.5.9.1 Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled' + - id: 16620 + title: "Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'" + description: "This policy setting changes the operational behavior of the Mapper I/O network protocol driver." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Mapper I/O (LLTDIO) driver." + compliance: + - cis: ["18.5.9.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38170-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitLLTDIOOnPrivateNet -> 0' + + # 18.5.9.2 (L2) Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled' + - id: 16621 + title: "Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'" + description: "This policy setting changes the operational behavior of the Responder network protocol driver." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Responder (RSPNDR) driver." + compliance: + - cis: ["18.5.9.2"] + - cis_csc: ["9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37959-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnPublicNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitRspndrOnPrivateNet -> 0' + + # Section 18.5.10 - Microsoft Peer-to-Peer Networking Services + - id: 16622 + title: "Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'" + description: "The Peer Name Resolution Protocol (PNRP) allows for distributed resolution of a name to an IPv6 address and port number." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to peer-to-peer networking." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Microsoft Peer-to-Peer Networking Services\\Turn off Microsoft Peer-to-Peer Networking Services." + compliance: + - cis: ["18.5.10.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37699-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> 1' + + # 18.5.11.2 (L1) Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled' (Scored) + - id: 16623 + title: "Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'" + description: "You can use this procedure to controls user's ability to install and configure a Network Bridge. The recommended state for this setting is: Enabled." + rationale: "The Network Bridge setting, if enabled, allows users to create a Layer 2 Media Access Control (MAC) bridge, enabling them to connect two or more physical network segments together. A Network Bridge thus allows a computer that has connections to two different networks to share data between those networks. In an enterprise managed environment, where there is a need to control network traffic to only authorized paths, allowing users to create a Network Bridge increases the risk and attack surface from the bridged network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit installation and configuration of Network Bridge on your DNS domain network Note: This Group Policy path is provided by the Group Policy template NetworkConnections.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.11.2"] + - cis_csc: ["5.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + references: + - "CCE-38002-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA -> 0' + + # 18.5.11.3 (L1) Ensure 'Prohibit use of Internet Connection Sharing on your DNS domain network' is set to 'Enabled' (Scored) + - id: 16624 + title: "Ensure 'Prohibit use of Internet Connection Sharing on your DNS domain network' is set to 'Enabled'" + description: 'Although this "legacy" setting traditionally applied to the use of Internet Connection Sharing (ICS) in Windows 2000, Windows XP & Server 2003, this setting now freshly applies to the Mobile Hotspot feature in Windows 10 & Server 2016. The recommended state for this setting is: Enabled .' + rationale: "Non-administrators should not be able to turn on the Mobile Hotspot feature and open their Internet connectivity up to nearby mobile devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit use of Internet Connection Sharing on your DNS domain network Note: This Group Policy path is provided by the Group Policy template NetworkConnections.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.5.11.3"] + - cis_csc: ["9.1"] + - pci_dss: ["1.3.5"] + - tsc: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_ShowSharedAccessUI -> 0' + + # 18.5.11.4 (L1) Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled' (Scored) + - id: 16625 + title: "Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'" + description: "This policy setting determines whether to require domain users to elevate when setting a network's location. The recommended state for this setting is: Enabled ." + rationale: "Allowing regular users to set a network location increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Require domain users to elevate when setting a network's location Note: This Group Policy path may not exist by default. It is provided by the Group Policy template NetworkConnections.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.5.11.4"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-38188-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation -> 1' + + # 18.5.14.1 Ensure 'Hardened UNC Paths' is set to 'Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares' + - id: 16626 + title: 'Ensure ''Hardened UNC Paths'' is set to ''Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares''' + description: 'This policy setting configures secure access to UNC paths. The recommended state for this setting is: Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares .' + rationale: "In February 2015, Microsoft released a new control mechanism to mitigate a security risk in Group Policy as part of the MS15-011 / MSKB 3000483 security update. This mechanism requires both the installation of the new security update and also the deployment of specific group policy settings to all computers on the domain from Windows Vista / Server 2008 (non-R2) or newer (the associated security patch to enable this feature was not released for Server 2003). A new group policy template ( NetworkProvider.admx/adml ) was also provided with the security update. Once the new GPO template is in place, the following are the minimum requirements to remediate the Group Policy security risk: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1" + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with the following paths configured, at a minimum: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Provider\\Hardened UNC Paths Note: This Group Policy path does not exist by default. An additional Group Policy template ( NetworkProvider.admx/adml ) is required" + compliance: + - cis: ["18.5.14.1"] + - cis_csc: ["3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\NETLOGON -> r:RequireMutualAuthentication=1 && r:RequireIntegrity=1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\SYSVOL -> r:RequireMutualAuthentication=1 && r:RequireIntegrity=1' + + # Section 18.5.19.2 - Parameters + # 18.5.19.2.1 (L2) Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)') (Scored) + - id: 16627 + title: "Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')" + rationale: "Since the vast majority of private enterprise managed networks have no need to utilize IPv6 (because they have access to private IPv4 addressing), disabling IPv6 components reduces a possible attack surface that is also harder to monitor the traffic on." + remediation: "To establish the recommended configuration, set the following Registry value to 0xff (255) (DWORD): HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TCPIP6\\Parameters:DisabledComponents." + compliance: + - cis: ["18.5.19.2.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.2"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> 255' + + # Section 18.5.20 - Windows Connect Now + # 18.5.20.1 (L2) Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled' (Scored) + - id: 16628 + title: "Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'" + description: "This policy setting allows the configuration of wireless settings using Windows Connect Now (WCN)." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to user configuration of wireless settings." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Configuration of wireless settings using Windows Connect Now." + compliance: + - cis: ["18.5.20.1"] + - cis_csc: ["15.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37481-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> 0' + + # 18.5.20.2 (L2) Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled' (Scored) + - id: 16629 + title: "Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'" + description: "This policy setting prohibits access to Windows Connect Now (WCN) wizards." + rationale: "Allowing standard users to access the Windows Connect Now wizard increases the risk and attack surface." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\Network\Network\\Windows Connect Now\\Prohibit access of the Windows Connect Now wizards." + compliance: + - cis: ["18.5.20.2"] + - cis_csc: ["15.4"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36109-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> 1' + + # Section 18.5.21 - Windows Connection Manager + # 18.5.21.1 (L1) Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled' (Scored) + - id: 16630 + title: "Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled'" + description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time. The recommended state for this setting is: Enabled." + rationale: "Blocking simultaneous connections can help prevent a user unknowingly allowing network traffic to flow between the Internet and the enterprise managed network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Minimize the number of simultaneous connections to the Internet or a Windows Domain Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WCM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.5.21.1"] + - cis_csc: ["12"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-38338-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections -> n:(\d+) compare != 0' + + # 18.5.21.2 (L2) Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled' (MS only) (Scored) + - id: 16631 + title: "Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled'" + description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time." + rationale: "The potential concern is that a user would unknowingly allow network traffic to flow between the insecure public network and the enterprise managed network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Prohibit connection to non-domain networks when connected to domain authenticated network." + compliance: + - cis: ["18.5.21.2"] + - cis_csc: ["12"] + - pci_dss: ["1.3.4"] + - tsc: ["CC6.6"] + references: + - "CCE-37627-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain -> 1' + + ############################################### + # 18.7 Start Menu and Taskbar + ############################################### + + # 18.7.1.1 (L2) Ensure 'Turn off notifications network usage' is set to 'Enabled' (Scored) + - id: 16632 + title: "Ensure 'Turn off notifications network usage' is set to 'Enabled'" + description: "This policy setting blocks applications from using the network to send notifications to update tiles, tile badges, toast, or raw notifications. This policy setting turns off the connection between Windows and the Windows Push Notification Service (WNS). This policy setting also stops applications from being able to poll application services to update tiles. The recommended state for this setting is: Enabled ." + rationale: "Windows Push Notification Services (WNS) is a mechanism to receive 3rd-party notifications and updates from the cloud/Internet. In a high security environment, external systems, especially those hosted outside the organization, should be prevented from having an impact on the secure workstations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Start Menu and Taskbar\\Turn off notifications network usage Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WPN.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.7.1.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -> NoCloudApplicationNotification -> 1' + + ############################################### + # 18.8 System + ############################################### + ###################################### + # 18.8.3 Audit Process Creation + ###################################### + - id: 16633 + title: "Ensure 'Include command line in process creation events' is set to 'Disabled'" + description: "This policy setting determines what information is logged in security audit events when a new process has been created. The recommended state for this setting is: Disabled." + rationale: "When this policy setting is enabled, any user who has read access to the security events can read the command-line arguments for any successfully created process. Command-line arguments may contain sensitive or private information such as passwords or user data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Audit Process Creation\\Include command line in process creation events Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AuditSettings.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.3.1"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-36925-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled -> 0' + + ###################################### + # 18.8.4 Credentials Delegation + ###################################### + # 18.8.4.1 (L1) Ensure 'Encryption Oracle Remediation' is set to 'Enabled: Force Updated Clients' (Scored) + - id: 16634 + title: "Ensure 'Encryption Oracle Remediation' is set to 'Enabled: Force Updated Clients'" + description: "Some versions of the CredSSP protocol that is used by some applications (such as Remote Desktop Connection) are vulnerable to an encryption oracle attack against the client. This policy controls compatibility with vulnerable clients and servers and allows you to set the level of protection desired for the encryption oracle vulnerability. The recommended state for this setting is: Enabled: Force Updated Clients ." + rationale: "This setting is important to mitigate the CredSSP encryption oracle vulnerability, for which information was published by Microsoft on 03/13/2018 in CVE-2018-0886 | CredSSP Remote Code Execution Vulnerability. All versions of Windows Server from Server 2008 (non-R2) onwards are affected by this vulnerability, and will be compatible with this recommendation provided that they have been patched up through May 2018 (or later)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Force Updated Clients : Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Encryption Oracle Remediation Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1803 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.4.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters -> AllowEncryptionOracle -> 0' + + # 18.8.4.2 (L1) Ensure 'Remote host allows delegation of non-exportable credentials' is set to 'Enabled' (Scored) + - id: 16635 + title: "Ensure 'Remote host allows delegation of non-exportable credentials' is set to 'Enabled'" + description: "Remote host allows delegation of non-exportable credentials. When using credential delegation, devices provide an exportable version of credentials to the remote host. This exposes users to the risk of credential theft from attackers on the remote host. The Restricted Admin Mode and Windows Defender Remote Credential Guard features are two options to help protect against this risk. The recommended state for this setting is: Enabled ." + rationale: "Restricted Admin Mode was designed to help protect administrator accounts by ensuring that reusable credentials are not stored in memory on remote devices that could potentially be compromised. Windows Defender Remote Credential Guard helps you protect your credentials over a Remote Desktop connection by redirecting Kerberos requests back to the device that is requesting the connection. Both features should be enabled and supported, as they reduce the chance of credential theft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Remote host allows delegation of non-exportable credentials Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.4.2"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "https://docs.microsoft.com/en-us/windows/access-protection/remote-credential-guard" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds -> 1' + + ########################################## + # 18.8.14 Early Launch Antimalware + ########################################## + # 18.8.14.1 (L1) Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical' (Scored) + - id: 16636 + title: "Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'" + description: "This policy setting allows you to specify which boot-start drivers are initialized based on a classification determined by an Early Launch Antimalware boot-start driver. The Early Launch Antimalware boot-start driver can return the following classifications for each boot-start driver: - Good: The driver has been signed and has not been tampered with. - Bad: The driver has been identified as malware. It is recommended that you do not allow known bad drivers to be initialized. - Bad, but required for boot: The driver has been identified as malware, but the computer cannot successfully boot without loading this driver. - Unknown: This driver has not been attested to by your malware detection application and has not been classified by the Early Launch Antimalware boot-start driver. If you enable this policy setting you will be able to choose which boot-start drivers to initialize the next time the computer is started. If your malware detection application does not include an Early Launch Antimalware boot- start driver or if your Early Launch Antimalware boot-start driver has been disabled, this setting has no effect and all boot-start drivers are initialized. The recommended state for this setting is: Enabled: Good, unknown and bad but critical." + rationale: "This policy setting helps reduce the impact of malware that has already infected your system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Good, unknown and bad but critical: Computer Configuration\\Policies\\Administrative Templates\\System\\Early Launch Antimalware\\Boot-Start Driver Initialization Policy Note: This Group Policy path may not exist by default. It is provided by the Group Policy template EarlyLaunchAM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.14.1"] + - cis_csc: ["8"] + - pci_dss: ["5.1.1"] + - nist_800_53: ["SI.3"] + - tsc: ["CC6.8"] + references: + - "CCE-37912-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy -> 3' + + # 18.8.21.2 (L1) Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE' (Scored) + - id: 16637 + title: "Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'" + description: "The 'Do not apply during periodic background processing' option prevents the system from updating affected policies in the background while the computer is in use. When background updates are disabled, policy changes will not take effect until the next user logon or system restart. The recommended state for this setting is: Enabled: FALSE (unchecked)." + rationale: "Setting this option to false (unchecked) will ensure that domain policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Do not apply during periodic background processing option to FALSE (unchecked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.2"] + - cis_csc: ["3.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36169-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy -> 0' + + # 18.8.21.3 (L1) Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE' (Scored) + - id: 16638 + title: "Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'" + description: "The 'Process even if the Group Policy objects have not changed' option updates and reapplies policies even if the policies have not changed. The recommended state for this setting is: Enabled: TRUE (checked)." + rationale: "Setting this option to true (checked) will ensure unauthorized changes that might have been configured locally are forced to match the domain-based Group Policy settings again." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Process even if the Group Policy objects have not changed option to TRUE (checked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.3"] + - cis_csc: ["3.7"] + - pci_dss: ["11.5.1"] + - tsc: ["PI1.4", "PI1.5", "CC6.1", "CC6.8", "CC7.2", "CC7.3", "CC7.4"] + references: + - "CCE-36169-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges -> 0' + + # 18.8.21.4 (L1) Ensure 'Continue experiences on this device' is set to 'Disabled' (Scored) + - id: 16639 + title: "Ensure 'Continue experiences on this device' is set to 'Disabled'" + description: "This policy setting determines whether the Windows device is allowed to participate in cross-device experiences (continue experiences). The recommended state for this setting is: Disabled ." + rationale: "A cross-device experience is when a system can access app and send messages to other devices. In an enterprise managed environment only trusted systems should be communicating within the network. Access to any other system should be prohibited." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Continue experiences on this device Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.21.4"] + - cis_csc: ["9.1"] + - pci_dss: ["6.5.8"] + - nist_800_53: ["SA.11", "AU.14", "AC.7"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableCdp -> 0' + + # 18.8.21.5 (L1) Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled' (Scored) + - id: 16640 + title: "Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'" + description: "This policy setting prevents Group Policy from being updated while the computer is in use. This policy setting applies to Group Policy for computers, users and Domain Controllers. The recommended state for this setting is: Disabled." + rationale: "This setting ensures that group policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Turn off background refresh of Group Policy Note: This Group Policy path is provided by the Group Policy template GroupPolicy.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.21.5"] + - cis_csc: ["3.7"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-37712-7" + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy' + + # 18.8.22.1.1 (L1) Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled' (Scored) + - id: 16641 + title: "Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'" + description: "This policy setting controls whether the computer can download print driver packages over HTTP. To set up HTTP printing, printer drivers that are not available in the standard operating system installation might need to be downloaded over HTTP. The recommended state for this setting is: Enabled." + rationale: "Users might download drivers that include malicious code." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off downloading of print drivers over HTTP Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36625-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> 1' + + # 18.8.22.1.2 (L2) Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled' (Scored) + - id: 16642 + title: "Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'" + description: "This setting turns off data sharing from the handwriting recognition personalization tool. The handwriting recognition personalization tool enables Tablet PC users to adapt handwriting recognition to their own writing style by providing writing samples. The tool can optionally share user writing samples with Microsoft to improve handwriting recognition in future versions of Windows. The tool generates reports and transmits them to Microsoft over a secure connection. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting personalization data sharing. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ShapeCollector.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.22.1.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37911-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> 1' + + # 18.8.22.1.3 (L2) Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled' (Scored) + - id: 16643 + title: "Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'" + description: "Turns off the handwriting recognition error reporting tool. The handwriting recognition error reporting tool enables users to report errors encountered in Tablet PC Input Panel. The tool generates error reports and transmits them to Microsoft over a secure connection. Microsoft uses these error reports to improve handwriting recognition in future versions of Windows. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting recognition error reporting. Note: This Group Policy path is provided by the Group Policy template InkWatson.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.3"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36203-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> 1' + + # 18.8.22.1.4 (L2) Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled' (Scored) + - id: 16644 + title: "Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'" + description: "This policy setting specifies whether the Internet Connection Wizard can connect to Microsoft to download a list of Internet Service Providers (ISPs). The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.4"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37163-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> 1' + + # 18.8.22.1.5 (L1) Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled' (Scored) + - id: 16645 + title: "Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'" + description: "This policy setting controls whether Windows will download a list of providers for the Web publishing and online ordering wizards. The recommended state for this setting is: Enabled." + rationale: "Although the risk is minimal, enabling this setting will reduce the possibility of a user unknowingly downloading malicious content through this feature." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet download for Web publishing and online ordering wizards Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.5"] + - cis_csc: ["7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36096-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> 1' + + # 18.8.22.1.6 (L1) Ensure 'Turn off printing over HTTP' is set to 'Enabled' (Scored) + - id: 16646 + title: "Ensure 'Turn off printing over HTTP' is set to 'Enabled'" + description: "This policy setting allows you to disable the client computer's ability to print over HTTP, which allows the computer to print to printers on the intranet as well as the Internet. The recommended state for this setting is: Enabled." + rationale: "Information that is transmitted over HTTP through this capability is not protected and can be intercepted by malicious users. For this reason, it is not often used in enterprise managed environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off printing over HTTP Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.6"] + - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36920-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> 1' + + # 18.8.22.1.7 (L2) Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled' (Scored) + - id: 16647 + title: "Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'" + description: "This policy setting specifies whether the Windows Registration Wizard connects to Microsoft.com for online registration. The recommended state for this setting is: Enabled." + rationale: "Users in an enterprise managed environment should not be registering their own copies of Windows, providing their own PII in the process." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Registration if URL connection is referring to Microsoft.com. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36352-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> 1' + + # 18.8.22.1.8 (L2) Ensure 'Turn off Search Companion content file updates' is set to 'Enabled' (Scored) + - id: 16648 + title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'" + description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches. The recommended state for this setting is: Enabled." + rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for. This risk is very low because even if this setting is enabled users still must submit search queries to the desired search engine in order to perform searches." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Search Companion content file updates. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.8"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36884-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' + + # 18.8.22.1.9 (L2) Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled' (Scored) + - id: 16649 + title: 'Ensure ''Turn off the "Order Prints" picture task'' is set to ''Enabled''' + description: 'This policy setting specifies whether the "Order Prints Online" task is available from Picture Tasks in Windows folders. The Order Prints Online Wizard is used to download a list of providers and allow users to order prints online. The recommended state for this setting is: Enabled.' + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Order Prints\" picture task. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.9"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38275-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> 1' + + # 18.8.22.1.10 (L2) Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled' (Scored) + - id: 16650 + title: 'Ensure ''Turn off the "Publish to Web" task for files and folders'' is set to ''Enabled''' + description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders. The Web Publishing wizard is used to download a list of providers and allow users to publish content to the Web. The recommended state for this setting is: Enabled." + rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Publish to Web\" task for files and folders Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.10"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37090-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' + + # 18.8.22.1.11 (L2) Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled' (Scored) + - id: 16651 + title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'" + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the Windows Messenger Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.11"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36628-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' + + # 18.8.22.1.12 (L2) Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled' (Scored) + - id: 16652 + title: "Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'" + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Customer Experience Improvement Program. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.12"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36174-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> 0' + + # 18.8.22.1.13 (L2) Ensure 'Turn off Windows Error Reporting' is set to 'Enabled' (Scored) + - id: 16653 + title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'" + description: "This policy setting controls whether or not errors are reported to Microsoft. Error Reporting is used to report information about a system or application that has failed or has stopped responding and is used to improve the quality of the product. The recommended state for this setting is: Enabled." + rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Error Reporting. Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.8.22.1.13"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-35964-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' + + ###################################### + # 18.8.25 Kerberos + ###################################### + # 18.8.25.1 (L2) Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic' (Scored) + - id: 16654 + title: "Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic'" + description: "This policy setting allows you to set support for Kerberos to attempt authentication using the certificate for the device to the domain. Support for device authentication using certificate will require connectivity to a DC in the device account domain which supports certificate authentication for computer accounts. The recommended state for this setting is: Enabled: Automatic ." + rationale: "Having stronger device authentication with the use of certificates is strongly encouraged over standard username and password authentication. Having this set to Automatic will allow certificate based authentication to be used whenever possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Automatic : Computer Configuration\\Policies\\Administrative Templates\\System\\Kerberos\\Support device authentication using certificate Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Kerberos.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.25.1"] + - cis_csc: ["1.6"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitBehavior -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitEnabled -> 1' + + # 18.8.26.1 (L1) Ensure 'Enumeration policy for external devices incompatible with Kernel DMA Protection' is set to 'Enabled: Block All' (Scored) + - id: 16655 + title: "Ensure 'Enumeration policy for external devices incompatible with Kernel DMA Protection' is set to 'Enabled: Block All'" + description: "This policy is intended to provide additional security against external DMA-capable devices. It allows for more control over the enumeration of external DMA-capable devices that are not compatible with DMA Remapping/device memory isolation and sandboxing. The recommended state for this setting is: Enabled: Block All . Note: This policy does not apply to 1394, PCMCIA or ExpressCard devices. The protection also only applies to Windows 10 R1803 or higher, and also requires a UEFI BIOS to function." + rationale: "Device memory sandboxing allows the OS to leverage the I/O Memory Management Unit (IOMMU) of a device to block unpermitted I/O, or memory access, by the peripheral." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block All : Computer Configuration\\Policies\\Administrative Templates\\System\\Kernel DMA Protection\\Enumeration policy for external devices incompatible with Kernel DMA Protection Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DmaGuard.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.26.1"] + - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36920-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Kernel DMA Protection -> DeviceEnumerationPolicy -> 0' + + ####################################### + # 18.8.27 Locale Services + ####################################### + # 18.8.27.1 (L2) Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled' (Scored) + - id: 16656 + title: "Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'" + description: "This policy prevents automatic copying of user input methods to the system account for use on the sign-in screen. The user is restricted to the set of input methods that are enabled in the system account. The recommended state for this setting is: Enabled." + rationale: "This is a way to increase the security of the system account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Locale Services\\Disallow copying of user input methods to the system account for sign-in. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.26.1"] + - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36343-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> 1' + + ################################################ + # 18.8.28 Logon + ################################################ + # 18.8.28.1 (L1) Ensure 'Block user from showing account details on sign-in' is set to 'Enabled' (Scored) + - id: 16657 + title: "Ensure 'Block user from showing account details on sign-in' is set to 'Enabled'" + description: "This policy prevents the user from showing account details (email address or user name) on the sign-in screen. The recommended state for this setting is: Enabled ." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Block user from showing account details on sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.1"] + - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockUserFromShowingAccountDetailsOnSignin -> 1' + + # 18.8.28.2 (L1) Ensure 'Do not display network selection UI' is set to 'Enabled' (Scored) + - id: 16658 + title: "Ensure 'Do not display network selection UI' is set to 'Enabled'" + description: "This policy setting allows you to control whether anyone can interact with available networks UI on the logon screen. The recommended state for this setting is: Enabled." + rationale: "An unauthorized user could disconnect the PC from the network or can connect the PC to other available networks without signing into Windows." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not display network selection UI Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.2"] + - cis_csc: ["5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38353-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI -> 1' + + # 18.8.28.3 (L1) Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled' (Scored) + - id: 16659 + title: "Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'" + description: "This policy setting prevents connected users from being enumerated on domain-joined computers. The recommended state for this setting is: Enabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not enumerate connected users on domain-joined computers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.3"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.5"] + references: + - "CCE-37838-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers -> 1' + + # 18.8.28.4 (L1) Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled' (MS only) (Scored) + - id: 16660 + title: "Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled'" + description: "This policy setting allows local users to be enumerated on domain-joined computers. The recommended state for this setting is: Disabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Enumerate local users on domain-joined computers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.4"] + - cis_csc: ["16.9"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-35894-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers -> 0' + + # 18.8.28.5 (L1) Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled' (Scored) + - id: 16661 + title: "Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled'" + description: "This policy setting allows you to prevent app notifications from appearing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "App notifications might display sensitive business or personal data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off app notifications on the lock screen Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.5"] + - cis_csc: ["16.5"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-35893-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications -> 1' + + # 18.8.28.6 (L1) Ensure 'Turn off picture password sign-in' is set to 'Enabled' (Scored) + - id: 16662 + title: "Ensure 'Turn off picture password sign-in' is set to 'Enabled'" + description: "This policy setting allows you to control whether a domain user can sign in using a picture password. The recommended state for this setting is: Enabled . Note: If the picture password feature is permitted, the user's domain password is cached in the system vault when using it." + rationale: "Picture passwords bypass the requirement for a typed complex password. In a shared work environment, a simple shoulder surf where someone observed the on-screen gestures would allow that person to gain access to the system without the need to know the complex password. Vertical monitor screens with an image are much more visible at a distance than horizontal key strokes, increasing the likelihood of a successful observation of the mouse gestures." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off picture password sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.28.6"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword -> 1' + + # 18.8.28.7 (L1) Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled' (Scored) + - id: 16663 + title: "Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'" + description: "This policy setting allows you to control whether a domain user can sign in using a convenience PIN. In Windows 10, convenience PIN was replaced with Passport, which has stronger security properties. To configure Passport for domain users, use the policies under Computer Configuration\\Administrative Templates\\Windows Components\\Microsoft Passport for Work. Note: The user's domain password will be cached in the system vault when using this feature. The recommended state for this setting is: Disabled." + rationale: "A PIN is created from a much smaller selection of characters than a password, so in most cases a PIN will be much less robust than a password." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn on convenience PIN sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn on PIN sign-in, but it was renamed starting with the Windows 10 Release 1511 Administrative Templates." + compliance: + - cis: ["18.8.28.7"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "CCE-37528-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon -> 0' + + ####################################### + # 18.8.31 OS Policies + ####################################### + # 18.8.31.1 (L2) Ensure 'Allow Clipboard synchronization across devices' is set to 'Disabled' (Scored) + - id: 16664 + title: "Ensure 'Allow Clipboard synchronization across devices' is set to 'Disabled'" + description: "This policy setting determines whether Clipboard contents can be synchronized across devices. The recommended state for this setting is: Disabled ." + rationale: "Due to privacy concerns, clipboard data should stay local to the system and not synced across devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\OS Policies\\Allow Clipboard synchronization across devices" + compliance: + - cis: ["18.8.31.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowCrossDeviceClipboard -> 0' + + # 18.8.31.2 (L2) Ensure 'Allow upload of User Activities' is set to 'Disabled' (Scored) + - id: 16665 + title: "Ensure 'Allow upload of User Activities' is set to 'Disabled'" + description: "This policy setting determines whether published User Activities can be uploaded to the cloud. The recommended state for this setting is: Disabled ." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "TTo establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\System\\OS Policies\\Allow upload of User Activities" + compliance: + - cis: ["18.8.31.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> UploadUserActivities -> 0' + + ####################################### + # 18.8.34 Power Management + ####################################### + ####################################### + # 18.8.34.6 Sleep Settings + ####################################### + # 18.8.34.6.1 (L2) Ensure 'Allow network connectivity during connected-standby (on battery)' is set to 'Disabled' (Scored) + - id: 16666 + title: "Ensure 'Allow network connectivity during connected-standby (on battery)' is set to 'Disabled'" + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled ." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, on battery and in a sleep state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (on battery) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.34.6.1"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> DCSettingIndex -> 0' + + # 18.8.34.6.2 (L2) Ensure 'Allow network connectivity during connected-standby (plugged in)' is set to 'Disabled' (Scored) + - id: 16667 + title: "Ensure 'Allow network connectivity during connected-standby (plugged in)' is set to 'Disabled'" + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled ." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, plugged in and in a sleep state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (plugged in) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.34.6.2"] + - cis_csc: ["9"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> ACSettingIndex -> 0' + + # 18.8.34.6.3 (L1) Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled' (Scored) + - id: 16668 + title: "Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'" + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (on battery) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.33.6.3"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "CCE-36881-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex -> 1' + + # 18.8.34.6.4 (L1) Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled' (Scored) + - id: 16669 + title: "Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'" + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (plugged in) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.33.6.4"] + - cis_csc: ["16.5"] + - pci_dss: ["8.2"] + - tsc: ["CC6.1"] + references: + - "CCE-37066-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex -> 1' + + # 18.8.36.1 (L1) Ensure 'Configure Offer Remote Assistance' is set to 'Disabled' (Scored) + - id: 16670 + title: "Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'" + description: "This policy setting allows you to turn on or turn off Offer (Unsolicited) Remote Assistance on this computer. Help desk and support personnel will not be able to proactively offer assistance, although they can still respond to user assistance requests. The recommended state for this setting is: Disabled." + rationale: "A user might be tricked and accept an unsolicited Remote Assistance offer from a malicious user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Offer Remote Assistance Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.35.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36388-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited -> 0' + + # # 18.8.36.2 (L1) Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled' (Scored) + - id: 16671 + title: "Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'" + description: "This policy setting allows you to turn on or turn off Solicited (Ask for) Remote Assistance on this computer. The recommended state for this setting is: Disabled." + rationale: "There is slight risk that a rogue administrator will gain access to another user's desktop session, however, they cannot connect to a user's computer unannounced or control it without permission from the user. When an expert tries to connect, the user can still choose to deny the connection or give the expert view-only privileges. The user must explicitly click the Yes button to allow the expert to remotely control the workstation." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Solicited Remote Assistance Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.36.2"] + - cis_csc: ["5.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37281-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp -> 0' + + # 18.8.37.1 (L1) Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled' (MS only) (Scored) + - id: 16672 + title: "Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled'" + description: "This policy setting controls whether RPC clients authenticate with the Endpoint Mapper Service when the call they are making contains authentication information. The Endpoint Mapper Service on computers running Windows NT4 (all service packs) cannot process authentication information supplied in this manner. This policy setting can cause a specific issue with 1-way forest trusts if it is applied to the trusting domain DCs (see Microsoft KB3073942), so we do not recommend applying it to Domain Controllers. Note: This policy will not be in effect until the system is rebooted. The recommended state for this setting is: Enabled." + rationale: "Anonymous access to RPC services could result in accidental disclosure of information to unauthenticated users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Enable RPC Endpoint Mapper Client Authentication Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RPC.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.8.37.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - https://support.microsoft.com/en-us/help/3073942/rpc-endpoint-mapper-client-authentication-prevents-users-and-groups-fr + - "CCE-37346-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution -> 1' + + # 18.8.37.2 (L2) Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated' (MS only) (Scored) + - id: 16673 + title: "Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated'" + description: "This policy setting controls how the RPC server runtime handles unauthenticated RPC clients connecting to RPC servers." + rationale: "Unauthenticated RPC communication can create a security vulnerability." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Authenticated: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Restrict Unauthenticated RPC clients." + compliance: + - cis: ["18.8.37.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-36559-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients -> 1' + + # Section 18.8.45.5 - Microsoft Support Diagnostic Tool + # 18.8.45.5.1 (L2) Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled' (Scored) + - id: 16674 + title: "Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'" + description: "This policy setting configures Microsoft Support Diagnostic Tool (MSDT) interactive communication with the support provider." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Microsoft Support Diagnostic Tool\\Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider." + compliance: + - cis: ["18.8.45.5.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38161-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> 0' + + # Section 18.8.45.11 - Windows Performance PerfTrack + # 18.8.45.11.1 (L2) Ensure 'Enable/Disable PerfTrack' is set to 'Disabled' (Scored) + - id: 16675 + title: "Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'" + description: "This policy setting specifies whether to enable or disable tracking of responsiveness events." + rationale: "When enabled the aggregated data of a given event will be transmitted to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Windows Performance PerfTrack\\Enable/Disable PerfTrack." + compliance: + - cis: ["18.8.45.11.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36648-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> 0' + + # Section 18.8.47 User Profiles + # 18.8.47.1 (L2) Ensure 'Turn off the advertising ID' is set to 'Enabled' (Scored) + - id: 16676 + title: "Ensure 'Turn off the advertising ID' is set to 'Enabled'" + description: "This policy setting turns off the advertising ID, preventing apps from using the ID for experiences across apps." + rationale: "Tracking user activity for advertising purposes, even anonymously, may be a privacy concern." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\User Profiles\\Turn off the advertising ID." + compliance: + - cis: ["18.8.47.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36931-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> 1' + + # Section 18.8.50.1 - Time Providers + # 18.8.50.1.1 (L2) Ensure 'Enable Windows NTP Client' is set to 'Enabled' (Scored) + - id: 16677 + title: "Ensure 'Enable Windows NTP Client' is set to 'Enabled'" + description: "This policy setting specifies whether the Windows NTP Client is enabled." + rationale: "A reliable and accurate account of time is important for a number of services and security requirements, including but not limited to distributed applications, authentication services, multi-user databases and logging services." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Client." + compliance: + - cis: ["18.8.50.1.1"] + - cis_csc: ["6.1"] + - pci_dss: ["10.4"] + - nist_800_53: ["AU.8"] + - tsc: ["CC7.2"] + references: + - "CCE-37843-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> 1' + + # 18.8.50.1.2 (L2) Ensure 'Enable Windows NTP Server' is set to 'Disabled' (MS only) (Scored) + - id: 16678 + title: "Ensure 'Enable Windows NTP Server' is set to 'Disabled'" + description: "This policy setting allows you to specify whether the Windows NTP Server is enabled." + rationale: "The configuration of proper time synchronization is critically important in an enterprise managed environment both due to the sensitivity of Kerberos authentication timestamps and also to ensure accurate security logging." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Server." + compliance: + - cis: ["18.8.50.1.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - nist_800_53: ["AU.8"] + - tsc: ["CC6.3"] + references: + - "CCE-37319-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled -> 0' + + ################################################ + # 18.9 Windows Components + ################################################ + + # 18.9.4.1 (L2) Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled' (Scored) + - id: 16679 + title: "Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled'" + description: "Manages a Windows app's ability to share data between users who have installed the app. Data is shared through the SharedLocal folder. This folder is available through the Windows.Storage API. The recommended state for this setting is: Disabled ." + rationale: "Users of a system could accidentally share sensitive data with other users on the same system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Package Deployment\\Allow a Windows app to share application data between users Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppxPackageManager.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.4.1"] + - cis_csc: ["14.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager -> AllowSharedLocalAppData -> 0' + + # 18.9.6.1 (L1) Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled' (Scored) + - id: 16680 + title: "Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'" + description: "This policy setting lets you control whether Microsoft accounts are optional for Windows Store apps that require an account to sign in. This policy only affects Windows Store apps that support it. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting allows an organization to use their enterprise user accounts instead of using their Microsoft accounts when accessing Windows store apps. This provides the organization with greater control over relevant credentials. Microsoft accounts cannot be centrally managed and as such enterprise credential security policies cannot be applied to them, which could put any information accessed by using Microsoft accounts at risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App runtime\\Allow Microsoft accounts to be optional Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppXRuntime.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.6.1"] + - cis_csc: ["16.9"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + references: + - "CCE-38354-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional -> 1' + + # 18.9.8.1 (L1) Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled' (Scored) + - id: 16681 + title: "Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'" + description: "This policy setting disallows AutoPlay for MTP devices like cameras or phones. The recommended state for this setting is: Enabled." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Disallow Autoplay for non-volume devices Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.8.1"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - tsc: ["CC5.2"] + references: + - "CCE-37636-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume -> 1' + + # 18.9.8.2 (L1) Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands' (Scored) + - id: 16682 + title: "Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'" + description: "This policy setting sets the default behavior for Autorun commands. Autorun commands are generally stored in autorun.inf files. They often launch the installation program or other routines. The recommended state for this setting is: Enabled: Do not execute any autorun commands." + rationale: "Prior to Windows Vista, when media containing an autorun command is inserted, the system will automatically execute the program without user intervention. This creates a major security concern as code may be executed without user's knowledge. The default behavior starting with Windows Vista is to prompt the user whether autorun command is to be run. The autorun command is represented as a handler in the Autoplay dialog." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Do not execute any autorun commands: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Set the default behavior for AutoRun Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.8.2"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-38217-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun -> 1' + + # 18.9.8.3 (L1) Ensure 'Turn off Autoplay' is set to 'Enabled: All drives' (Scored) + - id: 16683 + title: "Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'" + description: "Autoplay starts to read from a drive as soon as you insert media in the drive, which causes the setup file for programs or audio media to start immediately. An attacker could use this feature to launch a program to damage the computer or data on the computer. Autoplay is disabled by default on some removable drive types, such as floppy disk and network drives, but not on CD-ROM drives. Note: You cannot use this policy setting to enable Autoplay on computer drives in which it is disabled by default, such as floppy disk and network drives. The recommended state for this setting is: Enabled: All drives." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: All drives: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Turn off Autoplay Note: This Group Policy path is provided by the Group Policy template AutoPlay.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.8.3"] + - cis_csc: ["8.3"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36875-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun -> 255' + + # 18.9.10.1.1 (L1) Ensure 'Configure enhanced anti-spoofing' is set to 'Enabled' (Scored) + - id: 16684 + title: "Ensure 'Configure enhanced anti-spoofing' is set to 'Enabled'" + description: "This policy setting determines whether enhanced anti-spoofing is configured for devices which support it. The recommended state for this setting is: Enabled ." + rationale: "Enterprise managed environments are now supporting a wider range of mobile devices, increasing the security on these devices will help protect against unauthorized access on your network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Biometrics\\Facial Features\\Configure enhanced anti-spoofing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Biometrics.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Windows 10 Release 1511 and Windows 10 Release 1607 & Server 2016 Administrative Templates, this setting was named Use enhanced anti-spoofing when available. It was renamed to Configure enhanced anti-spoofing starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.10.1.1"] + - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures -> EnhancedAntiSpoofing -> 1' + + # 18.9.12.1 (L2) Ensure 'Allow Use of Camera' is set to 'Disabled' (Scored) + - id: 16685 + title: "Ensure 'Allow Use of Camera' is set to 'Disabled'" + description: "This policy setting controls whether the use of Camera devices on the machine are permitted. The recommended state for this setting is: Disabled ." + rationale: "Cameras in a high security environment can pose serious privacy and data exfiltration risks - they should be disabled to help mitigate that risk." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Camera\\Allow Use of Camera Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Camera.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.12.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera -> AllowCamera -> 0' + + # 18.9.13.1 (L1) Ensure 'Turn off Microsoft consumer experiences' is set to 'Enabled' (Scored) + - id: 16686 + title: "Ensure 'Turn off Microsoft consumer experiences' is set to 'Enabled'" + description: "This policy setting turns off experiences that help consumers make the most of their devices and Microsoft account. The recommended state for this setting is: Enabled . Note: Per Microsoft TechNet, this policy setting only applies to Windows 10 Enterprise and Windows 10 Education editions." + rationale: "Having apps silently install in an enterprise managed environment is not good security practice - especially if the apps send data back to a 3rd party." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off Microsoft consumer experiences Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.13.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "https://technet.microsoft.com/en-us/itpro/windows/manage/group-policies-for-enterprise-and-education-editions" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableWindowsConsumerFeatures -> 1' + + # 18.9.14.1 (L1) Ensure 'Require pin for pairing' is set to 'Enabled: First Time' OR 'Enabled: Always' (Scored) + - id: 16687 + title: "Ensure 'Require pin for pairing' is set to 'Enabled: First Time' OR 'Enabled: Always'" + description: "This policy setting controls whether or not a PIN is required for pairing to a wireless display device. The recommended state for this setting is: 'Enabled: First Time' OR 'Enabled: Always'." + rationale: "If this setting is not configured or disabled then a PIN would not be required when pairing wireless display devices to the system, increasing the risk of unauthorized use." + remediation: "To establish the recommended configuration via GP, set the following UI path to 'Enabled: First Time' OR 'Enabled: Always' : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Connect\\Require pin for pairing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WirelessDisplay.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.14.1"] + - cis_csc: ["15.8"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing -> 2' + + # 18.9.15.1 (L1) Ensure 'Do not display the password reveal button' is set to 'Enabled' (Scored) + - id: 16688 + title: "Ensure 'Do not display the password reveal button' is set to 'Enabled'" + description: "This policy setting allows you to configure the display of the password reveal button in password entry user experiences. The recommended state for this setting is: Enabled." + rationale: "This is a useful feature when entering a long and complex password, especially when using a touchscreen. The potential risk is that someone else may see your password while surreptitiously observing your screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Do not display the password reveal button Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredUI.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.15.1"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-37534-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal -> 1' + + # 18.9.15.2 (L1) Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled' (Scored) + - id: 16689 + title: "Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'" + description: "This policy setting controls whether administrator accounts are displayed when a user attempts to elevate a running application. The recommended state for this setting is: Disabled." + rationale: "Users could see the list of administrator accounts, making it slightly easier for a malicious user who has logged onto a console session to try to crack the passwords of those accounts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Enumerate administrator accounts on elevation Note: This Group Policy path is provided by the Group Policy template CredUI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.15.2"] + - cis_csc: ["16"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-36512-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators -> 0' + + # 18.9.16.1 (L1) Ensure 'Allow Telemetry' is set to 'Enabled: 0 - Security [Enterprise Only]' or 'Enabled: 1 - Basic' (Scored) + - id: 16690 + title: "Ensure 'Allow Telemetry' is set to 'Enabled: 0 - Security [Enterprise Only]' or 'Enabled: 1 - Basic'" + description: "This policy setting determines the amount of diagnostic and usage data reported to Microsoft:A value of 0 - Security [Enterprise Only] will send minimal data to Microsoft. This data includes Malicious Software Removal Tool (MSRT) & Windows Defender data, if enabled, and telemetry client settings. Setting a value of 0 applies to enterprise, EDU, IoT and server devices only. Setting a value of 0 for other devices is equivalent to choosing a value of 1. A value of 1 - Basic sends only a basic amount of diagnostic and usage data. Note that setting values of 0 or 1 will degrade certain experiences on the device. A value of 2 - Enhanced sends enhanced diagnostic and usage data. A value of 3 - Full sends the same data as a value of 2, plus additional diagnostics data, including the files and content that may have caused the problem. Windows 10 telemetry settings apply to the Windows operating system and some first party apps. This setting does not apply to third party apps running on Windows 10. The recommended state for this setting is: Enabled: 0 - Security [Enterprise Only] or Enabled: 1 - Basic . Note: If the Allow Telemetry setting is configured to 0 - Security [Enterprise Only] , then the options in Windows Update to defer upgrades and updates will have no effect. Note #2: In the Microsoft Windows 10 RTM (Release 1507) Administrative Templates, the zero value was named 0 - Off [Enterprise Only] , but it was renamed to 0 - Security [Enterprise Only] starting with the Windows 10 Release 1511 Administrative Templates." + rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 0 - Security [Enterprise Only] or Enabled: 1 - Basic : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Allow Telemetry Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry -> 1' + + # 18.9.16.2 (L2) Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage' (Scored) + - id: 16691 + title: "Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage'" + description: "This policy setting controls whether the Connected User Experience and Telemetry service can automatically use an authenticated proxy to send data back to Microsoft. The recommended state for this setting is: Enabled: Disable Authenticated Proxy usage ." + rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Authenticated Proxy usage : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableEnterpriseAuthProxy -> 1' + + # 18.9.16.3 (L1) Ensure 'Do not show feedback notifications' is set to 'Enabled' (Scored) + - id: 16692 + title: "Ensure 'Do not show feedback notifications' is set to 'Enabled'" + description: "This policy setting allows an organization to prevent its devices from showing feedback questions from Microsoft. The recommended state for this setting is: Enabled ." + rationale: "Users should not be sending any feedback to 3rd party vendors in an enterprise managed environment." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Do not show feedback notifications Note: This Group Policy path may not exist by default. It is provided by the Group Policy template FeedbackNotifications.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.3"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DoNotShowFeedbackNotifications -> 1' + + # 18.9.16.4 (L1) Ensure 'Toggle user control over Insider builds' is set to 'Disabled' (Scored) + - id: 16693 + title: "Ensure 'Toggle user control over Insider builds' is set to 'Disabled'" + description: 'This policy setting determines whether users can access the Insider build controls in the Advanced Options for Windows Update. These controls are located under "Get Insider builds," and enable users to make their devices available for downloading and installing Windows preview software. The recommended state for this setting is: Disabled . Note: This policy setting applies only to devices running Windows Server 2016, up until Release 1703. For Release 1709 or newer, Microsoft encourages using the Manage preview builds setting (Rule 18.9.102.1.1). We have kept this setting in the benchmark to ensure that any older builds of Windows Server 2016 in the environment are still enforced.' + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Toggle user control over Insider builds Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AllowBuildPreview.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.16.4"] + - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> AllowBuildPreview -> 0' + + # 18.9.26.1.1 (L1) Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' (Scored) + - id: 16694 + title: "Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.1.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37775-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention -> 0' + + # 18.9.26.1.2 (L1) Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' (Scored) + - id: 16695 + title: "Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.1.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37948-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> n:^(\d+) compare >= 32768' + + # 18.9.26.2.1 (L1) Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' (Scored) + - id: 16696 + title: "Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.2.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37145-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention -> 0' + + # 18.9.26.2.2 (L1) Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater' (Scored) + - id: 16697 + title: "Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'" + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 196,608 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 196,608 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.2.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37695-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> n:^(\d+) compare >= 196608' + + # 18.9.26.3.1 (L1) Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' (Scored) + - id: 16698 + title: "Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.3.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-38276-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention -> 0' + + # 18.9.26.3.2 (L1) Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' (Scored) + - id: 16699 + title: "Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.3.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-37526-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> n:^(\d+) compare >= 32768' + + # 18.9.26.4.1 (L1) Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled' (Scored) + - id: 16700 + title: "Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'" + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.4.1"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-36160-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention -> 0' + + # 18.9.26.4.2 (L1) Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater' (Scored) + - id: 16701 + title: "Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'" + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.26.4.2"] + - cis_csc: ["6.3"] + - pci_dss: ["10.6.1"] + - nist_800_53: ["AU.6"] + - gpg13: ["4.12"] + - gdpr_IV: [35.7.d] + - hipaa: ["164.312.b"] + - tsc: ["CC6.1", "CC6.8", "CC7.2", "CC7.3"] + references: + - "CCE-36092-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> n:^(\d+) compare >= 32768' + + # 18.9.30.2 (L1) Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled' (Scored) + - id: 16702 + title: "Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'" + description: "Disabling Data Execution Prevention can allow certain legacy plug-in applications to function without terminating Explorer. The recommended state for this setting is: Disabled." + rationale: "Data Execution Prevention is an important security feature supported by Explorer that helps to limit the impact of certain types of malware." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off Data Execution Prevention for Explorer Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Explorer.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.30.2"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-37809-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention -> 0' + + # 18.9.30.3 (L1) Ensure 'Turn off heap termination on corruption' is set to 'Disabled' (Scored) + - id: 16703 + title: "Ensure 'Turn off heap termination on corruption' is set to 'Disabled'" + description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." + rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off shell protocol protected mode Note: This Group Policy path is provided by the Group Policy template WindowsExplorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.30.3"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36660-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption -> 0' + + # 18.9.30.4 (L1) Ensure 'Turn off shell protocol protected mode' is set to 'Disabled' (Scored) + - id: 16704 + title: "Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'" + description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." + rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off shell protocol protected mode Note: This Group Policy path is provided by the Group Policy template WindowsExplorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.30.4"] + - cis_csc: ["8.4"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-36809-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior -> 0' + + # 18.9.39.2 Ensure 'Turn off location' is set to 'Enabled' + - id: 16705 + title: "Ensure 'Turn off location' is set to 'Enabled'" + description: "This policy setting turns off the location feature for the computer. The recommended state for this setting is: Enabled." + rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Turn off location. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sensors.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.39.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36886-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> 1' + + # 18.9.43.1 (L2) Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled' (Scored) + - id: 16706 + title: "Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled'" + description: "This policy setting allows backup and restore of cellular text messages to Microsoft's cloud services. The recommended state for this setting is: Disabled ." + rationale: "In a high security environment, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Messaging\\Allow Message Service Cloud Sync Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Messaging.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.43.1"] + - cis_csc: ["9.1", "13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging -> AllowMessageSync -> 0' + + # 18.9.44.1 (L1) Ensure 'Block all consumer Microsoft account user authentication' is set to 'Enabled' (Scored) + - id: 16707 + title: "Ensure 'Block all consumer Microsoft account user authentication' is set to 'Enabled'" + description: "This setting determines whether applications and services on the device can utilize new consumer Microsoft account authentication via the Windows OnlineID and WebAccountManager APIs. The recommended state for this setting is: Enabled ." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used on their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft accounts\\Block all consumer Microsoft account user authentication Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSAPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.44.1"] + - cis_csc: ["16"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount -> DisableUserAuth -> 1' + + # 18.9.52.1 (L1) Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled' (Scored) + - id: 16708 + title: "Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'" + description: "This policy setting lets you prevent apps and features from working with files on OneDrive using the Next Generation Sync Client. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting prevents users from accidentally uploading confidential or sensitive corporate information to the OneDrive cloud service using the Next Generation Sync Client." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\OneDrive\\Prevent the usage of OneDrive for file storage Note: This Group Policy path may not exist by default. It is provided by the Group Policy template SkyDrive.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer). However, we strongly recommend you only use the version included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Older versions of the templates had conflicting settings in different template files for both OneDrive & SkyDrive, until it was cleaned up properly in the above version. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Prevent the usage of SkyDrive for file storage, but it was renamed starting with the Windows 10 RTM (Release 1507) Administrative Templates." + compliance: + - cis: ["18.9.52.1"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36939-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC -> 1' + + # 18.9.59.2.2 (L1) Ensure 'Do not allow passwords to be saved' is set to 'Enabled' (Scored) + - id: 16709 + title: "Ensure 'Do not allow passwords to be saved' is set to 'Enabled'" + description: "This policy setting helps prevent Remote Desktop clients from saving passwords on a computer. The recommended state for this setting is: Enabled. Note: If this policy setting was previously configured as Disabled or Not configured, any previously saved passwords will be deleted the first time a Remote Desktop client disconnects from any server." + rationale: "An attacker with physical access to the computer may be able to break the protection guarding saved passwords. An attacker who compromises a user's account and connects to their computer could use saved passwords to gain access to additional hosts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Connection Client\\Do not allow passwords to be saved Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.2.2"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + references: + - "CCE-36223-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving -> 1' + + # 18.9.59.3.2.1 Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled' + - id: 16710 + title: "Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'" + description: "This policy setting allows you to restrict users to a single Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "This setting ensures that users & administrators who Remote Desktop to a server will continue to use the same session - if they disconnect and reconnect, they will go back to the same session they were using before, preventing the creation of a second simultaneous session. This both prevents unnecessary resource usage by having the server host unnecessary additional sessions (which would put extra load on the server) and also ensures a consistency of experience for the user." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Connections\\Restrict Remote Desktop Services users to a single Remote Desktop Services session. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Restrict Terminal Services users to a single remote session, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.59.3.2.1"] + - pci_dss: ["7.2"] + - tsc: ["CC6.4"] + references: + - "CCE-37708-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fSingleSessionPerUser -> 1' + + # 18.9.59.3.3.1 Ensure 'Do not allow COM port redirection' is set to 'Enabled' + - id: 16711 + title: "Ensure 'Do not allow COM port redirection' is set to 'Enabled'" + description: "This policy setting specifies whether to prevent the redirection of data to client COM ports from the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for COM port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow COM port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.3.1"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37696-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> 1' + + # 18.9.59.3.3.2 (L1) Ensure 'Do not allow drive redirection' is set to 'Enabled' (Scored) + - id: 16712 + title: "Ensure 'Do not allow drive redirection' is set to 'Enabled'" + description: "This policy setting prevents users from sharing the local drives on their client computers to Remote Desktop Servers that they access. Mapped drives appear in the session folder tree in Windows Explorer in the following format: \\\\TSClient\\$ If local drives are shared they are left vulnerable to intruders who want to exploit the data that is stored on them. The recommended state for this setting is: Enabled." + rationale: "Data could be forwarded from the user's Remote Desktop Services session to the user's local computer without any direct user interaction. Malicious software already present on a compromised server would have direct and stealthy disk access to the user's local computer during the Remote Desktop session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow drive redirection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.3.2"] + - cis_csc: ["13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36509-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm -> 1' + + # 18.9.59.3.3.3 Ensure 'Do not allow LPT port redirection' is set to 'Enabled' + - id: 16713 + title: "Ensure 'Do not allow LPT port redirection' is set to 'Enabled'" + description: "This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for LPT port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow LPT port redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.3.3"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37778-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> 1' + + # 18.9.59.3.3.4 Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled' + - id: 16714 + title: "Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'" + description: "This policy setting allows you to control the redirection of supported Plug and Play devices, such as Windows Portable Devices, to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for Plug and Play device redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow supported Plug and Play device redirection. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.3.4"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37477-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> 1' + + # 18.9.59.3.9.1 (L1) Ensure 'Always prompt for password upon connection' is set to 'Enabled' (Scored) + - id: 16715 + title: "Ensure 'Always prompt for password upon connection' is set to 'Enabled'" + description: "This policy setting specifies whether Remote Desktop Services always prompts the client computer for a password upon connection. You can use this policy setting to enforce a password prompt for users who log on to Remote Desktop Services, even if they already provided the password in the Remote Desktop Connection client. The recommended state for this setting is: Enabled." + rationale: "Users have the option to store both their username and password when they create a new Remote Desktop Connection shortcut. If the server that runs Remote Desktop Services allows users who have used this feature to log on to the server but not enter their password, then it is possible that an attacker who has gained physical access to the user's computer could connect to a Remote Desktop Server through the Remote Desktop Connection shortcut, even though they may not know the user's password." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Always prompt for password upon connection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In the Microsoft Windows Vista Administrative Templates, this setting was named Always prompt client for password upon connection, but it was renamed starting with the Windows Server 2008 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.59.3.9.1"] + - cis_csc: ["16.14"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-37929-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword -> 1' + + # 18.9.59.3.9.2 (L1) Ensure 'Require secure RPC communication' is set to 'Enabled' (Scored) + - id: 16716 + title: "Ensure 'Require secure RPC communication' is set to 'Enabled'" + description: "This policy setting allows you to specify whether Remote Desktop Services requires secure Remote Procedure Call (RPC) communication with all clients or allows unsecured communication. You can use this policy setting to strengthen the security of RPC communication with clients by allowing only authenticated and encrypted requests. The recommended state for this setting is: Enabled." + rationale: "Allowing unsecure RPC communication can exposes the server to man in the middle attacks and data disclosure attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require secure RPC communication Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.9.2"] + - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-37567-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic -> 1' + + # 18.9.59.3.9.3 (L1) Ensure 'Require use of specific security layer for remote (RDP) connections' is set to 'Enabled: SSL' (Scored) + - id: 16717 + title: "Ensure 'Require use of specific security layer for remote (RDP) connections' is set to 'Enabled: SSL'" + description: "This policy setting specifies whether to require the use of a specific security layer to secure communications between clients and RD Session Host servers during Remote Desktop Protocol (RDP) connections. The recommended state for this setting is: Enabled: SSL. Note: In spite of this setting being labeled SSL, it is actually enforcing Transport Layer Security (TLS) version 1.0, not the older (and less secure) SSL protocol." + rationale: "The native Remote Desktop Protocol (RDP) encryption is now considered a weak protocol, so enforcing the use of stronger Transport Layer Security (TLS) encryption for all RDP communications between clients and RD Session Host servers is preferred." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: High Level: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require use of specific security layer for remote (RDP) connections. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.9.5.3"] + - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-CCE-36598-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> SecurityLayer -> 2' + + # 18.9.59.3.9.4 (L1) Ensure 'Require user authentication for remote connections by using Network Level Authentication' is set to 'Enabled' (Scored) + - id: 16718 + title: "Ensure 'Require user authentication for remote connections by using Network Level Authentication' is set to 'Enabled'" + description: "This policy setting allows you to specify whether to require user authentication for remote connections to the RD Session Host server by using Network Level Authentication. The recommended state for this setting is: Enabled." + rationale: "Requiring that user authentication occur earlier in the remote connection process enhances security." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: High Level: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Set client connection encryption level Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.9.4"] + - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-36598-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> UserAuthentication -> 1' + + # 18.9.59.3.9.5 (L1) Ensure 'Set client connection encryption level' is set to 'Enabled: High Level' (Scored) + - id: 16719 + title: "Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'" + description: "This policy setting specifies whether to require the use of a specific encryption level to secure communications between client computers and RD Session Host servers during Remote Desktop Protocol (RDP) connections. This policy only applies when you are using native RDP encryption. However, native RDP encryption (as opposed to SSL encryption) is not recommended. This policy does not apply to SSL encryption. The recommended state for this setting is: Enabled: High Level." + rationale: "If Remote Desktop client connections that use low level encryption are allowed, it is more likely that an attacker will be able to decrypt any captured Remote Desktop Services network traffic." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: High Level: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Set client connection encryption level Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.9.5"] + - cis_csc: ["3.4"] + - pci_dss: ["8.2.1"] + - tsc: ["CC6.1"] + references: + - "CCE-36627-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel -> 3' + + # 18.9.59.3.10.1 Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less' + - id: 16720 + title: "Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less'" + description: "This policy setting allows you to specify the maximum amount of time that an active Remote Desktop Services session can be idle (without user input) before it is automatically disconnected. The recommended state for this setting is: Enabled: 15 minutes or less." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of inactive sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 15 minutes or less: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for active but idle Remote Desktop Services sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Set time limit for active but idle Terminal Services sessions, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.59.3.10.1"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1.8"] + - tsc: ["CC6.1"] + references: + - "CCE-37562-6" + - https://workbench.cisecurity.org/benchmarks/766 + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare <= 900000' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare != 0' + + # 18.9.59.3.10.2 Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute' + - id: 16721 + title: "Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'" + description: "This policy setting allows you to configure a time limit for disconnected Remote Desktop Services sessions. The recommended state for this setting is: Enabled: 1 minute." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of disconnected but still active sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. This setting is important to ensure a disconnected session is properly terminated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 minute: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for disconnected sessions. Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.10.2"] + - cis_csc: ["16.5"] + - pci_dss: ["8.1"] + - tsc: ["CC6.1"] + references: + - "CCE-37949-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> 60000' + + # 18.9.59.3.11.1 (L1) Ensure 'Do not delete temp folders upon exit' is set to 'Disabled' (Scored) + - id: 16722 + title: "Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'" + description: "This policy setting specifies whether Remote Desktop Services retains a user's per-session temporary folders at logoff. The recommended state for this setting is: Disabled." + rationale: "Sensitive information could be contained inside the temporary folders and visible to other administrators that log into the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not delete temp folders upon exit Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Do not delete temp folder upon exit, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.59.3.11.1"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-37946-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit -> 1' + + # 18.9.59.3.11.2 (L1) Ensure 'Do not use temporary folders per session' is set to 'Disabled' (Scored) + - id: 16723 + title: "Ensure 'Do not use temporary folders per session' is set to 'Disabled'" + description: "By default, Remote Desktop Services creates a separate temporary folder on the RD Session Host server for each active session that a user maintains on the RD Session Host server. The temporary folder is created on the RD Session Host server in a Temp folder under the user's profile folder and is named with the sessionid. This temporary folder is used to store individual temporary files. To reclaim disk space, the temporary folder is deleted when the user logs off from a session. The recommended state for this setting is: Disabled." + rationale: "Disabling this setting keeps the cached data independent for each session, both reducing the chance of problems from shared cached data between sessions, and keeping possibly sensitive data separate to each user session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not use temporary folders per session Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.59.3.11.2"] + - cis_csc: ["14.4"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-38180-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> PerSessionTempDir -> 1' + + # 18.9.60.1 Ensure 'Prevent downloading of enclosures' is set to 'Enabled' + - id: 16724 + title: "Ensure 'Prevent downloading of enclosures' is set to 'Enabled'" + description: "This policy setting prevents the user from having enclosures (file attachments) downloaded from an RSS feed to the user's computer. The recommended state for this setting is: Enabled." + rationale: "Allowing attachments to be downloaded through the RSS feed can introduce files that could have malicious intent." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\RSS Feeds\\Prevent downloading of enclosures Note: This Group Policy path is provided by the Group Policy template InetRes.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Turn off downloading of enclosures, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.60.1"] + - cis_csc: ["7.2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-37126-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload -> 1' + + # 18.9.61.2 (L2) Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search' (Scored) + - id: 16725 + title: "Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search'" + description: "This policy setting allows search and Cortana to search cloud sources like OneDrive and SharePoint. The recommended state for this setting is: Enabled: Disable Cloud Search ." + rationale: "Due to privacy concerns, data should never be sent to any 3rd party since this data could contain sensitive information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Cloud Search : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cloud Search Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.61.2"] + - cis_csc: ["9.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCloudSearch -> 0' + + # 18.9.61.3 Ensure 'Allow indexing of encrypted files' is set to 'Disabled' + - id: 16726 + title: "Ensure 'Allow indexing of encrypted files' is set to 'Disabled'" + description: "This policy setting controls whether encrypted items are allowed to be indexed. When this setting is changed, the index is rebuilt completely. Full volume encryption (such as BitLocker Drive Encryption or a non-Microsoft solution) must be used for the location of the index to maintain security for encrypted files. The recommended state for this setting is: Disabled." + rationale: "Indexing and allowing users to search encrypted files could potentially reveal confidential data stored within the encrypted files." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow indexing of encrypted files Note: This Group Policy path is provided by the Group Policy template Search.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.61.3"] + - cis_csc: ["13.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-38277-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems -> 0' + + # 18.9.66.1 Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled' + - id: 16727 + title: "Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'" + description: "The Key Management Service (KMS) is a Microsoft license activation method that entails setting up a local server to store the software licenses. The KMS server itself needs to connect to Microsoft to activate the KMS service, but subsequent on-network clients can activate Microsoft Windows OS and/or their Microsoft Office via the KMS server instead of connecting directly to Microsoft. This policy setting lets you opt-out of sending KMS client activation data to Microsoft automatically. The recommended state for this setting is: Enabled." + rationale: "Even though the KMS licensing method does not require KMS clients to connect to Microsoft, they still send KMS client activation state data to Microsoft automatically. Preventing this information from being sent can help reduce privacy concerns in high security environments." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Software Protection Platform\\Turn off KMS Client Online AVS Validation. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AVSValidationGP.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.66.1"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> 1' + + # 18.9.77.3.1 (L1) Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled' (Scored) + - id: 16728 + title: "Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled'" + description: 'This policy setting configures a local override for the configuration to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to "Windows Defender Antivirus Cloud Protection Service". This setting can only be set by Group Policy. The recommended state for this setting is: Disabled .' + rationale: "The decision on whether or not to participate in Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service for malicious software reporting should be made centrally in an enterprise managed environment, so that all computers within it behave consistently in that regard. Configuring this setting to Disabled ensures that the decision remains centrally managed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Configure local setting override for reporting to Microsoft MAPS Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.3.1"] + - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-36940-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting -> 0' + + # 18.9.77.3.2 Ensure 'Join Microsoft MAPS' is set to 'Disabled' + - id: 16729 + title: "Ensure 'Join Microsoft MAPS' is set to 'Disabled'" + description: "This policy setting allows you to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to 'Windows Defender Antivirus Cloud Protection Service'. Microsoft MAPS / Windows Defender Antivirus Cloud Protection Service is the online community that helps you choose how to respond to potential threats. The community also helps stop the spread of new malicious software infections. You can choose to send basic or additional information about detected software. Additional information helps Microsoft create new definitions and help it to protect your computer. Possible options are: - (0x0) Disabled (default) - (0x1) Basic membership - (0x2) Advanced membership Basic membership will send basic information to Microsoft about software that has been detected including where the software came from the actions that you apply or that are applied automatically and whether the actions were successful. Advanced membership in addition to basic information will send more information to Microsoft about malicious software spyware and potentially unwanted software including the location of the software file names how the software operates and how it has impacted your computer. The recommended state for this setting is: Disabled." + rationale: "The information that would be sent can include things like location of detected items on your computer if harmful software was removed. The information would be automatically collected and sent. In some instances personal information might unintentionally be sent to Microsoft. However, Microsoft states that it will not use this information to identify you or contact you. For privacy reasons in high security environments, it is best to prevent these data submissions altogether." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\MAPS\\Join Microsoft MAPS. Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.3.2"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting' + + # 18.9.77.7.1 (L1) Ensure 'Turn on behavior monitoring' is set to 'Enabled' (Scored) + - id: 16730 + title: "Ensure 'Turn on behavior monitoring' is set to 'Enabled'" + description: "This policy setting allows you to configure behavior monitoring for Windows Defender Antivirus. The recommended state for this setting is: Enabled ." + rationale: "When running an antivirus solution such as Windows Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Real-Time Protection\\Turn on behavior monitoring Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.7.1"] + - cis_csc: ["8.1"] + - pci_dss: ["5.2"] + references: + - "CCE-38389-3" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection -> DisableBehaviorMonitoring -> 0' + + # Section - 18.9.77.9 - Reporting + - id: 16731 + title: "Ensure 'Configure Watson events' is set to 'Disabled'" + description: "This policy setting allows you to configure whether or not Watson events are sent." + rationale: "Watson events are the reports that get sent to Microsoft when a program or service crashes or fails, including the possibility of automatic submission." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Reporting\\Configure Watson events." + compliance: + - cis: ["18.9.77.9.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-36950-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts -> 1' + + # 18.9.77.10.1 (L1) Ensure 'Scan removable drives' is set to 'Enabled' (Scored) + - id: 16732 + title: "Ensure 'Scan removable drives' is set to 'Enabled'" + description: "This policy setting allows you to manage whether or not to scan for malicious software and unwanted software in the contents of removable drives, such as USB flash drives, when running a full scan. The recommended state for this setting is: Enabled ." + rationale: "It is important to ensure that any present removable drives are always included in any type of scan, as removable drives are more likely to contain malicious software brought in to the enterprise managed environment from an external, unmanaged computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Scan\\Scan removable drives Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.10.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-38409-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning -> 0' + + # 18.9.77.10.2 (L1) Ensure 'Turn on e-mail scanning' is set to 'Enabled' (Scored) + - id: 16733 + title: "Ensure 'Turn on e-mail scanning' is set to 'Enabled'" + description: "This policy setting allows you to configure e-mail scanning. When e-mail scanning is enabled, the engine will parse the mailbox and mail files, according to their specific format, in order to analyze the mail bodies and attachments. Several e-mail formats are currently supported, for example: pst (Outlook), dbx, mbx, mime (Outlook Express), binhex (Mac). The recommended state for this setting is: Enabled ." + rationale: "Incoming e-mails should be scanned by an antivirus solution such as Windows Defender Antivirus, as email attachments are a commonly used attack vector to infiltrate computers with malicious software." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Scan\\Turn on e-mail scanning Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.10.2"] + - cis_csc: ["13"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + references: + - "CCE-36958-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning -> 0' + + # 18.9.77.13.3.1 (L1) Ensure 'Prevent users and apps from accessing dangerous websites' is set to 'Enabled: Block' (Scored) + - id: 16734 + title: "Ensure 'Prevent users and apps from accessing dangerous websites' is set to 'Enabled: Block'" + description: "This policy setting controls Windows Defender Exploit Guard network protection. The recommended state for this setting is: Enabled: Block ." + rationale: "This setting can help prevent employees from using any application to access dangerous domains that may host phishing scams, exploit-hosting sites, and other malicious content on the Internet." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Windows Defender Exploit Guard\\Network Protection\\Prevent users and apps from accessing dangerous websites Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.13.3.1"] + - cis_csc: ["7"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection -> EnableNetworkProtection -> 1' + + # 18.9.77.14 (L1) Ensure 'Configure detection for potentially unwanted applications' is set to 'Enabled: Block' (Scored) + - id: 16735 + title: "Ensure 'Configure detection for potentially unwanted applications' is set to 'Enabled: Block'" + description: "This policy setting controls detection and action for Potentially Unwanted Applications (PUA), which are sneaky unwanted application bundlers or their bundled applications, that can deliver adware or malware. The recommended state for this setting is: Enabled: Block . For more information, see this link: Block potentially unwanted applications with Windows Defender Antivirus | Microsoft Docs" + rationale: "Potentially unwanted applications can increase the risk of your network being infected with malware, cause malware infections to be harder to identify, and can waste IT resources in cleaning up the applications. They should be blocked from installation." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Configure detection for potentially unwanted applications Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.77.14"] + - cis_csc: ["8"] + - pci_dss: ["2.2.3"] + - nist_800_53: ["CM.1"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> PUAProtection -> 1' + + # 18.9.77.15 (L1) Ensure 'Turn off Windows Defender AntiVirus' is set to 'Disabled' (Scored) + - id: 16736 + title: "Ensure 'Turn off Windows Defender AntiVirus' is set to 'Disabled'" + description: "This policy setting turns off Windows Defender Antivirus. If the setting is configured to Disabled, Windows Defender Antivirus runs and computers are scanned for malware and other potentially unwanted software. The recommended state for this setting is: Disabled ." + rationale: "It is important to ensure a current, updated antivirus product is scanning each computer for malicious file activity. Microsoft provides a competent solution out of the box in Windows Defender Antivirus. Organizations that choose to purchase a reputable 3rd-party antivirus solution may choose to exempt themselves from this recommendation in lieu of the commercial alternative." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender Antivirus\\Turn off Windows Defender AntiVirus Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn off Windows Defender, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.77.15"] + - cis_csc: ["8.1"] + - pci_dss: ["5.2"] + - tsc: ["CC6.8"] + references: + - "CCE-36082-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> DisableAntiSpyware -> 0' + + # 18.9.80.1.1 Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass' + - id: 16737 + title: "Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass'" + description: "This policy setting allows you to manage the behavior of Windows SmartScreen. Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. Some information is sent to Microsoft about files and programs run on PCs with this feature enabled. The recommended state for this setting is: Enabled: Warn and prevent bypass." + rationale: "Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. However, due to the fact that some information is sent to Microsoft about files and programs run on PCs some organizations may prefer to disable it." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Warn and prevent bypass: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender SmartScreen\\Explorer\\Configure Windows Defender SmartScreen Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsExplorer.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Configure Windows SmartScreen, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.9.80.1.1"] + - cis_csc: ["2"] + - pci_dss: ["2.2.4"] + - nist_800_53: ["CM.1"] + - tsc: ["CC5.2"] + references: + - "CCE-35859-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> ShellSmartScreenLevel -> Block' + + # 18.9.84.1 (L2) Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled' (Scored) + - id: 16738 + title: "Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled'" + description: "This policy setting determines whether suggested apps in Windows Ink Workspace are allowed. The recommended state for this setting is: Disabled ." + rationale: "This Microsoft feature is designed to collect data and suggest apps based on that data collected. Disabling this setting will help ensure your data is not shared with any third party." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow suggested apps in Windows Ink Workspace Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.84.1"] + - cis_csc: ["13"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowSuggestedAppsInWindowsInkWorkspace -> 0' + + # 18.9.84.2 (L1) Ensure 'Allow Windows Ink Workspace' is set to 'Enabled: On, but disallow access above lock' OR 'Disabled' but not 'Enabled: On' (Scored) + - id: 16739 + title: "Ensure 'Allow Windows Ink Workspace' is set to 'Enabled: On, but disallow access above lock' OR 'Disabled' but not 'Enabled: On'" + description: "This policy setting determines whether Windows Ink items are allowed above the lock screen. The recommended state for this setting is: Enabled: On, but disallow access above lock OR Disabled ." + rationale: "Allowing any apps to be accessed while system is locked is not recommended. If this feature is permitted, it should only be accessible once a user authenticates with the proper credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: On, but disallow access above lock OR Disabled : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow Windows Ink Workspace Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.84.2"] + - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace -> 1' + + # 18.9.85.1 Ensure 'Allow user control over installs' is set to 'Disabled' + - id: 16740 + title: "Ensure 'Allow user control over installs' is set to 'Disabled'" + description: "This setting controls whether users are permitted to change installation options that typically are available only to system administrators. The security features of Windows Installer normally prevent users from changing installation options that are typically reserved for system administrators, such as specifying the directory to which files are installed. If Windows Installer detects that an installation package has permitted the user to change a protected option, it stops the installation and displays a message. These security features operate only when the installation program is running in a privileged security context in which it has access to directories denied to the user. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment, only IT staff with administrative rights should be installing or changing software on a system. Allowing users the ability to have any control over installs can risk unapproved software from being installed or removed from a system, which could cause the system to become vulnerable to compromise." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Allow user control over installs Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Enable user control over installs, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.85.1"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36400-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl -> 0' + + # 18.9.85.2 Ensure 'Always install with elevated privileges' is set to 'Disabled' + - id: 16741 + title: "Ensure 'Always install with elevated privileges' is set to 'Disabled'" + description: "This setting controls whether or not Windows Installer should use system permissions when it installs any program on the system. Note: This setting appears both in the Computer Configuration and User Configuration folders. To make this setting effective, you must enable the setting in both folders. Caution: If enabled, skilled users can take advantage of the permissions this setting grants to change their privileges and gain permanent access to restricted files and folders. Note that the User Configuration version of this setting is not guaranteed to be secure. The recommended state for this setting is: Disabled." + rationale: "Users with limited privileges can exploit this feature by creating a Windows Installer installation package that creates a new local account that belongs to the local built-in Administrators group, adds their current account to the local built-in Administrators group, installs malicious software, or performs other unauthorized activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Always install with elevated privileges Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.85.2"] + - cis_csc: ["5.1"] + - pci_dss: ["7.1"] + - tsc: ["CC6.4"] + references: + - "CCE-36919-9" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated -> 0' + + # 18.9.85.3 Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled' + - id: 16742 + title: "Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'" + description: "This policy setting controls whether Web-based programs are allowed to install software on the computer without notifying the user. The recommended state for this setting is: Disabled." + rationale: "Suppressing the system warning can pose a security risk and increase the attack surface on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Prevent Internet Explorer security prompt for Windows Installer scripts. Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable IE security prompt for Windows Installer scripts, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.85.3"] + - cis_csc: ["7"] + - pci_dss: ["2.2.5"] + - tsc: ["CC6.3"] + references: + - "CCE-37524-6" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> 0' + + # 18.9.86.1 Ensure 'Sign-in last interactive user automatically after a system-initiated restart' is set to 'Disabled' + - id: 16743 + title: "Ensure 'Sign-in last interactive user automatically after a system-initiated restart' is set to 'Disabled'" + description: "This policy setting controls whether a device will automatically sign-in the last interactive user after Windows Update restarts the system. The recommended state for this setting is: Disabled." + rationale: "Disabling this feature will prevent the caching of user's credentials and unauthorized use of the device, and also ensure the user is aware of the restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Logon Options\\Sign-in last interactive user automatically after a system-initiated restart Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinLogon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.86.1"] + - cis_csc: ["16.5"] + - pci_dss: ["8.6"] + - tsc: ["CC6.1"] + references: + - "CCE-36977-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn -> 1' + + # 18.9.95.1 Ensure 'Turn on PowerShell Script Block Logging' is set to 'Disabled' + - id: 16744 + title: "Ensure 'Turn on PowerShell Script Block Logging' is set to 'Disabled'" + description: "This policy setting enables logging of all PowerShell script input to the Microsoft-Windows- PowerShell/Operational event log. The recommended state for this setting is: Disabled. Note: In Microsoft's own hardening guidance, they recommend the opposite value, Enabled, because having this data logged improves investigations of PowerShell attack incidents. However, the default ACL on the PowerShell Operational log allows Interactive User (i.e. any logged on user) to read it, and therefore possibly expose passwords or other sensitive information to unauthorized users. If Microsoft locks down the default ACL on that log in the future (e.g. to restrict it only to Administrators), then we will revisit this recommendation in a future release." + rationale: "There are potential risks of capturing passwords in the PowerShell logs. This setting should only be needed for debugging purposes, and not in normal operation, it is important to ensure this is set to Disabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Script Block Logging Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.95.1"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging -> 0' + + # 18.9.95.2 Ensure 'Turn on PowerShell Transcription' is set to 'Disabled' + - id: 16745 + title: "Ensure 'Turn on PowerShell Transcription' is set to 'Disabled'" + description: "This Policy setting lets you capture the input and output of Windows PowerShell commands into text-based transcripts. The recommended state for this setting is: Disabled." + rationale: "If this setting is enabled there is a risk that passwords could get stored in plain text in the PowerShell_transcript output file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Transcription Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.95.2"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting -> 0' + + # 18.9.97.1.1 Ensure 'Allow Basic authentication' is set to 'Disabled' + - id: 16746 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client uses Basic authentication. The recommended state for this setting is: Disabled." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow Basic authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.1.1"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36310-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic -> 0' + + # 18.9.97.1.2 Ensure 'Allow unencrypted traffic' is set to 'Disabled' + - id: 16747 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow unencrypted traffic Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.1.2"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37726-7" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic -> 0' + + # 18.9.97.1.3 Ensure 'Disallow Digest authentication' is set to 'Enabled' + - id: 16748 + title: "Ensure 'Disallow Digest authentication' is set to 'Enabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client will not use Digest authentication. The recommended state for this setting is: Enabled." + rationale: "Digest authentication is less robust than other authentication methods available in WinRM, an attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Disallow Digest authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.1.3"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-38318-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest -> 0' + + # 18.9.97.2.1 Ensure 'Allow Basic authentication' is set to 'Disabled' + - id: 16749 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service accepts Basic authentication from a remote client. The recommended state for this setting is: Disabled." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow Basic authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.2.1"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36254-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic -> 0' + + # 18.9.97.2.2 Ensure 'Allow remote server management through WinRM' is set to 'Disabled' + - id: 16750 + title: "Ensure 'Allow remote server management through WinRM' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port. The recommended state for this setting is: Disabled." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Management (WinRM) service on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow automatic configuration of listeners, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.9.97.2.2"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-37927-1" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> 0' + + # 18.9.97.2.3 Ensure 'Allow unencrypted traffic' is set to 'Disabled' + - id: 16751 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow unencrypted traffic Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.97.2.3"] + - cis_csc: ["16.13"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-38223-4" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic -> 0' + + # 18.9.97.2.4 Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled' + - id: 16752 + title: "Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'" + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service will allow RunAs credentials to be stored for any plug-ins. The recommended state for this setting is: Enabled. Note: If you enable and then disable this policy setting, any values that were previously configured for RunAsPassword will need to be reset." + rationale: "Although the ability to store RunAs credentials is a convenient feature it increases the risk of account compromise slightly. For example, if you forget to lock your desktop before leaving it unattended for a few minutes another person could access not only the desktop of your computer but also any hosts you manage via WinRM with cached RunAs credentials." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Disallow WinRM from storing RunAs credentials Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.97.2.4"] + - cis_csc: ["16.4"] + - pci_dss: ["12.3.8"] + references: + - "CCE-36000-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs -> 1' + + # 18.9.98.1 Ensure 'Allow Remote Shell Access' is set to 'Disabled' + - id: 16753 + title: "Ensure 'Allow Remote Shell Access' is set to 'Disabled'" + description: "This policy setting allows you to manage configuration of remote access to all supported shells to execute scripts and commands. The recommended state for this setting is: Disabled. Note: The GPME help text for this setting is incorrectly worded, implying that configuring it to Enabled will reject new Remote Shell connections, and setting it to Disabled will allow Remote Shell connections. The opposite is true (and is consistent with the title of the setting). This is a wording mistake by Microsoft in the Administrative Template." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Shell on trusted networks and when feasible employ additional controls such as IPsec." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Shell\\Allow Remote Shell Access. Note: This Group Policy path is provided by the Group Policy template WindowsRemoteShell.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.98.1"] + - cis_csc: ["3.4"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "CCE-36499-2" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> 0' + + # 18.9.99.2.1 (L1) Ensure 'Prevent users from modifying settings' is set to 'Enabled' (Scored) + - id: 16754 + title: "Ensure 'Prevent users from modifying settings' is set to 'Enabled'" + description: "This policy setting prevent users from making changes to the Exploit protection settings area in the Windows Security settings. The recommended state for this setting is: Enabled ." + rationale: "Only authorized IT staff should be able to make changes to the exploit protection settings in order to ensure the organizations specific configuration is not modified." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Security\\App and browser protection\\Prevent users from modifying settings Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefenderSecurityCenter.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.99.2.1"] + - cis_csc: ["8.4"] + - pci_dss: ["12.3.8"] + references: + - "CCE-36000-8" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection -> DisallowExploitProtectionOverride -> 1' + + # 18.9.102.1.1 (L1) Ensure 'Manage preview builds' is set to 'Enabled: Disable preview builds' (Scored) + - id: 16755 + title: "Ensure 'Manage preview builds' is set to 'Enabled: Disable preview builds'" + description: "This policy setting determines whether users can access the Windows Insider Program controls in Settings -> Update and Security. These controls enable users to make their devices available for downloading and installing preview (beta) builds of Windows software. The recommended state for this setting is: Enabled: Disable preview builds ." + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable preview builds : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Windows Update for Business\\Manage preview builds Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.102.1.1"] + - cis_csc: ["3"] + - pci_dss: ["6.4.2"] + - tsc: ["CC6.6", "CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuilds -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuildsPolicyValue -> 0' + + # 18.9.102.1.2 (L1) Ensure 'Select when Preview Builds and Feature Updates are received' is set to 'Enabled: Semi-Annual Channel, 180 or more days' (Scored) + - id: 16756 + title: "Ensure 'Select when Preview Builds and Feature Updates are received' is set to 'Enabled: Semi-Annual Channel, 180 or more days'" + description: 'This policy setting determines the level of Preview Build or Feature Updates to receive, and when. The Windows readiness level for each new Windows 10 Feature Update is classified in one of 5 categories, depending on your organizations level of comfort with receiving them: Preview Build - Fast: Devices set to this level will be the first to receive new builds of Windows with features not yet available to the general public. Select Fast to participate in identifying and reporting issues to Microsoft, and provide suggestions on new functionality. Preview Build - Slow: Devices set to this level receive new builds of Windows before they are available to the general public, but at a slower cadence than those set to Fast, and with changes and fixes identified in earlier builds. Release Preview: Receive builds of Windows just before Microsoft releases them to the general public. Semi-Annual Channel (Targeted): Receive feature updates when they are released to the general public. Semi-Annual Channel: Feature updates will arrive when they are declared Semi-Annual Channel. This usually occurs about 4 months after Semi-Annual Channel (Targeted), indicating that Microsoft, Independent Software Vendors (ISVs), partners and customer believe that the release is ready for broad deployment. The recommended state for this setting is: Enabled: Semi-Annual Channel, 180 or more days . Note: If the "Allow Telemetry" policy is set to 0, this policy will have no effect. Note #2: Starting with Windows Server 2016 RTM (Release 1607), Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering. Note #3: Prior to Windows Server 2016 R1709, values above 180 days are not recognized by the OS. Starting with Windows Server 2016 R1709, the maximum number of days you can defer is 365 days.' + rationale: "Forcing new features without prior testing in your environment could cause software incompatibilities as well as introducing new bugs into the operating system. In an enterprise managed environment, it is generally preferred to delay Feature Updates until thorough testing and a deployment plan is in place. This recommendation delays the automatic installation of new features as long as possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Semi-Annual Channel, 180 or more days : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Windows Update for Business\\Select when Preview Builds and Feature Updates are received Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Select when Feature Updates are received, but it was renamed to Select when Preview Builds and Feature Updates are received starting with the Windows 10 Release 1709 Administrative Templates." + compliance: + - cis: ["18.9.102.1.2"] + - cis_csc: ["3"] + - pci_dss: ["4.1"] + - hipaa: ["164.312.a.2.IV", "164.312.e.1", "164.312.e.2.I", "164.312.e.2.II"] + - nist_800_53: ["SC.8"] + - tsc: ["CC6.1", "CC6.7", "CC7.2"] + references: + - "https://blogs.technet.microsoft.com/wsus/2017/05/05/demystifying-dual-scan/" + - "https://blogs.technet.microsoft.com/wsus/2017/08/04/improving-dual-scan-on-1607/" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdatesPeriodInDays -> n:^(\d+) compare >= 180' + + # 18.9.102.1.3 (L1) Ensure 'Select when Quality Updates are received' is set to 'Enabled: 0 days' (Scored) + - id: 16757 + title: "Ensure 'Select when Quality Updates are received' is set to 'Enabled: 0 days'" + description: 'This settings controls when Quality Updates are received. The recommended state for this setting is: Enabled: 0 days . Note: If the "Allow Telemetry" policy is set to 0, this policy will have no effect. Note #2: Starting with Windows Server 2016 RTM (Release 1607), Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering' + rationale: "Quality Updates can contain important bug fixes and/or security patches, and should be installed as soon as possible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled:0 days : Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Windows Update for Business\\Select when Quality Updates are received Note: This Group Policy path does not exist by default. An updated Group Policy template ( WindowsUpdate.admx/adml ) is required - it is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.102.1.3"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + references: + - "https://blogs.technet.microsoft.com/wsus/2017/05/05/demystifying-dual-scan/" + - "https://blogs.technet.microsoft.com/wsus/2017/08/04/improving-dual-scan-on-1607/" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdatesPeriodInDays -> 0' + + # 18.9.102.2 Ensure 'Configure Automatic Updates' is set to 'Enabled' + - id: 16758 + title: "Ensure 'Configure Automatic Updates' is set to 'Enabled'" + description: "This policy setting specifies whether computers in your environment will receive security updates from Windows Update or WSUS. If you configure this policy setting to Enabled, the operating system will recognize when a network connection is available and then use the network connection to search Windows Update or your designated intranet site for updates that apply to them. After you configure this policy setting to Enabled, select one of the following three options in the Configure Automatic Updates Properties dialog box to specify how the service will work: 2 - Notify for download and auto install (Notify before downloading any updates) 3 - Auto download and notify for install (Download the updates automatically and notify when they are ready to be installed.) (Default setting) 4 - Auto download and schedule the install (Automatically download updates and install them on the schedule specified below.)) 5 - Allow local admin to choose setting (Leave decision on above choices up to the local Administrators (Not Recommended)) The recommended state for this setting is: Enabled. Note: The sub-setting 'Configure automatic updating:' has 4 possible values - all of them are valid depending on specific organizational needs, however if feasible we suggest using a value of 4 - Auto download and schedule the install. This suggestion is not a scored requirement. Note #2: Organizations that utilize a 3rd-party solution for patching may choose to exempt themselves from this setting, and instead configure it to Disabled so that the native Windows Update mechanism does not interfere with the 3rd-party patching process." + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Configure Automatic Updates Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.2"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + references: + - "CCE-36172-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> 0' + + # 18.9.102.3 Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day' + - id: 16759 + title: "Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'" + description: "This policy setting specifies when computers in your environment will receive security updates from Windows Update or WSUS. The recommended state for this setting is: 0 - Every day. Note: This setting is only applicable if 4 - Auto download and schedule the install is selected in Rule 18.9.102.2. It will have no impact if any other option is selected." + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to 0 - Every day: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Configure Automatic Updates: Scheduled install day Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.102.3"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + references: + - "CCE-36172-5" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay -> 0' + + # 18.9.102.4 Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled' + - id: 16760 + title: "Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'" + description: "This policy setting specifies that Automatic Updates will wait for computers to be restarted by the users who are logged on to them to complete a scheduled installation. The recommended state for this setting is: Disabled. Note: This setting applies only when you configure Automatic Updates to perform scheduled update installations. If you configure the Configure Automatic Updates setting to Disabled, this setting has no effect." + rationale: "Some security updates require that the computer be restarted to complete an installation. If the computer cannot restart automatically, then the most recent update will not completely install and no new updates will download to the computer until it is restarted. Without the auto-restart functionality, users who are not security-conscious may choose to indefinitely delay the restart, therefore keeping the computer in a less secure state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\No auto-restart with logged on users for scheduled automatic updates installations Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named No auto-restart for scheduled Automatic Updates installations, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.9.102.4"] + - cis_csc: ["4.5"] + - pci_dss: ["6.2"] + - nist_800_53: ["SI.2", "SA.11", "SI.4"] + - gpg_13: ["4.3"] + - gdpr_IV: ["35.7.d"] + - hipaa: ["164.312.b"] + - tsc: ["A1.2", "CC6.8"] + references: + - "CCE-37027-0" + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers -> 0' diff --git a/etc/ruleset/sca/windows/cis_win2022.yml b/etc/ruleset/sca/windows/cis_win2022.yml new file mode 100644 index 0000000000..81ed4d3f7d --- /dev/null +++ b/etc/ruleset/sca/windows/cis_win2022.yml @@ -0,0 +1,7291 @@ +# Security Configuration Assessment +# CIS Checks for Windows 2022 RTM +# Copyright (C) 2015, Wazuh Inc. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation +# +# Based on: +# Center for Internet Security Benchmark for Microsoft Windows Server 2022 v2.0.0 - 04-14-2023 + +policy: + id: "cis_win2022" + file: "cis_win2022.yml" + name: "CIS Microsoft Windows Server 2022 Benchmark v2.0.0" + description: "This document provides prescriptive guidance for establishing a secure configuration posture for Microsoft Windows Server 2022. Please note that the rules provide accurate results for Microsoft Windows Server 2022 Operating Systems with the System language set to English. The SCA policy will work with other languages but the results will be less accurate due to some of the rules that depend on the System language." + references: + - https://www.cisecurity.org/cis-benchmarks/ + +requirements: + title: "Check that the Windows platform is Windows Server 2022" + description: "Requirements for running the CIS benchmark under Windows Server 2022" + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion -> ProductName -> r:^Windows Server 2022' + +checks: + # 1.1.1 (L1) Ensure 'Enforce password history' is set to '24 or more password(s)' (Automated) + - id: 27000 + title: "Ensure 'Enforce password history' is set to '24 or more password(s)'." + description: "This policy setting determines the number of renewed, unique passwords that have to be associated with a user account before you can reuse an old password. The value for this policy setting must be between 0 and 24 passwords. The default value for Windows Vista is 0 passwords, but the default setting in a domain is 24 passwords. To maintain the effectiveness of this policy setting, use the Minimum password age setting to prevent users from repeatedly changing their password. The recommended state for this setting is: 24 or more password(s). Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center. Note #2: As of the publication of this benchmark, Microsoft currently has a maximum limit of 24 saved passwords. For more information, please visit Enforce password history (Windows 10) - Windows security | Microsoft Docs." + rationale: "The longer a user uses the same password, the greater the chance that an attacker can determine the password through brute force attacks. Also, any accounts that may have been compromised will remain exploitable for as long as the password is left unchanged. If password changes are required but password reuse is not prevented, or if users continually reuse a small number of passwords, the effectiveness of a good password policy is greatly reduced. If you specify a low number for this policy setting, users will be able to use the same small number of passwords repeatedly. If you do not also configure the Minimum password age setting, users might repeatedly change their passwords until they can reuse their original password." + remediation: "To establish the recommended configuration via GP, set the following UI path to 24 or more password(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Enforce password history." + references: + - https://www.cisecurity.org/white-papers/cis-password-policy-guide/ + compliance: + - cis: ["1.1.1"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["16.2"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:net.exe accounts -> n:Length of password history maintained:\s+(\d+) compare >= 24' + + # 1.1.2 (L1) Ensure 'Maximum password age' is set to '365 or fewer days, but not 0'. (Automated) + - id: 27001 + title: "Ensure 'Maximum password age' is set to '365 or fewer days, but not 0'." + description: "This policy setting defines how long a user can use their password before it expires. Values for this policy setting range from 0 to 999 days. If you set the value to 0, the password will never expire. Because attackers can crack passwords, the more frequently you change the password the less opportunity an attacker has to use a cracked password. However, the lower this value is set, the higher the potential for an increase in calls to help desk support due to users having to change their password or forgetting which password is current. The recommended state for this setting is 365 or fewer days, but not 0. Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "The longer a password exists the higher the likelihood that it will be compromised by a brute force attack, by an attacker gaining general knowledge about the user, or by the user sharing the password. Configuring the Maximum password age setting to 0 so that users are never required to change their passwords is a major security risk because that allows a compromised password to be used by the malicious user for as long as the valid user has authorized access." + impact: "If the Maximum password age setting is too low, users are required to change their passwords very often. Such a configuration can reduce security in the organization, because users might write their passwords in an insecure location or lose them. If the value for this policy setting is too high, the level of security within an organization is reduced because it allows potential attackers more time in which to discover user passwords or to use compromised accounts." + remediation: "To establish the recommended configuration via GP, set the following UI path to 365 or fewer days, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Maximum password age." + references: + - "https://www.cisecurity.org/white-papers/cis-password-policy-guide/" + compliance: + - cis: ["1.1.2"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["16.10"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:net.exe accounts -> n:Maximum password age \(days\):\s+(\d+) compare <= 365' + - 'c:net.exe accounts -> n:Maximum password age \(days\):\s+(\d+) compare > 0' + + # 1.1.3 (L1) Ensure 'Minimum password age' is set to '1 or more day(s)'. (Automated) + - id: 27002 + title: "Ensure 'Minimum password age' is set to '1 or more day(s)'." + description: "This policy setting determines the number of days that you must use a password before you can change it. The range of values for this policy setting is between 1 and 999 days. (You may also set the value to 0 to allow immediate password changes.) The default value for this setting is 0 days. The recommended state for this setting is: 1 or more day(s). Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "Users may have favorite passwords that they like to use because they are easy to remember and they believe that their password choice is secure from compromise. Unfortunately, passwords are compromised and if an attacker is targeting a specific individual user account, with foreknowledge of data about that user, reuse of old passwords can cause a security breach. To address password reuse a combination of security settings is required. Using this policy setting with the Enforce password history setting prevents the easy reuse of old passwords. For example, if you configure the Enforce password history setting to ensure that users cannot reuse any of their last 12 passwords, they could change their password 13 times in a few minutes and reuse the password they started with, unless you also configure the Minimum password age setting to a number that is greater than 0. You must configure this policy setting to a number that is greater than 0 for the Enforce password history setting to be effective." + impact: "If an administrator sets a password for a user but wants that user to change the password when the user first logs on, the administrator must select the User must change password at next logon check box, or the user will not be able to change the password until the next day." + remediation: "To establish the recommended configuration via GP, set the following UI path to 1 or more day(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Minimum password age." + references: + - "https://www.cisecurity.org/white-papers/cis-password-policy-guide/" + compliance: + - cis: ["1.1.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["16.10"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:net.exe accounts -> n:Minimum password age \(days\):\s+(\d+) compare >= 1' + + # 1.1.4 (L1) Ensure 'Minimum password length' is set to '14 or more character(s)'. (Automated) + - id: 27003 + title: "Ensure 'Minimum password length' is set to '14 or more character(s)'." + description: 'This policy setting determines the least number of characters that make up a password for a user account. There are many different theories about how to determine the best password length for an organization, but perhaps "passphrase" is a better term than "password." In Microsoft Windows 2000 and newer, passphrases can be quite long and can include spaces. Therefore, a phrase such as "I want to drink a $5 milkshake" is a valid passphrase; it is a considerably stronger password than an 8 or 10 character string of random numbers and letters, and yet is easier to remember. Users must be educated about the proper selection and maintenance of passwords, especially with regard to password length. In enterprise environments, the ideal value for the Minimum password length setting is 14 characters, however you should adjust this value to meet your organization''s business requirements. The recommended state for this setting is: 14 or more character(s). Note: In Windows Server 2016 and older versions of Windows Server, the GUI of the Local Security Policy (LSP), Local Group Policy Editor (LGPE) and Group Policy Management Editor (GPME) would not let you set this value higher than 14 characters. However, starting with Windows Server 2019, Microsoft changed the GUI to allow up to a 20 character minimum password length. Note #2: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center.' + rationale: "Types of password attacks include dictionary attacks (which attempt to use common words and phrases) and brute force attacks (which try every possible combination of characters). Also, attackers sometimes try to obtain the account database so they can use tools to discover the accounts and passwords." + impact: "Requirements for extremely long passwords can actually decrease the security of an organization, because users might leave the information in an insecure location or lose it. If very long passwords are required, mistyped passwords could cause account lockouts and increase the volume of help desk calls. If your organization has issues with forgotten passwords due to password length requirements, consider teaching your users about passphrases, which are often easier to remember and, due to the larger number of character combinations, much harder to discover. Note: Older versions of Windows such as Windows 98 and Windows NT 4.0 do not support passwords that are longer than 14 characters. Computers that run these older operating systems are unable to authenticate with computers or domains that use accounts that require long passwords." + remediation: "To establish the recommended configuration via GP, set the following UI path to 14 or more character(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Minimum password length." + references: + - "https://www.cisecurity.org/white-papers/cis-password-policy-guide/" + compliance: + - cis: ["1.1.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'c:net.exe accounts -> n:Minimum password length:\s+(\d+) compare >= 14' + + # 1.1.5 (L1) Ensure 'Password must meet complexity requirements' is set to 'Enabled'. (Automated) - Not Implemented + + # 1.1.6 (L1) Ensure 'Relax minimum password length limits' is set to 'Enabled'. (Automated) + - id: 27004 + title: "Ensure 'Relax minimum password length limits' is set to 'Enabled'." + description: "This policy setting determines whether the minimum password length setting can be increased beyond the legacy limit of 14 characters. For more information please see the following Microsoft Security Blog. The recommended state for this setting is: Enabled. Note: This setting only affects local accounts on the computer. Domain accounts are only affected by settings on the Domain Controllers, because that is where domain accounts are stored." + rationale: "This setting will enable the enforcement of longer and generally stronger passwords or passphrases where MFA is not in use." + impact: "The Minimum password length setting may be configured higher than 14 characters. If very long passwords are required, mistyped passwords could cause account lockouts and increase the volume of help desk calls. If your organization has issues with forgotten passwords due to password length requirements, consider teaching your users about passphrases, which are often easier to remember and, due to the larger number of character combinations, much harder to discover." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Password Policy\\Relax minimum password length limits Note: This setting is only available within the built-in OS security template of Windows 10 Release 2004 and Server 2022 (or newer), and is not available via older versions of the OS, or via downloadable Administrative Templates (ADMX/ADML). Therefore, you must use a Windows 10 Release 2004 or Server 2022 system (or newer) to view or edit this setting with the Group Policy Management Console (GPMC) or Group Policy Management Editor (GPME)." + references: + - "https://www.cisecurity.org/white-papers/cis-password-policy-guide/" + - "https://support.microsoft.com/en-us/topic/minimum-password-length-auditing-and-enforcement-on-certain-versions-of-windows-5ef7fecf-3325-f56b-cc10-4fd565aacc59" + compliance: + - cis: ["1.1.6"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SAM' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SAM -> RelaxMinimumPasswordLengthLimits' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SAM -> RelaxMinimumPasswordLengthLimits -> 1' + + # 1.1.7 (L1) Ensure 'Store passwords using reversible encryption' is set to 'Disabled'. (Automated) - Not Implemented + + # 1.2.1 (L1) Ensure 'Account lockout duration' is set to '15 or more minute(s)'. (Automated) + - id: 27005 + title: "Ensure 'Account lockout duration' is set to '15 or more minute(s)'." + description: "This policy setting determines the length of time that must pass before a locked account is unlocked and a user can try to log on again. The setting does this by specifying the number of minutes a locked out account will remain unavailable. If the value for this policy setting is configured to 0, locked out accounts will remain locked out until an administrator manually unlocks them. Although it might seem like a good idea to configure the value for this policy setting to a high value, such a configuration will likely increase the number of calls that the help desk receives to unlock accounts locked by mistake. Users should be aware of the length of time a lock remains in place, so that they realize they only need to call the help desk if they have an extremely urgent need to regain access to their computer. The recommended state for this setting is: 15 or more minute(s). Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "A denial of service (DoS) condition can be created if an attacker abuses the Account lockout threshold and repeatedly attempts to log on with a specific account. Once you configure the Account lockout threshold setting, the account will be locked out after the specified number of failed attempts. If you configure the Account lockout duration setting to 0, then the account will remain locked out until an administrator unlocks it manually." + impact: "Although it may seem like a good idea to configure this policy setting to never automatically unlock an account, such a configuration can increase the number of requests that your organization's help desk receives to unlock accounts that were locked by mistake." + remediation: "To establish the recommended configuration via GP, set the following UI path to 15 or more minute(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Account Lockout Policy\\Account lockout duration." + references: + - "https://www.cisecurity.org/white-papers/cis-password-policy-guide/" + compliance: + - cis: ["1.2.1"] + - cis_csc_v8: ["4.10"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.8", "SC.L2-3.13.9"] + - iso_27001-2013: ["A.8.1.3"] + - pci_dss_v4.0: ["8.3.4"] + condition: all + rules: + - 'c:net.exe accounts -> n:Lockout duration \(minutes\):\s+(\d+) compare >= 15' + + # 1.2.2 (L1) Ensure 'Account lockout threshold' is set to '5 or fewer invalid logon attempt(s), but not 0'. (Automated) + - id: 27006 + title: "Ensure 'Account lockout threshold' is set to '5 or fewer invalid logon attempt(s), but not 0'." + description: "This policy setting determines the number of failed logon attempts before the account is locked. Setting this policy to 0 does not conform to the benchmark as doing so disables the account lockout threshold. The recommended state for this setting is: 5 or fewer invalid logon attempt(s), but not 0. Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "Setting an account lockout threshold reduces the likelihood that an online password brute force attack will be successful. Setting the account lockout threshold too low introduces risk of increased accidental lockouts and/or a malicious actor intentionally locking out accounts." + impact: "If this policy setting is enabled, a locked-out account will not be usable until it is reset by an administrator or until the account lockout duration expires. This setting may generate additional help desk calls. If you enforce this setting an attacker could cause a denial of service condition by deliberately generating failed logons for multiple user, therefore you should also configure the Account Lockout Duration to a relatively low value. If you configure the Account Lockout Threshold to 0, there is a possibility that an attacker's attempt to discover passwords with a brute force password attack might go undetected if a robust audit mechanism is not in place." + remediation: "To establish the recommended configuration via GP, set the following UI path to 5 or fewer invalid login attempt(s), but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Account Lockout Policy\\Account lockout threshold." + references: + - "https://www.cisecurity.org/white-papers/cis-password-policy-guide/" + compliance: + - cis: ["1.2.2"] + - cis_csc_v8: ["4.10"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.8", "SC.L2-3.13.9"] + - iso_27001-2013: ["A.8.1.3"] + - pci_dss_v4.0: ["8.3.4"] + condition: all + rules: + - 'c:net.exe accounts -> n:Lockout threshold:\s+(\d+) compare > 0' + - 'c:net.exe accounts -> n:Lockout threshold:\s+(\d+) compare <= 5' + + # 1.2.3 (L1) Ensure 'Allow Administrator account lockout' is set to 'Enabled'. (Manual) - Not Implemented + + # 1.2.4 (L1) Ensure 'Reset account lockout counter after' is set to '15 or more minute(s)'. (Automated) + - id: 27007 + title: "Ensure 'Reset account lockout counter after' is set to '15 or more minute(s)'." + description: "This policy setting determines the length of time before the Account lockout threshold resets to zero. The default value for this policy setting is Not Defined. If the Account lockout threshold is defined, this reset time must be less than or equal to the value for the Account lockout duration setting. If you leave this policy setting at its default value or configure the value to an interval that is too long, your environment could be vulnerable to a DoS attack. An attacker could maliciously perform a number of failed logon attempts on all users in the organization, which will lock out their accounts. If no policy were determined to reset the account lockout, it would be a manual task for administrators. Conversely, if a reasonable time value is configured for this policy setting, users would be locked out for a set period until all of the accounts are unlocked automatically. The recommended state for this setting is: 15 or more minute(s). Note: Password Policy settings (section 1.1) and Account Lockout Policy settings (section 1.2) must be applied via the Default Domain Policy GPO in order to be globally in effect on domain user accounts as their default behavior. If these settings are configured in another GPO, they will only affect local user accounts on the computers that receive the GPO. However, custom exceptions to the default password policy and account lockout policy rules for specific domain users and/or groups can be defined using Password Settings Objects (PSOs), which are completely separate from Group Policy and most easily configured using Active Directory Administrative Center." + rationale: "Users can accidentally lock themselves out of their accounts if they mistype their password multiple times. To reduce the chance of such accidental lockouts, the Reset account lockout counter after setting determines the number of minutes that must elapse before the counter that tracks failed logon attempts and triggers lockouts is reset to 0." + impact: "If you do not configure this policy setting or if the value is configured to an interval that is too long, a DoS attack could occur. An attacker could maliciously attempt to log on to each user's account numerous times and lock out their accounts as described in the preceding paragraphs. If you do not configure the Reset account lockout counter after setting, administrators would have to manually unlock all accounts. If you configure this policy setting to a reasonable value the users would be locked out for some period, after which their accounts would unlock automatically. Be sure that you notify users of the values used for this policy setting so that they will wait for the lockout timer to expire before they call the help desk about their inability to log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to 15 or more minute(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Account Policies\\Account Lockout Policy\\Reset account lockout counter after." + references: + - "https://www.cisecurity.org/white-papers/cis-password-policy-guide/" + compliance: + - cis: ["1.2.4"] + - cis_csc_v8: ["4.10"] + - cis_csc_v7: ["16.5"] + - cmmc_v2.0: ["AC.L2-3.1.8", "SC.L2-3.13.9"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - pci_dss_v4.0: ["8.3.4"] + condition: all + rules: + - 'c:net.exe accounts -> n:Lockout observation window \(minutes\):\s+(\d+) compare >= 15' + + # 2.2.1 (L1) Ensure 'Access Credential Manager as a trusted caller' is set to 'No One'. (Automated) - Not Implemented + # 2.2.2 (L1) Ensure 'Access this computer from the network' is set to 'Administrators, Authenticated Users, ENTERPRISE DOMAIN CONTROLLERS' (DC only). (Automated) - Not Implemented + # 2.2.3 (L1) Ensure 'Access this computer from the network' is set to 'Administrators, Authenticated Users' (MS only). (Automated) - Not Implemented + # 2.2.4 (L1) Ensure 'Act as part of the operating system' is set to 'No One'. (Automated) - Not Implemented + # 2.2.5 (L1) Ensure 'Add workstations to domain' is set to 'Administrators' (DC only). (Automated) - Not Implemented + # 2.2.6 (L1) Ensure 'Adjust memory quotas for a process' is set to 'Administrators, LOCAL SERVICE, NETWORK SERVICE'. (Automated) - Not Implemented + # 2.2.7 (L1) Ensure 'Allow log on locally' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.8 (L1) Ensure 'Allow log on through Remote Desktop Services' is set to 'Administrators' (DC only). (Automated) - Not Implemented + # 2.2.9 (L1) Ensure 'Allow log on through Remote Desktop Services' is set to 'Administrators, Remote Desktop Users' (MS only). (Automated) - Not Implemented + # 2.2.10 (L1) Ensure 'Back up files and directories' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.11 (L1) Ensure 'Change the system time' is set to 'Administrators, LOCAL SERVICE'. (Automated) - Not Implemented + # 2.2.12 (L1) Ensure 'Change the time zone' is set to 'Administrators, LOCAL SERVICE'. (Automated) - Not Implemented + # 2.2.13 (L1) Ensure 'Create a pagefile' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.14 (L1) Ensure 'Create a token object' is set to 'No One'. (Automated) - Not Implemented + # 2.2.15 (L1) Ensure 'Create global objects' is set to 'Administrators, LOCAL SERVICE, NETWORK SERVICE, SERVICE'. (Automated) - Not Implemented + # 2.2.16 (L1) Ensure 'Create permanent shared objects' is set to 'No One'. (Automated) - Not Implemented + # 2.2.17 (L1) Ensure 'Create symbolic links' is set to 'Administrators' (DC only). (Automated) - Not Implemented + # 2.2.18 (L1) Ensure 'Create symbolic links' is set to 'Administrators, NT VIRTUAL MACHINE\Virtual Machines' (MS only). (Automated) - Not Implemented + # 2.2.19 (L1) Ensure 'Debug programs' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.20 (L1) Ensure 'Deny access to this computer from the network' to include 'Guests' (DC only). (Automated) - Not Implemented + # 2.2.21 (L1) Ensure 'Deny access to this computer from the network' to include 'Guests, Local account and member of Administrators group' (MS only). (Automated) - Not Implemented + # 2.2.22 (L1) Ensure 'Deny log on as a batch job' to include 'Guests'. (Automated) - Not Implemented + # 2.2.23 (L1) Ensure 'Deny log on as a service' to include 'Guests'. (Automated) - Not Implemented + # 2.2.24 (L1) Ensure 'Deny log on locally' to include 'Guests'. (Automated) - Not Implemented + # 2.2.25 (L1) Ensure 'Deny log on through Remote Desktop Services' to include 'Guests' (DC only). (Automated) - Not Implemented + # 2.2.26 (L1) Ensure 'Deny log on through Remote Desktop Services' is set to 'Guests, Local account' (MS only). (Automated) - Not Implemented + # 2.2.27 (L1) Ensure 'Enable computer and user accounts to be trusted for delegation' is set to 'Administrators' (DC only). (Automated) - Not Implemented + # 2.2.28 (L1) Ensure 'Enable computer and user accounts to be trusted for delegation' is set to 'No One' (MS only). (Automated) - Not Implemented + # 2.2.29 (L1) Ensure 'Force shutdown from a remote system' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.30 (L1) Ensure 'Generate security audits' is set to 'LOCAL SERVICE, NETWORK SERVICE'. (Automated) - Not Implemented + # 2.2.31 (L1) Ensure 'Impersonate a client after authentication' is set to 'Administrators, LOCAL SERVICE, NETWORK SERVICE, SERVICE' (DC only). (Automated) - Not Implemented + # 2.2.33 (L1) Ensure 'Increase scheduling priority' is set to 'Administrators, Window Manager\Window Manager Group'. (Automated) - Not Implemented + # 2.2.34 (L1) Ensure 'Load and unload device drivers' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.35 (L1) Ensure 'Lock pages in memory' is set to 'No One'. (Automated) - Not Implemented + # 2.2.36 (L2) Ensure 'Log on as a batch job' is set to 'Administrators' (DC Only). (Automated) - Not Implemented + # 2.2.38 (L1) Ensure 'Manage auditing and security log' is set to 'Administrators' (MS only). (Automated) - Not Implemented + # 2.2.39 (L1) Ensure 'Modify an object label' is set to 'No One'. (Automated) - Not Implemented + # 2.2.40 (L1) Ensure 'Modify firmware environment values' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.41 (L1) Ensure 'Perform volume maintenance tasks' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.42 (L1) Ensure 'Profile single process' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.43 (L1) Ensure 'Profile system performance' is set to 'Administrators, NT SERVICE\WdiServiceHost'. (Automated) - Not Implemented + # 2.2.44 (L1) Ensure 'Replace a process level token' is set to 'LOCAL SERVICE, NETWORK SERVICE'. (Automated) - Not Implemented + # 2.2.45 (L1) Ensure 'Restore files and directories' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.46 (L1) Ensure 'Shut down the system' is set to 'Administrators'. (Automated) - Not Implemented + # 2.2.47 (L1) Ensure 'Synchronize directory service data' is set to 'No One' (DC only). (Automated) - Not Implemented + # 2.2.48 (L1) Ensure 'Take ownership of files or other objects' is set to 'Administrators'. (Automated) - Not Implemented + + # 2.3.1.1 (L1) Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts'. (Automated) + - id: 27008 + title: "Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts'." + description: "This policy setting prevents users from adding new Microsoft accounts on this computer. The recommended state for this setting is: Users can't add or log on with Microsoft accounts." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used to log onto their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + impact: "Users will not be able to log onto the computer with their Microsoft account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Users can't add or log on with Microsoft accounts: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Block Microsoft accounts." + compliance: + - cis: ["2.3.1.1"] + - cis_csc_v7: ["16.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> NoConnectedUser -> 3' + + # 2.3.1.2 (L1) Ensure 'Accounts: Guest account status' is set to 'Disabled' (MS only). (Automated) + - id: 27009 + title: "Ensure 'Accounts: Guest account status' is set to 'Disabled' (MS only)." + description: "This policy setting determines whether the Guest account is enabled or disabled. The Guest account allows unauthenticated network users to gain access to the system. The recommended state for this setting is: Disabled. Note: This setting will have no impact when applied to the Domain Controllers organizational unit via group policy because Domain Controllers have no local account database. It can be configured at the domain level via group policy, similar to account lockout and password policy settings." + rationale: "The default Guest account allows unauthenticated network users to log on as Guest with no password. These unauthorized users could access any resources that are accessible to the Guest account over the network. This capability means that any network shares with permissions that allow access to the Guest account, the Guests group, or the Everyone group will be accessible over the network, which could lead to the exposure or corruption of data." + impact: "All network users will need to authenticate before they can access shared resources. If you disable the Guest account and the Network Access: Sharing and Security Model option is set to Guest Only, network logons, such as those performed by the Microsoft Network Server (SMB Service), will fail. This policy setting should have little impact on most organizations because it is the default setting in Microsoft Windows 2000, Windows XP, and Windows Server™ 2003." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Guest account status." + compliance: + - cis: ["2.3.1.2"] + - cis_csc_v8: ["4.7"] + - cis_csc_v7: ["16.8"] + - iso_27001-2013: ["A.9.2.1"] + - pci_dss_v3.2.1: ["2.1", "2.1.1"] + - pci_dss_v4.0: ["2.2.2", "2.3.1"] + - soc_2: ["CC6.3"] + condition: any + rules: + - 'c:net user guest -> r:Account active\s+No' + - "c:net user guest -> r:The user name could not be found." + + # 2.3.1.3 (L1) Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'. (Automated) + - id: 27010 + title: "Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'." + description: "This policy setting determines whether local accounts that are not password protected can be used to log on from locations other than the physical computer console. If you enable this policy setting, local accounts that have blank passwords will not be able to log on to the network from remote client computers. Such accounts will only be able to log on at the keyboard of the computer. The recommended state for this setting is: Enabled." + rationale: "Blank passwords are a serious threat to computer security and should be forbidden through both organizational policy and suitable technical measures. In fact, the default settings for Active Directory domains require complex passwords of at least seven characters. However, if users with the ability to create new accounts bypass your domain-based password policies, they could create accounts with blank passwords. For example, a user could build a stand-alone computer, create one or more accounts with blank passwords, and then join the computer to the domain. The local accounts with blank passwords would still function. Anyone who knows the name of one of these unprotected accounts could then use it to log on." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Limit local account use of blank passwords to console logon only." + compliance: + - cis: ["2.3.1.3"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LimitBlankPasswordUse -> 1' + + # 2.3.1.4 (L1) Configure 'Accounts: Rename administrator account'. (Automated) + - id: 27011 + title: "Configure 'Accounts: Rename administrator account'." + description: "The built-in local administrator account is a well-known account name that attackers will target. It is recommended to choose another name for this account, and to avoid names that denote administrative or elevated access accounts. Be sure to also change the default description for the local administrator (through the Computer Management console). On Domain Controllers, since they do not have their own local accounts, this rule refers to the built-in Administrator account that was established when the domain was first created." + rationale: "The Administrator account exists on all computers that run the Windows 2000 or newer operating systems. If you rename this account, it is slightly more difficult for unauthorized persons to guess this privileged user name and password combination. The built-in Administrator account cannot be locked out, regardless of how many times an attacker might use a bad password. This capability makes the Administrator account a popular target for brute force attacks that attempt to guess passwords. The value of this countermeasure is lessened because this account has a well-known SID, and there are third-party tools that allow authentication by using the SID rather than the account name. Therefore, even if you rename the Administrator account, an attacker could launch a brute force attack by using the SID to log on." + impact: "You will have to inform users who are authorized to use this account of the new account name. (The guidance for this setting assumes that the Administrator account was not disabled, which was recommended earlier in this chapter.)." + remediation: "To establish the recommended configuration via GP, configure the following UI path: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Rename administrator account." + compliance: + - cis: ["2.3.1.4"] + - cis_csc_v8: ["4.7"] + - pci_dss_v3.2.1: ["2.1", "2.1.1"] + - pci_dss_v4.0: ["2.2.2", "2.3.1"] + - soc_2: ["CC6.3"] + condition: all + rules: + - "c:net user administrator -> r:The user name could not be found." + + # 2.3.1.5 (L1) Configure 'Accounts: Rename guest account'. (Automated) + - id: 27012 + title: "Configure 'Accounts: Rename guest account'." + description: "The built-in local guest account is another well-known name to attackers. It is recommended to rename this account to something that does not indicate its purpose. Even if you disable this account, which is recommended, ensure that you rename it for added security. On Domain Controllers, since they do not have their own local accounts, this rule refers to the built-in Guest account that was established when the domain was first created." + rationale: "The Guest account exists on all computers that run the Windows 2000 or newer operating systems. If you rename this account, it is slightly more difficult for unauthorized persons to guess this privileged user name and password combination." + impact: "There should be little impact, because the Guest account is disabled by default." + remediation: "To establish the recommended configuration via GP, configure the following UI path: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Accounts: Rename guest account." + compliance: + - cis: ["2.3.1.5"] + - cis_csc_v8: ["4.7"] + - pci_dss_v3.2.1: ["2.1", "2.1.1"] + - pci_dss_v4.0: ["2.2.2", "2.3.1"] + - soc_2: ["CC6.3"] + condition: all + rules: + - "c:net user guest -> r:The user name could not be found." + + # 2.3.2.1 (L1) Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'. (Automated) + - id: 27013 + title: "Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'." + description: "This policy setting allows administrators to enable the more precise auditing capabilities present in Windows Vista. The Audit Policy settings available in Windows Server 2003 Active Directory do not yet contain settings for managing the new auditing subcategories. To properly apply the auditing policies prescribed in this baseline, the Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings setting needs to be configured to Enabled. The recommended state for this setting is: Enabled. Important: Be very cautious about audit settings that can generate a large volume of traffic. For example, if you enable either success or failure auditing for all of the Privilege Use subcategories, the high volume of audit events generated can make it difficult to find other types of entries in the Security log. Such a configuration could also have a significant impact on system performance." + rationale: "Prior to the introduction of auditing subcategories in Windows Vista, it was difficult to track events at a per-system or per-user level. The larger event categories created too many events and the key information that needed to be audited was difficult to find." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings." + references: + - "https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing#to-ensure-that-advanced-audit-policy-configuration-settings-are-not-overwritten" + compliance: + - cis: ["2.3.2.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.2", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> SCENoApplyLegacyAuditPolicy -> 1' + + # 2.3.2.2 (L1) Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'. (Automated) + - id: 27014 + title: "Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'." + description: "This policy setting determines whether the system shuts down if it is unable to log Security events. It is a requirement for Trusted Computer System Evaluation Criteria (TCSEC)-C2 and Common Criteria certification to prevent auditable events from occurring if the audit system is unable to log them. Microsoft has chosen to meet this requirement by halting the system and displaying a stop message if the auditing system experiences a failure. When this policy setting is enabled, the system will be shut down if a security audit cannot be logged for any reason. If the Audit: Shut down system immediately if unable to log security audits setting is enabled, unplanned system failures can occur. The administrative burden can be significant, especially if you also configure the Retention method for the Security log to Do not overwrite events (clear log manually). This configuration causes a repudiation threat (a backup operator could deny that they backed up or restored data) to become a denial of service (DoS) vulnerability, because a server could be forced to shut down if it is overwhelmed with logon events and other security events that are written to the Security log. Also, because the shutdown is not graceful, it is possible that irreparable damage to the operating system, applications, or data could result. Although the NTFS file system guarantees its integrity when an ungraceful computer shutdown occurs, it cannot guarantee that every data file for every application will still be in a usable form when the computer restarts. The recommended state for this setting is: Disabled." + rationale: "If the computer is unable to record events to the Security log, critical evidence or important troubleshooting information may not be available for review after a security incident. Also, an attacker could potentially generate a large volume of Security log events to purposely force a computer shutdown." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Audit: Shut down system immediately if unable to log security audits." + compliance: + - cis: ["2.3.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> CrashOnAuditFail -> 0' + + # 2.3.4.1 (L1) Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators'. (Automated) + - id: 27015 + title: "Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators'." + description: "This policy setting determines who is allowed to format and eject removable NTFS media. You can use this policy setting to prevent unauthorized users from removing data on one computer to access it on another computer on which they have local administrator privileges. The recommended state for this setting is: Administrators." + rationale: "Users may be able to move data on removable disks to a different computer where they have administrative privileges. The user could then take ownership of any file, grant themselves full control, and view or modify any file. The fact that most removable storage devices will eject media by pressing a mechanical button diminishes the advantage of this policy setting." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Allowed to format and eject removable media." + compliance: + - cis: ["2.3.4.1"] + - cis_csc_v7: ["13.7"] + - iso_27001-2013: ["A.8.3.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> AllocateDASD -> 0' + + # 2.3.4.2 (L1) Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'. (Automated) + - id: 27016 + title: "Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'." + description: "For a computer to print to a shared printer, the driver for that shared printer must be installed on the local computer. This security setting determines who is allowed to install a printer driver as part of connecting to a shared printer. The recommended state for this setting is: Enabled. Note: This setting does not affect the ability to add a local printer. This setting does not affect Administrators." + rationale: "It may be appropriate in some organizations to allow users to install printer drivers on their own workstations. However, you should allow only Administrators, not users, to do so on servers, because printer driver installation on a server may unintentionally cause the computer to become less stable. A malicious user could install inappropriate printer drivers in a deliberate attempt to damage the computer, or a user might accidentally install malicious software that masquerades as a printer driver. It is feasible for an attacker to disguise a Trojan horse program as a printer driver. The program may appear to users as if they must use it to print, but such a program could unleash malicious code on your computer network." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Devices: Prevent users from installing printer drivers." + compliance: + - cis: ["2.3.4.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers -> AddPrinterDrivers -> 1' + + # 2.3.5.1 (L1) Ensure 'Domain controller: Allow server operators to schedule tasks' is set to 'Disabled' (DC only). (Automated) + - id: 27017 + title: "Ensure 'Domain controller: Allow server operators to schedule tasks' is set to 'Disabled' (DC only)." + description: "This policy setting determines whether members of the Server Operators group are allowed to submit jobs by means of the AT schedule facility. The impact of this policy setting configuration should be small for most organizations. Users, including those in the Server Operators group, will still be able to create jobs by means of the Task Scheduler Wizard, but those jobs will run in the context of the account with which the user authenticates when they set up the job. Note: An AT Service Account can be modified to select a different account rather than the LOCAL SYSTEM account. To change the account, open System Tools, click Scheduled Tasks, and then click Accessories folder. Then click AT Service Account on the Advanced menu. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting, jobs that are created by server operators by means of the AT service will execute in the context of the account that runs that service. By default, that is the local SYSTEM account. If you enable this policy setting, server operators could perform tasks that SYSTEM is able to do but that they would typically not be able to do, such as add their account to the local Administrators group." + impact: "None - this is the default behavior. Note that users (including those in the Server Operators group) are still able to create jobs by means of the Task Scheduler Wizard. However, those jobs will run in the context of the account that the user authenticates with when setting up the job." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Allow server operators to schedule tasks." + compliance: + - cis: ["2.3.5.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> SubmitControl' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> SubmitControl -> 0' + + # 2.3.5.2 (L1) Ensure 'Domain controller: Allow vulnerable Netlogon secure channel connections' is set to 'Not Configured' (DC Only). (Automated) + - id: 27018 + title: "Ensure 'Domain controller: Allow vulnerable Netlogon secure channel connections' is set to 'Not Configured' (DC Only)." + description: "This security setting determines whether the domain controller bypasses secure RPC for Netlogon secure channel connections for specified machine accounts. When deployed, this policy should be applied to all domain controllers in a forest by enabling the policy on the domain controllers OU. When the Create Vulnerable Connections list (allow list) is configured: - Given allow permission, the domain controller will allow accounts to use a Netlogon secure channel without secure RPC. - Given deny permission, the domain controller will require accounts to use a Netlogon secure channel with secure RPC which is the same as the default (not necessary). Note: Warning from Microsoft - enabling this policy will expose your domain-joined devices and can expose your Active Directory forest to risk. This policy should be used as a temporary measure for 3rd-party devices as you deploy updates. Once a 3rd-party device is updated to support using secure RPC with Netlogon secure channels, the account should be removed from the Create Vulnerable Connections list. To better understand the risk of configuring accounts to be allowed to use vulnerable Netlogon secure channel connections, please visit How to manage the changes in Netlogon secure channel connections associated with CVE-2020-1472. The recommended state for this setting is: Not Configured." + rationale: "Enabling this policy will expose your domain-joined devices and can expose your Active Directory forest to security risks. It is highly recommended that this setting not be used (i.e. be left completely unconfigured) so as not to add risk." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Not Configured: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Allow vulnerable Netlogon secure channel connections." + references: + - "https://go.microsoft.com/fwlink/?linkid=2133485" + compliance: + - cis: ["2.3.5.2"] + condition: all + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters -> VulnerableChannelAllowList' + + # 2.3.5.3 (L1) Ensure 'Domain controller: LDAP server channel binding token requirements' is set to 'Always' (DC Only). (Automated) + - id: 27019 + title: "Ensure 'Domain controller: LDAP server channel binding token requirements' is set to 'Always' (DC Only)." + description: "This setting determines whether the LDAP server (Domain Controller) enforces validation of Channel Binding Tokens (CBT) received in LDAP bind requests that are sent over SSL/TLS (i.e. LDAPS). The recommended state for this setting is: Always. Note: All LDAP clients must have the CVC-2017-8563 security update to be compatible with Domain Controllers that have this setting enabled. More information on this setting is available at: MSKB 4520412: 2020 LDAP channel binding and LDAP signing requirements for Windows." + rationale: 'Requiring Channel Binding Tokens (CBT) can prevent an attacker who is able to capture users'' authentication credentials (e.g. OAuth tokens, session identifiers, etc.) from reusing those credentials in another TLS session. This also helps to increase protection against "man-in-the-middle" attacks using LDAP authentication over SSL/TLS (LDAPS).' + impact: "All LDAP clients must provide channel binding information over SSL/TLS (i.e. LDAPS). The LDAP server (Domain Controller) rejects authentication requests from clients that do not do so. Clients must have the CVC-2017-8563 security update to support this feature, and may have compatibility issues with this setting without the security update. This may also mean that LDAP authentication requests over SSL/TLS that previously worked may stop working until the security update is installed. When first deploying this setting, you may initially want to only set it to the alternate setting of When supported (instead of Always) on all Domain Controllers. This alternate, interim setting enables support for LDAP client channel binding but does not require it. Then set one DC that is not currently being targeted by LDAP clients to Always, and test each of the critical LDAP clients against that DC (and remediating as necessary), before deploying Always to the rest of the DCs. We also recommend using the new Event ID 3039 on your Domain Controllers (added with the March 2020 security update) to help locate clients that do not use Channel Binding Tokens (CBT) in their LDAPS connections. This new Event ID requires increasing the logging level of the 16 LDAP Interface Events portion of the NTDS service diagnostics to a value of 2 (Basic). For more information, please see Table 2: CBT events at this link: MSKB 4520412: 2020 LDAP channel binding and LDAP signing requirements for Windows Older OSes such as Windows XP, Windows Server 2003, Windows Vista and Windows Server 2008 (non-R2), will first require patches for Microsoft Security Advisory 973811, as well as all associated fixes, in order to be compatible with domain controllers that have this setting deployed. Note: Only Always is actually considered compliant to the CIS benchmark." + remediation: "To establish the recommended configuration via GP, set the following UI path to Always: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: LDAP server channel binding token requirements Note: This Group Policy path requires the installation of the March 2020 (or later) Windows security update. With that update, Microsoft added this setting to the built-in OS security template." + compliance: + - cis: ["2.3.5.3"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["16.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters -> LdapEnforceChannelBinding' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters -> LdapEnforceChannelBinding -> 2' + + # 2.3.5.4 (L1) Ensure 'Domain controller: LDAP server signing requirements' is set to 'Require signing' (DC only). (Automated) + - id: 27020 + title: "Ensure 'Domain controller: LDAP server signing requirements' is set to 'Require signing' (DC only)." + description: "This policy setting determines whether the Lightweight Directory Access Protocol (LDAP) server requires LDAP clients to negotiate data signing. The recommended state for this setting is: Require signing. Note: Domain member computers must have Network security: LDAP signing requirements (Rule 2.3.11.8) set to Negotiate signing or higher. If not, they will fail to authenticate once the above Require signing value is configured on the Domain Controllers. Fortunately, Negotiate signing is the default in the client configuration. Note #2: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are shipped with Windows XP Professional use LDAP simple bind or LDAP simple bind through SSL to talk to a Domain Controller. Note #3: Before enabling this setting, you should first ensure that there are no clients (including server-based applications) that are configured to authenticate with Active Directory via unsigned LDAP, because changing this setting will break those applications. Such applications should first be reconfigured to use signed LDAP, Secure LDAP (LDAPS), or IPsec-protected connections. For more information on how to identify whether your DCs are being accessed via unsigned LDAP (and where those accesses are coming from), see this Microsoft TechNet blog article: Identifying Clear Text LDAP binds to your DC's - Practical Windows Security." + rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks. In such attacks, an intruder captures packets between the server and the client, modifies them, and then forwards them to the client. Where LDAP servers are concerned, an attacker could cause a client to make decisions that are based on false records from the LDAP directory. To lower the risk of such an intrusion in an organization's network, you can implement strong physical security measures to protect the network infrastructure. Also, you could implement Internet Protocol security (IPsec) authentication header mode (AH), which performs mutual authentication and packet integrity for IP traffic to make all types of man-in-the-middle attacks extremely difficult. Additionally, allowing the use of regular, unsigned LDAP permits credentials to be received over the network in clear text, which could very easily result in the interception of account passwords by other systems on the network." + impact: "Unless TLS/SSL is being used, the LDAP data signing option must be negotiated. Clients that do not support LDAP signing will be unable to run LDAP queries against the Domain Controllers. All Windows 2000-based computers in your organization that are managed from Windows Server 2003-based or Windows XP-based computers and that use Windows NT Challenge/Response (NTLM) authentication must have Windows 2000 Service Pack 3 (SP3) installed. Alternatively, these clients must have a registry change. For information about this registry change, see Microsoft Knowledge Base article 325465: Windows 2000 domain controllers require SP3 or later when using Windows Server 2003 administration tools. Also, some non-Microsoft operating systems do not support LDAP signing. If you enable this policy setting, client computers that use those operating systems may be unable to access domain resources." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require signing: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: LDAP server signing requirements." + compliance: + - cis: ["2.3.5.4"] + - cis_csc_v8: ["3.10"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters -> LDAPServerIntegrity' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NTDS\Parameters -> LDAPServerIntegrity -> 2' + + # 2.3.5.5 (L1) Ensure 'Domain controller: Refuse machine account password changes' is set to 'Disabled' (DC only). (Automated) + - id: 27021 + title: "Ensure 'Domain controller: Refuse machine account password changes' is set to 'Disabled' (DC only)." + description: "This security setting determines whether Domain Controllers will refuse requests from member computers to change computer account passwords. The recommended state for this setting is: Disabled. Note: Some problems can occur as a result of machine account password expiration, particularly if a machine is reverted to a previous point-in-time state, as is common with virtual machines. Depending on how far back the reversion is, the older machine account password stored on the machine may no longer be recognized by the domain controllers, and therefore the computer loses its domain trust. This can also disrupt non-persistent VDI implementations, and devices with write filters that disallow permanent changes to the OS volume. Some organizations may choose to exempt themselves from this recommendation and disable machine account password expiration for these situations." + rationale: "If you enable this policy setting on all Domain Controllers in a domain, domain members will not be able to change their computer account passwords, and those passwords will be more susceptible to attack." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain controller: Refuse machine account password changes." + compliance: + - cis: ["2.3.5.5"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters -> RefusePasswordChange' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Netlogon\Parameters -> RefusePasswordChange -> 0' + + # 2.3.6.1 (L1) Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'. (Automated) + - id: 27022 + title: "Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'." + description: "This policy setting determines whether all secure channel traffic that is initiated by the domain member must be signed or encrypted. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + impact: "None - this is the default behavior. However, only Windows NT 4.0 with Service Pack 6a (SP6a) and subsequent versions of the Windows operating system support digital encryption and signing of the secure channel. Windows 98 Second Edition clients do not support it unless they have Dsclient installed. Therefore, you cannot enable the Domain member: Digitally encrypt or sign secure channel data (always) setting on Domain Controllers that support Windows 98 clients as members of the domain. Potential impacts can include the following: - The ability to create or delete trust relationships with clients running versions of Windows earlier than Windows NT 4.0 with SP6a will be disabled. - Logons from clients running versions of Windows earlier than Windows NT 4.0 with SP6a will be disabled. - The ability to authenticate other domains' users from a Domain Controller running a version of Windows earlier than Windows NT 4.0 with SP6a in a trusted domain will be disabled. You can enable this policy setting after you eliminate all Windows 9x clients from the domain and upgrade all Windows NT 4.0 servers and Domain Controllers from trusted/trusting domains to Windows NT 4.0 with SP6a." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt or sign secure channel data (always)." + compliance: + - cis: ["2.3.6.1"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireSignOrSeal -> 1' + + # 2.3.6.2 (L1) Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'. (Automated) + - id: 27023 + title: "Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'." + description: "This policy setting determines whether a domain member should attempt to negotiate encryption for all secure channel traffic that it initiates. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + impact: "None - this is the default behavior. However, only Windows NT 4.0 Service Pack 6a (SP6a) and subsequent versions of the Windows operating system support digital encryption and signing of the secure channel. Windows 98 Second Edition clients do not support it unless they have Dsclient installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally encrypt secure channel data (when possible)." + compliance: + - cis: ["2.3.6.2"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SealSecureChannel -> 1' + + # 2.3.6.3 (L1) Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'. (Automated) + - id: 27024 + title: "Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'." + description: "This policy setting determines whether a domain member should attempt to negotiate whether all secure channel traffic that it initiates must be digitally signed. Digital signatures protect the traffic from being modified by anyone who captures the data as it traverses the network. The recommended state for this setting is: Enabled." + rationale: "When a computer joins a domain, a computer account is created. After it joins the domain, the computer uses the password for that account to create a secure channel with the Domain Controller for its domain every time that it restarts. Requests that are sent on the secure channel are authenticated-and sensitive information such as passwords are encrypted-but the channel is not integrity-checked, and not all information is encrypted. Digital encryption and signing of the secure channel is a good idea where it is supported. The secure channel protects domain credentials as they are sent to the Domain Controller." + impact: "None - this is the default behavior. However, only Windows NT 4.0 with Service Pack 6a (SP6a) and subsequent versions of the Windows operating system support digital encryption and signing of the secure channel. Windows 98 Second Edition clients do not support it unless they have Dsclient installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Digitally sign secure channel data (when possible)." + compliance: + - cis: ["2.3.6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> SignSecureChannel -> 1' + + # 2.3.6.4 (L1) Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'. (Automated) + - id: 27025 + title: "Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'." + description: "This policy setting determines whether a domain member can periodically change its computer account password. Computers that cannot automatically change their account passwords are potentially vulnerable, because an attacker might be able to determine the password for the system's domain account. The recommended state for this setting is: Disabled. Note: Some problems can occur as a result of machine account password expiration, particularly if a machine is reverted to a previous point-in-time state, as is common with virtual machines. Depending on how far back the reversion is, the older machine account password stored on the machine may no longer be recognized by the domain controllers, and therefore the computer loses its domain trust. This can also disrupt non-persistent VDI implementations, and devices with write filters that disallow permanent changes to the OS volume. Some organizations may choose to exempt themselves from this recommendation and disable machine account password expiration for these situations." + rationale: "The default configuration for Windows Server 2003-based computers that belong to a domain is that they are automatically required to change the passwords for their accounts every 30 days. If you disable this policy setting, computers that run Windows Server 2003 will retain the same passwords as their computer accounts. Computers that are no longer able to automatically change their account password are at risk from an attacker who could determine the password for the computer's domain account." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Disable machine account password changes." + compliance: + - cis: ["2.3.6.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> DisablePasswordChange -> 0' + + # 2.3.6.5 (L1) Ensure 'Domain member: Maximum machine account password age' is set to '30 or fewer days, but not 0'. (Automated) + - id: 27026 + title: "Ensure 'Domain member: Maximum machine account password age' is set to '30 or fewer days, but not 0'." + description: "This policy setting determines the maximum allowable age for a computer account password. By default, domain members automatically change their domain passwords every 30 days. The recommended state for this setting is: 30 or fewer days, but not 0. Note: A value of 0 does not conform to the benchmark as it disables maximum password age. Note #2: Some problems can occur as a result of machine account password expiration, particularly if a machine is reverted to a previous point-in-time state, as is common with virtual machines. Depending on how far back the reversion is, the older machine account password stored on the machine may no longer be recognized by the domain controllers, and therefore the computer loses its domain trust. This can also disrupt non-persistent VDI implementations, and devices with write filters that disallow permanent changes to the OS volume. Some organizations may choose to exempt themselves from this recommendation and disable machine account password expiration for these situations." + rationale: "In Active Directory-based domains, each computer has an account and password just like every user. By default, the domain members automatically change their domain password every 30 days. If you increase this interval significantly, or set it to 0 so that the computers no longer change their passwords, an attacker will have more time to undertake a brute force attack to guess the passwords of computer accounts." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to 30 or fewer days, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Maximum machine account password age." + compliance: + - cis: ["2.3.6.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> n:^(\d+) compare <= 30' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> MaximumPasswordAge -> 0' + + # 2.3.6.6 (L1) Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'. (Automated) + - id: 27027 + title: "Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'." + description: "When this policy setting is enabled, a secure channel can only be established with Domain Controllers that are capable of encrypting secure channel data with a strong (128-bit) session key. To enable this policy setting, all Domain Controllers in the domain must be able to encrypt secure channel data with a strong key, which means all Domain Controllers must be running Microsoft Windows 2000 or newer. The recommended state for this setting is: Enabled." + rationale: "Session keys that are used to establish secure channel communications between Domain Controllers and member computers are much stronger in Windows 2000 than they were in previous Microsoft operating systems. Whenever possible, you should take advantage of these stronger session keys to help protect secure channel communications from attacks that attempt to hijack network sessions and eavesdropping. (Eavesdropping is a form of hacking in which network data is read or altered in transit. The data can be modified to hide or change the sender, or be redirected.)." + impact: "None - this is the default behavior. However, computers will not be able to join Windows NT 4.0 domains, and trusts between Active Directory domains and Windows NT-style domains may not work properly. Also, Domain Controllers with this setting configured will not allow older pre-Windows 2000 clients (that that do not support this policy setting) to join the domain." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Domain member: Require strong (Windows 2000 or later) session key." + compliance: + - cis: ["2.3.6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Netlogon\Parameters -> RequireStrongKey -> 1' + + # 2.3.7.1 (L1) Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'. (Automated) + - id: 27028 + title: "Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'." + description: "This policy setting determines whether users must press CTRL+ALT+DEL before they log on. The recommended state for this setting is: Disabled." + rationale: "Microsoft developed this feature to make it easier for users with certain types of physical impairments to log on to computers that run Windows. If users are not required to press CTRL+ALT+DEL, they are susceptible to attacks that attempt to intercept their passwords. If CTRL+ALT+DEL is required before logon, user passwords are communicated by means of a trusted path. An attacker could install a Trojan horse program that looks like the standard Windows logon dialog box and capture the user's password. The attacker would then be able to log on to the compromised account with whatever level of privilege that user has." + impact: "Users must press CTRL+ALT+DEL before they log on to Windows unless they use a smart card for Windows logon. A smart card is a tamper-proof device that stores security information." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Do not require CTRL+ALT+DEL." + compliance: + - cis: ["2.3.7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DisableCAD -> 0' + + # 2.3.7.2 (L1) Ensure 'Interactive logon: Don't display last signed-in' is set to 'Enabled'. (Automated) + - id: 27029 + title: "Ensure 'Interactive logon: Don't display last signed-in' is set to 'Enabled'." + description: "This policy setting determines whether the account name of the last user to log on to the client computers in your organization will be displayed in each computer's respective Windows logon screen. Enable this policy setting to prevent intruders from collecting account names visually from the screens of desktop or laptop computers in your organization. The recommended state for this setting is: Enabled." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + impact: "The name of the last user to successfully log on will not be displayed in the Windows logon screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Don't display last signed-in Note: In older versions of Microsoft Windows, this setting was named Interactive logon: Do not display last user name, but it was renamed starting with Windows Server 2019." + compliance: + - cis: ["2.3.7.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> DontDisplayLastUserName -> 1' + + # 2.3.7.3 (L1) Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'. (Automated) + - id: 27030 + title: "Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'." + description: "Windows notices inactivity of a logon session, and if the amount of inactive time exceeds the inactivity limit, then the screen saver will run, locking the session. The recommended state for this setting is: 900 or fewer second(s), but not 0. Note: A value of 0 does not conform to the benchmark as it disables the machine inactivity limit." + rationale: "If a user forgets to lock their computer when they walk away it's possible that a passerby will hijack it." + impact: "The screen saver will automatically activate when the computer has been unattended for the amount of time specified. The impact should be minimal since the screen saver is enabled by default." + remediation: "To establish the recommended configuration via GP, set the following UI path to 900 or fewer seconds, but not 0: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Machine inactivity limit." + compliance: + - cis: ["2.3.7.3"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> 0' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> InactivityTimeoutSecs -> n:^(\d+) compare <= 900' + + # 2.3.7.4 (L1) Configure 'Interactive logon: Message text for users attempting to log on'. (Automated) + - id: 27031 + title: "Configure 'Interactive logon: Message text for users attempting to log on'." + description: "This policy setting specifies a text message that displays to users when they log on. Configure this setting in a manner that is consistent with the security and operational requirements of your organization." + rationale: "Displaying a warning message before logon may help prevent an attack by warning the attacker about the consequences of their misconduct before it happens. It may also help to reinforce corporate policy by notifying employees of the appropriate policy during the logon process. This text is often used for legal reasons-for example, to warn users about the ramifications of misusing company information or to warn them that their actions may be audited. Note: Any warning that you display should first be approved by your organization's legal and human resources representatives." + impact: "Users will have to acknowledge a dialog box containing the configured text before they can log on to the computer. Note: Windows Vista and Windows XP Professional support logon banners that can exceed 512 characters in length and that can also contain carriage-return line-feed sequences. However, Windows 2000-based clients cannot interpret and display these messages. You must use a Windows 2000-based computer to create a logon message policy that applies to Windows 2000-based computers." + remediation: "To establish the recommended configuration via GP, configure the following UI path to a value that is consistent with the security and operational requirements of your organization: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Message text for users attempting to log on." + compliance: + - cis: ["2.3.7.4"] + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system' + - 'r:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system -> legalnoticetext' + - 'r:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system -> legalnoticetext-> r:\w+' + + # 2.3.7.5 (L1) Configure 'Interactive logon: Message title for users attempting to log on'. (Automated) + - id: 27032 + title: "Configure 'Interactive logon: Message title for users attempting to log on'." + description: "This policy setting specifies the text displayed in the title bar of the window that users see when they log on to the system. Configure this setting in a manner that is consistent with the security and operational requirements of your organization." + rationale: "Displaying a warning message before logon may help prevent an attack by warning the attacker about the consequences of their misconduct before it happens. It may also help to reinforce corporate policy by notifying employees of the appropriate policy during the logon process." + impact: "Users will have to acknowledge a dialog box with the configured title before they can log on to the computer." + remediation: "To establish the recommended configuration via GP, configure the following UI path to a value that is consistent with the security and operational requirements of your organization: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Message title for users attempting to log on." + compliance: + - cis: ["2.3.7.5"] + condition: all + rules: + - 'r:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system' + - 'r:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system -> legalnoticecaption' + - 'r:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system -> legalnoticecaption -> r:\w+' + + # 2.3.7.6 (L2) Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)' (MS only) (Automated) + - id: 27033 + title: "Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)' (MS only)." + description: "This policy setting determines whether a user can log on to a Windows domain using cached account information. Logon information for domain accounts can be cached locally to allow users to log on even if a Domain Controller cannot be contacted. This policy setting determines the number of unique users for whom logon information is cached locally. If this value is set to 0, the logon cache feature is disabled. An attacker who is able to access the file system of the server could locate this cached information and use a brute force attack to determine user passwords. The recommended state for this setting is: 4 or fewer logon(s)." + rationale: "The number that is assigned to this policy setting indicates the number of users whose logon information the computer will cache locally. If the number is set to 4, then the computer caches logon information for 4 users. When a 5th user logs on to the computer, the server overwrites the oldest cached logon session. Users who access the computer console will have their logon credentials cached on that computer. An attacker who is able to access the file system of the computer could locate this cached information and use a brute force attack to attempt to determine user passwords. To mitigate this type of attack, Windows encrypts the information and obscures its physical location." + remediation: "To establish the recommended configuration via GP, set the following UI path to 4 or fewer logon(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Number of previous logons to cache (in case domain controller is not available)." + compliance: + - cis: ["2.3.7.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> CachedLogonsCount -> n:^(\d+) compare <= 4' + + # 2.3.7.7 (L1) Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'. (Automated) + - id: 27034 + title: "Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'." + description: "This policy setting determines how far in advance users are warned that their password will expire. It is recommended that you configure this policy setting to at least 5 days but no more than 14 days to sufficiently warn users when their passwords will expire. The recommended state for this setting is: between 5 and 14 days." + rationale: "It is recommended that user passwords be configured to expire periodically. Users will need to be warned that their passwords are going to expire, or they may inadvertently be locked out of the computer when their passwords expire. This condition could lead to confusion for users who access the network locally, or make it impossible for users to access your organization's network through dial-up or virtual private network (VPN) connections." + impact: "Users will see a dialog box prompt to change their password each time that they log on to the domain when their password is configured to expire between 5 and 14 days." + remediation: "To establish the recommended configuration via GP, set the following UI path to a value between 5 and 14 days: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Prompt user to change password before expiration." + compliance: + - cis: ["2.3.7.7"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> PasswordExpiryWarning -> n:^(\d+) compare >= 5 && n:^(\d+) compare <= 14' + + # 2.3.7.8 (L1) Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled' (MS only). (Automated) + - id: 27035 + title: "Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled' (MS only)." + description: "Logon information is required to unlock a locked computer. For domain accounts, this security setting determines whether it is necessary to contact a Domain Controller to unlock a computer. The recommended state for this setting is: Enabled." + rationale: "By default, the computer caches in memory the credentials of any users who are authenticated locally. The computer uses these cached credentials to authenticate anyone who attempts to unlock the console. When cached credentials are used, any changes that have recently been made to the account - such as user rights assignments, account lockout, or the account being disabled - are not considered or applied after the account is authenticated. User privileges are not updated, and (more importantly) disabled accounts are still able to unlock the console of the computer." + impact: "When the console on a computer is locked, either by a user or automatically by a screen saver time-out, the console can only be unlocked if a Domain Controller is available to re-authenticate the domain account that is being used to unlock the computer. If no Domain Controller is available, the user cannot unlock the computer." + remediation: "To implement the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Require Domain Controller Authentication to unlock workstation." + compliance: + - cis: ["2.3.7.8"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ForceUnlockLogon -> 1' + + # 2.3.7.9 (L1) Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher. (Automated) + - id: 27036 + title: "Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher." + description: "This policy setting determines what happens when the smart card for a logged-on user is removed from the smart card reader. The recommended state for this setting is: Lock Workstation. Configuring this setting to Force Logoff or Disconnect if a Remote Desktop Services session also conforms to the benchmark." + rationale: "Users sometimes forget to lock their workstations when they are away from them, allowing the possibility for malicious users to access their computers. If smart cards are used for authentication, the computer should automatically lock itself when the card is removed to ensure that only the user with the smart card is accessing resources using those credentials." + impact: "If you select Lock Workstation, the workstation is locked when the smart card is removed, allowing users to leave the area, take their smart card with them, and still maintain a protected session. If you select Force Logoff, users are automatically logged off when their smart card is removed. If you select Disconnect if a Remote Desktop Services session, removal of the smart card disconnects the session without logging the users off. This allows the user to insert the smart card and resume the session later, or at another smart card reader-equipped computer, without having to log on again. If the session is local, this policy will function identically to Lock Workstation. Enforcing this setting on computers used by people who must log onto multiple computers in order to perform their duties could be frustrating and lower productivity. For example, if network administrators are limited to a single account but need to log into several computers simultaneously in order to effectively manage the network enforcing this setting will limit them to logging onto one computer at a time. For these reasons it is recommended that this setting only be enforced on workstations used for purposes commonly associated with typical users such as document creation and email." + remediation: "To establish the recommended configuration via GP, set the following UI path to Lock Workstation (or, if applicable for your environment, Force Logoff or Disconnect if a Remote Desktop Services session): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Interactive logon: Smart card removal behavior." + compliance: + - cis: ["2.3.7.9"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScRemoveOption -> r:^1$|^2$|^3$' + + # 2.3.8.1 (L1) Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'. (Automated) + - id: 27037 + title: "Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'." + description: 'This policy setting determines whether packet signing is required by the SMB client component. Note: When Windows Vista-based computers have this policy setting enabled and they connect to file or print shares on remote servers, it is important that the setting is synchronized with its companion setting, Microsoft network server: Digitally sign communications (always), on those servers. For more information about these settings, see the "Microsoft network client and server; Digitally sign communications (four related settings)" section in Chapter 5 of the Threats and Countermeasures guide. The recommended state for this setting is: Enabled.' + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + impact: "The Microsoft network client will not communicate with a Microsoft network server unless that server agrees to perform SMB packet signing. The Windows 2000 Server, Windows 2000 Professional, Windows Server 2003, Windows XP Professional and Windows Vista implementations of the SMB file and print sharing protocol support mutual authentication, which prevents session hijacking attacks and supports message authentication to prevent man-in-the-middle attacks. SMB signing provides this authentication by placing a digital signature into each SMB, which is then verified by both the client and the server. Implementation of SMB signing may negatively affect performance, because each packet needs to be signed and verified. If these settings are enabled on a server that is performing multiple roles, such as a small business server that is serving as a Domain Controller, file server, print server, and application server performance may be substantially slowed. Additionally, if you configure computers to ignore all unsigned SMB communications, older applications and operating systems will not be able to connect. However, if you completely disable all SMB signing, computers will be vulnerable to session hijacking attacks. When SMB signing policies are enabled on Domain Controllers running Windows Server 2003 and member computers running Windows Vista SP1 or Windows Server 2008 group policy processing will fail. A hotfix is available from Microsoft that resolves this issue; see Microsoft Knowledge Base article 950876 for more details: Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (always)." + compliance: + - cis: ["2.3.8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> RequireSecuritySignature -> 1' + + # 2.3.8.2 (L1) Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'. (Automated) + - id: 27038 + title: "Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'." + description: "This policy setting determines whether the SMB client will attempt to negotiate SMB packet signing. Note: Enabling this policy setting on SMB clients on your network makes them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + impact: "None - this is the default behavior. The Windows 2000 Server, Windows 2000 Professional, Windows Server 2003, Windows XP Professional and Windows Vista implementations of the SMB file and print sharing protocol support mutual authentication, which prevents session hijacking attacks and supports message authentication to prevent man-in-the-middle attacks. SMB signing provides this authentication by placing a digital signature into each SMB, which is then verified by both the client and the server. Implementation of SMB signing may negatively affect performance, because each packet needs to be signed and verified. If these settings are enabled on a server that is performing multiple roles, such as a small business server that is serving as a Domain Controller, file server, print server, and application server performance may be substantially slowed. Additionally, if you configure computers to ignore all unsigned SMB communications, older applications and operating systems will not be able to connect. However, if you completely disable all SMB signing, computers will be vulnerable to session hijacking attacks. When SMB signing policies are enabled on Domain Controllers running Windows Server 2003 and member computers running Windows Vista SP1 or Windows Server 2008 group policy processing will fail. A hotfix is available from Microsoft that resolves this issue; see Microsoft Knowledge Base article 950876 for more details: Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Digitally sign communications (if server agrees)." + compliance: + - cis: ["2.3.8.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnableSecuritySignature -> 1' + + # 2.3.8.3 (L1) Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'. (Automated) + - id: 27039 + title: "Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'." + description: "This policy setting determines whether the SMB redirector will send plaintext passwords during authentication to third-party SMB servers that do not support password encryption. It is recommended that you disable this policy setting unless there is a strong business case to enable it. If this policy setting is enabled, unencrypted passwords will be allowed across the network. The recommended state for this setting is: Disabled." + rationale: "If you enable this policy setting, the server can transmit passwords in plaintext across the network to other computers that offer SMB services, which is a significant security risk. These other computers may not use any of the SMB security mechanisms that are included with Windows Server 2003." + impact: "None - this is the default behavior. Some very old applications and operating systems such as MS-DOS, Windows for Workgroups 3.11, and Windows 95a may not be able to communicate with the servers in your organization by means of the SMB protocol." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network client: Send unencrypted password to third-party SMB servers." + compliance: + - cis: ["2.3.8.3"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters -> EnablePlainTextPassword -> 0' + + # 2.3.9.1 (L1) Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s)'. (Automated) + - id: 27040 + title: "Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s)'." + description: "This policy setting allows you to specify the amount of continuous idle time that must pass in an SMB session before the session is suspended because of inactivity. Administrators can use this policy setting to control when a computer suspends an inactive SMB session. If client activity resumes, the session is automatically reestablished. The maximum value is 99999, which is over 69 days; in effect, this value disables the setting. The recommended state for this setting is: 15 or fewer minute(s)." + rationale: "Each SMB session consumes server resources, and numerous null sessions will slow the server or possibly cause it to fail. An attacker could repeatedly establish SMB sessions until the server's SMB services become slow or unresponsive." + impact: "There will be little impact because SMB sessions will be re-established automatically if the client resumes activity." + remediation: "To establish the recommended configuration via GP, set the following UI path to 15 or fewer minute(s): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Amount of idle time required before suspending session." + compliance: + - cis: ["2.3.9.1"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> AutoDisconnect -> n:^(\d+) compare <= 15' + + # 2.3.9.2 (L1) Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'. (Automated) + - id: 27041 + title: "Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'." + description: "This policy setting determines whether packet signing is required by the SMB server component. Enable this policy setting in a mixed environment to prevent downstream clients from using the workstation as a network server. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + impact: "The Microsoft network server will not communicate with a Microsoft network client unless that client agrees to perform SMB packet signing. The Windows 2000 Server, Windows 2000 Professional, Windows Server 2003, Windows XP Professional and Windows Vista implementations of the SMB file and print sharing protocol support mutual authentication, which prevents session hijacking attacks and supports message authentication to prevent man-in-the-middle attacks. SMB signing provides this authentication by placing a digital signature into each SMB, which is then verified by both the client and the server. Implementation of SMB signing may negatively affect performance, because each packet needs to be signed and verified. If these settings are enabled on a server that is performing multiple roles, such as a small business server that is serving as a Domain Controller, file server, print server, and application server performance may be substantially slowed. Additionally, if you configure computers to ignore all unsigned SMB communications, older applications and operating systems will not be able to connect. However, if you completely disable all SMB signing, computers will be vulnerable to session hijacking attacks. When SMB signing policies are enabled on Domain Controllers running Windows Server 2003 and member computers running Windows Vista SP1 or Windows Server 2008 group policy processing will fail. A hotfix is available from Microsoft that resolves this issue; see Microsoft Knowledge Base article 950876 for more details: Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (always)." + compliance: + - cis: ["2.3.9.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RequireSecuritySignature -> 1' + + # 2.3.9.3 (L1) Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'. (Automated) + - id: 27042 + title: "Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'." + description: "This policy setting determines whether the SMB server will negotiate SMB packet signing with clients that request it. If no signing request comes from the client, a connection will be allowed without a signature if the Microsoft network server: Digitally sign communications (always) setting is not enabled. Note: Enable this policy setting on SMB clients on your network to make them fully effective for packet signing with all clients and servers in your environment. The recommended state for this setting is: Enabled." + rationale: "Session hijacking uses tools that allow attackers who have access to the same network as the client or server to interrupt, end, or steal a session in progress. Attackers can potentially intercept and modify unsigned SMB packets and then modify the traffic and forward it so that the server might perform undesirable actions. Alternatively, the attacker could pose as the server or client after legitimate authentication and gain unauthorized access to data. SMB is the resource sharing protocol that is supported by many Windows operating systems. It is the basis of NetBIOS and many other protocols. SMB signatures authenticate both users and the servers that host the data. If either side fails the authentication process, data transmission will not take place." + impact: "The Microsoft network server will negotiate SMB packet signing as requested by the client. That is, if packet signing has been enabled on the client, packet signing will be negotiated. The Windows 2000 Server, Windows 2000 Professional, Windows Server 2003, Windows XP Professional and Windows Vista implementations of the SMB file and print sharing protocol support mutual authentication, which prevents session hijacking attacks and supports message authentication to prevent man-in-the-middle attacks. SMB signing provides this authentication by placing a digital signature into each SMB, which is then verified by both the client and the server. Implementation of SMB signing may negatively affect performance, because each packet needs to be signed and verified. If these settings are enabled on a server that is performing multiple roles, such as a small business server that is serving as a Domain Controller, file server, print server, and application server performance may be substantially slowed. Additionally, if you configure computers to ignore all unsigned SMB communications, older applications and operating systems will not be able to connect. However, if you completely disable all SMB signing, computers will be vulnerable to session hijacking attacks. When SMB signing policies are enabled on Domain Controllers running Windows Server 2003 and member computers running Windows Vista SP1 or Windows Server 2008 group policy processing will fail. A hotfix is available from Microsoft that resolves this issue; see Microsoft Knowledge Base article 950876 for more details: Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Digitally sign communications (if client agrees)." + compliance: + - cis: ["2.3.9.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableSecuritySignature -> 1' + + # 2.3.9.4 (L1) Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'. (Automated) + - id: 27043 + title: "Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'." + description: "This security setting determines whether to disconnect users who are connected to the local computer outside their user account's valid logon hours. This setting affects the Server Message Block (SMB) component. If you enable this policy setting you should also enable Network security: Force logoff when logon hours expire (Rule 2.3.11.6). If your organization configures logon hours for users, this policy setting is necessary to ensure they are effective. The recommended state for this setting is: Enabled." + rationale: "If your organization configures logon hours for users, then it makes sense to enable this policy setting. Otherwise, users who should not have access to network resources outside of their logon hours may actually be able to continue to use those resources with sessions that were established during allowed hours." + impact: "None - this is the default behavior. If logon hours are not used in your organization, this policy setting will have no impact. If logon hours are used, existing user sessions will be forcibly terminated when their logon hours expire." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Disconnect clients when logon hours expire." + compliance: + - cis: ["2.3.9.4"] + - cis_csc_v8: ["5.6"] + - cis_csc_v7: ["16.13"] + - nist_sp_800-53: ["AC-2(1)"] + - soc_2: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> EnableForcedLogOff -> 1' + + # 2.3.9.5 (L1) Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher (MS only). (Automated) + - id: 27044 + title: "Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher (MS only)." + description: "This policy setting controls the level of validation a computer with shared folders or printers (the server) performs on the service principal name (SPN) that is provided by the client computer when it establishes a session using the server message block (SMB) protocol. The server message block (SMB) protocol provides the basis for file and print sharing and other networking operations, such as remote Windows administration. The SMB protocol supports validating the SMB server service principal name (SPN) within the authentication blob provided by a SMB client to prevent a class of attacks against SMB servers referred to as SMB relay attacks. This setting will affect both SMB1 and SMB2. The recommended state for this setting is: Accept if provided by client. Configuring this setting to Required from client also conforms to the benchmark. Note: Since the release of the MS KB3161561 security patch, this setting can cause significant issues (such as replication problems, group policy editing issues and blue screen crashes) on Domain Controllers when used simultaneously with UNC path hardening (i.e. Rule 18.5.14.1). CIS therefore recommends against deploying this setting on Domain Controllers." + rationale: "The identity of a computer can be spoofed to gain unauthorized access to network resources." + impact: "All Windows operating systems support both a client-side SMB component and a server-side SMB component. This setting affects the server SMB behavior, and its implementation should be carefully evaluated and tested to prevent disruptions to file and print serving capabilities. If configured to Accept if provided by client, the SMB server will accept and validate the SPN provided by the SMB client and allow a session to be established if it matches the SMB server's list of SPN's for itself. If the SPN does NOT match, the session request for that SMB client will be denied. If configured to Required from client, the SMB client MUST send a SPN name in session setup, and the SPN name provided MUST match the SMB server that is being requested to establish a connection. If no SPN is provided by client, or the SPN provided does not match, the session is denied." + remediation: "To establish the recommended configuration via GP, set the following UI path to Accept if provided by client (configuring to Required from client also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Microsoft network server: Server SPN target name validation level." + compliance: + - cis: ["2.3.9.5"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters -> SMBServerNameHardeningLevel -> n:^(\d+) compare >= 1' + + # 2.3.10.1 (L1) Ensure 'Network access: Allow anonymous SID/Name translation' is set to 'Disabled'. (Automated) + - id: 27045 + title: "Ensure 'Network access: Allow anonymous SID/Name translation' is set to 'Disabled'." + description: "This policy setting determines whether an anonymous user can request security identifier (SID) attributes for another user, or use a SID to obtain its corresponding user name. The recommended state for this setting is: Disabled." + rationale: "If this policy setting is enabled, a user with local access could use the well-known Administrator's SID to learn the real name of the built-in Administrator account, even if it has been renamed. That person could then use the account name to initiate a password guessing attack." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Allow anonymous SID/Name translation." + compliance: + - cis: ["2.3.10.1"] + condition: all + rules: + - 'c:powershell "$null = secedit /export /cfg $env:temp/secexport.cfg; $(gc $env:temp/secexport.cfg | Select-String \"LSAAnonymousNameLookup\").ToString().Split(\"=\")[1].Trim()" -> r:0' + + # 2.3.10.2 (L1) Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled' (MS only). (Automated) + - id: 27046 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled' (MS only)." + description: "This policy setting controls the ability of anonymous users to enumerate the accounts in the Security Accounts Manager (SAM). If you enable this policy setting, users with anonymous connections will not be able to enumerate domain account user names on the systems in your environment. This policy setting also allows additional restrictions on anonymous connections. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)." + impact: "None - this is the default behavior. It will be impossible to establish trusts with Windows NT 4.0-based domains. Also, client computers that run older versions of the Windows operating system such as Windows NT 3.51 and Windows 95 will experience problems when they try to use resources on the server." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts." + compliance: + - cis: ["2.3.10.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymousSAM -> 1' + + # 2.3.10.3 (L1) Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled' (MS only). (Automated) + - id: 27047 + title: "Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled' (MS only)." + description: "This policy setting controls the ability of anonymous users to enumerate SAM accounts as well as shares. If you enable this policy setting, anonymous users will not be able to enumerate domain account user names and network share names on the systems in your environment. The recommended state for this setting is: Enabled. Note: This policy has no effect on Domain Controllers." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)." + impact: "It will be impossible to establish trusts with Windows NT 4.0-based domains. Also, client computers that run older versions of the Windows operating system such as Windows NT 3.51 and Windows 95 will experience problems when they try to use resources on the server. Users who access file and print servers anonymously will be unable to list the shared network resources on those servers; the users will have to authenticate before they can view the lists of shared folders and printers. However, even with this policy setting enabled, anonymous users will have access to resources with permissions that explicitly include the built-in group, ANONYMOUS LOGON." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow anonymous enumeration of SAM accounts and shares." + compliance: + - cis: ["2.3.10.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RestrictAnonymous -> 1' + + # 2.3.10.4 (L2) Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'. (Automated) + - id: 27048 + title: "Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'." + description: "This policy setting determines whether Credential Manager (formerly called Stored User Names and Passwords) saves passwords or credentials for later use when it gains domain authentication. The recommended state for this setting is: Enabled. Note: Changes to this setting will not take effect until Windows is restarted." + rationale: "Passwords that are cached can be accessed by the user when logged on to the computer. Although this information may sound obvious, a problem can arise if the user unknowingly executes hostile code that reads the passwords and forwards them to another, unauthorized user." + impact: "Credential Manager will not store passwords and credentials on the computer. Users will be forced to enter passwords whenever they log on to their Passport account or other network resources that aren't accessible to their domain account. Testing has shown that clients running Windows Vista or Windows Server 2008 will be unable to connect to Distributed File System (DFS) shares in untrusted domains. Enabling this setting also makes it impossible to specify alternate credentials for scheduled tasks, this can cause a variety of problems. For example, some third-party backup products will no longer work. This policy setting should have no impact on users who access network resources that are configured to allow access with their Active Directory-based domain account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Do not allow storage of passwords and credentials for network authentication." + compliance: + - cis: ["2.3.10.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> DisableDomainCreds' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> DisableDomainCreds -> 1' + + # 2.3.10.5 (L1) Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'. (Automated) + - id: 27049 + title: "Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'." + description: "This policy setting determines what additional permissions are assigned for anonymous connections to the computer. The recommended state for this setting is: Disabled." + rationale: "An unauthorized user could anonymously list account names and shared resources and use the information to attempt to guess passwords, perform social engineering attacks, or launch DoS attacks." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Let Everyone permissions apply to anonymous users." + compliance: + - cis: ["2.3.10.5"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> EveryoneIncludesAnonymous -> 0' + + # 2.3.10.6 (L1) Configure 'Network access: Named Pipes that can be accessed anonymously' (DC only). (Automated) + - id: 27050 + title: "Configure 'Network access: Named Pipes that can be accessed anonymously' (DC only)." + description: "This policy setting determines which communication sessions, or pipes, will have attributes and permissions that allow anonymous access. The recommended state for this setting is: LSARPC, NETLOGON, SAMR and (when the legacy Computer Browser service is enabled) BROWSER. Note: A Member Server that holds the Remote Desktop Services Role with Remote Desktop Licensing Role Service will require a special exception to this recommendation, to allow the HydraLSPipe and TermServLicensing Named Pipes to be accessed anonymously." + rationale: "Limiting named pipes that can be accessed anonymously will reduce the attack surface of the system." + impact: "Null session access over named pipes will be disabled unless they are included, and applications that rely on this feature or on unauthenticated access to named pipes will no longer function. The BROWSER named pipe may need to be added to this list if the Computer Browser service is needed for supporting legacy components. The Computer Browser service is disabled by default." + remediation: "To establish the recommended configuration via GP, configure the following UI path: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Named Pipes that can be accessed anonymously." + compliance: + - cis: ["2.3.10.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:LSARPC' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:NETLOGON' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:SAMR' + + # 2.3.10.7 (L1) Configure 'Network access: Named Pipes that can be accessed anonymously' (MS only). (Automated) + - id: 27051 + title: "Configure 'Network access: Named Pipes that can be accessed anonymously' (MS only)." + description: "This policy setting determines which communication sessions, or pipes, will have attributes and permissions that allow anonymous access. The recommended state for this setting is: (i.e. None), or (when the legacy Computer Browser service is enabled) BROWSER. Note: A Member Server that holds the Remote Desktop Services Role with Remote Desktop Licensing Role Service will require a special exception to this recommendation, to allow the HydraLSPipe and TermServLicensing Named Pipes to be accessed anonymously." + rationale: "Limiting named pipes that can be accessed anonymously will reduce the attack surface of the system." + impact: "Null session access over named pipes will be disabled unless they are included, and applications that rely on this feature or on unauthenticated access to named pipes will no longer function. The BROWSER named pipe may need to be added to this list if the Computer Browser service is needed for supporting legacy components. The Computer Browser service is disabled by default." + remediation: "To establish the recommended configuration via GP, configure the following UI path: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Named Pipes that can be accessed anonymously." + compliance: + - cis: ["2.3.10.7"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionPipes -> r:\S+' + + # 2.3.10.8 (L1) Configure 'Network access: Remotely accessible registry paths' is configured. (Automated) + - id: 27052 + title: "Configure 'Network access: Remotely accessible registry paths' is configured." + description: "This policy setting determines which registry paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: This setting does not exist in Windows XP. There was a setting with that name in Windows XP, but it is called \"Network access: Remotely accessible registry paths and sub-paths\" in Windows Server 2003, Windows Vista, and Windows Server 2008 (non-R2). Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value. The recommended state for this setting is: System\\CurrentControlSet\\Control\\ProductOptions System\\CurrentControlSet\\Control\\Server Applications Software\\Microsoft\\Windows NT\\CurrentVersion." + rationale: "The registry is a database that contains computer configuration information, and much of the information is sensitive. An attacker could use this information to facilitate unauthorized activities. To reduce the risk of such an attack, suitable ACLs are assigned throughout the registry to help protect it from access by unauthorized users." + impact: "None - this is the default behavior. However, if you remove the default registry paths from the list of accessible ones, remote management tools such as the Microsoft Baseline Security Analyzer and Microsoft Systems Management Server could fail, as they require remote access to the registry to properly monitor and manage computers. Note: If you want to allow remote access, you must also enable the Remote Registry service." + remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\ProductOptions System\\CurrentControlSet\\Control\\Server Applications Software\\Microsoft\\Windows NT\\CurrentVersion Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Remotely accessible registry paths." + compliance: + - cis: ["2.3.10.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Print\\Printers' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Services\\Eventlog' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\OLAP Server' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Print' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\ContentIndex' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Services\\SysmonLog' + + # 2.3.10.9 (L1) Configure 'Network access: Remotely accessible registry paths and sub-paths' is configured. (Automated) + - id: 27053 + title: "Configure 'Network access: Remotely accessible registry paths and sub-paths' is configured." + description: "This policy setting determines which registry paths and sub-paths will be accessible over the network, regardless of the users or groups listed in the access control list (ACL) of the winreg registry key. Note: In Windows XP this setting is called \"Network access: Remotely accessible registry paths,\" the setting with that same name in Windows Vista, Windows Server 2008 (non-R2), and Windows Server 2003 does not exist in Windows XP. Note #2: When you configure this setting you specify a list of one or more objects. The delimiter used when entering the list is a line feed or carriage return, that is, type the first object on the list, press the Enter button, type the next object, press Enter again, etc. The setting value is stored as a comma-delimited list in group policy security templates. It is also rendered as a comma-delimited list in Group Policy Editor's display pane and the Resultant Set of Policy console. It is recorded in the registry as a line-feed delimited list in a REG_MULTI_SZ value. The recommended state for this setting is: System\\CurrentControlSet\\Control\\Print\\Printers System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex System\\CurrentControlSet\\Control\\Terminal Server System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib System\\CurrentControlSet\\Services\\SysmonLog The recommended state for servers that hold the Active Directory Certificate Services Role with Certification Authority Role Service includes the above list and: System\\CurrentControlSet\\Services\\CertSvc The recommended state for servers that have the WINS Server Feature installed includes the above list and: System\\CurrentControlSet\\Services\\WINS." + rationale: "The registry contains sensitive computer configuration information that could be used by an attacker to facilitate unauthorized activities. The fact that the default ACLs assigned throughout the registry are fairly restrictive and help to protect the registry from access by unauthorized users reduces the risk of such an attack." + impact: "None - this is the default behavior. However, if you remove the default registry paths from the list of accessible ones, remote management tools such as the Microsoft Baseline Security Analyzer and Microsoft Systems Management Server could fail, as they require remote access to the registry to properly monitor and manage computers. Note: If you want to allow remote access, you must also enable the Remote Registry service." + remediation: "To establish the recommended configuration via GP, set the following UI path to: System\\CurrentControlSet\\Control\\Print\\Printers System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex System\\CurrentControlSet\\Control\\Terminal Server System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib System\\CurrentControlSet\\Services\\SysmonLog Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Remotely accessible registry paths and sub-paths When a server holds the Active Directory Certificate Services Role with Certification Authority Role Service, the above list should also include: System\\CurrentControlSet\\Services\\CertSvc. When a server has the WINS Server Feature installed, the above list should also include: System\\CurrentControlSet\\Services\\WINS." + compliance: + - cis: ["2.3.10.9"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\SecurePipeServers\Winreg\AllowedPaths -> Machine -> r:System\\CurrentControlSet\\Control\\Print\\Printers System\\CurrentControlSet\\Services\\Eventlog Software\\Microsoft\\OLAP Server|Software\\Microsoft\\Windows NT\\CurrentVersion\\Print Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows System\\CurrentControlSet\\Control\\ContentIndex System\\CurrentControlSet\\Control\\Terminal Server System\\CurrentControlSet\\Control\\Terminal Server\\UserConfig System\\CurrentControlSet\\Control\\Terminal Server\\DefaultUserConfiguration Software\\Microsoft\\Windows NT\\CurrentVersion\\Perflib System\\CurrentControlSet\\Services\\SysmonLog' + + # 2.3.10.10 (L1) Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'. (Automated) + - id: 27054 + title: "Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'." + description: "When enabled, this policy setting restricts anonymous access to only those shares and pipes that are named in the Network access: Named pipes that can be accessed anonymously and Network access: Shares that can be accessed anonymously settings. This policy setting controls null session access to shares on your computers by adding RestrictNullSessAccess with the value 1 in the HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\LanManServer\\Parameters registry key. This registry value toggles null session shares on or off to control whether the server service restricts unauthenticated clients' access to named resources. The recommended state for this setting is: Enabled." + rationale: "Null sessions are a weakness that can be exploited through shares (including the default shares) on computers in your environment." + impact: "None - this is the default behavior. If you choose to enable this setting and are supporting Windows NT 4.0 domains, you should check if any of the named pipes are required to maintain trust relationships between the domains, and then add the pipe to the Network access: Named pipes that can be accessed anonymously list: - COMNAP: SNA session access - COMNODE: SNA session access - SQL\\QUERY: SQL instance access - SPOOLSS: Spooler service - LLSRPC: License Logging service - NETLOGON: Net Logon service - LSARPC: LSA access - SAMR: Remote access to SAM objects - BROWSER: Computer Browser service Previous to the release of Windows Server 2003 with Service Pack 1 (SP1) these named pipes were allowed anonymous access by default, but with the increased hardening in Windows Server 2003 with SP1 these pipes must be explicitly added if needed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict anonymous access to Named Pipes and Shares." + compliance: + - cis: ["2.3.10.10"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> RestrictNullSessAccess -> 1' + + # 2.3.10.11 (L1) Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow' (MS only). (Automated) + - id: 27055 + title: "Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow' (MS only)." + description: 'This policy setting allows you to restrict remote RPC connections to SAM. The recommended state for this setting is: Administrators: Remote Access: Allow. Note: A Windows 10 R1607, Server 2016 or newer OS is required to access and set this value in Group Policy. Note #2: This setting was originally only supported on Windows Server 2016 and newer, then support for it was added to Windows Server 2008 R2 and newer via the March 2017 security patches. Note #3: If your organization is using Azure Advanced Threat Protection (APT), the service account, "AATP Service" will need to be added to the recommendation configuration. For more information on adding the "AATP Service" account please see Configure SAM-R to enable lateral movement path detection in Microsoft Defender for Identity | Microsoft Docs.' + rationale: "To ensure that an unauthorized user cannot anonymously list local account names or groups and use the information to attempt to guess passwords or perform social engineering attacks. (Social engineering attacks try to deceive users in some way to obtain passwords or some form of security information.)." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Administrators: Remote Access: Allow: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Restrict clients allowed to make remote calls to SAM." + compliance: + - cis: ["2.3.10.11"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> restrictremotesam' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> restrictremotesam -> r:O:BAG:BAD:\(A;;RC;;;BA\)' + + # 2.3.10.12 (L1) Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'. (Automated) + - id: 27056 + title: "Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'." + description: "This policy setting determines which network shares can be accessed by anonymous users. The default configuration for this policy setting has little effect because all users have to be authenticated before they can access shared resources on the server. The recommended state for this setting is: (i.e. None)." + rationale: "It is very dangerous to allow any values in this setting. Any shares that are listed can be accessed by any network user, which could lead to the exposure or corruption of sensitive data." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to (i.e. None): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Shares that can be accessed anonymously." + compliance: + - cis: ["2.3.10.12"] + - cis_csc_v7: ["14.6"] + - iso_27001-2013: ["A.9.1.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters -> NullSessionShares -> r:\S+' + + # 2.3.10.13 (L1) Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'. (Automated) + - id: 27057 + title: "Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'." + description: "This policy setting determines how network logons that use local accounts are authenticated. The Classic option allows precise control over access to resources, including the ability to assign different types of access to different users for the same resource. The Guest only option allows you to treat all users equally. In this context, all users authenticate as Guest only to receive the same access level to a given resource. The recommended state for this setting is: Classic - local users authenticate as themselves. Note: This setting does not affect interactive logons that are performed remotely by using such services as Telnet or Remote Desktop Services (formerly called Terminal Services)." + rationale: "With the Guest only model, any user who can authenticate to your computer over the network does so with guest privileges, which probably means that they will not have write access to shared resources on that computer. Although this restriction does increase security, it makes it more difficult for authorized users to access shared resources on those computers because ACLs on those resources must include access control entries (ACEs) for the Guest account. With the Classic model, local accounts should be password protected. Otherwise, if Guest access is enabled, anyone can use those user accounts to access shared system resources." + impact: "None - this is the default configuration for domain-joined computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Classic - local users authenticate as themselves: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network access: Sharing and security model for local accounts." + compliance: + - cis: ["2.3.10.13"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> ForceGuest -> 0' + + # 2.3.11.1 (L1) Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'. (Automated) + - id: 27058 + title: "Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'." + description: "This policy setting determines whether Local System services that use Negotiate when reverting to NTLM authentication can use the computer identity. This policy is supported on at least Windows 7 or Windows Server 2008 R2. The recommended state for this setting is: Enabled." + rationale: "When connecting to computers running versions of Windows earlier than Windows Vista or Windows Server 2008 (non-R2), services running as Local System and using SPNEGO (Negotiate) that revert to NTLM use the computer identity. In Windows 7, if you are connecting to a computer running Windows Server 2008 or Windows Vista, then a system service uses either the computer identity or a NULL session. When connecting with a NULL session, a system-generated session key is created, which provides no protection but allows applications to sign and encrypt data without errors. When connecting with the computer identity, both signing and encryption is supported in order to provide data protection." + impact: "Services running as Local System that use Negotiate when reverting to NTLM authentication will use the computer identity. This might cause some authentication requests between Windows operating systems to fail and log an error." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow Local System to use computer identity for NTLM." + compliance: + - cis: ["2.3.11.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> UseMachineId' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> UseMachineId -> 1' + + # 2.3.11.2 (L1) Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'. (Automated) + - id: 27059 + title: "Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'." + description: "This policy setting determines whether NTLM is allowed to fall back to a NULL session when used with LocalSystem. The recommended state for this setting is: Disabled." + rationale: "NULL sessions are less secure because by definition they are unauthenticated." + impact: "Any applications that require NULL sessions for LocalSystem will not work as designed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Allow LocalSystem NULL session fallback." + compliance: + - cis: ["2.3.11.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> allownullsessionfallback -> 0' + + # 2.3.11.3 (L1) Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'. (Automated) + - id: 27060 + title: "Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'." + description: "This setting determines if online identities are able to authenticate to this computer. The Public Key Cryptography Based User-to-User (PKU2U) protocol introduced in Windows 7 and Windows Server 2008 R2 is implemented as a security support provider (SSP). The SSP enables peer-to-peer authentication, particularly through the Windows 7 media and file sharing feature called HomeGroup, which permits sharing between computers that are not members of a domain. With PKU2U, a new extension was introduced to the Negotiate authentication package, Spnego.dll. In previous versions of Windows, Negotiate decided whether to use Kerberos or NTLM for authentication. The extension SSP for Negotiate, Negoexts.dll, which is treated as an authentication protocol by Windows, supports Microsoft SSPs including PKU2U. When computers are configured to accept authentication requests by using online IDs, Negoexts.dll calls the PKU2U SSP on the computer that is used to log on. The PKU2U SSP obtains a local certificate and exchanges the policy between the peer computers. When validated on the peer computer, the certificate within the metadata is sent to the logon peer for validation and associates the user's certificate to a security token and the logon process completes. The recommended state for this setting is: Disabled." + rationale: "The PKU2U protocol is a peer-to-peer authentication protocol - authentication should be managed centrally in most managed networks." + impact: "None - this is the default configuration for domain-joined computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network Security: Allow PKU2U authentication requests to this computer to use online identities." + compliance: + - cis: ["2.3.11.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\pku2u -> AllowOnlineID -> 0' + + # 2.3.11.4 (L1) Ensure 'Network security: Configure encryption types allowed for Kerberos' is set to 'AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types' (Automated) + - id: 27061 + title: "Ensure 'Network security: Configure encryption types allowed for Kerberos' is set to 'AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types'." + description: "This policy setting allows you to set the encryption types that Kerberos is allowed to use. The recommended state for this setting is: AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types. Note: Some legacy applications and OSes may still require RC4_HMAC_MD5 - we recommend you test in your environment and verify whether you can safely remove it." + rationale: "The strength of each encryption algorithm varies from one to the next, choosing stronger algorithms will reduce the risk of compromise however doing so may cause issues when the computer attempts to authenticate with systems that do not support them." + remediation: "To establish the recommended configuration via GP, set the following UI path to AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Configure encryption types allowed for Kerberos." + compliance: + - cis: ["2.3.11.4"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4", "18.5"] + - cmmc_v2.0: ["AC.L2-3.1.17", "AC.L2-3.1.13", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.8", "SC.L2-3.13.15"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.13.1.1", "A.10.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\Kerberos\Parameters -> SupportedEncryptionTypes -> r:2147483644|2147483640' + + # 2.3.11.5 (L1) Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'. (Automated) + - id: 27062 + title: "Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'." + description: "This policy setting determines whether the LAN Manager (LM) hash value for the new password is stored when the password is changed. The LM hash is relatively weak and prone to attack compared to the cryptographically stronger Microsoft Windows NT hash. Since LM hashes are stored on the local computer in the security database, passwords can then be easily compromised if the database is attacked. Note: Older operating systems and some third-party applications may fail when this policy setting is enabled. Also, note that the password will need to be changed on all accounts after you enable this setting to gain the proper benefit. The recommended state for this setting is: Enabled." + rationale: "The SAM file can be targeted by attackers who seek access to username and password hashes. Such attacks use special tools to crack passwords, which can then be used to impersonate users and gain access to resources on your network. These types of attacks will not be prevented if you enable this policy setting, but it will be much more difficult for these types of attacks to succeed." + impact: "None - this is the default behavior. Earlier operating systems such as Windows 95, Windows 98, and Windows ME as well as some third-party applications will fail." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Do not store LAN Manager hash value on next password change." + compliance: + - cis: ["2.3.11.5"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> NoLMHash -> 1' + + # 2.3.11.6 (L1) Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'. (Manual) - Not Implemented + + # 2.3.11.7 (L1) Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'. (Automated) + - id: 27063 + title: "Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'." + description: "LAN Manager (LM) was a family of early Microsoft client/server software (predating Windows NT) that allowed users to link personal computers together on a single network. LM network capabilities included transparent file and print sharing, user security features, and network administration tools. In Active Directory domains, the Kerberos protocol is the default authentication protocol. However, if the Kerberos protocol is not negotiated for some reason, Active Directory will use LM, NTLM, or NTLMv2. LAN Manager authentication includes the LM, NTLM, and NTLM version 2 (NTLMv2) variants, and is the protocol that is used to authenticate all Windows clients when they perform the following operations: - Join a domain - Authenticate between Active Directory forests - Authenticate to down-level domains - Authenticate to computers that do not run Windows 2000, Windows Server 2003, or Windows XP - Authenticate to computers that are not in the domain The Network security: LAN Manager authentication level setting determines which challenge/response authentication protocol is used for network logons. This choice affects the level of authentication protocol used by clients, the level of session security negotiated, and the level of authentication accepted by servers. The recommended state for this setting is: Send NTLMv2 response only. Refuse LM & NTLM." + rationale: "Windows 2000 and Windows XP clients were configured by default to send LM and NTLM authentication responses (Windows 95-based and Windows 98-based clients only send LM). The default settings in OSes predating Windows Vista / Windows Server 2008 (non-R2) allowed all clients to authenticate with servers and use their resources. However, this meant that LM responses - the weakest form of authentication response - were sent over the network, and it was potentially possible for attackers to sniff that traffic to more easily reproduce the user's password. The Windows 95, Windows 98, and Windows NT operating systems cannot use the Kerberos version 5 protocol for authentication. For this reason, in a Windows Server 2003 domain, these computers authenticate by default with both the LM and NTLM protocols for network authentication. You can enforce a more secure authentication protocol for Windows 95, Windows 98, and Windows NT by using NTLMv2. For the logon process, NTLMv2 uses a secure channel to protect the authentication process. Even if you use NTLMv2 for older clients and servers, Windows-based clients and servers that are members of the domain will use the Kerberos authentication protocol to authenticate with Windows Server 2003 or newer Domain Controllers. For these reasons, it is strongly preferred to restrict the use of LM & NTLM (non-v2) as much as possible." + impact: "Clients use NTLMv2 authentication only and use NTLMv2 session security if the server supports it; Domain Controllers refuse LM and NTLM (accept only NTLMv2 authentication). Clients that do not support NTLMv2 authentication will not be able to authenticate in the domain and access domain resources by using LM and NTLM." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Send NTLMv2 response only. Refuse LM & NTLM: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LAN Manager authentication level." + compliance: + - cis: ["2.3.11.7"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["18.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa -> LmCompatibilityLevel -> 5' + + # 2.3.11.8 (L1) Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher. (Automated) + - id: 27064 + title: "Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher." + description: "This policy setting determines the level of data signing that is requested on behalf of clients that issue LDAP BIND requests. Note: This policy setting does not have any impact on LDAP simple bind (ldap_simple_bind) or LDAP simple bind through SSL (ldap_simple_bind_s). No Microsoft LDAP clients that are included with Windows XP Professional use ldap_simple_bind or ldap_simple_bind_s to communicate with a Domain Controller. The recommended state for this setting is: Negotiate signing. Configuring this setting to Require signing also conforms to the benchmark." + rationale: "Unsigned network traffic is susceptible to man-in-the-middle attacks in which an intruder captures the packets between the client and server, modifies them, and then forwards them to the server. For an LDAP server, this susceptibility means that an attacker could cause a server to make decisions that are based on false or altered data from the LDAP queries. To lower this risk in your network, you can implement strong physical security measures to protect the network infrastructure. Also, you can make all types of man-in-the-middle attacks extremely difficult if you require digital signatures on all network packets by means of IPsec authentication headers." + impact: "None - this is the default behavior. However, if you choose instead to configure the server to require LDAP signatures then you must also configure the client. If you do not configure the client it will not be able to communicate with the server, which could cause many features to fail, including user authentication, Group Policy, and logon scripts, because the caller will be told that the LDAP BIND command request failed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Negotiate signing (configuring to Require signing also conforms to the benchmark): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: LDAP client signing requirements." + compliance: + - cis: ["2.3.11.8"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["18.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LDAP -> LDAPClientIntegrity -> n:(\d+) compare >= 1' + + # 2.3.11.9 (L1) Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption' (Automated) + - id: 27065 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'." + description: "This policy setting determines which behaviors are allowed by clients for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable both options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. In other words, these options help protect against man-in-the-middle attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) clients." + compliance: + - cis: ["2.3.11.9"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["18.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NtlmMinClientSec' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NtlmMinClientSec -> 536870912' + + # 2.3.11.10 (L1) Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption' (Automated) + - id: 27066 + title: "Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'." + description: "This policy setting determines which behaviors are allowed by servers for applications using the NTLM Security Support Provider (SSP). The SSP Interface (SSPI) is used by applications that need authentication services. The setting does not modify how the authentication sequence works but instead require certain behaviors in applications that use the SSPI. The recommended state for this setting is: Require NTLMv2 session security, Require 128-bit encryption. Note: These values are dependent on the Network security: LAN Manager Authentication Level (Rule 2.3.11.7) security setting value." + rationale: "You can enable all of the options for this policy setting to help protect network traffic that uses the NTLM Security Support Provider (NTLM SSP) from being exposed or tampered with by an attacker who has gained access to the same network. That is, these options help protect against man-in-the-middle attacks." + remediation: "To establish the recommended configuration via GP, set the following UI path to Require NTLMv2 session security, Require 128-bit encryption: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Network security: Minimum session security for NTLM SSP based (including secure RPC) servers." + compliance: + - cis: ["2.3.11.10"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["18.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\MSV1_0 -> NTLMMinServerSec -> 537395200' + + # 2.3.13.1 (L1) Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled'. (Automated) + - id: 27067 + title: "Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled'." + description: "This policy setting determines whether a computer can be shut down when a user is not logged on. If this policy setting is enabled, the shutdown command is available on the Windows logon screen. It is recommended to disable this policy setting to restrict the ability to shut down the computer to users with credentials on the system. The recommended state for this setting is: Disabled. Note: In Server 2008 R2 and older versions, this setting had no impact on Remote Desktop (RDP) / Terminal Services sessions - it only affected the local console. However, Microsoft changed the behavior in Windows Server 2012 (non-R2) and above, where if set to Enabled, RDP sessions are also allowed to shut down or restart the server." + rationale: "Users who can access the console locally could shut down the computer. Attackers could also walk to the local console and restart the server, which would cause a temporary DoS condition. Attackers could also shut down the server and leave all of its applications and services unavailable. As noted in the Description above, the Denial of Service (DoS) risk of enabling this setting dramatically increases in Windows Server 2012 (non-R2) and above, as even remote users could then shut down or restart the server from the logon screen of an RDP session." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\Shutdown: Allow system to be shut down without having to log on." + compliance: + - cis: ["2.3.13.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> ShutdownWithoutLogon -> 0' + + # 2.3.15.1 (L1) Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'. (Automated) + - id: 27068 + title: "Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'." + description: "This policy setting determines whether case insensitivity is enforced for all subsystems. The Microsoft Win32 subsystem is case insensitive. However, the kernel supports case sensitivity for other subsystems, such as the Portable Operating System Interface for UNIX (POSIX). Because Windows is case insensitive (but the POSIX subsystem will support case sensitivity), failure to enforce this policy setting makes it possible for a user of the POSIX subsystem to create a file with the same name as another file by using mixed case to label it. Such a situation can block access to these files by another user who uses typical Win32 tools, because only one of the files will be available. The recommended state for this setting is: Enabled." + rationale: "Because Windows is case-insensitive but the POSIX subsystem will support case sensitivity, failure to enable this policy setting would make it possible for a user of that subsystem to create a file with the same name as another file but with a different mix of upper and lower case letters. Such a situation could potentially confuse users when they try to access such files from normal Win32 tools because only one of the files will be available." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Require case insensitivity for non-Windows subsystems." + compliance: + - cis: ["2.3.15.1"] + - cis_csc_v8: ["4.1", "5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - hipaa: ["164.312(a)(2)(i)"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2", "8.1", "8.1.1"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "12.5.2", "2.1.1", "2.2.1"] + - soc_2: ["CC6.1", "CC6.2", "CC6.3", "CC7.1", "CC8.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Kernel -> ObCaseInsensitive -> 1' + + # 2.3.15.2 (L1) Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'. (Automated) + - id: 27069 + title: "Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'." + description: "This policy setting determines the strength of the default discretionary access control list (DACL) for objects. Active Directory maintains a global list of shared system resources, such as DOS device names, mutexes, and semaphores. In this way, objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and what permissions are granted. The recommended state for this setting is: Enabled." + rationale: "This setting determines the strength of the default DACL for objects. Windows maintains a global list of shared computer resources so that objects can be located and shared among processes. Each type of object is created with a default DACL that specifies who can access the objects and with what permissions." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)." + compliance: + - cis: ["2.3.15.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager' + - 'not r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode' + - 'r:HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager -> ProtectionMode -> 1' + + # 2.3.17.1 (L1) Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'. (Automated) + - id: 27070 + title: "Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'." + description: "This policy setting controls the behavior of Admin Approval Mode for the built-in Administrator account. The recommended state for this setting is: Enabled." + rationale: 'One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. An attack vector for these programs was to discover the password of the account named "Administrator" because that user account was created for all installations of Windows. To address this risk, in Windows Vista or newer, the built-in Administrator account is now disabled by default. In a default installation of a new computer, accounts with administrative control over the computer are initially set up in one of two ways: - - If the computer is not joined to a domain, the first user account you create has the equivalent permissions as a local administrator. If the computer is joined to a domain, no local administrator accounts are created. The Enterprise or Domain Administrator must log on to the computer and create one if a local administrator account is warranted. Once Windows is installed, the built-in Administrator account may be manually enabled, but we strongly recommend that this account remain disabled.' + impact: "The built-in Administrator account uses Admin Approval Mode. Users that log on using the local Administrator account will be prompted for consent whenever a program requests an elevation in privilege, just like any other user would." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Admin Approval Mode for the Built-in Administrator account." + compliance: + - cis: ["2.3.17.1"] + - cis_csc_v7: ["4.3"] + - iso_27001-2013: ["A.9.2.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> FilterAdministratorToken -> 1' + + # 2.3.17.2 (L1) Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt + - id: 27071 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'." + description: "This policy setting controls the behavior of the elevation prompt for administrators. The recommended state for this setting is: Prompt for consent on the secure desktop." + rationale: "One of the risks that the UAC feature introduced with Windows Vista is trying to mitigate is that of malicious software running under elevated credentials without the user or administrator being aware of its activity. This setting raises awareness to the administrator of elevated privilege operations and permits the administrator to prevent a malicious program from elevating its privilege when the program attempts to do so." + remediation: "To establish the recommended configuration via GP, set the following UI path to Prompt for consent on the secure desktop: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode." + compliance: + - cis: ["2.3.17.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorAdmin -> r:^1$|^2$' + + # 2.3.17.3 (L1) Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'. (Automated) + - id: 27072 + title: "Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'." + description: "This policy setting controls the behavior of the elevation prompt for standard users. The recommended state for this setting is: Automatically deny elevation requests." + rationale: "One of the risks that the User Account Control feature introduced with Windows Vista is trying to mitigate is that of malicious programs running under elevated credentials without the user or administrator being aware of their activity. This setting raises awareness to the user that a program requires the use of elevated privilege operations and requires that the user be able to supply administrative credentials in order for the program to run." + impact: 'When an operation requires elevation of privilege, a configurable access denied error message is displayed. An enterprise that is running desktops as standard user may choose this setting to reduce help desk calls. Note: With this setting configured as recommended, the default error message displayed when a user attempts to perform an operation or run a program requiring privilege elevation (without Administrator rights) is "This program will not run. This program is blocked by group policy. For more information, contact your system administrator." Some users who are not used to seeing this message may believe that the operation or program they attempted to run is specifically blocked by group policy, as that is what the message seems to imply. This message may therefore result in user questions as to why that specific operation/program is blocked, when in fact, the problem is that they need to perform the operation or run the program with an Administrative account (or "Run as Administrator" if it is already an Administrator account), and they are not doing that.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Automatically deny elevation requests: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Behavior of the elevation prompt for standard users." + compliance: + - cis: ["2.3.17.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> ConsentPromptBehaviorUser -> 0' + + # 2.3.17.4 (L1) Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'. (Automated) + - id: 27073 + title: "Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'." + description: "This policy setting controls the behavior of application installation detection for the computer. The recommended state for this setting is: Enabled." + rationale: "Some malicious software will attempt to install itself after being given permission to run. For example, malicious software with a trusted application shell. The user may have given permission for the program to run because the program is trusted, but if they are then prompted for installation of an unknown component this provides another way of trapping the software before it can do damage." + impact: "When an application installation package is detected that requires elevation of privilege, the user is prompted to enter an administrative user name and password. If the user enters valid credentials, the operation continues with the applicable privilege." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Detect application installations and prompt for elevation." + compliance: + - cis: ["2.3.17.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableInstallerDetection -> 1' + + # 2.3.17.5 (L1) Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'. (Automated) + - id: 27074 + title: "Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'." + description: "This policy setting controls whether applications that request to run with a User Interface Accessibility (UIAccess) integrity level must reside in a secure location in the file system. Secure locations are limited to the following: - ...\\Program Files\\, including subfolders - ...\\Windows\\System32\\ - ...\\Program Files (x86)\\, including subfolders (for 64-bit versions of Windows) Note: Windows enforces a public key infrastructure (PKI) signature check on any interactive application that requests to run with a UIAccess integrity level regardless of the state of this security setting. The recommended state for this setting is: Enabled." + rationale: "UIAccess Integrity allows an application to bypass User Interface Privilege Isolation (UIPI) restrictions when an application is elevated in privilege from a standard user to an administrator. This is required to support accessibility features such as screen readers that are transmitting user interfaces to alternative forms. A process that is started with UIAccess rights has the following abilities: - To set the foreground window. - To drive any application window using SendInput function. - To use read input for all integrity levels using low-level hooks, raw input, GetKeyState, GetAsyncKeyState, and GetKeyboardInput. - To set journal hooks. - To uses AttachThreadInput to attach a thread to a higher integrity input queue." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Only elevate UIAccess applications that are installed in secure locations." + compliance: + - cis: ["2.3.17.5"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableSecureUIAPaths -> 1' + + # 2.3.17.6 (L1) Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'. (Automated) + - id: 27075 + title: "Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'." + description: "This policy setting controls the behavior of all User Account Control (UAC) policy settings for the computer. If you change this policy setting, you must restart your computer. The recommended state for this setting is: Enabled. Note: If this policy setting is disabled, the Security Center notifies you that the overall security of the operating system has been reduced." + rationale: "This is the setting that turns on or off UAC. If this setting is disabled, UAC will not be used and any security benefits and risk mitigations that are dependent on UAC will not be present on the system." + impact: "None - this is the default behavior. Users and administrators will need to learn to work with UAC prompts and adjust their work habits to use least privilege operations." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Run all administrators in Admin Approval Mode." + compliance: + - cis: ["2.3.17.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableLUA -> 1' + + # 2.3.17.7 (L1) Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'. (Automated) + - id: 27076 + title: "Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'." + description: "This policy setting controls whether the elevation request prompt is displayed on the interactive user's desktop or the secure desktop. The recommended state for this setting is: Enabled." + rationale: "Standard elevation prompt dialog boxes can be spoofed, which may cause users to disclose their passwords to malicious software. The secure desktop presents a very distinct appearance when prompting for elevation, where the user desktop dims, and the elevation prompt UI is more prominent. This increases the likelihood that users who become accustomed to the secure desktop will recognize a spoofed elevation prompt dialog box and not fall for the trick." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Switch to the secure desktop when prompting for elevation." + compliance: + - cis: ["2.3.17.7"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> PromptOnSecureDesktop -> 1' + + # 2.3.17.8 (L1) Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'. (Automated) + - id: 27077 + title: "Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'." + description: "This policy setting controls whether application write failures are redirected to defined registry and file system locations. This policy setting mitigates applications that run as administrator and write run-time application data to: - %ProgramFiles% - %windir% - %windir%\\System32 - HKEY_LOCAL_MACHINE\\SOFTWARE The recommended state for this setting is: Enabled." + rationale: "This setting reduces vulnerabilities by ensuring that legacy applications only write data to permitted locations." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Local Policies\\Security Options\\User Account Control: Virtualize file and registry write failures to per-user locations." + compliance: + - cis: ["2.3.17.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization' + - 'r:HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System -> EnableVirtualization -> 1' + + # 5.1 (L1) Ensure 'Print Spooler (Spooler)' is set to 'Disabled' (DC only). (Automated) + - id: 27078 + title: "Ensure 'Print Spooler (Spooler)' is set to 'Disabled' (DC only)." + description: "This service spools print jobs and handles interaction with printers. The recommended state for this setting is: Disabled." + rationale: "Disabling the Print Spooler (Spooler) service mitigates the PrintNightmare vulnerability (CVE-2021-34527) and other attacks against the service." + impact: "Domain Controllers will not be able to prune published printers from Active Directory. By default, Domain Controllers prune printer objects from Active Directory if the computer that published them doesn't respond to contact requests. Domain Controllers will not be able to act as a print server, sharing printers for clients. Applications on and users logged in at Domain Controllers will not be able to print, including printing to files (such as Adobe Portable Document Format (PDF)) which uses the Print Spooler service." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Print Spooler." + references: + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527" + compliance: + - cis: ["5.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler -> Start -> 4' + + # 5.2 (L2) Ensure 'Print Spooler (Spooler)' is set to 'Disabled' (MS only). (Automated) + - id: 27079 + title: "Ensure 'Print Spooler (Spooler)' is set to 'Disabled' (MS only)." + description: "This service spools print jobs and handles interaction with printers. The recommended state for this setting is: Disabled." + rationale: "Disabling the Print Spooler (Spooler) service mitigates the PrintNightmare vulnerability (CVE-2021-34527) and other attacks against the service." + impact: "Member Servers will not be able to act as a print server, sharing printers for clients. Applications on and users logged in to Member Servers will not be able to print, including printing to files (such as Adobe Portable Document Format (PDF)) which uses the Print Spooler service." + remediation: "To establish the recommended configuration via GP, set the following UI path to: Disabled: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\System Services\\Print Spooler." + references: + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527" + compliance: + - cis: ["5.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler -> Start -> 4' + + # 9.1.1 (L1) Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)'. (Automated) + - id: 27080 + title: "Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)'." + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Firewall state." + compliance: + - cis: ["9.1.1"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> EnableFirewall -> 1' + + # 9.1.2 (L1) Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)'. (Automated) + - id: 27081 + title: "Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)'." + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Inbound connections." + compliance: + - cis: ["9.1.2"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultInboundAction -> 1' + + # 9.1.3 (L1) Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)'. (Automated) + - id: 27082 + title: "Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)'." + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default)." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Outbound connections." + compliance: + - cis: ["9.1.3"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DefaultOutboundAction -> 0' + + # 9.1.4 (L1) Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'. (Automated) + - id: 27083 + title: "Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'." + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + impact: "Windows Firewall will not display a notification when a program is blocked from receiving inbound connections." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.1.4"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile -> DisableNotifications -> 1' + + # 9.1.5 (L1) Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SystemRoot%\System32\logfiles\firewall\domainfw.log'. (Automated) + - id: 27084 + title: "Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SystemRoot%\\System32\\logfiles\\firewall\\domainfw.log'." + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SystemRoot%\\System32\\logfiles\\firewall\\domainfw.log." + rationale: "If Windows Firewall events are not recorded it may be difficult or impossible for Administrators to analyze system issues or unauthorized activities of malicious users. Microsoft stores all firewall events as one file on the system (pfirewall.log). To improve logging, separate each firewall profile (domain, private, public) into its own distinct log file (domainfw.log, privatefw.log, publicfw.log) for better organization and identification of specific issues within each profile." + impact: "The log file will be stored in the specified file." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SystemRoot%\\System32\\logfiles\\firewall\\domainfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Name." + compliance: + - cis: ["9.1.5"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\domainfw.log' + + # 9.1.6 (L1) Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16,384 KB or greater'. (Automated) + - id: 27085 + title: "Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16,384 KB or greater'." + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "The log file size will be limited to the specified size, old events will be overwritten by newer ones when the limit is reached." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.1.6"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + # 9.1.7 (L1) Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'. (Automated) + - id: 27086 + title: "Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Information about dropped packets will be recorded in the firewall log file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.1.7"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogDroppedPackets -> 1' + + # 9.1.8 (L1) Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'. (Automated) + - id: 27087 + title: "Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Information about successful connections will be recorded in the firewall log file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Domain Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.1.8"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging -> LogSuccessfulConnections -> 1' + + # 9.2.1 (L1) Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)'. (Automated) + - id: 27088 + title: "Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)'." + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Firewall state." + compliance: + - cis: ["9.2.1"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> EnableFirewall -> 1' + + # 9.2.2 (L1) Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)'. (Automated) + - id: 27089 + title: "Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)'." + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Inbound connections." + compliance: + - cis: ["9.2.2"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultInboundAction -> 1' + + # 9.2.3 (L1) Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)'. (Automated) + - id: 27090 + title: "Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)'." + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Outbound connections." + compliance: + - cis: ["9.2.3"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DefaultOutboundAction -> 0' + + # 9.2.4 (L1) Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'. (Automated) + - id: 27091 + title: "Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'." + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "Firewall notifications can be complex and may confuse the end users, who would not be able to address the alert." + impact: "Windows Firewall will not display a notification when a program is blocked from receiving inbound connections." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.2.4"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile -> DisableNotifications -> 1' + + # 9.2.5 (L1) Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SystemRoot%\System32\logfiles\firewall\privatefw.log'. (Automated) + - id: 27092 + title: "Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SystemRoot%\\System32\\logfiles\\firewall\\privatefw.log'." + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SystemRoot%\\System32\\logfiles\\firewall\\privatefw.log." + rationale: "If Windows Firewall events are not recorded it may be difficult or impossible for Administrators to analyze system issues or unauthorized activities of malicious users. Microsoft stores all firewall events as one file on the system (pfirewall.log). To improve logging, separate each firewall profile (domain, private, public) into its own distinct log file (domainfw.log, privatefw.log, publicfw.log) for better organization and identification of specific issues within each profile." + impact: "The log file will be stored in the specified file." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SystemRoot%\\System32\\logfiles\\firewall\\privatefw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Name." + compliance: + - cis: ["9.2.5"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\privatefw.log' + + # 9.2.6 (L1) Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16,384 KB or greater'. (Automated) + - id: 27093 + title: "Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16,384 KB or greater'." + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "The log file size will be limited to the specified size, old events will be overwritten by newer ones when the limit is reached." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.2.6"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + # 9.2.7 (L1) Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'. (Automated) + - id: 27094 + title: "Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Information about dropped packets will be recorded in the firewall log file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.2.7"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogDroppedPackets -> 1' + + # 9.2.8 (L1) Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes'. (Automated) + - id: 27095 + title: "Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Information about successful connections will be recorded in the firewall log file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Private Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.2.8"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging -> LogSuccessfulConnections -> 1' + + # 9.3.1 (L1) Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'. (Automated) + - id: 27096 + title: "Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'." + description: "Select On (recommended) to have Windows Firewall with Advanced Security use the settings for this profile to filter network traffic. If you select Off, Windows Firewall with Advanced Security will not use any of the firewall rules or connection security rules for this profile. The recommended state for this setting is: On (recommended)." + rationale: "If the firewall is turned off all traffic will be able to access the system and an attacker may be more easily able to remotely exploit a weakness in a network service." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to On (recommended): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Firewall state." + compliance: + - cis: ["9.3.1"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> EnableFirewall -> 1' + + # 9.3.2 (L1) Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)'. (Automated) + - id: 27097 + title: "Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)'." + description: "This setting determines the behavior for inbound connections that do not match an inbound firewall rule. The recommended state for this setting is: Block (default)." + rationale: "If the firewall allows all traffic to access the system then an attacker may be more easily able to remotely exploit a weakness in a network service." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Block (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Inbound connections." + compliance: + - cis: ["9.3.2"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultInboundAction -> 1' + + # 9.3.3 (L1) Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)'. (Automated) + - id: 27098 + title: "Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)'." + description: "This setting determines the behavior for outbound connections that do not match an outbound firewall rule. The recommended state for this setting is: Allow (default). Note: If you set Outbound connections to Block and then deploy the firewall policy by using a GPO, computers that receive the GPO settings cannot receive subsequent Group Policy updates unless you create and deploy an outbound rule that enables Group Policy to work. Predefined rules for Core Networking include outbound rules that enable Group Policy to work. Ensure that these outbound rules are active, and thoroughly test firewall profiles before deploying." + rationale: "Some people believe that it is prudent to block all outbound connections except those specifically approved by the user or administrator. Microsoft disagrees with this opinion, blocking outbound connections by default will force users to deal with a large number of dialog boxes prompting them to authorize or block applications such as their web browser or instant messaging software. Additionally, blocking outbound traffic has little value because if an attacker has compromised the system they can reconfigure the firewall anyway." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Allow (default): Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Outbound connections." + compliance: + - cis: ["9.3.3"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DefaultOutboundAction -> 0' + + # 9.3.4 (L1) Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No'. (Automated) + - id: 27099 + title: "Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No'." + description: "Select this option to have Windows Firewall with Advanced Security display notifications to the user when a program is blocked from receiving inbound connections. The recommended state for this setting is: No." + rationale: "Some organizations may prefer to avoid alarming users when firewall rules block certain types of network activity. However, notifications can be helpful when troubleshooting network issues involving the firewall." + impact: "Windows Firewall will not display a notification when a program is blocked from receiving inbound connections." + remediation: "To establish the recommended configuration via GP, set the following UI path to 'No': Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Display a notification." + compliance: + - cis: ["9.3.4"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> DisableNotifications -> 1' + + # 9.3.5 (L1) Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'. (Automated) + - id: 27100 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'." + description: "This setting controls whether local administrators are allowed to create local firewall rules that apply together with firewall rules configured by Group Policy. The recommended state for this setting is: No. Note: When the Apply local firewall rules setting is configured to No, it's recommended to also configure the Display a notification setting to No. Otherwise, users will continue to receive messages that ask if they want to unblock a restricted inbound connection, but the user's response will be ignored." + rationale: "When in the Public profile, there should be no special local firewall exceptions per computer. These settings should be managed by a centralized policy." + impact: "Administrators can still create firewall rules, but the rules will not be applied." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local firewall rules." + compliance: + - cis: ["9.3.5"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalPolicyMerge -> 0' + + # 9.3.6 (L1) Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'. (Automated) + - id: 27101 + title: "Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'." + description: "This setting controls whether local administrators are allowed to create connection security rules that apply together with connection security rules configured by Group Policy. The recommended state for this setting is: No." + rationale: "Users with administrative privileges might create firewall rules that expose the system to remote attack." + impact: "Administrators can still create local connection security rules, but the rules will not be applied." + remediation: "To establish the recommended configuration via GP, set the following UI path to No: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Settings Customize\\Apply local connection security rules." + compliance: + - cis: ["9.3.6"] + - cis_csc_v8: ["4.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4"] + - pci_dss_v4.0: ["1.2.1"] + - soc_2: ["CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile -> AllowLocalIPsecPolicyMerge -> 0' + + # 9.3.7 (L1) Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SystemRoot%\System32\logfiles\firewall\publicfw.log'. (Automated) + - id: 27102 + title: "Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SystemRoot%\\System32\\logfiles\\firewall\\publicfw.log'." + description: "Use this option to specify the path and name of the file in which Windows Firewall will write its log information. The recommended state for this setting is: %SystemRoot%\\System32\\logfiles\\firewall\\publicfw.log." + rationale: "If Windows Firewall events are not recorded it may be difficult or impossible for Administrators to analyze system issues or unauthorized activities of malicious users. Microsoft stores all firewall events as one file on the system (pfirewall.log). To improve logging, separate each firewall profile (domain, private, public) into its own distinct log file (domainfw.log, privatefw.log, publicfw.log) for better organization and identification of specific issues within each profile." + impact: "The log file will be stored in the specified file." + remediation: "To establish the recommended configuration via GP, set the following UI path to %SystemRoot%\\System32\\logfiles\\firewall\\publicfw.log: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Name." + compliance: + - cis: ["9.3.7"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFilePath -> r:System32\\logfiles\\firewall\\publicfw.log' + + # 9.3.8 (L1) Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16,384 KB or greater'. (Automated) + - id: 27103 + title: "Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16,384 KB or greater'." + description: "Use this option to specify the size limit of the file in which Windows Firewall will write its log information. The recommended state for this setting is: 16,384 KB or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "The log file size will be limited to the specified size, old events will be overwritten by newer ones when the limit is reached." + remediation: "To establish the recommended configuration via GP, set the following UI path to 16,384 KB or greater: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Size limit (KB)." + compliance: + - cis: ["9.3.8"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogFileSize -> n:^(\d+) compare >= 16384' + + # 9.3.9 (L1) Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'. (Automated) + - id: 27104 + title: "Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security discards an inbound packet for any reason. The log records why and when the packet was dropped. Look for entries with the word DROP in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Information about dropped packets will be recorded in the firewall log file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log dropped packets." + compliance: + - cis: ["9.3.9"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogDroppedPackets -> 1' + + # 9.3.10 (L1) Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'. (Automated) + - id: 27105 + title: "Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'." + description: "Use this option to log when Windows Firewall with Advanced Security allows an inbound connection. The log records why and when the connection was formed. Look for entries with the word ALLOW in the action column of the log. The recommended state for this setting is: Yes." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Information about successful connections will be recorded in the firewall log file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Yes: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Windows Firewall with Advanced Security\\Windows Firewall with Advanced Security\\Windows Firewall Properties\\Public Profile\\Logging Customize\\Log successful connections." + compliance: + - cis: ["9.3.10"] + - cis_csc_v8: ["4.5", "8.5"] + - cis_csc_v7: ["9.4", "11.2"] + - cmmc_v2.0: ["AC.L1-3.1.20", "AU.L2-3.3.1", "CM.L2-3.4.7", "SC.L1-3.13.1", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7", "SC-7(5)"] + - pci_dss_v3.2.1: ["1.1.4", "1.4", "10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["1.2.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC6.6", "CC7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging -> LogSuccessfulConnections -> 1' + + # 17.1.1 (L1) Ensure 'Audit Credential Validation' is set to 'Success and Failure'. (Automated) + - id: 27106 + title: "Ensure 'Audit Credential Validation' is set to 'Success and Failure'." + description: "This subcategory reports the results of validation tests on credentials submitted for a user account logon request. These events occur on the computer that is authoritative for the credentials. For domain accounts, the Domain Controller is authoritative, whereas for local accounts, the local computer is authoritative. In domain environments, most of the Account Logon events occur in the Security log of the Domain Controllers that are authoritative for the domain accounts. However, these events can occur on other computers in the organization when local accounts are used to log on. Events for this subcategory include: - 4774: An account was mapped for logon. - 4775: An account could not be mapped for logon. - 4776: The Domain Controller attempted to validate the credentials for an account. - 4777: The Domain Controller failed to validate the credentials for an account. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Logon\\Audit Credential Validation." + compliance: + - cis: ["17.1.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.12"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Credential Validation" -> r:Success and Failure' + + # 17.1.2 (L1) Ensure 'Audit Kerberos Authentication Service' is set to 'Success and Failure' (DC Only). (Automated) + - id: 27107 + title: "Ensure 'Audit Kerberos Authentication Service' is set to 'Success and Failure' (DC Only)." + description: "This subcategory reports the results of events generated after a Kerberos authentication TGT request. Kerberos is a distributed authentication service that allows a client running on behalf of a user to prove its identity to a server without sending data across the network. This helps mitigate an attacker or server from impersonating a user. - 4768: A Kerberos authentication ticket (TGT) was requested. - 4771: Kerberos pre-authentication failed. - 4772: A Kerberos authentication ticket request failed. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Logon\\Audit Kerberos Authentication Service." + compliance: + - cis: ["17.1.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Kerberos Authentication Service" -> r:Success and Failure' + + # 17.1.3 (L1) Ensure 'Audit Kerberos Service Ticket Operations' is set to 'Success and Failure' (DC Only). (Automated) + - id: 27108 + title: "Ensure 'Audit Kerberos Service Ticket Operations' is set to 'Success and Failure' (DC Only)." + description: "This subcategory reports the results of events generated by Kerberos authentication ticket-granting ticket (TGT) requests. Kerberos Service Ticket requests (TGS requests) occur as part of service use and access requests by specific accounts. Auditing these events will record the IP address from which the account requested TGS, when TGS was requested, and which encryption type was used. - 4769: A Kerberos service ticket was requested. - 4770: A Kerberos service ticket was renewed. - 4773: A Kerberos service ticket request failed. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Logon\\Audit Kerberos Service Ticket Operations." + compliance: + - cis: ["17.1.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Kerberos Service Ticket Operations" -> r:Success and Failure' + + # 17.2.1 (L1) Ensure 'Audit Application Group Management' is set to 'Success and Failure'. (Automated) + - id: 27109 + title: "Ensure 'Audit Application Group Management' is set to 'Success and Failure'." + description: "This policy setting allows you to audit events generated by changes to application groups such as the following: - Application group is created, changed, or deleted. - Member is added or removed from an application group. Application groups are utilized by Windows Authorization Manager, which is a flexible framework created by Microsoft for integrating role-based access control (RBAC) into applications. More information on Windows Authorization Manager is available at MSDN - Windows Authorization Manager. The recommended state for this setting is: Success and Failure." + rationale: "Auditing events in this category may be useful when investigating an incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Application Group Management." + compliance: + - cis: ["17.2.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Application Group Management" -> r:Success and Failure' + + # 17.2.2 (L1) Ensure 'Audit Computer Account Management' is set to include 'Success' (DC only). (Automated) + - id: 27110 + title: "Ensure 'Audit Computer Account Management' is set to include 'Success' (DC only)." + description: "This subcategory reports each event of computer account management, such as when a computer account is created, changed, deleted, renamed, disabled, or enabled. Events for this subcategory include: - 4741: A computer account was created. - 4742: A computer account was changed. - 4743: A computer account was deleted. The recommended state for this setting is to include: Success." + rationale: "Auditing events in this category may be useful when investigating an incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Computer Account Management." + compliance: + - cis: ["17.2.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Computer Account Management" -> r:Success' + + # 17.2.3 (L1) Ensure 'Audit Distribution Group Management' is set to include 'Success' (DC only). (Automated) + - id: 27111 + title: "Ensure 'Audit Distribution Group Management' is set to include 'Success' (DC only)." + description: "This subcategory reports each event of distribution group management, such as when a distribution group is created, changed, or deleted or when a member is added to or removed from a distribution group. If you enable this Audit policy setting, administrators can track events to detect malicious, accidental, and authorized creation of group accounts. Events for this subcategory include: - 4744: A security-disabled local group was created. - 4745: A security-disabled local group was changed. - 4746: A member was added to a security-disabled local group. - 4747: A member was removed from a security-disabled local group. - 4748: A security-disabled local group was deleted. - 4749: A security-disabled global group was created. - 4750: A security-disabled global group was changed. - 4751: A member was added to a security-disabled global group. - 4752: A member was removed from a security-disabled global group. - 4753: A security-disabled global group was deleted. - 4759: A security-disabled universal group was created. - 4760: A security-disabled universal group was changed. - 4761: A member was added to a security-disabled universal group. - 4762: A member was removed from a security-disabled universal group. - 4763: A security-disabled universal group was deleted. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may provide an organization with insight when investigating an incident. For example, when a given unauthorized user was added to a sensitive distribution group." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Distribution Group Management." + compliance: + - cis: ["17.2.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Distribution Group Management" -> r:Success' + + # 17.2.4 (L1) Ensure 'Audit Other Account Management Events' is set to include 'Success' (DC only). (Automated) + - id: 27112 + title: "Ensure 'Audit Other Account Management Events' is set to include 'Success' (DC only)." + description: "This subcategory reports other account management events. Events for this subcategory include: - 4782: The password hash an account was accessed. - 4793: The Password Policy Checking API was called. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Other Account Management Events." + compliance: + - cis: ["17.2.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Other Account Management Events" -> r:Success' + + # 17.2.5 (L1) Ensure 'Audit Security Group Management' is set to include 'Success'. (Automated) + - id: 27113 + title: "Ensure 'Audit Security Group Management' is set to include 'Success'." + description: "This subcategory reports each event of security group management, such as when a security group is created, changed, or deleted or when a member is added to or removed from a security group. If you enable this Audit policy setting, administrators can track events to detect malicious, accidental, and authorized creation of security group accounts. Events for this subcategory include: - 4727: A security-enabled global group was created. - 4728: A member was added to a security-enabled global group. - 4729: A member was removed from a security-enabled global group. - 4730: A security-enabled global group was deleted. - 4731: A security-enabled local group was created. - 4732: A member was added to a security-enabled local group. - 4733: A member was removed from a security-enabled local group. - 4734: A security-enabled local group was deleted. - 4735: A security-enabled local group was changed. - 4737: A security-enabled global group was changed. - 4754: A security-enabled universal group was created. - 4755: A security-enabled universal group was changed. - 4756: A member was added to a security-enabled universal group. - 4757: A member was removed from a security-enabled universal group. - 4758: A security-enabled universal group was deleted. - 4764: A group's type was changed. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit Security Group Management." + compliance: + - cis: ["17.2.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.6"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1", "A.9.2.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Security Group Management" -> r:Success' + + # 17.2.6 (L1) Ensure 'Audit User Account Management' is set to 'Success and Failure'. (Automated) + - id: 27114 + title: "Ensure 'Audit User Account Management' is set to 'Success and Failure'." + description: "This subcategory reports each event of user account management, such as when a user account is created, changed, or deleted; a user account is renamed, disabled, or enabled; or a password is set or changed. If you enable this Audit policy setting, administrators can track events to detect malicious, accidental, and authorized creation of user accounts. Events for this subcategory include: - 4720: A user account was created. - 4722: A user account was enabled. - 4723: An attempt was made to change an account's password. - 4724: An attempt was made to reset an account's password. - 4725: A user account was disabled. - 4726: A user account was deleted. - 4738: A user account was changed. - 4740: A user account was locked out. - 4765: SID History was added to an account. - 4766: An attempt to add SID History to an account failed. - 4767: A user account was unlocked. - 4780: The ACL was set on accounts which are members of administrators groups. - 4781: The name of an account was changed: - 4794: An attempt was made to set the Directory Services Restore Mode. - 5376: Credential Manager credentials were backed up. - 5377: Credential Manager credentials were restored from a backup. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Account Management\\Audit User Account Management." + compliance: + - cis: ["17.2.6"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"User Account Management" -> r:Success and Failure' + + # 17.3.1 (L1) Ensure 'Audit PNP Activity' is set to include 'Success'. (Automated) + - id: 27115 + title: "Ensure 'Audit PNP Activity' is set to include 'Success'." + description: "This policy setting allows you to audit when plug and play detects an external device. The recommended state for this setting is to include: Success. Note: A Windows 10, Server 2016 or newer OS is required to access and set this value in Group Policy." + rationale: "Enabling this setting will allow a user to audit events when a device is plugged into a system. This can help alert IT staff if unapproved devices are plugged in." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Detailed Tracking\\Audit PNP Activity." + compliance: + - cis: ["17.3.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Plug and Play Events" -> r:Success' + + # 17.3.2 (L1) Ensure 'Audit Process Creation' is set to include 'Success'. (Automated) + - id: 27116 + title: "Ensure 'Audit Process Creation' is set to include 'Success'." + description: "This subcategory reports the creation of a process and the name of the program or user that created it. Events for this subcategory include: - 4688: A new process has been created. - 4696: A primary token was assigned to process. Refer to Microsoft Knowledge Base article 947226: Description of security events in Windows Vista and in Windows Server 2008 for the most recent information about this setting. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Detailed Tracking\\Audit Process Creation." + compliance: + - cis: ["17.3.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Process Creation" -> r:Success' + + # 17.4.1 (L1) Ensure 'Audit Directory Service Access' is set to include 'Failure' (DC only). (Automated) + - id: 27117 + title: "Ensure 'Audit Directory Service Access' is set to include 'Failure' (DC only)." + description: "This subcategory reports when an AD DS object is accessed. Only objects with SACLs cause audit events to be generated, and only when they are accessed in a manner that matches their SACL. These events are similar to the directory service access events in previous versions of Windows Server. This subcategory applies only to Domain Controllers. Events for this subcategory include: - 4662 : An operation was performed on an object. The recommended state for this setting is to include: Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\DS Access\\Audit Directory Service Access." + compliance: + - cis: ["17.4.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Directory Service Access" -> r:Failure' + + # 17.4.2 (L1) Ensure 'Audit Directory Service Changes' is set to include 'Success' (DC only). (Automated) + - id: 27118 + title: "Ensure 'Audit Directory Service Changes' is set to include 'Success' (DC only)." + description: "This subcategory reports changes to objects in Active Directory Domain Services (AD DS). The types of changes that are reported are create, modify, move, and undelete operations that are performed on an object. DS Change auditing, where appropriate, indicates the old and new values of the changed properties of the objects that were changed. Only objects with SACLs cause audit events to be generated, and only when they are accessed in a manner that matches their SACL. Some objects and properties do not cause audit events to be generated due to settings on the object class in the schema. This subcategory applies only to Domain Controllers. Events for this subcategory include: - 5136 : A directory service object was modified. - 5137 : A directory service object was created. - 5138 : A directory service object was undeleted. - 5139 : A directory service object was moved. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\DS Access\\Audit Directory Service Changes." + compliance: + - cis: ["17.4.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Directory Service Changes" -> r:Success' + + # 17.5.1 (L1) Ensure 'Audit Account Lockout' is set to include 'Failure'. (Automated) + - id: 27119 + title: "Ensure 'Audit Account Lockout' is set to include 'Failure'." + description: "This subcategory reports when a user's account is locked out as a result of too many failed logon attempts. Events for this subcategory include: - 4625: An account failed to log on. The recommended state for this setting is to include: Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Account Lockout." + compliance: + - cis: ["17.5.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.6"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1", "A.9.2.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Account Lockout" -> r:Failure' + + # 17.5.2 (L1) Ensure 'Audit Group Membership' is set to include 'Success'. (Automated) + - id: 27120 + title: "Ensure 'Audit Group Membership' is set to include 'Success'." + description: "This policy allows you to audit the group membership information in the user's logon token. Events in this subcategory are generated on the computer on which a logon session is created. For an interactive logon, the security audit event is generated on the computer that the user logged on to. For a network logon, such as accessing a shared folder on the network, the security audit event is generated on the computer hosting the resource. The recommended state for this setting is to include: Success. Note: A Windows 10, Server 2016 or newer OS is required to access and set this value in Group Policy." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Group Membership." + compliance: + - cis: ["17.5.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Group Membership" -> r:Success' + + # 17.5.3 (L1) Ensure 'Audit Logoff' is set to include 'Success'. (Automated) + - id: 27121 + title: "Ensure 'Audit Logoff' is set to include 'Success'." + description: "This subcategory reports when a user logs off from the system. These events occur on the accessed computer. For interactive logons, the generation of these events occurs on the computer that is logged on to. If a network logon takes place to access a share, these events generate on the computer that hosts the accessed resource. If you configure this setting to No auditing, it is difficult or impossible to determine which user has accessed or attempted to access organization computers. Events for this subcategory include: - 4634: An account was logged off. - 4647: User initiated logoff. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Logoff." + compliance: + - cis: ["17.5.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Logoff" -> r:Success' + + # 17.5.4 (L1) Ensure 'Audit Logon' is set to 'Success and Failure'. (Automated) + - id: 27122 + title: "Ensure 'Audit Logon' is set to 'Success and Failure'." + description: "This subcategory reports when a user attempts to log on to the system. These events occur on the accessed computer. For interactive logons, the generation of these events occurs on the computer that is logged on to. If a network logon takes place to access a share, these events generate on the computer that hosts the accessed resource. If you configure this setting to No auditing, it is difficult or impossible to determine which user has accessed or attempted to access organization computers. Events for this subcategory include: - 4624: An account was successfully logged on. - 4625: An account failed to log on. - 4648: A logon was attempted using explicit credentials. - 4675: SIDs were filtered. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Logon." + compliance: + - cis: ["17.5.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Logon" -> r:Success and Failure' + + # 17.5.5 (L1) Ensure 'Audit Other Logon/Logoff Events' is set to 'Success and Failure'. (Automated) + - id: 27123 + title: "Ensure 'Audit Other Logon/Logoff Events' is set to 'Success and Failure'." + description: "This subcategory reports other logon/logoff-related events, such as Remote Desktop Services session disconnects and reconnects, using RunAs to run processes under a different account, and locking and unlocking a workstation. Events for this subcategory include: - 4649: A replay attack was detected. - 4778: A session was reconnected to a Window Station. - 4779: A session was disconnected from a Window Station. - 4800: The workstation was locked. - 4801: The workstation was unlocked. - 4802: The screen saver was invoked. - 4803: The screen saver was dismissed. - 5378: The requested credentials delegation was disallowed by policy. - 5632: A request was made to authenticate to a wireless network. - 5633: A request was made to authenticate to a wired network. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Other Logon/Logoff Events." + compliance: + - cis: ["17.5.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Other Logon/Logoff Events" -> r:Success and Failure' + + # 17.5.6 (L1) Ensure 'Audit Special Logon' is set to include 'Success'. (Automated) + - id: 27124 + title: "Ensure 'Audit Special Logon' is set to include 'Success'." + description: "This subcategory reports when a special logon is used. A special logon is a logon that has administrator-equivalent privileges and can be used to elevate a process to a higher level. Events for this subcategory include: - 4964 : Special groups have been assigned to a new logon. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Logon/Logoff\\Audit Special Logon." + compliance: + - cis: ["17.5.6"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3", "16.13"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Special Logon" -> r:Success' + + # 17.6.1 (L1) Ensure 'Audit Detailed File Share' is set to include 'Failure'. (Automated) + - id: 27125 + title: "Ensure 'Audit Detailed File Share' is set to include 'Failure'." + description: "This subcategory allows you to audit attempts to access files and folders on a shared folder. Events for this subcategory include: - 5145: network share object was checked to see whether client can be granted desired access. The recommended state for this setting is to include: Failure." + rationale: "Auditing the Failures will log which unauthorized users attempted (and failed) to get access to a file or folder on a network share on this computer, which could possibly be an indication of malicious intent." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit Detailed File Share." + compliance: + - cis: ["17.6.1"] + - cis_csc_v8: ["3.3", "8.5"] + - cis_csc_v7: ["6.3", "14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1", "A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "7.1", "9.4.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Detailed File Share" -> r:Failure' + + # 17.6.2 (L1) Ensure 'Audit File Share' is set to 'Success and Failure'. (Automated) + - id: 27126 + title: "Ensure 'Audit File Share' is set to 'Success and Failure'." + description: "This policy setting allows you to audit attempts to access a shared folder. The recommended state for this setting is: Success and Failure. Note: There are no system access control lists (SACLs) for shared folders. If this policy setting is enabled, access to all shared folders on the system is audited." + rationale: "In an enterprise managed environment, it's important to track deletion, creation, modification, and access events for network shares. Any unusual file sharing activity may be useful in an investigation of potentially malicious activity." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit File Share." + compliance: + - cis: ["17.6.2"] + - cis_csc_v8: ["3.3", "8.5"] + - cis_csc_v7: ["6.3", "14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "AU.L2-3.3.1", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.12.4.1", "A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6", "AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3", "7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "7.1", "9.4.5"] + - soc_2: ["CC5.2", "CC6.1", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"File Share" -> r:Success and Failure' + + # 17.6.3 (L1) Ensure 'Audit Other Object Access Events' is set to 'Success and Failure'. (Automated) + - id: 27127 + title: "Ensure 'Audit Other Object Access Events' is set to 'Success and Failure'." + description: "This policy setting allows you to audit events generated by the management of task scheduler jobs or COM+ objects. For scheduler jobs, the following are audited: - Job created. - Job deleted. - Job enabled. - Job disabled. - Job updated. For COM+ objects, the following are audited: - Catalog object added. - Catalog object updated. - Catalog object deleted. The recommended state for this setting is: Success and Failure." + rationale: "The unexpected creation of scheduled tasks and COM+ objects could potentially be an indication of malicious activity. Since these types of actions are generally low volume, it may be useful to capture them in the audit logs for use during an investigation." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit Other Object Access Events." + compliance: + - cis: ["17.6.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Other Object Access Events" -> r:Success and Failure' + + # 17.6.4 (L1) Ensure 'Audit Removable Storage' is set to 'Success and Failure'. (Automated) + - id: 27128 + title: "Ensure 'Audit Removable Storage' is set to 'Success and Failure'." + description: "This policy setting allows you to audit user attempts to access file system objects on a removable storage device. A security audit event is generated only for all objects for all types of access requested. If you configure this policy setting, an audit event is generated each time an account accesses a file system object on a removable storage. Success audits record successful attempts and Failure audits record unsuccessful attempts. If you do not configure this policy setting, no audit event is generated when an account accesses a file system object on a removable storage. The recommended state for this setting is: Success and Failure. Note: A Windows 8.0, Server 2012 (non-R2) or newer OS is required to access and set this value in Group Policy." + rationale: "Auditing removable storage may be useful when investigating an incident. For example, if an individual is suspected of copying sensitive information onto a USB drive." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Object Access\\Audit Removable Storage." + compliance: + - cis: ["17.6.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Removable Storage" -> r:Success and Failure' + + # 17.7.1 (L1) Ensure 'Audit Audit Policy Change' is set to include 'Success'. (Automated) + - id: 27129 + title: "Ensure 'Audit Audit Policy Change' is set to include 'Success'." + description: "This subcategory reports changes in audit policy including SACL changes. Events for this subcategory include: - 4715: The audit policy (SACL) on an object was changed. - 4719: System audit policy was changed. - 4902: The Per-user audit policy table was created. - 4904: An attempt was made to register a security event source. - 4905: An attempt was made to unregister a security event source. - 4906: The CrashOnAuditFail value has changed. - 4907: Auditing settings on object were changed. - 4908: Special Groups Logon table modified. - 4912: Per User Audit Policy was changed. The recommended state for this setting is include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Audit Policy Change." + compliance: + - cis: ["17.7.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2", "A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Audit Policy Change" -> r:Success' + + # 17.7.2 (L1) Ensure 'Audit Authentication Policy Change' is set to include 'Success'. (Automated) + - id: 27130 + title: "Ensure 'Audit Authentication Policy Change' is set to include 'Success'." + description: "This subcategory reports changes in authentication policy. Events for this subcategory include: - 4706: A new trust was created to a domain. - 4707: A trust to a domain was removed. - 4713: Kerberos policy was changed. - 4716: Trusted domain information was modified. - 4717: System security access was granted to an account. - 4718: System security access was removed from an account. - 4739: Domain Policy was changed. - 4864: A namespace collision was detected. - 4865: A trusted forest information entry was added. - 4866: A trusted forest information entry was removed. - 4867: A trusted forest information entry was modified. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Authentication Policy Change." + compliance: + - cis: ["17.7.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2", "A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Authentication Policy Change" -> r:Success' + + # 17.7.3 (L1) Ensure 'Audit Authorization Policy Change' is set to include 'Success'. (Automated) + - id: 27131 + title: "Ensure 'Audit Authorization Policy Change' is set to include 'Success'." + description: "This subcategory reports changes in authorization policy. Events for this subcategory include: - 4703: A user right was adjusted. - 4704: A user right was assigned. - 4705: A user right was removed. - 4670: Permissions on an object were changed. - 4911: Resource attributes of the object were changed. - 4913: Central Access Policy on the object was changed. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Authorization Policy Change." + compliance: + - cis: ["17.7.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["5.5", "6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.1.2", "A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Authorization Policy Change" -> r:Success' + + # 17.7.4 (L1) Ensure 'Audit MPSSVC Rule-Level Policy Change' is set to 'Success and Failure'. (Automated) + - id: 27132 + title: "Ensure 'Audit MPSSVC Rule-Level Policy Change' is set to 'Success and Failure'." + description: "This subcategory determines whether the operating system generates audit events when changes are made to policy rules for the Microsoft Protection Service (MPSSVC.exe). Events for this subcategory include: - 4944: The following policy was active when the Windows Firewall started. - 4945: A rule was listed when the Windows Firewall started. - 4946: A change has been made to Windows Firewall exception list. A rule was added. - 4947: A change has been made to Windows Firewall exception list. A rule was modified. - 4948: A change has been made to Windows Firewall exception list. A rule was deleted. - 4949: Windows Firewall settings were restored to the default values. - 4950: A Windows Firewall setting has changed. - 4951: A rule has been ignored because its major version number was not recognized by Windows Firewall. - 4952: Parts of a rule have been ignored because its minor version number was not recognized by Windows Firewall. The other parts of the rule will be enforced. - 4953: A rule has been ignored by Windows Firewall because it could not parse the rule. - 4954: Windows Firewall Group Policy settings have changed. The new settings have been applied. - 4956: Windows Firewall has changed the active profile. - 4957: Windows Firewall did not apply the following rule. - 4958: Windows Firewall did not apply the following rule because the rule referred to items not configured on this computer. The recommended state for this setting is: Success and Failure." + rationale: "Changes to firewall rules are important for understanding the security state of the computer and how well it is protected against network attacks." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit MPSSVC Rule-Level Policy Change." + compliance: + - cis: ["17.7.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"MPSSVC Rule-Level Policy Change" -> r:Success and Failure' + + # 17.7.5 (L1) Ensure 'Audit Other Policy Change Events' is set to include 'Failure'. (Automated) + - id: 27133 + title: "Ensure 'Audit Other Policy Change Events' is set to include 'Failure'." + description: "This subcategory contains events about EFS Data Recovery Agent policy changes, changes in Windows Filtering Platform filter, status on Security policy settings updates for local Group Policy settings, Central Access Policy changes, and detailed troubleshooting events for Cryptographic Next Generation (CNG) operations. - 5063: A cryptographic provider operation was attempted. - 5064: A cryptographic context operation was attempted. - 5065: A cryptographic context modification was attempted. - 5066: A cryptographic function operation was attempted. - 5067: A cryptographic function modification was attempted. - 5068: A cryptographic function provider operation was attempted. - 5069: A cryptographic function property operation was attempted. - 5070: A cryptographic function property modification was attempted. - 6145: One or more errors occurred while processing security policy in the group policy objects. The recommended state for this setting is to include: Failure." + rationale: "This setting can help detect errors in applied Security settings which came from Group Policy, and failure events related to Cryptographic Next Generation (CNG) functions." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Policy Change\\Audit Other Policy Change Events." + compliance: + - cis: ["17.7.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Other Policy Change Events" -> r:Failure' + + # 17.8.1 (L1) Ensure 'Audit Sensitive Privilege Use' is set to 'Success and Failure'. (Automated) + - id: 27134 + title: "Ensure 'Audit Sensitive Privilege Use' is set to 'Success and Failure'." + description: "This subcategory reports when a user account or service uses a sensitive privilege. A sensitive privilege includes the following user rights: - Act as part of the operating system - Back up files and directories - Create a token object - Debug programs - Enable computer and user accounts to be trusted for delegation - Generate security audits - - Load and unload device drivers - Manage auditing and security log - Modify firmware environment values - Replace a process-level token - Restore files and directories - Take ownership of files or other objects Impersonate a client after authentication Auditing this subcategory will create a high volume of events. Events for this subcategory include: - 4672: Special privileges assigned to new logon. - 4673: A privileged service was called. - 4674: An operation was attempted on a privileged object. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\Privilege Use\\Audit Sensitive Privilege Use." + compliance: + - cis: ["17.8.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Sensitive Privilege Use" -> r:Success and Failure' + + # 17.9.1 (L1) Ensure 'Audit IPsec Driver' is set to 'Success and Failure'. (Automated) + - id: 27135 + title: "Ensure 'Audit IPsec Driver' is set to 'Success and Failure'." + description: "This subcategory reports on the activities of the Internet Protocol security (IPsec) driver. Events for this subcategory include: - 4960: IPsec dropped an inbound packet that failed an integrity check. If this problem persists, it could indicate a network issue or that packets are being modified in transit to this computer. Verify that the packets sent from the remote computer are the same as those received by this computer. This error might also indicate interoperability problems with other IPsec implementations. - 4961: IPsec dropped an inbound packet that failed a replay check. If this problem persists, it could indicate a replay attack against this computer. - 4962: IPsec dropped an inbound packet that failed a replay check. The inbound packet had too low a sequence number to ensure it was not a replay. - 4963: IPsec dropped an inbound clear text packet that should have been secured. This is usually due to the remote computer changing its IPsec policy without informing this computer. This could also be a spoofing attack attempt. - 4965: IPsec received a packet from a remote computer with an incorrect Security Parameter Index (SPI). This is usually caused by malfunctioning hardware that is corrupting packets. If these errors persist, verify that the packets sent from the remote computer are the same as those received by this computer. This error may also indicate interoperability problems with other IPsec implementations. In that case, if connectivity is not impeded, then these events can be ignored. - 5478: IPsec Services has started successfully. - 5479: IPsec Services has been shut down successfully. The shutdown of IPsec Services can put the computer at greater risk of network attack or expose the computer to potential security risks. - 5480: IPsec Services failed to get the complete list of network interfaces on the computer. This poses a potential security risk because some of the network interfaces may not get the protection provided by the applied IPsec filters. Use the IP Security Monitor snap-in to diagnose the problem. - 5483: IPsec Services failed to initialize RPC server. IPsec Services could not be started. - 5484: IPsec Services has experienced a critical failure and has been shut down. The shutdown of IPsec Services can put the computer at greater risk of network attack or expose the computer to potential security risks. - 5485: IPsec Services failed to process some IPsec filters on a plug-and-play event for network interfaces. This poses a potential security risk because some of the network interfaces may not get the protection provided by the applied IPsec filters. Use the IP Security Monitor snap-in to diagnose the problem. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit IPsec Driver." + compliance: + - cis: ["17.9.1"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"IPsec Driver" -> r:Success and Failure' + + # 17.9.2 (L1) Ensure 'Audit Other System Events' is set to 'Success and Failure'. (Automated) + - id: 27136 + title: "Ensure 'Audit Other System Events' is set to 'Success and Failure'." + description: "This subcategory reports on other system events. Events for this subcategory include: - 5024 : The Windows Firewall Service has started successfully. - 5025 : The Windows Firewall Service has been stopped. - 5027 : The Windows Firewall Service was unable to retrieve the security policy from the local storage. The service will continue enforcing the current policy. - 5028 : The Windows Firewall Service was unable to parse the new security policy. The service will continue with currently enforced policy. - 5029: The Windows Firewall Service failed to initialize the driver. The service will continue to enforce the current policy. - 5030: The Windows Firewall Service failed to start. - 5032: Windows Firewall was unable to notify the user that it blocked an application from accepting incoming connections on the network. - 5033 : The Windows Firewall Driver has started successfully. - 5034 : The Windows Firewall Driver has been stopped. - 5035 : The Windows Firewall Driver failed to start. - 5037 : The Windows Firewall Driver detected critical runtime error. Terminating. - 5058: Key file operation. - 5059: Key migration operation. The recommended state for this setting is: Success and Failure." + rationale: "Capturing these audit events may be useful for identifying when the Windows Firewall is not performing as expected." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit Other System Events." + compliance: + - cis: ["17.9.2"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Other System Events" -> r:Success and Failure' + + # 17.9.3 (L1) Ensure 'Audit Security State Change' is set to include 'Success'. (Automated) + - id: 27137 + title: "Ensure 'Audit Security State Change' is set to include 'Success'." + description: "This subcategory reports changes in security state of the system, such as when the security subsystem starts and stops. Events for this subcategory include: - 4608: Windows is starting up. - 4609: Windows is shutting down. - 4616: The system time was changed. - 4621: Administrator recovered system from CrashOnAuditFail. Users who are not administrators will now be allowed to log on. Some auditable activity might not have been recorded. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit Security State Change." + compliance: + - cis: ["17.9.3"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Security State Change" -> r:Success' + + # 17.9.4 (L1) Ensure 'Audit Security System Extension' is set to include 'Success'. (Automated) + - id: 27138 + title: "Ensure 'Audit Security System Extension' is set to include 'Success'." + description: "This subcategory reports the loading of extension code such as authentication packages by the security subsystem. Events for this subcategory include: - 4610: An authentication package has been loaded by the Local Security Authority. - 4611: A trusted logon process has been registered with the Local Security Authority. - 4614: A notification package has been loaded by the Security Account Manager. - 4622: A security package has been loaded by the Local Security Authority. - 4697: A service was installed in the system. The recommended state for this setting is to include: Success." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to include Success: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit Security System Extension." + compliance: + - cis: ["17.9.4"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"Security System Extension" -> r:Success' + + # 17.9.5 (L1) Ensure 'Audit System Integrity' is set to 'Success and Failure'. (Automated) + - id: 27139 + title: "Ensure 'Audit System Integrity' is set to 'Success and Failure'." + description: "This subcategory reports on violations of integrity of the security subsystem. Events for this subcategory include: - 4612 : Internal resources allocated for the queuing of audit messages have been exhausted, leading to the loss of some audits. - 4615 : Invalid use of LPC port. - 4618 : A monitored security event pattern has occurred. - 4816 : RPC detected an integrity violation while decrypting an incoming message. - 5038 : Code integrity determined that the image hash of a file is not valid. The file could be corrupt due to unauthorized modification or the invalid hash could indicate a potential disk device error. - 5056: A cryptographic self test was performed. - 5057: A cryptographic primitive operation failed. - 5060: Verification operation failed. - 5061: Cryptographic operation. - 5062: A kernel-mode cryptographic self test was performed. The recommended state for this setting is: Success and Failure." + rationale: "Auditing these events may be useful when investigating a security incident." + impact: "If no audit settings are configured, or if audit settings are too lax on the computers in your organization, security incidents might not be detected or not enough evidence will be available for network forensic analysis after security incidents occur. However, if audit settings are too severe, critically important entries in the Security log may be obscured by all of the meaningless entries and computer performance and the available amount of data storage may be seriously affected. Companies that operate in certain regulated industries may have legal obligations to log certain events or activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Success and Failure: Computer Configuration\\Policies\\Windows Settings\\Security Settings\\Advanced Audit Policy Configuration\\Audit Policies\\System\\Audit System Integrity." + compliance: + - cis: ["17.9.5"] + - cis_csc_v8: ["8.5"] + - cis_csc_v7: ["6.3"] + - cmmc_v2.0: ["AU.L2-3.3.1"] + - iso_27001-2013: ["A.12.4.1"] + - nist_sp_800-53: ["AU-3(1)", "AU-7"] + - pci_dss_v3.2.1: ["10.1", "10.2.2", "10.2.4", "10.2.5", "10.3"] + - pci_dss_v4.0: ["10.2", "10.2.1", "10.2.1.2", "10.2.1.5", "9.4.5"] + - soc_2: ["CC5.2", "CC7.2"] + condition: all + rules: + - 'c:auditpol.exe /get /subcategory:"System Integrity" -> r:Success and Failure' + + # 18.1.1.1 (L1) Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'. (Automated) + - id: 27140 + title: "Ensure 'Prevent enabling lock screen camera' is set to 'Enabled'." + description: "Disables the lock screen camera toggle switch in PC Settings and prevents a camera from being invoked on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen camera extends the protection afforded by the lock screen to camera features." + impact: "If you enable this setting, users will no longer be able to enable or disable lock screen camera access in PC Settings, and the camera cannot be invoked on the lock screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen camera Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenCamera -> 1' + + # 18.1.1.2 (L1) Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'. (Automated) + - id: 27141 + title: "Ensure 'Prevent enabling lock screen slide show' is set to 'Enabled'." + description: "Disables the lock screen slide show settings in PC Settings and prevents a slide show from playing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "Disabling the lock screen slide show extends the protection afforded by the lock screen to slide show contents." + impact: "If you enable this setting, users will no longer be able to modify slide show settings in PC Settings, and no slide show will ever start." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Personalization\\Prevent enabling lock screen slide show Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanelDisplay.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.1.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Personalization -> NoLockScreenSlideshow -> 1' + + # 18.1.2.2 (L1) Ensure 'Allow users to enable online speech recognition services' is set to 'Disabled'. (Automated) + - id: 27142 + title: "Ensure 'Allow users to enable online speech recognition services' is set to 'Disabled'." + description: "This policy enables the automatic learning component of input personalization that includes speech, inking, and typing. Automatic learning enables the collection of speech and handwriting patterns, typing history, contacts, and recent calendar information. It is required for the use of Cortana. Some of this collected information may be stored on the user's OneDrive, in the case of inking and typing; some of the information will be uploaded to Microsoft to personalize speech. The recommended state for this setting is: Disabled." + rationale: "If this setting is Enabled sensitive information could be stored in the cloud or sent to Microsoft." + impact: "Automatic learning of speech, inking, and typing stops and users cannot change its value via PC Settings." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Regional and Language Options\\Allow users to enable online speech recognition services Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow input personalization, but it was renamed to Allow users to enable online speech recognition services starting with the Windows 10 R1809 & Server 2019 Administrative Templates." + compliance: + - cis: ["18.1.2.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization -> AllowInputPersonalization' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization -> AllowInputPersonalization -> 0' + + # 18.1.3 (L2) Ensure 'Allow Online Tips' is set to 'Disabled'. (Automated) + - id: 27143 + title: "Ensure 'Allow Online Tips' is set to 'Disabled'." + description: "This policy setting configures the retrieval of online tips and help for the Settings app. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any third-party since this data could contain sensitive information." + impact: "Settings will not contact Microsoft content services to retrieve tips and help content." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Control Panel\\Allow Online Tips Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ControlPanel.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.1.3"] + - cis_csc_v7: ["9.2", "9.3"] + - iso_27001-2013: ["A.13.1.1", "A.13.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> AllowOnlineTips' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> AllowOnlineTips -> 0' + + # 18.3.1 (L1) Ensure LAPS AdmPwd GPO Extension / CSE is installed (MS only). (Automated) + - id: 27144 + title: "Ensure LAPS AdmPwd GPO Extension / CSE is installed (MS only)." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. Note: Organizations that utilize third-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + impact: "No impact. When installed and registered properly, AdmPwd.dll takes no action unless given appropriate GPO commands during Group Policy refresh. It is not a memory-resident agent or service. In a disaster recovery scenario where Active Directory is not available, the local Administrator password will not be retrievable and a local password reset using a tool (such as Microsoft's Disaster and Recovery Toolset (DaRT) Recovery Image) may be necessary." + remediation: "In order to utilize LAPS, a minor Active Directory Schema update is required, and a Group Policy Client Side Extension (CSE) must be installed on each managed computer. When LAPS is installed, the file AdmPwd.dll must be present in the following location and registered in Windows (the LAPS AdmPwd GPO Extension / CSE installation does this for you): C:\\Program Files\\LAPS\\CSE\\AdmPwd.dll." + compliance: + - cis: ["18.3.1"] + - cis_csc_v8: ["5.2", "5.4"] + - cis_csc_v7: ["4.4", "16.2"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "IA.L2-3.5.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA} -> DllName' + + # 18.3.2 (L1) Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled' (MS only). (Automated) + - id: 27145 + title: "Ensure 'Do not allow password expiration time longer than required by policy' is set to 'Enabled' (MS only)." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize third-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + impact: 'Planned password expiration longer than password age dictated by "Password Settings" policy is NOT allowed.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Do not allow password expiration time longer than required by policy Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.3.2"] + - cis_csc_v7: ["16.10"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PwdExpirationProtectionEnabled -> 1' + + # 18.3.3 (L1) Ensure 'Enable Local Admin Password Management' is set to 'Enabled' (MS only). (Automated) + - id: 27146 + title: "Ensure 'Enable Local Admin Password Management' is set to 'Enabled' (MS only)." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + impact: "The local administrator password is managed (provided that the LAPS AdmPwd GPO Extension / CSE is installed on the target computer (see recommendation Ensure LAPS AdmPwd GPO Extension / CSE is installed), the Active Directory domain schema and account permissions have been properly configured on the domain). In a disaster recovery scenario where Active Directory is not available, the local Administrator password will not be retrievable and a local password reset using a tool (such as Microsoft's Disaster and Recovery Toolset (DaRT) Recovery Image) may be necessary." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Enable Local Admin Password Management Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.3.3"] + - cis_csc_v8: ["5.2", "5.4"] + - cis_csc_v7: ["4.4", "16.2"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "IA.L2-3.5.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.4.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> AdmPwdEnabled -> 1' + + # 18.3.4 (L1) Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters' (MS only). (Automated) + - id: 27147 + title: "Ensure 'Password Settings: Password Complexity' is set to 'Enabled: Large letters + small letters + numbers + special characters' (MS only)." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: Large letters + small letters + numbers + special characters. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + impact: "LAPS-generated passwords will be required to contain large letters + small letters + numbers + special characters." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Complexity option to Large letters + small letters + numbers + special characters: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.3.4"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordComplexity -> 4' + + # 18.3.5 (L1) Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more' (MS only). (Automated) + - id: 27148 + title: "Ensure 'Password Settings: Password Length' is set to 'Enabled: 15 or more' (MS only)." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 15 or more. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + impact: "LAPS-generated passwords will be required to have a length of 15 characters (or more, if selected)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Length option to 15 or more: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.3.5"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["4.4"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - iso_27001-2013: ["A.9.4.3"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordLength -> n:^(\d+) compare >= 15' + + # 18.3.6 (L1) Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer' (MS only). (Automated) + - id: 27149 + title: "Ensure 'Password Settings: Password Age (Days)' is set to 'Enabled: 30 or fewer' (MS only)." + description: "In May 2015, Microsoft released the Local Administrator Password Solution (LAPS) tool, which is free and supported software that allows an organization to automatically set randomized and unique local Administrator account passwords on domain-attached workstations and Member Servers. The passwords are stored in a confidential attribute of the domain computer account and can be retrieved from Active Directory by approved Sysadmins when needed. The LAPS tool requires a small Active Directory Schema update in order to implement, as well as installation of a Group Policy Client Side Extension (CSE) on targeted computers. Please see the LAPS documentation for details. LAPS supports Windows Vista or newer workstation OSes, and Server 2003 or newer server OSes. LAPS does not support standalone computers - they must be joined to a domain. The recommended state for this setting is: Enabled: 30 or fewer. Note: Organizations that utilize 3rd-party commercial software to manage unique & complex local Administrator passwords on domain members may opt to disregard these LAPS recommendations. Note #2: LAPS is only designed to manage local Administrator passwords, and is therefore not recommended (or supported) for use directly on Domain Controllers, which do not have a traditional local Administrator account. We strongly encourage you to only deploy the LAPS CSE and LAPS GPO settings to member servers and workstations." + rationale: "Due to the difficulty in managing local Administrator passwords, many organizations choose to use the same password on all workstations and/or Member Servers when deploying them. This creates a serious attack surface security risk because if an attacker manages to compromise one system and learn the password to its local Administrator account, then they can leverage that account to instantly gain access to all other computers that also use that password for their local Administrator account." + impact: "LAPS-generated passwords will be required to have a maximum age of 30 days (or fewer, if selected)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, and configure the Password Age (Days) option to 30 or fewer: Computer Configuration\\Policies\\Administrative Templates\\LAPS\\Password Settings Note: This Group Policy path does not exist by default. An additional Group Policy template (AdmPwd.admx/adml) is required - it is included with Microsoft Local Administrator Password Solution (LAPS)." + compliance: + - cis: ["18.3.6"] + - cis_csc_v8: ["5.2"] + - cis_csc_v7: ["16.10"] + - cmmc_v2.0: ["IA.L2-3.5.7"] + - pci_dss_v4.0: ["2.2.2", "8.3.5", "8.3.6", "8.6.3"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft Services\AdmPwd -> PasswordAgeDays -> n:^(\d+) compare <= 30' + + # 18.4.1 (L1) Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled' (MS only). (Automated) + - id: 27150 + title: "Ensure 'Apply UAC restrictions to local accounts on network logons' is set to 'Enabled' (MS only)." + description: 'This setting controls whether local accounts can be used for remote administration via network logon (e.g., NET USE, connecting to C$, etc.). Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Enabling this policy significantly reduces that risk. Enabled: Applies UAC token-filtering to local accounts on network logons. Membership in powerful group such as Administrators is disabled and powerful privileges are removed from the resulting access token. This configures the LocalAccountTokenFilterPolicy registry value to 0. This is the default behavior for Windows. Disabled: Allows local accounts to have full administrative rights when authenticating via network logon, by configuring the LocalAccountTokenFilterPolicy registry value to 1. For more information about local accounts and credential theft, review the "Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques" documents. For more information about LocalAccountTokenFilterPolicy, see Microsoft Knowledge Base article 951016: Description of User Account Control and remote restrictions in Windows Vista. The recommended state for this setting is: Enabled.' + rationale: "Local accounts are at high risk for credential theft when the same account and password is configured on multiple systems. Ensuring this policy is Enabled significantly reduces that risk." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Apply UAC restrictions to local accounts on network logons Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link." + compliance: + - cis: ["18.4.1"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> LocalAccountTokenFilterPolicy -> 0' + + # 18.4.2 (L1) Ensure 'Configure RPC packet level privacy setting for incoming connections' is set to 'Enabled'. (Automated) + - id: 27151 + title: "Ensure 'Configure RPC packet level privacy setting for incoming connections' is set to 'Enabled'." + description: "This policy setting controls packet level privacy for Remote Procedure Call (RPC) incoming connections. The recommended state for this setting is: Enabled." + rationale: "A security bypass vulnerability (CVE-2021-1678 | Windows Print Spooler Spoofing Vulnerability) exists in the way the Printer RPC binding handles authentication for the remote Winspool interface. Enabling the RPC packet level privacy setting for incoming connections enforces the server-side to increase the authentication level to minimize this vulnerability." + impact: "None - this is default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure RPC packet level privacy setting for incoming connections Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link." + references: + - "https://support.microsoft.com/en-us/topic/managing-deployment-of-printer-rpc-binding-changes-for-cve-2021-1678-kb4599464-12a69652-30b9-3d61-d9f7-7201623a8b25" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-1678" + compliance: + - cis: ["18.4.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print -> RpcAuthnLevelPrivacyEnabled' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Print -> RpcAuthnLevelPrivacyEnabled -> 1' + + # 18.4.3 (L1) Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver (recommended)'. (Automated) + - id: 27152 + title: "Ensure 'Configure SMB v1 client driver' is set to 'Enabled: Disable driver (recommended)'." + description: "This setting configures the start type for the Server Message Block version 1 (SMBv1) client driver service (MRxSmb10), which is recommended to be disabled. The recommended state for this setting is: Enabled: Disable driver (recommended). Note: Do not, under any circumstances, configure this overall setting as Disabled, as doing so will delete the underlying registry entry altogether, which will cause serious problems." + rationale: 'Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3. More information on this can be found at the following links: Stop using SMB1 | Storage at Microsoft Disable SMB v1 in Managed Environments with Group Policy - "Stay Safe" Cyber Security Blog Disabling SMBv1 through Group Policy - Microsoft Security Guidance blog.' + impact: "Some legacy OSes (e.g. Windows XP, Server 2003 or older), applications and appliances may no longer be able to communicate with the system once SMBv1 is disabled. We recommend careful testing be performed to determine the impact prior to configuring this as a widespread control, and where possible, remediate any incompatibilities found with the vendor of the incompatible system. Microsoft is also maintaining a thorough (although not comprehensive) list of known SMBv1 incompatibilities at this link: SMB1 Product Clearinghouse | Storage at Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable driver (recommended): Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 client driver Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link." + compliance: + - cis: ["18.4.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2", "14.3"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10 -> Start -> 4' + + # 18.4.4 (L1) Ensure 'Configure SMB v1 server' is set to 'Disabled'. (Automated) + - id: 27153 + title: "Ensure 'Configure SMB v1 server' is set to 'Disabled'." + description: "This setting configures the server-side processing of the Server Message Block version 1 (SMBv1) protocol. The recommended state for this setting is: Disabled." + rationale: 'Since September 2016, Microsoft has strongly encouraged that SMBv1 be disabled and no longer used on modern networks, as it is a 30 year old design that is much more vulnerable to attacks then much newer designs such as SMBv2 and SMBv3. More information on this can be found at the following links: Stop using SMB1 | Storage at Microsoft Disable SMB v1 in Managed Environments with Group Policy - "Stay Safe" Cyber Security Blog Disabling SMBv1 through Group Policy - Microsoft Security Guidance blog.' + impact: "Some legacy OSes (e.g. Windows XP, Server 2003 or older), applications and appliances may no longer be able to communicate with the system once SMBv1 is disabled. We recommend careful testing be performed to determine the impact prior to configuring this as a widespread control, and where possible, remediate any incompatibilities found with the vendor of the incompatible system. Microsoft is also maintaining a thorough (although not comprehensive) list of known SMBv1 incompatibilities at this link: SMB1 Product Clearinghouse | Storage at Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Configure SMB v1 server Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link." + compliance: + - cis: ["18.4.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2", "14.3"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1", "A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters -> SMB1 -> 0' + + # 18.4.5 (L1) Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled'. (Automated) + - id: 27154 + title: "Ensure 'Enable Structured Exception Handling Overwrite Protection (SEHOP)' is set to 'Enabled'." + description: "Windows includes support for Structured Exception Handling Overwrite Protection (SEHOP). We recommend enabling this feature to improve the security profile of the computer. The recommended state for this setting is: Enabled." + rationale: "This feature is designed to block exploits that use the Structured Exception Handler (SEH) overwrite technique. This protection mechanism is provided at run-time. Therefore, it helps protect applications regardless of whether they have been compiled with the latest improvements, such as the /SAFESEH option." + impact: "After you enable SEHOP, existing versions of Cygwin, Skype, and Armadillo-protected applications may not work correctly." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\Enable Structured Exception Handling Overwrite Protection (SEHOP) Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link. More information is available at MSKB 956607: How to enable Structured Exception Handling Overwrite Protection (SEHOP) in Windows operating systems." + compliance: + - cis: ["18.4.5"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel -> DisableExceptionChainValidation -> 0' + + # 18.4.6 (L1) Ensure 'NetBT NodeType configuration' is set to 'Enabled: P-node (recommended)'. (Automated) + - id: 27155 + title: "Ensure 'NetBT NodeType configuration' is set to 'Enabled: P-node (recommended)'." + description: "This setting determines which method NetBIOS over TCP/IP (NetBT) uses to register and resolve names. The available methods are: - The B-node (broadcast) method only uses broadcasts. - The P-node (point-to-point) method only uses name queries to a name server (WINS). - The M-node (mixed) method broadcasts first, then queries a name server (WINS) if broadcast failed. - The H-node (hybrid) method queries a name server (WINS) first, then broadcasts if the query failed. The recommended state for this setting is: Enabled: P-node (recommended) (point-to-point). Note: Resolution through LMHOSTS or DNS follows these methods. If the NodeType registry value is present, it overrides any DhcpNodeType registry value. If neither NodeType nor DhcpNodeType is present, the computer uses B-node (broadcast) if there are no WINS servers configured for the network, or H-node (hybrid) if there is at least one WINS server configured." + rationale: "In order to help mitigate the risk of NetBIOS Name Service (NBT-NS) poisoning attacks, setting the node type to P-node (point-to-point) will prevent the system from sending out NetBIOS broadcasts." + impact: "NetBIOS name resolution queries will require a defined and available WINS server for external NetBIOS name resolution. If a WINS server is not defined or not reachable, and the desired hostname is not defined in the local cache, local LMHOSTS or HOSTS files, NetBIOS name resolution will fail." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: P-node (recommended): Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\NetBT NodeType configuration Note: This change does not take effect until the computer has been restarted. Note #2: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link. Please note that this setting is only available in the Security baseline (FINAL) for Windows 10 v1903 and Windows Server v1903 (or newer) release of SecGuide.admx/adml, so if you previously downloaded this template, you may need to update it from a newer Microsoft baseline to get this new NetBT NodeType configuration setting." + compliance: + - cis: ["18.4.6"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NodeType' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NodeType -> 2' + + # 18.4.7 (L1) Ensure 'WDigest Authentication' is set to 'Disabled'. (Automated) + - id: 27156 + title: "Ensure 'WDigest Authentication' is set to 'Disabled'." + description: 'When WDigest authentication is enabled, Lsass.exe retains a copy of the user''s plaintext password in memory, where it can be at risk of theft. If this setting is not configured, WDigest authentication is disabled in Windows 8.1 and in Windows Server 2012 R2; it is enabled by default in earlier versions of Windows and Windows Server. For more information about local accounts and credential theft, review the "Mitigating Pass-the-Hash (PtH) Attacks and Other Credential Theft Techniques" documents. For more information about UseLogonCredential, see Microsoft Knowledge Base article 2871997: Microsoft Security Advisory Update to improve credentials protection and management May 13, 2014. The recommended state for this setting is: Disabled.' + rationale: "Preventing the plaintext storage of credentials in memory may reduce opportunity for credential theft." + impact: "None - this is also the default configuration for Server 2012 R2 or newer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MS Security Guide\\WDigest Authentication (disabling may require KB2871997) Note: This Group Policy path does not exist by default. An additional Group Policy template (SecGuide.admx/adml) is required - it is available from Microsoft at this link." + compliance: + - cis: ["18.4.7"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest -> UseLogonCredential -> 0' + + # 18.5.1 (L1) Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled'. (Automated) + - id: 27157 + title: "Ensure 'MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended)' is set to 'Disabled'." + description: "This setting is separate from the Welcome screen feature in Windows XP and Windows Vista; if that feature is disabled, this setting is not disabled. If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks to which the computer is connected. Also, if you enable automatic logon, the password is stored in the registry in plaintext, and the specific registry key that stores this value is remotely readable by the Authenticated Users group. For additional information, see Microsoft Knowledge Base article 324737: How to turn on automatic logon in Windows. The recommended state for this setting is: Disabled." + rationale: "If you configure a computer for automatic logon, anyone who can physically gain access to the computer can also gain access to everything that is on the computer, including any network or networks that the computer is connected to. Also, if you enable automatic logon, the password is stored in the registry in plaintext. The specific registry key that stores this setting is remotely readable by the Authenticated Users group. As a result, this entry is appropriate only if the computer is physically secured and if you ensure that untrusted users cannot remotely see the registry." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (AutoAdminLogon) Enable Automatic Logon (not recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.1"] + - cis_csc_v8: ["3.11"] + - cis_csc_v7: ["16.4"] + - cmmc_v2.0: ["AC.L2-3.1.19", "IA.L2-3.5.10", "MP.L2-3.8.1", "SC.L2-3.13.11", "SC.L2-3.13.16"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1"] + - nist_sp_800-53: ["SC-28", "SC-28(1)"] + - pci_dss_v3.2.1: ["3.4", "3.4.1", "8.2.1"] + - pci_dss_v4.0: ["3.1.1", "3.3.2", "3.3.3", "3.5.1", "3.5.1.2", "3.5.1.3", "8.3.2"] + - soc_2: ["CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> AutoAdminLogon -> 0' + + # 18.5.2 (L1) Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' (Automated) + - id: 27158 + title: "Ensure 'MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'." + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should follow through the network. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting IPv6) IP source routing protection level (protects against packet spoofing) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.5.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters -> DisableIPSourceRouting -> 2' + + # 18.5.3 (L1) Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled' (Automated) + - id: 27159 + title: "Ensure 'MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing)' is set to 'Enabled: Highest protection, source routing is completely disabled'." + description: "IP source routing is a mechanism that allows the sender to determine the IP route that a datagram should take through the network. It is recommended to configure this setting to Not Defined for enterprise environments and to Highest Protection for high security environments to completely disable source routing. The recommended state for this setting is: Enabled: Highest protection, source routing is completely disabled." + rationale: "An attacker could use source routed packets to obscure their identity and location. Source routing allows a computer that sends a packet to specify the route that the packet takes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Highest protection, source routing is completely disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (DisableIPSourceRouting) IP source routing protection level (protects against packet spoofing) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.5.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> DisableIPSourceRouting -> 2' + + # 18.5.4 (L1) Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'. (Automated) + - id: 27160 + title: "Ensure 'MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes' is set to 'Disabled'." + description: "Internet Control Message Protocol (ICMP) redirects cause the IPv4 stack to plumb host routes. These routes override the Open Shortest Path First (OSPF) generated routes. The recommended state for this setting is: Disabled." + rationale: "This behavior is expected. The problem is that the 10 minute time-out period for the ICMP redirect-plumbed routes temporarily creates a network situation in which traffic will no longer be routed properly for the affected host. Ignoring such ICMP redirects will limit the system's exposure to attacks that will impact its ability to participate on the network." + impact: "When Routing and Remote Access Service (RRAS) is configured as an autonomous system boundary router (ASBR), it does not correctly import connected interface subnet routes. Instead, this router injects host routes into the OSPF routes. However, the OSPF router cannot be used as an ASBR router, and when connected interface subnet routes are imported into OSPF the result is confusing routing tables with strange routing paths." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (EnableICMPRedirect) Allow ICMP redirects to override OSPF generated routes Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.4"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> EnableICMPRedirect -> 0' + + # 18.5.5 (L2) Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes (recommended)'. (Automated) + - id: 27161 + title: "Ensure 'MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds' is set to 'Enabled: 300,000 or 5 minutes (recommended)'." + description: "This value controls how often TCP attempts to verify that an idle connection is still intact by sending a keep-alive packet. If the remote computer is still reachable, it acknowledges the keep-alive packet. The recommended state for this setting is: Enabled: 300,000 or 5 minutes (recommended)." + rationale: "An attacker who is able to connect to network applications could establish numerous connections to cause a DoS condition." + impact: "Keep-alive packets are not sent by default by Windows. However, some applications may configure the TCP stack flag that requests keep-alive packets. For such configurations, you can lower this value from the default setting of two hours to five minutes to disconnect inactive sessions more quickly." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 300,000 or 5 minutes (recommended): Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (KeepAliveTime) How often keep-alive packets are sent in milliseconds Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> KeepAliveTime -> 300000' + + # 18.5.6 (L1) Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'. (Automated) + - id: 27162 + title: "Ensure 'MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers' is set to 'Enabled'." + description: "NetBIOS over TCP/IP is a network protocol that among other things provides a way to easily resolve NetBIOS names that are registered on Windows-based systems to the IP addresses that are configured on those systems. This setting determines whether the computer releases its NetBIOS name when it receives a name-release request. The recommended state for this setting is: Enabled." + rationale: "The NetBT protocol is designed not to use authentication, and is therefore vulnerable to spoofing. Spoofing makes a transmission appear to come from a user other than the user who performed the action. A malicious user could exploit the unauthenticated nature of the protocol to send a name-conflict datagram to a target computer, which would cause the computer to relinquish its name and not respond to queries. An attacker could send a request over the network and query a computer to release its NetBIOS name. As with any change that could affect applications, it is recommended that you test this change in a non-production environment before you change the production environment. The result of such an attack could be to cause intermittent connectivity issues on the target computer, or even to prevent the use of Network Neighborhood, domain logons, the NET SEND command, or additional NetBIOS name resolution." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (NoNameReleaseOnDemand) Allow the computer to ignore NetBIOS name release requests except from WINS servers Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.6"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NetBT\Parameters -> NoNameReleaseOnDemand -> 1' + + # 18.5.7 (L2) Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'. (Automated) + - id: 27163 + title: "Ensure 'MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS)' is set to 'Disabled'." + description: "This setting is used to enable or disable the Internet Router Discovery Protocol (IRDP), which allows the system to detect and configure default gateway addresses automatically as described in RFC 1256 on a per-interface basis. The recommended state for this setting is: Disabled." + rationale: "An attacker who has gained control of a computer on the same network segment could configure a computer on the network to impersonate a router. Other computers with IRDP enabled would then attempt to route their traffic through the already compromised computer." + impact: "Windows will not automatically detect and configure default gateway addresses on the computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (PerformRouterDiscovery) Allow IRDP to detect and configure Default Gateway addresses (could lead to DoS) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> PerformRouterDiscovery -> 0' + + # 18.5.8 (L1) Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'. (Automated) + - id: 27164 + title: "Ensure 'MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended)' is set to 'Enabled'." + description: "The DLL search order can be configured to search for DLLs that are requested by running processes in one of two ways: - Search folders specified in the system path first, and then search the current working folder. - Search current working folder first, and then search the folders specified in the system path. When enabled, the registry value is set to 1. With a setting of 1, the system first searches the folders that are specified in the system path and then searches the current working folder. When disabled the registry value is set to 0 and the system first searches the current working folder and then searches the folders that are specified in the system path. Applications will be forced to search for DLLs in the system path first. For applications that require unique versions of these DLLs that are included with the application, this entry could cause performance or stability problems. The recommended state for this setting is: Enabled. Note: More information on how Safe DLL search mode works is available at this link: Dynamic-Link Library Search Order - Windows applications | Microsoft Docs." + rationale: "If a user unknowingly executes hostile code that was packaged with additional files that include modified versions of system DLLs, the hostile code could load its own versions of those DLLs and potentially increase the type and degree of damage the code can render." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (SafeDllSearchMode) Enable Safe DLL search mode (recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.8"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager -> SafeDllSearchMode -> 1' + + # 18.5.9 (L1) Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds' (Automated) + - id: 27165 + title: "Ensure 'MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended)' is set to 'Enabled: 5 or fewer seconds'." + description: "Windows includes a grace period between when the screen saver is launched and when the console is actually locked automatically when screen saver locking is enabled. The recommended state for this setting is: Enabled: 5 or fewer seconds." + rationale: "The default grace period that is allowed for user movement before the screen saver lock takes effect is five seconds. If you leave the default grace period configuration, your computer is vulnerable to a potential attack from someone who could approach the console and attempt to log on to the computer before the lock takes effect. An entry to the registry can be made to adjust the length of the grace period." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 5 or fewer seconds: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (ScreenSaverGracePeriod) The time in seconds before the screen saver grace period expires (0 recommended) Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.5.9"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon -> ScreenSaverGracePeriod -> n:^(\d+) compare <= 5' + + # 18.5.10 (L2) Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'. (Automated) + - id: 27166 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'." + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + impact: "TCP starts a retransmission timer when each outbound segment is passed to the IP. If no acknowledgment is received for the data in a given segment before the timer expires, then the segment is retransmitted up to three times." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions IPv6) How many times unacknowledged data is retransmitted Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.10"] + - cis_csc_v8: ["4.2"] + - cis_csc_v7: ["11.1"] + - cmmc_v2.0: ["CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.3", "CM.L2-3.4.6", "CM.L2-3.4.7", "SC.L2-3.13.6"] + - nist_sp_800-53: ["AC-18(1)", "AC-18(3)", "CM-2", "CM-6", "CM-7", "CM-7(1)", "CM-9"] + - pci_dss_v3.2.1: ["1.1.1", "1.2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.4.2", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> TcpMaxDataRetransmissions -> 3' + + # 18.5.11 (L2) Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'. (Automated) + - id: 27167 + title: "Ensure 'MSS: (TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted' is set to 'Enabled: 3'." + description: "This setting controls the number of times that TCP retransmits an individual data segment (non-connect segment) before the connection is aborted. The retransmission time-out is doubled with each successive retransmission on a connection. It is reset when responses resume. The base time-out value is dynamically determined by the measured round-trip time on the connection. The recommended state for this setting is: Enabled: 3." + rationale: "A malicious user could exhaust a target computer's resources if it never sent any acknowledgment messages for data that was transmitted by the target computer." + impact: "TCP starts a retransmission timer when each outbound segment is passed to the IP. If no acknowledgment is received for the data in a given segment before the timer expires, then the segment is retransmitted up to three times." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS:(TcpMaxDataRetransmissions) How many times unacknowledged data is retransmitted Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required - it is available from this TechNet blog post: The MSS settings - Microsoft Security Guidance blog." + compliance: + - cis: ["18.5.11"] + - cis_csc_v7: ["9.2"] + - iso_27001-2013: ["A.13.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters -> TcpMaxDataRetransmissions -> 3' + + # 18.5.12 (L1) Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less' (Automated) + - id: 27168 + title: "Ensure 'MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning' is set to 'Enabled: 90% or less'." + description: "This setting can generate a security audit in the Security event log when the log reaches a user-defined threshold. The recommended state for this setting is: Enabled: 90% or less. Note: If log settings are configured to Overwrite events as needed or Overwrite events older than x days, this event will not be generated." + rationale: "If the Security log reaches 90 percent of its capacity and the computer has not been configured to overwrite events as needed, more recent events will not be written to the log. If the log reaches its capacity and the computer has been configured to shut down when it can no longer record events to the Security log, the computer will shut down and will no longer be available to provide network services." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 90% or less: Computer Configuration\\Policies\\Administrative Templates\\MSS (Legacy)\\MSS: (WarningLevel) Percentage threshold for the security event log at which the system will generate a warning Note: This Group Policy path does not exist by default. An additional Group Policy template (MSS-legacy.admx/adml) is required." + compliance: + - cis: ["18.5.12"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.3", "6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security' + - 'not r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Security -> WarningLevel -> n:^(\d+) compare <= 90' + + # 18.6.4.1 (L1) Ensure 'Configure DNS over HTTPS (DoH) name resolution' is set to 'Enabled: Allow DoH' or higher. (Automated) + - id: 27169 + title: "Ensure 'Configure DNS over HTTPS (DoH) name resolution' is set to 'Enabled: Allow DoH' or higher." + description: "This setting determines if DNS over HTTPS (DoH) is used by the system. DNS over HTTPS (DoH) is a protocol for performing remote Domain Name System (DNS) resolution over the Hypertext Transfer Protocol Secure (HTTPS). For additional information on DNS over HTTPS (DoH), visit: Secure DNS Client over HTTPS (DoH) on Windows Server 2022 | Microsoft Docs. The recommended state for this setting is: Enabled: Allow DoH. Configuring this setting to Enabled: Require DoH also conforms to the benchmark." + rationale: "DNS over HTTPS (DoH) helps protect against DNS spoofing. Spoofing makes a transmission appear to come from a user other than the user who performed the action. It can also help prevent man-in-the-middle (MitM) attacks because the session in-between is encrypted." + impact: "If the option Enabled: Require DoH is chosen, this could limit third-party products from logging DNS traffic (in transit) as the traffic would be encrypted while in transit. The Require DoH option could also lead to domain-joined systems not functioning properly within the environment. The option Enabled: Allow DoH will perform DoH queries if the configured DNS servers support it. If they don't support it, classic name resolution will be used. This is the safest option. Note: Per Microsoft, don't enable the Enabled: Require DoH option for domain-joined computers as Active Directory Domain Services is heavily reliant on DNS because the Windows Server DNS Server service does not support DoH queries." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Allow DoH (configuring to Enabled: Require DoH also conforms to the benchmark): Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Configure DNS over HTTPS (DoH) name resolution Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DnsClient.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/windows-server/networking/dns/doh-client-support" + compliance: + - cis: ["18.6.4.1"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> DoHPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> DoHPolicy -> r:^2$|^3$' + + # 18.6.4.2 (L1) Ensure 'Configure NetBIOS settings' is set to 'Enabled: Disable NetBIOS name resolution on public networks'. (Automated) + - id: 27170 + title: "Ensure 'Configure NetBIOS settings' is set to 'Enabled: Disable NetBIOS name resolution on public networks'." + description: "This policy setting specifies if the Domain Name System (DNS) client will perform name resolution over Network Basic Input/Output System (NetBIOS). NetBIOS is a legacy name resolution method for internal Microsoft networking that predates the use of DNS for that purpose (pre-Active Directory). Some legacy applications still require the use of NetBIOS for full functionality. The recommended state for this setting is: Enabled: Disable NetBIOS name resolution on public networks. Configuring this setting to Enabled: Disable NetBIOS name resolution also conforms to the benchmark." + rationale: 'NetBIOS does not perform authentication and can allow remote attackers to cause a denial of service by sending spoofed Name Conflicts or Name Release datagrams. This is also known as "NetBIOS Name Server Protocol Spoofing". Preventing the use of NetBIOS on public networks reduces the attack surface.' + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable NetBIOS name resolution on public networks: Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Configure NetBIOS settings." + compliance: + - cis: ["18.6.4.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableNetbios' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableNetbios -> 2' + + # 18.6.4.3 (L1) Ensure 'Turn off multicast name resolution' is set to 'Enabled'. (Automated) + - id: 27171 + title: "Ensure 'Turn off multicast name resolution' is set to 'Enabled'." + description: "LLMNR is a secondary name resolution protocol. With LLMNR, queries are sent using multicast over a local network link on a single subnet from a client computer to another client computer on the same subnet that also has LLMNR enabled. LLMNR does not require a DNS server or DNS client configuration, and provides name resolution in scenarios in which conventional DNS name resolution is not possible. The recommended state for this setting is: Enabled." + rationale: "An attacker can listen on a network for these LLMNR (UDP/5355) or NBT-NS (UDP/137) broadcasts and respond to them, tricking the host into thinking that it knows the location of the requested system. Note: To completely mitigate local name resolution poisoning, in addition to this setting, the properties of each installed NIC should also be set to Disable NetBIOS over TCP/IP (on the WINS tab in the NIC properties). Unfortunately, there is no global setting to achieve this that automatically applies to all NICs - it is a per-NIC setting that varies with different NIC hardware installations." + impact: "In the event DNS is unavailable a system will be unable to request it from other systems on the same subnet." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\DNS Client\\Turn off multicast name resolution Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DnsClient.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.6.4.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient -> EnableMulticast -> 0' + + # 18.6.5.1 (L2) Ensure 'Enable Font Providers' is set to 'Disabled'. (Automated) + - id: 27172 + title: "Ensure 'Enable Font Providers' is set to 'Disabled'." + description: "This policy setting determines whether Windows is allowed to download fonts and font catalog data from an online font provider. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment the IT department should be managing the changes to the system configuration, to ensure all changes are tested and approved." + impact: "Windows will not connect to an online font provider and will only enumerate locally-installed fonts." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Fonts\\Enable Font Providers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.6.5.1"] + - cis_csc_v8: ["16.5"] + - cis_csc_v7: ["18.4"] + - pci_dss_v3.2.1: ["6.2"] + - pci_dss_v4.0: ["12.3.4", "6.3.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableFontProviders' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableFontProviders -> 0' + + # 18.6.8.1 (L1) Ensure 'Enable insecure guest logons' is set to 'Disabled'. (Automated) + - id: 27173 + title: "Ensure 'Enable insecure guest logons' is set to 'Disabled'." + description: "This policy setting determines if the SMB client will allow insecure guest logons to an SMB server. The recommended state for this setting is: Disabled." + rationale: "Insecure guest logons are used by file servers to allow unauthenticated access to shared folders." + impact: "The SMB client will reject insecure guest logons. This was not originally the default behavior in older versions of Windows, but Microsoft changed the default behavior starting with Windows Server 2016 R1709: Guest access in SMB2 disabled by default in Windows 10 and Windows Server 2016." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Lanman Workstation\\Enable insecure guest logons Note: This Group Policy path may not exist by default. It is provided by the Group Policy template LanmanWorkstation.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.6.8.1"] + - cis_csc_v7: ["9.2"] + - iso_27001-2013: ["A.13.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation -> AllowInsecureGuestAuth' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation -> AllowInsecureGuestAuth -> 0' + + # 18.6.9.1 (L2) Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'. (Automated) + - id: 27174 + title: "Ensure 'Turn on Mapper I/O (LLTDIO) driver' is set to 'Disabled'." + description: "This policy setting changes the operational behavior of the Mapper I/O network protocol driver. LLTDIO allows a computer to discover the topology of a network it's connected to. It also allows a computer to initiate Quality-of-Service requests such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Mapper I/O (LLTDIO) driver Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.9.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableLLTDIO -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitLLTDIOOnPrivateNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowLLTDIOOnPublicNet -> 0' + + # 18.6.9.2 (L2) Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'. (Automated) + - id: 27175 + title: "Ensure 'Turn on Responder (RSPNDR) driver' is set to 'Disabled'." + description: "This policy setting changes the operational behavior of the Responder network protocol driver. The Responder allows a computer to participate in Link Layer Topology Discovery requests so that it can be discovered and located on the network. It also allows a computer to participate in Quality-of-Service activities such as bandwidth estimation and network health analysis. The recommended state for this setting is: Disabled." + rationale: "To help protect from potentially discovering and connecting to unauthorized devices, this setting should be disabled to prevent responding to network traffic for network topology discovery." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Link-Layer Topology Discovery\\Turn on Responder (RSPNDR) driver Note: This Group Policy path is provided by the Group Policy template LinkLayerTopologyDiscovery.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.9.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> EnableRspndr -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> ProhibitRspndrOnPrivateNet -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnDomain -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LLTD -> AllowRspndrOnPublicNet -> 0' + + # 18.6.10.2 (L2) Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'. (Automated) + - id: 27176 + title: "Ensure 'Turn off Microsoft Peer-to-Peer Networking Services' is set to 'Enabled'." + description: "The Peer Name Resolution Protocol (PNRP) allows for distributed resolution of a name to an IPv6 address and port number. The protocol operates in the context of clouds. A cloud is a set of peer computers that can communicate with each other by using the same IPv6 scope. Peer-to-Peer protocols allow for applications in the areas of RTC, collaboration, content distribution and distributed processing. The recommended state for this setting is: Enabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to peer-to-peer networking." + impact: "Microsoft Peer-to-Peer Networking Services are turned off in their entirety, and all applications dependent on them will stop working." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Microsoft Peer-to-Peer Networking Services\\Turn off Microsoft Peer-to-Peer Networking Services Note: This Group Policy path is provided by the Group Policy template P2P-pnrp.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.10.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Peernet -> Disabled -> 1' + + # 18.6.11.2 (L1) Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'. (Automated) + - id: 27177 + title: "Ensure 'Prohibit installation and configuration of Network Bridge on your DNS domain network' is set to 'Enabled'." + description: "You can use this procedure to control a user's ability to install and configure a Network Bridge. The recommended state for this setting is: Enabled." + rationale: "The Network Bridge setting, if enabled, allows users to create a Layer 2 Media Access Control (MAC) bridge, enabling them to connect two or more physical network segments together. A Network Bridge thus allows a computer that has connections to two different networks to share data between those networks. In an enterprise managed environment, where there is a need to control network traffic to only authorized paths, allowing users to create a Network Bridge increases the risk and attack surface from the bridged network." + impact: "Users cannot create or configure a Network Bridge." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit installation and configuration of Network Bridge on your DNS domain network Note: This Group Policy path is provided by the Group Policy template NetworkConnections.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.11.2"] + - cis_csc_v8: ["4.8", "12.2"] + - cis_csc_v7: ["11.3"] + - cmmc_v2.0: ["AC.L1-3.1.2", "AC.L1-3.1.20", "AC.L1-3.1.22", "AC.L2-3.1.14", "AC.L2-3.1.16", "AC.L2-3.1.17", "AC.L2-3.1.3", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.5", "SC.L2-3.13.2", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.12.1.2"] + - nist_sp_800-53: ["CP-6", "CP-7", "PL-8"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "1.2.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "1.3.1", "1.3.2", "1.3.3", "1.4.4", "11.4.5", "2.2.4", "6.4.1", "7.1", "7.2.5.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_AllowNetBridge_NLA -> 0' + + # 18.6.11.3 (L1) Ensure 'Prohibit use of Internet Connection Sharing on your DNS domain network' is set to 'Enabled'. (Automated) + - id: 27178 + title: "Ensure 'Prohibit use of Internet Connection Sharing on your DNS domain network' is set to 'Enabled'." + description: 'Although this "legacy" setting traditionally applied to the use of Internet Connection Sharing (ICS) in Windows 2000, Windows XP & Server 2003, this setting now freshly applies to the Mobile Hotspot feature in Windows 10 & Server 2016. The recommended state for this setting is: Enabled.' + rationale: "Non-administrators should not be able to turn on the Mobile Hotspot feature and open their Internet connectivity up to nearby mobile devices." + impact: "Mobile Hotspot cannot be enabled or configured by Administrators and non-Administrators alike." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Prohibit use of Internet Connection Sharing on your DNS domain network Note: This Group Policy path is provided by the Group Policy template NetworkConnections.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.11.3"] + - cis_csc_v8: ["4.8", "12.2"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["AC.L1-3.1.2", "AC.L1-3.1.20", "AC.L1-3.1.22", "AC.L2-3.1.14", "AC.L2-3.1.16", "AC.L2-3.1.17", "AC.L2-3.1.3", "CM.L2-3.4.1", "CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L1-3.13.5", "SC.L2-3.13.2", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - nist_sp_800-53: ["CP-6", "CP-7", "PL-8"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "1.2.3", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "1.3.1", "1.3.2", "1.3.3", "1.4.4", "11.4.5", "2.2.4", "6.4.1", "7.1", "7.2.5.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_ShowSharedAccessUI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_ShowSharedAccessUI -> 0' + + # 18.6.11.4 (L1) Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'. (Automated) + - id: 27179 + title: "Ensure 'Require domain users to elevate when setting a network's location' is set to 'Enabled'." + description: "This policy setting determines whether to require domain users to elevate when setting a network's location. The recommended state for this setting is: Enabled." + rationale: "Allowing regular users to set a network location increases the risk and attack surface." + impact: "Domain users must elevate when setting a network's location." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Connections\\Require domain users to elevate when setting a network's location Note: This Group Policy path may not exist by default. It is provided by the Group Policy template NetworkConnections.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.6.11.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Network Connections -> NC_StdDomainUserSetLocation -> 1' + + # 18.6.14.1 (L1) Ensure 'Hardened UNC Paths' is set to 'Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares' (Automated) + - id: 27180 + title: 'Ensure ''Hardened UNC Paths'' is set to ''Enabled, with "Require Mutual Authentication" and "Require Integrity" set for all NETLOGON and SYSVOL shares''.' + description: 'This policy setting configures secure access to UNC paths. The recommended state for this setting is: Enabled, with Require Mutual Authentication and Require Integrity set for all NETLOGON and SYSVOL shares. Note: If the environment exclusively contains Windows 8.0 / Server 2012 (non-R2) or newer systems, then the "Privacy" setting may (optionally) also be set to enable SMB encryption. However, using SMB encryption will render the targeted share paths completely inaccessible by older OSes, so only use this additional option with caution and thorough testing.' + rationale: "In February 2015, Microsoft released a new control mechanism to mitigate a security risk in Group Policy as part of the MS15-011 / MSKB 3000483 security update. This mechanism requires both the installation of the new security update and also the deployment of specific group policy settings to all computers on the domain from Windows Vista / Server 2008 (non-R2) or newer (the associated security patch to enable this feature was not released for Server 2003). A new group policy template (NetworkProvider.admx/adml) was also provided with the security update. Once the new GPO template is in place, the following are the minimum requirements to remediate the Group Policy security risk: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Note: A reboot may be required after the setting is applied to a client machine to access the above paths." + impact: "Windows only allows access to the specified UNC paths after fulfilling additional security requirements." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with the following paths configured, at a minimum: \\\\*\\NETLOGON RequireMutualAuthentication=1, RequireIntegrity=1 \\\\*\\SYSVOL RequireMutualAuthentication=1, RequireIntegrity=1 Computer Configuration\\Policies\\Administrative Templates\\Network\\Network Provider\\Hardened UNC Paths. Note: This Group Policy path does not exist by default. An additional Group Policy template (NetworkProvider.admx/adml) is required." + compliance: + - cis: ["18.6.14.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\NETLOGON' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\SYSVOL' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\NETLOGON -> r:RequireMutualAuthentication=1, RequireIntegrity=1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\NetworkProvider\HardenedPaths -> \\*\SYSVOL -> r:RequireMutualAuthentication=1, RequireIntegrity=1' + + # 18.6.19.2.1 (L2) Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)'). (Automated) + - id: 27181 + title: "Disable IPv6 (Ensure TCPIP6 Parameter 'DisabledComponents' is set to '0xff (255)')." + description: "Internet Protocol version 6 (IPv6) is a set of protocols that computers use to exchange information over the Internet and over home and business networks. IPv6 allows for many more IP addresses to be assigned than IPv4 did. Older networking, hosts and operating systems may not support IPv6 natively. The recommended state for this setting is: DisabledComponents - 0xff (255)." + rationale: "Since the vast majority of private enterprise managed networks have no need to utilize IPv6 (because they have access to private IPv4 addressing), disabling IPv6 components removes a possible attack surface that is also harder to monitor the traffic on. As a result, we recommend configuring IPv6 to a Disabled state when it is not needed." + impact: "Connectivity to other systems using IPv6 will no longer operate, and software that depends on IPv6 will cease to function. Examples of Microsoft applications that may use IPv6 include: Remote Assistance, HomeGroup, DirectAccess, Windows Mail. This registry change is documented in Microsoft Knowledge Base article 929852: How to disable IPv6 or its components in Windows. Note: This registry change does not take effect until the next reboot." + remediation: "To establish the recommended configuration, set the following Registry value to 0xff (255) (DWORD): HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\TCPIP6\\Parameters:Disabl edComponents Note: This change does not take effect until the computer has been restarted. Note #2: Although Microsoft does not provide an ADMX template to configure this registry value, a custom .ADM template (Disable-IPv6-Components-KB929852.adm) is provided in the CIS Benchmark Remediation Kit to facilitate its configuration. Be aware though that simply turning off the group policy setting in the .ADM template will not \"undo\" the change once applied. Instead, the opposite setting must be applied to change the registry value to the opposite state." + compliance: + - cis: ["18.6.19.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP6\Parameters -> DisabledComponents -> 255' + + # 18.6.20.1 (L2) Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'. (Automated) + - id: 27182 + title: "Ensure 'Configuration of wireless settings using Windows Connect Now' is set to 'Disabled'." + description: "This policy setting allows the configuration of wireless settings using Windows Connect Now (WCN). The WCN Registrar enables the discovery and configuration of devices over Ethernet (UPnP) over in-band 802.11 Wi-Fi through the Windows Portable Device API (WPD) and via USB Flash drives. Additional options are available to allow discovery and configuration over a specific medium. The recommended state for this setting is: Disabled." + rationale: "This setting enhances the security of the environment and reduces the overall risk exposure related to user configuration of wireless settings." + impact: "WCN operations are disabled over all media." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Configuration of wireless settings using Windows Connect Now Note: This Group Policy path is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.6.20.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["15.4", "15.5"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.8.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> EnableRegistrars -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableUPnPRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableInBand802DOT11Registrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableFlashConfigRegistrar -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\Registrars -> DisableWPDRegistrar -> 0' + + # 18.6.20.2 (L2) Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'. (Automated) + - id: 27183 + title: "Ensure 'Prohibit access of the Windows Connect Now wizards' is set to 'Enabled'." + description: "This policy setting prohibits access to Windows Connect Now (WCN) wizards. The recommended state for this setting is: Enabled." + rationale: "Allowing standard users to access the Windows Connect Now wizard increases the risk and attack surface." + impact: 'The WCN wizards are turned off and users have no access to any of the wizard tasks. All the configuration related tasks including "Set up a wireless router or access point" and "Add a wireless device" are disabled.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connect Now\\Prohibit access of the Windows Connect Now wizards Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsConnectNow.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.6.20.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WCN\UI -> DisableWcnUi -> 1' + + # 18.6.21.1 (L1) Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled: 3 = Prevent Wi-Fi when on Ethernet' (Automated) + - id: 27184 + title: "Ensure 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is set to 'Enabled: 3 = Prevent Wi-Fi when on Ethernet'." + description: "This policy setting prevents computers from establishing multiple simultaneous connections to either the Internet or to a Windows domain. The recommended state for this setting is: Enabled: 3 = Prevent Wi-Fi when on Ethernet." + rationale: "Preventing bridged network connections can help prevent a user unknowingly allowing traffic to route between internal and external networks, which risks exposure to sensitive internal data." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 3 = Prevent Wi-Fi when on Ethernet: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Minimize the number of simultaneous connections to the Internet or a Windows Domain Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WCM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates. It was updated with a new Minimize Policy Options sub-setting starting with the Windows 10 Release 1903 Administrative Templates." + compliance: + - cis: ["18.6.21.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["15.5"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fMinimizeConnections -> 3' + + # 18.6.21.2 (L2) Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled' (MS only). (Automated) + - id: 27185 + title: "Ensure 'Prohibit connection to non-domain networks when connected to domain authenticated network' is set to 'Enabled' (MS only)." + description: "This policy setting prevents computers from connecting to both a domain based network and a non-domain based network at the same time. The recommended state for this setting is: Enabled." + rationale: "The potential concern is that a user would unknowingly allow network traffic to flow between the insecure public network and the enterprise managed network." + impact: "The computer responds to automatic and manual network connection attempts based on the following circumstances: Automatic connection attempts - When the computer is already connected to a domain based network, all automatic connection attempts to non-domain networks are blocked. - When the computer is already connected to a non-domain based network, automatic connection attempts to domain based networks are blocked. Manual connection attempts - When the computer is already connected to either a non-domain based network or a domain based network over media other than Ethernet, and a user attempts to create a manual connection to an additional network in violation of this policy setting, the existing network connection is disconnected and the manual connection is allowed. - When the computer is already connected to either a non-domain based network or a domain based network over Ethernet, and a user attempts to create a manual connection to an additional network in violation of this policy setting, the existing Ethernet connection is maintained and the manual connection attempt is blocked." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Network\\Windows Connection Manager\\Prohibit connection to non-domain networks when connected to domain authenticated network Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WCM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.6.21.2"] + - cis_csc_v7: ["12.4"] + - iso_27001-2013: ["A.13.1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WcmSvc\GroupPolicy -> fBlockNonDomain -> 1' + + # 18.7.1 (L1) Ensure 'Allow Print Spooler to accept client connections' is set to 'Disabled'. (Automated) + - id: 27186 + title: "Ensure 'Allow Print Spooler to accept client connections' is set to 'Disabled'." + description: "This policy setting controls whether the Print Spooler service will accept client connections. The recommended state for this setting is: Disabled. Note: The Print Spooler service must be restarted for changes to this policy to take effect. Warning: An exception to this recommendation must be made for print servers in order for them to function properly. Users will not be able to print to the server when client connections are disabled." + rationale: "Disabling the ability for the Print Spooler service to accept client connections mitigates remote attacks against the PrintNightmare vulnerability (CVE-2021-34527) and other remote Print Spooler attacks. However, this recommendation does not mitigate against local attacks on the Print Spooler service." + impact: "Provided that the Print Spooler service is not disabled, applications on and users logged in to servers will continue to be able to print from the server. However, the Print Spooler service will not accept client connections or allow users to share printers. Note that all printers that were already shared will continue to be shared. Warning: An exception to this recommendation must be made for print servers in order for them to function properly. Users will not be able to print to the server when client connections are disabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Printers:Allow Print Spooler to accept client connections Note: This Group Policy path is provided by the Group Policy template Printing2.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + references: + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527" + compliance: + - cis: ["18.7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RegisterSpoolerRemoteRpcEndPoint' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RegisterSpoolerRemoteRpcEndPoint -> 2' + + # 18.7.2 (L1) Ensure 'Configure Redirection Guard' is set to 'Enabled: Redirection Guard Enabled'. (Automated) + - id: 27187 + title: "Ensure 'Configure Redirection Guard' is set to 'Enabled: Redirection Guard Enabled'." + description: "This policy setting determines whether Redirection Guard is enabled for the print spooler. Redirection Guard can prevent file redirections from being used within the print spooler. The recommended state for this setting is: Enabled: Redirection Guard Enabled." + rationale: "This setting prevents non-administrators from redirecting files within the print spooler process." + impact: "None - this is default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Redirection Guard Enabled: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Configure Redirection Guard Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + references: + - "https://techcommunity.microsoft.com/t5/microsoft-security-baselines/windows-11-version-22h2-security-baseline/ba-p/3632520" + compliance: + - cis: ["18.7.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RedirectionguardPolicy' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RedirectionguardPolicy -> 1' + + # 18.7.3 (L1) Ensure 'Configure RPC connection settings: Protocol to use for outgoing RPC connections' is set to 'Enabled: RPC over TCP'. (Automated) + - id: 27188 + title: "Ensure 'Configure RPC connection settings: Protocol to use for outgoing RPC connections' is set to 'Enabled: RPC over TCP'." + description: "This policy setting controls which protocol and protocol settings to use for outgoing Remote Procedure Call (RPC) connections to a remote print spooler. The recommended state for this setting is: Enabled: RPC over TCP." + rationale: "This setting prevents the use of named pipes for RPC connections to the print spooler and forces the use of TCP which is a more secure communication method." + impact: "Warning: Many existing print configurations may be using the older named pipes protocol and therefore will cease to function." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: RPC over TCP: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Configure RPC connection settings: Protocol to use for outgoing RPC connections Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + references: + - "https://learn.microsoft.com/en-us/troubleshoot/windows-client/printing/windows-11-rpc-connection-updates-for-print#allow-rpc-over-tcp-communication" + compliance: + - cis: ["18.7.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RpcUseNamedPipeProtocol' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RpcUseNamedPipeProtocol -> 1' + + # 18.7.4 (L1) Ensure 'Configure RPC connection settings: Use authentication for outgoing RPC connections' is set to 'Enabled: Default'. (Automated) + - id: 27189 + title: "Ensure 'Configure RPC connection settings: Use authentication for outgoing RPC connections' is set to 'Enabled: Default'." + description: "This policy setting controls which protocol and protocol settings to use for outgoing Remote Procedure Call (RPC) connections to a remote print spooler. The recommended state for this setting is: Enabled: Default." + rationale: "This setting can prevent the use of named pipes for RPC connections to the print spooler and forces the use of TCP which is a more secure communication method." + impact: "Warning: Many existing print configurations may be using the older named pipes protocol and therefore will cease to function." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Default: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Configure RPC connection settings: Use authentication for outgoing RPC connections Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + references: + - "https://learn.microsoft.com/en-us/troubleshoot/windows-client/printing/windows-11-rpc-connection-updates-for-print#allow-rpc-over-tcp-communication" + compliance: + - cis: ["18.7.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RpcAuthentication' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RpcAuthentication -> 1' + + # 18.7.5 (L1) Ensure 'Configure RPC listener settings: Protocols to allow for incoming RPC connections' is set to 'Enabled: RPC over TCP'. (Automated) + - id: 27190 + title: "Ensure 'Configure RPC listener settings: Protocols to allow for incoming RPC connections' is set to 'Enabled: RPC over TCP'." + description: "This policy setting controls which protocols incoming Remote Procedure Call (RPC) connections to the print spooler are allowed to use. The recommended state for this setting is: Enabled: RCP over TCP." + rationale: "This setting can prevent the use of named pipes for RPC connections to the print spooler and forces the use of TCP which is a more secure communication method." + impact: "Warning: Many existing print configurations may be using the older named pipes protocol and therefore will cease to function." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: RCP over TCP: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Configure RPC listener settings: Configure protocol options for incoming RPC connections Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + compliance: + - cis: ["18.7.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RpcProtocols' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RpcProtocols -> 7' + + # 18.7.6 (L1) Ensure 'Configure RPC listener settings: Authentication protocol to use for incoming RPC connections:' is set to 'Enabled: Negotiate' or higher (Automated) + - id: 27191 + title: "Ensure 'Configure RPC listener settings: Authentication protocol to use for incoming RPC connections:' is set to 'Enabled: Negotiate' or higher." + description: "This policy setting controls which protocols incoming Remote Procedure Call (RPC) connections to the print spooler are allowed to use. The recommended state for this setting is: Enabled: Negotiate or higher.." + rationale: "This setting can prevent the use of named pipes for RPC connections to the print spooler and forces the use of TCP which is a more secure communication method." + impact: "Warning: Many existing print configurations may be using the older named pipes protocol and therefore will cease to function." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Negotiate or higher: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Configure RPC listener settings: Configure protocol options for incoming RPC connections Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + compliance: + - cis: ["18.7.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> ForceKerberosForRpc' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> ForceKerberosForRpc -> 1' + + # 18.7.7 (L1) Ensure 'Configure RPC over TCP port' is set to 'Enabled: 0'. (Automated) + - id: 27192 + title: "Ensure 'Configure RPC over TCP port' is set to 'Enabled: 0'." + description: "This policy setting controls which port is used for RPC over TCP for incoming connections to the print spooler and outgoing connections to remote print spoolers. The recommended state for this setting is: Enabled: 0." + rationale: "Using dynamic ports for printing makes it more difficult for an attacker to know which port is being used and therefore which port to attack." + impact: "If your current print environment is configured for a specific TCP port, this setting may require a firewall change (if applicable) for continued printing." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 0: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Configure RPC over TCP port Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + compliance: + - cis: ["18.7.7"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RpcTcpPort' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> RpcTcpPort -> n:^(\d+) compare <= 65535' + + # 18.7.8 (L1) Ensure 'Limits print driver installation to Administrators' is set to 'Enabled'. (Automated) + - id: 27193 + title: "Ensure 'Limits print driver installation to Administrators' is set to 'Enabled'." + description: "This policy setting controls whether users who aren't Administrators can install print drivers on the system. The recommended state for this setting is: Enabled. Note: On August 10, 2021, Microsoft announced a Point and Print Default Behavior Change which modifies the default Point and Print driver installation and update behavior to require Administrator privileges. This is documented in KB5005652 - Manage new Point and Print default driver installation behavior (CVE-2021-34481)." + rationale: "Restricting the installation of print drives to Administrators can help mitigate the PrintNightmare vulnerability (CVE-2021-34527) and other Print Spooler attacks." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Administrative Templates\\Printers\\Limits print driver installation to Administrators Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (and newer)." + references: + - "https://support.microsoft.com/en-us/topic/kb5005010-restricting-installation-of-new-printer-drivers-after-applying-the-july-6-2021-updates-31b91c02-05bc-4ada-a7ea-183b129578a7" + - "https://support.microsoft.com/en-gb/topic/kb5005652-manage-new-point-and-print-default-driver-installation-behavior-cve-2021-34481-873642bf-2634-49c5-a23b-6d8e9a302872" + compliance: + - cis: ["18.7.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> RestrictDriverInstallationToAdministrators' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> RestrictDriverInstallationToAdministrators -> 1' + + # 18.7.9 (L1) Ensure 'Manage processing of Queue-specific files' is set to 'Enabled: Limit Queue-specific files to Color profiles'. (Automated) + - id: 27194 + title: "Ensure 'Manage processing of Queue-specific files' is set to 'Enabled: Limit Queue-specific files to Color profiles'." + description: "This policy setting manages how queue-specific files are processed during printer installation. At printer installation time, a vendor-supplied installation application can specify a set of files, of any type, to be associated with a particular print queue. The files are downloaded to each client that connects to the print server. The recommended state for this setting is: Enabled: Limit Queue-specific files to Color profiles." + rationale: "A Windows Print Spooler Remote Code Execution Vulnerability (CVE-2021-36958) exists when the Windows Print Spooler service improperly performs privileged file operations. An attacker who successfully exploites this vulnerability could run arbitrary code with SYSTEM privileges and then install programs; view, change, or delete data; or create new accounts with full user rights." + impact: "None - this is default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Limit Queue-specific files to Color profiles: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Manage processing of Queue-specific files Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (and newer)." + references: + - "https://learn.microsoft.com/en-us/windows-hardware/drivers/print/installing-queue-specific-files" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-36958" + compliance: + - cis: ["18.7.9"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> CopyFilesPolicy' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers -> CopyFilesPolicy -> 1' + + # 18.7.10 (L1) Ensure 'Point and Print Restrictions: When installing drivers for a new connection' is set to 'Enabled: Show warning and elevation prompt'. (Automated) + - id: 27195 + title: "Ensure 'Point and Print Restrictions: When installing drivers for a new connection' is set to 'Enabled: Show warning and elevation prompt'." + description: "This policy setting controls whether computers will show a warning and a security elevation prompt when users create a new printer connection using Point and Print. The recommended state for this setting is: Enabled: Show warning and elevation prompt. Note: On August 10, 2021, Microsoft announced a Point and Print Default Behavior Change which modifies the default Point and Print driver installation and update behavior to require Administrator privileges. This is documented in KB5005652 - Manage new Point and Print default driver installation behavior (CVE-2021-34481). This change overrides all Point and Print Group Policy settings and ensures that only Administrators can install printer drivers from a print server using Point and Print." + rationale: "Enabling Windows User Account Control (UAC) for the installation of new print drivers can help mitigate the PrintNightmare vulnerability (CVE-2021-34527) and other Print Spooler attacks. Although the Point and Print default driver installation behavior overrides this setting, it is important to configure this as a backstop in the event that behavior is reversed." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Show warning and elevation prompt: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Point and Print Restrictions: When installing drivers for a new connection Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + references: + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-1675" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34481" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-36958" + - "https://msrc-blog.microsoft.com/2021/08/10/point-and-print-default-behavior-change/" + - "https://support.microsoft.com/en-us/topic/kb5005652-manage-new-point-and-print-default-driver-installation-behavior-cve-2021-34481-873642bf-2634-49c5-a23b-6d8e9a302872" + compliance: + - cis: ["18.7.10"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint' + - 'not r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> NoWarningNoElevationOnInstall' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> NoWarningNoElevationOnInstall -> 0' + + # 18.7.11 (L1) Ensure 'Point and Print Restrictions: When updating drivers for an existing connection' is set to 'Enabled: Show warning and elevation prompt'. (Automated) + - id: 27196 + title: "Ensure 'Point and Print Restrictions: When updating drivers for an existing connection' is set to 'Enabled: Show warning and elevation prompt'." + description: "This policy setting controls whether computers will show a warning and a security elevation prompt when users are updating drivers for an existing connection using Point and Print. The recommended state for this setting is: Enabled: Show warning and elevation prompt. Note: On August 10, 2021, Microsoft announced a Point and Print Default Behavior Change which modifies the default Point and Print driver installation and update behavior to require Administrator privileges. This is documented in KB5005652 - Manage new Point and Print default driver installation behavior (CVE-2021-34481). This change overrides all Point and Print Group Policy settings and ensures that only Administrators can install printer drivers from a print server using Point and Print." + rationale: "Enabling Windows User Account Control (UAC) for updating existing print drivers can help mitigate the PrintNightmare vulnerability (CVE-2021-34527) and other Print Spooler attacks. Although the Point and Print default driver installation behavior overrides this setting, it is important to configure this as a backstop in the event that behavior is reversed." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Show warning and elevation prompt: Computer Configuration\\Policies\\Administrative Templates\\Printers\\Point and Print Restrictions: When updating drivers for an existing connection Note: This Group Policy path is provided by the Group Policy template Printing.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + references: + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-1675" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34481" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-34527" + - "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-36958" + - "https://msrc-blog.microsoft.com/2021/08/10/point-and-print-default-behavior-change/" + - "https://support.microsoft.com/en-us/topic/kb5005652-manage-new-point-and-print-default-driver-installation-behavior-cve-2021-34481-873642bf-2634-49c5-a23b-6d8e9a302872" + compliance: + - cis: ["18.7.11"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint' + - 'not r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> UpdatePromptSettings' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint -> UpdatePromptSettings -> 0' + + # 18.8.1.1 (L2) Ensure 'Turn off notifications network usage' is set to 'Enabled'. (Automated) + - id: 27197 + title: "Ensure 'Turn off notifications network usage' is set to 'Enabled'." + description: "This policy setting blocks applications from using the network to send notifications to update tiles, tile badges, toast, or raw notifications. This policy setting turns off the connection between Windows and the Windows Push Notification Service (WNS). This policy setting also stops applications from being able to poll application services to update tiles. The recommended state for this setting is: Enabled." + rationale: "Windows Push Notification Services (WNS) is a mechanism to receive third-party notifications and updates from the cloud/Internet. In a high security environment, external systems, especially those hosted outside the organization, should be prevented from having an impact on the secure workstations." + impact: "Applications and system features will not be able receive notifications from the network from WNS or via notification polling APIs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Start Menu and Taskbar\\Turn off notifications network usage Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WPN.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.8.1.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -> NoCloudApplicationNotification' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications -> NoCloudApplicationNotification -> 1' + + # 18.9.3.1 (L1) Ensure 'Include command line in process creation events' is set to 'Enabled'. (Automated) + - id: 27198 + title: "Ensure 'Include command line in process creation events' is set to 'Enabled'." + description: "This policy setting controls whether the process creation command line text is logged in security audit events when a new process has been created. The recommended state for this setting is: Enabled. Note: This feature that this setting controls was not originally supported in server OSes older than Windows Server 2012 R2. However, in February 2015 Microsoft added support for the feature to Windows Server 2008 R2 and Windows Server 2012 (non-R2) via an update - KB3004375. Therefore, this setting is also important to set on those older OSes." + rationale: "Capturing process command line information in event logs can be very valuable when performing forensic investigations of attack incidents." + impact: 'Process command line information will be included in the event logs, which can contain sensitive or private information such as passwords or user data. Warning: There are potential risks of capturing credentials and sensitive information which could be exposed to users who have read-access to event logs. Microsoft provides a feature called "Protected Event Logging" to better secure event log data. For assistance with protecting event logging, visit: About Logging Windows - PowerShell | Microsoft Docs.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Audit Process Creation\\Include command line in process creation events Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AuditSettings.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_logging_windows?view=powershell-7.2#protected-event-logging" + compliance: + - cis: ["18.9.3.1"] + - cis_csc_v8: ["8.8"] + - cis_csc_v7: ["8.8"] + - iso_27001-2013: ["A.12.14.1"] + - soc_2: ["CC5.2", "CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit -> ProcessCreationIncludeCmdLine_Enabled -> 1' + + # 18.9.4.1 (L1) Ensure 'Encryption Oracle Remediation' is set to 'Enabled: Force Updated Clients'. (Automated) + - id: 27199 + title: "Ensure 'Encryption Oracle Remediation' is set to 'Enabled: Force Updated Clients'." + description: "Some versions of the CredSSP protocol that is used by some applications (such as Remote Desktop Connection) are vulnerable to an encryption oracle attack against the client. This policy controls compatibility with vulnerable clients and servers and allows you to set the level of protection desired for the encryption oracle vulnerability. The recommended state for this setting is: Enabled: Force Updated Clients." + rationale: "This setting is important to mitigate the CredSSP encryption oracle vulnerability, for which information was published by Microsoft on 03/13/2018 in CVE-2018-0886 | CredSSP Remote Code Execution Vulnerability. All versions of Windows Server from Server 2008 (non-R2) onwards are affected by this vulnerability, and will be compatible with this recommendation provided that they have been patched up through May 2018 (or later)." + impact: "Client applications which use CredSSP will not be able to fall back to the insecure versions and services using CredSSP will not accept unpatched clients. This setting should not be deployed until all remote hosts support the newest version, which is achieved by ensuring that all Microsoft security updates at least through May 2018 are installed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Force Updated Clients: Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Encryption Oracle Remediation Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1803 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.4.1"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters -> AllowEncryptionOracle' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters -> AllowEncryptionOracle -> 0' + + # 18.9.4.2 (L1) Ensure 'Remote host allows delegation of non- exportable credentials' is set to 'Enabled'. (Automated) + - id: 27200 + title: "Ensure 'Remote host allows delegation of non- exportable credentials' is set to 'Enabled'." + description: "Remote host allows delegation of non-exportable credentials. When using credential delegation, devices provide an exportable version of credentials to the remote host. This exposes users to the risk of credential theft from attackers on the remote host. The Restricted Admin Mode and Windows Defender Remote Credential Guard features are two options to help protect against this risk. The recommended state for this setting is: Enabled. Note: More detailed information on Windows Defender Remote Credential Guard and how it compares to Restricted Admin Mode can be found at this link: Protect Remote Desktop credentials with Windows Defender Remote Credential Guard (Windows 10) | Microsoft Docs." + rationale: "Restricted Admin Mode was designed to help protect administrator accounts by ensuring that reusable credentials are not stored in memory on remote devices that could potentially be compromised. Windows Defender Remote Credential Guard helps you protect your credentials over a Remote Desktop connection by redirecting Kerberos requests back to the device that is requesting the connection. Both features should be enabled and supported, as they reduce the chance of credential theft." + impact: "The host will support the Restricted Admin Mode and Windows Defender Remote Credential Guard features." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Credentials Delegation\\Remote host allows delegation of non-exportable credentials Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredSsp.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/windows/security/identity-protection/remote-credential-guard" + compliance: + - cis: ["18.9.4.2"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["16.5"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation -> AllowProtectedCreds -> 1' + + # 18.9.5.1 (NG) Ensure 'Turn On Virtualization Based Security' is set to 'Enabled'. (Automated) + - id: 27201 + title: "Ensure 'Turn On Virtualization Based Security' is set to 'Enabled'." + description: "This policy setting specifies whether Virtualization Based Security is enabled. Virtualization Based Security uses the Windows Hypervisor to provide support for security services. The recommended state for this setting is: Enabled Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Kerberos, NTLM, and Credential manager isolate secrets by using virtualization-based security. Previous versions of Windows stored secrets in the Local Security Authority (LSA). Prior to Windows 10, the LSA stored secrets used by the operating system in its process memory. With Windows Defender Credential Guard enabled, the LSA process in the operating system talks to a new component called the isolated LSA process that stores and protects those secrets. Data stored by the isolated LSA process is protected using virtualization-based security and is not accessible to the rest of the operating system." + impact: "Warning: All drivers on the system must be compatible with this feature or the system may crash. Ensure that this policy setting is only deployed to computers which are known to be compatible. Warning #2: Enabling Windows Defender Credential Guard on Domain Controllers is not supported. The domain controller hosts authentication services which integrate with processes isolated when Windows Defender Credential Guard is enabled, causing crashes." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.1"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> EnableVirtualizationBasedSecurity' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> EnableVirtualizationBasedSecurity -> 1' + + # 18.9.5.2 (NG) Ensure 'Turn On Virtualization Based Security: Select Platform Security Level' is set to 'Secure Boot' or higher. (Automated) + - id: 27202 + title: "Ensure 'Turn On Virtualization Based Security: Select Platform Security Level' is set to 'Secure Boot' or higher." + description: "This policy setting specifies whether Virtualization Based Security (VBS) is enabled. VBS uses the Windows Hypervisor to provide support for security services. The recommended state for this setting is: Secure Boot or Secure Boot and DMA Protection. Note: VBS requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Secure Boot can help reduce the risk of bootloader attacks and in conjunction with DMA protections to help protect data from being scraped from memory." + impact: "Choosing the Secure Boot option provides the system with as much protection as is supported by the computer's hardware. A system with input/output memory management units (IOMMUs) will have Secure Boot with DMA protection. A system without IOMMUs will simply have Secure Boot enabled without DMA protection. Choosing the Secure Boot with DMA protection option requires the system to have IOMMUs in order to enable VBS. Without IOMMU hardware support, VBS will be disabled. Warning: All drivers on the system must be compatible with this feature or the system may crash. Ensure that this policy setting is only deployed to computers which are known to be compatible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Secure Boot or Secure Boot and DMA Protection: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Select Platform Security Level Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.2"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> RequirePlatformSecurityFeatures' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> RequirePlatformSecurityFeatures -> 3' + + # 18.9.5.3 (NG) Ensure 'Turn On Virtualization Based Security: Virtualization Based Protection of Code Integrity' is set to 'Enabled with UEFI lock'. (Automated) + - id: 27203 + title: "Ensure 'Turn On Virtualization Based Security: Virtualization Based Protection of Code Integrity' is set to 'Enabled with UEFI lock'." + description: "This setting enables virtualization based protection of Kernel Mode Code Integrity. When this is enabled, kernel mode memory protections are enforced and the Code Integrity validation path is protected by the Virtualization Based Security feature. The recommended state for this setting is: Enabled with UEFI lock Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "The Enabled with UEFI lock option ensures that Virtualization Based Protection of Code Integrity cannot be disabled remotely." + impact: "Warning: All drivers on the system must be compatible with this feature or the system may crash. Ensure that this policy setting is only deployed to computers which are known to be compatible. Warning #2: Once this setting is turned on and active, Virtualization Based Security cannot be disabled solely via GPO or any other remote method. After removing the setting from GPO, the features must also be manually disabled locally at the machine using the steps provided at this link: Manage Windows Defender Credential Guard (Windows 10) | Microsoft Docs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with UEFI lock: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Virtualization Based Protection of Code Integrity Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.3"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HypervisorEnforcedCodeIntegrity' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HypervisorEnforcedCodeIntegrity -> 1' + + # 18.9.5.4 (NG) Ensure 'Turn On Virtualization Based Security: Require UEFI Memory Attributes Table' is set to 'True (checked)'. (Automated) + - id: 27204 + title: "Ensure 'Turn On Virtualization Based Security: Require UEFI Memory Attributes Table' is set to 'True (checked)'." + description: "This option will only enable Virtualization Based Protection of Code Integrity on devices with UEFI firmware support for the Memory Attributes Table. Devices without the UEFI Memory Attributes Table may have firmware that is incompatible with Virtualization Based Protection of Code Integrity which in some cases can lead to crashes or data loss or incompatibility with certain plug-in cards. If not setting this option the targeted devices should be tested to ensure compatibility. The recommended state for this setting is: True (checked) Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "This setting will help protect this control from being enabled on a system that is not compatible which could lead to a crash or data loss." + impact: "Warning: All drivers on the system must be compatible with this feature or the system may crash. Ensure that this policy setting is only deployed to computers which are known to be compatible." + remediation: "To establish the recommended configuration via GP, set the following UI path to TRUE: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Require UEFI Memory Attributes Table Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.4"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HVCIMATRequired' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> HVCIMATRequired -> 1' + + # 18.9.5.5 (NG) Ensure 'Turn On Virtualization Based Security: Credential Guard Configuration' is set to 'Enabled with UEFI lock' (MS Only). (Automated) + - id: 27205 + title: "Ensure 'Turn On Virtualization Based Security: Credential Guard Configuration' is set to 'Enabled with UEFI lock' (MS Only)." + description: 'This setting lets users turn on Credential Guard with virtualization-based security to help protect credentials. The "Enabled with UEFI lock" option ensures that Credential Guard cannot be disabled remotely. In order to disable the feature, you must set the Group Policy to "Disabled" as well as remove the security functionality from each computer, with a physically present user, in order to clear configuration persisted in UEFI. The recommended state for this setting is: Enabled with UEFI lock, but only on Member Servers (not Domain Controllers). Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs.' + rationale: "The Enabled with UEFI lock option ensures that Credential Guard cannot be disabled remotely." + impact: "Warning: All drivers on the system must be compatible with this feature or the system may crash. Ensure that this policy setting is only deployed to computers which are known to be compatible. Warning #2: Enabling Windows Defender Credential Guard on Domain Controllers is not supported. The domain controller hosts authentication services which integrate with processes isolated when Windows Defender Credential Guard is enabled, causing crashes. Warning #3: Once this setting is turned on and active, Credential Guard cannot be disabled solely via GPO or any other remote method. After removing the setting from GPO, the features must also be manually disabled locally at the machine using the steps provided at this link: Manage Windows Defender Credential Guard (Windows 10) | Microsoft Docs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled with UEFI lock (on Member Servers only): Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Credential Guard Configuration Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.5"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> LsaCfgFlags' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> LsaCfgFlags -> 1' + + # 18.9.5.6 (NG) Ensure 'Turn On Virtualization Based Security: Credential Guard Configuration' is set to 'Disabled' (DC Only). (Automated) + - id: 27206 + title: "Ensure 'Turn On Virtualization Based Security: Credential Guard Configuration' is set to 'Disabled' (DC Only)." + description: "This setting lets users turn on Credential Guard with virtualization-based security to help protect credentials. The recommended state for this setting is: Disabled on Domain Controllers. Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Credential Guard is not useful on Domain Controllers and can cause crashes on them." + impact: "None - this is the default behavior. Warning: Enabling Windows Defender Credential Guard on Domain Controllers is not supported. The domain controller hosts authentication services which integrate with processes isolated when Windows Defender Credential Guard is enabled, causing crashes. Manage Windows Defender Credential Guard (Windows 10) | Microsoft Docs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Credential Guard Configuration Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.6"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> LsaCfgFlags' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> LsaCfgFlags -> 0' + + # 18.9.5.7 (NG) Ensure 'Turn On Virtualization Based Security: Secure Launch Configuration' is set to 'Enabled'. (Automated) + - id: 27207 + title: "Ensure 'Turn On Virtualization Based Security: Secure Launch Configuration' is set to 'Enabled'." + description: "Secure Launch protects the Virtualization Based Security environment from exploited vulnerabilities in device firmware. The recommended state for this setting is: Enabled. Note: Virtualization Based Security requires a 64-bit version of Windows with Secure Boot enabled, which in turn requires that Windows was installed with a UEFI BIOS configuration, not a Legacy BIOS configuration. In addition, if running Windows on a virtual machine, the hardware-assisted CPU virtualization feature (Intel VT-x or AMD-V) must be exposed by the host to the guest VM. More information on system requirements for this feature can be found at Windows Defender Credential Guard Requirements (Windows 10) | Microsoft Docs Note #2: Credential Guard and Device Guard are not currently supported when using Azure IaaS VMs." + rationale: "Secure Launch changes the way windows boots to use Intel Trusted Execution Technology (TXT) and Runtime BIOS Resilience features to prevent firmware exploits from being able to impact the security of the Windows Virtualization Based Security environment." + impact: "Warning: All drivers on the system must be compatible with this feature or the system may crash. Ensure that this policy setting is only deployed to computers which are known to be compatible." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Guard\\Turn On Virtualization Based Security: Secure Launch Configuration Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DeviceGuard.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.5.7"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> ConfigureSystemGuardLaunch' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DeviceGuard -> ConfigureSystemGuardLaunch -> 1' + + # 18.9.7.2 (L1) Ensure 'Prevent device metadata retrieval from the Internet' is set to 'Enabled'. (Automated) + - id: 27208 + title: "Ensure 'Prevent device metadata retrieval from the Internet' is set to 'Enabled'." + description: "This policy setting allows you to prevent Windows from retrieving device metadata from the Internet. The recommended state for this setting is: Enabled. Note: This will not prevent the installation of basic hardware drivers, but does prevent associated third-party utility software from automatically being installed under the context of the SYSTEM account." + rationale: "Installation of software should be conducted by an authorized system administrator and not a standard user. Allowing automatic third-party software installations under the context of the SYSTEM account has potential for allowing unauthorized access via backdoors or installation software bugs." + impact: "Standard users without administrator privileges will not be able to install associated third-party utility software for peripheral devices. This may limit the use of advanced features of those devices unless/until an administrator installs the associated utility software for the device." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Device Installation\\Prevent device metadata retrieval from the Internet Note: This Group Policy path is provided by the Group Policy template DeviceInstallation.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates, or with the Group Policy template DeviceSetup.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.7.2"] + - cis_csc_v7: ["18.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata -> PreventDeviceMetadataFromNetwork' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata -> PreventDeviceMetadataFromNetwork -> 1' + + # 18.9.13.1 (L1) Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'. (Automated) + - id: 27209 + title: "Ensure 'Boot-Start Driver Initialization Policy' is set to 'Enabled: Good, unknown and bad but critical'." + description: "This policy setting allows you to specify which boot-start drivers are initialized based on a classification determined by an Early Launch Antimalware boot-start driver. The Early Launch Antimalware boot-start driver can return the following classifications for each boot-start driver: - Good: The driver has been signed and has not been tampered with. - Bad: The driver has been identified as malware. It is recommended that you do not allow known bad drivers to be initialized. - Bad, but required for boot: The driver has been identified as malware, but the computer cannot successfully boot without loading this driver. - Unknown: This driver has not been attested to by your malware detection application and has not been classified by the Early Launch Antimalware boot-start driver. If you enable this policy setting you will be able to choose which boot-start drivers to initialize the next time the computer is started. If your malware detection application does not include an Early Launch Antimalware boot-start driver or if your Early Launch Antimalware boot-start driver has been disabled, this setting has no effect and all boot-start drivers are initialized. The recommended state for this setting is: Enabled: Good, unknown and bad but critical." + rationale: "This policy setting helps reduce the impact of malware that has already infected your system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Good, unknown and bad but critical: Computer Configuration\\Policies\\Administrative Templates\\System\\Early Launch Antimalware\\Boot-Start Driver Initialization Policy Note: This Group Policy path may not exist by default. It is provided by the Group Policy template EarlyLaunchAM.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.13.1"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\EarlyLaunch -> DriverLoadPolicy -> 3' + + # 18.9.19.2 (L1) Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'. (Automated) + - id: 27210 + title: "Ensure 'Configure registry policy processing: Do not apply during periodic background processing' is set to 'Enabled: FALSE'." + description: 'The "Do not apply during periodic background processing" option prevents the system from updating affected policies in the background while the computer is in use. When background updates are disabled, policy changes will not take effect until the next user logon or system restart. The recommended state for this setting is: Enabled: FALSE (unchecked).' + rationale: "Setting this option to false (unchecked) will ensure that domain policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + impact: "Group Policies will be reapplied every time they are refreshed, which could have a slight impact on performance." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Do not apply during periodic background processing option to FALSE (unchecked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.19.2"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.2"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoBackgroundPolicy -> 0' + + # 18.9.19.3 (L1) Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'. (Automated) + - id: 27211 + title: "Ensure 'Configure registry policy processing: Process even if the Group Policy objects have not changed' is set to 'Enabled: TRUE'." + description: 'The "Process even if the Group Policy objects have not changed" option updates and reapplies policies even if the policies have not changed. The recommended state for this setting is: Enabled: TRUE (checked).' + rationale: "Setting this option to true (checked) will ensure unauthorized changes that might have been configured locally are forced to match the domain-based Group Policy settings again." + impact: "Group Policies will be reapplied even if they have not been changed, which could have a slight impact on performance." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled, then set the Process even if the Group Policy objects have not changed option to TRUE (checked): Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Configure registry policy processing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.19.3"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.2"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Group Policy\{35378EAC-683F-11D2-A89A-00C04FBBCFA2} -> NoGPOListChanges -> 0' + + # 18.9.19.4 (L1) Ensure 'Continue experiences on this device' is set to 'Disabled'. (Automated) + - id: 27212 + title: "Ensure 'Continue experiences on this device' is set to 'Disabled'." + description: "This policy setting determines whether the Windows device is allowed to participate in cross-device experiences (continue experiences). The recommended state for this setting is: Disabled." + rationale: "A cross-device experience is when a system can access app and send messages to other devices. In an enterprise managed environment only trusted systems should be communicating within the network. Access to any other system should be prohibited." + impact: "The Windows device will not be discoverable by other devices, and cannot participate in cross-device experiences." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Continue experiences on this device Note: This Group Policy path may not exist by default. It is provided by the Group Policy template GroupPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.19.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableCdp' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableCdp -> 0' + + # 18.9.19.5 (L1) Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'. (Automated) + - id: 27213 + title: "Ensure 'Turn off background refresh of Group Policy' is set to 'Disabled'." + description: "This policy setting prevents Group Policy from being updated while the computer is in use. This policy setting applies to Group Policy for computers, users and Domain Controllers. The recommended state for this setting is: Disabled." + rationale: "This setting ensures that group policy changes take effect more quickly, as compared to waiting until the next user logon or system restart." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Group Policy\\Turn off background refresh of Group Policy Note: This Group Policy path is provided by the Group Policy template GroupPolicy.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.19.5"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.4"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.2"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableBkGndGroupPolicy' + + # 18.9.20.1.1 (L1) Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'. (Automated) + - id: 27214 + title: "Ensure 'Turn off downloading of print drivers over HTTP' is set to 'Enabled'." + description: "This policy setting controls whether the computer can download print driver packages over HTTP. To set up HTTP printing, printer drivers that are not available in the standard operating system installation might need to be downloaded over HTTP. The recommended state for this setting is: Enabled." + rationale: "Users might download drivers that include malicious code." + impact: "Print drivers cannot be downloaded over HTTP. Note: This policy setting does not prevent the client computer from printing to printers on the intranet or the Internet over HTTP. It only prohibits downloading drivers that are not already installed locally." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off downloading of print drivers over HTTP Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.1"] + - cis_csc_v8: ["2.5"] + - cis_csc_v7: ["2.7"] + - cmmc_v2.0: ["CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "CM.L2-3.4.9"] + - iso_27001-2013: ["A.12.1.2", "A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-7(5)"] + - pci_dss_v4.0: ["1.2.5", "2.2.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableWebPnPDownload -> 1' + + # 18.9.20.1.2 (L2) Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'. (Automated) + - id: 27215 + title: "Ensure 'Turn off handwriting personalization data sharing' is set to 'Enabled'." + description: "This setting turns off data sharing from the handwriting recognition personalization tool. The handwriting recognition personalization tool enables Tablet PC users to adapt handwriting recognition to their own writing style by providing writing samples. The tool can optionally share user writing samples with Microsoft to improve handwriting recognition in future versions of Windows. The tool generates reports and transmits them to Microsoft over a secure connection. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + impact: "Tablet PC users cannot choose to share writing samples from the handwriting recognition personalization tool with Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting personalization data sharing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template ShapeCollector.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.20.1.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\TabletPC -> PreventHandwritingDataSharing -> 1' + + # 18.9.20.1.3 (L2) Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'. (Automated) + - id: 27216 + title: "Ensure 'Turn off handwriting recognition error reporting' is set to 'Enabled'." + description: "Turns off the handwriting recognition error reporting tool. The handwriting recognition error reporting tool enables users to report errors encountered in Tablet PC Input Panel. The tool generates error reports and transmits them to Microsoft over a secure connection. Microsoft uses these error reports to improve handwriting recognition in future versions of Windows. The recommended state for this setting is: Enabled." + rationale: "A person's handwriting is Personally Identifiable Information (PII), especially when it comes to your signature. As such, it is unacceptable in many environments to automatically upload PII to a website without explicit approval by the user." + impact: "Users cannot start the handwriting recognition error reporting tool or send error reports to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off handwriting recognition error reporting Note: This Group Policy path is provided by the Group Policy template InkWatson.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\HandwritingErrorReports -> PreventHandwritingErrorReports -> 1' + + # 18.9.20.1.4 (L2) Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'. (Automated) + - id: 27217 + title: "Ensure 'Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com' is set to 'Enabled'." + description: "This policy setting specifies whether the Internet Connection Wizard can connect to Microsoft to download a list of Internet Service Providers (ISPs). The recommended state for this setting is: Enabled." + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + impact: 'The "Choose a list of Internet Service Providers" path in the Internet Connection Wizard causes the wizard to exit. This prevents users from retrieving the list of ISPs, which resides on Microsoft servers.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet Connection Wizard if URL connection is referring to Microsoft.com Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Internet Connection Wizard -> ExitOnMSICW -> 1' + + # 18.9.20.1.5 (L1) Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'. (Automated) + - id: 27218 + title: "Ensure 'Turn off Internet download for Web publishing and online ordering wizards' is set to 'Enabled'." + description: "This policy setting controls whether Windows will download a list of providers for the Web publishing and online ordering wizards. The recommended state for this setting is: Enabled." + rationale: "Although the risk is minimal, enabling this setting will reduce the possibility of a user unknowingly downloading malicious content through this feature." + impact: "Windows is prevented from downloading providers; only the service providers cached in the local registry are displayed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Internet download for Web publishing and online ordering wizards Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoWebServices -> 1' + + # 18.9.20.1.6 (L2) Ensure 'Turn off printing over HTTP' is set to 'Enabled'. (Automated) + - id: 27219 + title: "Ensure 'Turn off printing over HTTP' is set to 'Enabled'." + description: "This policy setting allows you to disable the client computer's ability to print over HTTP, which allows the computer to print to printers on the intranet as well as the Internet. The recommended state for this setting is: Enabled. Note: This control affects printing over both HTTP and HTTPS." + rationale: "Information that is transmitted over HTTP through this capability is not protected and can be intercepted by malicious users. For this reason, it is not often used in enterprise managed environments." + impact: "The client computer will not be able to print to Internet printers over HTTP or HTTPS. Note: This policy setting affects the client side of Internet printing only. Regardless of how it is configured, a computer could act as an Internet Printing server and make its shared printers available through HTTP." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off printing over HTTP Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.6"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["13.3"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Printers -> DisableHTTPPrinting -> 1' + + # 18.9.20.1.7 (L2) Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'. (Automated) + - id: 27220 + title: "Ensure 'Turn off Registration if URL connection is referring to Microsoft.com' is set to 'Enabled'." + description: "This policy setting specifies whether the Windows Registration Wizard connects to Microsoft.com for online registration. The recommended state for this setting is: Enabled." + rationale: "Users in an enterprise managed environment should not be registering their own copies of Windows, providing their own PII in the process." + impact: "Users are blocked from connecting to Microsoft.com for online registration and they cannot register their copy of Windows online." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Registration if URL connection is referring to Microsoft.com Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Registration Wizard Control -> NoRegistration -> 1' + + # 18.9.20.1.8 (L2) Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'. (Automated) + - id: 27221 + title: "Ensure 'Turn off Search Companion content file updates' is set to 'Enabled'." + description: "This policy setting specifies whether Search Companion should automatically download content updates during local and Internet searches. The recommended state for this setting is: Enabled." + rationale: "There is a small risk that users will unknowingly reveal sensitive information because of the topics they are searching for. This risk is very low because even if this setting is enabled users still must submit search queries to the desired search engine in order to perform searches." + impact: "Search Companion does not download content updates during searches. Note: Internet searches will still send the search text and information about the search to Microsoft and the chosen search provider. If you select Classic Search, the Search Companion feature will be unavailable. You can select Classic Search by clicking Start, Search, Change Preferences, and then Change Internet Search Behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Search Companion content file updates Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.8"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SearchCompanion -> DisableContentFileUpdates -> 1' + + # 18.9.20.1.9 (L2) Ensure 'Turn off the "Order Prints" picture task' is set to 'Enabled'. (Automated) + - id: 27222 + title: 'Ensure ''Turn off the "Order Prints" picture task'' is set to ''Enabled''.' + description: 'This policy setting specifies whether the "Order Prints Online" task is available from Picture Tasks in Windows folders. The Order Prints Online Wizard is used to download a list of providers and allow users to order prints online. The recommended state for this setting is: Enabled.' + rationale: "In an enterprise managed environment we want to lower the risk of a user unknowingly exposing sensitive data." + impact: 'The task "Order Prints Online" is removed from Picture Tasks in File Explorer folders.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Order Prints\" picture task Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.9"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoOnlinePrintsWizard -> 1' + + # 18.9.20.1.10 (L2) Ensure 'Turn off the "Publish to Web" task for files and folders' is set to 'Enabled'. (Automated) + - id: 27223 + title: 'Ensure ''Turn off the "Publish to Web" task for files and folders'' is set to ''Enabled''.' + description: "This policy setting specifies whether the tasks Publish this file to the Web, Publish this folder to the Web, and Publish the selected items to the Web are available from File and Folder Tasks in Windows folders. The recommended state for this setting is: Enabled." + rationale: "Users may publish confidential or sensitive information to a public service outside of the control of the organization." + impact: 'The "Publish to Web" task is removed from File and Folder tasks in Windows folders.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the \"Publish to Web\" task for files and folders Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.10"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoPublishingWizard -> 1' + + # 18.9.20.1.11 (L2) Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'. (Automated) + - id: 27224 + title: "Ensure 'Turn off the Windows Messenger Customer Experience Improvement Program' is set to 'Enabled'." + description: "This policy setting specifies whether Windows Messenger can collect anonymous information about how the Windows Messenger software and service is used. Microsoft uses information collected through the Customer Experience Improvement Program to detect software flaws so that they can be corrected more quickly, enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + impact: "Windows Messenger will not collect usage information, and the user settings to enable the collection of usage information will not be shown." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off the Windows Messenger Customer Experience Improvement Program Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.11"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Messenger\Client -> CEIP -> 2' + + # 18.9.20.1.12 (L2) Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'. (Automated) + - id: 27225 + title: "Ensure 'Turn off Windows Customer Experience Improvement Program' is set to 'Enabled'." + description: "This policy setting specifies whether the Windows Customer Experience Improvement Program can collect anonymous information about how Windows is used. Microsoft uses information collected through the Windows Customer Experience Improvement Program to improve features that are most used and to detect flaws so that they can be corrected more quickly. Enabling this setting will reduce the amount of data Microsoft is able to gather for this purpose. The recommended state for this setting is: Enabled." + rationale: "Large enterprise managed environments may not want to have information collected by Microsoft from managed client computers." + impact: "All users are opted out of the Windows Customer Experience Improvement Program." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Customer Experience Improvement Program Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.12"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\SQMClient\Windows -> CEIPEnable -> 0' + + # 18.9.20.1.13 (L2) Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'. (Automated) + - id: 27226 + title: "Ensure 'Turn off Windows Error Reporting' is set to 'Enabled'." + description: "This policy setting controls whether or not errors are reported to Microsoft. Error Reporting is used to report information about a system or application that has failed or has stopped responding and is used to improve the quality of the product. The recommended state for this setting is: Enabled." + rationale: "If a Windows Error occurs in a secure, enterprise managed environment, the error should be reported directly to IT staff for troubleshooting and remediation. There is no benefit to the corporation to report these errors directly to Microsoft, and there is some risk of unknowingly exposing sensitive data as part of the error." + impact: "Users are not given the option to report errors to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Internet Communication Management\\Internet Communication settings\\Turn off Windows Error Reporting Note: This Group Policy path is provided by the Group Policy template ICM.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.20.1.13"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting -> Disabled -> 1' + + # 18.9.23.1 (L2) Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic'. (Automated) + - id: 27227 + title: "Ensure 'Support device authentication using certificate' is set to 'Enabled: Automatic'." + description: "This policy setting allows you to set support for Kerberos to attempt authentication using the certificate for the device to the domain. Support for device authentication using certificate will require connectivity to a DC in the device account domain which supports certificate authentication for computer accounts. The recommended state for this setting is: Enabled: Automatic." + rationale: "Having stronger device authentication with the use of certificates is strongly encouraged over standard username and password authentication. Having this set to Automatic will allow certificate based authentication to be used whenever possible." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Automatic: Computer Configuration\\Policies\\Administrative Templates\\System\\Kerberos\\Support device authentication using certificate Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Kerberos.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.23.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitBehavior' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitBehavior -> 0' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\kerberos\parameters -> DevicePKInitEnabled -> 1' + + # 18.9.24.1 (L1) Ensure 'Enumeration policy for external devices incompatible with Kernel DMA Protection' is set to 'Enabled: Block All'. (Automated) + - id: 27228 + title: "Ensure 'Enumeration policy for external devices incompatible with Kernel DMA Protection' is set to 'Enabled: Block All'." + description: "This policy is intended to provide additional security against external DMA-capable devices. It allows for more control over the enumeration of external DMA-capable devices that are not compatible with DMA Remapping/device memory isolation and sandboxing. The recommended state for this setting is: Enabled: Block All. Note: This policy does not apply to 1394, PCMCIA or ExpressCard devices. The protection also only applies to Windows 10 R1803 or higher, and also requires a UEFI BIOS to function. Note #2: More information on this feature is available at this link: Kernel DMA Protection for Thunderbolt (TM) 3 (Windows 10) | Microsoft Docs." + rationale: "Device memory sandboxing allows the OS to leverage the I/O Memory Management Unit (IOMMU) of a device to block unpermitted I/O, or memory access, by the peripheral." + impact: "External devices that are not compatible with DMA-remapping will not be enumerated and will not function unless/until the user has logged in successfully and has an unlocked user session. Once enumerated, these devices will continue to function, regardless of the state of the session. Devices that are compatible with DMA-remapping will be enumerated immediately, with their device memory isolated." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block All: Computer Configuration\\Policies\\Administrative Templates\\System\\Kernel DMA Protection\\Enumeration policy for external devices incompatible with Kernel DMA Protection Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DmaGuard.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.24.1"] + - cis_csc_v7: ["1.4"] + - iso_27001-2013: ["A.8.1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Kernel DMA Protection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Kernel DMA Protection -> DeviceEnumerationPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Kernel DMA Protection -> DeviceEnumerationPolicy -> 0' + + # 18.9.25.1 (L1) Ensure 'Allow Custom SSPs and APs to be loaded into LSASS' is set to 'Disabled'. (Automated) + - id: 27229 + title: "Ensure 'Allow Custom SSPs and APs to be loaded into LSASS' is set to 'Disabled'." + description: "This policy setting controls the configuration under which the Local Security Authority Subsystem Service (LSASS) will load custom Security Support Provider/Authentication Package (SSP/AP). The recommended state for this setting is: Disabled." + rationale: "Vulnerabilities exist where attackers are able to intercept logon credentials via SSP/AP. Disabling Custom SSPs and APs to be loaded into LSASS minimizes this vulnerability." + impact: "Custom Security Support Provider/Authentication Packages will not be permitted to load this may impact some legitimate third-party packages." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Local Security Authority\\Allow Custom SSPs and APs to be loaded into LSASS." + references: + - "https://learn.microsoft.com/en-us/windows/win32/secauthn/ssp-aps-versus-ssps" + compliance: + - cis: ["18.9.25.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowCustomSSPsAPs' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowCustomSSPsAPs -> 0' + + # 18.9.25.2 (NG) Ensure 'Configures LSASS to run as a protected process' is set to 'Enabled: Enabled with UEFI Lock'. (Automated) + - id: 27230 + title: "Ensure 'Configures LSASS to run as a protected process' is set to 'Enabled: Enabled with UEFI Lock'." + description: "This policy setting controls whether the Local Security Authority Subservice Service (LSASS) runs in protected mode and also has the option to lock in protected mode with Unified Extensible Firmware Interface (UEFI). The Local Security Authority (LSA), which includes the LSASS process, validates users for local and remote sign-ins and enforces local security policies. The recommended state for this setting is: Enabled: Enabled with UEFI Lock. Note: This additional protection to prevent reading memory and code injection by non-protected processes is supported by Windows 8.1 (and newer)." + rationale: "Provides added security for the credentials that LSA stores and manages. Enabling this setting with UEFI Lock prevents the setting from being changed remotely." + impact: "Once this setting has been applied (Enabled), removing the group policy setting (set to Not Configured) will not reverse the impact. In order to reverse the impact, you must explicitly configure this setting to Disabled and follow Microsoft's documentation on disabling the UEFI Lock." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Enabled with UEFI Lock: Computer Configuration\\Policies\\Administrative Templates\\System\\Local Security Authority\\Configures LSASS to run as a protected process." + references: + - "https://learn.microsoft.com/en-us/windows-server/security/credentials-protection-and-management/configuring-additional-lsa-protection" + - "https://learn.microsoft.com/en-us/windows/security/identity-protection/credential-guard/credential-guard-manage#disabling-windows-defender-credential-guard-with-uefi-lock" + compliance: + - cis: ["18.9.25.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RunAsPPL' + - 'r:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -> RunAsPPL -> 1' + + # 18.9.26.1 (L2) Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'. (Automated) + - id: 27231 + title: "Ensure 'Disallow copying of user input methods to the system account for sign-in' is set to 'Enabled'." + description: "This policy prevents automatic copying of user input methods to the system account for use on the sign-in screen. The user is restricted to the set of input methods that are enabled in the system account. The recommended state for this setting is: Enabled." + rationale: "This is a way to increase the security of the system account." + impact: "Users will have input methods enabled for the system account on the sign-in page." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Locale Services\\Disallow copying of user input methods to the system account for sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Globalization.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.26.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Control Panel\International -> BlockUserInputMethodsForSignIn -> 1' + + # 18.9.27.1 (L1) Ensure 'Block user from showing account details on sign-in' is set to 'Enabled'. (Automated) + - id: 27232 + title: "Ensure 'Block user from showing account details on sign-in' is set to 'Enabled'." + description: "This policy prevents the user from showing account details (email address or user name) on the sign-in screen. The recommended state for this setting is: Enabled." + rationale: "An attacker with access to the console (for example, someone with physical access or someone who is able to connect to the server through Remote Desktop Services) could view the name of the last user who logged on to the server. The attacker could then try to guess the password, use a dictionary, or use a brute-force attack to try and log on." + impact: "The user cannot choose to show account details on the sign-in screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Block user from showing account details on sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.27.1"] + - cis_csc_v8: ["4.1"] + - cis_csc_v7: ["5.1"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "CM.L2-3.4.1", "CM.L2-3.4.2", "CM.L2-3.4.6", "CM.L2-3.4.7"] + - iso_27001-2013: ["A.14.2.5", "A.8.1.3"] + - nist_sp_800-53: ["CM-7(1)", "CM-9", "SA-10"] + - pci_dss_v3.2.1: ["11.5", "2.2"] + - pci_dss_v4.0: ["1.1.1", "1.2.1", "1.2.6", "1.2.7", "1.5.1", "2.1.1", "2.2.1"] + - soc_2: ["CC7.1", "CC8.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockUserFromShowingAccountDetailsOnSignin' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockUserFromShowingAccountDetailsOnSignin -> 1' + + # 18.9.27.2 (L1) Ensure 'Do not display network selection UI' is set to 'Enabled'. (Automated) + - id: 27233 + title: "Ensure 'Do not display network selection UI' is set to 'Enabled'." + description: "This policy setting allows you to control whether anyone can interact with available networks UI on the logon screen. The recommended state for this setting is: Enabled." + rationale: "An unauthorized user could disconnect the PC from the network or can connect the PC to other available networks without signing into Windows." + impact: "The PC's network connectivity state cannot be changed without signing into Windows." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not display network selection UI Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.27.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontDisplayNetworkSelectionUI -> 1' + + # 18.9.27.3 (L1) Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'. (Automated) + - id: 27234 + title: "Ensure 'Do not enumerate connected users on domain-joined computers' is set to 'Enabled'." + description: "This policy setting prevents connected users from being enumerated on domain-joined computers. The recommended state for this setting is: Enabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + impact: "The Logon UI will not enumerate any connected users on domain-joined computers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Do not enumerate connected users on domain-joined computers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.27.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DontEnumerateConnectedUsers -> 1' + + # 18.9.27.4 (L1) Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled' (MS only). (Automated) + - id: 27235 + title: "Ensure 'Enumerate local users on domain-joined computers' is set to 'Disabled' (MS only)." + description: "This policy setting allows local users to be enumerated on domain-joined computers. The recommended state for this setting is: Disabled." + rationale: "A malicious user could use this feature to gather account names of other users, that information could then be used in conjunction with other types of attacks such as guessing passwords or social engineering. The value of this countermeasure is small because a user with domain credentials could gather the same account information using other methods." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Enumerate local users on domain-joined computers Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.27.4"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnumerateLocalUsers -> 0' + + # 18.9.27.5 (L1) Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled'. (Automated) + - id: 27236 + title: "Ensure 'Turn off app notifications on the lock screen' is set to 'Enabled'." + description: "This policy setting allows you to prevent app notifications from appearing on the lock screen. The recommended state for this setting is: Enabled." + rationale: "App notifications might display sensitive business or personal data." + impact: "No app notifications are displayed on the lock screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off app notifications on the lock screen Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Logon.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.27.5"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> DisableLockScreenAppNotifications -> 1' + + # 18.9.27.6 (L1) Ensure 'Turn off picture password sign-in' is set to 'Enabled'. (Automated) + - id: 27237 + title: "Ensure 'Turn off picture password sign-in' is set to 'Enabled'." + description: "This policy setting allows you to control whether a domain user can sign in using a picture password. The recommended state for this setting is: Enabled. Note: If the picture password feature is permitted, the user's domain password is cached in the system vault when using it." + rationale: "Picture passwords bypass the requirement for a typed complex password. In a shared work environment, a simple shoulder surf where someone observed the on-screen gestures would allow that person to gain access to the system without the need to know the complex password. Vertical monitor screens with an image are much more visible at a distance than horizontal key strokes, increasing the likelihood of a successful observation of the mouse gestures." + impact: "Users will not be able to set up or sign in with a picture password." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn off picture password sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.27.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> BlockDomainPicturePassword -> 1' + + # 18.9.27.7 (L1) Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'. (Automated) + - id: 27238 + title: "Ensure 'Turn on convenience PIN sign-in' is set to 'Disabled'." + description: "This policy setting allows you to control whether a domain user can sign in using a convenience PIN. In Windows 10, convenience PIN was replaced with Passport, which has stronger security properties. To configure Passport for domain users, use the policies under Computer Configuration\\Administrative Templates\\Windows Components\\Microsoft Passport for Work. Note: The user's domain password will be cached in the system vault when using this feature. The recommended state for this setting is: Disabled." + rationale: "A PIN is created from a much smaller selection of characters than a password, so in most cases a PIN will be much less robust than a password." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Logon\\Turn on convenience PIN sign-in Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredentialProviders.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn on PIN sign-in, but it was renamed starting with the Windows 10 Release 1511 Administrative Templates." + compliance: + - cis: ["18.9.27.7"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowDomainPINLogon -> 0' + + # 18.9.30.1 (L2) Ensure 'Allow Clipboard synchronization across devices' is set to 'Disabled'. (Automated) + - id: 27239 + title: "Ensure 'Allow Clipboard synchronization across devices' is set to 'Disabled'." + description: "This policy setting determines whether Clipboard contents can be synchronized across devices. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, clipboard data should stay local to the system and not synced across devices." + impact: "If you disable this policy setting, Clipboard contents cannot be shared to other devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\OS Policies\\Allow Clipboard synchronization across devices." + compliance: + - cis: ["18.9.30.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowCrossDeviceClipboard' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> AllowCrossDeviceClipboard -> 0' + + # 18.9.30.2 (L2) Ensure 'Allow upload of User Activities' is set to 'Disabled'. (Automated) + - id: 27240 + title: "Ensure 'Allow upload of User Activities' is set to 'Disabled'." + description: "This policy setting determines whether published User Activities can be uploaded to the cloud. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any third-party since this data could contain sensitive information." + impact: "Activities of type User Activity are not allowed to be uploaded to the cloud. The Timeline feature will not function across devices." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\OS Policies\\Allow upload of User Activities Note: This Group Policy path may not exist by default. It is provided by the Group Policy template OSPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1803 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.30.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> UploadUserActivities' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> UploadUserActivities -> 0' + + # 18.9.32.6.1 (L2) Ensure 'Allow network connectivity during connected-standby (on battery)' is set to 'Disabled'. (Automated) + - id: 27241 + title: "Ensure 'Allow network connectivity during connected-standby (on battery)' is set to 'Disabled'." + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, on battery and in a sleep state." + impact: "Network connectivity in standby (while on battery) is not guaranteed. This connectivity restriction currently only applies to WLAN networks only, but is subject to change (according to Microsoft)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (on battery) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.32.6.1"] + - cis_csc_v7: ["9.2"] + - iso_27001-2013: ["A.13.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> DCSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> DCSettingIndex -> 0' + + # 18.9.32.6.2 (L2) Ensure 'Allow network connectivity during connected-standby (plugged in)' is set to 'Disabled'. (Automated) + - id: 27242 + title: "Ensure 'Allow network connectivity during connected-standby (plugged in)' is set to 'Disabled'." + description: "This policy setting allows you to control the network connectivity state in standby on modern standby-capable systems. The recommended state for this setting is: Disabled." + rationale: "Disabling this setting ensures that the computer will not be accessible to attackers over a WLAN network while left unattended, plugged in and in a sleep state." + impact: "Network connectivity in standby (while plugged in) is not guaranteed. This connectivity restriction currently only applies to WLAN networks only, but is subject to change (according to Microsoft)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Allow network connectivity during connected-standby (plugged in) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.32.6.2"] + - cis_csc_v7: ["9.2"] + - iso_27001-2013: ["A.13.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> ACSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\f15576e8-98b7-4186-b944-eafa664402d9 -> ACSettingIndex -> 0' + + # 18.9.32.6.3 (L1) Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'. (Automated) + - id: 27243 + title: "Ensure 'Require a password when a computer wakes (on battery)' is set to 'Enabled'." + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (on battery) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.32.6.3"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> DCSettingIndex -> 1' + + # 18.9.32.6.4 (L1) Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'. (Automated) + - id: 27244 + title: "Ensure 'Require a password when a computer wakes (plugged in)' is set to 'Enabled'." + description: "Specifies whether or not the user is prompted for a password when the system resumes from sleep. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting ensures that anyone who wakes an unattended computer from sleep state will have to provide logon credentials before they can access the system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Power Management\\Sleep Settings\\Require a password when a computer wakes (plugged in) Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Power.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.32.6.4"] + - cis_csc_v8: ["4.3"] + - cis_csc_v7: ["16.11"] + - cmmc_v2.0: ["AC.L2-3.1.10", "AC.L2-3.1.11"] + - hipaa: ["164.312(a)(2)(iii)"] + - iso_27001-2013: ["A.8.1.3"] + - nist_sp_800-53: ["AC-11", "AC-11(1)", "AC-12", "AC-2(5)"] + - pci_dss_v3.2.1: ["8.1.8"] + - pci_dss_v4.0: ["8.2.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\0e796bdb-100d-47d6-a2d5-f7d2daa51f51 -> ACSettingIndex -> 1' + + # 18.9.34.1 (L1) Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'. (Automated) + - id: 27245 + title: "Ensure 'Configure Offer Remote Assistance' is set to 'Disabled'." + description: "This policy setting allows you to turn on or turn off Offer (Unsolicited) Remote Assistance on this computer. Help desk and support personnel will not be able to proactively offer assistance, although they can still respond to user assistance requests. The recommended state for this setting is: Disabled." + rationale: "A user might be tricked and accept an unsolicited Remote Assistance offer from a malicious user." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Offer Remote Assistance Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.34.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowUnsolicited -> 0' + + # 18.9.34.2 (L1) Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'. (Automated) + - id: 27246 + title: "Ensure 'Configure Solicited Remote Assistance' is set to 'Disabled'." + description: "This policy setting allows you to turn on or turn off Solicited (Ask for) Remote Assistance on this computer. The recommended state for this setting is: Disabled." + rationale: "There is slight risk that a rogue administrator will gain access to another user's desktop session, however, they cannot connect to a user's computer unannounced or control it without permission from the user. When an expert tries to connect, the user can still choose to deny the connection or give the expert view-only privileges. The user must explicitly click the Yes button to allow the expert to remotely control the workstation." + impact: "Users on this computer cannot use e-mail or file transfer to ask someone for help. Also, users cannot use instant messaging programs to allow connections to this computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Assistance\\Configure Solicited Remote Assistance Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RemoteAssistance.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.34.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fAllowToGetHelp -> 0' + + # 18.9.35.1 (L1) Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled' (MS only). (Automated) + - id: 27247 + title: "Ensure 'Enable RPC Endpoint Mapper Client Authentication' is set to 'Enabled' (MS only)." + description: "This policy setting controls whether RPC clients authenticate with the Endpoint Mapper Service when the call they are making contains authentication information. The Endpoint Mapper Service on computers running Windows NT4 (all service packs) cannot process authentication information supplied in this manner. This policy setting can cause a specific issue with 1-way forest trusts if it is applied to the trusting domain DCs (see Microsoft KB3073942), so we do not recommend applying it to Domain Controllers. Note: This policy will not be in effect until the system is rebooted. The recommended state for this setting is: Enabled." + rationale: "Anonymous access to RPC services could result in accidental disclosure of information to unauthenticated users." + impact: "RPC clients will authenticate to the Endpoint Mapper Service for calls that contain authentication information. Clients making such calls will not be able to communicate with the Windows NT4 Server Endpoint Mapper Service." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Enable RPC Endpoint Mapper Client Authentication Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RPC.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.35.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> EnableAuthEpResolution -> 1' + + # 18.9.35.2 (L2) Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated' (MS only). (Automated) + - id: 27248 + title: "Ensure 'Restrict Unauthenticated RPC clients' is set to 'Enabled: Authenticated' (MS only)." + description: 'This policy setting controls how the RPC server runtime handles unauthenticated RPC clients connecting to RPC servers. This policy setting impacts all RPC applications. In a domain environment this policy setting should be used with caution as it can impact a wide range of functionality including group policy processing itself. Reverting a change to this policy setting can require manual intervention on each affected machine. This policy setting should never be applied to a Domain Controller. A client will be considered an authenticated client if it uses a named pipe to communicate with the server or if it uses RPC Security. RPC Interfaces that have specifically requested to be accessible by unauthenticated clients may be exempt from this restriction, depending on the selected value for this policy setting. -- "None" allows all RPC clients to connect to RPC Servers running on the machine on which the policy setting is applied. -- "Authenticated" allows only authenticated RPC Clients (per the definition above) to connect to RPC Servers running on the machine on which the policy setting is applied. Exemptions are granted to interfaces that have requested them. -- "Authenticated without exceptions" allows only authenticated RPC Clients (per the definition above) to connect to RPC Servers running on the machine on which the policy setting is applied. No exceptions are allowed. This value has the potential to cause serious problems and is not recommended. Note: This policy setting will not be applied until the system is rebooted. The recommended state for this setting is: Enabled: Authenticated.' + rationale: "Unauthenticated RPC communication can create a security vulnerability." + impact: "Only authenticated RPC Clients will be allowed to connect to RPC servers running on the machine on which the policy setting is applied. Exemptions are granted to interfaces that have requested them." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Authenticated: Computer Configuration\\Policies\\Administrative Templates\\System\\Remote Procedure Call\\Restrict Unauthenticated RPC clients Note: This Group Policy path may not exist by default. It is provided by the Group Policy template RPC.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.35.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Rpc -> RestrictRemoteClients -> 1' + + # 18.9.38.1 (L1) Ensure 'Configure validation of ROCA-vulnerable WHfB keys during authentication' is set to 'Enabled: Audit' or higher (DC only). (Automated) + - id: 27249 + title: "Ensure 'Configure validation of ROCA-vulnerable WHfB keys during authentication' is set to 'Enabled: Audit' or higher (DC only)." + description: 'This policy setting allows you to configure how Domain Controllers handle Windows Hello for Business (WHfB) keys that are vulnerable to the "Return of Coppersmith''s attack" (ROCA) vulnerability. If this policy setting is enabled the following options are supported: Ignore: During authentication the Domain Controller will not probe any WHfB keys for the ROCA vulnerability. Audit: During authentication the Domain Controller will emit audit events for WHfB keys that are subject to the ROCA vulnerability (authentications will still succeed). Block: During authentication the Domain Controller will block the use of WHfB keys that are subject to the ROCA vulnerability (vulnerable authentications will fail). The recommended state for this setting is: Enabled: Audit. Configuring this setting to Enabled: Block also conforms to the benchmark. Note: This setting only takes effect on Domain Controllers. Note #2: A reboot is not required for changes to this setting to take effect.' + rationale: 'The "Return of Coppersmith''s attack" or ROCA vulnerability is a cryptographic weakness in a widely used cryptographic library. An attacker can reveal secret keys (offline with no physical access to the affected device) on certified devices using this library. For more information on this vulnerability, visit ADV170012 - Security Update Guide - Microsoft - Vulnerability in TPM could allow Security Feature Bypass.' + impact: "This setting may affect vulnerable Trusted Platform Module (TPMs). To avoid issues, this setting should not be set to Block until appropriate mitigations have been performed, for example patching of vulnerable TPMs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Audit (configuring to Enabled: Block also conforms to the benchmark): Computer Configuration\\Policies\\Administrative Templates\\System\\Security Account Manager\\Configure validation of ROCA-vulnerable WHfB keys during authentication Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sam.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + references: + - "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-15361" + - "https://nvd.nist.gov/vuln/detail/CVE-2017-15361" + compliance: + - cis: ["18.9.38.1"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\SAM' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\SAM -> SamNGCKeyROCAValidation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\SAM -> SamNGCKeyROCAValidation -> n:(\d+) compare >= 1' + + # 18.9.46.5.1 (L2) Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'. (Automated) + - id: 27250 + title: "Ensure 'Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider' is set to 'Disabled'." + description: "This policy setting configures Microsoft Support Diagnostic Tool (MSDT) interactive communication with the support provider. MSDT gathers diagnostic data for analysis by support professionals. The recommended state for this setting is: Disabled." + rationale: "Due to privacy concerns, data should never be sent to any third-party since this data could contain sensitive information." + impact: "MSDT cannot run in support mode, and no data can be collected or sent to the support provider." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Microsoft Support Diagnostic Tool\\Microsoft Support Diagnostic Tool: Turn on MSDT interactive communication with support provider Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSDT.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.9.46.5.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\ScriptedDiagnosticsProvider\Policy -> DisableQueryRemoteServer -> 0' + + # 18.9.46.11.1 (L2) Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'. (Automated) + - id: 27251 + title: "Ensure 'Enable/Disable PerfTrack' is set to 'Disabled'." + description: "This policy setting specifies whether to enable or disable tracking of responsiveness events. The recommended state for this setting is: Disabled." + rationale: "When enabled the aggregated data of a given event will be transmitted to Microsoft. The option exists to restrict this feature for a specific user, set the consent level, and designate specific programs for which error reports could be sent. However, centrally restricting the ability to execute PerfTrack to limit the potential for unauthorized or undesired usage, data leakage, or unintentional communications is highly recommended." + impact: "Responsiveness events are not processed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Troubleshooting and Diagnostics\\Windows Performance PerfTrack\\Enable/Disable PerfTrack Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PerformancePerftrack.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.46.11.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d}' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WDI\{9c5a40da-b965-4fc3-8781-88dd50a6299d} -> ScenarioExecutionEnabled -> 0' + + # 18.9.48.1 (L2) Ensure 'Turn off the advertising ID' is set to 'Enabled'. (Automated) + - id: 27252 + title: "Ensure 'Turn off the advertising ID' is set to 'Enabled'." + description: "This policy setting turns off the advertising ID, preventing apps from using the ID for experiences across apps. The recommended state for this setting is: Enabled." + rationale: "Tracking user activity for advertising purposes, even anonymously, may be a privacy concern. In an enterprise managed environment, applications should not need or require tracking for targeted advertising." + impact: "The advertising ID is turned off. Apps can't use the ID for experiences across apps." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\User Profiles\\Turn off the advertising ID Note: This Group Policy path may not exist by default. It is provided by the Group Policy template UserProfiles.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.9.48.1"] + - cis_csc_v7: ["9.2"] + - iso_27001-2013: ["A.13.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo -> DisabledByGroupPolicy -> 1' + + # 18.9.50.1.1 (L2) Ensure 'Enable Windows NTP Client' is set to 'Enabled'. (Automated) + - id: 27253 + title: "Ensure 'Enable Windows NTP Client' is set to 'Enabled'." + description: "This policy setting specifies whether the Windows NTP Client is enabled. Enabling the Windows NTP Client allows your computer to synchronize its computer clock with other NTP servers. You might want to disable this service if you decide to use a third-party time provider. The recommended state for this setting is: Enabled." + rationale: "A reliable and accurate account of time is important for a number of services and security requirements, including but not limited to distributed applications, authentication services, multi-user databases and logging services. The use of an NTP client (with secure operation) establishes functional accuracy and is a focal point when reviewing security relevant events." + impact: "You can set the local computer clock to synchronize time with NTP servers." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Client Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.50.1.1"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpClient -> Enabled -> 1' + + # 18.9.50.1.2 (L2) Ensure 'Enable Windows NTP Server' is set to 'Disabled' (MS only). (Automated) + - id: 27254 + title: "Ensure 'Enable Windows NTP Server' is set to 'Disabled' (MS only)." + description: "This policy setting allows you to specify whether the Windows NTP Server is enabled. The recommended state for this setting is: Disabled. Note: In most enterprise managed environments, you should not disable the Windows NTP Server on Domain Controllers, as it is very important for the operation of NT5DS (domain hierarchy-based) time synchronization." + rationale: "The configuration of proper time synchronization is critically important in an enterprise managed environment both due to the sensitivity of Kerberos authentication timestamps and also to ensure accurate security logging." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\System\\Windows Time Service\\Time Providers\\Enable Windows NTP Server Note: This Group Policy path is provided by the Group Policy template W32Time.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.9.50.1.2"] + - cis_csc_v8: ["8.4"] + - cis_csc_v7: ["6.1"] + - cmmc_v2.0: ["AU.L2-3.3.7"] + - iso_27001-2013: ["A.12.4.4"] + - nist_sp_800-53: ["AU-7"] + - pci_dss_v3.2.1: ["10.4"] + - pci_dss_v4.0: ["10.6", "10.6.1", "10.6.2", "10.6.3"] + - soc_2: ["CC4.1", "CC5.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time\TimeProviders\NtpServer -> Enabled -> 0' + + # 18.10.3.1 (L2) Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled'. (Automated) + - id: 27255 + title: "Ensure 'Allow a Windows app to share application data between users' is set to 'Disabled'." + description: "Manages a Windows app's ability to share data between users who have installed the app. Data is shared through the SharedLocal folder. This folder is available through the Windows.Storage API. The recommended state for this setting is: Disabled." + rationale: "Users of a system could accidentally share sensitive data with other users on the same system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App Package Deployment\\Allow a Windows app to share application data between users Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppxPackageManager.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.3.1"] + - cis_csc_v8: ["3.3"] + - cis_csc_v7: ["14.6"] + - cmmc_v2.0: ["AC.L1-3.1.1", "AC.L1-3.1.2", "AC.L2-3.1.3", "AC.L2-3.1.5", "MP.L2-3.8.2"] + - hipaa: ["164.308(a)(3)(i)", "164.308(a)(3)(ii)(A)", "164.312(a)(1)"] + - iso_27001-2013: ["A.9.1.1"] + - nist_sp_800-53: ["AC-5", "AC-6"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - pci_dss_v4.0: ["1.3.1", "7.1"] + - soc_2: ["CC5.2", "CC6.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager -> AllowSharedLocalAppData' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\AppModel\StateManager -> AllowSharedLocalAppData -> 0' + + # 18.10.5.1 (L1) Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'. (Automated) + - id: 27256 + title: "Ensure 'Allow Microsoft accounts to be optional' is set to 'Enabled'." + description: "This policy setting lets you control whether Microsoft accounts are optional for Windows Store apps that require an account to sign in. This policy only affects Windows Store apps that support it. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting allows an organization to use their enterprise user accounts instead of using their Microsoft accounts when accessing Windows store apps. This provides the organization with greater control over relevant credentials. Microsoft accounts cannot be centrally managed and as such enterprise credential security policies cannot be applied to them, which could put any information accessed by using Microsoft accounts at risk." + impact: "Windows Store apps that typically require a Microsoft account to sign in will allow users to sign in with an enterprise account instead." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\App runtime\\Allow Microsoft accounts to be optional Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AppXRuntime.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.5.1"] + - cis_csc_v8: ["5.6"] + - cis_csc_v7: ["16.2"] + - nist_sp_800-53: ["AC-2(1)"] + - soc_2: ["CC6.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> MSAOptional -> 1' + + # 18.10.7.1 (L1) Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'. (Automated) + - id: 27257 + title: "Ensure 'Disallow Autoplay for non-volume devices' is set to 'Enabled'." + description: "This policy setting disallows AutoPlay for MTP devices like cameras or phones. The recommended state for this setting is: Enabled." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + impact: "AutoPlay will not be allowed for MTP devices like cameras or phones." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Disallow Autoplay for non-volume devices Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.7.1"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoAutoplayfornonVolume -> 1' + + # 18.10.7.2 (L1) Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'. (Automated) + - id: 27258 + title: "Ensure 'Set the default behavior for AutoRun' is set to 'Enabled: Do not execute any autorun commands'." + description: "This policy setting sets the default behavior for Autorun commands. Autorun commands are generally stored in autorun.inf files. They often launch the installation program or other routines. The recommended state for this setting is: Enabled: Do not execute any autorun commands." + rationale: "Prior to Windows Vista, when media containing an autorun command is inserted, the system will automatically execute the program without user intervention. This creates a major security concern as code may be executed without user's knowledge. The default behavior starting with Windows Vista is to prompt the user whether autorun command is to be run. The autorun command is represented as a handler in the Autoplay dialog." + impact: "AutoRun commands will be completely disabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Do not execute any autorun commands: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Set the default behavior for AutoRun Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AutoPlay.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.7.2"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoAutorun -> 1' + + # 18.10.7.3 (L1) Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'. (Automated) + - id: 27259 + title: "Ensure 'Turn off Autoplay' is set to 'Enabled: All drives'." + description: "Autoplay starts to read from a drive as soon as you insert media in the drive, which causes the setup file for programs or audio media to start immediately. An attacker could use this feature to launch a program to damage the computer or data on the computer. Autoplay is disabled by default on some removable drive types, such as floppy disk and network drives, but not on CD-ROM drives. Note: You cannot use this policy setting to enable Autoplay on computer drives in which it is disabled by default, such as floppy disk and network drives. The recommended state for this setting is: Enabled: All drives." + rationale: "An attacker could use this feature to launch a program to damage a client computer or data on the computer." + impact: "Autoplay will be disabled - users will have to manually launch setup or installation programs that are provided on removable media." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: All drives: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\AutoPlay Policies\\Turn off Autoplay Note: This Group Policy path is provided by the Group Policy template AutoPlay.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.7.3"] + - cis_csc_v8: ["10.3"] + - cis_csc_v7: ["8.5"] + - cmmc_v2.0: ["MP.L2-3.8.7"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> NoDriveTypeAutoRun -> 255' + + # 18.10.8.1.1 (L1) Ensure 'Configure enhanced anti-spoofing' is set to 'Enabled'. (Automated) + - id: 27260 + title: "Ensure 'Configure enhanced anti-spoofing' is set to 'Enabled'." + description: "This policy setting determines whether enhanced anti-spoofing is configured for devices which support it. The recommended state for this setting is: Enabled." + rationale: "Enterprise managed environments are now supporting a wider range of mobile devices, increasing the security on these devices will help protect against unauthorized access on your network." + impact: "Windows will require all users on the device to use anti-spoofing for facial features, on devices which support it." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Biometrics\\Facial Features\\Configure enhanced anti-spoofing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Biometrics.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer). Note #2: In the Windows 10 Release 1511 and Windows 10 Release 1607 & Server 2016 Administrative Templates, this setting was initially named Use enhanced anti-spoofing when available. It was renamed to Configure enhanced anti-spoofing starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.10.8.1.1"] + - cis_csc_v8: ["10.5"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures -> EnhancedAntiSpoofing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics\FacialFeatures -> EnhancedAntiSpoofing -> 1' + + # 18.10.10.1 (L2) Ensure 'Allow Use of Camera' is set to 'Disabled'. (Automated) + - id: 27261 + title: "Ensure 'Allow Use of Camera' is set to 'Disabled'." + description: "This policy setting controls whether the use of Camera devices on the machine are permitted. The recommended state for this setting is: Disabled." + rationale: "Cameras in a high security environment can pose serious privacy and data exfiltration risks - they should be disabled to help mitigate that risk." + impact: "Users will not be able to utilize the camera on a system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Camera\\Allow Use of Camera Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Camera.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.10.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera -> AllowCamera' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Camera -> AllowCamera -> 0' + + # 18.10.12.1 (L1) Ensure 'Turn off cloud consumer account state content' is set to 'Enabled'. (Automated) + - id: 27262 + title: "Ensure 'Turn off cloud consumer account state content' is set to 'Enabled'." + description: "This policy setting determines whether cloud consumer account state content is allowed in all Windows experiences. The recommended state for this setting is: Enabled." + rationale: "The use of consumer accounts in an enterprise managed environment is not good security practice as it could lead to possible data leakage." + impact: "Users will not be able to use Microsoft consumer accounts on the system, and associated Windows experiences will instead present default fallback content." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off cloud consumer account state content Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.12.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableConsumerAccountStateContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableConsumerAccountStateContent -> 1' + + # 18.10.12.2 (L2) Ensure 'Turn off cloud optimized content' is set to 'Enabled'. (Automated) + - id: 27263 + title: "Ensure 'Turn off cloud optimized content' is set to 'Enabled'." + description: "This policy setting turns off cloud optimized content in all Windows experiences. The recommended state for this setting is: Enabled." + rationale: "Due to privacy concerns, data should never be sent to any third-party since this data could contain sensitive information." + impact: "Windows experiences that use the cloud optimized content client component, will present the default fallback content instead of customized content." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off cloud optimized content Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 10 Release 20H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.12.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableCloudOptimizedContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableCloudOptimizedContent -> 1' + + # 18.10.12.3 (L1) Ensure 'Turn off Microsoft consumer experiences' is set to 'Enabled'. (Automated) + - id: 27264 + title: "Ensure 'Turn off Microsoft consumer experiences' is set to 'Enabled'." + description: "This policy setting turns off experiences that help consumers make the most of their devices and Microsoft account. The recommended state for this setting is: Enabled. Note: Per Microsoft TechNet, this policy setting only applies to Windows 10 Enterprise and Windows 10 Education editions." + rationale: "Having apps silently install in an enterprise managed environment is not good security practice - especially if the apps send data back to a third-party." + impact: "Users will no longer see personalized recommendations from Microsoft and notifications about their Microsoft account." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Cloud Content\\Turn off Microsoft consumer experiences Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CloudContent.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.12.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableWindowsConsumerFeatures' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent -> DisableWindowsConsumerFeatures -> 1' + + # 18.10.13.1 (L1) Ensure 'Require pin for pairing' is set to 'Enabled: First Time' OR 'Enabled: Always'. (Automated) + - id: 27265 + title: "Ensure 'Require pin for pairing' is set to 'Enabled: First Time' OR 'Enabled: Always'." + description: "This policy setting controls whether or not a PIN is required for pairing to a wireless display device. The recommended state for this setting is: Enabled: First Time OR Enabled: Always." + rationale: "If this setting is not configured or disabled then a PIN would not be required when pairing wireless display devices to the system, increasing the risk of unauthorized use." + impact: "The pairing ceremony for connecting to new wireless display devices will always require a PIN." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: First Time OR Enabled: Always: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Connect\\Require pin for pairing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WirelessDisplay.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). The new Choose one of the following actions sub-option was later added as of the Windows 10 Release 1809 Administrative Templates. Choosing Enabled in the older templates is the equivalent of choosing Enabled: First Time in the newer templates." + compliance: + - cis: ["18.10.13.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Connect -> RequirePinForPairing -> r:^1$|^2$' + + # 18.10.14.1 (L1) Ensure 'Do not display the password reveal button' is set to 'Enabled'. (Automated) + - id: 27266 + title: "Ensure 'Do not display the password reveal button' is set to 'Enabled'." + description: "This policy setting allows you to configure the display of the password reveal button in password entry user experiences. The recommended state for this setting is: Enabled." + rationale: "This is a useful feature when entering a long and complex password, especially when using a touchscreen. The potential risk is that someone else may see your password while surreptitiously observing your screen." + impact: "The password reveal button will not be displayed after a user types a password in the password entry text box." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Do not display the password reveal button Note: This Group Policy path may not exist by default. It is provided by the Group Policy template CredUI.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.14.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CredUI -> DisablePasswordReveal -> 1' + + # 18.10.14.2 (L1) Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'. (Automated) + - id: 27267 + title: "Ensure 'Enumerate administrator accounts on elevation' is set to 'Disabled'." + description: "This policy setting controls whether administrator accounts are displayed when a user attempts to elevate a running application. The recommended state for this setting is: Disabled." + rationale: "Users could see the list of administrator accounts, making it slightly easier for a malicious user who has logged onto a console session to try to crack the passwords of those accounts." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Credential User Interface\\Enumerate administrator accounts on elevation Note: This Group Policy path is provided by the Group Policy template CredUI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.14.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\CredUI -> EnumerateAdministrators -> 0' + + # 18.10.15.1 (L1) Ensure 'Allow Diagnostic Data' is set to 'Enabled: Diagnostic data off (not recommended)' or 'Enabled: Send required diagnostic data'. (Automated) + - id: 27268 + title: "Ensure 'Allow Diagnostic Data' is set to 'Enabled: Diagnostic data off (not recommended)' or 'Enabled: Send required diagnostic data'." + description: "This policy setting determines the amount of diagnostic and usage data reported to Microsoft: - A value of (0) Diagnostic data off (not recommended). Using this value, no diagnostic data is sent from the device. This value is only supported on Enterprise, Education, and Server editions. If you choose this setting, devices in your organization will still be secure. - A value of (1) Send required diagnostic data. This is the minimum diagnostic data necessary to keep Windows secure, up to date, and performing as expected. Using this value disables the Optional diagnostic data control in the Settings app. - A value of (3)Send optional diagnostic data. Additional diagnostic data is collected that helps us to detect, diagnose and fix issues, as well as make product improvements. Required diagnostic data will always be included when you choose to send optional diagnostic data. Optional diagnostic data can also include diagnostic log files and crash dumps. Use the Limit Dump Collection and the Limit Diagnostic Log Collection policies for more granular control of what optional diagnostic data is sent. Windows telemetry settings apply to the Windows operating system and some first party apps. This setting does not apply to third party apps running on Windows 10/11. The recommended state for this setting is: Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data. Note: If your organization relies on Windows Update, the minimum recommended setting is Required diagnostic data. Because no Windows Update information is collected when diagnostic data is off, important information about update failures is not sent. Microsoft uses this information to fix the causes of those failures and improve the quality of updates. Note #2: The Configure diagnostic data opt-in settings user interface group policy can be used to prevent end users from changing their data collection settings. Note #3: Enhanced diagnostic data setting is not available on Windows 11 and Windows Server 2022 and has been replaced with policies that can control the amount of optional diagnostic data that is sent. For more information on these settings visit Manage diagnostic data using Group Policy and MDM." + rationale: "Sending any data to a third-party vendor is a security concern and should only be done on an as needed basis." + impact: "Note that setting values of 0 or 1 will degrade certain experiences on the device." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Allow Diagnostic Data Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow Telemetry, but it was renamed to Allow Diagnostic Data starting with the Windows 11 Release 21H2 Administrative Templates." + references: + - "https://docs.microsoft.com/en-us/windows/privacy/configure-windows-diagnostic-data-in-your-organization" + compliance: + - cis: ["18.10.15.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> AllowTelemetry -> r:^0$|^1$' + + # 18.10.15.2 (L2) Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage' (Automated) + - id: 27269 + title: "Ensure 'Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service' is set to 'Enabled: Disable Authenticated Proxy usage'." + description: "This policy setting controls whether the Connected User Experience and Telemetry service can automatically use an authenticated proxy to send data back to Microsoft. The recommended state for this setting is: Enabled: Disable Authenticated Proxy usage." + rationale: "Sending any data to a 3rd party vendor is a security concern and should only be done on an as needed basis." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Authenticated Proxy usage: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Configure Authenticated Proxy usage for the Connected User Experience and Telemetry service Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableEnterpriseAuthProxy' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableEnterpriseAuthProxy -> 1' + + # 18.10.15.3 (L1) Ensure 'Disable OneSettings Downloads' is set to 'Enabled'. (Automated) + - id: 27270 + title: "Ensure 'Disable OneSettings Downloads' is set to 'Enabled'." + description: "This policy setting controls whether Windows attempts to connect with the OneSettings service to download configuration settings. The recommended state for this setting is: Enabled." + rationale: "Sending data to a third-party vendor is a security concern and should only be done on an as-needed basis." + impact: "Windows will not connect to the OneSettings service to download configuration settings." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Disable OneSettings Downloads Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableOneSettingsDownloads' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DisableOneSettingsDownloads -> 1' + + # 18.10.15.4 (L1) Ensure 'Do not show feedback notifications' is set to 'Enabled'. (Automated) + - id: 27271 + title: "Ensure 'Do not show feedback notifications' is set to 'Enabled'." + description: "This policy setting allows an organization to prevent its devices from showing feedback questions from Microsoft. The recommended state for this setting is: Enabled." + rationale: "Users should not be sending any feedback to third-party vendors in an enterprise managed environment." + impact: "Users will no longer see feedback notifications through the Windows Feedback app." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Do not show feedback notifications Note: This Group Policy path may not exist by default. It is provided by the Group Policy template FeedbackNotifications.admx/adml that is included with the Microsoft Windows 10 Release 1511 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DoNotShowFeedbackNotifications' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> DoNotShowFeedbackNotifications -> 1' + + # 18.10.15.5 (L1) Ensure 'Enable OneSettings Auditing' is set to 'Enabled'. (Automated) + - id: 27272 + title: "Ensure 'Enable OneSettings Auditing' is set to 'Enabled'." + description: "This policy setting controls whether Windows records attempts to connect with the OneSettings service to the Event Log. The recommended state for this setting is: Enabled." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "Windows will record attempts to connect with the OneSettings service to the Applications and Services Logs\\Microsoft\\Windows\\Privacy-Auditing\\Operational Event Log channel." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Enable OneSettings Auditing Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.5"] + - cis_csc_v8: ["6.3"] + - cis_csc_v7: ["8.5"] + - iso_27001-2013: ["A.12.2.1"] + - pci_dss_v3.2.1: ["8.3"] + - soc_2: ["CC6.1", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> EnableOneSettingsAuditing' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> EnableOneSettingsAuditing -> 1' + + # 18.10.15.6 (L1) Ensure 'Limit Diagnostic Log Collection' is set to 'Enabled'. (Automated) + - id: 27273 + title: "Ensure 'Limit Diagnostic Log Collection' is set to 'Enabled'." + description: "This policy setting controls whether additional diagnostic logs are collected when more information is needed to troubleshoot a problem on the device. The recommended state for this setting is: Enabled. Note: Diagnostic logs are only sent when the device has been configured to send optional diagnostic data. Diagnostic data is limited when recommendation Allow Diagnostic Data is set to Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data to send only basic information." + rationale: "Sending data to a third-party vendor is a security concern and should only be done on an as-needed basis." + impact: "Diagnostic logs and information such as crash dumps will not be collected for transmission to Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Limit Diagnostic Log Collection Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDiagnosticLogCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDiagnosticLogCollection -> 1' + + # 18.10.15.7 (L1) Ensure 'Limit Dump Collection' is set to 'Enabled'. (Automated) + - id: 27274 + title: "Ensure 'Limit Dump Collection' is set to 'Enabled'." + description: "This policy setting limits the type of memory dumps that can be collected when more information is needed to troubleshoot a problem. The recommended state for this setting is: Enabled. Note: Memory dumps are only sent when the device has been configured to send optional diagnostic data. Diagnostic data is limited when recommendation Allow Diagnostic Data is set to Enabled: Diagnostic data off (not recommended) or Enabled: Send required diagnostic data to send only basic information." + rationale: "Memory dumps can contain sensitive information - sending such data to a third-party vendor is a security concern and should only be done on an as-needed basis." + impact: "Windows Error Reporting will not send full and/or heap memory dumps to Microsoft - they will be limited to kernel mini and/or user mode triage memory dumps (if sending optional diagnostic data is permitted)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled. Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Limit Dump Collection Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DataCollection.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.7"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDumpCollection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\DataCollection -> LimitDumpCollection -> 1' + + # 18.10.15.8 (L1) Ensure 'Toggle user control over Insider builds' is set to 'Disabled'. (Automated) + - id: 27275 + title: "Ensure 'Toggle user control over Insider builds' is set to 'Disabled'." + description: 'This policy setting determines whether users can access the Insider build controls in the Advanced Options for Windows Update. These controls are located under "Get Insider builds," and enable users to make their devices available for downloading and installing Windows preview software. The recommended state for this setting is: Disabled. Note: This policy setting applies only to devices running Windows Server 2016, up until Release 1703. For Release 1709 or newer, Microsoft encourages using the Manage preview builds setting (recommendation title ''Manage preview builds''). We have kept this setting in the benchmark to ensure that any older builds of Windows Server 2016 in the environment are still enforced.' + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + impact: 'The item "Get Insider builds" will be unavailable.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Data Collection and Preview Builds\\Toggle user control over Insider builds Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AllowBuildPreview.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.15.8"] + - cis_csc_v8: ["2.5"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "CM.L2-3.4.9"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-7(5)"] + - pci_dss_v4.0: ["1.2.5", "2.2.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> AllowBuildPreview' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> AllowBuildPreview -> 0' + + # 18.10.17.1 (L1) Ensure 'Enable App Installer' is set to 'Disabled'. (Automated) + - id: 27276 + title: "Ensure 'Enable App Installer' is set to 'Disabled'." + description: "This policy setting controls whether user have access to the Windows Package Manager. Windows Package Manager is a package manager solution that consists of a command line tool and set of services for installing applications on Microsoft Windows Server 2019 (or newer). The recommended state for this setting is: Disabled." + rationale: "Windows Package Manager is a command line tool can be used to discover, install, upgrade, remove and configure applications, and it can be used as a distribution channel for software packages containing tools and applications. Users should not have access to these types of development tools." + impact: "Users will not have access to the command line tool, winget to discover, install, upgrade, remove, configure, or distribute applications." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Desktop App Installer\\Enable App Installer Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DesktopAppInstaller.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (or newer)." + references: + - "https://learn.microsoft.com/en-us/windows/package-manager/" + compliance: + - cis: ["18.10.17.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppInstaller' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppInstaller -> EnableAppInstaller' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds ->EnableAppInstaller -> 0' + + # 18.10.17.2 (L1) Ensure 'Enable App Installer Experimental Features' is set to 'Disabled'. (Automated) + - id: 27277 + title: "Ensure 'Enable App Installer Experimental Features' is set to 'Disabled'." + description: "This policy setting controls whether users can enable experimental features in the Windows Package Manager. The recommended state for this setting is Disabled." + rationale: "Windows Package Manager is a command line tool can be used to discover, install, upgrade, remove and configure applications, and it can be used as a distribution channel for software packages containing tools and applications. Users should not have access to experimental features." + impact: "Users will not have access to experimental features in the command line tool, winget to discover, install, upgrade, remove, configure, or distribute applications." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Desktop App Installer\\Enable App Installer Experimental Features Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DesktopAppInstaller.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (or newer)." + references: + - "https://learn.microsoft.com/en-us/windows/package-manager/" + compliance: + - cis: ["18.10.17.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppInstaller' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppInstaller -> EnableExperimentalFeatures' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> EnableExperimentalFeatures -> 0' + + # 18.10.17.3 (L1) Ensure 'Enable App Installer Hash Override' is set to 'Disabled'. (Automated) + - id: 27278 + title: "Ensure 'Enable App Installer Hash Override' is set to 'Disabled'." + description: "This policy setting controls whether or not users can override the SHA256 security validation in the Windows Package Manager settings. The recommended state for this setting is: Disabled." + rationale: "Users should not have the ability to override SHA256 security validation." + impact: "Users will not have the ability to override the SHA256 security validation." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Desktop App Installer\\Enable App Installer Hash Override Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DesktopAppInstaller.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (or newer)." + references: + - "https://learn.microsoft.com/en-us/windows/package-manager/" + compliance: + - cis: ["18.10.17.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppInstaller' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppInstaller -> EnableHashOverride' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> EnableHashOverride -> 0' + + # 18.10.17.4 (L1) Ensure 'Enable App Installer ms-appinstaller protocol' is set to 'Disabled'. (Automated) + - id: 27279 + title: "Ensure 'Enable App Installer ms-appinstaller protocol' is set to 'Disabled'." + description: "This policy setting controls whether users can install packages from a website that is using the ms-appinstaller protocol. The ms-appinstaller protocol allows users to install an application by clicking a link on a website. The recommended state for this setting is: Disabled." + rationale: "Users should not have the ability to install an application by clicking a link on a website. If an unknown or malicious link is clicked, malicious software could be installed on the system." + impact: "Users will not have the ability to use the ms-appinstaller protocol to install applications by clicking a link on a website." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Desktop App Installer\\Enable App Installer ms-appinstaller protocol Note: This Group Policy path may not exist by default. It is provided by the Group Policy template DesktopAppInstaller.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (or newer)." + references: + - "https://learn.microsoft.com/en-us/windows/package-manager/" + compliance: + - cis: ["18.10.17.4"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppInstaller' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppInstaller -> EnableMSAppInstallerProtocol' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds -> EnableMSAppInstallerProtocol -> 0' + + # 18.10.26.1.1 (L1) Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'. (Automated) + - id: 27280 + title: "Ensure 'Application: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.1.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> Retention -> 0' + + # 18.10.26.1.2 (L1) Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'. (Automated) + - id: 27281 + title: "Ensure 'Application: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "When event logs fill to capacity, they will stop recording information unless the retention method for each is set so that the computer will overwrite the oldest entries with the most recent ones. To mitigate the risk of loss of recent data, you can configure the retention method so that older events are overwritten as needed. The consequence of this configuration is that older events will be removed from the logs. Attackers can take advantage of such a configuration, because they can generate a large number of extraneous events to overwrite any evidence of their attack. These risks can be somewhat reduced if you automate the archival and backup of event log data. Ideally, all specifically monitored events should be sent to a server that uses Microsoft System Center Operations Manager (SCOM) or some other automated monitoring tool. Such a configuration is particularly important because an attacker who successfully compromises a server could clear the Security log. If all events are sent to a monitoring server, then you will be able to gather forensic information about the attacker's activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Application\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.1.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Application -> MaxSize -> n:^(\d+) compare >= 32768' + + # 18.10.26.2.1 (L1) Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'. (Automated) + - id: 27282 + title: "Ensure 'Security: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.2.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> Retention -> 0' + + # 18.10.26.2.2 (L1) Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'. (Automated) + - id: 27283 + title: "Ensure 'Security: Specify the maximum log file size (KB)' is set to 'Enabled: 196,608 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 196,608 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "When event logs fill to capacity, they will stop recording information unless the retention method for each is set so that the computer will overwrite the oldest entries with the most recent ones. To mitigate the risk of loss of recent data, you can configure the retention method so that older events are overwritten as needed. The consequence of this configuration is that older events will be removed from the logs. Attackers can take advantage of such a configuration, because they can generate a large number of extraneous events to overwrite any evidence of their attack. These risks can be somewhat reduced if you automate the archival and backup of event log data. Ideally, all specifically monitored events should be sent to a server that uses Microsoft System Center Operations Manager (SCOM) or some other automated monitoring tool. Such a configuration is particularly important because an attacker who successfully compromises a server could clear the Security log. If all events are sent to a monitoring server, then you will be able to gather forensic information about the attacker's activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 196,608 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Security\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.2.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Security -> MaxSize -> n:^(\d+) compare >= 196608' + + # 18.10.26.3.1 (L1) Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'. (Automated) + - id: 27284 + title: "Ensure 'Setup: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.3.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> Retention -> 0' + + # 18.10.26.3.2 (L1) Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'. (Automated) + - id: 27285 + title: "Ensure 'Setup: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "When event logs fill to capacity, they will stop recording information unless the retention method for each is set so that the computer will overwrite the oldest entries with the most recent ones. To mitigate the risk of loss of recent data, you can configure the retention method so that older events are overwritten as needed. The consequence of this configuration is that older events will be removed from the logs. Attackers can take advantage of such a configuration, because they can generate a large number of extraneous events to overwrite any evidence of their attack. These risks can be somewhat reduced if you automate the archival and backup of event log data. Ideally, all specifically monitored events should be sent to a server that uses Microsoft System Center Operations Manager (SCOM) or some other automated monitoring tool. Such a configuration is particularly important because an attacker who successfully compromises a server could clear the Security log. If all events are sent to a monitoring server, then you will be able to gather forensic information about the attacker's activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\Setup\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.3.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup -> MaxSize -> n:^(\d+) compare >= 32768' + + # 18.10.26.4.1 (L1) Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'. (Automated) + - id: 27286 + title: "Ensure 'System: Control Event Log behavior when the log file reaches its maximum size' is set to 'Disabled'." + description: "This policy setting controls Event Log behavior when the log file reaches its maximum size. The recommended state for this setting is: Disabled. Note: Old events may or may not be retained according to the Backup log automatically when full policy setting." + rationale: "If new events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Control Event Log behavior when the log file reaches its maximum size Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Retain old events, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.4.1"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> Retention -> 0' + + # 18.10.26.4.2 (L1) Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'. (Automated) + - id: 27287 + title: "Ensure 'System: Specify the maximum log file size (KB)' is set to 'Enabled: 32,768 or greater'." + description: "This policy setting specifies the maximum size of the log file in kilobytes. The maximum log file size can be configured between 1 megabyte (1,024 kilobytes) and 4 terabytes (4,194,240 kilobytes) in kilobyte increments. The recommended state for this setting is: Enabled: 32,768 or greater." + rationale: "If events are not recorded it may be difficult or impossible to determine the root cause of system problems or the unauthorized activities of malicious users." + impact: "When event logs fill to capacity, they will stop recording information unless the retention method for each is set so that the computer will overwrite the oldest entries with the most recent ones. To mitigate the risk of loss of recent data, you can configure the retention method so that older events are overwritten as needed. The consequence of this configuration is that older events will be removed from the logs. Attackers can take advantage of such a configuration, because they can generate a large number of extraneous events to overwrite any evidence of their attack. These risks can be somewhat reduced if you automate the archival and backup of event log data. Ideally, all specifically monitored events should be sent to a server that uses Microsoft System Center Operations Manager (SCOM) or some other automated monitoring tool. Such a configuration is particularly important because an attacker who successfully compromises a server could clear the Security log. If all events are sent to a monitoring server, then you will be able to gather forensic information about the attacker's activities." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 32,768 or greater: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Event Log Service\\System\\Specify the maximum log file size (KB) Note: This Group Policy path is provided by the Group Policy template EventLog.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Maximum Log Size (KB), but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.26.4.2"] + - cis_csc_v8: ["8.3"] + - cis_csc_v7: ["6.4"] + - iso_27001-2013: ["A.12.4.1"] + - pci_dss_v3.2.1: ["10.7"] + - soc_2: ["A1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\EventLog\System -> MaxSize -> n:^(\d+) compare >= 32768' + + # 18.10.29.2 (L1) Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'. (Automated) + - id: 27288 + title: "Ensure 'Turn off Data Execution Prevention for Explorer' is set to 'Disabled'." + description: "Disabling Data Execution Prevention can allow certain legacy plug-in applications to function without terminating Explorer. The recommended state for this setting is: Disabled. Note: Some legacy plug-in applications and other software may not function with Data Execution Prevention and will require an exception to be defined for that specific plug-in/software." + rationale: "Data Execution Prevention is an important security feature supported by Explorer that helps to limit the impact of certain types of malware." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off Data Execution Prevention for Explorer Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Explorer.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.29.2"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoDataExecutionPrevention -> 0' + + # 18.10.29.3 (L1) Ensure 'Turn off heap termination on corruption' is set to 'Disabled'. (Automated) + - id: 27289 + title: "Ensure 'Turn off heap termination on corruption' is set to 'Disabled'." + description: "Without heap termination on corruption, legacy plug-in applications may continue to function when a File Explorer session has become corrupt. Ensuring that heap termination on corruption is active will prevent this. The recommended state for this setting is: Disabled." + rationale: "Allowing an application to function after its session has become corrupt increases the risk posture to the system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off heap termination on corruption Note: This Group Policy path is provided by the Group Policy template Explorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.29.3"] + - cis_csc_v7: ["8.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer -> NoHeapTerminationOnCorruption -> 0' + + # 18.10.29.4 (L1) Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'. (Automated) + - id: 27290 + title: "Ensure 'Turn off shell protocol protected mode' is set to 'Disabled'." + description: "This policy setting allows you to configure the amount of functionality that the shell protocol can have. When using the full functionality of this protocol, applications can open folders and launch files. The protected mode reduces the functionality of this protocol allowing applications to only open a limited set of folders. Applications are not able to open files with this protocol when it is in the protected mode. It is recommended to leave this protocol in the protected mode to increase the security of Windows. The recommended state for this setting is: Disabled." + rationale: "Limiting the opening of files and folders to a limited set reduces the attack surface of the system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\File Explorer\\Turn off shell protocol protected mode Note: This Group Policy path is provided by the Group Policy template WindowsExplorer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.29.4"] + - cis_csc_v7: ["8.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer -> PreXPSP2ShellProtocolBehavior -> 0' + + # 18.10.37.1 (L2) Ensure 'Turn off location' is set to 'Enabled'. (Automated) + - id: 27291 + title: "Ensure 'Turn off location' is set to 'Enabled'." + description: "This policy setting turns off the location feature for the computer. The recommended state for this setting is: Enabled." + rationale: "This setting affects the location feature (e.g. GPS or other location tracking). From a security perspective, it's not a good idea to reveal your location to software in most cases, but there are legitimate uses, such as mapping software. However, they should not be used in high security environments." + impact: "The location feature is turned off, and all programs on the computer are prevented from using location information from the location feature." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Location and Sensors\\Turn off location Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Sensors.admx/adml that is included with the Microsoft Windows 7 & Server 2008 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.37.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors -> DisableLocation -> 1' + + # 18.10.41.1 (L2) Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled'. (Automated) + - id: 27292 + title: "Ensure 'Allow Message Service Cloud Sync' is set to 'Disabled'." + description: "This policy setting allows backup and restore of cellular text messages to Microsoft's cloud services. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, data should never be sent to any third-party since this data could contain sensitive information." + impact: "Cellular text messages will not be backed up to (or restored from) Microsoft's cloud services." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Messaging\\Allow Message Service Cloud Sync Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Messaging.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.41.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging -> AllowMessageSync' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Messaging -> AllowMessageSync -> 0' + + # 18.10.42.1 (L1) Ensure 'Block all consumer Microsoft account user authentication' is set to 'Enabled'. (Automated) + - id: 27293 + title: "Ensure 'Block all consumer Microsoft account user authentication' is set to 'Enabled'." + description: "This setting determines whether applications and services on the device can utilize new consumer Microsoft account authentication via the Windows OnlineID and WebAccountManager APIs. The recommended state for this setting is: Enabled." + rationale: "Organizations that want to effectively implement identity management policies and maintain firm control of what accounts are used on their computers will probably want to block Microsoft accounts. Organizations may also need to block Microsoft accounts in order to meet the requirements of compliance standards that apply to their information systems." + impact: "All applications and services on the device will be prevented from new authentications using consumer Microsoft accounts via the Windows OnlineID and WebAccountManager APIs. Authentications performed directly by the user in web browsers or in apps that use OAuth will remain unaffected." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft accounts\\Block all consumer Microsoft account user authentication Note: This Group Policy path may not exist by default. It is provided by the Group Policy template MSAPolicy.admx/adml that is included with the Microsoft Windows 10 Release 1703 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.42.1"] + - cis_csc_v8: ["5.3"] + - cis_csc_v7: ["16.8"] + - cmmc_v2.0: ["IA.L2-3.5.6"] + - iso_27001-2013: ["A.9.2.1"] + - nist_sp_800-53: ["AC-2(3)"] + - pci_dss_v3.2.1: ["8.1.4"] + - pci_dss_v4.0: ["8.3.7"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount -> DisableUserAuth' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftAccount -> DisableUserAuth -> 1' + + # 18.10.43.5.1 (L1) Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled'. (Automated) + - id: 27294 + title: "Ensure 'Configure local setting override for reporting to Microsoft MAPS' is set to 'Disabled'." + description: 'This policy setting configures a local override for the configuration to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to "Microsft Defender Antivirus Cloud Protection Service". This setting can only be set by Group Policy. The recommended state for this setting is: Disabled.' + rationale: "The decision on whether or not to participate in Microsoft MAPS / Microsoft Defender Antivirus Cloud Protection Service for malicious software reporting should be made centrally in an enterprise managed environment, so that all computers within it behave consistently in that regard. Configuring this setting to Disabled ensures that the decision remains centrally managed." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\MAPS\\Configure local setting override for reporting to Microsoft MAPS Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.5.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> LocalSettingOverrideSpynetReporting -> 0' + + # 18.10.43.5.2 (L2) Ensure 'Join Microsoft MAPS' is set to 'Disabled'. (Automated) + - id: 27295 + title: "Ensure 'Join Microsoft MAPS' is set to 'Disabled'." + description: "This policy setting allows you to join Microsoft Active Protection Service (MAPS), which Microsoft has now renamed to Windows Defender Antivirus Cloud Protection Service and then Microsoft Defender Antivirus Cloud Protection Service. Microsoft MAPS / Microsoft Defender Antivirus Cloud Protection Service is the online community that helps you choose how to respond to potential threats. The community also helps stop the spread of new malicious software infections. You can choose to send basic or additional information about detected software. Additional information helps Microsoft create new definitions and help it to protect your computer. Possible options are: - - - (0x0) Disabled (default) (0x1) Basic membership (0x2) Advanced membership Basic membership will send basic information to Microsoft about software that has been detected including where the software came from the actions that you apply or that are applied automatically and whether the actions were successful. Advanced membership in addition to basic information will send more information to Microsoft about malicious software spyware and potentially unwanted software including the location of the software file names how the software operates and how it has impacted your computer. The recommended state for this setting is: Disabled." + rationale: "The information that would be sent can include things like location of detected items on your computer if harmful software was removed. The information would be automatically collected and sent. In some instances personal information might unintentionally be sent to Microsoft. However, Microsoft states that it will not use this information to identify you or contact you. For privacy reasons in high security environments, it is best to prevent these data submissions altogether." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\MAPS\\Join Microsoft MAPS Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.5.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet -> SpynetReporting' + + # 18.10.43.6.1.1 (L1) Ensure 'Configure Attack Surface Reduction rules' is set to 'Enabled'. (Automated) + - id: 27296 + title: "Ensure 'Configure Attack Surface Reduction rules' is set to 'Enabled'." + description: "This policy setting controls the state for the Attack Surface Reduction (ASR) rules. The recommended state for this setting is: Enabled." + rationale: "Attack surface reduction helps prevent actions and apps that are typically used by exploit-seeking malware to infect machines." + impact: "When a rule is triggered, a notification will be displayed from the Action Center." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Microsoft Defender Exploit Guard\\Attack Surface Reduction\\Configure Attack Surface Reduction rules Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.6.1.1"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR -> ExploitGuard_ASR_Rules' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR -> ExploitGuard_ASR_Rules -> 1' + + # 18.10.43.6.1.2 (L1) Ensure 'Configure Attack Surface Reduction rules: Set the state for each ASR rule' is configured. (Automated) + - id: 27297 + title: "Ensure 'Configure Attack Surface Reduction rules: Set the state for each ASR rule' is configured." + description: "This policy setting sets the Attack Surface Reduction rules. The recommended state for this setting is: 26190899-1602-49e8-8b27-eb1d0a1ce869 - 1 (Block Office communication application from creating child processes) 3b576869-a4ec-4529-8536-b80a7769e899 - 1 (Block Office applications from creating executable content) 56a863a9-875e-4185-98a7-b882c64b5ce5 - 1 (Block abuse of exploited vulnerable signed drivers) 5beb7efe-fd9a-4556-801d-275e5ffc04cc - 1 (Block execution of potentially obfuscated scripts) 75668c1f-73b5-4cf0-bb93-3ecf5cb7cc84 - 1 (Block Office applications from injecting code into other processes) 7674ba52-37eb-4a4f-a9a1-f0f9a1619a2c - 1 (Block Adobe Reader from creating child processes) 92e97fa1-2edf-4476-bdd6-9dd0b4dddc7b - 1 (Block Win32 API calls from Office macro) 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 - 1 (Block credential stealing from the Windows local security authority subsystem (lsass.exe)) b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4 - 1 (Block untrusted and unsigned processes that run from USB) be9ba2d9-53ea-4cdc-84e5-9b1eeee46550 - 1 (Block executable content from email client and webmail) d3e037e1-3eb8-44c8-a917-57927947596d - 1 (Block JavaScript or VBScript from launching downloaded executable content) d4f940ab-401b-4efc-aadc-ad5f3c50688a - 1 (Block Office applications from creating child processes) e6db77e5-3df2-4cf1-b95a-636979351e5b - 1 (Block persistence through WMI event subscription) Note: More information on ASR rules can be found at the following link: Use Attack surface reduction rules to prevent malware infection | Microsoft Docs." + rationale: "Attack surface reduction helps prevent actions and apps that are typically used by exploit-seeking malware to infect machines." + impact: "When a rule is triggered, a notification will be displayed from the Action Center." + remediation: "To establish the recommended configuration via GP, set the following UI path so that 26190899-1602-49e8-8b27-eb1d0a1ce869, 3b576869-a4ec-4529-8536-b80a7769e899, 56a863a9-875e-4185-98a7-b882c64b5ce5, 5beb7efe-fd9a-4556-801d-275e5ffc04cc, 75668c1f-73b5-4cf0-bb93-3ecf5cb7cc84, 7674ba52-37eb-4a4f-a9a1-f0f9a1619a2c, 92e97fa1-2edf-4476-bdd6-9dd0b4dddc7b, 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2, b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4, be9ba2d9-53ea-4cdc-84e5-9b1eeee46550, d3e037e1-3eb8-44c8-a917-57927947596d, d4f940ab-401b-4efc-aadc-ad5f3c50688a, and e6db77e5-3df2-4cf1-b95a-636979351e5b are each set to a value of 1: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Microsoft Defender Exploit Guard\\Attack Surface Reduction\\Configure Attack Surface Reduction rules: Set the state for each ASR rule Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.6.1.2"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D4F940AB-401B-4EFC-AADC-AD5F3C50688A' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 3B576869-A4EC-4529-8536-B80A7769E899' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D3E037E1-3EB8-44C8-A917-57927947596D' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 26190899-1602-49E8-8B27-eB1D0A1CE869' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 7674BA52-37EB-4A4F-A9A1-F0F9A1619A2C' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 9E6C4E1F-7D60-472F-bA1A-A39EF669E4B2' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> BE9BA2D9-53EA-4CDC-84E5-9B1EEEE46550 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D4F940AB-401B-4EFC-AADC-AD5F3C50688A -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 3B576869-A4EC-4529-8536-B80A7769E899 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 75668C1F-73B5-4CF0-BB93-3ECF5CB7CC84 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> D3E037E1-3EB8-44C8-A917-57927947596D -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 5BEB7EFE-FD9A-4556-801D-275E5FFC04CC -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 92E97FA1-2EDF-4476-BDD6-9DD0B4DDDC7B -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 26190899-1602-49E8-8B27-eB1D0A1CE869 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 7674BA52-37EB-4A4F-A9A1-F0F9A1619A2C -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> 9E6C4E1F-7D60-472F-bA1A-A39EF669E4B2 -> 1' + - 'r:HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\ASR\Rules -> B2B3F03D-6A65-4F7B-A9C7-1C7EF74A9BA4 -> 1' + + # 18.10.43.6.3.1 (L1) Ensure 'Prevent users and apps from accessing dangerous websites' is set to 'Enabled: Block'. (Automated) + - id: 27298 + title: "Ensure 'Prevent users and apps from accessing dangerous websites' is set to 'Enabled: Block'." + description: "This policy setting controls Microsoft Defender Exploit Guard network protection. The recommended state for this setting is: Enabled: Block." + rationale: "This setting can help prevent employees from using any application to access dangerous domains that may host phishing scams, exploit-hosting sites, and other malicious content on the Internet." + impact: "Users and applications will not be able to access dangerous domains." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Microsoft Defender Exploit Guard\\Network Protection\\Prevent users and apps from accessing dangerous websites Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.6.3.1"] + - cis_csc_v8: ["9.3", "10.5"] + - cis_csc_v7: ["7.4", "8.3"] + - cmmc_v2.0: ["SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.1"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.1.6", "1.4", "11.4"] + - pci_dss_v4.0: ["1.2.6", "1.4.2"] + - soc_2: ["CC5.2", "CC6.6", "CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection -> EnableNetworkProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection -> EnableNetworkProtection -> 1' + + # 18.10.43.7.1 (L2) Ensure 'Enable file hash computation feature' is set to 'Enabled'. (Automated) + - id: 27299 + title: "Ensure 'Enable file hash computation feature' is set to 'Enabled'." + description: "This setting determines whether hash values are computed for files scanned by Microsoft Defender. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to monitor for suspicious and known malicious activity. File hashes are a reliable way of detecting changes to files, and can speed up the scan process by skipping files that have not changed since they were last scanned and determined to be safe. A changed file hash can also be cause for additional scrutiny." + impact: "This setting could cause performance degradation during initial deployment and for users where new executable content is frequently being created (such as software developers), or where applications are frequently installed or updated. For more information on this setting, please visit Security baseline (FINAL): Windows 10 and Windows Server, version 2004 - Microsoft Tech Community - 1543631. Note: The impact of this setting should be monitored closely during deployment to ensure user and system performance impact is within acceptable limits." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\MpEngine\\Enable file hash computation feature Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 2004 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.7.1"] + - cis_csc_v8: ["10.1"] + - cis_csc_v7: ["8.1"] + - cmmc_v2.0: ["SI.L1-3.14.2"] + - hipaa: ["164.308(a)(5)(ii)(B)"] + - iso_27001-2013: ["A.12.2.1"] + - pci_dss_v3.2.1: ["5.1"] + - pci_dss_v4.0: ["5.1.1", "5.2.1", "5.2.2", "5.3.2"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine -> EnableFileHashComputation' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine -> EnableFileHashComputation -> 1' + + # 18.10.43.10.1 (L1) Ensure 'Scan all downloaded files and attachments' is set to 'Enabled'. (Automated) + - id: 27300 + title: "Ensure 'Scan all downloaded files and attachments' is set to 'Enabled'." + description: "This policy setting configures scanning for all downloaded files and attachments. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Scan all downloaded files and attachments Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-antivirus/configure-real-time-protection-microsoft-defender-antivirus" + compliance: + - cis: ["18.10.43.10.1"] + - cis_csc_v7: ["8.1"] + - iso_27001-2013: ["A.12.2.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableIOAVProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableIOAVProtection -> 0' + + # 18.10.43.10.2 (L1) Ensure 'Turn off real-time protection' is set to 'Disabled'. (Automated) + - id: 27301 + title: "Ensure 'Turn off real-time protection' is set to 'Disabled'." + description: "This policy setting configures real-time protection prompts for known malware detection. Microsoft Defender Antivirus alerts you when malware or potentially unwanted software attempts to install itself or to run on your computer. The recommended state for this setting is: Disabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Turn off real-time protection Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-antivirus/configure-real-time-protection-microsoft-defender-antivirus" + compliance: + - cis: ["18.10.43.10.2"] + - cis_csc_v7: ["8.1"] + - iso_27001-2013: ["A.12.2.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableRealtimeMonitoring' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableRealtimeMonitoring -> 0' + + # 18.10.43.10.3 (L1) Ensure 'Turn on behavior monitoring' is set to 'Enabled'. (Automated) + - id: 27302 + title: "Ensure 'Turn on behavior monitoring' is set to 'Enabled'." + description: "This policy setting allows you to configure behavior monitoring for Microsoft Defender Antivirus. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + impact: "None - this is the default configuration." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Turn on behavior monitoring Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.10.3"] + - cis_csc_v8: ["10.7"] + - cis_csc_v7: ["8.1"] + - iso_27001-2013: ["A.12.2.1"] + - pci_dss_v4.0: ["5.3.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableBehaviorMonitoring' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableBehaviorMonitoring -> 0' + + # 18.10.43.10.4 (L1) Ensure 'Turn on script scanning' is set to 'Enabled'. (Automated) + - id: 27303 + title: "Ensure 'Turn on script scanning' is set to 'Enabled'." + description: "This policy setting allows script scanning to be turned on/off. Script scanning intercepts scripts then scans them before they are executed on the system. The recommended state for this setting is: Enabled." + rationale: "When running an antivirus solution such as Microsoft Defender Antivirus, it is important to ensure that it is configured to heuristically monitor in real-time for suspicious and known malicious activity." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Real-Time Protection\\Turn on script scanning Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 11 Release 21H2 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/microsoft-365/security/defender-endpoint/configure-advanced-scan-types-microsoft-defender-antivirus?view=o365-worldwide" + compliance: + - cis: ["18.10.43.10.4"] + - cis_csc_v8: ["10.7"] + - cis_csc_v7: ["8.1"] + - iso_27001-2013: ["A.12.2.1"] + - pci_dss_v4.0: ["5.3.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableScriptScanning' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-TimeProtection -> DisableScriptScanning -> 0' + + # 18.10.43.12.1 (L2) Ensure 'Configure Watson events' is set to 'Disabled'. (Automated) + - id: 27304 + title: "Ensure 'Configure Watson events' is set to 'Disabled'." + description: "This policy setting allows you to configure whether or not Watson events are sent. The recommended state for this setting is: Disabled." + rationale: "Watson events are the reports that get sent to Microsoft when a program or service crashes or fails, including the possibility of automatic submission. Preventing this information from being sent can help reduce privacy concerns." + impact: "Watson events will not be sent to Microsoft automatically when a program or service crashes or fails." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Reporting\\Configure Watson events Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.12.1"] + - cis_csc_v7: ["13.3"] + - iso_27001-2013: ["A.13.1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting -> DisableGenericRePorts -> 1' + + # 18.10.43.13.1 (L1) Ensure 'Scan removable drives' is set to 'Enabled'. (Automated) + - id: 27305 + title: "Ensure 'Scan removable drives' is set to 'Enabled'." + description: "This policy setting allows you to manage whether or not to scan for malicious software and unwanted software in the contents of removable drives, such as USB flash drives, when running a full scan. The recommended state for this setting is: Enabled." + rationale: "It is important to ensure that any present removable drives are always included in any type of scan, as removable drives are more likely to contain malicious software brought in to the enterprise managed environment from an external, unmanaged computer." + impact: "Removable drives will be scanned during any type of scan by Microsoft Defender Antivirus." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Scan\\Scan removable drives Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.13.1"] + - cis_csc_v8: ["10.4"] + - cis_csc_v7: ["8.4"] + - cmmc_v2.0: ["SC.L2-3.13.13", "SI.L1-3.14.5"] + - hipaa: ["164.310(d)(1)"] + - iso_27001-2013: ["A.12.2.1"] + - pci_dss_v4.0: ["5.3.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableRemovableDriveScanning -> 0' + + # 18.10.43.13.2 (L1) Ensure 'Turn on e-mail scanning' is set to 'Enabled'. (Automated) + - id: 27306 + title: "Ensure 'Turn on e-mail scanning' is set to 'Enabled'." + description: "This policy setting allows you to configure e-mail scanning. When e-mail scanning is enabled, the engine will parse the mailbox and mail files, according to their specific format, in order to analyze the mail bodies and attachments. Several e-mail formats are currently supported, for example: pst (Outlook), dbx, mbx, mime (Outlook Express), binhex (Mac). The recommended state for this setting is: Enabled." + rationale: "Incoming e-mails should be scanned by an antivirus solution such as Microsoft Defender Antivirus, as email attachments are a commonly used attack vector to infiltrate computers with malicious software." + impact: "E-mail scanning by Microsoft Defender Antivirus will be enabled." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Scan\\Turn on e-mail scanning Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.13.2"] + - cis_csc_v7: ["8.1"] + - iso_27001-2013: ["A.12.2.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Scan -> DisableEmailScanning -> 0' + + # 18.10.43.16 (L1) Ensure 'Configure detection for potentially unwanted applications' is set to 'Enabled: Block'. (Automated) + - id: 27307 + title: "Ensure 'Configure detection for potentially unwanted applications' is set to 'Enabled: Block'." + description: "This policy setting controls detection and action for Potentially Unwanted Applications (PUA), which are sneaky unwanted application bundlers or their bundled applications, that can deliver adware or malware. The recommended state for this setting is: Enabled: Block. For more information, see this link: Block potentially unwanted applications with Microsoft Defender Antivirus | Microsoft Docs." + rationale: "Potentially unwanted applications can increase the risk of your network being infected with malware, cause malware infections to be harder to identify, and can waste IT resources in cleaning up the applications. They should be blocked from installation." + impact: "Applications that are identified by Microsoft as PUA will be blocked at download and install time." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Block: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Configure detection for potentially unwanted applications Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with the Microsoft Windows 10 Release 1809 & Server 2019 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.43.16"] + - cis_csc_v8: ["10.6"] + - cis_csc_v7: ["2.7", "8.1"] + - iso_27001-2013: ["A.12.1.2", "A.12.2.1", "A.12.5.1", "A.12.6.2"] + - pci_dss_v3.2.1: ["11.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> PUAProtection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender -> PUAProtection -> 1' + + # 18.10.43.17 (L1) Ensure 'Turn off Microsoft Defender AntiVirus' is set to 'Disabled'. (Automated) + - id: 27308 + title: "Ensure 'Turn off Microsoft Defender AntiVirus' is set to 'Disabled'." + description: "This policy setting turns off Microsoft Defender Antivirus. If the setting is configured to Disabled, Microsoft Defender Antivirus runs and computers are scanned for malware and other potentially unwanted software. The recommended state for this setting is: Disabled." + rationale: "It is important to ensure a current, updated antivirus product is scanning each computer for malicious file activity. Microsoft provides a competent solution out of the box in Microsoft Defender Antivirus. Organizations that choose to purchase a reputable third-party antivirus solution may choose to exempt themselves from this recommendation in lieu of the commercial alternative." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Microsoft Defender Antivirus\\Turn off Microsoft Defender AntiVirus Note: This Group Policy path is provided by the Group Policy template WindowsDefender.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Turn off Windows Defender, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates. It was again renamed to Windows Defender Antivirus starting with the Windows 10 Release 2004 Administrative Templates." + compliance: + - cis: ["18.10.43.17"] + - cis_csc_v8: ["10.6"] + - cis_csc_v7: ["8.1"] + - iso_27001-2013: ["A.12.2.1"] + - pci_dss_v3.2.1: ["11.4"] + - soc_2: ["CC6.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsDefender' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsDefender -> DisableAntiSpyware' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsDefender -> DisableAntiSpyware -> 0' + + # 18.10.51.1 (L1) Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'. (Automated) + - id: 27309 + title: "Ensure 'Prevent the usage of OneDrive for file storage' is set to 'Enabled'." + description: "This policy setting lets you prevent apps and features from working with files on OneDrive using the Next Generation Sync Client. The recommended state for this setting is: Enabled." + rationale: "Enabling this setting prevents users from accidentally (or intentionally) uploading confidential or sensitive corporate information to the OneDrive cloud service using the Next Generation Sync Client. Note: This security concern applies to any cloud-based file storage application installed on a server, not just the one supplied with Windows Server." + impact: "Users can't access OneDrive from the OneDrive app and file picker. Windows Store apps can't access OneDrive using the WinRT API. OneDrive doesn't appear in the navigation pane in File Explorer. OneDrive files aren't kept in sync with the cloud. Users can't automatically upload photos and videos from the camera roll folder. Note: If your organization uses Office 365, be aware that this setting will prevent users from saving files to OneDrive/SkyDrive. Note #2: If your organization has decided to implement OneDrive for Business and therefore needs to except itself from this recommendation, we highly suggest that you also obtain and utilize the OneDrive.admx/adml template that is bundled with the latest OneDrive client, as noted at this link (this template is not included with the Windows Administrative Templates). Two alternative OneDrive settings in particular from that template are worth your consideration: - Allow syncing OneDrive accounts for only specific organizations - a computer-based setting that restricts OneDrive client connections to only approved tenant IDs. - Prevent users from synchronizing personal OneDrive accounts - a user-based setting that prevents use of consumer OneDrive (i.e. non-business)." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\OneDrive\\Prevent the usage of OneDrive for file storage Note: This Group Policy path may not exist by default. It is provided by the Group Policy template SkyDrive.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer). However, we strongly recommend you only use the version included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Older versions of the templates had conflicting settings in different template files for both OneDrive & SkyDrive, until it was cleaned up properly in the above version. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Prevent the usage of SkyDrive for file storage, but it was renamed starting with the Windows 10 RTM (Release 1507) Administrative Templates." + compliance: + - cis: ["18.10.51.1"] + - cis_csc_v7: ["13.4"] + - iso_27001-2013: ["A.13.2.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\OneDrive -> DisableFileSyncNGSC -> 1' + + # 18.10.56.1 (L2) Ensure 'Turn off Push To Install service' is set to 'Enabled'. (Automated) + - id: 27310 + title: "Ensure 'Turn off Push To Install service' is set to 'Enabled'." + description: "This policy setting controls whether users can push Apps to the device from the Microsoft Store App running on other devices or the web. The recommended state for this setting is: Enabled." + rationale: "In a high security managed environment, application installations should be managed centrally by IT staff, not by end users." + impact: "Users will not be able to push Apps to this device from the Microsoft Store running on other devices or the web." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Push to Install\\Turn off Push To Install service Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PushToInstall.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.56.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall -> DisablePushToInstall' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\PushToInstall -> DisablePushToInstall -> 1' + + # 18.10.57.2.2 (L1) Ensure 'Do not allow passwords to be saved' is set to 'Enabled'. (Automated) + - id: 27311 + title: "Ensure 'Do not allow passwords to be saved' is set to 'Enabled'." + description: "This policy setting helps prevent Remote Desktop clients from saving passwords on a computer. The recommended state for this setting is: Enabled. Note: If this policy setting was previously configured as Disabled or Not configured, any previously saved passwords will be deleted the first time a Remote Desktop client disconnects from any server." + rationale: "An attacker with physical access to the computer may be able to break the protection guarding saved passwords. An attacker who compromises a user's account and connects to their computer could use saved passwords to gain access to additional hosts." + impact: "The password saving checkbox will be disabled for Remote Desktop clients and users will not be able to save passwords." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Connection Client\\Do not allow passwords to be saved Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.2.2"] + - cis_csc_v7: ["16.11"] + - iso_27001-2013: ["A.8.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DisablePasswordSaving -> 1' + + # 18.10.57.3.2.1 (L2) Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'. (Automated) + - id: 27312 + title: "Ensure 'Restrict Remote Desktop Services users to a single Remote Desktop Services session' is set to 'Enabled'." + description: "This policy setting allows you to restrict users to a single Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "This setting ensures that users & administrators who Remote Desktop to a server will continue to use the same session - if they disconnect and reconnect, they will go back to the same session they were using before, preventing the creation of a second simultaneous session. This both prevents unnecessary resource usage by having the server host unnecessary additional sessions (which would put extra load on the server) and also ensures a consistency of experience for the user." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Connections\\Restrict Remote Desktop Services users to a single Remote Desktop Services session Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Restrict Terminal Services users to a single remote session, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.10.57.3.2.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fSingleSessionPerUser' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fSingleSessionPerUser -> 1' + + # 18.10.57.3.3.1 (L2) Ensure 'Allow UI Automation redirection' is set to 'Disabled'. (Automated) + - id: 27313 + title: "Ensure 'Allow UI Automation redirection' is set to 'Disabled'." + description: "This policy setting determines whether User Interface (UI) Automation client applications running on the local computer can access UI elements on the server. UI Automation gives programs access to most UI elements, which allows use of assistive technology products like Magnifier and Narrator that need to interact with the UI in order to work properly. UI information also allows automated test scripts to interact with the UI. For example, the local computer's Narrator and Magnifier clients can be used to interact with UI on a web page opened in a remote session. The recommended state for this setting is: Disabled. Note: Remote Desktop sessions don't currently support UI Automation redirection." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for UI Automation redirection within a Remote Desktop session is rare, and not supported at this time, but it makes sense to reduce the number of unexpected avenues for malicious activity to occur." + impact: "UI Automation clients on the local computer will not be able to interact with remote apps." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Allow UI Automation redirection Note: This Group Policy path may not exist by default. It is provided by the Group Policy template TerminalServer.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-overview" + compliance: + - cis: ["18.10.57.3.3.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> EnableUiaRedirection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> EnableUiaRedirection -> 0' + + # 18.10.57.3.3.2 (L2) Ensure 'Do not allow COM port redirection' is set to 'Enabled'. (Automated) + - id: 27314 + title: "Ensure 'Do not allow COM port redirection' is set to 'Enabled'." + description: "This policy setting specifies whether to prevent the redirection of data to client COM ports from the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for COM port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + impact: "Users in a Remote Desktop Services session will not be able to redirect server data to local (client) COM ports." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow COM port redirection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.3.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCcm -> 1' + + # 18.10.57.3.3.3 (L1) Ensure 'Do not allow drive redirection' is set to 'Enabled'. (Automated) + - id: 27315 + title: "Ensure 'Do not allow drive redirection' is set to 'Enabled'." + description: "This policy setting prevents users from sharing the local drives on their client computers to Remote Desktop Servers that they access. Mapped drives appear in the session folder tree in Windows Explorer in the following format: \\\\TSClient\\$ If local drives are shared they are left vulnerable to intruders who want to exploit the data that is stored on them. The recommended state for this setting is: Enabled." + rationale: "Data could be forwarded from the user's Remote Desktop Services session to the user's local computer without any direct user interaction. Malicious software already present on a compromised server would have direct and stealthy disk access to the user's local computer during the Remote Desktop session." + impact: "Drive redirection will not be possible. In most situations, traditional network drive mapping to file shares (including administrative shares) performed manually by the connected user will serve as a capable substitute to still allow file transfers when needed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow drive redirection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.3.3"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableCdm -> 1' + + # 18.10.57.3.3.4 (L2) Ensure 'Do not allow location redirection' is set to 'Enabled'. (Automated) + - id: 27316 + title: "Ensure 'Do not allow location redirection' is set to 'Enabled'." + description: "This policy setting controls the redirection of location data to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for location data redirection within a Remote Desktop session is rare, so it makes sense to reduce the number of unexpected avenues for malicious activity to occur." + impact: "Users will not be able to redirect their location data to the remote computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow location redirection Note: This Group Policy path may not exist by default. It is provided by the Group Policy template TerminalServer.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.57.3.3.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLocationRedir' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLocationRedir -> 1' + + # 18.10.57.3.3.5 (L2) Ensure 'Do not allow LPT port redirection' is set to 'Enabled'. (Automated) + - id: 27317 + title: "Ensure 'Do not allow LPT port redirection' is set to 'Enabled'." + description: "This policy setting specifies whether to prevent the redirection of data to client LPT ports during a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for LPT port redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + impact: "Users in a Remote Desktop Services session will not be able to redirect server data to local (client) LPT ports." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow LPT port redirection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.3.5"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableLPT -> 1' + + # 18.10.57.3.3.6 (L2) Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'. (Automated) + - id: 27318 + title: "Ensure 'Do not allow supported Plug and Play device redirection' is set to 'Enabled'." + description: "This policy setting allows you to control the redirection of supported Plug and Play devices, such as Windows Portable Devices, to the remote computer in a Remote Desktop Services session. The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. The need for Plug and Play device redirection within a Remote Desktop session is very rare, so makes sense to reduce the number of unexpected avenues for data exfiltration and/or malicious code transfer." + impact: "Users in a Remote Desktop Services session will not be able to redirect their supported (local client) Plug and Play devices to the remote computer." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow supported Plug and Play device redirection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.3.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisablePNPRedir -> 1' + + # 18.10.57.3.3.7 (L2) Ensure 'Do not allow WebAuthn redirection' is set to 'Enabled'. (Automated) + - id: 27319 + title: "Ensure 'Do not allow WebAuthn redirection' is set to 'Enabled'." + description: "This policy setting controls the redirection of web authentication (WebAuthn) requests from a Remote Desktop session to the local device. This redirection enables users to authenticate to resources inside the Remote Desktop session using their local authenticator (e.g. Windows Hello for Business, security key, or other). The recommended state for this setting is: Enabled." + rationale: "In a more security-sensitive environment, it is desirable to reduce the possible attack surface. To reduce this, resources inside the Remote Desktop session should not be allowed to use the local authenticator." + impact: "Users in a Remote Desktop Services session will not be able to authenticate to resources inside the Remote Desktop session using their local authenticator." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Device and Resource Redirection\\Do not allow WebAuthn redirection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.57.3.3.7"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableWebAuthn' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fDisableWebAuthn -> 1' + + # 18.10.57.3.9.1 (L1) Ensure 'Always prompt for password upon connection' is set to 'Enabled'. (Automated) + - id: 27320 + title: "Ensure 'Always prompt for password upon connection' is set to 'Enabled'." + description: "This policy setting specifies whether Remote Desktop Services always prompts the client computer for a password upon connection. You can use this policy setting to enforce a password prompt for users who log on to Remote Desktop Services, even if they already provided the password in the Remote Desktop Connection client. The recommended state for this setting is: Enabled." + rationale: "Users have the option to store both their username and password when they create a new Remote Desktop Connection shortcut. If the server that runs Remote Desktop Services allows users who have used this feature to log on to the server but not enter their password, then it is possible that an attacker who has gained physical access to the user's computer could connect to a Remote Desktop Server through the Remote Desktop Connection shortcut, even though they may not know the user's password." + impact: "Users cannot automatically log on to Remote Desktop Services by supplying their passwords in the Remote Desktop Connection client. They will be prompted for a password to log on." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Always prompt for password upon connection Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In the Microsoft Windows Vista Administrative Templates, this setting was named Always prompt client for password upon connection, but it was renamed starting with the Windows Server 2008 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.57.3.9.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fPromptForPassword -> 1' + + # 18.10.57.3.9.2 (L1) Ensure 'Require secure RPC communication' is set to 'Enabled'. (Automated) + - id: 27321 + title: "Ensure 'Require secure RPC communication' is set to 'Enabled'." + description: "This policy setting allows you to specify whether Remote Desktop Services requires secure Remote Procedure Call (RPC) communication with all clients or allows unsecured communication. You can use this policy setting to strengthen the security of RPC communication with clients by allowing only authenticated and encrypted requests. The recommended state for this setting is: Enabled." + rationale: "Allowing unsecure RPC communication can exposes the server to man in the middle attacks and data disclosure attacks." + impact: "Remote Desktop Services accepts requests from RPC clients that support secure requests, and does not allow unsecured communication with untrusted clients." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require secure RPC communication Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.9.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> fEncryptRPCTraffic -> 1' + + # 18.10.57.3.9.3 (L1) Ensure 'Require use of specific security layer for remote (RDP) connections' is set to 'Enabled: SSL'. (Automated) + - id: 27322 + title: "Ensure 'Require use of specific security layer for remote (RDP) connections' is set to 'Enabled: SSL'." + description: "This policy setting specifies whether to require the use of a specific security layer to secure communications between clients and RD Session Host servers during Remote Desktop Protocol (RDP) connections. The recommended state for this setting is: Enabled: SSL. Note: In spite of this setting being labeled SSL, it is actually enforcing Transport Layer Security (TLS) version 1.0, not the older (and less secure) SSL protocol." + rationale: "The native Remote Desktop Protocol (RDP) encryption is now considered a weak protocol, so enforcing the use of stronger Transport Layer Security (TLS) encryption for all RDP communications between clients and RD Session Host servers is preferred." + impact: "TLS 1.0 will be required to authenticate to the RD Session Host server. If TLS is not supported, the connection fails. Note: By default, this setting will use a self-signed certificate for RDP connections. If your organization has established the use of a Public Key Infrastructure (PKI) for SSL/TLS encryption, then we recommend that you also configure the Server authentication certificate template setting to instruct RDP to use a certificate from your PKI instead of a self-signed one. Note that the certificate template used for this purpose must have “Client Authentication” configured as an Intended Purpose. Note also that a valid, non-expired certificate using the specified template must already be installed on the server for it to work. Note #2: Some third party two-factor authentication solutions (e.g. RSA Authentication Agent) can be negatively affected by this setting, as the SSL/TLS security layer will expect the user's Windows password upon initial connection attempt (before the RDP logon screen), and once successfully authenticated, pass the credential along to that Windows session on the RDP host (to complete the login). If a two-factor agent is present and expecting a different credential at the RDP logon screen, this initial connection may result in a failed logon attempt, and also effectively cause a “double logon” requirement for each and every new RDP session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: SSL: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require use of specific security layer for remote (RDP) connections Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.9.3"] + - cis_csc_v8: ["3.10"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> SecurityLayer' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> SecurityLayer -> 2' + + # 18.10.57.3.9.4 (L1) Ensure 'Require user authentication for remote connections by using Network Level Authentication' is set to 'Enabled'. (Automated) + - id: 27323 + title: "Ensure 'Require user authentication for remote connections by using Network Level Authentication' is set to 'Enabled'." + description: "This policy setting allows you to specify whether to require user authentication for remote connections to the RD Session Host server by using Network Level Authentication. The recommended state for this setting is: Enabled." + rationale: "Requiring that user authentication occur earlier in the remote connection process enhances security." + impact: "Only client computers that support Network Level Authentication can connect to the RD Session Host server. Note: Some third party two-factor authentication solutions (e.g. RSA Authentication Agent) can be negatively affected by this setting, as Network Level Authentication will expect the user's Windows password upon initial connection attempt (before the RDP logon screen), and once successfully authenticated, pass the credential along to that Windows session on the RDP host (to complete the login). If a two-factor agent is present and expecting a different credential at the RDP logon screen, this initial connection may result in a failed logon attempt, and also effectively cause a “double logon” requirement for each and every new RDP session." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Require user authentication for remote connections by using Network Level Authentication Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In the Microsoft Windows Vista Administrative Templates, this setting was initially named Require user authentication using RDP 6.0 for remote connections, but it was renamed starting with the Windows Server 2008 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.57.3.9.4"] + - cis_csc_v8: ["3.10"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> UserAuthentication' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> UserAuthentication -> 1' + + # 18.10.57.3.9.5 (L1) Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'. (Automated) + - id: 27324 + title: "Ensure 'Set client connection encryption level' is set to 'Enabled: High Level'." + description: "This policy setting specifies whether to require the use of a specific encryption level to secure communications between client computers and RD Session Host servers during Remote Desktop Protocol (RDP) connections. This policy only applies when you are using native RDP encryption. However, native RDP encryption (as opposed to SSL encryption) is not recommended. This policy does not apply to SSL encryption. The recommended state for this setting is: Enabled: High Level." + rationale: "If Remote Desktop client connections that use low level encryption are allowed, it is more likely that an attacker will be able to decrypt any captured Remote Desktop Services network traffic." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: High Level: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Security\\Set client connection encryption level Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.9.5"] + - cis_csc_v8: ["3.10"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MinEncryptionLevel -> 3' + + # 18.10.57.3.10.1 (L2) Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less, but not Never (0)'. (Automated) + - id: 27325 + title: "Ensure 'Set time limit for active but idle Remote Desktop Services sessions' is set to 'Enabled: 15 minutes or less, but not Never (0)'." + description: "This policy setting allows you to specify the maximum amount of time that an active Remote Desktop Services session can be idle (without user input) before it is automatically disconnected. The recommended state for this setting is: Enabled: 15 minutes or less, but not Never (0)." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of inactive sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. In addition, session timeouts that are misconfigured or set for a long period of time can leave the system open to an attacker hijacking the session." + impact: "Remote Desktop Services will automatically disconnect active but idle sessions after 15 minutes (or the specified amount of time). The user receives a warning two minutes before the session disconnects, which allows the user to press a key or move the mouse to keep the session active. Note that idle session time limits do not apply to console sessions." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 15 minutes or less, but not Never (0): Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for active but idle Remote Desktop Services sessions Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Set time limit for active but idle Terminal Services sessions, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.10.57.3.10.1"] + - cis_csc_v7: ["16.11"] + - iso_27001-2013: ["A.8.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare <= 900000' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxIdleTime -> n:^(\d+) compare != 0' + + # 18.10.57.3.10.2 (L2) Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'. (Automated) + - id: 27326 + title: "Ensure 'Set time limit for disconnected sessions' is set to 'Enabled: 1 minute'." + description: "This policy setting allows you to configure a time limit for disconnected Remote Desktop Services sessions. The recommended state for this setting is: Enabled: 1 minute." + rationale: "This setting helps to prevent active Remote Desktop sessions from tying up the computer for long periods of time while not in use, preventing computing resources from being consumed by large numbers of disconnected but still active sessions. In addition, old, forgotten Remote Desktop sessions that are still active can cause password lockouts if the user's password has changed but the old session is still running. For systems that limit the number of connected users (e.g. servers in the default Administrative mode - 2 sessions only), other users' old but still active sessions can prevent another user from connecting, resulting in an effective denial of service. This setting is important to ensure a disconnected session is properly terminated. In addition, session timeouts that are misconfigured or set for a long period of time can leave the system open to an attacker hijacking the session." + impact: "Disconnected Remote Desktop sessions are deleted from the server after 1 minute. Note that disconnected session time limits do not apply to console sessions." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 1 minute: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Session Time Limits\\Set time limit for disconnected sessions Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.10.2"] + - cis_csc_v7: ["16.11"] + - iso_27001-2013: ["A.8.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> MaxDisconnectionTime -> 60000' + + # 18.10.57.3.11.1 (L1) Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'. (Automated) + - id: 27327 + title: "Ensure 'Do not delete temp folders upon exit' is set to 'Disabled'." + description: "This policy setting specifies whether Remote Desktop Services retains a user's per-session temporary folders at logoff. The recommended state for this setting is: Disabled." + rationale: "Sensitive information could be contained inside the temporary folders and visible to other administrators that log into the system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not delete temp folders upon exit Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Do not delete temp folder upon exit, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.57.3.11.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> DeleteTempDirsOnExit -> 1' + + # 18.10.57.3.11.2 (L1) Ensure 'Do not use temporary folders per session' is set to 'Disabled'. (Automated) + - id: 27328 + title: "Ensure 'Do not use temporary folders per session' is set to 'Disabled'." + description: "By default, Remote Desktop Services creates a separate temporary folder on the RD Session Host server for each active session that a user maintains on the RD Session Host server. The temporary folder is created on the RD Session Host server in a Temp folder under the user's profile folder and is named with the sessionid. This temporary folder is used to store individual temporary files. To reclaim disk space, the temporary folder is deleted when the user logs off from a session. The recommended state for this setting is: Disabled." + rationale: "Disabling this setting keeps the cached data independent for each session, both reducing the chance of problems from shared cached data between sessions, and keeping possibly sensitive data separate to each user session." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Remote Desktop Services\\Remote Desktop Session Host\\Temporary Folders\\Do not use temporary folders per session Note: This Group Policy path is provided by the Group Policy template TerminalServer.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.57.3.11.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> PerSessionTempDir' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services -> PerSessionTempDir -> 1' + + # 18.10.58.1 (L1) Ensure 'Prevent downloading of enclosures' is set to 'Enabled'. (Automated) + - id: 27329 + title: "Ensure 'Prevent downloading of enclosures' is set to 'Enabled'." + description: "This policy setting prevents the user from having enclosures (file attachments) downloaded from an RSS feed to the user's computer. The recommended state for this setting is: Enabled." + rationale: "Allowing attachments to be downloaded through the RSS feed can introduce files that could have malicious intent." + impact: "Users cannot set the Feed Sync Engine to download an enclosure through the Feed property page. Developers cannot change the download setting through feed APIs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\RSS Feeds\\Prevent downloading of enclosures Note: This Group Policy path is provided by the Group Policy template InetRes.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Turn off downloading of enclosures, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.58.1"] + - cis_csc_v8: ["9.4"] + - cis_csc_v7: ["7.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8"] + - iso_27001-2013: ["A.12.6.2"] + - nist_sp_800-53: ["CM-10", "CM-11", "SC-18"] + - pci_dss_v4.0: ["2.2.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Feeds -> DisableEnclosureDownload -> 1' + + # 18.10.59.2 (L2) Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search'. (Automated) + - id: 27330 + title: "Ensure 'Allow Cloud Search' is set to 'Enabled: Disable Cloud Search'." + description: "This policy setting allows search and Cortana to search cloud sources like OneDrive and SharePoint. The recommended state for this setting is: Enabled: Disable Cloud Search." + rationale: "Due to privacy concerns, data should never be sent to any third-party since this data could contain sensitive information." + impact: "Search and Cortana will not be permitted to search cloud sources like OneDrive and SharePoint." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Disable Cloud Search: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow Cloud Search Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.59.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCloudSearch' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowCloudSearch -> 0' + + # 18.10.59.3 (L1) Ensure 'Allow indexing of encrypted files' is set to 'Disabled'. (Automated) + - id: 27331 + title: "Ensure 'Allow indexing of encrypted files' is set to 'Disabled'." + description: "This policy setting controls whether encrypted items are allowed to be indexed. When this setting is changed, the index is rebuilt completely. Full volume encryption (such as BitLocker Drive Encryption or a non-Microsoft solution) must be used for the location of the index to maintain security for encrypted files. The recommended state for this setting is: Disabled." + rationale: "Indexing and allowing users to search encrypted files could potentially reveal confidential data stored within the encrypted files." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow indexing of encrypted files Note: This Group Policy path is provided by the Group Policy template Search.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.59.3"] + - cis_csc_v7: ["14.8"] + - iso_27001-2013: ["A.10.1.1"] + condition: any + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> AllowIndexingEncryptedStoresOrItems -> 0' + + # 18.10.59.4 (L2) Ensure 'Allow search highlights' is set to 'Disabled'. (Automated) + - id: 27332 + title: "Ensure 'Allow search highlights' is set to 'Disabled'." + description: "This policy setting controls search highlights in the start menu search box and in search home. The recommended state for this setting is: Disabled." + rationale: "In a high security environment, data should never be sent to or received by any third-party since this data could contain sensitive information." + impact: 'Interesting, "informative", and "noteworthy" information about the current date will not be displayed (by Microsoft) to the user.' + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Search\\Allow search highlights Note: This Group Policy path may not exist by default. It is provided by the Group Policy template Search.admx/adml that is included with the Microsoft Windows 10 Release 21H2 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.59.4"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> EnableDynamicContentInWSB' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search -> EnableDynamicContentInWSB -> 0' + + # 18.10.63.1 (L2) Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'. (Automated) + - id: 27333 + title: "Ensure 'Turn off KMS Client Online AVS Validation' is set to 'Enabled'." + description: "The Key Management Service (KMS) is a Microsoft license activation method that entails setting up a local server to store the software licenses. The KMS server itself needs to connect to Microsoft to activate the KMS service, but subsequent on-network clients can activate Microsoft Windows OS and/or their Microsoft Office via the KMS server instead of connecting directly to Microsoft. This policy setting lets you opt-out of sending KMS client activation data to Microsoft automatically. The recommended state for this setting is: Enabled." + rationale: "Even though the KMS licensing method does not require KMS clients to connect to Microsoft, they still send KMS client activation state data to Microsoft automatically. Preventing this information from being sent can help reduce privacy concerns in high security environments." + impact: "The computer is prevented from sending data to Microsoft regarding its KMS client activation state." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Software Protection Platform\\Turn off KMS Client Online AVS Validation Note: This Group Policy path may not exist by default. It is provided by the Group Policy template AVSValidationGP.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.63.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Software Protection Platform -> NoGenTicket -> 1' + + # 18.10.76.2.1 (L1) Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass'. (Automated) + - id: 27334 + title: "Ensure 'Configure Windows Defender SmartScreen' is set to 'Enabled: Warn and prevent bypass'." + description: "This policy setting allows you to manage the behavior of Windows SmartScreen. Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. Some information is sent to Microsoft about files and programs run on PCs with this feature enabled. The recommended state for this setting is: Enabled: Warn and prevent bypass." + rationale: "Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. However, due to the fact that some information is sent to Microsoft about files and programs run on PCs some organizations may prefer to disable it." + impact: "Users will be warned before they are allowed to run unrecognized programs downloaded from the Internet." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Warn and prevent bypass: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Defender SmartScreen\\Explorer\\Configure Windows Defender SmartScreen Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsExplorer.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Configure Windows SmartScreen, but it was renamed starting with the Windows 10 Release 1703 Administrative Templates." + compliance: + - cis: ["18.10.76.2.1"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> ShellSmartScreenLevel' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> EnableSmartScreen -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System -> ShellSmartScreenLevel -> Block' + + # 18.10.80.1 (L2) Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled'. (Automated) + - id: 27335 + title: "Ensure 'Allow suggested apps in Windows Ink Workspace' is set to 'Disabled'." + description: "This policy setting determines whether suggested apps in Windows Ink Workspace are allowed. The recommended state for this setting is: Disabled." + rationale: "This Microsoft feature is designed to collect data and suggest apps based on that data collected. Disabling this setting will help ensure your data is not shared with any third party." + impact: "The suggested apps in Windows Ink Workspace will not be allowed." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow suggested apps in Windows Ink Workspace Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.80.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowSuggestedAppsInWindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowSuggestedAppsInWindowsInkWorkspace -> 0' + + # 18.10.80.2 (L1) Ensure 'Allow Windows Ink Workspace' is set to 'Enabled: On, but disallow access above lock' OR 'Enabled: Disabled'. (Automated) + - id: 27336 + title: "Ensure 'Allow Windows Ink Workspace' is set to 'Enabled: On, but disallow access above lock' OR 'Enabled: Disabled'." + description: "This policy setting determines whether Windows Ink items are allowed above the lock screen. The recommended state for this setting is: Enabled: On, but disallow access above lock OR Enabled: Disabled." + rationale: "Allowing any apps to be accessed while system is locked is not recommended. If this feature is permitted, it should only be accessible once a user authenticates with the proper credentials." + impact: "Windows Ink Workspace will not be permitted above the lock screen." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: On, but disallow access above lock OR Enabled: Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Ink Workspace\\Allow Windows Ink Workspace Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsInkWorkspace.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.80.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsInkWorkspace -> AllowWindowsInkWorkspace -> r:^0$|^1$' + + # 18.10.81.1 (L1) Ensure 'Allow user control over installs' is set to 'Disabled'. (Automated) + - id: 27337 + title: "Ensure 'Allow user control over installs' is set to 'Disabled'." + description: "This setting controls whether users are permitted to change installation options that typically are available only to system administrators. The security features of Windows Installer normally prevent users from changing installation options that are typically reserved for system administrators, such as specifying the directory to which files are installed. If Windows Installer detects that an installation package has permitted the user to change a protected option, it stops the installation and displays a message. These security features operate only when the installation program is running in a privileged security context in which it has access to directories denied to the user. The recommended state for this setting is: Disabled." + rationale: "In an enterprise managed environment, only IT staff with administrative rights should be installing or changing software on a system. Allowing users the ability to have any control over installs can risk unapproved software from being installed or removed from a system, which could cause the system to become vulnerable to compromise." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Allow user control over installs Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was named Enable user control over installs, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.81.1"] + - cis_csc_v8: ["2.5"] + - cmmc_v2.0: ["CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "CM.L2-3.4.9"] + - nist_sp_800-53: ["CM-7(5)"] + - pci_dss_v4.0: ["1.2.5", "2.2.4"] + - soc_2: ["CC6.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> EnableUserControl -> 0' + + # 18.10.81.2 (L1) Ensure 'Always install with elevated privileges' is set to 'Disabled'. (Automated) + - id: 27338 + title: "Ensure 'Always install with elevated privileges' is set to 'Disabled'." + description: "This setting controls whether or not Windows Installer should use system permissions when it installs any program on the system. Note: This setting appears both in the Computer Configuration and User Configuration folders. To make this setting effective, you must enable the setting in both folders. Caution: If enabled, skilled users can take advantage of the permissions this setting grants to change their privileges and gain permanent access to restricted files and folders. Note that the User Configuration version of this setting is not guaranteed to be secure. The recommended state for this setting is: Disabled." + rationale: "Users with limited privileges can exploit this feature by creating a Windows Installer installation package that creates a new local account that belongs to the local built-in Administrators group, adds their current account to the local built-in Administrators group, installs malicious software, or performs other unauthorized activities." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Always install with elevated privileges Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.81.2"] + - cis_csc_v8: ["5.4"] + - cis_csc_v7: ["4.3"] + - cmmc_v2.0: ["AC.L2-3.1.5", "AC.L2-3.1.6", "AC.L2-3.1.7", "SC.L2-3.13.3"] + - iso_27001-2013: ["A.9.2.3"] + - nist_sp_800-53: ["AC-6(2)", "AC-6(5)"] + - pci_dss_v3.2.1: ["7.1", "7.1.1", "7.1.2", "7.1.3"] + - soc_2: ["CC6.1", "CC6.3"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> AlwaysInstallElevated -> 0' + + # 18.10.81.3 (L2) Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'. (Automated) + - id: 27339 + title: "Ensure 'Prevent Internet Explorer security prompt for Windows Installer scripts' is set to 'Disabled'." + description: "This policy setting controls whether Web-based programs are allowed to install software on the computer without notifying the user. The recommended state for this setting is: Disabled." + rationale: "Suppressing the system warning can pose a security risk and increase the attack surface on the system." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Installer\\Prevent Internet Explorer security prompt for Windows Installer scripts Note: This Group Policy path is provided by the Group Policy template MSI.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Disable IE security prompt for Windows Installer scripts, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.81.3"] + - cis_csc_v8: ["2.5"] + - cmmc_v2.0: ["CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "CM.L2-3.4.9"] + - nist_sp_800-53: ["CM-7(5)"] + - pci_dss_v4.0: ["1.2.5", "2.2.4"] + - soc_2: ["CC6.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Installer -> SafeForScripting -> 0' + + # 18.10.82.1 (L1) Ensure 'Enable MPR notifications for the system' is set to 'Disabled'. (Automated) + - id: 27340 + title: "Ensure 'Enable MPR notifications for the system' is set to 'Disabled'." + description: "This policy setting controls whether winlogon sends Multiple Provider Router (MPR) notifications. MPR handles communication between the Windows operating system and the installed network providers. MPR checks the registry to determine which providers are installed on the system and the order they are cycled through. The recommended state for this setting is: Disabled." + rationale: "MPR is a legacy utility that provides notifications to registered credential managers or network providers when there is a logon event or a password change event. Although this functionality can be used by legitimate applications, it can also be abused by attackers to harvest logon information." + impact: "Winlogon will not send Multiple Provider Router (MPR) notifications on the system." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Logon Options\\Enable MPR notifications for the system Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinLogon.admx/adml that is included with the Microsoft Windows 11 Release 22H2 Administrative Templates (or newer)." + references: + - "https://techcommunity.microsoft.com/t5/microsoft-security-baselines/windows-11-version-22h2-security-baseline/ba-p/3632520" + - "https://learn.microsoft.com/en-us/windows/win32/secauthn/multiple-provider-router" + compliance: + - cis: ["18.10.82.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> EnableMPR' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> EnableMPR -> 0' + + # 18.10.82.2 (L1) Ensure 'Sign-in and lock last interactive user automatically after a restart' is set to 'Disabled'. (Automated) + - id: 27341 + title: "Ensure 'Sign-in and lock last interactive user automatically after a restart' is set to 'Disabled'." + description: "This policy setting controls whether a device will automatically sign-in the last interactive user after Windows Update restarts the system. The recommended state for this setting is: Disabled." + rationale: "Disabling this feature will prevent the caching of user's credentials and unauthorized use of the device, and also ensure the user is aware of the restart." + impact: "The device does not store the user's credentials for automatic sign-in after a Windows Update restart. The users' lock screen apps are not restarted after the system restarts. The user is required to present the logon credentials in order to proceed after restart." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Logon Options\\Sign-in and lock last interactive user automatically after a restart Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WinLogon.admx/adml that is included with the Microsoft Windows 8.1 & Server 2012 R2 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Sign-in last interactive user automatically after a system-initiated restart, but it was renamed starting with the Windows 10 Release 1903 Administrative Templates." + compliance: + - cis: ["18.10.82.2"] + - cis_csc_v7: ["16.11"] + - iso_27001-2013: ["A.8.1.3"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System -> DisableAutomaticRestartSignOn -> 1' + + # 18.10.87.1 (L1) Ensure 'Turn on PowerShell Script Block Logging' is set to 'Enabled'. (Automated) + - id: 27342 + title: "Ensure 'Turn on PowerShell Script Block Logging' is set to 'Enabled'." + description: "This policy setting enables logging of all PowerShell script input to the Applications and Services Logs\\Microsoft\\Windows\\PowerShell\\Operational Event Log channel. The recommended state for this setting is: Enabled. Note: If logging of Script Block Invocation Start/Stop Events is enabled (option box checked), PowerShell will log additional events when invocation of a command, script block, function, or script starts or stops. Enabling this option generates a high volume of event logs. CIS has intentionally chosen not to make a recommendation for this option, since it generates a large volume of events. If an organization chooses to enable the optional setting (checked), this also conforms to the benchmark." + rationale: "Logs of PowerShell script input can be very valuable when performing forensic investigations of PowerShell attack incidents to determine what occurred." + impact: "PowerShell script input will be logged to the Applications and Services Logs\\Microsoft\\Windows\\PowerShell\\Operational Event Log channel, which can contain credentials and sensitive information. Warning: There are potential risks of capturing credentials and sensitive information in the PowerShell logs, which could be exposed to users who have read-access to those logs. Microsoft provides a feature called \"Protected Event Logging\" to better secure event log data. For assistance with protecting event logging, visit: About Logging Windows - PowerShell | Microsoft Docs." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Script Block Logging Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_logging_windows?view=powershell-7.2#protected-event-logging" + compliance: + - cis: ["18.10.87.1"] + - cis_csc_v8: ["8.8"] + - cis_csc_v7: ["8.8"] + - iso_27001-2013: ["A.12.14.1"] + - soc_2: ["CC5.2", "CC6.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging -> EnableScriptBlockLogging -> 1' + + # 18.10.87.2 (L1) Ensure 'Turn on PowerShell Transcription' is set to 'Enabled'. (Automated) + - id: 27343 + title: "Ensure 'Turn on PowerShell Transcription' is set to 'Enabled'." + description: "This Policy setting lets you capture the input and output of Windows PowerShell commands into text-based transcripts. The recommended state for this setting is: Enabled." + rationale: "PowerShell transcript input can be very valuable when performing forensic investigations of PowerShell attack incidents to determine what occurred." + impact: "PowerShell transcript input will be logged to the PowerShell_transcript output file, which is saved to the My Documents folder of each users' profile by default. Warning: There are potential risks of capturing credentials and sensitive information in the PowerShell_transcript output file, which could be exposed to users who have read-access to the file." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows PowerShell\\Turn on PowerShell Transcription Note: This Group Policy path may not exist by default. It is provided by the Group Policy template PowerShellExecutionPolicy.admx/adml that is included with the Microsoft Windows 10 RTM (Release 1507) Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_group_policy_settings?view=powershell-7.2#turn-on-powershell-transcription" + compliance: + - cis: ["18.10.87.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\PowerShell\Transcription -> EnableTranscripting -> 1' + + # 18.10.89.1.1 (L1) Ensure 'Allow Basic authentication' is set to 'Disabled'. (Automated) + - id: 27344 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client uses Basic authentication. The recommended state for this setting is: Disabled." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow Basic authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.89.1.1"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["16.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowBasic -> 0' + + # 18.10.89.1.2 (L1) Ensure 'Allow unencrypted traffic' is set to 'Disabled'. (Automated) + - id: 27345 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Allow unencrypted traffic Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.89.1.2"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowUnencryptedTraffic -> 0' + + # 18.10.89.1.3 (L1) Ensure 'Disallow Digest authentication' is set to 'Enabled'. (Automated) + - id: 27346 + title: "Ensure 'Disallow Digest authentication' is set to 'Enabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) client will not use Digest authentication. The recommended state for this setting is: Enabled." + rationale: "Digest authentication is less robust than other authentication methods available in WinRM, an attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + impact: "The WinRM client will not use Digest authentication." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Client\\Disallow Digest authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.89.1.3"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["16.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client -> AllowDigest -> 0' + + # 18.10.89.2.1 (L1) Ensure 'Allow Basic authentication' is set to 'Disabled'. (Automated) + - id: 27347 + title: "Ensure 'Allow Basic authentication' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service accepts Basic authentication from a remote client. The recommended state for this setting is: Disabled." + rationale: "Basic authentication is less robust than other authentication methods available in WinRM because credentials including passwords are transmitted in plain text. An attacker who is able to capture packets on the network where WinRM is running may be able to determine the credentials used for accessing remote hosts via WinRM." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow Basic authentication Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.89.2.1"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["16.5"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowBasic -> 0' + + # 18.10.89.2.2 (L2) Ensure 'Allow remote server management through WinRM' is set to 'Disabled'. (Automated) + - id: 27348 + title: "Ensure 'Allow remote server management through WinRM' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service automatically listens on the network for requests on the HTTP transport over the default HTTP port. The recommended state for this setting is: Disabled." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Management (WinRM) service on trusted networks and when feasible employ additional controls such as IPsec." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow remote server management through WinRM Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Allow automatic configuration of listeners, but it was renamed starting with the Windows 8.0 & Server 2012 (non-R2) Administrative Templates." + compliance: + - cis: ["18.10.89.2.2"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowAutoConfig -> 0' + + # 18.10.89.2.3 (L1) Ensure 'Allow unencrypted traffic' is set to 'Disabled'. (Automated) + - id: 27349 + title: "Ensure 'Allow unencrypted traffic' is set to 'Disabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service sends and receives unencrypted messages over the network. The recommended state for this setting is: Disabled." + rationale: "Encrypting WinRM network traffic reduces the risk of an attacker viewing or modifying WinRM messages as they transit the network." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Allow unencrypted traffic Note: This Group Policy path is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.89.2.3"] + - cis_csc_v8: ["3.10"] + - cis_csc_v7: ["14.4"] + - cmmc_v2.0: ["AC.L2-3.1.13", "AC.L2-3.1.17", "IA.L2-3.5.10", "SC.L2-3.13.11", "SC.L2-3.13.15", "SC.L2-3.13.8"] + - hipaa: ["164.312(a)(2)(iv)", "164.312(e)(1)", "164.312(e)(2)(i)", "164.312(e)(2)(ii)"] + - iso_27001-2013: ["A.10.1.1", "A.13.1.1"] + - nist_sp_800-53: ["AC-17(2)", "SC-8", "SC-8(1)"] + - pci_dss_v3.2.1: ["2.1.1", "4.1", "4.1.1", "8.2.1"] + - pci_dss_v4.0: ["2.2.7", "4.1.1", "4.2.1", "4.2.1.2", "4.2.2", "8.3.2"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> AllowUnencryptedTraffic -> 0' + + # 18.10.89.2.4 (L1) Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'. (Automated) + - id: 27350 + title: "Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'." + description: "This policy setting allows you to manage whether the Windows Remote Management (WinRM) service will allow RunAs credentials to be stored for any plug-ins. The recommended state for this setting is: Enabled. Note: If you enable and then disable this policy setting, any values that were previously configured for RunAsPassword will need to be reset." + rationale: "Although the ability to store RunAs credentials is a convenient feature it increases the risk of account compromise slightly. For example, if you forget to lock your desktop before leaving it unattended for a few minutes another person could access not only the desktop of your computer but also any hosts you manage via WinRM with cached RunAs credentials." + impact: "The WinRM service will not allow the RunAsUser or RunAsPassword configuration values to be set for any plug-ins. If a plug-in has already set the RunAsUser and RunAsPassword configuration values, the RunAsPassword configuration value will be erased from the credential store on the computer. If this setting is later Disabled again, any values that were previously configured for RunAsPassword will need to be reset." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Management (WinRM)\\WinRM Service\\Disallow WinRM from storing RunAs credentials Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsRemoteManagement.admx/adml that is included with the Microsoft Windows 8.0 & Server 2012 (non-R2) Administrative Templates (or newer)." + compliance: + - cis: ["18.10.89.2.4"] + - cis_csc_v7: ["14.3"] + - iso_27001-2013: ["A.13.1.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service -> DisableRunAs -> 1' + + # 18.10.90.1 (L2) Ensure 'Allow Remote Shell Access' is set to 'Disabled'. (Automated) + - id: 27351 + title: "Ensure 'Allow Remote Shell Access' is set to 'Disabled'." + description: "This policy setting allows you to manage configuration of remote access to all supported shells to execute scripts and commands. The recommended state for this setting is: Disabled. Note: The GPME help text for this setting is incorrectly worded, implying that configuring it to Enabled will reject new Remote Shell connections, and setting it to Disabled will allow Remote Shell connections. The opposite is true (and is consistent with the title of the setting). This is a wording mistake by Microsoft in the Administrative Template." + rationale: "Any feature is a potential avenue of attack, those that enable inbound network connections are particularly risky. Only enable the use of the Windows Remote Shell on trusted networks and when feasible employ additional controls such as IPsec." + impact: "New Remote Shell connections are not allowed and are rejected by the server. Note: On Server 2012 (non-R2) and newer, due to design changes in the OS after Server 2008 R2, configuring this setting as prescribed will prevent the ability to add or remove Roles and Features (even locally) via the GUI. We therefore recommend that the necessary Roles and Features be installed prior to configuring this setting on a Level 2 server. Alternatively, Roles and Features can still be added or removed using the PowerShell commands Add-WindowsFeature or Remove-WindowsFeature in the Server Manager module, even with this setting configured." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Remote Shell\\Allow Remote Shell Access Note: This Group Policy path is provided by the Group Policy template WindowsRemoteShell.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.90.1"] + - cis_csc_v8: ["4.8"] + - cis_csc_v7: ["9.2"] + - cmmc_v2.0: ["CM.L2-3.4.7", "CM.L2-3.4.8", "SC.L2-3.13.6"] + - iso_27001-2013: ["A.13.1.3"] + - pci_dss_v3.2.1: ["1.1.6", "1.2.1", "2.2.2", "2.2.5"] + - pci_dss_v4.0: ["1.2.5", "2.2.4", "6.4.1"] + - soc_2: ["CC6.3", "CC6.6"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service\WinRS -> AllowRemoteShellAccess -> 0' + + # 18.10.92.2.1 (L1) Ensure 'Prevent users from modifying settings' is set to 'Enabled'. (Automated) + - id: 27352 + title: "Ensure 'Prevent users from modifying settings' is set to 'Enabled'." + description: "This policy setting prevent users from making changes to the Exploit protection settings area in the Windows Security settings. The recommended state for this setting is: Enabled." + rationale: "Only authorized IT staff should be able to make changes to the exploit protection settings in order to ensure the organizations specific configuration is not modified." + impact: "Local users cannot make changes in the Exploit protection settings area." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Security\\App and browser protection\\Prevent users from modifying settings Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsDefenderSecurityCenter.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.92.2.1"] + - cis_csc_v8: ["10.5"] + - cis_csc_v7: ["8.3"] + - nist_sp_800-53: ["SI-16"] + - pci_dss_v3.2.1: ["1.4"] + - soc_2: ["CC6.8"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection -> DisallowExploitProtectionOverride' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection -> DisallowExploitProtectionOverride -> 1' + + # 18.10.93.1.1 (L1) Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'. (Automated) + - id: 27353 + title: "Ensure 'No auto-restart with logged on users for scheduled automatic updates installations' is set to 'Disabled'." + description: "This policy setting specifies that Automatic Updates will wait for computers to be restarted by the users who are logged on to them to complete a scheduled installation. The recommended state for this setting is: Disabled. Note: This setting applies only when you configure Automatic Updates to perform scheduled update installations. If you configure the Configure Automatic Updates setting to Disabled, this setting has no effect." + rationale: "Some security updates require that the computer be restarted to complete an installation. If the computer cannot restart automatically, then the most recent update will not completely install and no new updates will download to the computer until it is restarted. Without the auto-restart functionality, users who are not security-conscious may choose to indefinitely delay the restart, therefore keeping the computer in a less secure state." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Legacy Policies\\No auto-restart with logged on users for scheduled automatic updates installations Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates. Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named No auto-restart for scheduled Automatic Updates installations, but it was renamed starting with the Windows 7 & Server 2008 R2 Administrative Templates." + compliance: + - cis: ["18.10.93.1.1"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoRebootWithLoggedOnUsers -> 0' + + # 18.10.93.2.1 (L1) Ensure 'Configure Automatic Updates' is set to 'Enabled'. (Automated) + - id: 27354 + title: "Ensure 'Configure Automatic Updates' is set to 'Enabled'." + description: 'This policy setting specifies whether computers in your environment will receive security updates from Windows Update or WSUS. If you configure this policy setting to Enabled, the operating system will recognize when a network connection is available and then use the network connection to search Windows Update or your designated intranet site for updates that apply to them. After you configure this policy setting to Enabled, select one of the following three options in the Configure Automatic Updates Properties dialog box to specify how the service will work: - 2 - Notify for download and auto install (Notify before downloading any updates) - 3 - Auto download and notify for install (Download the updates automatically and notify when they are ready to be installed.) (Default setting) - 4 - Auto download and schedule the install (Automatically download updates and install them on the schedule specified below.)) - 5 - Allow local admin to choose setting (Leave decision on above choices up to the local Administrators (Not Recommended)) The recommended state for this setting is: Enabled. Note: The sub-setting "Configure automatic updating:" has 4 possible values - all of them are valid depending on specific organizational needs, however if feasible we suggest using a value of 4 - Auto download and schedule the install. This suggestion is not a scored requirement. Note #2: Organizations that utilize a third-party solution for patching may choose to exempt themselves from this recommendation, and instead configure it to Disabled so that the native Windows Update mechanism does not interfere with the third-party patching process.' + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + impact: "Critical operating system updates and service packs will be installed as necessary." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage end user experience\\Configure Automatic Updates Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.93.2.1"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> NoAutoUpdate -> 0' + + # 18.10.93.2.2 (L1) Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'. (Automated) + - id: 27355 + title: "Ensure 'Configure Automatic Updates: Scheduled install day' is set to '0 - Every day'." + description: "This policy setting specifies when computers in your environment will receive security updates from Windows Update or WSUS. The recommended state for this setting is: 0 - Every day. Note: This setting is only applicable if 4 - Auto download and schedule the install is selected in recommendation 'Configure Automatic Updates'. It will have no impact if any other option is selected." + rationale: "Although each version of Windows is thoroughly tested before release, it is possible that problems will be discovered after the products are shipped. The Configure Automatic Updates setting can help you ensure that the computers in your environment will always have the most recent critical operating system updates and service packs installed." + impact: "If 4 - Auto download and schedule the install is selected in recommendation 'Configure Automatic Updates', critical operating system updates and service packs will automatically download every day (at 3:00 A.M., by default)." + remediation: "To establish the recommended configuration via GP, set the following UI path to 0 - Every day: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage end user experience\\Configure Automatic Updates: Scheduled install day Note: This Group Policy path is provided by the Group Policy template WindowsUpdate.admx/adml that is included with all versions of the Microsoft Windows Administrative Templates." + compliance: + - cis: ["18.10.93.2.2"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -> ScheduledInstallDay -> 0' + + # 18.10.93.4.1 (L1) Ensure 'Manage preview builds' is set to 'Disabled'. (Automated) + - id: 27356 + title: "Ensure 'Manage preview builds' is set to 'Disabled'." + description: "This policy setting manage which updates that are receive prior to the update being released. Dev Channel: Ideal for highly technical users. Insiders in the Dev Channel will receive builds from our active development branch that is earliest in a development cycle. These builds are not matched to a specific Windows 10 release. Beta Channel: Ideal for feature explorers who want to see upcoming Windows 10 features. Your feedback will be especially important here as it will help our engineers ensure key issues are fixed before a major release. Release Preview Channel (default): Insiders in the Release Preview Channel will have access to the upcoming release of Windows 10 prior to it being released to the world. These builds are supported by Microsoft. The Release Preview Channel is where we recommend companies preview and validate upcoming Windows 10 releases before broad deployment within their organization. The recommended state for this setting is: Disabled. Note: Preview Build enrollment requires a telemetry level setting of 2 or higher and your domain registered on insider.windows.com. For additional information on Preview Builds, see: https://aka.ms/wipforbiz." + rationale: "It can be risky for experimental features to be allowed in an enterprise managed environment because this can introduce bugs and security holes into systems, making it easier for an attacker to gain access. It is generally preferred to only use production-ready builds." + impact: "Preview builds are prevented from installing on the device." + remediation: "To establish the recommended configuration via GP, set the following UI path to Disabled: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage updates offered from Windows Update\\Manage preview builds Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1709 Administrative Templates (or newer)." + references: + - "https://docs.microsoft.com/en-us/windows-insider/business/manage-builds" + compliance: + - cis: ["18.10.93.4.1"] + - cis_csc_v8: ["2.5"] + - cis_csc_v7: ["2.6"] + - cmmc_v2.0: ["CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "CM.L2-3.4.9"] + - iso_27001-2013: ["A.12.5.1", "A.12.6.2"] + - nist_sp_800-53: ["CM-7(5)"] + - pci_dss_v4.0: ["1.2.5", "2.2.4"] + - soc_2: ["CC6.8"] + condition: any + rules: + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' + - 'not r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuildsPolicyValue' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> ManagePreviewBuildsPolicyValue -> 1' + + # 18.10.93.4.2 (L1) Ensure 'Select when Preview Builds and Feature Updates are received' is set to 'Enabled: 180 or more days'. (Automated) + - id: 27357 + title: "Ensure 'Select when Preview Builds and Feature Updates are received' is set to 'Enabled: 180 or more days'." + description: 'This policy setting determines when Preview Build or Feature Updates are received. Defer Updates This enables devices to defer taking the next Feature Update available to your channel for up to 14 days for all the pre-release channels and up to 365 days for the Semi-Annual Channel. Or, if the device is updating from the Semi-Annual Channel, a version for the device to move to and/or stay on until the policy is updated or the device reaches end of service can be specified. Note: If you set both policies, the version specified will take precedence and the deferrals will not be in effect. Please see the Windows Release Information page for OS version information. Pause Updates To prevent Feature Updates from being received on their scheduled time, you can temporarily pause Feature Updates. The pause will remain in effect for 35 days from the specified start date or until the field is cleared (Quality Updates will still be offered). Note: If the "Allow Diagnostic Data" (formerly "Allow Telemetry") policy is set to 0, this policy will have no effect. Note #2: Starting with Windows 10 R1607, Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering. More information on Dual Scan is available at these links: - Demystifying "Dual Scan" - WSUS Product Team Blog - Improving Dual Scan on 1607 - WSUS Product Team Blog Note #3: Prior to Windows 10 R1703, values above 180 days are not recognized by the OS. Starting with Windows 10 R1703, the maximum number of days you can defer is 365 days.' + rationale: "In a production environment, it is preferred to only use software and features that are publicly available, after they have gone through rigorous testing in beta." + impact: "Feature Updates will be delayed until they are publicly released to general public by Microsoft." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled: 180 or more days: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage updates offered from Windows Update\\Select when Preview Builds and Feature Updates are received Note: This Group Policy path may not exist by default. It is provided by the Group Policy template WindowsUpdate.admx/adml that is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer). Note #2: In older Microsoft Windows Administrative Templates, this setting was initially named Select when Feature Updates are received, but it was renamed to Select when Preview Builds and Feature Updates are received starting with the Windows 10 Release 1709 Administrative Templates." + compliance: + - cis: ["18.10.93.4.2"] + - cis_csc_v8: ["2.5", "7.3"] + - cis_csc_v7: ["2.4"] + - cmmc_v2.0: ["CM.L2-3.4.6", "CM.L2-3.4.7", "CM.L2-3.4.8", "CM.L2-3.4.9", "SI.L1-3.14.1"] + - iso_27001-2013: ["A.8.1.1"] + - nist_sp_800-53: ["CM-7(5)", "SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - pci_dss_v4.0: ["1.2.5", "2.2.4"] + - soc_2: ["CC6.8", "CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdates' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdatesPeriodInDays' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferFeatureUpdatesPeriodInDays -> n:^(\d+) compare >= 180' + + # 18.10.93.4.3 (L1) Ensure 'Select when Quality Updates are received' is set to 'Enabled: 0 days'. (Automated) + - id: 27358 + title: "Ensure 'Select when Quality Updates are received' is set to 'Enabled: 0 days'." + description: 'This settings controls when Quality Updates are received. The recommended state for this setting is: Enabled: 0 days. Note: If the "Allow Diagnostic Data" (formerly "Allow Telemetry") policy is set to 0, this policy will have no effect. Note #2: Starting with Windows Server 2016 RTM (Release 1607), Microsoft introduced a new Windows Update (WU) client behavior called Dual Scan, with an eye to cloud-based update management. In some cases, this Dual Scan feature can interfere with Windows Updates from Windows Server Update Services (WSUS) and/or manual WU updates. If you are using WSUS in your environment, you may need to set the above setting to Not Configured or configure the setting Do not allow update deferral policies to cause scans against Windows Update (added in the Windows 10 Release 1709 Administrative Templates) in order to prevent the Dual Scan feature from interfering. More information on Dual Scan is available at these links: - Demystifying "Dual Scan" - WSUS Product Team Blog - Improving Dual Scan on 1607 - WSUS Product Team Blog.' + rationale: "Quality Updates can contain important bug fixes and/or security patches, and should be installed as soon as possible." + impact: "None - this is the default behavior." + remediation: "To establish the recommended configuration via GP, set the following UI path to Enabled:0 days: Computer Configuration\\Policies\\Administrative Templates\\Windows Components\\Windows Update\\Manage updates offered from Windows Update\\Select when Quality Updates are received Note: This Group Policy path does not exist by default. An updated Group Policy template (WindowsUpdate.admx/adml) is required - it is included with the Microsoft Windows 10 Release 1607 & Server 2016 Administrative Templates (or newer)." + compliance: + - cis: ["18.10.93.4.3"] + - cis_csc_v8: ["7.3"] + - cis_csc_v7: ["3.4", "3.5"] + - cmmc_v2.0: ["SI.L1-3.14.1"] + - nist_sp_800-53: ["SI-2(2)"] + - pci_dss_v3.2.1: ["6.2"] + - soc_2: ["CC7.1"] + condition: all + rules: + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdates' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdates -> 1' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdatesPeriodInDays' + - 'r:HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -> DeferQualityUpdatesPeriodInDays -> 0' + + # 19.1.3.1 (L1) Ensure 'Enable screen saver' is set to 'Enabled'. (Automated) - Not Implemented + # 19.1.3.2 (L1) Ensure 'Password protect the screen saver' is set to 'Enabled'. (Automated) - Not Implemented + # 19.1.3.3 (L1) Ensure 'Screen saver timeout' is set to 'Enabled: 900 seconds or fewer, but not 0'. (Automated) - Not Implemented + # 19.5.1.1 (L1) Ensure 'Turn off toast notifications on the lock screen' is set to 'Enabled'. (Automated) - Not Implemented + # 19.6.6.1.1 (L2) Ensure 'Turn off Help Experience Improvement Program' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.4.1 (L1) Ensure 'Do not preserve zone information in file attachments' is set to 'Disabled'. (Automated) - Not Implemented + # 19.7.4.2 (L1) Ensure 'Notify antivirus programs when opening attachments' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.7.1 (L1) Ensure 'Configure Windows spotlight on lock screen' is set to Disabled'. (Automated) - Not Implemented + # 19.7.7.2 (L1) Ensure 'Do not suggest third-party content in Windows spotlight' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.7.3 (L2) Ensure 'Do not use diagnostic data for tailored experiences' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.7.4 (L2) Ensure 'Turn off all Windows spotlight features' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.7.5 (L1) Ensure 'Turn off Spotlight collection on Desktop' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.25.1 (L1) Ensure 'Prevent users from sharing files within their profile.' is set to 'Enabled'. (Automated) - Not Implemented + # 19.7.40.1 (L1) Ensure 'Always install with elevated privileges' is set to 'Disabled'. (Automated) - Not Implemented + # 19.7.42.2.1 (L2) Ensure 'Prevent Codec Download' is set to 'Enabled'. (Automated) - Not Implemented diff --git a/etc/selinux/wazuh.te b/etc/selinux/wazuh.te index e69de29bb2..dc8e34a0a2 100644 --- a/etc/selinux/wazuh.te +++ b/etc/selinux/wazuh.te @@ -0,0 +1,50 @@ +# Copyright (C) 2015, Wazuh Inc. +# July 4, 2018. +# +# This program is free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. + +module wazuh 1.3; + +require { + type audisp_t; + type var_t; + type auditd_t; + type usr_t; + type auditd_etc_t; + class sock_file { create setattr unlink }; + class process { noatsecure siginh rlimitinh }; + class dir { remove_name add_name read write }; + class file { getattr open read }; + class capability { dac_override dac_read_search }; + class lnk_file { read }; +} + +#============= audisp_t ============== +allow audisp_t self: capability dac_override; + +allow audisp_t usr_t:dir { remove_name add_name read write }; +allow audisp_t usr_t:file getattr; + +allow audisp_t usr_t:sock_file { create setattr }; +allow audisp_t usr_t:file { open read }; + +allow audisp_t var_t:dir { remove_name add_name read write }; +allow audisp_t var_t:file getattr; + +allow audisp_t var_t:sock_file { create setattr unlink }; +allow audisp_t var_t:file { open read }; + +#============= auditd_t ============== + +allow auditd_t audisp_t:process { noatsecure siginh }; + +allow auditd_t auditd_etc_t:lnk_file { read }; +allow auditd_t self:capability { dac_override dac_read_search }; +allow auditd_t var_t:file { getattr open read }; +allow auditd_t var_t:dir { remove_name add_name read write }; +allow auditd_t var_t:sock_file { create setattr unlink }; + +allow auditd_t audisp_t:process rlimitinh; diff --git a/packages/.gitignore b/packages/.gitignore new file mode 100644 index 0000000000..be951dd1cc --- /dev/null +++ b/packages/.gitignore @@ -0,0 +1,8 @@ +*.deb +*.rpm +*.zip +*.pkg +.sha512 +.cache +output + diff --git a/packages/README.md b/packages/README.md index e69de29bb2..a0df0f555e 100644 --- a/packages/README.md +++ b/packages/README.md @@ -0,0 +1,124 @@ +## Wazuh Package Builder Script + +This script automates the process of building Wazuh packages (manager or agent) for various architectures within a Docker container. + +**Features:** + +- Supports building packages for different targets (manager/agent). +- Selectable architectures (amd64, i386, **ppc64le, arm64, armhf*). +- Optional debug builds. +- Generates checksums for built packages. +- Builds legacy packages for CentOS 5 (RPM only). +- Uses local source code or downloads from GitHub. +- Builds future test packages (x.30.0). + +***Note:** Support for *ppc64le, arm64, and armhf* architectures **is not** currently **available** in the **workflow**. + +**Requirements:** + +- Docker installed and running. + +**Usage:** +``` +wazuh# cd packages +./generate_package.sh [OPTIONS] +``` + +**Options:** +| Option | Description | Default | +|------------|----------------------------------------------------------|-----------------------| +| -b, --branch | Git branch to use (optional) | master | +| -t, --target | Target package to build (required): manager or agent | - | +| -a, --architecture | Target architecture (optional): amd64, i386, etc. | - | +| -j, --jobs | Number of parallel jobs (optional) | 2 | +| -r, --revision | Package revision (optional) | 0 | +| -s, --store | Destination path for the package (optional) | (output folder created) | +| -p, --path | Installation path for the package (optional) | /var/ossec | +| -d, --debug | Build binaries with debug symbols (optional) | no | +| -c, --checksum | Generate checksum on the same directory (optional) | no | +| -l, --legacy | Build package for CentOS 5 (RPM only) (optional) | no | +| --dont-build-docker | Use a locally built Docker image (optional) | no | +| --tag | Tag to use with the Docker image (optional) | - | +| *--sources | Path containing local Wazuh source code (optional) | script path | +| **--is_stage | Use release name in package (optional) | no | +| --src | Generate the source package (optional) | no | +| --system | Package format to build (optional): rpm, deb (default)| deb | +| -h, --help | Show this help message | - | + +***Note1:** If we don't use this flag, will the script use the current directory where *generate_package.sh* is located. + +****Note 2:** If the package is not a release package, a short hash commit based on the git command `git rev-parse --short HEAD` will be appended to the end of the name. The default length of the short hash is determined by the Git command [git rev-parse --short[=length]](https://git-scm.com/docs/git-rev-parse#Documentation/git-rev-parse.txt---shortlength:~:text=interpreted%20as%20usual.-,%2D%2Dshort%5B%3Dlength%5D,-Same%20as%20%2D%2Dverify). + + +**Example Usage:** + +1. Build a manager package for amd64 architecture: +./wazuh_package_builder.sh -t manager -a amd64 -s /tmp --system rpm + +2. Build a debug agent package for i386 architecture with checksum generation: +./wazuh_package_builder.sh -t agent -a i386 -s /tmp -d -c --system rpm + +3. Build a legacy RPM package for CentOS 5 (agent): +./wazuh_package_builder.sh -t agent -l -s /tmp --system rpm + +4. Build a package using local Wazuh source code: +./wazuh_package_builder.sh -t manager -a amd64 --sources /path/to/wazuh/source --system rpm + + +**Notes:** +- For `--dont-build-docker` to work effectively, ensure a Docker image with the necessary build environment is already available. +- For RPM packages, we use the following architecture equivalences: + * amd64 -> x86_64 + * arm64 -> aarch64 + * armhf -> armv7hl + +# Workflow + +## Generate and push builder images to GH + +```bash +curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GH_WORKFLOW_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" --data-binary "@$(pwd)/wazuh-agent-test-amd64-rpm.json" "https://api.github.com/repos/wazuh/wazuh/actions/workflows/packages-upload-agent-images-amd.yml/dispatches" +``` + +Where the JSON looks like this: + +```json +# cat wazuh-agent-test-amd64-rpm.json +{ + "ref":"4.9.0", + "inputs": + { + "tag":"auto", + "architecture":"amd64", + "system":"rpm", + "revision":"test", + "is_stage":"false", + "legacy":"false" + } +} +``` + +## Generate packages + +```json +curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $GH_WORKFLOW_TOKEN" -H "X-GitHub-Api-Version: 2022-11-28" --data-binary "@$(pwd)/wazuh-agent-test-amd64-rpm.json" "https://api.github.com/repos/wazuh/wazuh/actions/workflows/packages-build-linux-agent-amd.yml/dispatches" +``` + +Where the JSON looks like this: +```json +# cat wazuh-agent-test-amd64-rpm.json +{ + "ref":"4.9.0", + "inputs": + { + "docker_image_tag":"auto", + "architecture":"amd64", + "system":"deb", + "revision":"test", + "is_stage":"false", + "legacy":"false", + "checksum":"false", + } +} +``` + diff --git a/packages/build.sh b/packages/build.sh new file mode 100755 index 0000000000..27efc6b051 --- /dev/null +++ b/packages/build.sh @@ -0,0 +1,121 @@ +#!/bin/bash + +# Wazuh package builder +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. +set -e + +build_directories() { + local build_folder=$1 + local wazuh_dir="$2" + local future="$3" + + mkdir -p "${build_folder}" + wazuh_version="$(cat wazuh*/src/VERSION| cut -d 'v' -f 2)" + + if [[ "$future" == "yes" ]]; then + wazuh_version="$(future_version "$build_folder" "$wazuh_dir" $wazuh_version)" + source_dir="${build_folder}/wazuh-${BUILD_TARGET}-${wazuh_version}" + else + package_name="wazuh-${BUILD_TARGET}-${wazuh_version}" + source_dir="${build_folder}/${package_name}" + cp -R $wazuh_dir "$source_dir" + fi + echo "$source_dir" +} + +# Function to handle future version +future_version() { + local build_folder="$1" + local wazuh_dir="$2" + local base_version="$3" + + specs_path="$(find $wazuh_dir -name SPECS|grep $SYSTEM)" + + local major=$(echo "$base_version" | cut -dv -f2 | cut -d. -f1) + local minor=$(echo "$base_version" | cut -d. -f2) + local version="${major}.30.0" + local old_name="wazuh-${BUILD_TARGET}-${base_version}" + local new_name=wazuh-${BUILD_TARGET}-${version} + + local new_wazuh_dir="${build_folder}/${new_name}" + cp -R ${wazuh_dir} "$new_wazuh_dir" + find "$new_wazuh_dir" "${specs_path}" \( -name "*VERSION*" -o -name "*changelog*" \ + -o -name "*.spec" \) -exec sed -i "s/${base_version}/${version}/g" {} \; + sed -i "s/\$(VERSION)/${major}.${minor}/g" "$new_wazuh_dir/src/Makefile" + sed -i "s/${base_version}/${version}/g" $new_wazuh_dir/src/init/wazuh-{server,client,local}.sh + echo "$version" +} + +# Function to generate checksum and move files +post_process() { + local file_path="$1" + local checksum_flag="$2" + local source_flag="$3" + + if [[ "$checksum_flag" == "yes" ]]; then + sha512sum "$file_path" > /var/local/checksum/$(basename "$file_path").sha512 + fi + + if [[ "$source_flag" == "yes" ]]; then + mv "$file_path" /var/local/wazuh + fi +} + +# Main script body + +# Script parameters +export REVISION="$1" +export JOBS="$2" +debug="$3" +checksum="$4" +future="$5" +legacy="$6" +src="$7" + +build_dir="/build_wazuh" + +source helper_function.sh + +set -x + +# Download source code if it is not shared from the local host +if [ ! -d "/wazuh-local-src" ] ; then + curl -sL https://github.com/wazuh/wazuh/tarball/${WAZUH_BRANCH} | tar zx + short_commit_hash="$(curl -s https://api.github.com/repos/wazuh/wazuh/commits/${WAZUH_BRANCH} \ + | grep '"sha"' | head -n 1| cut -d '"' -f 4 | cut -c 1-11)" +else + if [ "${legacy}" = "no" ]; then + short_commit_hash="$(cd /wazuh-local-src && git rev-parse --short HEAD)" + else + # Git package is not available in the CentOS 5 repositories. + hash_commit=$(cat /wazuh-local-src/.git/$(cat /wazuh-local-src/.git/HEAD|cut -d" " -f2)) + short_commit_hash="$(cut -c 1-11 <<< $hash_commit)" + fi +fi + +# Build directories +source_dir=$(build_directories "$build_dir/${BUILD_TARGET}" "wazuh*" $future) + +wazuh_version="$(cat $source_dir/src/VERSION| cut -d 'v' -f 2)" +# TODO: Improve how we handle package_name +# Changing the "-" to "_" between target and version breaks the convention for RPM or DEB packages. +# For now, I added extra code that fixes it. +package_name="wazuh-${BUILD_TARGET}-${wazuh_version}" +specs_path="$(find $source_dir -name SPECS|grep $SYSTEM)" + +setup_build "$source_dir" "$specs_path" "$build_dir" "$package_name" "$debug" + +set_debug $debug $sources_dir + +# Installing build dependencies +cd $sources_dir +build_deps $legacy +build_package $package_name $debug "$short_commit_hash" "$wazuh_version" + +# Post-processing +get_package_and_checksum $wazuh_version $short_commit_hash $src diff --git a/packages/debs/SPECS/wazuh_agent/debian/changelog b/packages/debs/SPECS/wazuh_agent/debian/changelog new file mode 100644 index 0000000000..a5d5509337 --- /dev/null +++ b/packages/debs/SPECS/wazuh_agent/debian/changelog @@ -0,0 +1,673 @@ +wazuh-agent (4.9.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-9-0.html + + -- Wazuh, Inc Wed, 10 Jul 2024 00:00:00 +0000 + +wazuh-agent (4.8.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-8-1.html + + -- Wazuh, Inc Wed, 26 Jun 2024 00:00:00 +0000 + +wazuh-agent (4.8.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html + + -- Wazuh, Inc Wed, 12 Jun 2024 00:00:00 +0000 + +wazuh-agent (4.7.5-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-7-5.html + + -- Wazuh, Inc Thu, 30 May 2024 00:00:00 +0000 + +wazuh-agent (4.7.4-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-7-4.html + + -- Wazuh, Inc Thu, 25 Apr 2024 00:00:00 +0000 + +wazuh-agent (4.7.3-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-7-3.html + + -- Wazuh, Inc Tue, 27 Feb 2024 00:00:00 +0000 + +wazuh-agent (4.7.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html + + -- Wazuh, Inc Tue, 09 Jan 2024 00:00:00 +0000 + +wazuh-agent (4.7.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-7-1.html + + -- Wazuh, Inc Wed, 19 Dec 2023 00:00:00 +0000 + +wazuh-agent (4.7.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-7-0.html + + -- Wazuh, Inc Tue, 27 Nov 2023 00:00:00 +0000 + +wazuh-agent (4.6.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-6-0.html + + -- Wazuh, Inc Tue, 31 Oct 2023 00:00:00 +0000 + +wazuh-agent (4.5.4-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-5-4.html + + -- Wazuh, Inc Tue, 24 Oct 2023 00:00:00 +0000 + +wazuh-agent (4.5.3-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-5-3.html + + -- Wazuh, Inc Tue, 10 Oct 2023 00:00:00 +0000 + +wazuh-agent (4.5.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-5-2.html + + -- Wazuh, Inc Thu, 31 Aug 2023 00:00:00 +0000 + +wazuh-agent (4.5.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-5-1.html + + -- Wazuh, Inc Thu, 24 Aug 2023 15:56:43 +0000 + +wazuh-agent (4.5.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-5-0.html + + -- Wazuh, Inc Thu, 10 Aug 2023 15:56:43 +0000 + +wazuh-agent (4.4.5-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-4-5.html + + -- Wazuh, Inc Mon, 10 Jul 2023 15:56:43 +0000 + +wazuh-agent (4.4.4-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-4-4.html + + -- Wazuh, Inc Tue, 13 Jun 2023 12:31:50 +0000 + +wazuh-agent (4.4.3-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-4-3.html + + -- Wazuh, Inc Thu, 25 May 2023 12:31:50 +0000 + +wazuh-agent (4.4.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-4-2.html + + -- Wazuh, Inc Mon, 08 May 2023 12:31:50 +0000 + +wazuh-agent (4.3.11-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-3-11.html + + -- Wazuh, Inc Mon, 24 Apr 2023 15:00:00 +0000 + +wazuh-agent (4.4.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-4-1.html + + -- Wazuh, Inc Mon, 17 Apr 2023 12:31:50 +0000 + +wazuh-agent (4.4.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-4-0.html + + -- Wazuh, Inc Wed, 18 Jan 2023 12:31:50 +0000 + +wazuh-agent (4.3.10-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-3-10.html + + -- Wazuh, Inc Thu, 10 Nov 2022 15:00:00 +0000 + +wazuh-agent (4.3.9-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-3-9.html + + -- Wazuh, Inc Mon, 03 Oct 2022 15:00:00 +0000 + +wazuh-agent (4.3.8-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-3-8.html + + -- Wazuh, Inc Mon, 19 Sep 2022 15:00:00 +0000 + +wazuh-agent (4.3.7-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-3-7.html + + -- Wazuh, Inc Mon, 08 Aug 2022 15:00:00 +0000 + +wazuh-agent (4.3.6-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-3-6.html + + -- Wazuh, Inc Thu, 07 Jul 2022 15:00:00 +0000 + +wazuh-agent (4.3.5-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-3-5.html + + -- Wazuh, Inc Wed, 29 Jun 2022 15:00:00 +0000 + +wazuh-agent (4.3.4-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-3-4.html + + -- Wazuh, Inc Tue, 07 Jun 2022 15:41:39 +0000 + +wazuh-agent (4.3.3-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-3-3.html + + -- Wazuh, Inc Tue, 31 May 2022 15:41:39 +0000 + +wazuh-agent (4.3.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-3-2.html + + -- Wazuh, Inc Mon, 30 May 2022 15:41:39 +0000 + +wazuh-agent (4.2.7-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-2-7.html + + -- Wazuh, Inc Sun, 29 May 2022 08:51:00 +0000 + +wazuh-agent (4.3.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-3-1.html + + -- Wazuh, Inc Wed, 18 May 2022 12:14:41 +0000 + +wazuh-agent (4.3.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-3-0.html + + -- Wazuh, Inc Thu, 05 May 2022 12:15:57 +0000 + +wazuh-agent (4.2.6-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-2-6.html + + -- Wazuh, Inc Fri, 25 Mar 2022 16:47:07 +0000 + +wazuh-agent (4.2.5-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-2-5.html + + -- Wazuh, Inc Mon, 15 Nov 2021 16:47:07 +0000 + +wazuh-agent (4.2.4-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-2-4.html + + -- Wazuh, Inc Thu, 21 Oct 2021 15:57:51 +0000 + +wazuh-agent (4.2.3-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-2-3.html + + -- Wazuh, Inc Wed, 06 Oct 2021 15:07:13 +0000 + +wazuh-agent (4.2.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-2-2.html + + -- Wazuh, Inc Tue, 28 Sep 2021 08:58:38 +0000 + +wazuh-agent (4.2.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-2-1.html + + -- Wazuh, Inc Sat, 25 Sep 2021 07:04:22 +0000 + +wazuh-agent (4.2.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-2-0.html + + -- Wazuh, Inc Mon, 26 Apr 2021 11:51:55 +0000 + +wazuh-agent (4.1.5-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-1-5.html + + -- Wazuh, Inc Thu, 22 Apr 2021 16:50:05 +0000 + +wazuh-agent (4.1.4-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-1-4.html + + -- Wazuh, Inc Mon, 29 Mar 2021 16:23:09 +0000 + +wazuh-agent (4.1.3-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-1-3.html + + -- Wazuh, Inc Sat, 20 Mar 2021 13:41:26 +0000 + +wazuh-agent (4.1.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-1-2.html + + -- Wazuh, Inc Mon, 08 Mar 2021 14:00:25 +0000 + +wazuh-agent (4.1.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-1-1.html + + -- Wazuh, Inc Fri, 05 Mar 2021 13:24:41 +0000 + +wazuh-agent (4.1.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-1-0.html + + -- Wazuh, Inc Tue, 19 Jan 2021 06:25:59 +0000 + + wazuh-agent (4.0.4-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-0-4.html + + -- Wazuh, Inc Tue, 12 Jan 2021 09:30:15 +0000 + +wazuh-agent (4.0.3-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-0-3.html + + -- Wazuh, Inc Mon, 30 Nov 2020 10:00:15 +0000 + +wazuh-agent (4.0.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-0-2.html + + -- Wazuh, Inc Mon, 23 Nov 2020 12:16:36 +0000 + +wazuh-agent (4.0.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-0-1.html + + -- Wazuh, Inc Sat, 31 Oct 2020 12:16:36 +0000 + +wazuh-agent (4.0.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-4-0-0.html + + -- Wazuh, Inc Mon, 19 Oct 2020 06:59:39 +0000 + + wazuh-manager (3.13.6-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-13-6.html + + -- Wazuh, Inc Wed, 21 Sep 2022 15:00:00 +0000 + + wazuh-manager (3.13.5-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-13-5.html + + -- Wazuh, Inc Wed, 24 Aug 2022 15:00:00 +0000 + + wazuh-manager (3.13.4-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-13-4.html + + -- Wazuh, Inc Mon, 30 May 2022 15:00:00 +0000 + +wazuh-agent (3.13.3-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-13-3.html + + -- Wazuh, Inc Sat, 24 Apr 2021 07:01:55 +0000 + +wazuh-agent (3.13.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-13-2.html + + -- Wazuh, Inc Fri, 21 Aug 2020 10:05:02 +0000 + +wazuh-agent (3.13.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-13-1.html + + -- Wazuh, Inc Tue, 14 Jul 2020 10:05:02 +0000 + +wazuh-agent (3.13.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-13-0.html + + -- Wazuh, Inc Mon, 29 Jun 2020 10:05:02 +0000 + +wazuh-agent (3.12.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-12-2.html + + -- Wazuh, Inc Thu, 9 Apr 2020 08:47:14 +0000 + +wazuh-agent (3.12.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-12-1.html + + -- Wazuh, Inc Wed, 8 Apr 2020 16:12:28 +0000 + +wazuh-agent (3.12.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-12-0.html + + -- Wazuh, Inc Wed, 25 Mar 2020 10:20:48 +0000 + +wazuh-agent (3.11.4-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-11-4.html + + -- Wazuh, Inc Thu, 24 Feb 2020 10:01:00 +0000 + +wazuh-agent (3.11.3-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-11-3.html + + -- Wazuh, Inc Wed, 22 Jan 2020 10:01:00 +0000 + +wazuh-agent (3.11.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-11-2.html + + -- Wazuh, Inc Tue, 7 Jan 2020 10:01:00 +0000 + +wazuh-agent (3.11.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-11-1.html + + -- Wazuh, Inc Thu, 26 Dec 2019 13:33:00 +0000 + +wazuh-agent (3.11.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-11-0.html + + -- Wazuh, Inc Mon, 7 Oct 2019 13:33:00 +0000 + +wazuh-agent (3.10.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-10-2.html + + -- Wazuh, Inc Mon, 23 Sep 2019 10:19:00 +0000 + +wazuh-agent (3.10.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-10-1.html + + -- Wazuh, Inc Thu, 19 Sep 2019 13:33:00 +0000 + +wazuh-agent (3.10.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-10-0.html + + -- Wazuh, Inc Mon, 26 Aug 2019 13:33:00 +0000 + +wazuh-agent (3.9.5-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-9-5.html + + -- Wazuh, Inc Thu, 8 Aug 2019 16:31:00 +0000 + +wazuh-agent (3.9.4-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-9-4.html + + -- Wazuh, Inc Tue, 12 Jul 2019 16:31:00 +0000 + +wazuh-agent (3.9.3-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-9-3.html + + -- Wazuh, Inc Tue, 11 Jun 2019 16:31:00 +0000 + +wazuh-agent (3.9.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-9-2.html + + -- Wazuh, Inc Mon, 6 Jun 2019 13:33:00 +0000 + +wazuh-agent (3.9.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-9-1.html + + -- Wazuh, Inc Mon, 6 May 2019 13:33:00 +0000 + +wazuh-agent (3.9.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-9-0.html + + -- Wazuh, Inc Mon, 25 Feb 2019 11:00:00 +0000 + +wazuh-agent (3.8.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-8-2.html + + -- Wazuh, Inc Wed, 30 Jan 2019 11:00:00 +0000 + +wazuh-agent (3.8.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-8-1.html + + -- Wazuh, Inc Thu, 24 Jan 2019 09:28:34 +0000 + +wazuh-agent (3.8.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-8-0.html + + -- Wazuh, Inc Mon, 16 Jan 2019 11:00:00 +0000 + +wazuh-agent (3.7.2-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-7-2.html + + -- Wazuh, Inc Mon, 10 Dec 2018 11:00:00 +0000 + +wazuh-agent (3.7.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-7-1.html + + -- Wazuh, Inc Mon, 12 Nov 2018 11:00:00 +0000 + +wazuh-agent (3.7.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-7-0.html + + -- Wazuh, Inc Sat, 10 Nov 2018 11:00:00 +0000 + +wazuh-agent (3.6.1-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-6-1.html + + -- Wazuh, Inc Mon, 3 Sep 2018 11:00:00 +0000 + +wazuh-agent (3.6.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-6-0.html + + -- Wazuh, Inc Fri, 24 Aug 2018 11:00:00 +0000 + +wazuh-agent (3.5.0-RELEASE) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-5-0.html + + -- Wazuh, Inc Wed, 25 Jul 2018 20:12:41 +0000 + +wazuh-agent (3.4.0-1) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-4-0.html + + -- Wazuh, Inc Thu, 28 Jun 2018 20:12:41 +0000 + +wazuh-agent (3.3.1-1) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-3-1.html + + -- Wazuh, Inc Thu, 14 Jun 2018 9:29:41 +0000 + +wazuh-agent (3.3.0-1) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-3-0.html + + -- Wazuh, Inc Thu, 07 Jun 2018 10:00:31 +0000 + +wazuh-agent (3.2.4-1) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-2-4.html + + -- Wazuh, Inc Wed, 30 May 2018 12:44:31 +0000 + +wazuh-agent (3.2.3-1) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-2-3.html + + -- Wazuh, Inc Tue, 15 May 2018 12:35:30 +0000 + +wazuh-agent (3.2.2-1) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-2-2.html + + -- Wazuh, Inc Tue, 13 Mar 2018 12:35:30 +0000 + +wazuh-agent (3.2.1-1) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-2-1.html + + -- Wazuh, Inc Wed, 21 Feb 2018 15:26:30 +0000 + +wazuh-agent (3.2.0-1) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-2-0.html + + -- Wazuh, Inc Thu, 11 Dec 2017 15:19:24 +0000 + + +wazuh-agent (3.1.0-1) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-1-0.html + + -- Wazuh, Inc Mon, 19 Dec 2017 08:00:10 +0000 + + +wazuh-agent (3.0.0-2) stable; urgency=low + + * More info: https://documentation.wazuh.com/current/release-notes/release-3-0-0.html + + -- Wazuh, Inc Mon, 01 Nov 2017 08:00:10 +0000 + +wazuh-agent (2.1.1-1) stable; urgency=low + + * Labels configuration for agents to show data on alerts. + * Added group property for agents to customize shared files set. + * Send shared files to multiple agents in parallel. + * New decoder plugin for logs in JSON format with dynamic fields definition. + * Brought framework from API to Wazuh project. + * Show merged files MD5 checksum by agent_control and framework. + * New reliable request protocol for manager-agent communication. + * Remote agent upgrades with signed WPK packages. + * Added option for Remoted to prevent it from writing shared merged file. + * Added state for Agentd and Windows agent to notify connection state and metrics. + * Added new json log format for local file monitoring. + * Added OpenSCAP SSG datastream content for Ubuntu Trusty Tahr. + * Increased shared file delivery speed when using TCP. + * Increased TCP listening socket backlog. + * Changed Windows agent UI panel to show revision number instead of installation date. + * Group every decoded field (static and dynamic fields-1) into a data object for JSON alerts. + * Reload shared files by Remoted every 10 minutes. + * Increased string size limit for XML reader to 4096 bytes. + * Updated Logstash configuration and Elasticsearch mappings. + * Changed template fields structure for Kibana dashboards. + * Increased dynamic field limit to 1024, and default to 256. + * Changed agent buffer 'length' parameter to 'queue_size'. + * Changed some Rootcheck error messages to verbose logs. + * Removed unnecessary message by manage_agents advising to restart Wazuh manager. + * Fixed wrong queries to get last Syscheck and Rootcheck date. + * Prevent Logcollector keep-alives from being stored on archives.json. + * Fixed length of random message within keep-alives. + * Fixed Windows version detection for Windows 8 and newer. + * Fixed incorrect CIDR writing on client.keys by Authd. + * Fixed missing buffer flush by Analysisd when updating Rootcheck database. + * Stop Wazuh service before removing folder to reinstall. + + -- Wazuh, Inc Mon, 01 Aug 2016 08:00:10 +0000 + +wazuh-agent (2.1.0-1) stable; urgency=low + + * Rotate and compress log feature. + * Labeling data for agents to be shown in alerts. + * New 'auth' configuration template. + * Make manage_agents capable of add and remove agents via Authd. + * Implemented XML configuration for Authd. + * Option -F for Authd to force insertion if it finds duplicated name. + * Local auth client to manage agent keys. + * Added OS name and version into global.db. + * Option for logging in JSON format. + * Allow maild to send through a sendmail-like executable (by James Le Cuirot). + * Leaky bucket-like buffer for agents to prevent network flooding. + * Allow Syslog client to read JSON alerts. + * Allow Mail reporter to read JSON alerts. + * Added internal option to tune Rootcheck sleep time. + * Added route-null Active Response script for Windows 2012 (by @CrazyLlama). + * Updated SQLite library to 3.19.2. + * Updated zlib to 1.2.11. + * Updated cJSON library to 1.4.7. + * Change some manage_agents option parameters. + * Run Auth in background by default. + * Log classification as debug, info, warning, error and critical. + * Limit number of reads per cycle by Logcollector to prevent log starvation. + * Limit OpenSCAP module's event forwarding speed. + * Increased debug level of repeated Rootcheck messages. + * Send events when OpenSCAP starts and finishes scans. + * Delete PID files when a process exits not due to a signal. + * Change error messages due to SSL handshake failure to debug messages. + * Force group addition on installation for compatibility with LDAP (thanks to Gary Feltham). + * Fixed compiling error on systems with no OpenSSL. + * Fixed compiling warning at manage_agents. + * Fixed ossec-control enable/disable help message. + * Fixed unique aperture of random device on Unix. + * Fixed file sum comparison bug at Syscheck realtime engine. (Thanks to Arshad Khan) + * Close analysisd if alert outputs are disabled for all formats. + * Read Windows version name for versions newer than Windows 8 / Windows Server 2012. + * Fixed error in Analysisd that wrote Syscheck and Rootcheck databases of re-added agents on deleted files. + * Fixed internal option to configure the maximum labels' cache time. + * Fixed Auth password parsing on client side. + * Fix bad agent ID assignation in Authd on i686 architecture. + * Fixed Logcollector misconfiguration in Windows agents. + + -- Wazuh, Inc Mon, 01 Jul 2016 08:43:10 +0000 + +wazuh-agent (2.0.1-1) stable; urgency=low + + * Changed random data generator for a secure OS-provided generator. + * Changed Windows installer file name (depending on version). + * Linux distro detection using standard os-release file. + * Changed some URLs to documentation. + * Disable synchronization with SQLite databases for Syscheck by default. + * Minor changes at Rootcheck formatter for JSON alerts. + * Added debugging messages to Integrator logs. + * Show agent ID when possible on logs about incorrectly formatted messages. + * Use default maximum inotify event queue size. + * Show remote IP on encoding format errors when unencrypting messages. + + -- Wazuh, Inc Thu, 06 Jun 2017 08:43:10 +0000 + +wazuh-agent (2.0-1) stable; urgency=low + + * Wazuh-agent - base 2.0 + + -- Wazuh, Inc Mon, 30 Sep 2016 08:43:10 +0000 diff --git a/packages/debs/SPECS/wazuh_agent/debian/compat b/packages/debs/SPECS/wazuh_agent/debian/compat new file mode 100644 index 0000000000..7f8f011eb7 --- /dev/null +++ b/packages/debs/SPECS/wazuh_agent/debian/compat @@ -0,0 +1 @@ +7 diff --git a/.github/workflows/.python-version b/packages/debs/SPECS/wazuh_agent/debian/conffiles similarity index 100% rename from .github/workflows/.python-version rename to packages/debs/SPECS/wazuh_agent/debian/conffiles diff --git a/packages/debs/SPECS/wazuh_agent/debian/control b/packages/debs/SPECS/wazuh_agent/debian/control new file mode 100644 index 0000000000..c6c6cb0b1d --- /dev/null +++ b/packages/debs/SPECS/wazuh_agent/debian/control @@ -0,0 +1,14 @@ +Source: wazuh-agent +Section: admin +Priority: extra +Maintainer: Wazuh, Inc +Build-Depends: debhelper (>= 7.0.50~), make, gcc, linux-libc-dev, gawk, libaudit-dev, selinux-basics +Standards-Version: 3.8.4 +Homepage: https://www.wazuh.com + +Package: wazuh-agent +Architecture: any +Depends: ${shlibs:Depends}, libc6 (>= 2.7), lsb-release, debconf, adduser +Conflicts: ossec-hids-agent, wazuh-manager, ossec-hids, wazuh-api +Breaks: ossec-hids-agent, wazuh-manager, ossec-hids +Description: Wazuh helps you to gain security visibility into your infrastructure by monitoring hosts at an operating system and application level. It provides the following capabilities: log analysis, file integrity monitoring, intrusions detection and policy and compliance monitoring diff --git a/packages/debs/SPECS/wazuh_agent/debian/copyright b/packages/debs/SPECS/wazuh_agent/debian/copyright new file mode 100644 index 0000000000..1389198770 --- /dev/null +++ b/packages/debs/SPECS/wazuh_agent/debian/copyright @@ -0,0 +1,38 @@ +This work was packaged for Debian by: + + Wazuh, Inc on Wed, 10 Jul 2024 00:00:00 +0000 + +It was downloaded from: + + https://www.wazuh.com + +Upstream Authors: + + dcid@dcid.me + Jia-BingJB_Cheng@trendmicro.com + vichargrave@gmail.com + ossec@michaelstarks.com + ddpbsd@gmail.com + scott@atomicorp.com + brad.lhotsky@gmail.com + jeremy@jeremyrossy.com + santiago.bassett@gmail.com + pedro@wazuh.com + alberto.rodriguez@wazuh.com + braulio@wazuh.com + jose.fernandez@wazuh.com + +Copyright: + + GNU General Public License version 2. + +License: + + GNU General Public License version 2. + +The Debian packaging is: + + Copyright (C) 2015 Wazuh, Inc + +and is licensed under the GPL version 2, +see "/usr/share/common-licenses/GPL-2". diff --git a/packages/debs/SPECS/wazuh_agent/debian/postinst b/packages/debs/SPECS/wazuh_agent/debian/postinst new file mode 100644 index 0000000000..d114d2efe6 --- /dev/null +++ b/packages/debs/SPECS/wazuh_agent/debian/postinst @@ -0,0 +1,214 @@ +#!/bin/sh +# postinst script for wazuh-agent +# Wazuh, Inc 2015 + +set -e + +case "$1" in + configure) + + OS=$(lsb_release -si) + VER=$(lsb_release -sr) + DIR="/var/ossec" + USER="wazuh" + GROUP="wazuh" + WAZUH_GLOBAL_TMP_DIR="${DIR}/packages_files" + WAZUH_TMP_DIR="${WAZUH_GLOBAL_TMP_DIR}/agent_config_files" + SCRIPTS_DIR="${WAZUH_GLOBAL_TMP_DIR}/agent_installation_scripts" + SCA_BASE_DIR="${SCRIPTS_DIR}/sca" + + OSMYSHELL="/sbin/nologin" + + if [ -d /run/systemd/system ]; then + rm -f /etc/init.d/wazuh-agent + fi + + if [ ! -f ${OSMYSHELL} ]; then + if [ -f "/bin/false" ]; then + OSMYSHELL="/bin/false" + fi + fi + + if ! getent group ${GROUP} > /dev/null 2>&1; then + addgroup --system ${GROUP} > /dev/null 2>&1 + fi + if ! getent passwd ${USER} > /dev/null 2>&1; then + adduser --system --home ${DIR} --shell ${OSMYSHELL} --ingroup ${GROUP} ${USER} > /dev/null 2>&1 + fi + + if [ -z "$2" ] || [ -f ${WAZUH_TMP_DIR}/create_conf ] ; then + + ${SCRIPTS_DIR}/gen_ossec.sh conf agent ${OS} ${VER} ${DIR} > ${DIR}/etc/ossec.conf + ${SCRIPTS_DIR}/add_localfiles.sh ${DIR} >> ${DIR}/etc/ossec.conf + else + ${SCRIPTS_DIR}/gen_ossec.sh conf agent ${OS} ${VER} ${DIR} > ${DIR}/etc/ossec.conf.new + chmod 660 ${DIR}/etc/ossec.conf.new + fi + + # For the etc dir + if [ -f /etc/localtime ]; then + cp -pL /etc/localtime ${DIR}/etc/; + chmod 640 ${DIR}/etc/localtime + chown root:${GROUP} ${DIR}/etc/localtime + fi + + # Restore the local rules, client.keys and local_decoder + if [ -f ${WAZUH_TMP_DIR}/client.keys ]; then + cp ${WAZUH_TMP_DIR}/client.keys ${DIR}/etc/client.keys + fi + # Restore ossec.conf configuration + if [ -f ${WAZUH_TMP_DIR}/ossec.conf ]; then + mv ${WAZUH_TMP_DIR}/ossec.conf ${DIR}/etc/ossec.conf + fi + # Restore internal options configuration + if [ -f ${WAZUH_TMP_DIR}/local_internal_options.conf ]; then + mv ${WAZUH_TMP_DIR}/local_internal_options.conf ${DIR}/etc/local_internal_options.conf + fi + + # Install the SCA files + if [ -d "${SCA_BASE_DIR}" ]; then + . ${SCRIPTS_DIR}/src/init/dist-detect.sh + + SCA_DIR="${DIST_NAME}/${DIST_VER}" + + SCA_TMP_DIR="${SCA_BASE_DIR}/${DIST_NAME}/${DIST_VER}" + mkdir -p ${DIR}/ruleset/sca + + # Install the configuration files needed for this hosts + if [ -r "${SCA_BASE_DIR}/${DIST_NAME}/${DIST_VER}/${DIST_SUBVER}/sca.files" ]; then + SCA_TMP_DIR="${SCA_BASE_DIR}/${DIST_NAME}/${DIST_VER}/${DIST_SUBVER}" + elif [ -r "${SCA_BASE_DIR}/${DIST_NAME}/${DIST_VER}/sca.files" ]; then + SCA_TMP_DIR="${SCA_BASE_DIR}/${DIST_NAME}/${DIST_VER}" + elif [ -r "${SCA_BASE_DIR}/${DIST_NAME}/sca.files" ]; then + SCA_TMP_DIR="${SCA_BASE_DIR}/${DIST_NAME}" + else + SCA_TMP_DIR="${SCA_BASE_DIR}/generic" + fi + + SCA_TMP_FILE="${SCA_TMP_DIR}/sca.files" + + if [ -r ${SCA_TMP_FILE} ]; then + rm -f ${DIR}/ruleset/sca/* || true + + for sca_file in $(cat ${SCA_TMP_FILE}); do + mv ${SCA_BASE_DIR}/${sca_file} ${DIR}/ruleset/sca + done + fi + + # Set correct permissions, owner and group. ruleset directory may be empty. + if [ -n "$(ls -A ${DIR}/ruleset/sca/)" ]; then + chmod --recursive u=rwX,g=rX,o= ${DIR}/ruleset/sca/ + chown --recursive root:${GROUP} ${DIR}/ruleset/sca/ + fi + # Delete the temporary directory + rm -rf ${SCA_BASE_DIR} + + fi + + # Restore group files + if [ -d ${WAZUH_TMP_DIR}/group ]; then + for file in ${WAZUH_TMP_DIR}/group/* ; do + mv ${file} ${DIR}/etc/shared/ + done + rm -rf ${WAZUH_TMP_DIR}/group + fi + + touch ${DIR}/logs/active-responses.log + chown wazuh:wazuh ${DIR}/logs/active-responses.log + chmod 0660 ${DIR}/logs/active-responses.log + + # Check if SELinux is installed and enabled + if command -v getenforce > /dev/null 2>&1 && command -v semodule > /dev/null 2>&1; then + if [ $(getenforce) != "Disabled" ]; then + semodule -i ${DIR}/var/selinux/wazuh.pp + semodule -e wazuh + fi + fi + + # Register and configure agent if Wazuh environment variables are defined + if [ -z "$2" ] ; then + ${SCRIPTS_DIR}/src/init/register_configure_agent.sh ${DIR} > /dev/null || : + fi + + # Restoring file permissions + ${SCRIPTS_DIR}/restore-permissions.sh > /dev/null 2>&1 || : + + if [ -f /etc/systemd/system/wazuh-agent.service ]; then + rm -f /etc/systemd/system/wazuh-agent.service + if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1; then + systemctl daemon-reload > /dev/null 2>&1 + fi + fi + + # Remove old ossec user and group if exists and change ownwership of files + if getent group ossec > /dev/null 2>&1; then + find ${DIR}/ -group ossec -user root -exec chown root:wazuh {} \; > /dev/null 2>&1 || true + if getent passwd ossec > /dev/null 2>&1; then + find ${DIR}/ -group ossec -user ossec -exec chown wazuh:wazuh {} \; > /dev/null 2>&1 || true + deluser ossec > /dev/null 2>&1 + fi + if getent passwd ossecm > /dev/null 2>&1; then + find ${DIR}/ -group ossec -user ossecm -exec chown wazuh:wazuh {} \; > /dev/null 2>&1 || true + deluser ossecm > /dev/null 2>&1 + fi + if getent passwd ossecr > /dev/null 2>&1; then + find ${DIR}/ -group ossec -user ossecr -exec chown wazuh:wazuh {} \; > /dev/null 2>&1 || true + deluser ossecr > /dev/null 2>&1 + fi + if getent group ossec > /dev/null 2>&1; then + delgroup ossec > /dev/null 2>&1 + fi + fi + + find ${DIR} -nogroup -exec chgrp ${GROUP} {} \; > /dev/null 2>&1 + find ${DIR} -nouser -exec chown ${USER} {} \; > /dev/null 2>&1 + + if [ ! -z "$2" ]; then + if [ -f ${WAZUH_TMP_DIR}/wazuh.restart ] ; then + if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1; then + systemctl daemon-reload > /dev/null 2>&1 + systemctl restart wazuh-agent.service > /dev/null 2>&1 + elif command -v service > /dev/null 2>&1 ; then + service wazuh-agent restart > /dev/null 2>&1 + else + ${DIR}/bin/wazuh-control restart > /dev/null 2>&1 + fi + fi + fi + + #Delete obsolete files + if [ -f /etc/ossec-init.conf ]; then + rm -f /etc/ossec-init.conf + fi + + # Delete installation scripts + if [ -d ${SCRIPTS_DIR} ]; then + rm -rf ${SCRIPTS_DIR} + fi + + # Delete tmp directory + if [ -d ${WAZUH_TMP_DIR} ]; then + rm -rf ${WAZUH_TMP_DIR} + fi + + # If the parent directory is empty, delete it + if [ -z "$(ls -A ${WAZUH_GLOBAL_TMP_DIR})" ]; then + rm -rf ${WAZUH_GLOBAL_TMP_DIR} + fi + + ;; + + + abort-upgrade|abort-remove|abort-deconfigure) + + ;; + + + *) + echo "postinst called with unknown argument \`$1'" >2 + exit 1 + ;; + +esac + +exit 0 diff --git a/packages/debs/SPECS/wazuh_agent/debian/postrm b/packages/debs/SPECS/wazuh_agent/debian/postrm new file mode 100644 index 0000000000..8404ffdbbf --- /dev/null +++ b/packages/debs/SPECS/wazuh_agent/debian/postrm @@ -0,0 +1,109 @@ +#!/bin/sh +# postrm script for wazuh-agent +# Wazuh, Inc 2015 + +set -e + +DIR="/var/ossec" +WAZUH_TMP_DIR="${DIR}/packages_files/agent_config_files" + +case "$1" in + remove|failed-upgrade|abort-install|abort-upgrade|disappear) + + if [ -d ${WAZUH_TMP_DIR} ]; then + rm -rf ${WAZUH_TMP_DIR} + fi + + # Back up the old configuration files as .save + if [ ! -d ${DIR}/etc ]; then + mkdir -p ${DIR}/etc + fi + + # If the directory is not empty, copy the files into ${DIR}/etc + if ls -A ${DIR}/tmp/conffiles > /dev/null 2>&1 ; then + mv ${DIR}/tmp/conffiles/* ${DIR}/etc + fi + rm -rf ${DIR}/tmp + if [ "$1" = "remove" ]; then + rm -rf ${DIR}/ruleset + rm -rf ${DIR}/var + rm -rf ${DIR}/logs + rm -rf ${DIR}/queue + rm -rf ${DIR}/etc/shared + fi + + # Delete old .save + find ${DIR}/etc/ -type f -name "*save" -exec rm -f {} \; + + # Rename the files + find ${DIR}/etc/ -type f -exec mv {} {}.save \; + + ;; + + purge) + + if getent passwd wazuh >/dev/null 2>&1; then + deluser wazuh > /dev/null 2>&1 + fi + if getent group wazuh >/dev/null 2>&1; then + delgroup wazuh > /dev/null 2>&1 + fi + rm -rf ${DIR}/* + + ;; + + upgrade) + # If the upgrade downgrades to earlier versions, restore ownership + if command -v ${DIR}/bin/ossec-control > /dev/null 2>&1; then + + OSMYSHELL="/sbin/nologin" + + if [ -d ${DIR}/logs/wazuh ]; then + mv ${DIR}/logs/wazuh ${DIR}/logs/ossec + fi + + if [ -d ${DIR}/queue/sockets ]; then + mv ${DIR}/queue/sockets ${DIR}/queue/ossec + fi + + if [ -f ${DIR}/queue/sockets/.agent_info ]; then + mv ${DIR}/queue/sockets/.agent_info ${DIR}/queue/ossec/ + fi + + rm -rf ${DIR}/queue/sockets > /dev/null 2>&1 + + if ! getent group ossec > /dev/null 2>&1; then + addgroup --system ossec > /dev/null 2>&1 + fi + + if ! getent passwd ossec > /dev/null 2>&1; then + adduser --system --home /var/ossec --shell ${OSMYSHELL} --ingroup ossec ossec > /dev/null 2>&1 + fi + + # Set the correct permissions to orphaned files (not owned by root) + find ${DIR} ! -group root -exec chgrp ossec {} \; > /dev/null 2>&1 + find ${DIR} ! -user root -exec chown ossec {} \; > /dev/null 2>&1 + + # delete wazuh user and group + if getent passwd wazuh > /dev/null 2>&1; then + deluser wazuh + fi + + if getent group wazuh > /dev/null 2>&1; then + delgroup wazuh + fi + fi + + exit 0 + + ;; + + *) + echo "postrm called with unknown argument \`$1'" >&2 + exit 1 + + ;; + +esac + +exit 0 diff --git a/packages/debs/SPECS/wazuh_agent/debian/preinst b/packages/debs/SPECS/wazuh_agent/debian/preinst new file mode 100644 index 0000000000..1a67be6bab --- /dev/null +++ b/packages/debs/SPECS/wazuh_agent/debian/preinst @@ -0,0 +1,91 @@ +#!/bin/sh +# preinst script for wazuh-agent + +set -e + +# configuration variables +DIR="/var/ossec" +WAZUH_TMP_DIR="${DIR}/packages_files/agent_config_files" + +# environment configuration +if [ ! -d ${WAZUH_TMP_DIR} ]; then + mkdir -p ${WAZUH_TMP_DIR} +else + rm -rf ${WAZUH_TMP_DIR} + mkdir -p ${WAZUH_TMP_DIR} +fi + +case "$1" in + install|upgrade) + + if [ "$1" = "upgrade" ]; then + + if [ ! -d "$DIR" ]; then + echo "Error: Directory $DIR does not exist. Cannot perform upgrade" >&2 + exit 1 + fi + + if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1 && systemctl is-active --quiet wazuh-agent > /dev/null 2>&1; then + systemctl stop wazuh-agent.service > /dev/null 2>&1 + touch ${WAZUH_TMP_DIR}/wazuh.restart + elif command -v service > /dev/null 2>&1 && service wazuh-agent status 2>/dev/null | grep "is running" > /dev/null 2>&1; then + service wazuh-agent stop > /dev/null 2>&1 + touch ${WAZUH_TMP_DIR}/wazuh.restart + elif ${DIR}/bin/wazuh-control status 2>/dev/null | grep "is running" > /dev/null 2>&1; then + touch ${WAZUH_TMP_DIR}/wazuh.restart + elif ${DIR}/bin/ossec-control status 2>/dev/null | grep "is running" > /dev/null 2>&1; then + touch ${WAZUH_TMP_DIR}/wazuh.restart + fi + ${DIR}/bin/ossec-control stop > /dev/null 2>&1 || ${DIR}/bin/wazuh-control stop > /dev/null 2>&1 + + if [ -d ${DIR}/logs/ossec ]; then + mv ${DIR}/logs/ossec ${DIR}/logs/wazuh + fi + + if [ -d ${DIR}/queue/ossec ]; then + mv ${DIR}/queue/ossec ${DIR}/queue/sockets + fi + fi + + if [ ! -z "$2" ] && [ ! -f ${DIR}/etc/ossec.conf ] ; then + touch ${WAZUH_TMP_DIR}/create_conf + fi + + # Delete old service + if [ -f /etc/init.d/ossec ]; then + rm /etc/init.d/ossec + fi + # back up the current user rules + if [ -f ${DIR}/etc/client.keys ]; then + cp ${DIR}/etc/client.keys ${WAZUH_TMP_DIR}/client.keys + fi + if [ -f ${DIR}/etc/local_internal_options.conf ]; then + cp -p ${DIR}/etc/local_internal_options.conf ${WAZUH_TMP_DIR}/local_internal_options.conf + fi + if [ -f ${DIR}/etc/ossec.conf ]; then + cp -p ${DIR}/etc/ossec.conf ${WAZUH_TMP_DIR}/ossec.conf + fi + + if [ -d ${DIR}/etc/shared ]; then + files="$(ls -A ${DIR}/etc/shared/*)" + fi + + if [ ! -z "$files" ]; then + mkdir -p ${WAZUH_TMP_DIR}/group + cp -rp ${DIR}/etc/shared/* ${WAZUH_TMP_DIR}/group/ + fi + ;; + + abort-upgrade) + + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + + ;; + +esac + +exit 0 diff --git a/packages/debs/SPECS/wazuh_agent/debian/prerm b/packages/debs/SPECS/wazuh_agent/debian/prerm new file mode 100644 index 0000000000..5ffd70b01c --- /dev/null +++ b/packages/debs/SPECS/wazuh_agent/debian/prerm @@ -0,0 +1,108 @@ +#!/bin/sh +# prerm script for wazuh-manager + +set -e + +DIR="/var/ossec" + +case "$1" in + upgrade|deconfigure) + + # Stop the services before uninstalling the package + if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1 && systemctl is-active --quiet wazuh-agent > /dev/null 2>&1; then + systemctl stop wazuh-agent > /dev/null 2>&1 + elif command -v service > /dev/null 2>&1 && service wazuh-agent status 2>/dev/null | grep "running" > /dev/null 2>&1; then + service wazuh-agent stop > /dev/null 2>&1 + fi + ${DIR}/bin/wazuh-control stop > /dev/null 2>&1 + + # Process: wazuh-execd + if pgrep -f "wazuh-execd" > /dev/null 2>&1; then + kill -15 $(pgrep -f "wazuh-execd") > /dev/null 2>&1 + fi + + if pgrep -f "wazuh-execd" > /dev/null 2>&1; then + kill -9 $(pgrep -f "wazuh-execd") > /dev/null 2>&1 + fi + + # Process: wazuh-agentd + if pgrep -f "wazuh-agentd" > /dev/null 2>&1; then + kill -15 $(pgrep -f "wazuh-agentd") > /dev/null 2>&1 + fi + + if pgrep -f "wazuh-agentd" > /dev/null 2>&1; then + kill -9 $(pgrep -f "wazuh-agentd") > /dev/null 2>&1 + fi + + # Process: wazuh-syscheckd + if pgrep -f "wazuh-syscheckd" > /dev/null 2>&1; then + kill -15 $(pgrep -f "wazuh-syscheckd") > /dev/null 2>&1 + fi + + if pgrep -f "wazuh-syscheckd" > /dev/null 2>&1; then + kill -9 $(pgrep -f "wazuh-syscheckd") > /dev/null 2>&1 + fi + + # Process: wazuh-logcollector + if pgrep -f "wazuh-logcollector" > /dev/null 2>&1; then + kill -15 $(pgrep -f "wazuh-logcollector") > /dev/null 2>&1 + fi + + if pgrep -f "wazuh-logcollector" > /dev/null 2>&1; then + kill -9 $(pgrep -f "wazuh-logcollector") > /dev/null 2>&1 + fi + + # Process: wazuh-modulesd + if pgrep -f "wazuh-modulesd" > /dev/null 2>&1; then + kill -15 $(pgrep -f "wazuh-modulesd") > /dev/null 2>&1 + fi + + if pgrep -f "wazuh-modulesd" > /dev/null 2>&1; then + kill -9 $(pgrep -f "wazuh-modulesd") > /dev/null 2>&1 + fi + + ;; + + remove) + + # Stop the services before uninstalling the package + # Check for systemd + if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1 && systemctl is-active --quiet wazuh-agent > /dev/null 2>&1; then + systemctl stop wazuh-agent > /dev/null 2>&1 + # Check for SysV + elif command -v service > /dev/null 2>&1 && service wazuh-agent status 2>/dev/null | grep "running" > /dev/null 2>&1; then + service wazuh-agent stop > /dev/null 2>&1 + fi + ${DIR}/bin/wazuh-control stop > /dev/null 2>&1 + + # Save the conffiles + mkdir -p ${DIR}/tmp/conffiles + # Save the client.keys + if [ -f ${DIR}/etc/client.keys ]; then + cp -p ${DIR}/etc/client.keys ${DIR}/tmp/conffiles + fi + # Save the local_internal_options.conf + if [ -f ${DIR}/etc/local_internal_options.conf ]; then + cp -p ${DIR}/etc/local_internal_options.conf ${DIR}/tmp/conffiles + fi + # Save the ossec.conf + if [ -f ${DIR}/etc/ossec.conf ]; then + cp -p ${DIR}/etc/ossec.conf ${DIR}/tmp/conffiles + fi + + ;; + + failed-upgrade) + if [ -f ${DIR}/bin/wazuh-control ]; then + ${DIR}/bin/wazuh-control stop > /dev/null 2>&1 + fi + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; + +esac + +exit 0 diff --git a/packages/debs/SPECS/wazuh_agent/debian/rules b/packages/debs/SPECS/wazuh_agent/debian/rules new file mode 100644 index 0000000000..b79b4ce99f --- /dev/null +++ b/packages/debs/SPECS/wazuh_agent/debian/rules @@ -0,0 +1,161 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. +# +# Modified to make a template file for a multi-binary package with separated +# build-arch and build-indep targets by Bill Allombert 2001 + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +export TARGET_DIR=${CURDIR}/debian/wazuh-agent + +# Package build options +export INSTALLATION_DIR="/var/ossec" +export INSTALLATION_SCRIPTS_DIR="${INSTALLATION_DIR}/packages_files/agent_installation_scripts" +export JOBS="5" +export DEBUG_ENABLED="no" +export PATH="${PATH}" +export LD_LIBRARY_PATH="" + +%: + dh $@ + +override_dh_shlibdeps: + +override_dh_auto_configure: + +override_dh_auto_install: + +override_dh_install: + + rm -rf $(INSTALLATION_DIR)/ + + # Build the binaries + make -C src deps TARGET=agent + make -j$(JOBS) -C src/ TARGET=agent USE_SELINUX=yes DEBUG=$(DEBUG_ENABLED) + + USER_LANGUAGE="en" \ + USER_NO_STOP="y" \ + USER_INSTALL_TYPE="agent" \ + USER_DIR="$(INSTALLATION_DIR)" \ + USER_DELETE_DIR="y" \ + USER_ENABLE_ACTIVE_RESPONSE="y" \ + USER_ENABLE_SYSCHECK="y" \ + USER_ENABLE_ROOTCHECK="y" \ + USER_ENABLE_OPENSCAP="y" \ + USER_ENABLE_CISCAT="y" \ + USER_ENABLE_SYSCOLLECTOR="y" \ + USER_UPDATE="n" \ + USER_AGENT_SERVER_IP="MANAGER_IP" \ + USER_CA_STORE="/path/to/my_cert.pem" \ + USER_AUTO_START="n" \ + ./install.sh + + # Copying init.d script + mkdir -p ${TARGET_DIR}/etc/init.d/ + sed -i "s:WAZUH_HOME_TMP:${INSTALLATION_DIR}:g" src/init/templates/ossec-hids-debian.init + + cp src/init/templates/ossec-hids-debian.init ${TARGET_DIR}/etc/init.d/wazuh-agent + + # Copying systemd file + mkdir -p ${TARGET_DIR}/usr/lib/systemd/system/ + sed -i "s:WAZUH_HOME_TMP:${INSTALLATION_DIR}:g" src/init/templates/wazuh-agent.service + install -m 0644 src/init/templates/wazuh-agent.service ${TARGET_DIR}/usr/lib/systemd/system/ + + # Generating permission restoration file for postinstall + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR) + + # Remove preinstalled log files + rm -rf $(INSTALLATION_DIR)/logs/*.log + rm -rf $(INSTALLATION_DIR)/logs/*.json + + # Clean the preinstalled configuration assesment files + rm -rf ${TARGET_DIR}$(INSTALLATION_DIR)/ruleset/sca + mkdir -p ${TARGET_DIR}$(INSTALLATION_DIR)/ruleset/sca + + ./gen_permissions.sh $(INSTALLATION_DIR)/ ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/restore-permissions.sh + + # Copying to target + mkdir -p ${TARGET_DIR}$(INSTALLATION_DIR)/ + cp -r $(INSTALLATION_DIR)/. $(TARGET_DIR)$(INSTALLATION_DIR)/ + + # Copying install scripts to /usr/share + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/ + cp gen_ossec.sh ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/ + cp add_localfiles.sh ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/ + + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/src + cp src/VERSION ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/src/ + cp src/REVISION ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/src/ + + # Install configuration assesment files and files templates + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/applications + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/generic + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/debian/7 + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/debian/8 + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/debian/9 + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/debian/10 + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/debian/11 + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/debian/12 + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/ubuntu/12/04 + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/ubuntu/14/04 + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/ubuntu/16/04 + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/ubuntu/18/04 + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/ubuntu/20/04 + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/ubuntu/22/04 + + cp -r ruleset/sca/* ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca + + cp etc/templates/config/generic/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/generic + cp etc/templates/config/generic/sca.manager.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/generic + + cp etc/templates/config/debian/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/debian + cp etc/templates/config/debian/7/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/debian/7 + cp etc/templates/config/debian/8/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/debian/8 + cp etc/templates/config/debian/9/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/debian/9 + cp etc/templates/config/debian/10/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/debian/10 + cp etc/templates/config/debian/11/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/debian/11 + cp etc/templates/config/debian/12/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/debian/12 + + cp etc/templates/config/ubuntu/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/ubuntu + cp etc/templates/config/ubuntu/12/04/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/ubuntu/12/04 + cp etc/templates/config/ubuntu/14/04/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/ubuntu/14/04 + cp etc/templates/config/ubuntu/16/04/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/ubuntu/16/04 + cp etc/templates/config/ubuntu/18/04/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/ubuntu/18/04 + cp etc/templates/config/ubuntu/20/04/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/ubuntu/20/04 + cp etc/templates/config/ubuntu/22/04/sca.files ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/sca/ubuntu/22/04 + + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/src/init + cp -r src/init/* ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/src/init + + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/etc/templates/config/generic + cp -r etc/templates/config/generic ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/etc/templates/config/ + + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/etc/templates/config/debian + cp -r etc/templates/config/debian ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/etc/templates/config/ + + mkdir -p ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/etc/templates/config/ubuntu + cp -r etc/templates/config/ubuntu ${TARGET_DIR}$(INSTALLATION_SCRIPTS_DIR)/etc/templates/config/ + + # Copying systemd file + mkdir -p ${TARGET_DIR}/etc/systemd/system/ + sed -i "s:WAZUH_HOME_TMP:${INSTALLATION_DIR}:g" src/init/templates/wazuh-agent.service + cp src/init/templates/wazuh-agent.service ${TARGET_DIR}/etc/systemd/system/ + +override_dh_auto_clean: + $(MAKE) -C src clean + + +override_dh_strip: + dh_strip --no-automatic-dbgsym + +.PHONY: override_dh_install override_dh_strip override_dh_auto_clean override_dh_auto_build override_dh_auto_configure diff --git a/packages/debs/SPECS/wazuh_agent/debian/source/format b/packages/debs/SPECS/wazuh_agent/debian/source/format new file mode 100644 index 0000000000..163aaf8d82 --- /dev/null +++ b/packages/debs/SPECS/wazuh_agent/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/packages/debs/SPECS/wazuh_agent/debian/templates b/packages/debs/SPECS/wazuh_agent/debian/templates new file mode 100644 index 0000000000..3dbe63d83f --- /dev/null +++ b/packages/debs/SPECS/wazuh_agent/debian/templates @@ -0,0 +1,4 @@ +Template: wazuh-agent/server-ip +Type: string +Default: 127.0.0.1 +Description: OSSEC server IP address for this agent. This server is also known as Manager and will receive information from the agent. You need to specify the IP address, the hostname is not valid. The agent still needs to be registered and started manually. diff --git a/packages/debs/SPECS/wazuh_agent/debian/wazuh_agent.lintian_overrides b/packages/debs/SPECS/wazuh_agent/debian/wazuh_agent.lintian_overrides new file mode 100644 index 0000000000..e1233f34da --- /dev/null +++ b/packages/debs/SPECS/wazuh_agent/debian/wazuh_agent.lintian_overrides @@ -0,0 +1,9 @@ +wazuh-agent: embedded-library +wazuh-agent: embedded-zlib +wazuh-agent: possible-gpl-code-linked-with-openssl +wazuh-agent: new-package-should-close-itp-bug +wazuh-agent: possibly-insecure-handling-of-tmp-files-in-maintainer-script +wazuh-agent: non-standard-dir-in-var +wazuh-agent: file-in-unusual-dir +wazuh-agent: hardening-no-fortify-functions +wazuh-agent: hardening-no-relro diff --git a/packages/debs/amd64/agent/Dockerfile b/packages/debs/amd64/agent/Dockerfile new file mode 100644 index 0000000000..6896f77636 --- /dev/null +++ b/packages/debs/amd64/agent/Dockerfile @@ -0,0 +1,44 @@ +FROM debian:7 + +ENV DEBIAN_FRONTEND noninteractive + +# Installing necessary packages +RUN echo "deb http://archive.debian.org/debian/ wheezy contrib main non-free" > /etc/apt/sources.list && \ + echo "deb-src http://archive.debian.org/debian/ wheezy contrib main non-free" >> /etc/apt/sources.list && \ + apt-get update && apt-get install -y --force-yes apt-utils && \ + apt-get install -y --force-yes \ + curl gcc make sudo wget expect gnupg perl-base=5.14.2-21+deb7u3 perl \ + libc-bin=2.13-38+deb7u10 libc6=2.13-38+deb7u10 libc6-dev build-essential \ + cdbs devscripts equivs automake autoconf libtool libaudit-dev selinux-basics \ + libdb5.1=5.1.29-5 libdb5.1-dev libssl1.0.0=1.0.1e-2+deb7u20 procps gawk libsigsegv2 + +RUN apt-get update && apt-get build-dep python3.2 -y --force-yes + +RUN curl -OL http://packages.wazuh.com/utils/gcc/gcc-9.4.0.tar.gz && \ + tar xzf gcc-9.4.0.tar.gz && cd gcc-9.4.0/ && \ + ./contrib/download_prerequisites && \ + ./configure --prefix=/usr/local/gcc-9.4.0 --enable-languages=c,c++ --disable-multilib \ + --disable-libsanitizer && \ + make -j$(nproc) && make install && \ + ln -fs /usr/local/gcc-9.4.0/bin/g++ /usr/bin/c++ && \ + ln -fs /usr/local/gcc-9.4.0/bin/gcc /usr/bin/cc && cd / && rm -rf gcc-* + +ENV CPLUS_INCLUDE_PATH "/usr/local/gcc-9.4.0/include/c++/9.4.0/" +ENV LD_LIBRARY_PATH "/usr/local/gcc-9.4.0/lib64:${LD_LIBRARY_PATH}" +ENV PATH "/usr/local/gcc-9.4.0/bin:${PATH}" + +RUN curl -OL http://packages.wazuh.com/utils/cmake/cmake-3.18.3.tar.gz && \ + tar -zxf cmake-3.18.3.tar.gz && cd cmake-3.18.3 && \ + ./bootstrap --no-system-curl CXX=/usr/local/gcc-9.4.0/bin/g++ \ + CC=/usr/local/gcc-9.4.0/bin/gcc && \ + make -j$(nproc) && make install && ln -s /usr/local/bin/cmake /usr/bin/cmake && \ + cd / && rm -rf cmake-* + +# Add the script and helper_funcitons to build the Debian package +ADD build.sh /usr/local/bin/build_package +RUN chmod +x /usr/local/bin/build_package +ADD helper_function.sh /usr/local/bin/helper_function.sh +ADD gen_permissions.sh /tmp/gen_permissions.sh + +# Set the entrypoint +ENTRYPOINT ["/usr/local/bin/build_package"] diff --git a/packages/debs/arm64/agent/Dockerfile b/packages/debs/arm64/agent/Dockerfile new file mode 100644 index 0000000000..a79811426b --- /dev/null +++ b/packages/debs/arm64/agent/Dockerfile @@ -0,0 +1,47 @@ +FROM arm64v8/debian:stretch + +ENV DEBIAN_FRONTEND noninteractive + +# Installing necessary packages +RUN echo "deb http://archive.debian.org/debian stretch contrib main non-free" > /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list && \ + echo "deb-src http://archive.debian.org/debian stretch main" >> /etc/apt/sources.list && \ + apt-get update && apt-get install -y --allow-change-held-packages apt apt-utils \ + curl gcc g++ make sudo expect gnupg \ + perl-base perl wget libc-bin libc6 libc6-dev \ + build-essential cdbs devscripts equivs automake \ + autoconf libtool libaudit-dev selinux-basics \ + libdb5.3 libdb5.3 libssl1.0.2 gawk libsigsegv2 + +# Add Debian's source repository and, Install NodeJS 12 +RUN apt-get update && apt-get build-dep python3.5 -y --allow-change-held-packages +RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \ + apt-get install --allow-change-held-packages -y nodejs + +RUN curl -OL http://packages.wazuh.com/utils/gcc/gcc-9.4.0.tar.gz && \ + tar xzf gcc-9.4.0.tar.gz && cd gcc-9.4.0/ && \ + ./contrib/download_prerequisites && \ + ./configure --prefix=/usr/local/gcc-9.4.0 --enable-languages=c,c++ --disable-multilib \ + --disable-libsanitizer && \ + make -j$(nproc) && make install && \ + ln -fs /usr/local/gcc-9.4.0/bin/g++ /usr/bin/c++ && \ + ln -fs /usr/local/gcc-9.4.0/bin/gcc /usr/bin/cc && cd / && rm -rf gcc-* + +ENV CPLUS_INCLUDE_PATH "/usr/local/gcc-9.4.0/include/c++/9.4.0/" +ENV LD_LIBRARY_PATH "/usr/local/gcc-9.4.0/lib64/" +ENV PATH "/usr/local/gcc-9.4.0/bin:${PATH}" + +RUN curl -OL http://packages.wazuh.com/utils/cmake/cmake-3.18.3.tar.gz && \ + tar -zxf cmake-3.18.3.tar.gz && cd cmake-3.18.3 && \ + ./bootstrap --no-system-curl && \ + make -j$(nproc) && make install && ln -s /usr/local/bin/cmake /usr/bin/cmake && \ + cd / && rm -rf cmake-* + +# Add the script to build the Debian package +ADD build.sh /usr/local/bin/build_package +RUN chmod +x /usr/local/bin/build_package +ADD helper_function.sh /usr/local/bin/helper_function.sh +ADD gen_permissions.sh /tmp/gen_permissions.sh + +# Set the entrypoint +ENTRYPOINT ["/usr/local/bin/build_package"] diff --git a/packages/debs/armhf/agent/Dockerfile b/packages/debs/armhf/agent/Dockerfile new file mode 100644 index 0000000000..a27b9d1347 --- /dev/null +++ b/packages/debs/armhf/agent/Dockerfile @@ -0,0 +1,48 @@ +FROM arm32v7/debian:stretch + +ENV DEBIAN_FRONTEND noninteractive + +# Installing necessary packages +RUN echo "deb http://archive.debian.org/debian stretch contrib main non-free" > /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list && \ + echo "deb-src http://archive.debian.org/debian stretch main" >> /etc/apt/sources.list && \ + apt-get update && apt-get install -y --allow-change-held-packages apt-utils \ + curl gcc make wget sudo expect gnupg perl-base \ + perl libc-bin libc6 libc6-dev \ + build-essential cdbs devscripts equivs automake autoconf libtool \ + libaudit-dev selinux-basics util-linux libdb5.1 \ + libssl1.1 libssl-dev gawk libsigsegv2 procps libc6-armel-cross g++ + +# Add Debian's source repository and, Install NodeJS 12 +RUN apt-get build-dep python3.5 -y --allow-change-held-packages +RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \ + apt-get install -y --allow-change-held-packages nodejs + +RUN curl -OL http://packages.wazuh.com/utils/gcc/gcc-9.4.0.tar.gz && \ + tar xzf gcc-9.4.0.tar.gz && cd gcc-9.4.0/ && \ + linux32 ./contrib/download_prerequisites && \ + linux32 ./configure --prefix=/usr/local/gcc-9.4.0 --with-arch=armv7-a \ + --with-fpu=vfpv3-d16 --with-float=hard --enable-languages=c,c++ \ + --disable-multilib --disable-libsanitizer && \ + linux32 make -j$(nproc) && linux32 make install && \ + ln -fs /usr/local/gcc-9.4.0/bin/g++ /usr/bin/c++ && \ + ln -fs /usr/local/gcc-9.4.0/bin/gcc /usr/bin/cc && cd / && rm -rf gcc-* + +ENV CPLUS_INCLUDE_PATH "/usr/local/gcc-9.4.0/include/c++/9.4.0/" +ENV LD_LIBRARY_PATH "/usr/local/gcc-9.4.0/lib/" +ENV PATH "/usr/local/gcc-9.4.0/bin:${PATH}" + +RUN curl -OL http://packages.wazuh.com/utils/cmake/cmake-3.18.3.tar.gz && \ + tar -zxvf cmake-3.18.3.tar.gz && cd cmake-3.18.3 && \ + linux32 ./bootstrap --no-system-curl && \ + linux32 make -j$(nproc) && linux32 make install && \ + ln -s /usr/local/bin/cmake /usr/bin/cmake && cd / && rm -rf cmake-* + +# Add the script to build the Debian package +ADD build.sh /usr/local/bin/build_package +RUN chmod +x /usr/local/bin/build_package +ADD helper_function.sh /usr/local/bin/helper_function.sh +ADD gen_permissions.sh /tmp/gen_permissions.sh + +# Set the entrypoint +ENTRYPOINT ["/usr/local/bin/build_package"] diff --git a/packages/debs/i386/agent/Dockerfile b/packages/debs/i386/agent/Dockerfile new file mode 100644 index 0000000000..4e45fa3b04 --- /dev/null +++ b/packages/debs/i386/agent/Dockerfile @@ -0,0 +1,47 @@ +FROM i386/debian:7 + +ENV DEBIAN_FRONTEND noninteractive + +# Installing necessary packages +RUN echo "deb http://archive.debian.org/debian/ wheezy contrib main non-free" > /etc/apt/sources.list && \ + echo "deb-src http://archive.debian.org/debian/ wheezy contrib main non-free" >> /etc/apt/sources.list && \ + apt-get update && apt-get install -y --force-yes apt-utils && \ + apt-get install -y --force-yes \ + curl gcc-multilib make wget sudo expect gnupg perl-base=5.14.2-21+deb7u3 \ + perl libc-bin=2.13-38+deb7u10 libc6=2.13-38+deb7u10 libc6-dev \ + build-essential cdbs devscripts equivs automake autoconf libtool \ + libaudit-dev selinux-basics util-linux libdb5.1=5.1.29-5 libdb5.1-dev \ + libssl1.0.0=1.0.1e-2+deb7u20 gawk libsigsegv2 procps + +# Add Debian's source repository +RUN apt-get update && apt-get build-dep python3.2 -y --force-yes +RUN sed -i "s;/\* To add :#define SO_REUSEPORT 15 \*/;#define SO_REUSEPORT 15;g" /usr/include/asm-generic/socket.h + +RUN curl -OL http://packages.wazuh.com/utils/gcc/gcc-9.4.0.tar.gz && \ + tar xzf gcc-9.4.0.tar.gz && cd gcc-9.4.0/ && \ + linux32 ./contrib/download_prerequisites && \ + linux32 ./configure --prefix=/usr/local/gcc-9.4.0 --enable-languages=c,c++ \ + --disable-multilib --disable-libsanitizer && \ + linux32 make -j$(nproc) && linux32 make install && \ + ln -fs /usr/local/gcc-9.4.0/bin/g++ /usr/bin/c++ && \ + ln -fs /usr/local/gcc-9.4.0/bin/gcc /usr/bin/cc && cd / && rm -rf gcc-* + +ENV CPLUS_INCLUDE_PATH "/usr/local/gcc-9.4.0/include/c++/9.4.0/" +ENV LD_LIBRARY_PATH "/usr/local/gcc-9.4.0/lib:${LD_LIBRARY_PATH}" +ENV PATH "/usr/local/gcc-9.4.0/bin:${PATH}" + +RUN curl -OL http://packages.wazuh.com/utils/cmake/cmake-3.18.3.tar.gz && \ + tar -zxvf cmake-3.18.3.tar.gz && cd cmake-3.18.3 && \ + linux32 ./bootstrap --no-system-curl CXX=/usr/local/gcc-9.4.0/bin/g++ \ + CC=/usr/local/gcc-9.4.0/bin/gcc && \ + linux32 make -j$(nproc) && linux32 make install && \ + ln -s /usr/local/bin/cmake /usr/bin/cmake && cd / && rm -rf cmake-* + +# Add the script to build the Debian package +ADD build.sh /usr/local/bin/build_package +RUN chmod +x /usr/local/bin/build_package +ADD helper_function.sh /usr/local/bin/helper_function.sh +ADD gen_permissions.sh /tmp/gen_permissions.sh + +# Set the entrypoint +ENTRYPOINT ["/usr/local/bin/build_package"] diff --git a/packages/debs/ppc64le/agent/Dockerfile b/packages/debs/ppc64le/agent/Dockerfile new file mode 100644 index 0000000000..a611151b9d --- /dev/null +++ b/packages/debs/ppc64le/agent/Dockerfile @@ -0,0 +1,47 @@ +FROM ppc64le/debian:stretch + +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get -v + +# Installing necessary packages +RUN echo "deb http://archive.debian.org/debian stretch contrib main non-free" > /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list && \ + echo "deb-src http://archive.debian.org/debian stretch main" >> /etc/apt/sources.list && \ + apt-get update && apt-get install -y --allow-change-held-packages apt-utils && \ + apt-get install -y --allow-change-held-packages \ + curl gcc make sudo expect gnupg perl-base perl wget \ + libc-bin libc6 libc6-dev build-essential \ + cdbs devscripts equivs automake autoconf libtool libaudit-dev selinux-basics \ + libdb5.3 libdb5.3 libssl1.0.2 gawk libsigsegv2 + +RUN apt-get update && apt-get build-dep python3.5 -y --allow-change-held-packages + +RUN curl -OL http://packages.wazuh.com/utils/gcc/gcc-9.4.0.tar.gz && \ + tar xzf gcc-9.4.0.tar.gz && cd gcc-9.4.0/ && \ + ./contrib/download_prerequisites && \ + ./configure --prefix=/usr/local/gcc-9.4.0 --enable-languages=c,c++ --disable-multilib \ + --disable-libsanitizer && \ + make -j$(nproc) && make install && \ + ln -fs /usr/local/gcc-9.4.0/bin/g++ /usr/bin/c++ && \ + ln -fs /usr/local/gcc-9.4.0/bin/gcc /usr/bin/cc && cd / && rm -rf gcc-* + +ENV CPLUS_INCLUDE_PATH "/usr/local/gcc-9.4.0/include/c++/9.4.0/" +ENV LD_LIBRARY_PATH "/usr/local/gcc-9.4.0/lib64:${LD_LIBRARY_PATH}" +ENV PATH "/usr/local/gcc-9.4.0/bin:${PATH}" + +RUN curl -OL http://packages.wazuh.com/utils/cmake/cmake-3.18.3.tar.gz && \ + tar -zxf cmake-3.18.3.tar.gz && cd cmake-3.18.3 && \ + ./bootstrap --no-system-curl CXX=/usr/local/gcc-9.4.0/bin/g++ \ + CC=/usr/local/gcc-9.4.0/bin/gcc && \ + make -j$(nproc) && make install && ln -s /usr/local/bin/cmake /usr/bin/cmake && \ + cd / && rm -rf cmake-* + +# Add the script to build the Debian package +ADD build.sh /usr/local/bin/build_package +RUN chmod +x /usr/local/bin/build_package +ADD helper_function.sh /usr/local/bin/helper_function.sh +ADD gen_permissions.sh /tmp/gen_permissions.sh + +# Set the entrypoint +ENTRYPOINT ["/usr/local/bin/build_package"] diff --git a/packages/debs/utils/gen_permissions.sh b/packages/debs/utils/gen_permissions.sh new file mode 100755 index 0000000000..d2dc055ae2 --- /dev/null +++ b/packages/debs/utils/gen_permissions.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env /bin/bash +# +# Wazuh restore permissions script generator (ver 0.1) +# Copyright (C) 2019 Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. +# +# This scripts take 2 parameters, source_dir and target_dir +# Remember: you must use gawk, be careful mawk is not compatible +# +# Usage: ./gen_permissions.sh /var/ossec/ ~/restore_permissions.sh + +set -euo pipefail + +find $1 -depth -printf '%m:%u:%g:%p\0' | awk -v RS='\0' -F: ' +BEGIN { + print "#!/bin/sh"; + q = "\047"; +} +{ + gsub(q, q q "\\" q); + f = $0; + sub(/^[^:]*:[^:]*:[^:]*:/, "", f); + print "chown --", q $2 ":" $3 q, q f q, " > /dev/null 2>&1 || :"; + print "chmod", $1, q f q, " > /dev/null 2>&1 || :"; +}' > $2 +chmod +x $2 diff --git a/packages/debs/utils/helper_function.sh b/packages/debs/utils/helper_function.sh new file mode 100644 index 0000000000..02988d82d7 --- /dev/null +++ b/packages/debs/utils/helper_function.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +# DEB helper functions + +# Wazuh package builder +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. + + +setup_build(){ + sources_dir="$1" + specs_path="$2" + build_dir="$3" + package_name="$4" + debug="$5" + + cp -pr ${specs_path}/wazuh-${BUILD_TARGET}/debian ${sources_dir}/debian + cp -p /tmp/gen_permissions.sh ${sources_dir} + + # Generating directory structure to build the .deb package + cd ${build_dir}/${BUILD_TARGET} && tar -czf ${package_name}.orig.tar.gz "${package_name}" + + # Configure the package with the different parameters + sed -i "s:RELEASE:${REVISION}:g" ${sources_dir}/debian/changelog + sed -i "s:export JOBS=.*:export JOBS=${JOBS}:g" ${sources_dir}/debian/rules + sed -i "s:export DEBUG_ENABLED=.*:export DEBUG_ENABLED=${debug}:g" ${sources_dir}/debian/rules + sed -i "s#export PATH=.*#export PATH=/usr/local/gcc-5.5.0/bin:${PATH}#g" ${sources_dir}/debian/rules + sed -i "s#export LD_LIBRARY_PATH=.*#export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}#g" ${sources_dir}/debian/rules + sed -i "s:export INSTALLATION_DIR=.*:export INSTALLATION_DIR=${INSTALLATION_PATH}:g" ${sources_dir}/debian/rules + sed -i "s:DIR=\"/var/ossec\":DIR=\"${INSTALLATION_PATH}\":g" ${sources_dir}/debian/{preinst,postinst,prerm,postrm} +} + +set_debug(){ + local debug="$1" + local sources_dir="$2" + if [[ "${debug}" == "yes" ]]; then + sed -i "s:dh_strip --no-automatic-dbgsym::g" ${sources_dir}/debian/rules + fi +} + +build_deps(){ + mk-build-deps -ir -t "apt-get -o Debug::pkgProblemResolver=yes -y" +} + +build_package(){ + + if [[ "${ARCHITECTURE_TARGET}" == "amd64" ]] || [[ "${ARCHITECTURE_TARGET}" == "ppc64le" ]] || \ + [[ "${ARCHITECTURE_TARGET}" == "arm64" ]]; then + debuild --rootcmd=sudo -b -uc -us -nc + elif [[ "${ARCHITECTURE_TARGET}" == "armhf" ]]; then + linux32 debuild --rootcmd=sudo -b -uc -us -nc + else + linux32 debuild --rootcmd=sudo -ai386 -b -uc -us -nc + fi + return $? +} + +get_package_and_checksum(){ + wazuh_version="$1" + short_commit_hash="$2" + base_name="wazuh-${BUILD_TARGET}_${wazuh_version}-${REVISION}" + + if [[ "${ARCHITECTURE_TARGET}" == "ppc64le" ]]; then + deb_file="${base_name}_ppc64el.deb" + else + deb_file="${base_name}_${ARCHITECTURE_TARGET}.deb" + fi + + if [[ "${IS_STAGE}" == "no" ]]; then + deb_file="$(sed "s/\.deb/_${short_commit_hash}&/" <<< "$deb_file")" + fi + + pkg_path="${build_dir}/${BUILD_TARGET}" + if [[ "${checksum}" == "yes" ]]; then + cd ${pkg_path} && sha512sum wazuh-${BUILD_TARGET}*deb > /var/local/wazuh/${deb_file}.sha512 + fi + + find ${pkg_path} -type f -name "wazuh-${BUILD_TARGET}*deb" -exec mv {} /var/local/wazuh/${deb_file} \; +} diff --git a/packages/generate_package.sh b/packages/generate_package.sh new file mode 100755 index 0000000000..a633688c2b --- /dev/null +++ b/packages/generate_package.sh @@ -0,0 +1,264 @@ +#!/bin/bash + +# Wazuh package generator +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. + +set -ex +CURRENT_PATH="$( cd $(dirname $0) ; pwd -P )" +WAZUH_PATH="$(cd $CURRENT_PATH/..; pwd -P)" +ARCHITECTURE="amd64" +SYSTEM="deb" +OUTDIR="${CURRENT_PATH}/output/" +BRANCH="" +REVISION="0" +TARGET="agent" +JOBS="2" +DEBUG="no" +SRC="no" +BUILD_DOCKER="yes" +DOCKER_TAG="latest" +INSTALLATION_PATH="/var/ossec" +CHECKSUM="no" +FUTURE="no" +LEGACY="no" +IS_STAGE="no" + + +trap ctrl_c INT + +clean() { + exit_code=$1 + + # Clean the files + find "${DOCKERFILE_PATH}" \( -name '*.sh' -o -name '*.tar.gz' -o -name 'wazuh-*' \) ! -name 'docker_builder.sh' -exec rm -rf {} + + + exit ${exit_code} +} + +ctrl_c() { + clean 1 +} + +download_file() { + URL=$1 + DESTDIR=$2 + if command -v curl > /dev/null 2>&1 ; then + (cd ${DESTDIR} && curl -sO ${URL}) + elif command -v wget > /dev/null 2>&1 ; then + wget ${URL} -P ${DESTDIR} -q + fi +} + +build_pkg() { + if [ "$LEGACY" = "yes" ]; then + REVISION="${REVISION}.el5" + TAR_URL="https://packages-dev.wazuh.com/utils/centos-5-i386-build/centos-5-i386.tar.gz" + TAR_FILE="${CURRENT_PATH}/${SYSTEM}s/${ARCHITECTURE}/legacy/centos-5-i386.tar.gz" + if [ ! -f "$TAR_FILE" ]; then + download_file ${TAR_URL} "${CURRENT_PATH}/${SYSTEM}s/${ARCHITECTURE}/legacy" + fi + DOCKERFILE_PATH="${CURRENT_PATH}/${SYSTEM}s/${ARCHITECTURE}/legacy" + CONTAINER_NAME="pkg_${SYSTEM}_legacy_builder_${ARCHITECTURE}" + if [ "$SYSTEM" != "rpm" ]; then + echo "Legacy mode is only available for RPM packages." + clean 1 + fi + else + CONTAINER_NAME="pkg_${SYSTEM}_${TARGET}_builder_${ARCHITECTURE}" + if [ "${ARCHITECTURE}" = "arm64" ] || [ "${ARCHITECTURE}" = "ppc64le" ]; then + DOCKERFILE_PATH="${CURRENT_PATH}/${SYSTEM}s/${ARCHITECTURE}" + else + DOCKERFILE_PATH="${CURRENT_PATH}/${SYSTEM}s/${ARCHITECTURE}/${TARGET}" + fi + fi + + # Copy the necessary files + cp ${CURRENT_PATH}/build.sh ${DOCKERFILE_PATH} + cp ${CURRENT_PATH}/${SYSTEM}s/utils/* ${DOCKERFILE_PATH} + + # Build the Docker image + if [[ ${BUILD_DOCKER} == "yes" ]]; then + docker build -t ${CONTAINER_NAME}:${DOCKER_TAG} ${DOCKERFILE_PATH} || return 1 + fi + + # Build the Debian package with a Docker container + docker run -t --rm -v ${OUTDIR}:/var/local/wazuh:Z \ + -e SYSTEM="$SYSTEM" \ + -e BUILD_TARGET="${TARGET}" \ + -e ARCHITECTURE_TARGET="${ARCHITECTURE}" \ + -e INSTALLATION_PATH="${INSTALLATION_PATH}" \ + -e IS_STAGE="${IS_STAGE}" \ + -e WAZUH_BRANCH="${BRANCH}" \ + ${CUSTOM_CODE_VOL} \ + ${CONTAINER_NAME}:${DOCKER_TAG} \ + ${REVISION} ${JOBS} ${DEBUG} \ + ${CHECKSUM} ${FUTURE} ${LEGACY} ${SRC}|| return 1 + + echo "Package $(ls -Art ${OUTDIR} | tail -n 1) added to ${OUTDIR}." + + return 0 +} + +build() { + build_pkg || return 1 + return 0 +} + +help() { + set +x + echo + echo "Usage: $0 [OPTIONS]" + echo + echo " -b, --branch [Optional] Select Git branch." + echo " -t, --target [Required] Target package to build: manager or agent." + echo " -a, --architecture [Optional] Target architecture of the package [amd64/i386/ppc64le/arm64/armhf]." + echo " -j, --jobs [Optional] Change number of parallel jobs when compiling the manager or agent. By default: 2." + echo " -r, --revision [Optional] Package revision. By default: 0." + echo " -s, --store [Optional] Set the destination path of package. By default, an output folder will be created." + echo " -p, --path [Optional] Installation path for the package. By default: /var/ossec." + echo " -d, --debug [Optional] Build the binaries with debug symbols. By default: no." + echo " -c, --checksum [Optional] Generate checksum on the same directory than the package. By default: no." + echo " -l, --legacy [Optional only for RPM] Build package for CentOS 5." + echo " --dont-build-docker [Optional] Locally built docker image will be used instead of generating a new one." + echo " --tag [Optional] Tag to use with the docker image." + echo " --sources [Optional] Absolute path containing wazuh source code. This option will use local source code instead of downloading it from GitHub. By default use the script path." + echo " --is_stage [Optional] Use release name in package." + echo " --system [Optional] Select Package OS [rpm, deb]. By default is 'deb'." + echo " --src [Optional] Generate the source package in the destination directory." + echo " --future [Optional] Build test future package x.30.0 Used for development purposes." + echo " -h, --help Show this help." + echo + exit $1 +} + + +main() { + while [ -n "$1" ] + do + case "$1" in + "-b"|"--branch") + if [ -n "$2" ]; then + BRANCH="$2" + shift 2 + else + help 1 + fi + ;; + "-h"|"--help") + help 0 + ;; + "-t"|"--target") + if [ -n "$2" ]; then + TARGET="$2" + shift 2 + else + help 1 + fi + ;; + "-a"|"--architecture") + if [ -n "$2" ]; then + ARCHITECTURE="$2" + shift 2 + else + help 1 + fi + ;; + "-l"|"--legacy") + LEGACY="yes" + shift 1 + ;; + "-j"|"--jobs") + if [ -n "$2" ]; then + JOBS="$2" + shift 2 + else + help 1 + fi + ;; + "-r"|"--revision") + if [ -n "$2" ]; then + REVISION="$2" + shift 2 + else + help 1 + fi + ;; + "-p"|"--path") + if [ -n "$2" ]; then + INSTALLATION_PATH="$2" + shift 2 + else + help 1 + fi + ;; + "-d"|"--debug") + DEBUG="yes" + shift 1 + ;; + "-c"|"--checksum") + CHECKSUM="yes" + shift 1 + ;; + "--dont-build-docker") + BUILD_DOCKER="no" + shift 1 + ;; + "--tag") + if [ -n "$2" ]; then + DOCKER_TAG="$2" + shift 2 + else + help 1 + fi + ;; + "-s"|"--store") + if [ -n "$2" ]; then + OUTDIR="$2" + shift 2 + else + help 1 + fi + ;; + "--sources") + if [ -n "$2" ]; then + CUSTOM_CODE_VOL="-v $2:/wazuh-local-src:Z" + shift 2 + else + help 1 + fi + ;; + "--future") + FUTURE="yes" + shift 1 + ;; + "--is_stage") + IS_STAGE="yes" + shift 1 + ;; + "--src") + SRC="yes" + shift 1 + ;; + "--system") + SYSTEM="$2" + shift 2 + ;; + *) + help 1 + esac + done + + if [ -z "${CUSTOM_CODE_VOL}" ]; then + CUSTOM_CODE_VOL="-v $WAZUH_PATH:/wazuh-local-src:Z" + fi + + build && clean 0 + clean 1 +} + +main "$@" diff --git a/src/common/data_provider/include/data_provider.hpp b/packages/installers/win32/wazuh_installer.wxs similarity index 100% rename from src/common/data_provider/include/data_provider.hpp rename to packages/installers/win32/wazuh_installer.wxs diff --git a/packages/macos/entitlements.plist b/packages/macos/entitlements.plist new file mode 100644 index 0000000000..a9cc91fdd4 --- /dev/null +++ b/packages/macos/entitlements.plist @@ -0,0 +1,22 @@ + + + + + com.apple.security.automation.apple-events + + com.apple.security.personal-information.photos-library + + com.apple.security.personal-information.addressbook + + com.apple.security.files.user-selected.read-only + + com.apple.security.files.downloads.read-only + + com.apple.security.assets.pictures.read-only + + com.apple.security.assets.music.read-only + + com.apple.security.assets.movies.read-only + + + diff --git a/packages/macos/generate_wazuh_packages.sh b/packages/macos/generate_wazuh_packages.sh new file mode 100755 index 0000000000..b7445a8a0f --- /dev/null +++ b/packages/macos/generate_wazuh_packages.sh @@ -0,0 +1,453 @@ +#!/bin/bash +set -ex +# Program to build and package OSX wazuh-agent +# Wazuh package generator +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. + +export PATH=/usr/local/bin:/Applications/CMake.app/Contents/bin:/opt/homebrew/bin:/opt/homebrew/sbin:$PATH +CURRENT_PATH="$( cd $(dirname ${0}) ; pwd -P )" +ARCH="intel64" +WAZUH_SOURCE_REPOSITORY="https://github.com/wazuh/wazuh" +INSTALLATION_PATH="/Library/Ossec" # Installation path. +VERSION="" # Default VERSION (branch/tag). +REVISION="1" # Package revision. +BRANCH_TAG="" # Branch that will be downloaded to build package. +DESTINATION="${CURRENT_PATH}/output" # Where package will be stored. +JOBS="2" # Compilation jobs. +VERBOSE="no" # Enables the full log by using `set -exf`. +DEBUG="no" # Enables debug symbols while compiling. +CHECKSUM="no" # Enables the checksum generation. +IS_STAGE="no" # Enables release package naming. +MAKE_COMPILATION="yes" # Set whether or not to compile the code +CERT_APPLICATION_ID="" # Apple Developer ID certificate to sign Apps and binaries. +CERT_INSTALLER_ID="" # Apple Developer ID certificate to sign pkg. +KEYCHAIN="" # Keychain where the Apple Developer ID certificate is. +KC_PASS="" # Password of the keychain. +NOTARIZE="no" # Notarize the package for macOS Catalina. +DEVELOPER_ID="" # Apple Developer ID. +ALTOOL_PASS="" # Temporary Application password for altool. +TEAM_ID="" # Team ID of the Apple Developer ID. +pkg_name="" +notarization_path="" + +trap ctrl_c INT + +function clean_and_exit() { + exit_code=$1 + rm -rf "${SOURCES_DIRECTORY}" + if [ -z "$BRANCH_TAG" ]; then + make -C $WAZUH_PATH/src clean clean-deps + fi + ${CURRENT_PATH}/uninstall.sh + + exit ${exit_code} +} + +function ctrl_c() { + clean_and_exit 1 +} + + +function notarize_pkg() { + + # Notarize the macOS package + sleep_time="120" + build_timestamp="$(date +"%m%d%Y%H%M%S")" + if [ "${NOTARIZE}" = "yes" ]; then + + if sudo xcrun notarytool submit ${1} --apple-id "${DEVELOPER_ID}" --team-id "${TEAM_ID}" --password "${ALTOOL_PASS}" --wait ; then + echo "Package is notarized and ready to go." + echo "Adding the ticket to the package." + if xcrun stapler staple -v "${1}" ; then + echo "Ticket added. Ready to release the package." + mkdir -p "${DESTINATION}/" && cp "${1}" "${DESTINATION}/" + return 0 + else + echo "Something went wrong while adding the package." + clean_and_exit 1 + fi + else + echo "Error notarizing the package." + clean_and_exit 1 + fi + fi + + return 0 +} + +function sign_binaries() { + if [ ! -z "${KEYCHAIN}" ] && [ ! -z "${CERT_APPLICATION_ID}" ] ; then + security -v unlock-keychain -p "${KC_PASS}" "${KEYCHAIN}" > /dev/null + # Sign every single binary in Wazuh's installation. This also includes library files. + for bin in $(find ${INSTALLATION_PATH} -exec file {} \; | grep bit | cut -d: -f1); do + codesign -f --sign "${CERT_APPLICATION_ID}" --entitlements ${ENTITLEMENTS_PATH} --deep --timestamp --options=runtime --verbose=4 "${bin}" + done + security -v lock-keychain "${KEYCHAIN}" > /dev/null + fi +} + +function sign_pkg() { + if [ ! -z "${KEYCHAIN}" ] && [ ! -z "${CERT_INSTALLER_ID}" ] ; then + # Unlock the keychain to use the certificate + security -v unlock-keychain -p "${KC_PASS}" "${KEYCHAIN}" > /dev/null + + # Sign the package + productsign --sign "${CERT_INSTALLER_ID}" --timestamp ${DESTINATION}/${pkg_name} ${DESTINATION}/${pkg_name}.signed + mv ${DESTINATION}/${pkg_name}.signed ${DESTINATION}/${pkg_name} + + security -v lock-keychain "${KEYCHAIN}" > /dev/null + fi +} + +function get_pkgproj_specs() { + + VERSION="$1" + pkg_final_name="$2" + + pkg_file="${WAZUH_PACKAGES_PATH}/specs/wazuh_agent_${ARCH}.pkgproj" + + if [ ! -f "${pkg_file}" ]; then + echo "Warning: the file ${pkg_file} does not exists. Check the version selected." + exit 1 + else + echo "Modifiying ${pkg_file} to match revision." + sed -i -e "s:>.*${VERSION}-.*<:>${pkg_final_name}<:g" "${pkg_file}" + cp "${pkg_file}" "${AGENT_PKG_FILE}" + fi + + return 0 +} + +function build_package() { + + # Download source code + if [ -n "$BRANCH_TAG" ]; then + SOURCES_DIRECTORY="${CURRENT_PATH}/repository" + WAZUH_PATH="${SOURCES_DIRECTORY}/wazuh" + git clone --depth=1 -b ${BRANCH_TAG} ${WAZUH_SOURCE_REPOSITORY} "${WAZUH_PATH}" + else + WAZUH_PATH="${CURRENT_PATH}/../.." + fi + short_commit_hash="$(cd "${WAZUH_PATH}" && git rev-parse --short HEAD)" + + export CONFIG="${WAZUH_PATH}/etc/preloaded-vars.conf" + WAZUH_PACKAGES_PATH="${WAZUH_PATH}/packages/macos" + AGENT_PKG_FILE="${WAZUH_PACKAGES_PATH}/package_files/wazuh_agent_${ARCH}.pkgproj" + ENTITLEMENTS_PATH="${WAZUH_PACKAGES_PATH}/entitlements.plist" + + VERSION=$(cat ${WAZUH_PATH}/src/VERSION | cut -d "-" -f1 | cut -c 2-) + + # Define output package name + if [ $IS_STAGE == "no" ]; then + pkg_name="wazuh-agent_${VERSION}-${REVISION}_${ARCH}_${short_commit_hash}" + else + pkg_name="wazuh-agent-${VERSION}-${REVISION}.${ARCH}" + fi + + get_pkgproj_specs $VERSION $pkg_name + + if [ -d "${INSTALLATION_PATH}" ]; then + + echo "\nThe wazuh agent is already installed on this machine." + echo "Removing it from the system." + + ${CURRENT_PATH}/uninstall.sh + fi + + ${WAZUH_PACKAGES_PATH}/package_files/build.sh "${INSTALLATION_PATH}" "${WAZUH_PATH}" ${JOBS} ${DEBUG} ${MAKE_COMPILATION} + + # sign the binaries and the libraries + sign_binaries + + # create package + if packagesbuild ${AGENT_PKG_FILE} --build-folder "${DESTINATION}/" ; then + echo "The wazuh agent package for macOS has been successfully built." + pkg_name+=".pkg" + sign_pkg + if [[ "${CHECKSUM}" == "yes" ]]; then + shasum -a512 "${DESTINATION}/${pkg_name}" > "${DESTINATION}/${pkg_name}.sha512" + fi + clean_and_exit 0 + else + echo "ERROR: something went wrong while building the package." + clean_and_exit 1 + fi +} + +function help() { + set +x + echo "Usage: $0 [OPTIONS]" + echo + echo " Build options:" + echo " -a, --architecture [Optional] Target architecture of the package [intel64/arm64]. By Default: intel64." + echo " -b, --branch [Optional] Select Git branch [${BRANCH}]." + echo " -s, --store-path [Optional] Set the destination absolute path of package." + echo " -j, --jobs [Optional] Number of parallel jobs when compiling." + echo " -r, --revision [Optional] Package revision that append to version e.g. x.x.x-rev" + echo " -d, --debug [Optional] Build the binaries with debug symbols. By default: no." + echo " -c, --checksum [Optional] Generate checksum on the desired path (by default, if no path is specified it will be generated on the same directory than the package)." + echo " --is_stage [Optional] Use release name in package" + echo " -nc, --not-compile [Optional] Set whether or not to compile the code." + echo " -h, --help [ Util ] Show this help." + echo " -i, --install-deps [ Util ] Install build dependencies (Packages)." + echo " -x, --install-xcode [ Util ] Install X-Code and brew. Can't be executed as root." + echo " -v, --verbose [ Util ] Show additional information during the package generation." + echo " Signing options:" + echo " --keychain [Optional] Keychain where the Certificates are installed." + echo " --keychain-password [Optional] Password of the keychain." + echo " --application-certificate [Optional] Apple Developer ID certificate name to sign Apps and binaries." + echo " --installer-certificate [Optional] Apple Developer ID certificate name to sign pkg." + echo " --notarize [Optional] Notarize the package for its distribution on macOS." + echo " --notarize-path [Optional] Path of the package to be notarized." + echo " --developer-id [Optional] Your Apple Developer ID." + echo " --team-id [Optional] Your Apple Team ID." + echo " --altool-password [Optional] Temporary password to use altool from Xcode." + echo + exit "$1" +} + + + +function testdep() { + + if command -v packagesbuild ; then + return 0 + else + echo "Error: packagesbuild not found. Download and install dependencies." + echo "Use $0 -i for install it." + exit 1 + fi +} + +function install_deps() { + + # Install packagesbuild tool + curl -O http://s.sudre.free.fr/Software/files/Packages.dmg + + hdiutil attach Packages.dmg + + cd /Volumes/Packages* + + if sudo installer -package *Packages.pkg -target / ; then + echo "Packagesbuild was correctly installed." + else + echo "Something went wrong installing packagesbuild." + fi + + echo "Installing build dependencies for $(uname -m) architecture." + if [ "$(uname -m)" = "arm64" ]; then + brew install gcc binutils autoconf automake libtool cmake + else + brew install cmake + fi + exit 0 +} + +function install_xcode() { + + # Install brew tool. Brew will install X-Code if it is not already installed in the host. + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" + + exit 0 +} + +function check_root() { + + if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root" + echo + exit 1 + fi +} + +function main() { + + BUILD="yes" + while [ -n "$1" ] + do + case "$1" in + "-a"|"--architecture") + if [ -n "$2" ]; then + ARCH="$2" + shift 2 + else + help 1 + fi + ;; + "-b"|"--branch") + if [ -n "$2" ]; then + BRANCH_TAG="$2" + shift 2 + else + help 1 + fi + ;; + "-s"|"--store-path") + if [ -n "$2" ]; then + DESTINATION="$2" + shift 2 + else + help 1 + fi + ;; + "-j"|"--jobs") + if [ -n "$2" ]; then + JOBS="$2" + shift 2 + else + help 1 + fi + ;; + "-r"|"--revision") + if [ -n "$2" ]; then + REVISION="$2" + shift 2 + else + help 1 + fi + ;; + "-h"|"--help") + help 0 + ;; + "-i"|"--install-deps") + install_deps + ;; + "-x"|"--install-xcode") + install_xcode + ;; + "-v"|"--verbose") + VERBOSE="yes" + shift 1 + ;; + "-d"|"--debug") + DEBUG="yes" + shift 1 + ;; + "-c"|"--checksum") + CHECKSUM="yes" + shift 1 + ;; + "--is_stage") + IS_STAGE="yes" + shift 1 + ;; + "-nc"|"--not-compile") + MAKE_COMPILATION="no" + shift 1 + ;; + "--keychain") + if [ -n "$2" ]; then + KEYCHAIN="$2" + shift 2 + else + help 1 + fi + ;; + "--keychain-password") + if [ -n "$2" ]; then + KC_PASS="$2" + shift 2 + else + help 1 + fi + ;; + "--application-certificate") + if [ -n "$2" ]; then + CERT_APPLICATION_ID="$2" + shift 2 + else + help 1 + fi + ;; + "--installer-certificate") + if [ -n "$2" ]; then + CERT_INSTALLER_ID="$2" + shift 2 + else + help 1 + fi + ;; + "--notarize") + NOTARIZE="yes" + shift 1 + ;; + "--notarize-path") + if [ -n "$2" ]; then + notarization_path="$2" + shift 2 + else + help 1 + fi + ;; + "--developer-id") + if [ -n "$2" ]; then + DEVELOPER_ID="$2" + shift 2 + else + help 1 + fi + ;; + "--team-id") + if [ -n "$2" ]; then + TEAM_ID="$2" + shift 2 + else + help 1 + fi + ;; + "--altool-password") + if [ -n "$2" ]; then + ALTOOL_PASS="$2" + shift 2 + else + help 1 + fi + ;; + *) + help 1 + esac + done + + if [ ${VERBOSE} = "yes" ]; then + set -exf + fi + + testdep + + if [ "${ARCH}" != "intel64" ] && [ "${ARCH}" != "arm64" ]; then + echo "Error: architecture not supported." + echo "Supported architectures: intel64, arm64" + exit 1 + fi + + if [[ "${BUILD}" != "no" ]]; then + check_root + build_package + "${CURRENT_PATH}/uninstall.sh" + fi + + if [ "${NOTARIZE}" = "yes" ]; then + if [ "${BUILD}" = "yes" ]; then + notarization_path="${DESTINATION}/${pkg_name}" + fi + if [ -z "${notarization_path}" ]; then + echo "The path of the package to be notarized has not been specified." + help 1 + fi + notarize_pkg "${notarization_path}" + fi + + if [ "${BUILD}" = "no" ] && [ "${NOTARIZE}" = "no" ]; then + echo "The branch has not been specified and notarization has not been selected." + help 1 + fi + + return 0 +} + +main "$@" diff --git a/packages/macos/package_files/build.sh b/packages/macos/package_files/build.sh new file mode 100755 index 0000000000..1a910fe316 --- /dev/null +++ b/packages/macos/package_files/build.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# Program to build OSX wazuh-agent +# Wazuh package generator +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. +set -exf +DESTINATION_PATH=$1 +SOURCES_PATH=$2 +BUILD_JOBS=$3 +DEBUG=$4 +MAKE_COMPILATION=$5 +INSTALLATION_SCRIPTS_DIR=${DESTINATION_PATH}/packages_files/agent_installation_scripts + +function configure() { + echo USER_LANGUAGE="en" > ${CONFIG} + echo USER_NO_STOP="y" >> ${CONFIG} + echo USER_INSTALL_TYPE="agent" >> ${CONFIG} + echo USER_DIR="${DESTINATION_PATH}" >> ${CONFIG} + echo USER_DELETE_DIR="y" >> ${CONFIG} + echo USER_CLEANINSTALL="y" >> ${CONFIG} + echo USER_BINARYINSTALL="y" >> ${CONFIG} + echo USER_AGENT_SERVER_IP="MANAGER_IP" >> ${CONFIG} + echo USER_ENABLE_SYSCHECK="y" >> ${CONFIG} + echo USER_ENABLE_ROOTCHECK="y" >> ${CONFIG} + echo USER_ENABLE_OPENSCAP="n" >> ${CONFIG} + echo USER_ENABLE_CISCAT="n" >> ${CONFIG} + echo USER_ENABLE_ACTIVE_RESPONSE="y" >> ${CONFIG} + echo USER_CA_STORE="n" >> ${CONFIG} +} + +function build() { + + configure + + if [ "${MAKE_COMPILATION}" == "yes" ]; then + make -C ${SOURCES_PATH}/src deps TARGET=agent + + echo "Generating Wazuh executables" + make -j $BUILD_JOBS -C ${SOURCES_PATH}/src DYLD_FORCE_FLAT_NAMESPACE=1 DEBUG=$DEBUG TARGET=agent build + fi + + echo "Running install script" + ${SOURCES_PATH}/install.sh + + find ${DESTINATION_PATH}/ruleset/sca/ -type f -exec rm -f {} \; + + # Add the auxiliar script used while installing the package + mkdir -p ${INSTALLATION_SCRIPTS_DIR}/ + cp ${SOURCES_PATH}/gen_ossec.sh ${INSTALLATION_SCRIPTS_DIR}/ + cp ${SOURCES_PATH}/add_localfiles.sh ${INSTALLATION_SCRIPTS_DIR}/ + + mkdir -p ${INSTALLATION_SCRIPTS_DIR}/src/init + mkdir -p ${INSTALLATION_SCRIPTS_DIR}/etc/templates/config/{generic,darwin} + + cp -r ${SOURCES_PATH}/etc/templates/config/generic ${INSTALLATION_SCRIPTS_DIR}/etc/templates/config + cp -r ${SOURCES_PATH}/etc/templates/config/darwin ${INSTALLATION_SCRIPTS_DIR}/etc/templates/config + + find ${SOURCES_PATH}/src/init/ -name *.sh -type f -exec install -m 0640 {} ${INSTALLATION_SCRIPTS_DIR}/src/init \; + + mkdir -p ${INSTALLATION_SCRIPTS_DIR}/sca/generic + mkdir -p ${INSTALLATION_SCRIPTS_DIR}/sca/darwin/{15,16,17,18,20,21,22,23} + + cp -r ${SOURCES_PATH}/ruleset/sca/darwin ${INSTALLATION_SCRIPTS_DIR}/sca + cp -r ${SOURCES_PATH}/ruleset/sca/generic ${INSTALLATION_SCRIPTS_DIR}/sca + cp ${SOURCES_PATH}/etc/templates/config/generic/sca.files ${INSTALLATION_SCRIPTS_DIR}/sca/generic/ + + for n in $(seq 15 23); do + cp ${SOURCES_PATH}/etc/templates/config/darwin/$n/sca.files ${INSTALLATION_SCRIPTS_DIR}/sca/darwin/$n/ + done + + cp ${SOURCES_PATH}/src/VERSION ${INSTALLATION_SCRIPTS_DIR}/src/ + cp ${SOURCES_PATH}/src/REVISION ${INSTALLATION_SCRIPTS_DIR}/src/ +} + +build diff --git a/packages/macos/package_files/introduction.txt b/packages/macos/package_files/introduction.txt new file mode 100644 index 0000000000..c854daab99 --- /dev/null +++ b/packages/macos/package_files/introduction.txt @@ -0,0 +1,9 @@ +Welcome to the Wazuh Agent Installer. + +Wazuh is a free, open-source and enterprise-ready security monitoring solution for threat detection, integrity monitoring, incident response and compliance. + +This package will install the Wazuh agent in your system. + +Check out our documentation to learn more about Wazuh, and join our community where our team and other users can help you. + +To continue, click Next. diff --git a/packages/macos/package_files/postinstall.sh b/packages/macos/package_files/postinstall.sh new file mode 100755 index 0000000000..e19f92c76f --- /dev/null +++ b/packages/macos/package_files/postinstall.sh @@ -0,0 +1,186 @@ +#! /bin/bash +# By Spransy, Derek" and Charlie Scott +# Modified by Santiago Bassett (http://www.wazuh.com) - Feb 2016 +# alterations by bil hays 2013 +# -Switched to bash +# -Added some sanity checks +# -Added routine to find the first 3 contiguous UIDs above 100, +# starting at 600 puts this in user space +# -Added lines to append the ossec users to the group ossec +# so the the list GroupMembership works properly +GROUP="wazuh" +USER="wazuh" +DIR="/Library/Ossec" +INSTALLATION_SCRIPTS_DIR="${DIR}/packages_files/agent_installation_scripts" +SCA_BASE_DIR="${INSTALLATION_SCRIPTS_DIR}/sca" + +if [ -f "${DIR}/WAZUH_PKG_UPGRADE" ]; then + upgrade="true" +fi + +if [ -f "${DIR}/WAZUH_PKG_UPGRADE" ]; then + rm -f ${DIR}/WAZUH_PKG_UPGRADE +fi + +if [ -f "${DIR}/WAZUH_RESTART" ]; then + restart="true" +fi + +if [ -f "${DIR}/WAZUH_RESTART" ]; then + rm -f ${DIR}/WAZUH_RESTART +fi + +if [ -n "${upgrade}" ]; then + echo "Restoring configuration files from ${DIR}/config_files/ to ${DIR}/etc/" + rm -rf ${DIR}/etc/{ossec.conf,client.keys,local_internal_options.conf,shared} + cp -rf ${DIR}/config_files/{ossec.conf,client.keys,local_internal_options.conf,shared} ${DIR}/etc/ + rm -rf ${DIR}/config_files/ +fi + +# Default for all directories +echo "Seting permissions and ownership for directories and files" +chmod -R 750 ${DIR}/ +chown -R root:${GROUP} ${DIR}/ + +chown -R root:wheel ${DIR}/bin +chown -R root:wheel ${DIR}/lib + +# To the ossec queue (default for agentd to read) +chown -R ${USER}:${GROUP} ${DIR}/queue/{alerts,diff,sockets,rids} + +chmod -R 770 ${DIR}/queue/{alerts,sockets} +chmod -R 750 ${DIR}/queue/{diff,sockets,rids} + +# For the logging user +chmod 770 ${DIR}/logs +chown -R ${USER}:${GROUP} ${DIR}/logs +find ${DIR}/logs/ -type d -exec chmod 750 {} \; +find ${DIR}/logs/ -type f -exec chmod 660 {} \; + +chown -R root:${GROUP} ${DIR}/tmp +chmod 1750 ${DIR}/tmp + +chmod 770 ${DIR}/etc +chown ${USER}:${GROUP} ${DIR}/etc +chmod 640 ${DIR}/etc/internal_options.conf +chown root:${GROUP} ${DIR}/etc/internal_options.conf +chmod 640 ${DIR}/etc/local_internal_options.conf +chown root:${GROUP} ${DIR}/etc/local_internal_options.conf +chmod 640 ${DIR}/etc/client.keys +chown root:${GROUP} ${DIR}/etc/client.keys +chmod 640 ${DIR}/etc/localtime +chmod 770 ${DIR}/etc/shared # ossec must be able to write to it +chown -R root:${GROUP} ${DIR}/etc/shared +find ${DIR}/etc/shared/ -type f -exec chmod 660 {} \; +chown root:${GROUP} ${DIR}/etc/ossec.conf +chmod 660 ${DIR}/etc/ossec.conf +chown root:${GROUP} ${DIR}/etc/wpk_root.pem +chmod 640 ${DIR}/etc/wpk_root.pem + + +chmod 770 ${DIR}/.ssh + +# For the /var/run +chmod -R 770 ${DIR}/var +chown -R root:${GROUP} ${DIR}/var + +# Check if the distribution detection script exists +if [ -f "${INSTALLATION_SCRIPTS_DIR}/src/init/dist-detect.sh" ]; then + echo "Running the dist-detect.sh script..." + . "${INSTALLATION_SCRIPTS_DIR}/src/init/dist-detect.sh" +else + echo "Error: dist-detect.sh script not found." +fi + +if [ -z "${upgrade}" ]; then + echo "Generating Wazuh configuration for a fresh installation." + + if [ -f "${INSTALLATION_SCRIPTS_DIR}/gen_ossec.sh" ]; then + ${INSTALLATION_SCRIPTS_DIR}/gen_ossec.sh conf agent ${DIST_NAME} ${DIST_VER}.${DIST_SUBVER} ${DIR} > ${DIR}/etc/ossec.conf + chown root:wazuh ${DIR}/etc/ossec.conf + chmod 0640 ${DIR}/etc/ossec.conf + else + echo "Error: ${INSTALLATION_SCRIPTS_DIR}/gen_ossec.sh script not found." + fi +fi + +SCA_DIR="${DIST_NAME}/${DIST_VER}" +mkdir -p ${DIR}/ruleset/sca + +SCA_TMP_DIR="${SCA_BASE_DIR}/${SCA_DIR}" + +# Install the configuration files needed for this hosts +echo "Installing SCA configuration files..." +if [ -r "${SCA_BASE_DIR}/${DIST_NAME}/${DIST_VER}/${DIST_SUBVER}/sca.files" ]; then + SCA_TMP_DIR="${SCA_BASE_DIR}/${DIST_NAME}/${DIST_VER}/${DIST_SUBVER}" +elif [ -r "${SCA_BASE_DIR}/${DIST_NAME}/${DIST_VER}/sca.files" ]; then + SCA_TMP_DIR="${SCA_BASE_DIR}/${DIST_NAME}/${DIST_VER}" +elif [ -r "${SCA_BASE_DIR}/${DIST_NAME}/sca.files" ]; then + SCA_TMP_DIR="${SCA_BASE_DIR}/${DIST_NAME}" +else + SCA_TMP_DIR="${SCA_BASE_DIR}/generic" +fi + +SCA_TMP_FILE="${SCA_TMP_DIR}/sca.files" + +if [ -r ${SCA_TMP_FILE} ]; then + + rm -f ${DIR}/ruleset/sca/* || true + + for sca_file in $(cat ${SCA_TMP_FILE}); do + mv ${SCA_BASE_DIR}/${sca_file} ${DIR}/ruleset/sca + done +fi + +# Register and configure agent if Wazuh environment variables are defined +if [ -z "${upgrade}" ]; then + echo "Running the register_configure_agent.sh script..." + if [ -f "${INSTALLATION_SCRIPTS_DIR}/src/init/register_configure_agent.sh" ]; then + ${INSTALLATION_SCRIPTS_DIR}/src/init/register_configure_agent.sh ${DIR} > /dev/null || : + else + echo "Error: ${INSTALLATION_SCRIPTS_DIR}/src/init/register_configure_agent.sh script not found." + fi +fi + +# Remove backup file created in register_configure_agent step +if [ -e ${DIR}/etc/ossec.confre ]; then + rm -f ${DIR}/etc/ossec.confre || true +fi + +# Install the service +echo "Running the darwin-init.sh script..." +if [ -f "${INSTALLATION_SCRIPTS_DIR}/src/init/darwin-init.sh" ]; then + ${INSTALLATION_SCRIPTS_DIR}/src/init/darwin-init.sh ${DIR} +else + echo "Error: ${INSTALLATION_SCRIPTS_DIR}/src/init/darwin-init.sh script not found." +fi + +# Remove temporary directory +echo "Removing temporary files..." +rm -rf ${DIR}/packages_files + +# Remove old ossec user and group if exists and change ownwership of files + +if [[ $(dscl . -read /Groups/ossec) ]]; then + echo "Changing group from Ossec to Wazuh" + find ${DIR}/ -group ossec -user root -exec chown root:wazuh {} \ > /dev/null 2>&1 || true + if [[ $(dscl . -read /Users/ossec) ]]; then + echo "Changing user from Ossec to Wazuh" + find ${DIR}/ -group ossec -user ossec -exec chown wazuh:wazuh {} \ > /dev/null 2>&1 || true + echo "Removing Ossec user" + sudo /usr/bin/dscl . -delete "/Users/ossec" + fi + echo "Removing Ossec group" + sudo /usr/bin/dscl . -delete "/Groups/ossec" +fi + +# Remove 4.1.5 patch +if [ -f ${DIR}/queue/alerts/sockets ]; then + echo "Removing 4.1.5 patch file socket" + rm ${DIR}/queue/alerts/sockets +fi + +if [ -n "${upgrade}" ] && [ -n "${restart}" ]; then + echo "Restarting Wazuh..." + ${DIR}/bin/wazuh-control restart +fi diff --git a/packages/macos/package_files/preinstall.sh b/packages/macos/package_files/preinstall.sh new file mode 100755 index 0000000000..aaaaa1e77c --- /dev/null +++ b/packages/macos/package_files/preinstall.sh @@ -0,0 +1,158 @@ +#! /bin/bash +# By Spransy, Derek" and Charlie Scott +# Modified by Wazuh, Inc. . +# This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + +##### +# This checks for an error and exits with a custom message +# Returns zero on success +# $1 is the message +# $2 is the error code + +DIR="/Library/Ossec" + +if [ -d "${DIR}" ]; then + echo "A Wazuh agent installation was found in ${DIR}. Will perform an upgrade." + + if [ -f "${DIR}/WAZUH_PKG_UPGRADE" ]; then + rm -f "${DIR}/WAZUH_PKG_UPGRADE" + fi + if [ -f "${DIR}/WAZUH_RESTART" ]; then + rm -f "${DIR}/WAZUH_RESTART" + fi + + touch "${DIR}/WAZUH_PKG_UPGRADE" + upgrade="true" + + if ${DIR}/bin/wazuh-control status | grep "is running" > /dev/null 2>&1; then + touch "${DIR}/WAZUH_RESTART" + restart="true" + elif ${DIR}/bin/ossec-control status | grep "is running" > /dev/null 2>&1; then + touch "${DIR}/WAZUH_RESTART" + restart="true" + fi +fi + +# Stops the agent before upgrading it +echo "Stopping the agent before upgrading it." + +if [ -f ${DIR}/bin/wazuh-control ]; then + ${DIR}/bin/wazuh-control stop +elif [ -f ${DIR}/bin/ossec-control ]; then + ${DIR}/bin/ossec-control stop +fi + +if [ -n "${upgrade}" ]; then + echo "Backing up configuration files to ${DIR}/config_files/" + mkdir -p ${DIR}/config_files/ + cp -r ${DIR}/etc/{ossec.conf,client.keys,local_internal_options.conf,shared} ${DIR}/config_files/ + + if [ -d ${DIR}/logs/ossec ]; then + echo "Renaming ${DIR}/logs/ossec to ${DIR}/logs/wazuh" + mv ${DIR}/logs/ossec ${DIR}/logs/wazuh + fi + + if [ -d ${DIR}/queue/ossec ]; then + echo "Renaming ${DIR}/queue/ossec to ${DIR}/queue/sockets" + mv ${DIR}/queue/ossec ${DIR}/queue/sockets + fi +fi + +if [ -n "${upgrade}" ]; then + if pkgutil --pkgs | grep -i wazuh-agent-etc > /dev/null 2>&1 ; then + echo "Removing previous package receipt for wazuh-agent-etc" + pkgutil --forget com.wazuh.pkg.wazuh-agent-etc + fi +fi + +if [[ ! -f "/usr/bin/dscl" ]] + then + echo "Error: I couldn't find dscl, dying here"; + exit +fi + +DSCL="/usr/bin/dscl"; + +function check_errm +{ + if [[ ${?} != "0" ]] + then + echo "${1}"; + exit ${2}; + fi +} + +# get unique id numbers (uid, gid) that are greater than 100 +echo "Getting unique id numbers (uid, gid)" +unset -v i new_uid new_gid idvar; +declare -i new_uid=0 new_gid=0 i=100 idvar=0; +while [[ $idvar -eq 0 ]]; do + i=$[i+1] + if [[ -z "$(/usr/bin/dscl . -search /Users uid ${i})" ]] && [[ -z "$(/usr/bin/dscl . -search /Groups gid ${i})" ]]; + then + echo "Found available UID and GID: $i" + new_uid=$i + new_gid=$i + idvar=1 + #break + fi +done + +echo "UID available for wazuh user is:"; +echo ${new_uid} + +# Verify that the uid and gid exist and match +if [[ $new_uid -eq 0 ]] || [[ $new_gid -eq 0 ]]; + then + echo "Getting unique id numbers (uid, gid) failed!"; + exit 1; +fi +if [[ ${new_uid} != ${new_gid} ]] + then + echo "I failed to find matching free uid and gid!"; + exit 5; +fi + +# Stops the agent before upgrading it +if [ -f ${DIR}/bin/wazuh-control ]; then + ${DIR}/bin/wazuh-control stop +elif [ -f ${DIR}/bin/ossec-control ]; then + ${DIR}/bin/ossec-control stop +fi + +# Creating the group +echo "Checking group..." +if [[ $(dscl . -read /Groups/wazuh) ]] + then + echo "wazuh group already exists."; +else + sudo ${DSCL} localhost -create /Local/Default/Groups/wazuh + check_errm "Error creating group wazuh" "67" + sudo ${DSCL} localhost -createprop /Local/Default/Groups/wazuh PrimaryGroupID ${new_gid} + sudo ${DSCL} localhost -createprop /Local/Default/Groups/wazuh RealName wazuh + sudo ${DSCL} localhost -createprop /Local/Default/Groups/wazuh RecordName wazuh + sudo ${DSCL} localhost -createprop /Local/Default/Groups/wazuh RecordType: dsRecTypeStandard:Groups + sudo ${DSCL} localhost -createprop /Local/Default/Groups/wazuh Password "*" +fi + +# Creating the user +echo "Checking user..." +if [[ $(dscl . -read /Users/wazuh) ]] + then + echo "wazuh user already exists."; +else + sudo ${DSCL} localhost -create /Local/Default/Users/wazuh + check_errm "Error creating user wazuh" "77" + sudo ${DSCL} localhost -createprop /Local/Default/Users/wazuh RecordName wazuh + sudo ${DSCL} localhost -createprop /Local/Default/Users/wazuh RealName wazuh + sudo ${DSCL} localhost -createprop /Local/Default/Users/wazuh UserShell /usr/bin/false + sudo ${DSCL} localhost -createprop /Local/Default/Users/wazuh NFSHomeDirectory /var/wazuh + sudo ${DSCL} localhost -createprop /Local/Default/Users/wazuh UniqueID ${new_uid} + sudo ${DSCL} localhost -createprop /Local/Default/Users/wazuh PrimaryGroupID ${new_gid} + sudo ${DSCL} localhost -append /Local/Default/Groups/wazuh GroupMembership wazuh + sudo ${DSCL} localhost -createprop /Local/Default/Users/wazuh Password "*" +fi + +#Hide the fixed users +echo "Hiding the fixed wazuh user" +dscl . create /Users/wazuh IsHidden 1 \ No newline at end of file diff --git a/packages/macos/specs/wazuh_agent_arm64.pkgproj b/packages/macos/specs/wazuh_agent_arm64.pkgproj new file mode 100644 index 0000000000..9c463b1a19 --- /dev/null +++ b/packages/macos/specs/wazuh_agent_arm64.pkgproj @@ -0,0 +1,1255 @@ + + + + + PACKAGES + + + MUST-CLOSE-APPLICATION-ITEMS + + MUST-CLOSE-APPLICATIONS + + PACKAGE_FILES + + DEFAULT_INSTALL_LOCATION + / + HIERARCHY + + CHILDREN + + + CHILDREN + + GID + 80 + PATH + Applications + PATH_TYPE + 0 + PERMISSIONS + 509 + TYPE + 1 + UID + 0 + + + CHILDREN + + + CHILDREN + + GID + 80 + PATH + Application Support + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Automator + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Documentation + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Extensions + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Filesystems + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Frameworks + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Input Methods + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Internet Plug-Ins + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + LaunchAgents + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + LaunchDaemons + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/.ssh + PATH_TYPE + 0 + PERMISSIONS + 448 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/active-response + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/agentless + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/bin + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/internal_options.conf + PATH_TYPE + 0 + PERMISSIONS + 416 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/localtime + PATH_TYPE + 0 + PERMISSIONS + 416 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/client.keys + PATH_TYPE + 0 + PERMISSIONS + 416 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/local_internal_options.conf + PATH_TYPE + 0 + PERMISSIONS + 416 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/ossec.conf + PATH_TYPE + 0 + PERMISSIONS + 416 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/shared + PATH_TYPE + 0 + PERMISSIONS + 504 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/wpk_root.pem + PATH_TYPE + 0 + PERMISSIONS + 416 + TYPE + 3 + UID + 0 + + + EXPANDED + + GID + 0 + PATH + /Library/Ossec/etc + PATH_TYPE + 0 + PERMISSIONS + 504 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/lib + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/logs + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/queue + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/tmp + PATH_TYPE + 0 + PERMISSIONS + 1000 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/packages_files + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/var + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/wodles + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/ruleset + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + EXPANDED + + GID + 0 + PATH + /Library/Ossec + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + PreferencePanes + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Preferences + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 80 + PATH + Printers + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + PrivilegedHelperTools + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + QuickLook + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + QuickTime + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Screen Savers + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Scripts + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Services + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Widgets + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + GID + 0 + PATH + Library + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + + CHILDREN + + GID + 0 + PATH + Shared + PATH_TYPE + 0 + PERMISSIONS + 1023 + TYPE + 1 + UID + 0 + + + GID + 80 + PATH + Users + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + GID + 0 + PATH + / + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + PAYLOAD_TYPE + 0 + SHOW_INVISIBLE + + SPLIT_FORKS + + TREAT_MISSING_FILES_AS_WARNING + + VERSION + 4 + + PACKAGE_SCRIPTS + + POSTINSTALL_PATH + + PATH + postinstall.sh + PATH_TYPE + 1 + + PREINSTALL_PATH + + PATH + preinstall.sh + PATH_TYPE + 1 + + RESOURCES + + + PACKAGE_SETTINGS + + AUTHENTICATION + 1 + CONCLUSION_ACTION + 0 + FOLLOW_SYMBOLIC_LINKS + + IDENTIFIER + com.wazuh.pkg.wazuh-agent + LOCATION + 0 + NAME + agent + OVERWRITE_PERMISSIONS + + PAYLOAD_SIZE + -1 + RELOCATABLE + + USE_HFS+_COMPRESSION + + VERSION + 4.9.0-1 + + TYPE + 0 + UUID + 7BC88EDC-74AB-498A-992B-DE940686D898 + + + PROJECT + + PROJECT_COMMENTS + + NOTES + + PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBIVE1M + IDQuMDEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvVFIvaHRtbDQv + c3RyaWN0LmR0ZCI+CjxodG1sPgo8aGVhZD4KPG1ldGEgaHR0cC1l + cXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7 + IGNoYXJzZXQ9VVRGLTgiPgo8bWV0YSBodHRwLWVxdWl2PSJDb250 + ZW50LVN0eWxlLVR5cGUiIGNvbnRlbnQ9InRleHQvY3NzIj4KPHRp + dGxlPjwvdGl0bGU+CjxtZXRhIG5hbWU9IkdlbmVyYXRvciIgY29u + dGVudD0iQ29jb2EgSFRNTCBXcml0ZXIiPgo8bWV0YSBuYW1lPSJD + b2NvYVZlcnNpb24iIGNvbnRlbnQ9IjE1MDQuODMiPgo8c3R5bGUg + dHlwZT0idGV4dC9jc3MiPgo8L3N0eWxlPgo8L2hlYWQ+Cjxib2R5 + Pgo8L2JvZHk+CjwvaHRtbD4K + + + PROJECT_PRESENTATION + + BACKGROUND + + INSTALLATION TYPE + + HIERARCHIES + + INSTALLER + + LIST + + + DESCRIPTION + + OPTIONS + + HIDDEN + + STATE + 0 + + PACKAGE_UUID + 7BC88EDC-74AB-498A-992B-DE940686D898 + REQUIREMENTS + + TITLE + + + LANGUAGE + English + VALUE + Wazuh Agent + + + TOOLTIP + + TYPE + 0 + UUID + B5127C49-7EF4-4B73-97D7-2819981073A4 + + + REMOVED + + + + MODE + 0 + + INSTALLATION_STEPS + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewIntroductionController + INSTALLER_PLUGIN + Introduction + LIST_TITLE_KEY + InstallerSectionTitle + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewReadMeController + INSTALLER_PLUGIN + ReadMe + LIST_TITLE_KEY + InstallerSectionTitle + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewLicenseController + INSTALLER_PLUGIN + License + LIST_TITLE_KEY + InstallerSectionTitle + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewDestinationSelectController + INSTALLER_PLUGIN + TargetSelect + LIST_TITLE_KEY + InstallerSectionTitle + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewInstallationTypeController + INSTALLER_PLUGIN + PackageSelection + LIST_TITLE_KEY + InstallerSectionTitle + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewInstallationController + INSTALLER_PLUGIN + Install + LIST_TITLE_KEY + InstallerSectionTitle + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewSummaryController + INSTALLER_PLUGIN + Summary + LIST_TITLE_KEY + InstallerSectionTitle + + + INTRODUCTION + + LOCALIZATIONS + + + LANGUAGE + English + VALUE + + PATH + introduction.txt + PATH_TYPE + 1 + + + + + LICENSE + + LOCALIZATIONS + + MODE + 0 + + README + + LOCALIZATIONS + + + TITLE + + LOCALIZATIONS + + + LANGUAGE + English + VALUE + Wazuh Agent + + + + + PROJECT_REQUIREMENTS + + LIST + + + BEHAVIOR + 3 + DICTIONARY + + IC_REQUIREMENT_CPU_ARCHITECTURE_FAMILY + 3 + IC_REQUIREMENT_CPU_INTEL_ARCHITECTURE_TYPE + 0 + IC_REQUIREMENT_CPU_MINIMUM_CPU_CORES_COUNT + 1 + IC_REQUIREMENT_CPU_MINIMUM_FREQUENCY + 866666 + IC_REQUIREMENT_CPU_POWERPC_ARCHITECTURE_TYPE + 0 + + IC_REQUIREMENT_CHECK_TYPE + 0 + IDENTIFIER + fr.whitebox.Packages.requirement.cpu + MESSAGE + + + LANGUAGE + English + SECONDARY_VALUE + + VALUE + This installer has been built for Apple Silicon architecture. It won't install in other platforms. + + + + NAME + Processor + STATE + + + + BEHAVIOR + 3 + DICTIONARY + + IC_REQUIREMENT_OS_DISK_TYPE + 0 + IC_REQUIREMENT_OS_DISTRIBUTION_TYPE + 0 + IC_REQUIREMENT_OS_MINIMUM_VERSION + 100800 + + IC_REQUIREMENT_CHECK_TYPE + 1 + IDENTIFIER + fr.whitebox.Packages.requirement.os + MESSAGE + + NAME + Operating System + STATE + + + + RESOURCES + + ROOT_VOLUME_ONLY + + + PROJECT_SETTINGS + + BUILD_FORMAT + 0 + BUILD_PATH + + PATH + build + PATH_TYPE + 1 + + EXCLUDED_FILES + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + .DS_Store + TYPE + 0 + + + PROTECTED + + PROXY_NAME + Remove .DS_Store files + PROXY_TOOLTIP + Remove ".DS_Store" files created by the Finder. + STATE + + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + .pbdevelopment + TYPE + 0 + + + PROTECTED + + PROXY_NAME + Remove .pbdevelopment files + PROXY_TOOLTIP + Remove ".pbdevelopment" files created by ProjectBuilder or Xcode. + STATE + + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + CVS + TYPE + 1 + + + REGULAR_EXPRESSION + + STRING + .cvsignore + TYPE + 0 + + + REGULAR_EXPRESSION + + STRING + .cvspass + TYPE + 0 + + + REGULAR_EXPRESSION + + STRING + .svn + TYPE + 1 + + + REGULAR_EXPRESSION + + STRING + .git + TYPE + 1 + + + REGULAR_EXPRESSION + + STRING + .gitignore + TYPE + 0 + + + PROTECTED + + PROXY_NAME + Remove SCM metadata + PROXY_TOOLTIP + Remove helper files and folders used by the CVS, SVN or Git Source Code Management systems. + STATE + + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + classes.nib + TYPE + 0 + + + REGULAR_EXPRESSION + + STRING + designable.db + TYPE + 0 + + + REGULAR_EXPRESSION + + STRING + info.nib + TYPE + 0 + + + PROTECTED + + PROXY_NAME + Optimize nib files + PROXY_TOOLTIP + Remove "classes.nib", "info.nib" and "designable.nib" files within .nib bundles. + STATE + + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + Resources Disabled + TYPE + 1 + + + PROTECTED + + PROXY_NAME + Remove Resources Disabled folders + PROXY_TOOLTIP + Remove "Resources Disabled" folders. + STATE + + + + SEPARATOR + + + + NAME + wazuh-agent-4.9.0-1.arm64 + PAYLOAD_ONLY + + TREAT_MISSING_PRESENTATION_DOCUMENTS_AS_WARNING + + + + TYPE + 0 + VERSION + 2 + + diff --git a/packages/macos/specs/wazuh_agent_intel64.pkgproj b/packages/macos/specs/wazuh_agent_intel64.pkgproj new file mode 100644 index 0000000000..743fd71890 --- /dev/null +++ b/packages/macos/specs/wazuh_agent_intel64.pkgproj @@ -0,0 +1,1254 @@ + + + + + PACKAGES + + + MUST-CLOSE-APPLICATION-ITEMS + + MUST-CLOSE-APPLICATIONS + + PACKAGE_FILES + + DEFAULT_INSTALL_LOCATION + / + HIERARCHY + + CHILDREN + + + CHILDREN + + GID + 80 + PATH + Applications + PATH_TYPE + 0 + PERMISSIONS + 509 + TYPE + 1 + UID + 0 + + + CHILDREN + + + CHILDREN + + GID + 80 + PATH + Application Support + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Automator + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Documentation + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Extensions + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Filesystems + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Frameworks + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Input Methods + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Internet Plug-Ins + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + LaunchAgents + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + LaunchDaemons + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/.ssh + PATH_TYPE + 0 + PERMISSIONS + 448 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/active-response + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/agentless + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/bin + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/internal_options.conf + PATH_TYPE + 0 + PERMISSIONS + 416 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/localtime + PATH_TYPE + 0 + PERMISSIONS + 416 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/client.keys + PATH_TYPE + 0 + PERMISSIONS + 416 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/local_internal_options.conf + PATH_TYPE + 0 + PERMISSIONS + 416 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/ossec.conf + PATH_TYPE + 0 + PERMISSIONS + 416 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/shared + PATH_TYPE + 0 + PERMISSIONS + 504 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/etc/wpk_root.pem + PATH_TYPE + 0 + PERMISSIONS + 416 + TYPE + 3 + UID + 0 + + + EXPANDED + + GID + 0 + PATH + /Library/Ossec/etc + PATH_TYPE + 0 + PERMISSIONS + 504 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/lib + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/logs + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/queue + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/tmp + PATH_TYPE + 0 + PERMISSIONS + 1000 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/packages_files + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/var + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/wodles + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + /Library/Ossec/ruleset + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + EXPANDED + + GID + 0 + PATH + /Library/Ossec + PATH_TYPE + 0 + PERMISSIONS + 488 + TYPE + 3 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + PreferencePanes + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Preferences + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 80 + PATH + Printers + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + PrivilegedHelperTools + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + QuickLook + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + QuickTime + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Screen Savers + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Scripts + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Services + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + GID + 0 + PATH + Widgets + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + GID + 0 + PATH + Library + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + CHILDREN + + + CHILDREN + + GID + 0 + PATH + Shared + PATH_TYPE + 0 + PERMISSIONS + 1023 + TYPE + 1 + UID + 0 + + + GID + 80 + PATH + Users + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + + GID + 0 + PATH + / + PATH_TYPE + 0 + PERMISSIONS + 493 + TYPE + 1 + UID + 0 + + PAYLOAD_TYPE + 0 + SHOW_INVISIBLE + + SPLIT_FORKS + + TREAT_MISSING_FILES_AS_WARNING + + VERSION + 4 + + PACKAGE_SCRIPTS + + POSTINSTALL_PATH + + PATH + postinstall.sh + PATH_TYPE + 1 + + PREINSTALL_PATH + + PATH + preinstall.sh + PATH_TYPE + 1 + + RESOURCES + + + PACKAGE_SETTINGS + + AUTHENTICATION + 1 + CONCLUSION_ACTION + 0 + FOLLOW_SYMBOLIC_LINKS + + IDENTIFIER + com.wazuh.pkg.wazuh-agent + LOCATION + 0 + NAME + agent + OVERWRITE_PERMISSIONS + + PAYLOAD_SIZE + -1 + RELOCATABLE + + USE_HFS+_COMPRESSION + + VERSION + 4.9.0-1 + + TYPE + 0 + UUID + 7BC88EDC-74AB-498A-992B-DE940686D898 + + + PROJECT + + PROJECT_COMMENTS + + NOTES + + PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBIVE1M + IDQuMDEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvVFIvaHRtbDQv + c3RyaWN0LmR0ZCI+CjxodG1sPgo8aGVhZD4KPG1ldGEgaHR0cC1l + cXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7 + IGNoYXJzZXQ9VVRGLTgiPgo8bWV0YSBodHRwLWVxdWl2PSJDb250 + ZW50LVN0eWxlLVR5cGUiIGNvbnRlbnQ9InRleHQvY3NzIj4KPHRp + dGxlPjwvdGl0bGU+CjxtZXRhIG5hbWU9IkdlbmVyYXRvciIgY29u + dGVudD0iQ29jb2EgSFRNTCBXcml0ZXIiPgo8bWV0YSBuYW1lPSJD + b2NvYVZlcnNpb24iIGNvbnRlbnQ9IjE1MDQuODMiPgo8c3R5bGUg + dHlwZT0idGV4dC9jc3MiPgo8L3N0eWxlPgo8L2hlYWQ+Cjxib2R5 + Pgo8L2JvZHk+CjwvaHRtbD4K + + + PROJECT_PRESENTATION + + BACKGROUND + + INSTALLATION TYPE + + HIERARCHIES + + INSTALLER + + LIST + + + DESCRIPTION + + OPTIONS + + HIDDEN + + STATE + 0 + + PACKAGE_UUID + 7BC88EDC-74AB-498A-992B-DE940686D898 + REQUIREMENTS + + TITLE + + + LANGUAGE + English + VALUE + Wazuh Agent + + + TOOLTIP + + TYPE + 0 + UUID + B5127C49-7EF4-4B73-97D7-2819981073A4 + + + REMOVED + + + + MODE + 0 + + INSTALLATION_STEPS + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewIntroductionController + INSTALLER_PLUGIN + Introduction + LIST_TITLE_KEY + InstallerSectionTitle + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewReadMeController + INSTALLER_PLUGIN + ReadMe + LIST_TITLE_KEY + InstallerSectionTitle + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewLicenseController + INSTALLER_PLUGIN + License + LIST_TITLE_KEY + InstallerSectionTitle + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewDestinationSelectController + INSTALLER_PLUGIN + TargetSelect + LIST_TITLE_KEY + InstallerSectionTitle + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewInstallationTypeController + INSTALLER_PLUGIN + PackageSelection + LIST_TITLE_KEY + InstallerSectionTitle + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewInstallationController + INSTALLER_PLUGIN + Install + LIST_TITLE_KEY + InstallerSectionTitle + + + ICPRESENTATION_CHAPTER_VIEW_CONTROLLER_CLASS + ICPresentationViewSummaryController + INSTALLER_PLUGIN + Summary + LIST_TITLE_KEY + InstallerSectionTitle + + + INTRODUCTION + + LOCALIZATIONS + + + LANGUAGE + English + VALUE + + PATH + introduction.txt + PATH_TYPE + 1 + + + + + LICENSE + + LOCALIZATIONS + + MODE + 0 + + README + + LOCALIZATIONS + + + TITLE + + LOCALIZATIONS + + + LANGUAGE + English + VALUE + Wazuh Agent + + + + + PROJECT_REQUIREMENTS + + LIST + + + BEHAVIOR + 2 + DICTIONARY + + IC_REQUIREMENT_CPU_ARCHITECTURE_FAMILY + 2 + IC_REQUIREMENT_CPU_INTEL_ARCHITECTURE_TYPE + 2 + IC_REQUIREMENT_CPU_MINIMUM_CPU_CORES_COUNT + 1 + IC_REQUIREMENT_CPU_MINIMUM_FREQUENCY + 866666 + IC_REQUIREMENT_CPU_POWERPC_ARCHITECTURE_TYPE + 0 + + IC_REQUIREMENT_CHECK_TYPE + 0 + IDENTIFIER + fr.whitebox.Packages.requirement.cpu + MESSAGE + + + LANGUAGE + English + SECONDARY_VALUE + + VALUE + This installer has been built for 64-bit Intel architecture. + + + NAME + Processor + STATE + + + + BEHAVIOR + 3 + DICTIONARY + + IC_REQUIREMENT_OS_DISK_TYPE + 0 + IC_REQUIREMENT_OS_DISTRIBUTION_TYPE + 0 + IC_REQUIREMENT_OS_MINIMUM_VERSION + 100800 + + IC_REQUIREMENT_CHECK_TYPE + 1 + IDENTIFIER + fr.whitebox.Packages.requirement.os + MESSAGE + + NAME + Operating System + STATE + + + + RESOURCES + + ROOT_VOLUME_ONLY + + + PROJECT_SETTINGS + + BUILD_FORMAT + 0 + BUILD_PATH + + PATH + build + PATH_TYPE + 1 + + EXCLUDED_FILES + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + .DS_Store + TYPE + 0 + + + PROTECTED + + PROXY_NAME + Remove .DS_Store files + PROXY_TOOLTIP + Remove ".DS_Store" files created by the Finder. + STATE + + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + .pbdevelopment + TYPE + 0 + + + PROTECTED + + PROXY_NAME + Remove .pbdevelopment files + PROXY_TOOLTIP + Remove ".pbdevelopment" files created by ProjectBuilder or Xcode. + STATE + + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + CVS + TYPE + 1 + + + REGULAR_EXPRESSION + + STRING + .cvsignore + TYPE + 0 + + + REGULAR_EXPRESSION + + STRING + .cvspass + TYPE + 0 + + + REGULAR_EXPRESSION + + STRING + .svn + TYPE + 1 + + + REGULAR_EXPRESSION + + STRING + .git + TYPE + 1 + + + REGULAR_EXPRESSION + + STRING + .gitignore + TYPE + 0 + + + PROTECTED + + PROXY_NAME + Remove SCM metadata + PROXY_TOOLTIP + Remove helper files and folders used by the CVS, SVN or Git Source Code Management systems. + STATE + + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + classes.nib + TYPE + 0 + + + REGULAR_EXPRESSION + + STRING + designable.db + TYPE + 0 + + + REGULAR_EXPRESSION + + STRING + info.nib + TYPE + 0 + + + PROTECTED + + PROXY_NAME + Optimize nib files + PROXY_TOOLTIP + Remove "classes.nib", "info.nib" and "designable.nib" files within .nib bundles. + STATE + + + + PATTERNS_ARRAY + + + REGULAR_EXPRESSION + + STRING + Resources Disabled + TYPE + 1 + + + PROTECTED + + PROXY_NAME + Remove Resources Disabled folders + PROXY_TOOLTIP + Remove "Resources Disabled" folders. + STATE + + + + SEPARATOR + + + + NAME + wazuh-agent-4.9.0-1.intel64 + PAYLOAD_ONLY + + TREAT_MISSING_PRESENTATION_DOCUMENTS_AS_WARNING + + + + TYPE + 0 + VERSION + 2 + + diff --git a/packages/macos/uninstall.sh b/packages/macos/uninstall.sh new file mode 100755 index 0000000000..b41510375a --- /dev/null +++ b/packages/macos/uninstall.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +## Stop and remove application +sudo /Library/Ossec/bin/wazuh-control stop +sudo /bin/rm -r /Library/Ossec* + +# remove launchdaemons +/bin/rm -f /Library/LaunchDaemons/com.wazuh.agent.plist + +## remove StartupItems +/bin/rm -rf /Library/StartupItems/WAZUH + +## Remove User and Groups +/usr/bin/dscl . -delete "/Users/wazuh" +/usr/bin/dscl . -delete "/Groups/wazuh" + +/usr/sbin/pkgutil --forget com.wazuh.pkg.wazuh-agent +/usr/sbin/pkgutil --forget com.wazuh.pkg.wazuh-agent-etc + +# In case it was installed via Puppet pkgdmg provider + +if [ -e /var/db/.puppet_pkgdmg_installed_wazuh-agent ]; then + rm -f /var/db/.puppet_pkgdmg_installed_wazuh-agent +fi + +echo +echo "Wazuh agent correctly removed from the system." +echo + +exit 0 diff --git a/packages/rpms/SPECS/wazuh_agent.spec b/packages/rpms/SPECS/wazuh_agent.spec new file mode 100644 index 0000000000..eddae2b984 --- /dev/null +++ b/packages/rpms/SPECS/wazuh_agent.spec @@ -0,0 +1,901 @@ +%if %{_debugenabled} == yes + %global _enable_debug_package 0 + %global debug_package %{nil} + %global __os_install_post %{nil} + %define __strip /bin/true +%endif + +%if %{_isstage} == no + %define _rpmfilename %%{NAME}_%%{VERSION}-%%{RELEASE}_%%{ARCH}_%{_hashcommit}.rpm +%else + %define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm +%endif + +Summary: Wazuh helps you to gain security visibility into your infrastructure by monitoring hosts at an operating system and application level. It provides the following capabilities: log analysis, file integrity monitoring, intrusions detection and policy and compliance monitoring +Name: wazuh-agent +Version: %{_version} +Release: %{_release} +License: GPL +Group: System Environment/Daemons +Source0: %{name}-%{version}.tar.gz +URL: https://www.wazuh.com/ +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Vendor: Wazuh, Inc +Packager: Wazuh, Inc +Requires(pre): /usr/sbin/groupadd /usr/sbin/useradd +Requires(postun): /usr/sbin/groupdel /usr/sbin/userdel +Conflicts: ossec-hids ossec-hids-agent wazuh-manager wazuh-local +AutoReqProv: no + +Requires: coreutils +%if 0%{?el} >= 6 || 0%{?rhel} >= 6 +BuildRequires: coreutils glibc-devel automake autoconf libtool policycoreutils-python perl +%else +BuildRequires: coreutils glibc-devel automake autoconf libtool policycoreutils perl +%endif + +ExclusiveOS: linux + +%description +Wazuh helps you to gain security visibility into your infrastructure by monitoring +hosts at an operating system and application level. It provides the following capabilities: +log analysis, file integrity monitoring, intrusions detection and policy and compliance monitoring + +%prep +%setup -q + +./gen_ossec.sh conf agent centos %rhel %{_localstatedir} > etc/ossec-agent.conf + +%build +pushd src +# Rebuild for agent +make clean + +%if 0%{?el} >= 6 || 0%{?rhel} >= 6 + make deps TARGET=agent + make -j%{_threads} TARGET=agent USE_SELINUX=yes DEBUG=%{_debugenabled} +%else + %ifnarch amd64 + MSGPACK="USE_MSGPACK_OPT=no" + %endif + deps_version=`cat Makefile | grep "DEPS_VERSION =" | cut -d " " -f 3` + make deps RESOURCES_URL=http://packages.wazuh.com/deps/${deps_version} TARGET=agent + make -j%{_threads} TARGET=agent USE_AUDIT=no USE_SELINUX=yes USE_EXEC_ENVIRON=no DEBUG=%{_debugenabled} ${MSGPACK} + +%endif + +popd + +%install +# Clean BUILDROOT +rm -fr %{buildroot} + +echo 'USER_LANGUAGE="en"' > ./etc/preloaded-vars.conf +echo 'USER_NO_STOP="y"' >> ./etc/preloaded-vars.conf +echo 'USER_INSTALL_TYPE="agent"' >> ./etc/preloaded-vars.conf +echo 'USER_DIR="%{_localstatedir}"' >> ./etc/preloaded-vars.conf +echo 'USER_DELETE_DIR="y"' >> ./etc/preloaded-vars.conf +echo 'USER_ENABLE_ACTIVE_RESPONSE="y"' >> ./etc/preloaded-vars.conf +echo 'USER_ENABLE_SYSCHECK="y"' >> ./etc/preloaded-vars.conf +echo 'USER_ENABLE_ROOTCHECK="y"' >> ./etc/preloaded-vars.conf +echo 'USER_ENABLE_OPENSCAP="n"' >> ./etc/preloaded-vars.conf +echo 'USER_ENABLE_SYSCOLLECTOR="y"' >> ./etc/preloaded-vars.conf +echo 'USER_ENABLE_CISCAT="y"' >> ./etc/preloaded-vars.conf +echo 'USER_UPDATE="n"' >> ./etc/preloaded-vars.conf +echo 'USER_AGENT_SERVER_IP="MANAGER_IP"' >> ./etc/preloaded-vars.conf +echo 'USER_CA_STORE="/path/to/my_cert.pem"' >> ./etc/preloaded-vars.conf +echo 'USER_AUTO_START="n"' >> ./etc/preloaded-vars.conf +./install.sh + +%if 0%{?el} < 6 || 0%{?rhel} < 6 + mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir} + touch ${RPM_BUILD_ROOT}%{_sysconfdir}/ossec-init.conf +%endif + +# Create directories +mkdir -p ${RPM_BUILD_ROOT}%{_initrddir} +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/.ssh + +# Copy the installed files into RPM_BUILD_ROOT directory +cp -pr %{_localstatedir}/* ${RPM_BUILD_ROOT}%{_localstatedir}/ +mkdir -p ${RPM_BUILD_ROOT}/usr/lib/systemd/system/ +sed -i "s:WAZUH_HOME_TMP:%{_localstatedir}:g" src/init/templates/ossec-hids-rh.init +install -m 0755 src/init/templates/ossec-hids-rh.init ${RPM_BUILD_ROOT}%{_initrddir}/wazuh-agent +sed -i "s:WAZUH_HOME_TMP:%{_localstatedir}:g" src/init/templates/wazuh-agent.service +install -m 0644 src/init/templates/wazuh-agent.service ${RPM_BUILD_ROOT}/usr/lib/systemd/system/ + +# Clean the preinstalled configuration assesment files +rm -f ${RPM_BUILD_ROOT}%{_localstatedir}/ruleset/sca/* + +# Install configuration assesment files and files templates +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/{generic} +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/{1,2,2023} +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/{8,7,6,5} +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/ol/{9} +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/{9,8,7,6,5} +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles/{11,12,15} +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/suse/{11,12} +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/fedora/{29,30,31,32,33,34} +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/almalinux/{8,9} +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rocky/{8,9} + +cp -r ruleset/sca/{generic,centos,rhel,ol,sles,amazon,rocky,almalinux} ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp + +cp etc/templates/config/generic/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/generic + +cp etc/templates/config/amzn/1/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/1 +cp etc/templates/config/amzn/2/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/2 +cp etc/templates/config/amzn/2023/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/2023 + +cp etc/templates/config/centos/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos +cp etc/templates/config/centos/8/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/8 +cp etc/templates/config/centos/7/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/7 +cp etc/templates/config/centos/6/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/6 +cp etc/templates/config/centos/5/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/5 + +cp etc/templates/config/ol/9/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/ol/9 + +cp etc/templates/config/rhel/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel +cp etc/templates/config/rhel/9/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/9 +cp etc/templates/config/rhel/8/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/8 +cp etc/templates/config/rhel/7/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/7 +cp etc/templates/config/rhel/6/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/6 +cp etc/templates/config/rhel/5/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/5 + +cp etc/templates/config/sles/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles +cp etc/templates/config/sles/11/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles/11 +cp etc/templates/config/sles/12/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles/12 +cp etc/templates/config/sles/15/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles/15 + +cp etc/templates/config/suse/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/suse +cp etc/templates/config/suse/11/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/suse/11 +cp etc/templates/config/suse/12/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/suse/12 + +cp etc/templates/config/fedora/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/fedora +cp etc/templates/config/fedora/29/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/fedora/29 +cp etc/templates/config/fedora/30/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/fedora/30 +cp etc/templates/config/fedora/31/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/fedora/31 +cp etc/templates/config/fedora/32/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/fedora/32 +cp etc/templates/config/fedora/33/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/fedora/33 +cp etc/templates/config/fedora/34/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/fedora/34 + +cp etc/templates/config/almalinux/8/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/almalinux/8 +cp etc/templates/config/almalinux/9/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/almalinux/9 + +cp etc/templates/config/rocky/8/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rocky/8 +cp etc/templates/config/rocky/9/sca.files ${RPM_BUILD_ROOT}%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rocky/9 + +# Add configuration scripts +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/ +cp gen_ossec.sh ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/ +cp add_localfiles.sh ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/ + +# Templates for initscript +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/src/init +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/generic +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/centos +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/rhel +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/suse +mkdir -p ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/sles + +# Add SUSE initscript +sed -i "s:WAZUH_HOME_TMP:%{_localstatedir}:g" src/init/templates/ossec-hids-suse.init +cp -rp src/init/templates/ossec-hids-suse.init ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/src/init/ + +# Copy scap templates +cp -rp etc/templates/config/generic/* ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/generic +cp -rp etc/templates/config/centos/* ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/centos +cp -rp etc/templates/config/rhel/* ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/rhel +cp -rp etc/templates/config/suse/* ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/suse +cp -rp etc/templates/config/sles/* ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/sles + +install -m 0640 src/init/*.sh ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/src/init + +# Add installation scripts +cp src/VERSION ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/src/ +cp src/REVISION ${RPM_BUILD_ROOT}%{_localstatedir}/packages_files/agent_installation_scripts/src/ + +exit 0 + +%pre +# Create the wazuh group if it doesn't exists +if command -v getent > /dev/null 2>&1 && ! getent group wazuh > /dev/null 2>&1; then + groupadd -r wazuh +elif ! getent group wazuh > /dev/null 2>&1; then + groupadd -r wazuh +fi +# Create the wazuh user if it doesn't exists +if ! getent passwd wazuh > /dev/null 2>&1; then + useradd -g wazuh -G wazuh -d %{_localstatedir} -r -s /sbin/nologin wazuh +fi + +# Stop the services to upgrade the package +if [ $1 = 2 ]; then + if [ ! -d "%{_localstatedir}" ]; then + echo "Error: Directory %{_localstatedir} does not exist. Cannot perform upgrade" >&2 + exit 1 + fi + + if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1 && systemctl is-active --quiet wazuh-agent > /dev/null 2>&1; then + systemctl stop wazuh-agent.service > /dev/null 2>&1 + touch %{_localstatedir}/tmp/wazuh.restart + # Check for SysV + elif command -v service > /dev/null 2>&1 && service wazuh-agent status 2>/dev/null | grep "is running" > /dev/null 2>&1; then + service wazuh-agent stop > /dev/null 2>&1 + touch %{_localstatedir}/tmp/wazuh.restart + elif %{_localstatedir}/bin/wazuh-control status 2>/dev/null | grep "is running" > /dev/null 2>&1; then + touch %{_localstatedir}/tmp/wazuh.restart + elif %{_localstatedir}/bin/ossec-control status 2>/dev/null | grep "is running" > /dev/null 2>&1; then + touch %{_localstatedir}/tmp/wazuh.restart + fi + %{_localstatedir}/bin/ossec-control stop > /dev/null 2>&1 || %{_localstatedir}/bin/wazuh-control stop > /dev/null 2>&1 +fi + +%post + +echo "VERSION=\"$(%{_localstatedir}/bin/wazuh-control info -v)\"" > /etc/ossec-init.conf +if [ $1 = 2 ]; then + if [ -d %{_localstatedir}/logs/ossec ]; then + rm -rf %{_localstatedir}/logs/wazuh + cp -rp %{_localstatedir}/logs/ossec %{_localstatedir}/logs/wazuh + fi + + if [ -d %{_localstatedir}/queue/ossec ]; then + rm -rf %{_localstatedir}/queue/sockets + cp -rp %{_localstatedir}/queue/ossec %{_localstatedir}/queue/sockets + fi +fi +# If the package is being installed +if [ $1 = 1 ]; then + + touch %{_localstatedir}/logs/active-responses.log + chown wazuh:wazuh %{_localstatedir}/logs/active-responses.log + chmod 0660 %{_localstatedir}/logs/active-responses.log + + . %{_localstatedir}/packages_files/agent_installation_scripts/src/init/dist-detect.sh + + # Generating ossec.conf file + %{_localstatedir}/packages_files/agent_installation_scripts/gen_ossec.sh conf agent ${DIST_NAME} ${DIST_VER}.${DIST_SUBVER} %{_localstatedir} > %{_localstatedir}/etc/ossec.conf + chown root:wazuh %{_localstatedir}/etc/ossec.conf + + # Add default local_files to ossec.conf + %{_localstatedir}/packages_files/agent_installation_scripts/add_localfiles.sh %{_localstatedir} >> %{_localstatedir}/etc/ossec.conf + + + # Register and configure agent if Wazuh environment variables are defined + %{_localstatedir}/packages_files/agent_installation_scripts/src/init/register_configure_agent.sh %{_localstatedir} > /dev/null || : +fi + +if [[ -d /run/systemd/system ]]; then + rm -f %{_initrddir}/wazuh-agent +fi + +# Delete the installation files used to configure the agent +rm -rf %{_localstatedir}/packages_files + +# Remove unnecessary files from shared directory +rm -f %{_localstatedir}/etc/shared/*.rpmnew + +#AlmaLinux +if [ -r "/etc/almalinux-release" ]; then + DIST_NAME=almalinux + DIST_VER=`sed -rn 's/.* ([0-9]{1,2})\.*[0-9]{0,2}.*/\1/p' /etc/almalinux-release` +#Rocky +elif [ -r "/etc/rocky-release" ]; then + DIST_NAME=rocky + DIST_VER=`sed -rn 's/.* ([0-9]{1,2})\.*[0-9]{0,2}.*/\1/p' /etc/rocky-release` +# CentOS +elif [ -r "/etc/centos-release" ]; then + if grep -q "AlmaLinux" /etc/centos-release; then + DIST_NAME=almalinux + elif grep -q "Rocky" /etc/centos-release; then + DIST_NAME=almalinux + else + DIST_NAME="centos" + fi + DIST_VER=`sed -rn 's/.* ([0-9]{1,2})\.*[0-9]{0,2}.*/\1/p' /etc/centos-release` +# Fedora +elif [ -r "/etc/fedora-release" ]; then + DIST_NAME="fedora" + DIST_VER=`sed -rn 's/.* ([0-9]{1,2})\.*[0-9]{0,2}.*/\1/p' /etc/fedora-release` +# Oracle Linux +elif [ -r "/etc/oracle-release" ]; then + DIST_NAME="ol" + DIST_VER=`sed -rn 's/.* ([0-9]{1,2})\.*[0-9]{0,2}.*/\1/p' /etc/oracle-release` +# RedHat +elif [ -r "/etc/redhat-release" ]; then + if grep -q "AlmaLinux" /etc/redhat-release; then + DIST_NAME=almalinux + elif grep -q "Rocky" /etc/redhat-release; then + DIST_NAME=almalinux + elif grep -q "CentOS" /etc/redhat-release; then + DIST_NAME="centos" + else + DIST_NAME="rhel" + fi + DIST_VER=`sed -rn 's/.* ([0-9]{1,2})\.*[0-9]{0,2}.*/\1/p' /etc/redhat-release` +# SUSE +elif [ -r "/etc/SuSE-release" ]; then + if grep -q "openSUSE" /etc/SuSE-release; then + DIST_NAME="generic" + DIST_VER="" + else + DIST_NAME="sles" + DIST_VER=`sed -rn 's/.*VERSION = ([0-9]{1,2}).*/\1/p' /etc/SuSE-release` + fi +elif [ -r "/etc/os-release" ]; then + . /etc/os-release + DIST_NAME=$ID + DIST_VER=$(echo $VERSION_ID | sed -rn 's/[^0-9]*([0-9]+).*/\1/p') + if [ "X$DIST_VER" = "X" ]; then + DIST_VER="0" + fi + if [ "$DIST_NAME" = "amzn" ] && [ "$DIST_VER" != "2" ] && [ "$DIST_VER" != "2023" ]; then + DIST_VER="1" + fi + DIST_SUBVER=$(echo $VERSION_ID | sed -rn 's/[^0-9]*[0-9]+\.([0-9]+).*/\1/p') + if [ "X$DIST_SUBVER" = "X" ]; then + DIST_SUBVER="0" + fi +else + DIST_NAME="generic" + DIST_VER="" +fi + +SCA_DIR="${DIST_NAME}/${DIST_VER}" +SCA_BASE_DIR="%{_localstatedir}/tmp/sca-%{version}-%{release}-tmp" +mkdir -p %{_localstatedir}/ruleset/sca + + +SCA_TMP_DIR="${SCA_BASE_DIR}/${SCA_DIR}" +# Install the configuration files needed for this hosts +if [ -r "${SCA_BASE_DIR}/${DIST_NAME}/${DIST_VER}/${DIST_SUBVER}/sca.files" ]; then + SCA_TMP_DIR="${SCA_BASE_DIR}/${DIST_NAME}/${DIST_VER}/${DIST_SUBVER}" +elif [ -r "${SCA_BASE_DIR}/${DIST_NAME}/${DIST_VER}/sca.files" ]; then + SCA_TMP_DIR="${SCA_BASE_DIR}/${DIST_NAME}/${DIST_VER}" +elif [ -r "${SCA_BASE_DIR}/${DIST_NAME}/sca.files" ]; then + SCA_TMP_DIR="${SCA_BASE_DIR}/${DIST_NAME}" +else + SCA_TMP_DIR="${SCA_BASE_DIR}/generic" +fi + +SCA_TMP_FILE="${SCA_TMP_DIR}/sca.files" +if [ -r ${SCA_TMP_FILE} ]; then + + rm -f %{_localstatedir}/ruleset/sca/* || true + + for sca_file in $(cat ${SCA_TMP_FILE}); do + if [ -f ${SCA_BASE_DIR}/${sca_file} ]; then + mv ${SCA_BASE_DIR}/${sca_file} %{_localstatedir}/ruleset/sca + fi + done +fi + +# Set the proper selinux context +if ([ "X${DIST_NAME}" = "Xrhel" ] || [ "X${DIST_NAME}" = "Xcentos" ] || [ "X${DIST_NAME}" = "XCentOS" ]) && [ "${DIST_VER}" == "5" ]; then + if command -v getenforce > /dev/null 2>&1; then + if [ $(getenforce) != "Disabled" ]; then + chcon -t textrel_shlib_t %{_localstatedir}/lib/libwazuhext.so + chcon -t textrel_shlib_t %{_localstatedir}/lib/libwazuhshared.so + fi + fi +else + # Add the SELinux policy + if command -v getenforce > /dev/null 2>&1 && command -v semodule > /dev/null 2>&1; then + if [ $(getenforce) != "Disabled" ]; then + semodule -i %{_localstatedir}/var/selinux/wazuh.pp + semodule -e wazuh + fi + fi +fi + +# Restore ossec.conf permissions after upgrading +chmod 0660 %{_localstatedir}/etc/ossec.conf + +# Remove old ossec user and group if exists and change ownwership of files + +if getent group ossec > /dev/null 2>&1; then + find %{_localstatedir}/ -group ossec -user root -exec chown root:wazuh {} \; > /dev/null 2>&1 || true + if getent passwd ossec > /dev/null 2>&1; then + find %{_localstatedir}/ -group ossec -user ossec -exec chown wazuh:wazuh {} \; > /dev/null 2>&1 || true + userdel ossec > /dev/null 2>&1 + fi + if getent passwd ossecm > /dev/null 2>&1; then + find %{_localstatedir}/ -group ossec -user ossecm -exec chown wazuh:wazuh {} \; > /dev/null 2>&1 || true + userdel ossecm > /dev/null 2>&1 + fi + if getent passwd ossecr > /dev/null 2>&1; then + find %{_localstatedir}/ -group ossec -user ossecr -exec chown wazuh:wazuh {} \; > /dev/null 2>&1 || true + userdel ossecr > /dev/null 2>&1 + fi + if grep -q ossec /etc/group; then + groupdel ossec > /dev/null 2>&1 + fi +fi + +%preun + +if [ $1 = 0 ]; then + + # Stop the services before uninstall the package + # Check for systemd + if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1 && systemctl is-active --quiet wazuh-agent > /dev/null 2>&1; then + systemctl stop wazuh-agent.service > /dev/null 2>&1 + # Check for SysV + elif command -v service > /dev/null 2>&1 && service wazuh-agent status 2>/dev/null | grep "is running" > /dev/null 2>&1; then + service wazuh-agent stop > /dev/null 2>&1 + fi + %{_localstatedir}/bin/wazuh-control stop > /dev/null 2>&1 + + # Remove the SELinux policy + if command -v getenforce > /dev/null 2>&1 && command -v semodule > /dev/null 2>&1; then + if [ $(getenforce) != "Disabled" ]; then + if (semodule -l | grep wazuh > /dev/null); then + semodule -r wazuh > /dev/null + fi + fi + fi + # Remove the service file for SUSE hosts + if [ -f /etc/os-release ]; then + sles=$(grep "\"sles" /etc/os-release) + elif [ -f /etc/SuSE-release ]; then + sles=$(grep "SUSE Linux Enterprise Server" /etc/SuSE-release) + fi + if [ ! -z "$sles" ]; then + rm -f /etc/init.d/wazuh-agent + fi + + # Remove SCA files + rm -f %{_localstatedir}/ruleset/sca/* + +fi + +%triggerin -- glibc +[ -r %{_sysconfdir}/localtime ] && cp -fpL %{_sysconfdir}/localtime %{_localstatedir}/etc + chown root:wazuh %{_localstatedir}/etc/localtime + chmod 0640 %{_localstatedir}/etc/localtime + +%postun + +DELETE_WAZUH_USER_AND_GROUP=0 + +# If the upgrade downgrades to earlier versions, it will create the ossec +# group and user, we need to delete wazuh ones +if [ $1 = 1 ]; then + if command -v %{_localstatedir}/bin/ossec-control > /dev/null 2>&1; then + find %{_localstatedir} -group wazuh -exec chgrp ossec {} + + find %{_localstatedir} -user wazuh -exec chown ossec {} + + DELETE_WAZUH_USER_AND_GROUP=1 + fi + + if [ ! -f %{_localstatedir}/etc/client.keys ]; then + if [ -f %{_localstatedir}/etc/client.keys.rpmsave ]; then + mv %{_localstatedir}/etc/client.keys.rpmsave %{_localstatedir}/etc/client.keys + elif [ -f %{_localstatedir}/etc/client.keys.rpmnew ]; then + mv %{_localstatedir}/etc/client.keys.rpmnew %{_localstatedir}/etc/client.keys + fi + fi +fi + +# If the package is been uninstalled or we want to delete wazuh user and group +if [ $1 = 0 ] || [ $DELETE_WAZUH_USER_AND_GROUP = 1 ]; then + # Remove the wazuh user if it exists + if getent passwd wazuh > /dev/null 2>&1; then + userdel wazuh >/dev/null 2>&1 + fi + # Remove the wazuh group if it exists + if command -v getent > /dev/null 2>&1 && getent group wazuh > /dev/null 2>&1; then + groupdel wazuh >/dev/null 2>&1 + elif getent group wazuh > /dev/null 2>&1; then + groupdel wazuh >/dev/null 2>&1 + fi + + if [ $1 = 0 ];then + # Remove lingering folders and files + rm -rf %{_localstatedir}/etc/shared/ + rm -rf %{_localstatedir}/queue/ + rm -rf %{_localstatedir}/var/ + rm -rf %{_localstatedir}/bin/ + rm -rf %{_localstatedir}/logs/ + rm -rf %{_localstatedir}/backup/ + rm -rf %{_localstatedir}/ruleset/ + rm -rf %{_localstatedir}/tmp + fi +fi + +# posttrans code is the last thing executed in a install/upgrade +%posttrans +if [ -f %{_sysconfdir}/systemd/system/wazuh-agent.service ]; then + rm -rf %{_sysconfdir}/systemd/system/wazuh-agent.service + systemctl daemon-reload > /dev/null 2>&1 +fi + +if [ -f %{_localstatedir}/tmp/wazuh.restart ]; then + rm -f %{_localstatedir}/tmp/wazuh.restart + if command -v systemctl > /dev/null 2>&1 && systemctl > /dev/null 2>&1 ; then + systemctl daemon-reload > /dev/null 2>&1 + systemctl restart wazuh-agent.service > /dev/null 2>&1 + elif command -v service > /dev/null 2>&1; then + service wazuh-agent restart > /dev/null 2>&1 + else + %{_localstatedir}/bin/wazuh-control restart > /dev/null 2>&1 + fi +fi + +if [ -d %{_localstatedir}/logs/ossec ]; then + rm -rf %{_localstatedir}/logs/ossec/ +fi + +if [ -d %{_localstatedir}/queue/ossec ]; then + rm -rf %{_localstatedir}/queue/ossec/ +fi + +if [ -f %{_sysconfdir}/ossec-init.conf ]; then + rm -f %{_sysconfdir}/ossec-init.conf + rm -f %{_localstatedir}/etc/ossec-init.conf +fi + +%clean +rm -fr %{buildroot} + +%files +%defattr(-,root,root) +%config(missingok) %{_initrddir}/wazuh-agent +%attr(640, root, wazuh) %verify(not md5 size mtime) %ghost %{_sysconfdir}/ossec-init.conf +/usr/lib/systemd/system/wazuh-agent.service +%dir %attr(750, root, wazuh) %{_localstatedir} +%attr(750, root, wazuh) %{_localstatedir}/agentless +%dir %attr(770, root, wazuh) %{_localstatedir}/.ssh +%dir %attr(750, root, wazuh) %{_localstatedir}/active-response +%dir %attr(750, root, wazuh) %{_localstatedir}/active-response/bin +%attr(750, root, wazuh) %{_localstatedir}/active-response/bin/* +%dir %attr(750, root, root) %{_localstatedir}/bin +%attr(750, root, root) %{_localstatedir}/bin/* +%dir %attr(750, root, wazuh) %{_localstatedir}/backup +%dir %attr(770, wazuh, wazuh) %{_localstatedir}/etc +%attr(640, root, wazuh) %config(noreplace) %{_localstatedir}/etc/client.keys +%attr(640, root, wazuh) %{_localstatedir}/etc/internal_options* +%attr(640, root, wazuh) %{_localstatedir}/etc/localtime +%attr(640, root, wazuh) %config(noreplace) %{_localstatedir}/etc/local_internal_options.conf +%attr(660, root, wazuh) %config(noreplace) %{_localstatedir}/etc/ossec.conf +%attr(640, root, wazuh) %{_localstatedir}/etc/wpk_root.pem +%dir %attr(770, root, wazuh) %{_localstatedir}/etc/shared +%attr(660, root, wazuh) %config(missingok,noreplace) %{_localstatedir}/etc/shared/* +%dir %attr(750, root, wazuh) %{_localstatedir}/lib +%attr(750, root, wazuh) %{_localstatedir}/lib/* +%dir %attr(770, wazuh, wazuh) %{_localstatedir}/logs +%attr(660, wazuh, wazuh) %ghost %{_localstatedir}/logs/active-responses.log +%attr(660, root, wazuh) %ghost %{_localstatedir}/logs/ossec.log +%attr(660, root, wazuh) %ghost %{_localstatedir}/logs/ossec.json +%dir %attr(750, wazuh, wazuh) %{_localstatedir}/logs/wazuh +%dir %attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files +%dir %attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/agent_installation_scripts +%attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/agent_installation_scripts/add_localfiles.sh +%attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/agent_installation_scripts/gen_ossec.sh +%attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/generic/* +%attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/centos/* +%attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/rhel/* +%attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/sles/* +%attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/agent_installation_scripts/etc/templates/config/suse/* +%attr(750, root, root) %config(missingok) %{_localstatedir}/packages_files/agent_installation_scripts/src/* +%dir %attr(750, root, wazuh) %{_localstatedir}/queue +%dir %attr(770, wazuh, wazuh) %{_localstatedir}/queue/sockets +%dir %attr(750, wazuh, wazuh) %{_localstatedir}/queue/diff +%dir %attr(750, wazuh, wazuh) %{_localstatedir}/queue/fim +%dir %attr(750, wazuh, wazuh) %{_localstatedir}/queue/fim/db +%dir %attr(750, wazuh, wazuh) %{_localstatedir}/queue/syscollector +%dir %attr(750, wazuh, wazuh) %{_localstatedir}/queue/syscollector/db +%attr(640, root, wazuh) %{_localstatedir}/queue/syscollector/norm_config.json +%dir %attr(770, wazuh, wazuh) %{_localstatedir}/queue/alerts +%dir %attr(750, wazuh, wazuh) %{_localstatedir}/queue/rids +%dir %attr(750, wazuh, wazuh) %{_localstatedir}/queue/logcollector +%dir %attr(750, root, wazuh) %{_localstatedir}/ruleset/ +%dir %attr(750, root, wazuh) %{_localstatedir}/ruleset/sca +%attr(750, root, wazuh) %{_localstatedir}/lib/libdbsync.so +%attr(750, root, wazuh) %{_localstatedir}/lib/librsync.so +%attr(750, root, wazuh) %{_localstatedir}/lib/libsyscollector.so +%attr(750, root, wazuh) %{_localstatedir}/lib/libsysinfo.so +%attr(750, root, wazuh) %{_localstatedir}/lib/libstdc++.so.6 +%attr(750, root, wazuh) %{_localstatedir}/lib/libgcc_s.so.1 +%attr(750, root, wazuh) %{_localstatedir}/lib/libfimdb.so +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/generic +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/generic/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/1 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/1/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/2 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/2/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/2023 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amzn/2023/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/sca.files +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/5 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/5/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/6 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/6/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/7 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/7/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/8 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/centos/8/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/ol/9 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/ol/9/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/sca.files +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/5 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/5/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/6 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/6/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/7 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/7/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/8 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/8/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/9 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rhel/9/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles/sca.files +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles/11 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles/11/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles/12 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles/12/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles/15 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/sles/15/* +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/suse/sca.files +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/suse/11 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/suse/11/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/suse/12 +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/suse/12/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amazon +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/amazon/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/fedora +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/fedora/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/almalinux +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/almalinux/* +%dir %attr(750, wazuh, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rocky +%attr(640, root, wazuh) %config(missingok) %{_localstatedir}/tmp/sca-%{version}-%{release}-tmp/rocky/* +%dir %attr(1770, root, wazuh) %{_localstatedir}/tmp +%dir %attr(750, root, wazuh) %{_localstatedir}/var +%dir %attr(770, root, wazuh) %{_localstatedir}/var/incoming +%dir %attr(770, root, wazuh) %{_localstatedir}/var/run +%dir %attr(770, root, wazuh) %{_localstatedir}/var/selinux +%attr(640, root, wazuh) %{_localstatedir}/var/selinux/* +%dir %attr(770, root, wazuh) %{_localstatedir}/var/upgrade +%dir %attr(770, root, wazuh) %{_localstatedir}/var/wodles +%dir %attr(750, root, wazuh) %{_localstatedir}/wodles +%attr(750, root, wazuh) %{_localstatedir}/wodles/* +%dir %attr(750, root, wazuh) %{_localstatedir}/wodles/aws +%attr(750, root, wazuh) %{_localstatedir}/wodles/aws/* +%dir %attr(750, root, wazuh) %{_localstatedir}/wodles/azure +%attr(750, root, wazuh) %{_localstatedir}/wodles/azure/* +%dir %attr(750, root, wazuh) %{_localstatedir}/wodles/docker +%attr(750, root, wazuh) %{_localstatedir}/wodles/docker/* +%dir %attr(750, root, wazuh) %{_localstatedir}/wodles/gcloud +%attr(750, root, wazuh) %{_localstatedir}/wodles/gcloud/* + +%changelog +* Wed Jul 10 2024 support - 4.9.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-9-0.html +* Wed Jun 26 2024 support - 4.8.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-1.html +* Wed Jun 12 2024 support - 4.8.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-8-0.html +* Thu May 30 2024 support - 4.7.5 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-5.html +* Thu Apr 25 2024 support - 4.7.4 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-4.html +* Tue Feb 27 2024 support - 4.7.3 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-3.html +* Tue Jan 09 2024 support - 4.7.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-2.html +* Wed Dec 13 2023 support - 4.7.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-1.html +* Tue Nov 21 2023 support - 4.7.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-7-0.html +* Tue Oct 31 2023 support - 4.6.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-6-0.html +* Tue Oct 24 2023 support - 4.5.4 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-5-4.html +* Tue Oct 10 2023 support - 4.5.3 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-5-3.html +* Thu Aug 31 2023 support - 4.5.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-5-2.html +* Thu Aug 24 2023 support - 4.5.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-5.1.html +* Thu Aug 10 2023 support - 4.5.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-5-0.html +* Mon Jul 10 2023 support - 4.4.5 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-4-5.html +* Tue Jun 13 2023 support - 4.4.4 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-4-4.html +* Thu May 25 2023 support - 4.4.3 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-4-3.html +* Mon May 08 2023 support - 4.4.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-4-2.html +* Mon Apr 24 2023 support - 4.3.11 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-3.11.html +* Mon Apr 17 2023 support - 4.4.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-4-1.html +* Wed Jan 18 2023 support - 4.4.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-4-0.html +* Thu Nov 10 2022 support - 4.3.10 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-3-10.html +* Mon Oct 03 2022 support - 4.3.9 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-3-9.html +* Wed Sep 21 2022 support - 3.13.6 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-13-6.html +* Mon Sep 19 2022 support - 4.3.8 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-3-8.html +* Wed Aug 24 2022 support - 3.13.5 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-13-5.html +* Mon Aug 08 2022 support - 4.3.7 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-3-7.html +* Thu Jul 07 2022 support - 4.3.6 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-3-6.html +* Wed Jun 29 2022 support - 4.3.5 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-3-5.html +* Tue Jun 07 2022 support - 4.3.4 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-3-4.html +* Tue May 31 2022 support - 4.3.3 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-3-3.html +* Mon May 30 2022 support - 4.3.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-3-2.html +* Mon May 30 2022 support - 3.13.4 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-13-4.html +* Sun May 29 2022 support - 4.2.7 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-2-7.html +* Wed May 18 2022 support - 4.3.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-3-1.html +* Thu May 05 2022 support - 4.3.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-3-0.html +* Fri Mar 25 2022 support - 4.2.6 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-2-6.html +* Mon Nov 15 2021 support - 4.2.5 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-2-5.html +* Thu Oct 21 2021 support - 4.2.4 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-2-4.html +* Wed Oct 06 2021 support - 4.2.3 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-2-3.html +* Tue Sep 28 2021 support - 4.2.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-2-2.html +* Sat Sep 25 2021 support - 4.2.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-2-1.html +* Mon Apr 26 2021 support - 4.2.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-2-0.html +* Sat Apr 24 2021 support - 3.13.3 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-13-3.html +* Thu Apr 22 2021 support - 4.1.5 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-1-5.html +* Mon Mar 29 2021 support - 4.1.4 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-1-4.html +* Sat Mar 20 2021 support - 4.1.3 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-1-3.html +* Mon Mar 08 2021 support - 4.1.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-1-2.html +* Fri Mar 05 2021 support - 4.1.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-1-1.html +* Tue Jan 19 2021 support - 4.1.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-1-0.html +* Mon Nov 30 2020 support - 4.0.3 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-0-3.html +* Mon Nov 23 2020 support - 4.0.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-0-2.html +* Sat Oct 31 2020 support - 4.0.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-0-1.html +* Mon Oct 19 2020 support - 4.0.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-4-0-0.html +* Fri Aug 21 2020 support - 3.13.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-13-2.html +* Tue Jul 14 2020 support - 3.13.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-13-1.html +* Mon Jun 29 2020 support - 3.13.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-13-0.html +* Wed May 13 2020 support - 3.12.3 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-12-3.html +* Thu Apr 9 2020 support - 3.12.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-12-2.html +* Wed Apr 8 2020 support - 3.12.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-12-1.html +* Wed Mar 25 2020 support - 3.12.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-12-0.html +* Mon Feb 24 2020 support - 3.11.4 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-11-4.html +* Wed Jan 22 2020 support - 3.11.3 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-11-3.html +* Tue Jan 7 2020 support - 3.11.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-11-2.html +* Thu Dec 26 2019 support - 3.11.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-11-1.html +* Mon Oct 7 2019 support - 3.11.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-11-0.html +* Mon Sep 23 2019 support - 3.10.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-10-2.html +* Thu Sep 19 2019 support - 3.10.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-10-1.html +* Mon Aug 26 2019 support - 3.10.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-10-0.html +* Thu Aug 8 2019 support - 3.9.5 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-9-5.html +* Fri Jul 12 2019 support - 3.9.4 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-9-4.html +* Tue Jul 02 2019 support - 3.9.3 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-9-3.html +* Tue Jun 11 2019 support - 3.9.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-9-2.html +* Sat Jun 01 2019 support - 3.9.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-9-1.html +* Mon Feb 25 2019 support - 3.9.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-9-0.html +* Wed Jan 30 2019 support - 3.8.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-8-2.html +* Thu Jan 24 2019 support - 3.8.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-8-1.html +* Fri Jan 18 2019 support - 3.8.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-8-0.html +* Wed Nov 7 2018 support - 3.7.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-7-0.html +* Mon Sep 10 2018 support - 3.6.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-6-1.html +* Fri Sep 7 2018 support - 3.6.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-6-0.html +* Wed Jul 25 2018 support - 3.5.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-5-0.html +* Wed Jul 11 2018 support - 3.4.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-4-0.html +* Mon Jun 18 2018 support - 3.3.1 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-3-1.html +* Mon Jun 11 2018 support - 3.3.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-3-0.html +* Wed May 30 2018 support - 3.2.4 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-2-4.html +* Thu May 10 2018 support - 3.2.3 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-2-3.html +* Mon Apr 09 2018 support - 3.2.2 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-2-2.html +* Wed Feb 21 2018 support - 3.2.1 +- More info: https://documentation.wazuh.com/current/release-notes/rerlease-3-2-1.html +* Wed Feb 07 2018 support - 3.2.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-2-0.html +* Thu Dec 21 2017 support - 3.1.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-1-0.html +* Mon Nov 06 2017 support - 3.0.0 +- More info: https://documentation.wazuh.com/current/release-notes/release-3-0-0.html +* Tue Jun 06 2017 support - 2.0.1 +- Changed random data generator for a secure OS-provided generator. +- Changed Windows installer file name (depending on version). +- Linux distro detection using standard os-release file. +- Changed some URLs to documentation. +- Disable synchronization with SQLite databases for Syscheck by default. +- Minor changes at Rootcheck formatter for JSON alerts. +- Added debugging messages to Integrator logs. +- Show agent ID when possible on logs about incorrectly formatted messages. +- Use default maximum inotify event queue size. +- Show remote IP on encoding format errors when unencrypting messages. +- Fix permissions in agent-info folder +- Fix permissions in rids folder. +* Fri Apr 21 2017 Jose Luis Ruiz - 2.0 +- Changed random data generator for a secure OS-provided generator. +- Changed Windows installer file name (depending on version). +- Linux distro detection using standard os-release file. +- Changed some URLs to documentation. +- Disable synchronization with SQLite databases for Syscheck by default. +- Minor changes at Rootcheck formatter for JSON alerts. +- Added debugging messages to Integrator logs. +- Show agent ID when possible on logs about incorrectly formatted messages. +- Use default maximum inotify event queue size. +- Show remote IP on encoding format errors when unencrypting messages. +- Fixed resource leaks at rules configuration parsing. +- Fixed memory leaks at rules parser. +- Fixed memory leaks at XML decoders parser. +- Fixed TOCTOU condition when removing directories recursively. +- Fixed insecure temporary file creation for old POSIX specifications. +- Fixed missing agentless devices identification at JSON alerts. +- Fixed FIM timestamp and file name issue at SQLite database. +- Fixed cryptographic context acquirement on Windows agents. +- Fixed debug mode for Analysisd. +- Fixed bad exclusion of BTRFS filesystem by Rootcheck. +- Fixed compile errors on macOS. +- Fixed option -V for Integrator. +- Exclude symbolic links to directories when sending FIM diffs (by Stephan Joerrens). +- Fixed daemon list for service reloading at wazuh-control. +- Fixed socket waiting issue on Windows agents. +- Fixed PCI_DSS definitions grouping issue at Rootcheck controls. diff --git a/packages/rpms/amd64/agent/CentOS-Base.repo b/packages/rpms/amd64/agent/CentOS-Base.repo new file mode 100644 index 0000000000..96f58800c0 --- /dev/null +++ b/packages/rpms/amd64/agent/CentOS-Base.repo @@ -0,0 +1,54 @@ +# CentOS-Base.repo +# +# The mirror system uses the connecting IP address of the client and the +# update status of each mirror to pick mirrors that are updated to and +# geographically close to the client. You should use this for CentOS updates +# unless you are manually picking other mirrors. +# +# If the mirrorlist= does not work for you, as a fall back you can try the +# remarked out baseurl= line instead. +# +# + +[base] +name=CentOS-$releasever - Base +baseurl=http://mirror.nsc.liu.se/centos-store/6.10/os/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#released updates +[updates] +name=CentOS-$releasever - Updates +baseurl=http://mirror.nsc.liu.se/centos-store/6.10/updates/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#additional packages that may be useful +[extras] +name=CentOS-$releasever - Extras +baseurl=http://mirror.nsc.liu.se/centos-store/6.10/extras/$basearch/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#additional packages that extend functionality of existing packages +[centosplus] +name=CentOS-$releasever - Plus +baseurl=http://mirror.nsc.liu.se/centos-store/6.10/centosplus/$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#contrib - packages by Centos Users +[contrib] +name=CentOS-$releasever - Contrib +baseurl=http://mirror.nsc.liu.se/centos-store/6.10/contrib/$basearch/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +# SCLO - packages +[centos-sclo-sclo] +name=CentOS-$releasever - SCLO +baseurl=http://mirror.nsc.liu.se/centos-store/6.10/sclo/$basearch/rh/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 diff --git a/packages/rpms/amd64/agent/Dockerfile b/packages/rpms/amd64/agent/Dockerfile new file mode 100644 index 0000000000..298de7014c --- /dev/null +++ b/packages/rpms/amd64/agent/Dockerfile @@ -0,0 +1,74 @@ +FROM centos:6 + +# Install all the necessary tools to build the packages +RUN rm /etc/yum.repos.d/* && echo "exactarch=1" >> /etc/yum.conf +COPY CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo +RUN yum clean all && yum update -y +RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 +RUN yum install -y gcc make wget git \ + openssh-clients sudo gnupg \ + automake autoconf libtool policycoreutils-python \ + yum-utils epel-release redhat-rpm-config rpm-devel \ + autopoint gettext nspr nspr-devel \ + nss nss-devel kenel-headers magic magic-devel \ + db4 db4-devel zlib zlib-devel rpm-build bison \ + sharutils bzip2-devel xz-devel lzo-devel \ + e2fsprogs-devel libacl-devel libattr-devel \ + openssl-devel libxml2-devel kexec-tools elfutils \ + libarchive-devel elfutils-libelf-devel \ + elfutils-libelf patchelf elfutils-devel libgcrypt-devel + +RUN yum-builddep python34 -y + +RUN curl --silent --location https://rpm.nodesource.com/setup_8.x | bash - +RUN yum install -y nodejs + +RUN curl -OL http://packages.wazuh.com/utils/perl/perl-5.10.1.tar.gz && \ + gunzip perl-5.10.1.tar.gz && tar -xf perl*.tar && \ + cd /perl-5.10.1 && ./Configure -des -Dcc='gcc' -Dusethreads && \ + make -j2 && make install && ln -fs /usr/local/bin/perl /bin/perl && \ + cd / && rm -rf /perl-5.10.1* + +# Update rpmbuild, rpm and autoconf +RUN curl -O http://packages.wazuh.com/utils/autoconf/autoconf-2.69.tar.gz && \ + gunzip autoconf-2.69.tar.gz && tar xvf autoconf-2.69.tar && \ + cd autoconf-2.69 && ./configure && make -j$(nproc) && \ + make install && cd / && rm -rf autoconf-* + +RUN curl -O https://packages.wazuh.com/utils/libarchive/libarchive-3.1.2-12.el7.src.rpm && \ + rpmbuild --rebuild libarchive-3.1.2-12.el7.src.rpm && rpm -Uvh /root/rpmbuild/RPMS/x86_64/* --nodeps && rm -rf libarchive-* + +RUN curl -O http://packages.wazuh.com/utils/rpm/rpm-4.15.1.tar.bz2 && \ + tar -xjf rpm-4.15.1.tar.bz2 && cd rpm-4.15.1 && \ + ./configure --without-lua && make -j$(nproc) && make install && cd / && rm -rf rpm-* + +RUN mkdir -p /usr/local/var/lib/rpm && \ + cp /var/lib/rpm/Packages /usr/local/var/lib/rpm/Packages && \ + /usr/local/bin/rpm --rebuilddb && rm -rf /root/rpmbuild + +RUN curl -OL http://packages.wazuh.com/utils/gcc/gcc-9.4.0.tar.gz && \ + tar xzf gcc-9.4.0.tar.gz && cd gcc-9.4.0/ && \ + ./contrib/download_prerequisites && \ + ./configure --prefix=/usr/local/gcc-9.4.0 --enable-languages=c,c++ \ + --disable-multilib --disable-libsanitizer && \ + make -j$(nproc) && make install && \ + ln -fs /usr/local/gcc-9.4.0/bin/g++ /usr/bin/c++ && \ + ln -fs /usr/local/gcc-9.4.0/bin/gcc /usr/bin/cc && cd / && rm -rf gcc-* + +ENV CPLUS_INCLUDE_PATH "/usr/local/gcc-9.4.0/include/c++/9.4.0/" +ENV LD_LIBRARY_PATH "/usr/local/gcc-9.4.0/lib64/" +ENV PATH "/usr/local/gcc-9.4.0/bin:${PATH}" + +RUN curl -OL http://packages.wazuh.com/utils/cmake/cmake-3.18.3.tar.gz && \ + tar -zxf cmake-3.18.3.tar.gz && cd cmake-3.18.3 && \ + ./bootstrap --no-system-curl CC=/usr/local/gcc-9.4.0/bin/gcc \ + CXX=/usr/local/gcc-9.4.0/bin/g++ && \ + make -j$(nproc) && make install && cd / && rm -rf cmake-* + +# Add the scripts to build the RPM package +ADD build.sh /usr/local/bin/build_package +RUN chmod +x /usr/local/bin/build_package +ADD helper_function.sh /usr/local/bin/helper_function.sh + +# Set the entrypoint +ENTRYPOINT ["/usr/local/bin/build_package"] diff --git a/packages/rpms/arm64/agent/Dockerfile b/packages/rpms/arm64/agent/Dockerfile new file mode 100644 index 0000000000..9d82d2115b --- /dev/null +++ b/packages/rpms/arm64/agent/Dockerfile @@ -0,0 +1,83 @@ +FROM arm64v8/centos:7 + +# Enable EPEL +RUN yum install -y http://packages.wazuh.com/utils/pkg/epel-release-latest-7.noarch.rpm + +# Install all the necessary tools to build the packages +RUN yum install -y gcc make wget git \ + openssh-clients sudo gnupg file-devel\ + automake autoconf libtool policycoreutils-python \ + yum-utils system-rpm-config rpm-devel \ + gettext nspr nspr-devel \ + nss nss-devel libdb libdb-devel \ + zlib zlib-devel rpm-build bison \ + sharutils bzip2-devel xz-devel lzo-devel \ + e2fsprogs-devel libacl-devel libattr-devel \ + openssl-devel libxml2-devel kexec-tools elfutils \ + libcurl-devel elfutils-libelf-devel \ + elfutils-libelf patchelf elfutils-devel libgcrypt-devel \ + libarchive-devel libarchive bluez-libs-devel bzip2 \ + desktop-file-utils expat-devel findutils gcc-c++ gdbm-devel \ + glibc-devel gmp-devel gnupg2 libappstream-glib \ + libffi-devel libtirpc-devel libGL-devel libuuid-devel \ + libX11-devel ncurses-devel pkgconfig readline-devel \ + redhat-rpm-config sqlite-devel gdb tar tcl-devel tix-devel tk-devel \ + valgrind-devel python-rpm-macros python34 nodejs + +RUN curl -OL http://packages.wazuh.com/utils/gcc/gcc-9.4.0.tar.gz && \ + tar xzf gcc-9.4.0.tar.gz && cd gcc-9.4.0/ && \ + ./contrib/download_prerequisites && \ + ./configure --prefix=/usr/local/gcc-9.4.0 --enable-languages=c,c++ --disable-multilib \ + --disable-libsanitizer --disable-bootstrap && \ + make -j$(nproc) && make install && \ + ln -fs /usr/local/gcc-9.4.0/bin/g++ /usr/bin/c++ && \ + ln -fs /usr/local/gcc-9.4.0/bin/gcc /usr/bin/cc && cd / && rm -rf gcc-* + +ENV CPLUS_INCLUDE_PATH "/usr/local/gcc-9.4.0/include/c++/9.4.0/" +ENV LD_LIBRARY_PATH "/usr/local/gcc-9.4.0/lib64/" +ENV PATH "/usr/local/gcc-9.4.0/bin:${PATH}" + +RUN curl -OL http://packages.wazuh.com/utils/cmake/cmake-3.18.3.tar.gz && \ + tar -zxf cmake-3.18.3.tar.gz && cd cmake-3.18.3 && \ + ./bootstrap --no-system-curl CC=/usr/local/gcc-9.4.0/bin/gcc \ + CXX=/usr/local/gcc-9.4.0/bin/g++ && \ + make -j$(nproc) && make install && cd / && rm -rf cmake-* + +# Install Perl 5.10 +RUN curl -OL http://packages.wazuh.com/utils/perl/perl-5.10.1.tar.gz && \ + gunzip perl-5.10.1.tar.gz && tar -xf perl*.tar && \ + cd /perl-5.10.1 && ./Configure -des -Dcc='gcc' -Dusethreads && \ + make -j2 && make install && ln -fs /usr/local/bin/perl /bin/perl && \ + cd / && rm -rf /perl-5.10.1* + +RUN curl -O http://packages.wazuh.com/utils/openssl/openssl-1.1.1a.tar.gz && \ + tar -xzf openssl-1.1.1a.tar.gz && cd openssl* && \ + ./config -Wl,--enable-new-dtags,-rpath,'$(LIBRPATH)' && \ + make -j $(nproc) && make install && cd / && rm -rf openssl-* + +RUN curl -O http://packages.wazuh.com/utils/nodejs/node-v12.16.1-linux-arm64.tar.xz && \ + tar -xJf node-v12.16.1-linux-arm64.tar.xz && \ + cd node-v12.16* && cp -R * /usr/local/ && cd / && rm -rf node-v* + +# Update rpmbuild, rpm and autoconf +RUN curl -O http://packages.wazuh.com/utils/autoconf/autoconf-2.69.tar.gz && \ + gunzip autoconf-2.69.tar.gz && tar xvf autoconf-2.69.tar && \ + cd autoconf-2.69 && ./configure && \ + make -j $(nproc) && make install && cd / && rm -rf autoconf-* + +RUN curl -O http://packages.wazuh.com/utils/rpm/rpm-4.15.1.tar.bz2 && \ + tar -xjf rpm-4.15.1.tar.bz2 && cd rpm-4.15.1 && \ + ./configure --without-lua && make -j $(nproc) && \ + make install && cd / && rm -rf rpm-* + +RUN mkdir -p /usr/local/var/lib/rpm && \ + cp /var/lib/rpm/Packages /usr/local/var/lib/rpm/Packages && \ + /usr/local/bin/rpm --rebuilddb && rm -rf /root/rpmbuild + +# Add the scripts to build the RPM package +ADD build.sh /usr/local/bin/build_package +RUN chmod +x /usr/local/bin/build_package +ADD helper_function.sh /usr/local/bin/helper_function.sh + +# Set the entrypoint +ENTRYPOINT ["/usr/local/bin/build_package"] diff --git a/packages/rpms/armhf/agent/Dockerfile b/packages/rpms/armhf/agent/Dockerfile new file mode 100644 index 0000000000..221cb36cdb --- /dev/null +++ b/packages/rpms/armhf/agent/Dockerfile @@ -0,0 +1,67 @@ +FROM arm32v7/centos:7 + +ADD build_deps.sh /build_deps.sh +RUN sh build_deps.sh + +RUN curl -OL http://packages.wazuh.com/utils/gcc/gcc-9.4.0.tar.gz && \ + tar xzf gcc-9.4.0.tar.gz && cd gcc-9.4.0/ && \ + linux32 ./contrib/download_prerequisites && \ + linux32 ./configure --prefix=/usr/local/gcc-9.4.0 --with-arch=armv7-a \ + --with-float=hard --with-fpu=vfpv3-d16 --enable-languages=c,c++ --disable-multilib \ + --disable-libsanitizer && \ + linux32 make -j$(nproc) && linux32 make install && \ + ln -fs /usr/local/gcc-9.4.0/bin/g++ /usr/bin/c++ && \ + ln -fs /usr/local/gcc-9.4.0/bin/gcc /usr/bin/cc && cd / && rm -rf gcc-* + +ENV CPLUS_INCLUDE_PATH "/usr/local/gcc-9.4.0/include/c++/9.4.0/" +ENV LD_LIBRARY_PATH "/usr/local/gcc-9.4.0/lib/" +ENV PATH "/usr/local/gcc-9.4.0/bin:${PATH}" + +RUN curl -OL http://packages.wazuh.com/utils/cmake/cmake-3.18.3.tar.gz && \ + tar -zxf cmake-3.18.3.tar.gz && cd cmake-3.18.3 && \ + linux32 ./bootstrap --no-system-curl CC=/usr/local/gcc-9.4.0/bin/gcc \ + CXX=/usr/local/gcc-9.4.0/bin/g++ && \ + linux32 make -j$(nproc) && linux32 make install && cd / && rm -rf cmake-* + +# Install Perl 5.10 +RUN curl -OL http://packages.wazuh.com/utils/perl/perl-5.10.1.tar.gz && \ + gunzip perl-5.10.1.tar.gz && tar -xf perl*.tar && \ + cd /perl-5.10.1 && ./Configure -des -Dcc='gcc' -Dusethreads && \ + make -j2 && make install && ln -fs /usr/local/bin/perl /bin/perl && \ + cd / && rm -rf /perl-5.10.1* + +RUN curl -O http://packages.wazuh.com/utils/openssl/openssl-1.1.1a.tar.gz && \ + tar -xzf openssl-1.1.1a.tar.gz && cd openssl* && \ + linux32 ./config -Wl,--enable-new-dtags,-rpath,'$(LIBRPATH)' && \ + linux32 make -j $(nproc) && linux32 make install && \ + make install && cd / && rm -rf openssl-* + +RUN curl -O http://packages.wazuh.com/utils/nodejs/node-v4.9.1-linux-armv7l.tar.xz && \ + tar -xJf node-v4.9.1-linux-armv7l.tar.xz && cd node-v4.9.1-linux-armv7l && cp -R * /usr/local/ && cd / && rm -rf node-v* + +# Update rpmbuild, rpm and autoconf +RUN curl -O http://packages.wazuh.com/utils/autoconf/autoconf-2.69.tar.gz && \ + gunzip autoconf-2.69.tar.gz && tar xvf autoconf-2.69.tar && \ + cd autoconf-2.69 && linux32 ./configure && linux32 make -j $(nproc) && \ + linux32 make install && cd / && rm -rf autoconf-* + +RUN curl -O http://packages.wazuh.com/utils/rpm/rpm-4.15.1.tar.bz2 && \ + tar -xjf rpm-4.15.1.tar.bz2 && cd rpm-4.15.1 && \ + linux32 ./configure --without-lua && linux32 make -j $(nproc) && \ + linux32 make install && cd / && rm -rf rpm-* + +RUN echo "%_initddir %{_sysconfdir}/rc.d/init.d" >> /root/.rpmmacros +RUN echo "%_initrddir %{_initddir}" >> /root/.rpmmacros +RUN echo "%_arch armv7hl" >> /root/.rpmmacros + +RUN mkdir -p /usr/local/var/lib/rpm && \ + cp /var/lib/rpm/Packages /usr/local/var/lib/rpm/Packages && \ + /usr/local/bin/rpm --rebuilddb && rm -rf /root/rpmbuild + +# Add the scripts to build the RPM package +ADD build.sh /usr/local/bin/build_package +RUN chmod +x /usr/local/bin/build_package +ADD helper_function.sh /usr/local/bin/helper_function.sh + +# Set the entrypoint +ENTRYPOINT ["/usr/local/bin/build_package"] diff --git a/packages/rpms/i386/agent/CentOS-Base.repo b/packages/rpms/i386/agent/CentOS-Base.repo new file mode 100644 index 0000000000..1cfb74d432 --- /dev/null +++ b/packages/rpms/i386/agent/CentOS-Base.repo @@ -0,0 +1,47 @@ +# CentOS-Base.repo +# +# The mirror system uses the connecting IP address of the client and the +# update status of each mirror to pick mirrors that are updated to and +# geographically close to the client. You should use this for CentOS updates +# unless you are manually picking other mirrors. +# +# If the mirrorlist= does not work for you, as a fall back you can try the +# remarked out baseurl= line instead. +# + + +[base] +name=CentOS-$releasever - Base +baseurl=http://mirror.nsc.liu.se/centos-store/6.10/os/i386/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#released updates +[updates] +name=CentOS-$releasever - Updates +baseurl=http://mirror.nsc.liu.se/centos-store/6.10/updates/i386/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#additional packages that may be useful +[extras] +name=CentOS-$releasever - Extras +baseurl=http://mirror.nsc.liu.se/centos-store/6.10/extras/i386/ +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#additional packages that extend functionality of existing packages +[centosplus] +name=CentOS-$releasever - Plus +baseurl=http://mirror.nsc.liu.se/centos-store/6.10/centosplus/i386/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 + +#contrib - packages by Centos Users +[contrib] +name=CentOS-$releasever - Contrib +baseurl=http://mirror.nsc.liu.se/centos-store/6.10/contrib/i386/ +gpgcheck=1 +enabled=0 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 diff --git a/packages/rpms/i386/agent/Dockerfile b/packages/rpms/i386/agent/Dockerfile new file mode 100644 index 0000000000..9fa107f380 --- /dev/null +++ b/packages/rpms/i386/agent/Dockerfile @@ -0,0 +1,74 @@ +FROM i386/centos:6 + +# Install all the necessary tools to build the packages +RUN rm /etc/yum.repos.d/* && echo "exactarch=1" >> /etc/yum.conf +COPY CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo +RUN yum clean all && yum update -y +RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 +RUN yum -y install util-linux-ng \ + gcc-multilib make wget git openssh-clients \ + sudo gnupg automake autoconf libtool \ + policycoreutils-python yum-utils epel-release \ + redhat-rpm-config rpm-devel autopoint gettext \ + zlib zlib-devel nspr nspr-devel \ + nss nss-devel kenel-headers magic magic-devel \ + db4 db4-devel rpm-build bison \ + sharutils bzip2-devel xz-devel lzo-devel \ + e2fsprogs-devel libacl-devel libattr-devel \ + openssl-devel libxml2-devel kexec-tools elfutils \ + libarchive-devel elfutils-libelf-devel \ + elfutils-libelf patchelf elfutils-devel libgcrypt-devel + +RUN yum-builddep python34 -y + +RUN curl -OL http://packages.wazuh.com/utils/perl/perl-5.10.1.tar.gz && \ + gunzip perl-5.10.1.tar.gz && tar -xf perl*.tar && \ + cd /perl-5.10.1 && ./Configure -des -Dcc='gcc' -Dusethreads && \ + make -j2 && make install && ln -fs /usr/local/bin/perl /bin/perl && \ + cd / && rm -rf /perl-5.10.1* + +# Update rpmbuild, rpm and autoconf +RUN curl -O http://packages.wazuh.com/utils/autoconf/autoconf-2.69.tar.gz && \ + gunzip autoconf-2.69.tar.gz && tar xvf autoconf-2.69.tar && \ + cd autoconf-2.69 && linux32 ./configure && \ + linux32 make -j$(nproc) && linux32 make install && cd / && rm -rf autoconf-* + +RUN curl -O https://packages.wazuh.com/utils/libarchive/libarchive-3.1.2-12.el7.src.rpm && \ + linux32 rpmbuild --rebuild libarchive-3.1.2-12.el7.src.rpm --target i386 && \ + rpm -Uvh /root/rpmbuild/RPMS/i386/* --nodeps && rm -rf libarchive-* + +RUN curl -O http://packages.wazuh.com/utils/rpm/rpm-4.15.1.tar.bz2 && \ + tar -xjf rpm-4.15.1.tar.bz2 && cd rpm-4.15.1 && \ + linux32 ./configure --without-lua && linux32 make -j$(nproc) && \ + linux32 make install && cd / && rm -rf rpm-* + +RUN mkdir -p /usr/local/var/lib/rpm && \ + cp /var/lib/rpm/Packages /usr/local/var/lib/rpm/Packages && \ + /usr/local/bin/rpm --rebuilddb && rm -rf /root/rpmbuild + +RUN curl -OL http://packages.wazuh.com/utils/gcc/gcc-9.4.0.tar.gz && \ + tar xzf gcc-9.4.0.tar.gz && cd gcc-9.4.0/ && \ + linux32 ./contrib/download_prerequisites && \ + linux32 ./configure --prefix=/usr/local/gcc-9.4.0 --enable-languages=c,c++ \ + --disable-multilib --disable-libsanitizer && \ + linux32 make -j$(nproc) && linux32 make install && \ + ln -fs /usr/local/gcc-9.4.0/bin/g++ /usr/bin/c++ && \ + ln -fs /usr/local/gcc-9.4.0/bin/gcc /usr/bin/cc && cd / && rm -rf gcc-* + +ENV CPLUS_INCLUDE_PATH "/usr/local/gcc-9.4.0/include/c++/9.4.0/" +ENV LD_LIBRARY_PATH "/usr/local/gcc-9.4.0/lib/" +ENV PATH "/usr/local/gcc-9.4.0/bin:${PATH}" + +RUN curl -OL http://packages.wazuh.com/utils/cmake/cmake-3.18.3.tar.gz && \ + tar -zxf cmake-3.18.3.tar.gz && cd cmake-3.18.3 && \ + linux32 ./bootstrap --no-system-curl CC=/usr/local/gcc-9.4.0/bin/gcc \ + CXX=/usr/local/gcc-9.4.0/bin/g++ && \ + linux32 make -j$(nproc) && linux32 make install && cd / && rm -rf cmake-* + +# Add the scripts to build the RPM package +ADD build.sh /usr/local/bin/build_package +RUN chmod +x /usr/local/bin/build_package +ADD helper_function.sh /usr/local/bin/helper_function.sh + +# Set the entrypoint +ENTRYPOINT ["/usr/local/bin/build_package"] diff --git a/packages/rpms/ppc64le/agent/Dockerfile b/packages/rpms/ppc64le/agent/Dockerfile new file mode 100644 index 0000000000..923fa769e1 --- /dev/null +++ b/packages/rpms/ppc64le/agent/Dockerfile @@ -0,0 +1,57 @@ +FROM ppc64le/centos:7 +# Install all the necessary tools to build the packages + +RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 +RUN yum -y install centos-release-scl +RUN mv /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo.old +RUN mv /etc/yum.repos.d/CentOS-SCLo-scl.repo /etc/yum.repos.d/CentOS-SCLo-scl.repo.old + +RUN yum -y install gcc make wget git \ + openssh-clients rpm-build sudo gnupg \ + automake autoconf libtool policycoreutils-python \ + yum-utils epel-release redhat-rpm-config rpm-devel + +# Warning: this repo has been disabled by the vendor +RUN mv /etc/yum.repos.d/CentOS-Sources.repo /etc/yum.repos.d/CentOS-Sources.repo.old +RUN yum-builddep python34 -y + +RUN yum install -y \ + http://packages.wazuh.com/utils/nodejs/nodejs-8.9.4-2.el7.ppc64le.rpm \ + http://packages.wazuh.com/utils/nodejs/nodejs-devel-8.9.4-2.el7.ppc64le.rpm \ + http://packages.wazuh.com/utils/nodejs/npm-5.6.0-1.8.9.4.2.el7.ppc64le.rpm \ + http://packages.wazuh.com/utils/nodejs/nodejs-debuginfo-8.9.4-2.el7.ppc64le.rpm + +RUN curl -OL http://packages.wazuh.com/utils/gcc/gcc-9.4.0.tar.gz && \ + tar xzf gcc-9.4.0.tar.gz && cd gcc-9.4.0/ && \ + ./contrib/download_prerequisites && \ + ./configure --prefix=/usr/local/gcc-9.4.0 --enable-languages=c,c++ \ + --disable-multilib --disable-libsanitizer && \ + make -j$(nproc) && make install && \ + ln -fs /usr/local/gcc-9.4.0/bin/g++ /usr/bin/c++ && \ + ln -fs /usr/local/gcc-9.4.0/bin/gcc /usr/bin/cc && cd / && rm -rf gcc-* + +ENV CPLUS_INCLUDE_PATH "/usr/local/gcc-9.4.0/include/c++/9.4.0/" +ENV LD_LIBRARY_PATH "/usr/local/gcc-9.4.0/lib64/" +ENV PATH "/usr/local/gcc-9.4.0/bin:${PATH}" + +RUN curl -OL http://packages.wazuh.com/utils/cmake/cmake-3.18.3.tar.gz && \ + tar -zxf cmake-3.18.3.tar.gz && cd cmake-3.18.3 && \ + ./bootstrap --no-system-curl CC=/usr/local/gcc-9.4.0/bin/gcc \ + CXX=/usr/local/gcc-9.4.0/bin/g++ && \ + make -j$(nproc) && make install && cd / && rm -rf cmake-* && \ + ln -sf /usr/bin/rpmbuild /usr/local/bin/rpmbuild + +# Install Perl 5.10 +RUN curl -OL http://packages.wazuh.com/utils/perl/perl-5.10.1.tar.gz && \ + gunzip perl-5.10.1.tar.gz && tar -xf perl*.tar && \ + cd /perl-5.10.1 && ./Configure -des -Dcc='gcc' -Dusethreads && \ + make -j2 && make install && ln -fs /usr/local/bin/perl /bin/perl && \ + cd / && rm -rf /perl-5.10.1* + +# Add the scripts to build the RPM package +ADD build.sh /usr/local/bin/build_package +RUN chmod +x /usr/local/bin/build_package +ADD helper_function.sh /usr/local/bin/helper_function.sh + +# Set the entrypoint +ENTRYPOINT ["/usr/local/bin/build_package"] diff --git a/packages/rpms/utils/build_deps.sh b/packages/rpms/utils/build_deps.sh new file mode 100644 index 0000000000..eae66870c5 --- /dev/null +++ b/packages/rpms/utils/build_deps.sh @@ -0,0 +1,318 @@ +rpm_url="http://packages.wazuh.com/utils/armv7hl" +rpm -ivh --force --ignorearch --nodeps \ +${rpm_url}/iproute-4.11.0-25.el7_7.2.armv7hl.rpm \ +${rpm_url}/dhclient-4.2.5-79.el7.centos.armv7hl.rpm \ +${rpm_url}/audit-libs-python-2.8.5-4.el7.armv7hl.rpm \ +${rpm_url}/audit-libs-2.8.5-4.el7.armv7hl.rpm \ +${rpm_url}/autoconf-2.69-11.el7.noarch.rpm \ +${rpm_url}/automake-1.13.4-3.el7.noarch.rpm \ +${rpm_url}/bash-4.2.46-34.el7.armv7hl.rpm \ +${rpm_url}/binutils-2.27-43.base.el7.armv7hl.rpm \ +${rpm_url}/bison-3.0.4-2.el7.armv7hl.rpm \ +${rpm_url}/bluez-libs-devel-5.44-6.el7.armv7hl.rpm \ +${rpm_url}/bluez-libs-5.44-6.el7.armv7hl.rpm \ +${rpm_url}/bzip2-devel-1.0.6-13.el7.armv7hl.rpm \ +${rpm_url}/bzip2-libs-1.0.6-13.el7.armv7hl.rpm \ +${rpm_url}/bzip2-1.0.6-13.el7.armv7hl.rpm \ +${rpm_url}/ca-certificates-2019.2.32-76.el7_7.noarch.rpm \ +${rpm_url}/checkpolicy-2.5-8.el7.armv7hl.rpm \ +${rpm_url}/chkconfig-1.7.4-1.el7.armv7hl.rpm \ +${rpm_url}/coreutils-8.22-24.el7.armv7hl.rpm \ +${rpm_url}/cpio-2.11-27.el7.armv7hl.rpm \ +${rpm_url}/cpp-4.8.5-39.el7.armv7hl.rpm \ +${rpm_url}/desktop-file-utils-0.23-2.el7.armv7hl.rpm \ +${rpm_url}/diffutils-3.3-5.el7.armv7hl.rpm \ +${rpm_url}/dracut-network-033-568.el7.armv7hl.rpm \ +${rpm_url}/dracut-033-568.el7.armv7hl.rpm \ +${rpm_url}/dwz-0.11-3.el7.armv7hl.rpm \ +${rpm_url}/e2fsprogs-devel-1.42.9-17.el7.armv7hl.rpm \ +${rpm_url}/e2fsprogs-libs-1.42.9-17.el7.armv7hl.rpm \ +${rpm_url}/elfutils-devel-0.176-4.el7.armv7hl.rpm \ +${rpm_url}/elfutils-libelf-devel-0.176-4.el7.armv7hl.rpm \ +${rpm_url}/elfutils-libelf-0.176-4.el7.armv7hl.rpm \ +${rpm_url}/elfutils-libs-0.176-4.el7.armv7hl.rpm \ +${rpm_url}/elfutils-0.176-4.el7.armv7hl.rpm \ +${rpm_url}/emacs-filesystem-24.3-23.el7.noarch.rpm \ +${rpm_url}/ethtool-4.8-10.el7.armv7hl.rpm \ +${rpm_url}/expat-devel-2.1.0-11.el7.armv7hl.rpm \ +${rpm_url}/expat-2.1.0-11.el7.armv7hl.rpm \ +${rpm_url}/file-devel-5.11-36.el7.armv7hl.rpm \ +${rpm_url}/file-libs-5.11-36.el7.armv7hl.rpm \ +${rpm_url}/file-5.11-36.el7.armv7hl.rpm \ +${rpm_url}/findutils-4.5.11-6.el7.armv7hl.rpm \ +${rpm_url}/fipscheck-lib-1.4.1-6.el7.armv7hl.rpm \ +${rpm_url}/gawk-4.0.2-4.el7_3.1.armv7hl.rpm \ +${rpm_url}/gcc-c%2B%2B-4.8.5-39.el7.armv7hl.rpm \ +${rpm_url}/gcc-4.8.5-39.el7.armv7hl.rpm \ +${rpm_url}/gdb-7.6.1-119.el7.armv7hl.rpm \ +${rpm_url}/gdbm-devel-1.10-8.el7.armv7hl.rpm \ +${rpm_url}/gdbm-1.10-8.el7.armv7hl.rpm \ +${rpm_url}/gettext-libs-0.19.8.1-3.el7.armv7hl.rpm \ +${rpm_url}/gettext-0.19.8.1-3.el7.armv7hl.rpm \ +${rpm_url}/git-1.8.3.1-21.el7_7.armv7hl.rpm \ +${rpm_url}/glib2-2.56.1-5.el7.armv7hl.rpm \ +${rpm_url}/glibc-devel-2.17-307.el7.1.armv7hl.rpm \ +${rpm_url}/glibc-headers-2.17-307.el7.1.armv7hl.rpm \ +${rpm_url}/glibc-2.17-307.el7.1.armv7hl.rpm \ +${rpm_url}/gmp-devel-6.0.0-15.el7.armv7hl.rpm \ +${rpm_url}/gmp-6.0.0-15.el7.armv7hl.rpm \ +${rpm_url}/gnupg2-2.0.22-5.el7_5.armv7hl.rpm \ +${rpm_url}/grep-2.20-3.el7.armv7hl.rpm \ +${rpm_url}/gzip-1.5-10.el7.armv7hl.rpm \ +${rpm_url}/info-5.1-5.el7.armv7hl.rpm \ +${rpm_url}/json-glib-1.4.2-2.el7.armv7hl.rpm \ +${rpm_url}/kexec-tools-2.0.15-43.el7.armv7hl.rpm \ +${rpm_url}/krb5-devel-1.15.1-46.el7.armv7hl.rpm \ +${rpm_url}/krb5-libs-1.15.1-46.el7.armv7hl.rpm \ +${rpm_url}/less-458-9.el7.armv7hl.rpm \ +${rpm_url}/libX11-devel-1.6.7-2.el7.armv7hl.rpm \ +${rpm_url}/libX11-1.6.7-2.el7.armv7hl.rpm \ +${rpm_url}/libXft-devel-2.3.2-2.el7.armv7hl.rpm \ +${rpm_url}/libacl-devel-2.2.51-15.el7.armv7hl.rpm \ +${rpm_url}/libacl-2.2.51-15.el7.armv7hl.rpm \ +${rpm_url}/libappstream-glib-0.7.8-2.el7.armv7hl.rpm \ +${rpm_url}/libarchive-devel-3.1.2-14.el7_7.armv7hl.rpm \ +${rpm_url}/libarchive-3.1.2-14.el7_7.armv7hl.rpm \ +${rpm_url}/libassuan-2.1.0-3.el7.armv7hl.rpm \ +${rpm_url}/libattr-devel-2.4.46-13.el7.armv7hl.rpm \ +${rpm_url}/libattr-2.4.46-13.el7.armv7hl.rpm \ +${rpm_url}/libcgroup-0.41-21.el7.armv7hl.rpm \ +${rpm_url}/libcom_err-devel-1.42.9-17.el7.armv7hl.rpm \ +${rpm_url}/libcom_err-1.42.9-17.el7.armv7hl.rpm \ +${rpm_url}/libcroco-0.6.12-4.el7.armv7hl.rpm \ +${rpm_url}/libcurl-7.29.0-57.el7.armv7hl.rpm \ +${rpm_url}/libdb-devel-5.3.21-25.el7.armv7hl.rpm \ +${rpm_url}/libdb-5.3.21-25.el7.armv7hl.rpm \ +${rpm_url}/libedit-3.0-12.20121213cvs.el7.armv7hl.rpm \ +${rpm_url}/libffi-devel-3.0.13-19.el7.armv7hl.rpm \ +${rpm_url}/libffi-3.0.13-19.el7.armv7hl.rpm \ +${rpm_url}/libgcab1-0.7-4.el7_4.armv7hl.rpm \ +${rpm_url}/libgcc-4.8.5-39.el7.armv7hl.rpm \ +${rpm_url}/libgcrypt-devel-1.5.3-14.el7.armv7hl.rpm \ +${rpm_url}/libgcrypt-1.5.3-14.el7.armv7hl.rpm \ +${rpm_url}/libgomp-4.8.5-39.el7.armv7hl.rpm \ +${rpm_url}/libgpg-error-devel-1.12-3.el7.armv7hl.rpm \ +${rpm_url}/libgpg-error-1.12-3.el7.armv7hl.rpm \ +${rpm_url}/libicu-50.2-3.el7.armv7hl.rpm \ +${rpm_url}/libmpc-1.0.1-3.el7.armv7hl.rpm \ +${rpm_url}/libselinux-python-2.5-15.el7.armv7hl.rpm \ +${rpm_url}/libsemanage-python-2.5-14.el7.armv7hl.rpm \ +${rpm_url}/libsepol-2.5-10.el7.armv7hl.rpm \ +${rpm_url}/libsoup-2.62.2-2.el7.armv7hl.rpm \ +${rpm_url}/libstdc%2B%2B-devel-4.8.5-39.el7.armv7hl.rpm \ +${rpm_url}/libstdc%2B%2B-4.8.5-39.el7.armv7hl.rpm \ +${rpm_url}/libtirpc-devel-0.2.4-0.16.el7.armv7hl.rpm \ +${rpm_url}/libtirpc-0.2.4-0.16.el7.armv7hl.rpm \ +${rpm_url}/libtool-2.4.2-22.el7_3.armv7hl.rpm \ +${rpm_url}/libunistring-0.9.3-9.el7.armv7hl.rpm \ +${rpm_url}/libuuid-devel-2.23.2-63.el7.armv7hl.rpm \ +${rpm_url}/libuuid-2.23.2-63.el7.armv7hl.rpm \ +${rpm_url}/libuv-1.37.0-1.el7.armv7hl.rpm \ +${rpm_url}/libxcb-devel-1.13-1.el7.armv7hl.rpm \ +${rpm_url}/libxml2-devel-2.9.1-6.el7.4.armv7hl.rpm \ +${rpm_url}/libxml2-python-2.9.1-6.el7.4.armv7hl.rpm \ +${rpm_url}/libxml2-2.9.1-6.el7.4.armv7hl.rpm \ +${rpm_url}/lua-5.1.4-15.el7.armv7hl.rpm \ +${rpm_url}/lzo-devel-2.06-8.el7.armv7hl.rpm \ +${rpm_url}/lzo-minilzo-2.06-8.el7.armv7hl.rpm \ +${rpm_url}/lzo-2.06-8.el7.armv7hl.rpm \ +${rpm_url}/m4-1.4.16-10.el7.armv7hl.rpm \ +${rpm_url}/make-3.82-24.el7.armv7hl.rpm \ +${rpm_url}/man-db-2.6.3-11.el7.armv7hl.rpm \ +${rpm_url}/mpfr-3.1.1-4.el7.armv7hl.rpm \ +${rpm_url}/ncurses-devel-5.9-14.20130511.el7_4.armv7hl.rpm \ +${rpm_url}/ncurses-libs-5.9-14.20130511.el7_4.armv7hl.rpm \ +${rpm_url}/nodejs-6.17.1-1.el7.armv7hl.rpm \ +${rpm_url}/npm-3.10.10-1.6.17.1.1.el7.armv7hl.rpm \ +${rpm_url}/nspr-devel-4.21.0-1.el7.armv7hl.rpm \ +${rpm_url}/nspr-4.21.0-1.el7.armv7hl.rpm \ +${rpm_url}/nss-devel-3.44.0-7.el7_7.armv7hl.rpm \ +${rpm_url}/nss-pem-1.0.3-7.el7.armv7hl.rpm \ +${rpm_url}/nss-softokn-devel-3.44.0-8.el7_7.armv7hl.rpm \ +${rpm_url}/nss-softokn-3.44.0-8.el7_7.armv7hl.rpm \ +${rpm_url}/nss-sysinit-3.44.0-7.el7_7.armv7hl.rpm \ +${rpm_url}/nss-util-devel-3.44.0-4.el7_7.armv7hl.rpm \ +${rpm_url}/nss-util-3.44.0-4.el7_7.armv7hl.rpm \ +${rpm_url}/nss-3.44.0-7.el7_7.armv7hl.rpm \ +${rpm_url}/openldap-2.4.44-21.el7_6.armv7hl.rpm \ +${rpm_url}/openssh-clients-7.4p1-21.el7.armv7hl.rpm \ +${rpm_url}/openssh-7.4p1-21.el7.armv7hl.rpm \ +${rpm_url}/openssl-devel-1.0.2k-19.el7.armv7hl.rpm \ +${rpm_url}/openssl-libs-1.0.2k-19.el7.armv7hl.rpm \ +${rpm_url}/pam-1.1.8-23.el7.armv7hl.rpm \ +${rpm_url}/patch-2.7.1-12.el7_7.armv7hl.rpm \ +${rpm_url}/patchelf-0.9-10.el7.armv7hl.rpm \ +${rpm_url}/pcre-8.32-17.el7.armv7hl.rpm \ +${rpm_url}/perl-Carp-1.26-244.el7.noarch.rpm \ +${rpm_url}/perl-Data-Dumper-2.145-3.el7.armv7hl.rpm \ +${rpm_url}/perl-Error-0.17020-2.el7.noarch.rpm \ +${rpm_url}/perl-Exporter-5.68-3.el7.noarch.rpm \ +${rpm_url}/perl-File-Path-2.09-2.el7.noarch.rpm \ +${rpm_url}/perl-File-Temp-0.23.01-3.el7.noarch.rpm \ +${rpm_url}/perl-Getopt-Long-2.40-3.el7.noarch.rpm \ +${rpm_url}/perl-Git-1.8.3.1-21.el7_7.noarch.rpm \ +${rpm_url}/perl-PathTools-3.40-5.el7.armv7hl.rpm \ +${rpm_url}/perl-TermReadKey-2.30-20.el7.armv7hl.rpm \ +${rpm_url}/perl-Test-Harness-3.28-3.el7.noarch.rpm \ +${rpm_url}/perl-Text-ParseWords-3.29-4.el7.noarch.rpm \ +${rpm_url}/perl-Thread-Queue-3.02-2.el7.noarch.rpm \ +${rpm_url}/perl-constant-1.27-2.el7.noarch.rpm \ +${rpm_url}/perl-srpm-macros-1-8.el7.noarch.rpm \ +${rpm_url}/perl-threads-1.87-4.el7.armv7hl.rpm \ +${rpm_url}/perl-5.16.3-295.el7.armv7hl.rpm \ +${rpm_url}/pinentry-0.8.1-17.el7.armv7hl.rpm \ +${rpm_url}/pkgconfig-0.27.1-4.el7.armv7hl.rpm \ +${rpm_url}/policycoreutils-python-2.5-34.el7.armv7hl.rpm \ +${rpm_url}/policycoreutils-2.5-34.el7.armv7hl.rpm \ +${rpm_url}/popt-devel-1.13-16.el7.armv7hl.rpm \ +${rpm_url}/popt-1.13-16.el7.armv7hl.rpm \ +${rpm_url}/pth-2.0.7-23.el7.armv7hl.rpm \ +${rpm_url}/python-IPy-0.75-6.el7.noarch.rpm \ +${rpm_url}/python-kitchen-1.1.1-5.el7.noarch.rpm \ +${rpm_url}/python-libs-2.7.5-88.el7.armv7hl.rpm \ +${rpm_url}/python-rpm-macros-3-32.el7.noarch.rpm \ +${rpm_url}/python-srpm-macros-3-32.el7.noarch.rpm \ +${rpm_url}/python-2.7.5-88.el7.armv7hl.rpm \ +${rpm_url}/python34-libs-3.4.10-4.el7.armv7hl.rpm \ +${rpm_url}/python34-3.4.10-4.el7.armv7hl.rpm \ +${rpm_url}/readline-devel-6.2-11.el7.armv7hl.rpm \ +${rpm_url}/readline-6.2-11.el7.armv7hl.rpm \ +${rpm_url}/redhat-rpm-config-9.1.0-88.el7.centos.noarch.rpm \ +${rpm_url}/rpm-build-libs-4.11.3-43.el7.armv7hl.rpm \ +${rpm_url}/rpm-build-4.11.3-43.el7.armv7hl.rpm \ +${rpm_url}/rpm-devel-4.11.3-43.el7.armv7hl.rpm \ +${rpm_url}/rpm-libs-4.11.3-43.el7.armv7hl.rpm \ +${rpm_url}/rpm-4.11.3-43.el7.armv7hl.rpm \ +${rpm_url}/rsync-3.1.2-10.el7.armv7hl.rpm \ +${rpm_url}/sed-4.2.2-6.el7.armv7hl.rpm \ +${rpm_url}/setools-libs-3.3.8-4.el7.armv7hl.rpm \ +${rpm_url}/sharutils-4.13.3-8.el7.armv7hl.rpm \ +${rpm_url}/snappy-1.1.0-3.el7.armv7hl.rpm \ +${rpm_url}/sqlite-devel-3.7.17-8.el7_7.1.armv7hl.rpm \ +${rpm_url}/sqlite-3.7.17-8.el7_7.1.armv7hl.rpm \ +${rpm_url}/sudo-1.8.23-9.el7.armv7hl.rpm \ +${rpm_url}/systemd-219-73.el7.1.armv7hl.rpm \ +${rpm_url}/tar-1.26-35.el7.armv7hl.rpm \ +${rpm_url}/tcl-devel-8.5.13-8.el7.armv7hl.rpm \ +${rpm_url}/tcl-8.5.13-8.el7.armv7hl.rpm \ +${rpm_url}/tix-devel-8.4.3-12.el7.armv7hl.rpm \ +${rpm_url}/tix-8.4.3-12.el7.armv7hl.rpm \ +${rpm_url}/tk-devel-8.5.13-6.el7.armv7hl.rpm \ +${rpm_url}/tk-8.5.13-6.el7.armv7hl.rpm \ +${rpm_url}/unzip-6.0-21.el7.armv7hl.rpm \ +${rpm_url}/valgrind-devel-3.15.0-11.el7.armv7hl.rpm \ +${rpm_url}/valgrind-3.15.0-11.el7.armv7hl.rpm \ +${rpm_url}/vim-minimal-7.4.629-6.el7.armv7hl.rpm \ +${rpm_url}/xorg-x11-proto-devel-2018.4-1.el7.noarch.rpm \ +${rpm_url}/xz-devel-5.2.2-1.el7.armv7hl.rpm \ +${rpm_url}/xz-libs-5.2.2-1.el7.armv7hl.rpm \ +${rpm_url}/xz-5.2.2-1.el7.armv7hl.rpm \ +${rpm_url}/yum-utils-1.1.31-53.el7.noarch.rpm \ +${rpm_url}/yum-3.4.3-167.el7.centos.noarch.rpm \ +${rpm_url}/zip-3.0-11.el7.armv7hl.rpm \ +${rpm_url}/zlib-devel-1.2.7-18.el7.armv7hl.rpm \ +${rpm_url}/zlib-1.2.7-18.el7.armv7hl.rpm \ +${rpm_url}/fipscheck-1.4.1-6.el7.armv7hl.rpm \ +${rpm_url}/libatomic-4.8.5-39.el7.armv7hl.rpm \ +${rpm_url}/jasper-1.900.1-33.el7.armv7hl.rpm \ +${rpm_url}/jasper-devel-1.900.1-33.el7.armv7hl.rpm \ +${rpm_url}/jasper-libs-1.900.1-33.el7.armv7hl.rpm \ +${rpm_url}/jasper-utils-1.900.1-33.el7.armv7hl.rpm \ +${rpm_url}/kernel-headers-5.4.28-200.el7.armv7hl.rpm \ +${rpm_url}/glibc-common-2.17-307.el7.1.armv7hl.rpm \ +${rpm_url}/keyutils-libs-devel-1.5.8-3.el7.armv7hl.rpm \ +${rpm_url}/libmnl-1.0.3-7.el7.armv7hl.rpm \ +${rpm_url}/iptables-1.4.21-34.el7.armv7hl.rpm \ +${rpm_url}/iptables-devel-1.4.21-34.el7.armv7hl.rpm \ +${rpm_url}/hostname-3.13-3.el7_7.1.armv7hl.rpm \ +${rpm_url}/initscripts-9.49.49-1.el7.armv7hl.rpm \ +${rpm_url}/dhcp-4.2.5-79.el7.centos.armv7hl.rpm \ +${rpm_url}/dhcp-devel-4.2.5-79.el7.centos.armv7hl.rpm \ +${rpm_url}/dhcp-libs-4.2.5-79.el7.centos.armv7hl.rpm \ +${rpm_url}/dhcp-common-4.2.5-79.el7.centos.armv7hl.rpm \ +${rpm_url}/bind-export-devel-9.11.4-16.P2.el7.armv7hl.rpm \ +${rpm_url}/bind-export-libs-9.11.4-16.P2.el7.armv7hl.rpm \ +${rpm_url}/libkadm5-1.15.1-46.el7.armv7hl.rpm \ +${rpm_url}/libselinux-2.5-15.el7.armv7hl.rpm \ +${rpm_url}/libselinux-devel-2.5-15.el7.armv7hl.rpm \ +${rpm_url}/libverto-0.2.5-4.el7.armv7hl.rpm \ +${rpm_url}/libverto-devel-0.2.5-4.el7.armv7hl.rpm \ +${rpm_url}/groff-base-1.22.2-8.el7.armv7hl.rpm \ +${rpm_url}/libX11-common-1.6.7-2.el7.noarch.rpm \ +${rpm_url}/libxcb-devel-1.13-1.el7.armv7hl.rpm \ +${rpm_url}/libXft-2.3.2-2.el7.armv7hl.rpm \ +${rpm_url}/pkgconfig-0.27.1-4.el7.armv7hl.rpm \ +${rpm_url}/glib-networking-2.56.1-1.el7.armv7hl.rpm \ +${rpm_url}/libxcb-1.13-1.el7.armv7hl.rpm \ +${rpm_url}/groff-base-1.22.2-8.el7.armv7hl.rpm \ +${rpm_url}/libpipeline-1.2.3-3.el7.armv7hl.rpm \ +${rpm_url}/ncurses-5.9-14.20130511.el7_4.armv7hl.rpm \ +${rpm_url}/ncurses-base-5.9-14.20130511.el7_4.noarch.rpm \ +${rpm_url}/nss-softokn-freebl-devel-3.44.0-8.el7_7.armv7hl.rpm \ +${rpm_url}/nss-softokn-freebl-3.44.0-8.el7_7.armv7hl.rpm \ +${rpm_url}/perl-libs-5.16.3-295.el7.armv7hl.rpm \ +${rpm_url}/perl-Scalar-List-Utils-1.27-248.el7.armv7hl.rpm \ +${rpm_url}/perl-Pod-Usage-1.63-3.el7.noarch.rpm \ +${rpm_url}/perl-Time-Local-1.2300-2.el7.noarch.rpm \ +${rpm_url}/perl-Pod-Simple-3.28-4.el7.noarch.rpm \ +${rpm_url}/perl-threads-shared-1.43-6.el7.armv7hl.rpm \ +${rpm_url}/perl-macros-5.16.3-295.el7.armv7hl.rpm \ +${rpm_url}/libjpeg-turbo-1.2.90-8.el7.armv7hl.rpm \ +${rpm_url}/libjpeg-turbo-devel-1.2.90-8.el7.armv7hl.rpm \ +${rpm_url}/libjpeg-turbo-utils-1.2.90-8.el7.armv7hl.rpm \ +${rpm_url}/freetype-2.8-14.el7.armv7hl.rpm \ +${rpm_url}/freetype-devel-2.8-14.el7.armv7hl.rpm \ +${rpm_url}/fontconfig-2.13.0-4.3.el7.armv7hl.rpm \ +${rpm_url}/fontconfig-devel-2.13.0-4.3.el7.armv7hl.rpm \ +${rpm_url}/libXrender-0.9.10-1.el7.armv7hl.rpm \ +${rpm_url}/libXrender-devel-0.9.10-1.el7.armv7hl.rpm \ +${rpm_url}/libXau-1.0.8-2.1.el7.armv7hl.rpm \ +${rpm_url}/libXau-devel-1.0.8-2.1.el7.armv7hl.rpm \ +${rpm_url}/perl-Filter-1.49-3.el7.armv7hl.rpm \ +${rpm_url}/perl-Socket-2.010-5.el7.armv7hl.rpm \ +${rpm_url}/perl-Storable-2.45-3.el7.armv7hl.rpm \ +${rpm_url}/perl-Time-HiRes-1.9725-3.el7.armv7hl.rpm \ +${rpm_url}/libselinux-utils-2.5-15.el7.armv7hl.rpm \ +${rpm_url}/systemd-libs-219-73.el7.1.armv7hl.rpm \ +${rpm_url}/libglvnd-glx-1.0.1-0.8.git5baa1e5.el7.armv7hl.rpm \ +${rpm_url}/mesa-libGLU-9.0.0-4.el7.armv7hl.rpm \ +${rpm_url}/mesa-libGLU-devel-9.0.0-4.el7.armv7hl.rpm \ +${rpm_url}/freeglut-3.0.0-8.el7.armv7hl.rpm \ +${rpm_url}/freeglut-devel-3.0.0-8.el7.armv7hl.rpm \ +${rpm_url}/libnetfilter_conntrack-1.0.6-1.el7_3.armv7hl.rpm \ +${rpm_url}/libnetfilter_conntrack-devel-1.0.6-1.el7_3.armv7hl.rpm \ +${rpm_url}/libnfnetlink-1.0.1-4.el7.armv7hl.rpm \ +${rpm_url}/libnfnetlink-devel-1.0.1-4.el7.armv7hl.rpm \ +${rpm_url}/sysvinit-tools-2.88-14.dsf.el7.armv7hl.rpm \ +${rpm_url}/libcap-devel-2.22-11.el7.armv7hl.rpm \ +${rpm_url}/libcap-2.22-11.el7.armv7hl.rpm \ +${rpm_url}/libsepol-2.5-10.el7.armv7hl.rpm \ +${rpm_url}/libsepol-devel-2.5-10.el7.armv7hl.rpm \ +${rpm_url}/libnetfilter_conntrack-1.0.6-1.el7_3.armv7hl.rpm \ +${rpm_url}/libnetfilter_conntrack-devel-1.0.6-1.el7_3.armv7hl.rpm \ +${rpm_url}/glib2-devel-2.56.1-5.el7.armv7hl.rpm \ +${rpm_url}/glib2-2.56.1-5.el7.armv7hl.rpm \ +${rpm_url}/gsettings-desktop-schemas-devel-3.28.0-3.el7.armv7hl.rpm \ +${rpm_url}/gsettings-desktop-schemas-3.28.0-3.el7.armv7hl.rpm \ +${rpm_url}/gnutls-3.3.29-9.el7_6.armv7hl.rpm \ +${rpm_url}/libproxy-0.4.11-11.el7.armv7hl.rpm \ +${rpm_url}/libproxy-devel-0.4.11-11.el7.armv7hl.rpm \ +${rpm_url}/perl-podlators-2.5.1-3.el7.noarch.rpm \ +${rpm_url}/perl-Pod-Perldoc-3.20-4.el7.noarch.rpm \ +${rpm_url}/perl-Encode-2.51-7.el7.armv7hl.rpm \ +${rpm_url}/perl-Pod-Escapes-1.04-295.el7.noarch.rpm \ +${rpm_url}/dejavu-sans-fonts-2.33-6.el7.noarch.rpm \ +${rpm_url}/fontpackages-filesystem-1.44-8.el7.noarch.rpm \ +${rpm_url}/libglvnd-1.0.1-0.8.git5baa1e5.el7.armv7hl.rpm \ +${rpm_url}/libXext-1.3.3-3.el7.armv7hl.rpm \ +${rpm_url}/libXext-devel-1.3.3-3.el7.armv7hl.rpm \ +${rpm_url}/libglvnd-1.0.1-0.8.git5baa1e5.el7.armv7hl.rpm \ +${rpm_url}/mesa-libGL-18.3.4-7.el7.armv7hl.rpm \ +${rpm_url}/mesa-libGL-devel-18.3.4-7.el7.armv7hl.rpm \ +${rpm_url}/gl-manpages-1.1-7.20130122.el7.noarch.rpm \ +${rpm_url}/libICE-1.0.9-9.el7.armv7hl.rpm \ +${rpm_url}/libICE-devel-1.0.9-9.el7.armv7hl.rpm \ +${rpm_url}/wget-1.14-18.el7_6.1.armv7hl.rpm \ +${rpm_url}/libcurl-devel-7.29.0-57.el7.armv7hl.rpm \ +${rpm_url}/cmake3-data-3.17.3-3.el7.noarch.rpm \ +${rpm_url}/cmake3-3.17.3-3.el7.armv7hl.rpm diff --git a/packages/rpms/utils/helper_function.sh b/packages/rpms/utils/helper_function.sh new file mode 100644 index 0000000000..3e4e4a59f2 --- /dev/null +++ b/packages/rpms/utils/helper_function.sh @@ -0,0 +1,103 @@ +#!/bin/bash + +# RPM helper functions + +# Wazuh package builder +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. + +rpmbuild="rpmbuild" +rpm_build_dir="" # To be define on setup_build + +setup_build(){ + sources_dir="$1" + specs_path="$2" + build_dir="$3" + package_name="$4" + + rpm_build_dir=${build_dir}/rpmbuild + + mkdir -p ${rpm_build_dir}/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} + + cp ${specs_path}/wazuh-${BUILD_TARGET}.spec ${rpm_build_dir}/SPECS/${package_name}.spec + + # Generating source tar.gz + cd ${build_dir}/${BUILD_TARGET} && tar czf "${rpm_build_dir}/SOURCES/${package_name}.tar.gz" "${package_name}" +} + +set_debug(){ + local debug="$1" + if [[ "${debug}" == "no" ]]; then + echo '%debug_package %{nil}' > /etc/rpm/macros + fi +} + +build_deps(){ + local legacy="$1" + if [ "${legacy}" = "no" ]; then + echo "%_source_filedigest_algorithm 8" >> /root/.rpmmacros + echo "%_binary_filedigest_algorithm 8" >> /root/.rpmmacros + if [ "${BUILD_TARGET}" = "agent" ]; then + echo " %rhel 6" >> /root/.rpmmacros + echo " %centos 6" >> /root/.rpmmacros + echo " %centos_ver 6" >> /root/.rpmmacros + echo " %dist .el6" >> /root/.rpmmacros + echo " %el6 1" >> /root/.rpmmacros + fi + rpmbuild="/usr/local/bin/rpmbuild" + fi +} + +build_package(){ + package_name="$1" + debug="$2" + short_commit_hash="$3" + wazuh_version="$4" + + if [ "${ARCHITECTURE_TARGET}" = "i386" ] || [ "${ARCHITECTURE_TARGET}" = "armhf" ]; then + linux="linux32" + fi + + if [ "${ARCHITECTURE_TARGET}" = "armhf" ]; then + ARCH="armv7hl" + elif [ "${ARCHITECTURE_TARGET}" = "arm64" ]; then + ARCH="aarch64" + elif [ "${ARCHITECTURE_TARGET}" = "amd64" ]; then + ARCH="x86_64" + elif [[ "${ARCHITECTURE_TARGET}" == "i386" ]] || [[ "${ARCHITECTURE_TARGET}" == "ppc64le" ]]; then + ARCH=${ARCHITECTURE_TARGET} + else + echo "Invalid architecture selected. Choose: [armhf, arm64, amd64, i386, ppc64le]" + return 1 + fi + + $linux $rpmbuild --define "_sysconfdir /etc" --define "_topdir ${rpm_build_dir}" \ + --define "_threads ${JOBS}" --define "_release ${REVISION}" --define "_isstage ${IS_STAGE}" \ + --define "_localstatedir ${INSTALLATION_PATH}" --define "_debugenabled ${debug}" \ + --define "_version ${wazuh_version}" --define "_hashcommit ${short_commit_hash}" \ + --target $ARCH -ba ${rpm_build_dir}/SPECS/${package_name}.spec + return $? +} + +get_package_and_checksum(){ + src="$3" + export RPM_NAME=$(ls -R ${rpm_build_dir}/RPMS | grep "\.rpm$") + export SRC_NAME=$(ls -R ${rpm_build_dir}/SRPMS | grep "\.src\.rpm$") + + if [[ "${checksum}" == "yes" ]]; then + cd "${rpm_build_dir}/RPMS" && sha512sum $RPM_NAME > /var/local/wazuh/$RPM_NAME.sha512 + if [[ "${src}" == "yes" ]]; then + cd "${rpm_build_dir}/SRPMS" && sha512sum $SRC_NAME > /var/local/wazuh/$SRC_NAME.sha512 + fi + fi + + if [[ "${src}" == "yes" ]]; then + mv ${rpm_build_dir}/SRPMS/$SRC_NAME /var/local/wazuh + else + mv ${rpm_build_dir}/RPMS/$RPM_NAME /var/local/wazuh + fi +} diff --git a/packages/windows/Dockerfile b/packages/windows/Dockerfile new file mode 100644 index 0000000000..79fd0b2f0f --- /dev/null +++ b/packages/windows/Dockerfile @@ -0,0 +1,16 @@ +FROM ubuntu:22.04 + +# Installing necessary packages +RUN apt-get update && \ + apt-get install -y --allow-change-held-packages gcc g++ gcc-mingw-w64 g++-mingw-w64 nsis make wget unzip \ + curl perl binutils zip libssl-dev + +RUN curl -OL http://packages.wazuh.com/utils/cmake/cmake-3.18.3.tar.gz && \ + tar -zxvf cmake-3.18.3.tar.gz && \ + cd cmake-3.18.3 && \ + ./bootstrap && make -j$(nproc) && make install && \ + ln -s /usr/local/bin/cmake /usr/bin/cmake && cd / && rm -rf cmake-* + +ADD entrypoint.sh / + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/packages/windows/entrypoint.sh b/packages/windows/entrypoint.sh new file mode 100755 index 0000000000..03e5e5920f --- /dev/null +++ b/packages/windows/entrypoint.sh @@ -0,0 +1,33 @@ +#! /bin/bash + +set -ex + +JOBS=$1 +DEBUG=$2 +ZIP_NAME=$3 +TRUST_VERIFICATION=$4 +CA_NAME=$5 + +# Compile the wazuh agent for Windows +FLAGS="-j ${JOBS} IMAGE_TRUST_CHECKS=${TRUST_VERIFICATION} CA_NAME=\"${CA_NAME}\" " + +if [[ "${DEBUG}" = "yes" ]]; then + FLAGS+="DEBUG=1 " +fi + +if [ -z "${BRANCH}"]; then + mkdir /wazuh-local-src + cp -r /local-src/* /wazuh-local-src +else + URL_REPO=https://github.com/wazuh/wazuh/archive/${BRANCH}.zip + + # Download the wazuh repository + wget -O wazuh.zip ${URL_REPO} && unzip wazuh.zip +fi + +bash -c "make -C /wazuh-*/src deps TARGET=winagent ${FLAGS}" +bash -c "make -C /wazuh-*/src TARGET=winagent ${FLAGS}" + +rm -rf /wazuh-*/src/external + +zip -r /shared/${ZIP_NAME} /wazuh-* diff --git a/packages/windows/generate_compiled_windows_agent.sh b/packages/windows/generate_compiled_windows_agent.sh new file mode 100755 index 0000000000..96d5ba60a4 --- /dev/null +++ b/packages/windows/generate_compiled_windows_agent.sh @@ -0,0 +1,153 @@ +#! /bin/bash +set -ex + +BRANCH="" +JOBS="4" +ZIP_NAME="" +DEBUG="no" +OUTDIR="$(pwd)" +TRUST_VERIFICATION="1" +BUILD_DOCKER="yes" +DOCKER_TAG="latest" +CA_NAME="DigiCert Assured ID Root CA" +CUSTOM_CODE_VOL="" +DOCKERFILE_PATH="./" +DOCKER_IMAGE_NAME="compile_windows_agent" +TAG=$1 + + +help() { + set +x + echo + echo "Usage: $0 [OPTIONS]" + echo + echo " -b, --branch [Optional] Select Git branch to compile Wazuh code." + echo " --sources [Optional] Absolute path containing wazuh source code. This option will use local source code instead of downloading it from GitHub. By default: '../../src'." + echo " -o, --output [Required] Name to the output package." + echo " -j, --jobs [Optional] Change number of parallel jobs when compiling the Windows agent. By default: 4." + echo " -s, --store [Optional] Set the directory where the package will be stored. By default the current path." + echo " -d, --debug [Optional] Build the binaries with debug symbols. By default: no." + echo " -t, --trust_verification [Optional] Build the binaries with trust load images verification. By default: 1 (only warnings)." + echo " -c, --ca_name [Optional] CA name to be used to verify the trust of the agent. By default: DigiCert Assured ID Root CA." + echo " --dont-build-docker [Optional] Locally built docker image will be used instead of generating a new one." + echo " --tag [Optional] Tag to use with the docker image." + echo " -h, --help Show this help." + echo + exit $1 +} + + +main() { + while [ -n "$1" ] + do + case "$1" in + "-b"|"--branch") + if [ -n "$2" ]; then + BRANCH="$2" + shift 2 + else + help 1 + fi + ;; + "-h"|"--help") + help 0 + ;; + "-j"|"--jobs") + if [ -n "$2" ]; then + JOBS="$2" + shift 2 + else + help 1 + fi + ;; + "-o"|"--output") + if [ -n "$2" ]; then + ZIP_NAME="$2" + shift 2 + else + help 1 + fi + ;; + "-d"|"--debug") + DEBUG="yes" + shift 1 + ;; + "-s"|"--store") + if [ -n "$2" ]; then + OUTDIR="$2" + shift 2 + else + help 1 + fi + ;; + "-t"|"--trust_verification") + if [ -n "$2" ]; then + TRUST_VERIFICATION="$2" + shift 2 + else + help 1 + fi + ;; + "-c"|"--ca_name") + if [ -n "$2" ]; then + CA_NAME="$2" + shift 2 + else + help 1 + fi + ;; + "--dont-build-docker") + BUILD_DOCKER="no" + shift 1 + ;; + "--tag") + if [ -n "$2" ]; then + DOCKER_TAG="$2" + shift 2 + else + help 1 + fi + ;; + "--sources") + if [ -n "$2" ]; then + CUSTOM_CODE_VOL="-v $2:/local-src:Z" + shift 2 + else + help 1 + fi + ;; + *) + help 1 + esac + done + + if [ -z "${ZIP_NAME}" ]; then + help |grep -B5 --color "^.*--output.*$" & exit 1 + fi + + if [ ! -d "${OUTDIR}" ]; then + echo "Creating building directory at ${OUTDIR}" + mkdir -p ${OUTDIR} + fi + + if [ -z "${CUSTOM_CODE_VOL}" ]; then + cd ../.. + CUSTOM_CODE_VOL="-v $(pwd):/local-src:Z" + cd packages/windows + fi + + if [[ ${BUILD_DOCKER} == "yes" ]]; then + docker build -t ${DOCKER_IMAGE_NAME}:${DOCKER_TAG} ./ || exit 1 + fi + + if [ -n "${BRANCH}" ]; then + ENV_BRANCH="-e BRANCH=${BRANCH}" + fi + + docker run --rm -v ${OUTDIR}:/shared ${CUSTOM_CODE_VOL} ${ENV_BRANCH} ${DOCKER_IMAGE_NAME}:${DOCKER_TAG} ${JOBS} ${DEBUG} ${ZIP_NAME} ${TRUST_VERIFICATION} "${CA_NAME}" || exit 1 + echo "Package $(ls -Art ${OUTDIR} | tail -n 1) added to ${OUTDIR}." + + exit 0 +} + +main "$@" diff --git a/packages/windows/generate_wazuh_msi.ps1 b/packages/windows/generate_wazuh_msi.ps1 new file mode 100644 index 0000000000..99ec154b1c --- /dev/null +++ b/packages/windows/generate_wazuh_msi.ps1 @@ -0,0 +1,86 @@ +# Created by Wazuh, Inc. . +# This program is a free software; you can redistribute it and/or modify it under the terms of GPLv2 + +param ( + [string]$MSI_NAME = "wazuh-agent.msi", + [string]$SIGN = "no", + [string]$WIX_TOOLS_PATH = "", + [string]$SIGN_TOOLS_PATH = "", + [switch]$help + ) + +$CANDLE_EXE = "candle.exe" +$LIGHT_EXE = "light.exe" +$SIGNTOOL_EXE = "signtool.exe" + +if(($help.isPresent)) { + " + This tool can be used to generate the Windows Wazuh agent msi package. + + PARAMETERS TO BUILD WAZUH-AGENT MSI (OPTIONALS): + 1. MSI_NAME: MSI package name output. + 2. SIGN: yes or no. By default 'no'. + 3. WIX_TOOLS_PATH: Wix tools path. + 4. SIGN_TOOLS_PATH: sign tools path. + + USAGE: + + * WAZUH: + $ ./generate_wazuh_msi.ps1 -MSI_NAME {{ NAME }} -SIGN {{ yes|no }} -WIX_TOOLS_PATH {{ PATH }} -SIGN_TOOLS_PATH {{ PATH }} + + Build a devel msi: $ ./generate_wazuh_msi.ps1 -MSI_NAME wazuh-agent_4.9.0-0_windows_0ceb378.msi -SIGN no + Build a prod msi: $ ./generate_wazuh_msi.ps1 -MSI_NAME wazuh-agent-4.9.0-1.msi -SIGN yes + " + Exit +} + +# Get Power Shell version. +$PSversion = $PSVersionTable.PSVersion.Major +if ($PSversion -eq $null) { + $PSversion = 1 # $PSVersionTable is new with Powershell 2.0 +} + +function BuildWazuhMsi(){ + Write-Host "MSI_NAME = $MSI_NAME" + + if($WIX_TOOLS_PATH -ne ""){ + $CANDLE_EXE = $WIX_TOOLS_PATH + "/" + $CANDLE_EXE + $LIGHT_EXE = $WIX_TOOLS_PATH + "/" + $LIGHT_EXE + } + + if($SIGN_TOOLS_PATH -ne ""){ + $SIGNTOOL_EXE = $SIGN_TOOLS_PATH + "/" + $SIGNTOOL_EXE + } + + if($SIGN -eq "yes"){ + # Sign .exe files and the InstallerScripts.vbs + Write-Host "Signing .exe files..." + & $SIGNTOOL_EXE sign /a /tr http://timestamp.digicert.com /fd SHA256 /td SHA256 ".\*.exe" + Write-Host "Signing .vbs files..." + & $SIGNTOOL_EXE sign /a /tr http://timestamp.digicert.com /fd SHA256 /td SHA256 ".\InstallerScripts.vbs" + Write-Host "Signing .dll files..." + & $SIGNTOOL_EXE sign /a /tr http://timestamp.digicert.com /fd SHA256 /td SHA256 "..\*.dll" + & $SIGNTOOL_EXE sign /a /tr http://timestamp.digicert.com /fd SHA256 /td SHA256 ".\*.dll" + & $SIGNTOOL_EXE sign /a /tr http://timestamp.digicert.com /fd SHA256 /td SHA256 "..\data_provider\build\bin\sysinfo.dll" + & $SIGNTOOL_EXE sign /a /tr http://timestamp.digicert.com /fd SHA256 /td SHA256 "..\shared_modules\dbsync\build\bin\dbsync.dll" + & $SIGNTOOL_EXE sign /a /tr http://timestamp.digicert.com /fd SHA256 /td SHA256 "..\shared_modules\rsync\build\bin\rsync.dll" + & $SIGNTOOL_EXE sign /a /tr http://timestamp.digicert.com /fd SHA256 /td SHA256 "..\wazuh_modules\syscollector\build\bin\syscollector.dll" + & $SIGNTOOL_EXE sign /a /tr http://timestamp.digicert.com /fd SHA256 /td SHA256 "..\syscheckd\build\bin\libfimdb.dll" + } + + Write-Host "Building MSI installer..." + + & $CANDLE_EXE -nologo .\wazuh-installer.wxs -out "wazuh-installer.wixobj" -ext WixUtilExtension -ext WixUiExtension + & $LIGHT_EXE ".\wazuh-installer.wixobj" -out $MSI_NAME -ext WixUtilExtension -ext WixUiExtension + + if($SIGN -eq "yes"){ + Write-Host "Signing $MSI_NAME..." + & $SIGNTOOL_EXE sign /a /tr http://timestamp.digicert.com /d $MSI_NAME /fd SHA256 /td SHA256 $MSI_NAME + } +} + +############################ +# MAIN +############################ + +BuildWazuhMsi diff --git a/packages/wpk/README.md b/packages/wpk/README.md new file mode 100644 index 0000000000..439916f8f6 --- /dev/null +++ b/packages/wpk/README.md @@ -0,0 +1,68 @@ +# WPK package + +In this repository, you can find the necessary tools to build a WPK package. + +## Building WPK packages + +Usage: ./generate_wpk_package.sh [OPTIONS] +It is required to use -k or --aws-wpk-key, --aws-wpk-cert parameters + + -t, --target-system [Required] Select target wpk to build [linux/windows/macos]. + -b, --branch [Required] Select Git branch. + -d, --destination [Required] Set the destination path of package. + -pn, --package-name [Required] Path to package file (rpm, deb, apk, msi, pkg) to pack in wpk. + -o, --output [Required] Name to the output package. + -k, --key-dir [Optional] Set the WPK key path to sign package. + --aws-wpk-key [Optional] AWS Secrets manager Name/ARN to get WPK private key. + --aws-wpk-cert [Optional] AWS secrets manager Name/ARN to get WPK certificate. + --aws-wpk-key-region [Optional] AWS Region where secrets are stored. + -c, --checksum [Optional] Generate checksum on destination folder. By default: no. + --dont-build-docker [Optional] Locally built docker image will be used instead of generating a new one. By default: yes. + --tag [Optional] Tag to use with the docker image. + -h, --help Show this help. + +Please, visit the following link for the full WPK packages building documentation: [Generate Wazuh WPK packages automatically.](https://documentation.wazuh.com/current/development/packaging/generate-wpk-package.html) + +## Workflows + +There are workflows to generate both the necessary Docker images and to generate the WPKs of each of the operating systems: + +- packages-upload-wpk-images.yml +It is responsible for building and uploading the images necessary for the WPK script to our ghcr bucket. The image name for all systems it is 'common_wpk_builder'. The parameters it accepts are: + - docker_image_tag: + Tag name of the Docker image to be uploaded. + Use 'developer' to set branch name as tag. + Use 'auto' to set branch version as tag. + If using a custom tag, use only '-', '_', '.' and alphanumeric characters. + Default is 'auto'. + - source_reference: + Branch from wazuh/wazuh repository to use. + +- packages-build-wpk.yml +It is responsible for generating the WPKs for each system using the generate_wpk_package script. The parameters it accepts are: + - source_reference: + Branch/tag of wazuh/wazuh to generate WPKs. + - docker_image_tag: + Specify the docker tag used to build the package. + Use 'developer' to set branch name as tag. + Use 'auto' to set branch version as tag. + Default is 'auto'. + - wpk_reference: + Package URL with the package to be packed in the WPK. + - is_stage: + Should set development/production nomenclature + True if WPK name should have production format. + False if WPK name should have developer format. + Default is 'false'. + - checksum: + Generate package checksum + Default is 'false'. + +## Contribute + +If you want to contribute to our project please don't hesitate to send a pull request. You can also join our users [mailing list](https://groups.google.com/d/forum/wazuh) by sending an email to [wazuh+subscribe@googlegroups.com](mailto:wazuh+subscribe@googlegroups.com)or join to our Slack channel by filling this [form](https://wazuh.com/community/join-us-on-slack/) to ask questions and participate in discussions. + +## License and copyright + +WAZUH +Copyright (C) 2015 Wazuh Inc. (License GPLv2) diff --git a/packages/wpk/common/Dockerfile b/packages/wpk/common/Dockerfile new file mode 100644 index 0000000000..cf76ec51e0 --- /dev/null +++ b/packages/wpk/common/Dockerfile @@ -0,0 +1,13 @@ +FROM debian:9 +RUN echo "deb http://archive.debian.org/debian stretch contrib main non-free" > /etc/apt/sources.list && \ + echo "deb http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list && \ + apt-get update && \ + apt-get -y install --allow-change-held-packages python git curl jq python3 python3-pip libffi-dev && \ + pip3 install --upgrade cryptography==2.9.2 awscli + +ADD wpkpack.py /usr/local/bin/wpkpack +ADD run.sh /usr/local/bin/run +VOLUME /var/local/wazuh +VOLUME /etc/wazuh +VOLUME /etc/wazuh/checksum +ENTRYPOINT ["/usr/local/bin/run"] diff --git a/packages/wpk/generate_wpk_package.sh b/packages/wpk/generate_wpk_package.sh new file mode 100755 index 0000000000..25302e947e --- /dev/null +++ b/packages/wpk/generate_wpk_package.sh @@ -0,0 +1,267 @@ +#!/bin/bash + +# Program to build the Wazuh WPK packages +# Wazuh package generator +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. + +CURRENT_PATH="$( cd $(dirname ${0}) ; pwd -P )" +COMMON_BUILDER="common_wpk_builder" +COMMON_BUILDER_DOCKERFILE="${CURRENT_PATH}/common" +CHECKSUM="no" + +trap ctrl_c INT + + +function pack_wpk() { + local BRANCH="${1}" + local DESTINATION="${2}" + local CONTAINER_NAME="${3}" + local PACKAGE_NAME="${4}" + local OUT_NAME="${5}" + local CHECKSUM="${6}" + local AWS_REGION="${7}" + local WPK_KEY="${8}" + local WPK_CERT="${9}" + + if [[ "${CHECKSUM}" == "yes" ]]; then + CHECKSUM_FLAG="-c" + fi + if [ -n "${KEYDIR}" ]; then + MOUNT_KEYDIR_FLAG="-v ${KEYDIR}:/etc/wazuh:Z" + fi + if [ -n "${WPK_KEY}" ]; then + WPK_KEY_FLAG="--aws-wpk-key ${WPK_KEY}" + fi + if [ -n "${WPK_CERT}" ]; then + WPK_CERT_FLAG="--aws-wpk-cert ${WPK_CERT}" + fi + + docker run -t --rm ${MOUNT_KEYDIR_FLAG} -v ${DESTINATION}:/var/local/wazuh:Z -v ${PKG_PATH}:/var/pkg:Z -v ${DESTINATION}:/var/local/checksum:Z \ + -e AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID" -e AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY" \ + ${CONTAINER_NAME}:${DOCKER_TAG} -b ${BRANCH} -o ${OUT_NAME} --aws-wpk-key-region ${AWS_REGION} ${WPK_KEY_FLAG} ${WPK_CERT_FLAG} -pn ${PACKAGE_NAME} ${CHECKSUM_FLAG} + + return $? +} + + +function build_container() { + local CONTAINER_NAME="${1}" + local DOCKERFILE_PATH="${2}" + + cp run.sh wpkpack.py ${DOCKERFILE_PATH} + docker build -t ${CONTAINER_NAME}:${DOCKER_TAG} ${DOCKERFILE_PATH} +} + + +function help() { + echo + echo "Usage: ${0} [OPTIONS]" + echo "It is required to use -k or --aws-wpk-key, --aws-wpk-cert parameters" + echo + echo " -t, --target-system [Required] Select target wpk to build [linux/windows/macos]." + echo " -b, --branch [Required] Select Git branch." + echo " -d, --destination [Required] Set the destination path of package." + echo " -pn, --package-name [Required] Path to package file (rpm, deb, apk, msi, pkg) to pack in wpk." + echo " -o, --output [Required] Name to the output package." + echo " -k, --key-dir [Optional] Set the WPK key path to sign package." + echo " --aws-wpk-key [Optional] AWS Secrets manager Name/ARN to get WPK private key." + echo " --aws-wpk-cert [Optional] AWS secrets manager Name/ARN to get WPK certificate." + echo " --aws-wpk-key-region [Optional] AWS Region where secrets are stored." + echo " -c, --checksum [Optional] Generate checksum on destination folder. By default: no." + echo " --dont-build-docker [Optional] Locally built docker image will be used instead of generating a new one. By default: yes." + echo " --tag [Optional] Tag to use with the docker image." + echo " -h, --help Show this help." + echo + exit ${1} +} + + +function clean() { + local DOCKERFILE_PATH="${1}" + local exit_code="${2}" + + rm -f ${DOCKERFILE_PATH}/*.sh ${DOCKERFILE_PATH}/wpkpack.py + + return 0 +} + + +ctrl_c() { + clean 1 +} + + +function main() { + local TARGET="" + local BRANCH="" + local DESTINATION="${CURRENT_PATH}/output" + local CONTAINER_NAME="" + local PKG_NAME="" + local OUT_NAME="" + local WPK_KEY="" + local WPK_CERT="" + local AWS_REGION="us-east-1" + local BUILD_DOCKER="yes" + local DOCKER_TAG="latest" + + local HAVE_BRANCH=false + local HAVE_DESTINATION=false + local HAVE_TARGET=false + local HAVE_KEYDIR=false + local HAVE_PKG_NAME=false + local HAVE_OUT_NAME=false + local HAVE_WPK_KEY=false + local HAVE_WPK_CERT=false + + while [ -n "${1}" ] + do + case "${1}" in + "-t"|"--target-system") + if [ -n "${2}" ]; then + if [[ "${2}" == "linux" || "${2}" == "windows" || "${2}" == "macos" ]]; then + local TARGET="${2}" + local HAVE_TARGET=true + shift 2 + else + echo "Target system must be linux, windows or macos" + help 1 + fi + else + echo "ERROR: Missing target system." + help 1 + fi + ;; + "-b"|"--branch") + if [ -n "${2}" ]; then + local BRANCH="${2}" + local HAVE_BRANCH=true + shift 2 + else + echo "ERROR: Missing branch." + help 1 + fi + ;; + "-d"|"--destination") + if [ -n "${2}" ]; then + local DESTINATION="${2}" + local HAVE_DESTINATION=true + shift 2 + else + echo "ERROR: Missing destination directory." + help 1 + fi + ;; + "-k"|"--key-dir") + if [ -n "${2}" ]; then + if [[ "${2: -1}" != "/" ]]; then + KEYDIR="${2}/" + local HAVE_KEYDIR=true + else + KEYDIR="${2}" + local HAVE_KEYDIR=true + fi + shift 2 + fi + ;; + "-pn"|"--package-name") + if [ -n "${2}" ]; then + local HAVE_PKG_NAME=true + local PKG_NAME="${2}" + PKG_PATH=`echo ${PKG_NAME}| rev|cut -d'/' -f2-|rev` + PKG_NAME=`basename ${PKG_NAME}` + shift 2 + else + echo "ERROR: Missing package file" + help 1 + fi + ;; + "-o"|"--output") + if [ -n "${2}" ]; then + local HAVE_OUT_NAME=true + local OUT_NAME="${2}" + shift 2 + else + echo "ERROR: Missing output name." + help 1 + fi + ;; + "--aws-wpk-key") + if [ -n "${2}" ]; then + local HAVE_WPK_KEY=true + local WPK_KEY="${2}" + shift 2 + fi + ;; + "--aws-wpk-cert") + if [ -n "${2}" ]; then + local HAVE_WPK_CERT=true + local WPK_CERT="${2}" + shift 2 + fi + ;; + "--aws-wpk-key-region") + if [ -n "${2}" ]; then + local AWS_REGION="${2}" + shift 2 + fi + ;; + "-c"|"--checksum") + local CHECKSUM="yes" + shift 1 + ;; + "--dont-build-docker") + BUILD_DOCKER="no" + shift 1 + ;; + "--tag") + if [ -n "$2" ]; then + DOCKER_TAG="$2" + shift 2 + else + help 1 + fi + ;; + "-h"|"--help") + help 0 + ;; + *) + help 1 + esac + done + + if [[ "${HAVE_KEYDIR}" == false && ("${HAVE_WPK_KEY}" == false || "${HAVE_WPK_CERT}" == false) ]]; then + echo "ERROR: Option -k or -wk, -wc must be set." + help 1 + fi + + if [[ "${HAVE_TARGET}" == true ]] && [[ "${HAVE_BRANCH}" == true ]] && [[ "${HAVE_DESTINATION}" == true ]] && [[ "${HAVE_OUT_NAME}" == true ]]; then + if [[ "${TARGET}" == "linux" || "${TARGET}" == "windows" || "${TARGET}" == "macos" ]]; then + if [[ "${HAVE_PKG_NAME}" == true ]]; then + if [[ "${BUILD_DOCKER}" == "yes" ]]; then + build_container ${COMMON_BUILDER} ${COMMON_BUILDER_DOCKERFILE} || clean ${COMMON_BUILDER_DOCKERFILE} 1 + fi + local CONTAINER_NAME="${COMMON_BUILDER}" + pack_wpk ${BRANCH} ${DESTINATION} ${CONTAINER_NAME} ${PKG_NAME} ${OUT_NAME} ${CHECKSUM} ${CHECKSUMDIR} ${AWS_REGION} ${WPK_KEY} ${WPK_CERT} || clean ${COMMON_BUILDER_DOCKERFILE} 1 + clean ${COMMON_BUILDER_DOCKERFILE} 0 + else + echo "ERROR: Cannot build WPK without a package." + help 1 + fi + else + echo "ERROR: Target system must be linux, windows or macos." + help 1 + fi + else + echo "ERROR: Need more parameters" + help 1 + fi + + return 0 +} + +main "$@" diff --git a/packages/wpk/run.sh b/packages/wpk/run.sh new file mode 100755 index 0000000000..299a4acaf1 --- /dev/null +++ b/packages/wpk/run.sh @@ -0,0 +1,166 @@ +#!/bin/bash +set -x +DIRECTORY="wazuh*" +REPOSITORY="https://github.com/wazuh/wazuh" +REFERENCE="" +OUT_NAME="" +CHECKSUM="no" +PKG_NAME="" +HAVE_PKG_NAME_WIN=false +HAVE_PKG_NAME_MAC=false +HAVE_PKG_NAME_LINUX=false +AWS_REGION="us-east-1" +KEYPATH="/etc/wazuh" +WPKCERT="${KEYPATH}/wpkcert.pem" +WPKKEY="${KEYPATH}/wpkcert.key" +OUTDIR="/var/local/wazuh" +CHECKSUMDIR="/var/local/checksum" + + +help() { + set +x + echo + echo "Usage: ${0} [OPTIONS]" + echo "It is required to use -k or --aws-wpk-key, --aws-wpk-cert parameters" + echo + echo " -b, --branch [Required] Select Git branch or tag e.g. master" + echo " -o, --output [Required] Name to the output package." + echo " -pn, --package-name [Required] Path to package file (rpm, deb, apk, msi, pkg) to pack in wpk." + echo " -c, --checksum [Optional] Whether Generate checksum or not." + echo " --aws-wpk-key [Optional] AWS Secrets manager Name/ARN to get WPK private key." + echo " --aws-wpk-cert [Optional] AWS secrets manager Name/ARN to get WPK certificate." + echo " --aws-wpk-key-region [Optional] AWS Region where secrets are stored." + echo " -h, --help Show this help." + echo + exit ${1} +} + +main() { + while [ -n "${1}" ] + do + case "${1}" in + "-b"|"--branch") + if [ -n "${2}" ]; then + REFERENCE="${2}" + shift 2 + else + echo "ERROR: Missing branch." + help 1 + fi + ;; + "-o"|"--output") + if [ -n "${2}" ]; then + OUT_NAME="${2}" + shift 2 + else + echo "ERROR: Missing output name." + help 1 + fi + ;; + "-pn"|"--package-name") + if [ -n "${2}" ]; then + PKG_NAME="${2}" + if [ "${PKG_NAME: -4}" == ".msi" ]; then + HAVE_PKG_NAME_WIN=true + elif [ "${PKG_NAME: -4}" == ".pkg" ]; then + HAVE_PKG_NAME_MAC=true + elif [ "${PKG_NAME: -4}" == ".rpm" ]; then + HAVE_PKG_NAME_LINUX=true + elif [ "${PKG_NAME: -4}" == ".deb" ]; then + HAVE_PKG_NAME_LINUX=true + elif [ "${PKG_NAME: -4}" == ".apk" ]; then + HAVE_PKG_NAME_LINUX=true + else + echo "ERROR: missing package file." + help 1 + fi + shift 2 + fi + ;; + "-c"|"--checksum") + CHECKSUM="yes" + shift 1 + ;; + "--aws-wpk-key") + if [ -n "${2}" ]; then + AWS_WPK_KEY="${2}" + shift 2 + fi + ;; + "--aws-wpk-cert") + if [ -n "${2}" ]; then + AWS_WPK_CERT="${2}" + shift 2 + fi + ;; + "--aws-wpk-key-region") + if [ -n "${2}" ]; then + AWS_REGION="${2}" + shift 2 + fi + ;; + "-h"|"--help") + help 0 + ;; + *) + help 1 + esac + done + + if [ -n "${AWS_WPK_CERT}" ] && [ -n "${AWS_WPK_KEY}" ]; then + mkdir -p ${KEYPATH} + aws --region=${AWS_REGION} secretsmanager get-secret-value --secret-id ${AWS_WPK_CERT} | jq . > wpkcert.pem.json + jq .SecretString wpkcert.pem.json | tr -d '"' | sed 's|\\n|\n|g' > ${WPKCERT} + rm -f wpkcert.pem.json + aws --region=${AWS_REGION} secretsmanager get-secret-value --secret-id ${AWS_WPK_KEY} | jq . > wpkcert.key.json + jq .SecretString wpkcert.key.json | tr -d '"' | sed 's|\\n|\n|g' > ${WPKKEY} + rm -f wpkcert.key.json + fi + + # Get Wazuh + curl -sL ${REPOSITORY}/tarball/${REFERENCE} | tar zx + cd ${DIRECTORY} + + # Create package + if [ -z "${OUTPUT}" ] + then + OUTPUT="${OUTDIR}/${OUT_NAME}" + mkdir -p ${OUTDIR} + fi + + # Compress and sign package + if [ "${HAVE_PKG_NAME_WIN}" == true ]; then + CURRENT_DIR=$(pwd) + echo "wpkpack ${OUTPUT} ${WPKCERT} ${WPKKEY} ${PKG_NAME} upgrade.bat do_upgrade.ps1" + cd ${OUTDIR} + cp ${CURRENT_DIR}/src/win32/{upgrade.bat,do_upgrade.ps1} . + cp /var/pkg/${PKG_NAME} ${OUTDIR} 2>/dev/null + wpkpack ${OUTPUT} ${WPKCERT} ${WPKKEY} ${PKG_NAME} upgrade.bat do_upgrade.ps1 + rm -f upgrade.bat do_upgrade.ps1 ${PKG_NAME} + elif [ "${HAVE_PKG_NAME_MAC}" == true ] || [ "${HAVE_PKG_NAME_LINUX}" == true ]; then + CURRENT_DIR=$(pwd) + echo "wpkpack ${OUTPUT} ${WPKCERT} ${WPKKEY} ${PKG_NAME} upgrade.sh pkg_installer.sh" + cd ${OUTDIR} + cp ${CURRENT_DIR}/src/init/pkg_installer.sh . + cp ${CURRENT_DIR}/upgrade.sh . + cp /var/pkg/${PKG_NAME} ${OUTDIR} 2>/dev/null + wpkpack ${OUTPUT} ${WPKCERT} ${WPKKEY} ${PKG_NAME} upgrade.sh pkg_installer.sh + rm -f upgrade.sh pkg_installer.sh ${PKG_NAME} + else + echo "ERROR: a package (MSI/PKG/RPM/DEB) is needed to build the WPK" + help 1 + fi + + echo "PACKED FILE -> ${OUTPUT}" + cd ${OUTDIR} + + if [[ ${CHECKSUM} == "yes" ]]; then + mkdir -p ${CHECKSUMDIR} + sha512sum "${OUT_NAME}" > "${CHECKSUMDIR}/${OUT_NAME}.sha512" + fi +} + +if [ "${BASH_SOURCE[0]}" = "${0}" ] +then + main "$@" +fi diff --git a/packages/wpk/wpkpack.py b/packages/wpk/wpkpack.py new file mode 100755 index 0000000000..8ae6a90021 --- /dev/null +++ b/packages/wpk/wpkpack.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python3 + +# Tool to build and compress the WPK package +# Wazuh package generator +# Copyright (C) 2015, Wazuh Inc. +# +# This program is a free software; you can redistribute it +# and/or modify it under the terms of the GNU General Public +# License (version 2) as published by the FSF - Free Software +# Foundation. + +from io import SEEK_SET, SEEK_END +from sys import argv, stderr, exit +from tempfile import mkstemp +from os import listdir, remove, close +from os.path import isfile, isdir +import gzip +from shutil import copyfileobj +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives.asymmetric import padding, utils +from cryptography.hazmat.primitives import serialization, hashes + +MAGIC = b'WPK256\0' +HASH = hashes.SHA256() +PADDING = padding.PKCS1v15() +BUFLEN = 4096 + + +def mergecreate(path, tag = None): + with open(path, 'w') as f: + if tag: + f.write('#{0}\n'.format(tag)) + + +def mergeappend(merged, sources): + with open(merged, 'ab') as f: + for s in sources: + _mergeappend(f, s) + +def _mergeappend(fm, source): + if isfile(source): + with open(source, 'rb') as fs: + fs.seek(0, SEEK_END) + size = fs.tell() + fs.seek(0, SEEK_SET) + fm.write('!{0} {1}\n'.format(size, source).encode()) + copyfileobj(fs, fm) + elif isdir(source): + for d in listdir(source): + _mergeappend(fm, '{0}/{1}'.format(source, d)) + else: + raise Exception + + +def compress(source, target): + with open(source, 'rb') as fin: + with gzip.open(target, 'wb') as fout: + copyfileobj(fin, fout) + + +def sign(source_path, target_path, cert_path, priv_path): + hasher = hashes.Hash(HASH, default_backend()) + + with open(priv_path, 'rb') as fkey: + key = serialization.load_pem_private_key(fkey.read(), password=None, backend=default_backend()) + + with open(source_path, 'rb') as filein: + buf = filein.read(BUFLEN) + + while buf: + hasher.update(buf) + buf = filein.read(BUFLEN) + + digest = hasher.finalize() + signature = key.sign(digest, PADDING, utils.Prehashed(HASH)) + + with open(target_path, 'wb') as fileout: + fileout.write(MAGIC) + + with open(cert_path, 'rb') as filecert: + copyfileobj(filecert, fileout) + + fileout.write(b'\0' + signature) + filein.seek(0, SEEK_SET) + copyfileobj(filein, fileout) + + +if __name__ == '__main__': + if len(argv) < 4: + stderr.write('Syntax: {0} [ ... ]\n'.format(argv[0])) + exit(1) + + pack = argv[1] + fd, merged = mkstemp() + close(fd) + + try: + mergecreate(merged, pack) + mergeappend(merged, argv[4:]) + except Exception as error: + remove(merged) + raise error + + fd, zipped = mkstemp() + close(fd) + compress(merged, zipped) + remove(merged) + + try: + sign(zipped, pack, argv[2], argv[3]) + finally: + remove(zipped) diff --git a/src/Doxyfile b/src/Doxyfile new file mode 100644 index 0000000000..1f8ba83c10 --- /dev/null +++ b/src/Doxyfile @@ -0,0 +1,2427 @@ +# Doxyfile 1.8.13 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "WAZUH" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = "v5.0.0-50000" + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Source code documentation" + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 0. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 0 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = YES + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. + +FILE_PATTERNS = *.c \ + *.h \ + *.cpp \ + *.hpp + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = external \ + tests + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = documentation + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = YES + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /